From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 00:26:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C1931065670; Sun, 28 Nov 2010 00:26:08 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88AF58FC0A; Sun, 28 Nov 2010 00:26:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS0Q8kE024180; Sun, 28 Nov 2010 00:26:08 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS0Q8ic024174; Sun, 28 Nov 2010 00:26:08 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201011280026.oAS0Q8ic024174@svn.freebsd.org> From: Juli Mallett Date: Sun, 28 Nov 2010 00:26:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215959 - head/sys/mips/cavium/octe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 00:26:08 -0000 Author: jmallett Date: Sun Nov 28 00:26:08 2010 New Revision: 215959 URL: http://svn.freebsd.org/changeset/base/215959 Log: Remove unused and broken code to implement POW send and POW-only devices; a separate POW driver makes more sense, generally. Modified: head/sys/mips/cavium/octe/ethernet-common.c head/sys/mips/cavium/octe/ethernet-tx.c head/sys/mips/cavium/octe/ethernet-tx.h head/sys/mips/cavium/octe/ethernet.c head/sys/mips/cavium/octe/octe.c Modified: head/sys/mips/cavium/octe/ethernet-common.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-common.c Sat Nov 27 23:48:53 2010 (r215958) +++ head/sys/mips/cavium/octe/ethernet-common.c Sun Nov 28 00:26:08 2010 (r215959) @@ -46,9 +46,6 @@ __FBSDID("$FreeBSD$"); extern int octeon_is_simulation(void); extern cvmx_bootinfo_t *octeon_bootinfo; -extern int pow_send_group; -extern int always_use_pow; -extern char pow_send_list[]; /** @@ -239,11 +236,6 @@ int cvm_oct_common_init(struct ifnet *if octeon_bootinfo->mac_addr_base[5] + count}; cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - /* Force the interface to use the POW send if always_use_pow was - specified or it is in the pow send list */ - if ((pow_send_group != -1) && (always_use_pow || strstr(pow_send_list, if_name(ifp)))) - priv->queue = -1; - ifp->if_mtu = ETHERMTU; count++; Modified: head/sys/mips/cavium/octe/ethernet-tx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-tx.c Sat Nov 27 23:48:53 2010 (r215958) +++ head/sys/mips/cavium/octe/ethernet-tx.c Sun Nov 28 00:26:08 2010 (r215959) @@ -54,8 +54,6 @@ __FBSDID("$FreeBSD$"); #define GET_MBUF_QOS(m) 0 #endif -extern int pow_send_group; - /** * Packet transmit @@ -261,132 +259,6 @@ int cvm_oct_xmit(struct mbuf *m, struct /** - * Packet transmit to the POW - * - * @param m Packet to send - * @param dev Device info structure - * @return Always returns zero - */ -int cvm_oct_xmit_pow(struct mbuf *m, struct ifnet *ifp) -{ - cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - char *packet_buffer; - char *copy_location; - - /* Get a work queue entry */ - cvmx_wqe_t *work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL); - if (__predict_false(work == NULL)) { - DEBUGPRINT("%s: Failed to allocate a work queue entry\n", if_name(ifp)); - ifp->if_oerrors++; - m_freem(m); - return 0; - } - - /* Get a packet buffer */ - packet_buffer = cvmx_fpa_alloc(CVMX_FPA_PACKET_POOL); - if (__predict_false(packet_buffer == NULL)) { - DEBUGPRINT("%s: Failed to allocate a packet buffer\n", - if_name(ifp)); - cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, DONT_WRITEBACK(1)); - ifp->if_oerrors++; - m_freem(m); - return 0; - } - - /* Calculate where we need to copy the data to. We need to leave 8 bytes - for a next pointer (unused). We also need to include any configure - skip. Then we need to align the IP packet src and dest into the same - 64bit word. The below calculation may add a little extra, but that - doesn't hurt */ - copy_location = packet_buffer + sizeof(uint64_t); - copy_location += ((CVMX_HELPER_FIRST_MBUFF_SKIP+7)&0xfff8) + 6; - - /* We have to copy the packet since whoever processes this packet - will free it to a hardware pool. We can't use the trick of - counting outstanding packets like in cvm_oct_xmit */ - m_copydata(m, 0, m->m_pkthdr.len, copy_location); - - /* Fill in some of the work queue fields. We may need to add more - if the software at the other end needs them */ -#if 0 - work->hw_chksum = m->csum; -#endif - work->len = m->m_pkthdr.len; - work->ipprt = priv->port; - work->qos = priv->port & 0x7; - work->grp = pow_send_group; - work->tag_type = CVMX_HELPER_INPUT_TAG_TYPE; - work->tag = pow_send_group; /* FIXME */ - work->word2.u64 = 0; /* Default to zero. Sets of zero later are commented out */ - work->word2.s.bufs = 1; - work->packet_ptr.u64 = 0; - work->packet_ptr.s.addr = cvmx_ptr_to_phys(copy_location); - work->packet_ptr.s.pool = CVMX_FPA_PACKET_POOL; - work->packet_ptr.s.size = CVMX_FPA_PACKET_POOL_SIZE; - work->packet_ptr.s.back = (copy_location - packet_buffer)>>7; - - panic("%s: POW transmit not quite implemented yet.", __func__); -#if 0 - if (m->protocol == htons(ETH_P_IP)) { - work->word2.s.ip_offset = 14; - #if 0 - work->word2.s.vlan_valid = 0; /* FIXME */ - work->word2.s.vlan_cfi = 0; /* FIXME */ - work->word2.s.vlan_id = 0; /* FIXME */ - work->word2.s.dec_ipcomp = 0; /* FIXME */ - #endif - work->word2.s.tcp_or_udp = (ip_hdr(m)->protocol == IP_PROTOCOL_TCP) || (ip_hdr(m)->protocol == IP_PROTOCOL_UDP); - #if 0 - work->word2.s.dec_ipsec = 0; /* FIXME */ - work->word2.s.is_v6 = 0; /* We only support IPv4 right now */ - work->word2.s.software = 0; /* Hardware would set to zero */ - work->word2.s.L4_error = 0; /* No error, packet is internal */ - #endif - work->word2.s.is_frag = !((ip_hdr(m)->frag_off == 0) || (ip_hdr(m)->frag_off == 1<<14)); - #if 0 - work->word2.s.IP_exc = 0; /* Assume Linux is sending a good packet */ - #endif - work->word2.s.is_bcast = (m->pkt_type == PACKET_BROADCAST); - work->word2.s.is_mcast = (m->pkt_type == PACKET_MULTICAST); - #if 0 - work->word2.s.not_IP = 0; /* This is an IP packet */ - work->word2.s.rcv_error = 0; /* No error, packet is internal */ - work->word2.s.err_code = 0; /* No error, packet is internal */ - #endif - - /* When copying the data, include 4 bytes of the ethernet header to - align the same way hardware does */ - memcpy(work->packet_data, m->data + 10, sizeof(work->packet_data)); - } else { - #if 0 - work->word2.snoip.vlan_valid = 0; /* FIXME */ - work->word2.snoip.vlan_cfi = 0; /* FIXME */ - work->word2.snoip.vlan_id = 0; /* FIXME */ - work->word2.snoip.software = 0; /* Hardware would set to zero */ - #endif - work->word2.snoip.is_rarp = m->protocol == htons(ETH_P_RARP); - work->word2.snoip.is_arp = m->protocol == htons(ETH_P_ARP); - work->word2.snoip.is_bcast = (m->pkt_type == PACKET_BROADCAST); - work->word2.snoip.is_mcast = (m->pkt_type == PACKET_MULTICAST); - work->word2.snoip.not_IP = 1; /* IP was done up above */ - #if 0 - work->word2.snoip.rcv_error = 0; /* No error, packet is internal */ - work->word2.snoip.err_code = 0; /* No error, packet is internal */ - #endif - memcpy(work->packet_data, m->data, sizeof(work->packet_data)); - } -#endif - - /* Submit the packet to the POW */ - cvmx_pow_work_submit(work, work->tag, work->tag_type, work->qos, work->grp); - ifp->if_opackets++; - ifp->if_obytes += m->m_pkthdr.len; - m_freem(m); - return 0; -} - - -/** * This function frees all mbufs that are currenty queued for TX. * * @param dev Device being shutdown Modified: head/sys/mips/cavium/octe/ethernet-tx.h ============================================================================== --- head/sys/mips/cavium/octe/ethernet-tx.h Sat Nov 27 23:48:53 2010 (r215958) +++ head/sys/mips/cavium/octe/ethernet-tx.h Sun Nov 28 00:26:08 2010 (r215959) @@ -29,6 +29,5 @@ AND WITH ALL FAULTS AND CAVIUM NETWORKS /* $FreeBSD$ */ int cvm_oct_xmit(struct mbuf *m, struct ifnet *ifp); -int cvm_oct_xmit_pow(struct mbuf *m, struct ifnet *ifp); void cvm_oct_tx_shutdown(struct ifnet *ifp); Modified: head/sys/mips/cavium/octe/ethernet.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet.c Sat Nov 27 23:48:53 2010 (r215958) +++ head/sys/mips/cavium/octe/ethernet.c Sun Nov 28 00:26:08 2010 (r215959) @@ -74,36 +74,6 @@ TUNABLE_INT("hw.octe.pow_receive_group", "\t\tgroup. Also any other software can submit packets to this\n" "\t\tgroup for the kernel to process." */ -int pow_send_group = -1; /* XXX Should be a sysctl. */ -TUNABLE_INT("hw.octe.pow_send_group", &pow_send_group); -/* - "\t\tPOW group to send packets to other software on. This\n" - "\t\tcontrols the creation of the virtual device pow0.\n" - "\t\talways_use_pow also depends on this value." */ - -int always_use_pow; -TUNABLE_INT("hw.octe.always_use_pow", &always_use_pow); -/* - "\t\tWhen set, always send to the pow group. This will cause\n" - "\t\tpackets sent to real ethernet devices to be sent to the\n" - "\t\tPOW group instead of the hardware. Unless some other\n" - "\t\tapplication changes the config, packets will still be\n" - "\t\treceived from the low level hardware. Use this option\n" - "\t\tto allow a CVMX app to intercept all packets from the\n" - "\t\tlinux kernel. You must specify pow_send_group along with\n" - "\t\tthis option." */ - -char pow_send_list[128] = ""; -TUNABLE_STR("hw.octe.pow_send_list", pow_send_list, sizeof pow_send_list); -/* - "\t\tComma separated list of ethernet devices that should use the\n" - "\t\tPOW for transmit instead of the actual ethernet hardware. This\n" - "\t\tis a per port version of always_use_pow. always_use_pow takes\n" - "\t\tprecedence over this list. For example, setting this to\n" - "\t\t\"eth2,spi3,spi7\" would cause these three devices to transmit\n" - "\t\tusing the pow_send_group." */ - - static int disable_core_queueing = 1; TUNABLE_INT("hw.octe.disable_core_queueing", &disable_core_queueing); /* @@ -148,16 +118,10 @@ static void cvm_oct_update_link(void *co if (link_info.s.link_up) { if_link_state_change(ifp, LINK_STATE_UP); - if (priv->queue != -1) - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, queue %2d\n", - if_name(ifp), link_info.s.speed, - (link_info.s.full_duplex) ? "Full" : "Half", - priv->port, priv->queue); - else - DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n", - if_name(ifp), link_info.s.speed, - (link_info.s.full_duplex) ? "Full" : "Half", - priv->port); + DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, queue %2d\n", + if_name(ifp), link_info.s.speed, + (link_info.s.full_duplex) ? "Full" : "Half", + priv->port, priv->queue); } else { if_link_state_change(ifp, LINK_STATE_DOWN); DEBUGPRINT("%s: Link down\n", if_name(ifp)); @@ -382,44 +346,6 @@ int cvm_oct_init_module(device_t bus) /* Initialize the FAU used for counting packet buffers that need to be freed */ cvmx_fau_atomic_write32(FAU_NUM_PACKET_BUFFERS_TO_FREE, 0); - if ((pow_send_group != -1)) { - struct ifnet *ifp; - - printf("\tConfiguring device for POW only access\n"); - dev = BUS_ADD_CHILD(bus, 0, "pow", 0); - if (dev != NULL) - ifp = if_alloc(IFT_ETHER); - if (dev != NULL && ifp != NULL) { - /* Initialize the device private structure. */ - cvm_oct_private_t *priv; - - device_probe(dev); - priv = device_get_softc(dev); - priv->dev = dev; - priv->ifp = ifp; - priv->init = cvm_oct_common_init; - priv->imode = CVMX_HELPER_INTERFACE_MODE_DISABLED; - priv->port = CVMX_PIP_NUM_INPUT_PORTS; - priv->queue = -1; - TASK_INIT(&priv->link_task, 0, cvm_oct_update_link, priv); - - device_set_desc(dev, "Cavium Octeon POW Ethernet\n"); - - ifp->if_softc = priv; - - if (priv->init(ifp) < 0) { - printf("\t\tFailed to register ethernet device for POW\n"); - panic("%s: need to free ifp.", __func__); - } else { - cvm_oct_device[CVMX_PIP_NUM_INPUT_PORTS] = ifp; - printf("\t\t%s: POW send group %d, receive group %d\n", - if_name(ifp), pow_send_group, pow_receive_group); - } - } else { - printf("\t\tFailed to allocate ethernet device for POW\n"); - } - } - ifnum = 0; num_interfaces = cvmx_helper_get_number_of_interfaces(); for (interface = 0; interface < num_interfaces; interface++) { Modified: head/sys/mips/cavium/octe/octe.c ============================================================================== --- head/sys/mips/cavium/octe/octe.c Sat Nov 27 23:48:53 2010 (r215958) +++ head/sys/mips/cavium/octe/octe.c Sun Nov 28 00:26:08 2010 (r215959) @@ -125,16 +125,6 @@ static devclass_t octe_devclass; DRIVER_MODULE(octe, octebus, octe_driver, octe_devclass, 0, 0); DRIVER_MODULE(miibus, octe, miibus_driver, miibus_devclass, 0, 0); -static driver_t pow_driver = { - "pow", - octe_methods, - sizeof (cvm_oct_private_t), -}; - -static devclass_t pow_devclass; - -DRIVER_MODULE(pow, octebus, pow_driver, pow_devclass, 0, 0); - static int octe_probe(device_t dev) { @@ -322,7 +312,6 @@ static int octe_transmit(struct ifnet *ifp, struct mbuf *m) { cvm_oct_private_t *priv; - int error; priv = ifp->if_softc; @@ -332,12 +321,7 @@ octe_transmit(struct ifnet *ifp, struct return (0); } - if (priv->queue != -1) { - error = cvm_oct_xmit(m, ifp); - } else { - error = cvm_oct_xmit_pow(m, ifp); - } - return (error); + return (cvm_oct_xmit(m, ifp)); } static int From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 00:52:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0369B1065694; Sun, 28 Nov 2010 00:52:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E60BE8FC08; Sun, 28 Nov 2010 00:52:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS0q27w026929; Sun, 28 Nov 2010 00:52:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS0q2ux026927; Sun, 28 Nov 2010 00:52:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011280052.oAS0q2ux026927@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 28 Nov 2010 00:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215960 - head/sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 00:52:03 -0000 Author: yongari Date: Sun Nov 28 00:52:02 2010 New Revision: 215960 URL: http://svn.freebsd.org/changeset/base/215960 Log: Apply GPIO configuration for all CICADA PHYs. While I'm here show selected phymode to ease of debugging. Modified: head/sys/dev/usb/net/if_axe.c Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Sun Nov 28 00:26:08 2010 (r215959) +++ head/sys/dev/usb/net/if_axe.c Sun Nov 28 00:52:02 2010 (r215960) @@ -536,8 +536,9 @@ axe_ax88178_init(struct axe_softc *sc) } if (bootverbose) - device_printf(sc->sc_ue.ue_dev, "EEPROM data : 0x%04x\n", - eeprom); + device_printf(sc->sc_ue.ue_dev, + "EEPROM data : 0x%04x, phymode : 0x%02x\n", eeprom, + phymode); /* Program GPIOs depending on PHY hardware. */ switch (phymode) { case AXE_PHY_MODE_MARVELL: @@ -554,6 +555,8 @@ axe_ax88178_init(struct axe_softc *sc) AXE_GPIO1_EN, hz / 32); break; case AXE_PHY_MODE_CICADA: + case AXE_PHY_MODE_CICADA_V2: + case AXE_PHY_MODE_CICADA_V2_ASIX: if (gpio0 == 1) AXE_GPIO_WRITE(AXE_GPIO_RELOAD_EEPROM | AXE_GPIO0 | AXE_GPIO0_EN, hz / 32); From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 00:57:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4986A1065670; Sun, 28 Nov 2010 00:57:49 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37EDA8FC15; Sun, 28 Nov 2010 00:57:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS0vn8h027475; Sun, 28 Nov 2010 00:57:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS0vnHS027473; Sun, 28 Nov 2010 00:57:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011280057.oAS0vnHS027473@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 28 Nov 2010 00:57:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215962 - head/sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 00:57:49 -0000 Author: yongari Date: Sun Nov 28 00:57:48 2010 New Revision: 215962 URL: http://svn.freebsd.org/changeset/base/215962 Log: Move axe_reset() to axe_init(). Modified: head/sys/dev/usb/net/if_axe.c Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Sun Nov 28 00:53:43 2010 (r215961) +++ head/sys/dev/usb/net/if_axe.c Sun Nov 28 00:57:48 2010 (r215962) @@ -1022,6 +1022,8 @@ axe_init(struct usb_ether *ue) /* Cancel pending I/O */ axe_stop(ue); + axe_reset(sc); + /* Set MAC address. */ if (sc->sc_flags & (AXE_FLAG_178 | AXE_FLAG_772)) axe_cmd(sc, AXE_178_CMD_WRITE_NODEID, 0, 0, IF_LLADDR(ifp)); @@ -1110,6 +1112,4 @@ axe_stop(struct usb_ether *ue) */ usbd_transfer_stop(sc->sc_xfer[AXE_BULK_DT_WR]); usbd_transfer_stop(sc->sc_xfer[AXE_BULK_DT_RD]); - - axe_reset(sc); } From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 01:00:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EE6E106566B; Sun, 28 Nov 2010 01:00:39 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D7EB8FC0C; Sun, 28 Nov 2010 01:00:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS10doH027738; Sun, 28 Nov 2010 01:00:39 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS10dCk027736; Sun, 28 Nov 2010 01:00:39 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011280100.oAS10dCk027736@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 28 Nov 2010 01:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215963 - head/sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 01:00:39 -0000 Author: yongari Date: Sun Nov 28 01:00:39 2010 New Revision: 215963 URL: http://svn.freebsd.org/changeset/base/215963 Log: Do not reinitialize controller if it's already running. Modified: head/sys/dev/usb/net/if_axe.c Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Sun Nov 28 00:57:48 2010 (r215962) +++ head/sys/dev/usb/net/if_axe.c Sun Nov 28 01:00:39 2010 (r215963) @@ -1019,6 +1019,9 @@ axe_init(struct usb_ether *ue) AXE_LOCK_ASSERT(sc, MA_OWNED); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + /* Cancel pending I/O */ axe_stop(ue); From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 01:03:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8735F1065785; Sun, 28 Nov 2010 01:03:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75D2F8FC16; Sun, 28 Nov 2010 01:03:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS136cs027968; Sun, 28 Nov 2010 01:03:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS136EO027966; Sun, 28 Nov 2010 01:03:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011280103.oAS136EO027966@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 28 Nov 2010 01:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215964 - head/sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 01:03:06 -0000 Author: yongari Date: Sun Nov 28 01:03:06 2010 New Revision: 215964 URL: http://svn.freebsd.org/changeset/base/215964 Log: Make sure to change to currently selected media. Modified: head/sys/dev/usb/net/if_axe.c Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Sun Nov 28 01:00:39 2010 (r215963) +++ head/sys/dev/usb/net/if_axe.c Sun Nov 28 01:03:06 2010 (r215964) @@ -1074,6 +1074,8 @@ axe_init(struct usb_ether *ue) usbd_xfer_set_stall(sc->sc_xfer[AXE_BULK_DT_WR]); ifp->if_drv_flags |= IFF_DRV_RUNNING; + /* Switch to selected media. */ + axe_ifmedia_upd(ifp); axe_start(ue); } From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 01:16:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6872F106566C; Sun, 28 Nov 2010 01:16:37 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 570B68FC16; Sun, 28 Nov 2010 01:16:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS1GbVI029267; Sun, 28 Nov 2010 01:16:37 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS1GbZ4029265; Sun, 28 Nov 2010 01:16:37 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011280116.oAS1GbZ4029265@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 28 Nov 2010 01:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215966 - head/sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 01:16:37 -0000 Author: yongari Date: Sun Nov 28 01:16:37 2010 New Revision: 215966 URL: http://svn.freebsd.org/changeset/base/215966 Log: Do full controller initialization in axe_reset() for controllers that require special configuration from EEPROM. This will put controllers into known sane state. Modified: head/sys/dev/usb/net/if_axe.c Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Sun Nov 28 01:08:42 2010 (r215965) +++ head/sys/dev/usb/net/if_axe.c Sun Nov 28 01:16:37 2010 (r215966) @@ -671,6 +671,12 @@ axe_reset(struct axe_softc *sc) /* Wait a little while for the chip to get its brains in order. */ uether_pause(&sc->sc_ue, hz / 100); + + /* Reinitialize controller to achieve full reset. */ + if (sc->sc_flags & AXE_FLAG_178) + axe_ax88178_init(sc); + else if (sc->sc_flags & AXE_FLAG_772) + axe_ax88772_init(sc); } static void From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 01:43:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28147106566B; Sun, 28 Nov 2010 01:43:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 163AC8FC08; Sun, 28 Nov 2010 01:43:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS1hSAT032004; Sun, 28 Nov 2010 01:43:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS1hSRI032001; Sun, 28 Nov 2010 01:43:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011280143.oAS1hSRI032001@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 28 Nov 2010 01:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215968 - head/sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 01:43:29 -0000 Author: yongari Date: Sun Nov 28 01:43:28 2010 New Revision: 215968 URL: http://svn.freebsd.org/changeset/base/215968 Log: Introduce new macro AXE_IS_178_FAMILY and AXE_IS_772. Include AX88772A and AX88772B for future extension. While here add TX buffer size for 178 family controllers. Modified: head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_axereg.h Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Sun Nov 28 01:18:11 2010 (r215967) +++ head/sys/dev/usb/net/if_axe.c Sun Nov 28 01:43:28 2010 (r215968) @@ -302,7 +302,7 @@ axe_miibus_readreg(device_t dev, int phy axe_cmd(sc, AXE_CMD_MII_OPMODE_HW, 0, 0, NULL); val = le16toh(val); - if ((sc->sc_flags & AXE_FLAG_772) != 0 && reg == MII_BMSR) { + if (AXE_IS_772(sc) && reg == MII_BMSR) { /* * BMSR of AX88772 indicates that it supports extended * capability but the extended status register is @@ -384,7 +384,7 @@ axe_miibus_statchg(device_t dev) val = 0; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) val |= AXE_MEDIA_FULL_DUPLEX; - if (sc->sc_flags & (AXE_FLAG_178 | AXE_FLAG_772)) { + if (AXE_IS_178_FAMILY(sc)) { val |= AXE_178_MEDIA_RX_EN | AXE_178_MEDIA_MAGIC; if ((sc->sc_flags & AXE_FLAG_178) != 0) val |= AXE_178_MEDIA_ENCK; @@ -700,15 +700,18 @@ axe_attach_post(struct usb_ether *ue) sc->sc_phyno = 0; } - if (sc->sc_flags & AXE_FLAG_178) + if (sc->sc_flags & AXE_FLAG_178) { axe_ax88178_init(sc); - else if (sc->sc_flags & AXE_FLAG_772) + sc->sc_tx_bufsz = 16 * 1024; + } else if (sc->sc_flags & AXE_FLAG_772) { axe_ax88772_init(sc); + sc->sc_tx_bufsz = 8 * 1024; + } /* * Get station address. */ - if (sc->sc_flags & (AXE_FLAG_178 | AXE_FLAG_772)) + if (AXE_IS_178_FAMILY(sc)) axe_cmd(sc, AXE_178_CMD_READ_NODEID, 0, 0, ue->ue_eaddr); else axe_cmd(sc, AXE_172_CMD_READ_NODEID, 0, 0, ue->ue_eaddr); @@ -819,7 +822,7 @@ axe_bulk_read_callback(struct usb_xfer * err = 0; pc = usbd_xfer_get_frame(xfer, 0); - if (sc->sc_flags & (AXE_FLAG_772 | AXE_FLAG_178)) { + if (AXE_IS_178_FAMILY(sc)) { while (pos < actlen) { if ((pos + sizeof(hdr)) > actlen) { /* too little data */ @@ -916,7 +919,7 @@ tr_setup: if (m->m_pkthdr.len > MCLBYTES) { m->m_pkthdr.len = MCLBYTES; } - if (sc->sc_flags & (AXE_FLAG_772 | AXE_FLAG_178)) { + if (AXE_IS_178_FAMILY(sc)) { hdr.len = htole16(m->m_pkthdr.len); hdr.ilen = ~hdr.len; @@ -955,7 +958,7 @@ tr_setup: m_freem(m); - if (sc->sc_flags & (AXE_FLAG_772 | AXE_FLAG_178)) { + if (AXE_IS_178_FAMILY(sc)) { if (pos > (AXE_BULK_BUF_SIZE - MCLBYTES - sizeof(hdr))) { /* send out frame(s) */ break; @@ -1034,16 +1037,16 @@ axe_init(struct usb_ether *ue) axe_reset(sc); /* Set MAC address. */ - if (sc->sc_flags & (AXE_FLAG_178 | AXE_FLAG_772)) + if (AXE_IS_178_FAMILY(sc)) axe_cmd(sc, AXE_178_CMD_WRITE_NODEID, 0, 0, IF_LLADDR(ifp)); else axe_cmd(sc, AXE_172_CMD_WRITE_NODEID, 0, 0, IF_LLADDR(ifp)); /* Set transmitter IPG values */ - if (sc->sc_flags & (AXE_FLAG_178 | AXE_FLAG_772)) { + if (AXE_IS_178_FAMILY(sc)) axe_cmd(sc, AXE_178_CMD_WRITE_IPG012, sc->sc_ipgs[2], (sc->sc_ipgs[1] << 8) | (sc->sc_ipgs[0]), NULL); - } else { + else { axe_cmd(sc, AXE_172_CMD_WRITE_IPG0, 0, sc->sc_ipgs[0], NULL); axe_cmd(sc, AXE_172_CMD_WRITE_IPG1, 0, sc->sc_ipgs[1], NULL); axe_cmd(sc, AXE_172_CMD_WRITE_IPG2, 0, sc->sc_ipgs[2], NULL); @@ -1051,7 +1054,7 @@ axe_init(struct usb_ether *ue) /* Enable receiver, set RX mode */ rxmode = (AXE_RXCMD_MULTICAST | AXE_RXCMD_ENABLE); - if (sc->sc_flags & (AXE_FLAG_178 | AXE_FLAG_772)) { + if (AXE_IS_178_FAMILY(sc)) { #if 0 rxmode |= AXE_178_RXCMD_MFB_2048; /* chip default */ #else Modified: head/sys/dev/usb/net/if_axereg.h ============================================================================== --- head/sys/dev/usb/net/if_axereg.h Sun Nov 28 01:18:11 2010 (r215967) +++ head/sys/dev/usb/net/if_axereg.h Sun Nov 28 01:43:28 2010 (r215968) @@ -203,12 +203,22 @@ struct axe_softc { int sc_flags; #define AXE_FLAG_LINK 0x0001 #define AXE_FLAG_772 0x1000 /* AX88772 */ -#define AXE_FLAG_178 0x2000 /* AX88178 */ +#define AXE_FLAG_772A 0x2000 /* AX88772A */ +#define AXE_FLAG_772B 0x4000 /* AX88772B */ +#define AXE_FLAG_178 0x8000 /* AX88178 */ uint8_t sc_ipgs[3]; uint8_t sc_phyaddrs[2]; + int sc_tx_bufsz; }; +#define AXE_IS_178_FAMILY(sc) \ + ((sc)->sc_flags & (AXE_FLAG_772 | AXE_FLAG_772A | AXE_FLAG_772B | \ + AXE_FLAG_178)) + +#define AXE_IS_772(sc) \ + ((sc)->sc_flags & (AXE_FLAG_772 | AXE_FLAG_772A | AXE_FLAG_772B)) + #define AXE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define AXE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define AXE_LOCK_ASSERT(_sc, t) mtx_assert(&(_sc)->sc_mtx, t) From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 01:56:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAD8A1065670; Sun, 28 Nov 2010 01:56:44 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D90178FC13; Sun, 28 Nov 2010 01:56:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS1uii8033221; Sun, 28 Nov 2010 01:56:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS1ui3P033218; Sun, 28 Nov 2010 01:56:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011280156.oAS1ui3P033218@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 28 Nov 2010 01:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215969 - head/sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 01:56:45 -0000 Author: yongari Date: Sun Nov 28 01:56:44 2010 New Revision: 215969 URL: http://svn.freebsd.org/changeset/base/215969 Log: Add initial AX88772A support. H/W donated by: Derrick Brashear (shadow <> gmail dot com) Modified: head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_axereg.h Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Sun Nov 28 01:43:28 2010 (r215968) +++ head/sys/dev/usb/net/if_axe.c Sun Nov 28 01:56:44 2010 (r215969) @@ -142,11 +142,11 @@ static const struct usb_device_id axe_de AXE_DEV(ASIX, AX88172, 0), AXE_DEV(ASIX, AX88178, AXE_FLAG_178), AXE_DEV(ASIX, AX88772, AXE_FLAG_772), - AXE_DEV(ASIX, AX88772A, AXE_FLAG_772), + AXE_DEV(ASIX, AX88772A, AXE_FLAG_772A), AXE_DEV(ATEN, UC210T, 0), AXE_DEV(BELKIN, F5D5055, AXE_FLAG_178), AXE_DEV(BILLIONTON, USB2AR, 0), - AXE_DEV(CISCOLINKSYS, USB200MV2, AXE_FLAG_772), + AXE_DEV(CISCOLINKSYS, USB200MV2, AXE_FLAG_772A), AXE_DEV(COREGA, FETHER_USB2_TX, 0), AXE_DEV(DLINK, DUBE100, 0), AXE_DEV(DLINK, DUBE100B1, AXE_FLAG_772), @@ -191,6 +191,7 @@ static void axe_ifmedia_sts(struct ifnet static int axe_cmd(struct axe_softc *, int, int, int, void *); static void axe_ax88178_init(struct axe_softc *); static void axe_ax88772_init(struct axe_softc *); +static void axe_ax88772a_init(struct axe_softc *); static int axe_get_phyno(struct axe_softc *, int); static const struct usb_config axe_config[AXE_N_TRANSFER] = { @@ -613,7 +614,6 @@ axe_ax88178_init(struct axe_softc *sc) axe_cmd(sc, AXE_CMD_RXCTL_WRITE, 0, 0, NULL); } -#undef AXE_GPIO_WRITE static void axe_ax88772_init(struct axe_softc *sc) @@ -657,6 +657,47 @@ axe_ax88772_init(struct axe_softc *sc) } static void +axe_ax88772a_init(struct axe_softc *sc) +{ + struct usb_ether *ue; + uint16_t eeprom; + + ue = &sc->sc_ue; + axe_cmd(sc, AXE_CMD_SROM_READ, 0, 0x0017, &eeprom); + eeprom = le16toh(eeprom); + /* Reload EEPROM. */ + AXE_GPIO_WRITE(AXE_GPIO_RELOAD_EEPROM, hz / 32); + if (sc->sc_phyno == AXE_772_PHY_NO_EPHY) { + /* Manually select internal(embedded) PHY - MAC mode. */ + axe_cmd(sc, AXE_CMD_SW_PHY_SELECT, 0, AXE_SW_PHY_SELECT_SS_ENB | + AXE_SW_PHY_SELECT_EMBEDDED | AXE_SW_PHY_SELECT_SS_MII, + NULL); + uether_pause(&sc->sc_ue, hz / 32); + } else { + /* + * Manually select external PHY - MAC mode. + * Reverse MII/RMII is for AX88772A PHY mode. + */ + axe_cmd(sc, AXE_CMD_SW_PHY_SELECT, 0, AXE_SW_PHY_SELECT_SS_ENB | + AXE_SW_PHY_SELECT_EXT | AXE_SW_PHY_SELECT_SS_MII, NULL); + uether_pause(&sc->sc_ue, hz / 32); + } + /* Take PHY out of power down. */ + axe_cmd(sc, AXE_CMD_SW_RESET_REG, 0, AXE_SW_RESET_IPPD | + AXE_SW_RESET_IPRL, NULL); + uether_pause(&sc->sc_ue, hz / 4); + axe_cmd(sc, AXE_CMD_SW_RESET_REG, 0, AXE_SW_RESET_IPRL, NULL); + uether_pause(&sc->sc_ue, hz); + axe_cmd(sc, AXE_CMD_SW_RESET_REG, 0, AXE_SW_RESET_CLEAR, NULL); + uether_pause(&sc->sc_ue, hz / 32); + axe_cmd(sc, AXE_CMD_SW_RESET_REG, 0, AXE_SW_RESET_IPRL, NULL); + uether_pause(&sc->sc_ue, hz / 32); + axe_cmd(sc, AXE_CMD_RXCTL_WRITE, 0, 0, NULL); +} + +#undef AXE_GPIO_WRITE + +static void axe_reset(struct axe_softc *sc) { struct usb_config_descriptor *cd; @@ -677,6 +718,8 @@ axe_reset(struct axe_softc *sc) axe_ax88178_init(sc); else if (sc->sc_flags & AXE_FLAG_772) axe_ax88772_init(sc); + else if (sc->sc_flags & AXE_FLAG_772A) + axe_ax88772a_init(sc); } static void @@ -706,6 +749,9 @@ axe_attach_post(struct usb_ether *ue) } else if (sc->sc_flags & AXE_FLAG_772) { axe_ax88772_init(sc); sc->sc_tx_bufsz = 8 * 1024; + } else if (sc->sc_flags & AXE_FLAG_772A) { + axe_ax88772a_init(sc); + sc->sc_tx_bufsz = 8 * 1024; } /* @@ -719,7 +765,13 @@ axe_attach_post(struct usb_ether *ue) /* * Fetch IPG values. */ - axe_cmd(sc, AXE_CMD_READ_IPG012, 0, 0, sc->sc_ipgs); + if (sc->sc_flags & AXE_FLAG_772A) { + /* Set IPG values. */ + sc->sc_ipgs[0] = 0x15; + sc->sc_ipgs[1] = 0x16; + sc->sc_ipgs[2] = 0x1A; + } else + axe_cmd(sc, AXE_CMD_READ_IPG012, 0, 0, sc->sc_ipgs); } /* Modified: head/sys/dev/usb/net/if_axereg.h ============================================================================== --- head/sys/dev/usb/net/if_axereg.h Sun Nov 28 01:43:28 2010 (r215968) +++ head/sys/dev/usb/net/if_axereg.h Sun Nov 28 01:56:44 2010 (r215969) @@ -92,6 +92,10 @@ #define AXE_CMD_SW_PHY_STATUS 0x0021 #define AXE_CMD_SW_PHY_SELECT 0x0122 +/* AX88772A and AX88772B only. */ +#define AXE_CMD_READ_VLAN_CTRL 0x4027 +#define AXE_CMD_WRITE_VLAN_CTRL 0x4028 + #define AXE_SW_RESET_CLEAR 0x00 #define AXE_SW_RESET_RR 0x01 #define AXE_SW_RESET_RT 0x02 @@ -172,6 +176,21 @@ #define AXE_PHY_MODE_REALTEK_8251CL 0x0E #define AXE_PHY_MODE_ATTANSIC 0x40 +/* AX88772A only. */ +#define AXE_SW_PHY_SELECT_EXT 0x0000 +#define AXE_SW_PHY_SELECT_EMBEDDED 0x0001 +#define AXE_SW_PHY_SELECT_AUTO 0x0002 +#define AXE_SW_PHY_SELECT_SS_MII 0x0004 +#define AXE_SW_PHY_SELECT_SS_RVRS_MII 0x0008 +#define AXE_SW_PHY_SELECT_SS_RVRS_RMII 0x000C +#define AXE_SW_PHY_SELECT_SS_ENB 0x0010 + +/* AX88772A/AX88772B VLAN control. */ +#define AXE_VLAN_CTRL_ENB 0x00001000 +#define AXE_VLAN_CTRL_STRIP 0x00002000 +#define AXE_VLAN_CTRL_VID1_MASK 0x00000FFF +#define AXE_VLAN_CTRL_VID2_MASK 0x0FFF0000 + #define AXE_BULK_BUF_SIZE 16384 /* bytes */ #define AXE_CTL_READ 0x01 From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 04:07:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 258D51065670; Sun, 28 Nov 2010 04:07:46 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 146A18FC08; Sun, 28 Nov 2010 04:07:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS47jEY047849; Sun, 28 Nov 2010 04:07:45 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS47j1e047847; Sun, 28 Nov 2010 04:07:45 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201011280407.oAS47j1e047847@svn.freebsd.org> From: Juli Mallett Date: Sun, 28 Nov 2010 04:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215971 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 04:07:46 -0000 Author: jmallett Date: Sun Nov 28 04:07:45 2010 New Revision: 215971 URL: http://svn.freebsd.org/changeset/base/215971 Log: Set MACHINE_ARCH based on ABI and endianness. Reviewed by: imp Modified: head/sys/mips/include/param.h Modified: head/sys/mips/include/param.h ============================================================================== --- head/sys/mips/include/param.h Sun Nov 28 03:41:32 2010 (r215970) +++ head/sys/mips/include/param.h Sun Nov 28 04:07:45 2010 (r215971) @@ -57,7 +57,23 @@ #define MACHINE "mips" #endif #ifndef MACHINE_ARCH -#define MACHINE_ARCH "mips" +#if _BYTE_ORDER == _BIG_ENDIAN +#ifdef __mips_n64 +#define MACHINE_ARCH "mips64eb" +#elif defined(__mips_n32) +#define MACHINE_ARCH "mipsn32eb" +#else +#define MACHINE_ARCH "mipseb" +#endif +#else +#ifdef __mips_n64 +#define MACHINE_ARCH "mips64el" +#elif defined(__mips_n32) +#define MACHINE_ARCH "mipsn32el" +#else +#define MACHINE_ARCH "mipsel" +#endif +#endif #endif /* From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 05:51:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 833FB106564A; Sun, 28 Nov 2010 05:51:31 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5643B8FC0C; Sun, 28 Nov 2010 05:51:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS5pVqH058037; Sun, 28 Nov 2010 05:51:31 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS5pV4C058033; Sun, 28 Nov 2010 05:51:31 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201011280551.oAS5pV4C058033@svn.freebsd.org> From: "Jayachandran C." Date: Sun, 28 Nov 2010 05:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215973 - in head/sys: mips/mips vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 05:51:31 -0000 Author: jchandra Date: Sun Nov 28 05:51:31 2010 New Revision: 215973 URL: http://svn.freebsd.org/changeset/base/215973 Log: Fix issue noted by alc while reviewing r215938: The current implementation of vm_page_alloc_freelist() does not handle order > 0 correctly. Remove order parameter to the function and use it only for order 0 pages. Submitted by: alc Modified: head/sys/mips/mips/pmap.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sun Nov 28 04:55:31 2010 (r215972) +++ head/sys/mips/mips/pmap.c Sun Nov 28 05:51:31 2010 (r215973) @@ -1077,7 +1077,7 @@ pmap_alloc_pte_page(unsigned int index, { vm_page_t m; - m = vm_page_alloc_freelist(VM_FREELIST_DIRECT, 0, req); + m = vm_page_alloc_freelist(VM_FREELIST_DIRECT, req); if (m == NULL) return (NULL); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Nov 28 04:55:31 2010 (r215972) +++ head/sys/vm/vm_page.c Sun Nov 28 05:51:31 2010 (r215973) @@ -1409,12 +1409,12 @@ vm_page_alloc_init(vm_page_t m) /* * vm_page_alloc_freelist: * - * Allocate a page from the specified freelist with specified order. + * Allocate a page from the specified freelist. * Only the ALLOC_CLASS values in req are honored, other request flags * are ignored. */ vm_page_t -vm_page_alloc_freelist(int flind, int order, int req) +vm_page_alloc_freelist(int flind, int req) { struct vnode *drop; vm_page_t m; @@ -1431,7 +1431,7 @@ vm_page_alloc_freelist(int flind, int or cnt.v_free_count + cnt.v_cache_count > cnt.v_interrupt_free_min) || (page_req == VM_ALLOC_INTERRUPT && cnt.v_free_count + cnt.v_cache_count > 0)) { - m = vm_phys_alloc_freelist_pages(flind, VM_FREEPOOL_DIRECT, order); + m = vm_phys_alloc_freelist_pages(flind, VM_FREEPOOL_DIRECT, 0); } if (m == NULL) { mtx_unlock(&vm_page_queue_free_mtx); Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sun Nov 28 04:55:31 2010 (r215972) +++ head/sys/vm/vm_page.h Sun Nov 28 05:51:31 2010 (r215973) @@ -340,7 +340,7 @@ void vm_pageq_remove(vm_page_t m); void vm_page_activate (vm_page_t); vm_page_t vm_page_alloc (vm_object_t, vm_pindex_t, int); -vm_page_t vm_page_alloc_freelist(int, int, int); +vm_page_t vm_page_alloc_freelist(int, int); struct vnode *vm_page_alloc_init(vm_page_t); vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int); void vm_page_cache(vm_page_t); From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 05:57:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65F9D106566C; Sun, 28 Nov 2010 05:57:24 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52BE68FC13; Sun, 28 Nov 2010 05:57:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS5vObM058851; Sun, 28 Nov 2010 05:57:24 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS5vOsu058841; Sun, 28 Nov 2010 05:57:24 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201011280557.oAS5vOsu058841@svn.freebsd.org> From: Juli Mallett Date: Sun, 28 Nov 2010 05:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215974 - head/sys/mips/cavium/octe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 05:57:24 -0000 Author: jmallett Date: Sun Nov 28 05:57:24 2010 New Revision: 215974 URL: http://svn.freebsd.org/changeset/base/215974 Log: o) Remove some commented out or unimplemented code. o) Remove some options that are configurable on Linux but not FreeBSD. o) Centralize open/poll/stop routines for XAUI and SGMII and use the common uninit routine directly rather than providing a wrapper for it. The init functions for these interfaces are now identical and the common init routine could merge in setting those function pointers except that some hardware seems to use no open/poll/stop method? Modified: head/sys/mips/cavium/octe/ethernet-common.c head/sys/mips/cavium/octe/ethernet-common.h head/sys/mips/cavium/octe/ethernet-defines.h head/sys/mips/cavium/octe/ethernet-mdio.c head/sys/mips/cavium/octe/ethernet-mem.c head/sys/mips/cavium/octe/ethernet-rx.c head/sys/mips/cavium/octe/ethernet-sgmii.c head/sys/mips/cavium/octe/ethernet-xaui.c head/sys/mips/cavium/octe/ethernet.c Modified: head/sys/mips/cavium/octe/ethernet-common.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-common.c Sun Nov 28 05:51:31 2010 (r215973) +++ head/sys/mips/cavium/octe/ethernet-common.c Sun Nov 28 05:57:24 2010 (r215974) @@ -49,51 +49,6 @@ extern cvmx_bootinfo_t *octeon_bootinfo; /** - * Get the low level ethernet statistics - * - * @param dev Device to get the statistics from - * @return Pointer to the statistics - */ -#if 0 -static struct ifnet_stats *cvm_oct_common_get_stats(struct ifnet *ifp) -{ - cvmx_pip_port_status_t rx_status; - cvmx_pko_port_status_t tx_status; - cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - - if (priv->port < CVMX_PIP_NUM_INPUT_PORTS) { - if (octeon_is_simulation()) { - /* The simulator doesn't support statistics */ - memset(&rx_status, 0, sizeof(rx_status)); - memset(&tx_status, 0, sizeof(tx_status)); - } else { - cvmx_pip_get_port_status(priv->port, 1, &rx_status); - cvmx_pko_get_port_status(priv->port, 1, &tx_status); - } - - priv->stats.rx_packets += rx_status.inb_packets; - priv->stats.tx_packets += tx_status.packets; - priv->stats.rx_bytes += rx_status.inb_octets; - priv->stats.tx_bytes += tx_status.octets; - priv->stats.multicast += rx_status.multicast_packets; - priv->stats.rx_crc_errors += rx_status.inb_errors; - priv->stats.rx_frame_errors += rx_status.fcs_align_err_packets; - - /* The drop counter must be incremented atomically since the RX - tasklet also increments it */ -#ifdef CONFIG_64BIT - cvmx_atomic_add64_nosync(&priv->stats.rx_dropped, rx_status.dropped_packets); -#else - cvmx_atomic_add32_nosync((int32_t *)&priv->stats.rx_dropped, rx_status.dropped_packets); -#endif - } - - return &priv->stats; -} -#endif - - -/** * Set the multicast list. Currently unimplemented. * * @param dev Device to work on @@ -219,6 +174,67 @@ int cvm_oct_common_change_mtu(struct ifn /** + * Enable port. + */ +int cvm_oct_common_open(struct ifnet *ifp) +{ + cvmx_gmxx_prtx_cfg_t gmx_cfg; + cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; + int interface = INTERFACE(priv->port); + int index = INDEX(priv->port); + cvmx_helper_link_info_t link_info; + + gmx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); + gmx_cfg.s.en = 1; + cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64); + + if (!octeon_is_simulation()) { + link_info = cvmx_helper_link_get(priv->port); + if (!link_info.s.link_up) + if_link_state_change(ifp, LINK_STATE_DOWN); + else + if_link_state_change(ifp, LINK_STATE_UP); + } + + return 0; +} + + +/** + * Disable port. + */ +int cvm_oct_common_stop(struct ifnet *ifp) +{ + cvmx_gmxx_prtx_cfg_t gmx_cfg; + cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; + int interface = INTERFACE(priv->port); + int index = INDEX(priv->port); + + gmx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); + gmx_cfg.s.en = 0; + cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64); + return 0; +} + +/** + * Poll for link status change. + */ +void cvm_oct_common_poll(struct ifnet *ifp) +{ + cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; + cvmx_helper_link_info_t link_info; + + link_info = cvmx_helper_link_get(priv->port); + if (link_info.u64 == priv->link_info) + return; + + link_info = cvmx_helper_link_autoconf(priv->port); + priv->link_info = link_info.u64; + priv->need_link_update = 1; +} + + +/** * Per network device initialization * * @param dev Device to initialize @@ -240,24 +256,11 @@ int cvm_oct_common_init(struct ifnet *if count++; -#if 0 - ifp->get_stats = cvm_oct_common_get_stats; -#ifdef CONFIG_NET_POLL_CONTROLLER - ifp->poll_controller = cvm_oct_poll_controller; -#endif -#endif - cvm_oct_mdio_setup_device(ifp); cvm_oct_common_set_mac_address(ifp, mac); cvm_oct_common_change_mtu(ifp, ifp->if_mtu); -#if 0 - /* Zero out stats for port so we won't mistakenly show counters from the - bootloader */ - memset(ifp->get_stats(ifp), 0, sizeof(struct ifnet_stats)); -#endif - /* * Do any last-minute board-specific initialization. */ Modified: head/sys/mips/cavium/octe/ethernet-common.h ============================================================================== --- head/sys/mips/cavium/octe/ethernet-common.h Sun Nov 28 05:51:31 2010 (r215973) +++ head/sys/mips/cavium/octe/ethernet-common.h Sun Nov 28 05:57:24 2010 (r215974) @@ -28,6 +28,9 @@ AND WITH ALL FAULTS AND CAVIUM NETWORKS *************************************************************************/ /* $FreeBSD$ */ +int cvm_oct_common_open(struct ifnet *ifp); +int cvm_oct_common_stop(struct ifnet *ifp); +void cvm_oct_common_poll(struct ifnet *ifp); int cvm_oct_common_init(struct ifnet *ifp); void cvm_oct_common_uninit(struct ifnet *ifp); Modified: head/sys/mips/cavium/octe/ethernet-defines.h ============================================================================== --- head/sys/mips/cavium/octe/ethernet-defines.h Sun Nov 28 05:51:31 2010 (r215973) +++ head/sys/mips/cavium/octe/ethernet-defines.h Sun Nov 28 05:57:24 2010 (r215974) @@ -40,13 +40,6 @@ AND WITH ALL FAULTS AND CAVIUM NETWORKS * This kernel config option allows the user to control the number of * packet and work queue buffers allocated by the driver. If this is zero, * the driver uses the default from below. - * USE_MBUFS_IN_HW - * Tells the driver to populate the packet buffers with kernel mbufs. - * This allows the driver to receive packets without copying them. It also - * means that 32bit userspace can't access the packet buffers. - * USE_32BIT_SHARED - * This define tells the driver to allocate memory for buffers from the - * 32bit sahred region instead of the kernel memory space. * USE_HW_TCPUDP_CHECKSUM * Controls if the Octeon TCP/UDP checksum engine is used for packet * output. If this is zero, the kernel will perform the checksum in @@ -64,14 +57,6 @@ AND WITH ALL FAULTS AND CAVIUM NETWORKS #define CONFIG_CAVIUM_RESERVE32 0 #endif -#if CONFIG_CAVIUM_RESERVE32 - #define USE_32BIT_SHARED 1 - #define USE_MBUFS_IN_HW 0 -#else - #define USE_32BIT_SHARED 0 - #define USE_MBUFS_IN_HW 1 -#endif - #define INTERRUPT_LIMIT 10000 /* Max interrupts per second per core */ /*#define INTERRUPT_LIMIT 0 *//* Don't limit the number of interrupts */ #define USE_HW_TCPUDP_CHECKSUM 1 Modified: head/sys/mips/cavium/octe/ethernet-mdio.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-mdio.c Sun Nov 28 05:51:31 2010 (r215973) +++ head/sys/mips/cavium/octe/ethernet-mdio.c Sun Nov 28 05:57:24 2010 (r215974) @@ -70,10 +70,6 @@ int cvm_oct_mdio_read(struct ifnet *ifp, cvmx_write_csr(CVMX_SMI_CMD, smi_cmd.u64); do { -#if 0 - if (!in_interrupt()) - yield(); -#endif smi_rd.u64 = cvmx_read_csr(CVMX_SMI_RD_DAT); } while (smi_rd.s.pending); @@ -111,10 +107,6 @@ void cvm_oct_mdio_write(struct ifnet *if cvmx_write_csr(CVMX_SMI_CMD, smi_cmd.u64); do { -#if 0 - if (!in_interrupt()) - yield(); -#endif smi_wr.u64 = cvmx_read_csr(CVMX_SMI_WR_DAT); } while (smi_wr.s.pending); MDIO_UNLOCK(); Modified: head/sys/mips/cavium/octe/ethernet-mem.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-mem.c Sun Nov 28 05:51:31 2010 (r215973) +++ head/sys/mips/cavium/octe/ethernet-mem.c Sun Nov 28 05:57:24 2010 (r215974) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); * @param size Size of the buffer needed for the pool * @param elements Number of buffers to allocate */ -static int cvm_oct_fill_hw_mbuf(int pool, int size, int elements) +int cvm_oct_mem_fill_fpa(int pool, int size, int elements) { int freed = elements; while (freed) { @@ -79,7 +79,7 @@ static int cvm_oct_fill_hw_mbuf(int pool * @param size Size of the buffer needed for the pool * @param elements Number of buffers to allocate */ -static void cvm_oct_free_hw_mbuf(int pool, int size, int elements) +void cvm_oct_mem_empty_fpa(int pool, int size, int elements) { char *memory; @@ -97,111 +97,3 @@ static void cvm_oct_free_hw_mbuf(int poo else if (elements > 0) printf("Warning: Freeing of pool %u is missing %d mbufs\n", pool, elements); } - - -/** - * This function fills a hardware pool with memory. Depending - * on the config defines, this memory might come from the - * kernel or global 32bit memory allocated with - * cvmx_bootmem_alloc. - * - * @param pool Pool to populate - * @param size Size of each buffer in the pool - * @param elements Number of buffers to allocate - */ -static int cvm_oct_fill_hw_memory(int pool, int size, int elements) -{ - char *memory; - int freed = elements; - - if (USE_32BIT_SHARED) { -#if 0 - extern uint64_t octeon_reserve32_memory; - - memory = cvmx_bootmem_alloc_range(elements*size, 128, octeon_reserve32_memory, - octeon_reserve32_memory + (CONFIG_CAVIUM_RESERVE32<<20) - 1); - if (memory == NULL) - panic("Unable to allocate %u bytes for FPA pool %d\n", elements*size, pool); - - printf("Memory range %p - %p reserved for hardware\n", memory, memory + elements*size - 1); - - while (freed) { - cvmx_fpa_free(memory, pool, 0); - memory += size; - freed--; - } -#else - panic("%s: may need to implement using shared memory.", __func__); -#endif - } else { - while (freed) { - /* We need to force alignment to 128 bytes here */ -#if 0 - memory = kmalloc(size + 127, GFP_ATOMIC); -#else - panic("%s: not yet implemented.", __func__); -#endif - if (__predict_false(memory == NULL)) { - printf("Unable to allocate %u bytes for FPA pool %d\n", elements*size, pool); - break; - } - memory = (char *)(((unsigned long)memory+127) & -128); - cvmx_fpa_free(memory, pool, 0); - freed--; - } - } - return (elements - freed); -} - - -/** - * Free memory previously allocated with cvm_oct_fill_hw_memory - * - * @param pool FPA pool to free - * @param size Size of each buffer in the pool - * @param elements Number of buffers that should be in the pool - */ -static void cvm_oct_free_hw_memory(int pool, int size, int elements) -{ - if (USE_32BIT_SHARED) { - printf("Warning: 32 shared memory is not freeable\n"); - } else { - char *memory; - do { - memory = cvmx_fpa_alloc(pool); - if (memory) { - elements--; -#if 0 - kfree(phys_to_virt(cvmx_ptr_to_phys(memory))); -#else - panic("%s: not yet implemented.", __func__); -#endif - } - } while (memory); - - if (elements < 0) - printf("Freeing of pool %u had too many buffers (%d)\n", pool, elements); - else if (elements > 0) - printf("Warning: Freeing of pool %u is missing %d buffers\n", pool, elements); - } -} - - -int cvm_oct_mem_fill_fpa(int pool, int size, int elements) -{ - int freed; - if (USE_MBUFS_IN_HW) - freed = cvm_oct_fill_hw_mbuf(pool, size, elements); - else - freed = cvm_oct_fill_hw_memory(pool, size, elements); - return (freed); -} - -void cvm_oct_mem_empty_fpa(int pool, int size, int elements) -{ - if (USE_MBUFS_IN_HW) - cvm_oct_free_hw_mbuf(pool, size, elements); - else - cvm_oct_free_hw_memory(pool, size, elements); -} - Modified: head/sys/mips/cavium/octe/ethernet-rx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-rx.c Sun Nov 28 05:51:31 2010 (r215973) +++ head/sys/mips/cavium/octe/ethernet-rx.c Sun Nov 28 05:57:24 2010 (r215974) @@ -75,21 +75,6 @@ int cvm_oct_do_interrupt(void *dev_id) } -#ifdef CONFIG_NET_POLL_CONTROLLER -/** - * This is called when the kernel needs to manually poll the - * device. For Octeon, this is simply calling the interrupt - * handler. We actually poll all the devices, not just the - * one supplied. - * - * @param dev Device to poll. Unused - */ -void cvm_oct_poll_controller(struct ifnet *ifp) -{ - taskqueue_enqueue(cvm_oct_taskq, &cvm_oct_task); -} -#endif - /** * This is called on receive errors, and determines if the packet * can be dropped early-on in cvm_oct_tasklet_rx(). @@ -226,7 +211,7 @@ void cvm_oct_tasklet_rx(void *context, i } } - mbuf_in_hw = USE_MBUFS_IN_HW && work->word2.s.bufs == 1; + mbuf_in_hw = work->word2.s.bufs == 1; if ((mbuf_in_hw)) { m = *(struct mbuf **)(cvm_oct_get_buffer_ptr(work->packet_ptr) - sizeof(void *)); CVMX_PREFETCH(m, offsetof(struct mbuf, m_data)); @@ -356,7 +341,7 @@ void cvm_oct_tasklet_rx(void *context, i /* Check to see if the mbuf and work share the same packet buffer */ - if (USE_MBUFS_IN_HW && (packet_not_copied)) { + if ((packet_not_copied)) { /* This buffer needs to be replaced, increment the number of buffers we need to free by one */ cvmx_fau_atomic_add32( @@ -375,22 +360,20 @@ void cvm_oct_tasklet_rx(void *context, i cvmx_scratch_write64(CVMX_SCR_SCRATCH, old_scratch); } - if (USE_MBUFS_IN_HW) { - /* Refill the packet buffer pool */ - number_to_free = - cvmx_fau_fetch_and_add32(FAU_NUM_PACKET_BUFFERS_TO_FREE, 0); - - if (number_to_free > 0) { + /* Refill the packet buffer pool */ + number_to_free = + cvmx_fau_fetch_and_add32(FAU_NUM_PACKET_BUFFERS_TO_FREE, 0); + + if (number_to_free > 0) { + cvmx_fau_atomic_add32(FAU_NUM_PACKET_BUFFERS_TO_FREE, + -number_to_free); + num_freed = + cvm_oct_mem_fill_fpa(CVMX_FPA_PACKET_POOL, + CVMX_FPA_PACKET_POOL_SIZE, + number_to_free); + if (num_freed != number_to_free) { cvmx_fau_atomic_add32(FAU_NUM_PACKET_BUFFERS_TO_FREE, - -number_to_free); - num_freed = - cvm_oct_mem_fill_fpa(CVMX_FPA_PACKET_POOL, - CVMX_FPA_PACKET_POOL_SIZE, - number_to_free); - if (num_freed != number_to_free) { - cvmx_fau_atomic_add32(FAU_NUM_PACKET_BUFFERS_TO_FREE, - number_to_free - num_freed); - } + number_to_free - num_freed); } } sched_unpin(); Modified: head/sys/mips/cavium/octe/ethernet-sgmii.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-sgmii.c Sun Nov 28 05:51:31 2010 (r215973) +++ head/sys/mips/cavium/octe/ethernet-sgmii.c Sun Nov 28 05:57:24 2010 (r215974) @@ -46,72 +46,16 @@ __FBSDID("$FreeBSD$"); extern int octeon_is_simulation(void); -static int cvm_oct_sgmii_open(struct ifnet *ifp) -{ - cvmx_gmxx_prtx_cfg_t gmx_cfg; - cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - int interface = INTERFACE(priv->port); - int index = INDEX(priv->port); - cvmx_helper_link_info_t link_info; - - gmx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); - gmx_cfg.s.en = 1; - cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64); - - if (!octeon_is_simulation()) { - link_info = cvmx_helper_link_get(priv->port); - if (!link_info.s.link_up) - if_link_state_change(ifp, LINK_STATE_DOWN); - else - if_link_state_change(ifp, LINK_STATE_UP); - } - - return 0; -} - -static int cvm_oct_sgmii_stop(struct ifnet *ifp) -{ - cvmx_gmxx_prtx_cfg_t gmx_cfg; - cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - int interface = INTERFACE(priv->port); - int index = INDEX(priv->port); - - gmx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); - gmx_cfg.s.en = 0; - cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64); - return 0; -} - -static void cvm_oct_sgmii_poll(struct ifnet *ifp) -{ - cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - cvmx_helper_link_info_t link_info; - - link_info = cvmx_helper_link_get(priv->port); - if (link_info.u64 == priv->link_info) - return; - - link_info = cvmx_helper_link_autoconf(priv->port); - priv->link_info = link_info.u64; - priv->need_link_update = 1; -} - int cvm_oct_sgmii_init(struct ifnet *ifp) { cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; cvm_oct_common_init(ifp); - priv->open = cvm_oct_sgmii_open; - priv->stop = cvm_oct_sgmii_stop; + priv->open = cvm_oct_common_open; + priv->stop = cvm_oct_common_stop; priv->stop(ifp); if (!octeon_is_simulation()) - priv->poll = cvm_oct_sgmii_poll; + priv->poll = cvm_oct_common_poll; /* FIXME: Need autoneg logic */ return 0; } - -void cvm_oct_sgmii_uninit(struct ifnet *ifp) -{ - cvm_oct_common_uninit(ifp); -} - Modified: head/sys/mips/cavium/octe/ethernet-xaui.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-xaui.c Sun Nov 28 05:51:31 2010 (r215973) +++ head/sys/mips/cavium/octe/ethernet-xaui.c Sun Nov 28 05:57:24 2010 (r215974) @@ -46,71 +46,15 @@ __FBSDID("$FreeBSD$"); extern int octeon_is_simulation(void); -static int cvm_oct_xaui_open(struct ifnet *ifp) -{ - cvmx_gmxx_prtx_cfg_t gmx_cfg; - cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - int interface = INTERFACE(priv->port); - int index = INDEX(priv->port); - cvmx_helper_link_info_t link_info; - - gmx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); - gmx_cfg.s.en = 1; - cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64); - - if (!octeon_is_simulation()) { - link_info = cvmx_helper_link_get(priv->port); - if (!link_info.s.link_up) - if_link_state_change(ifp, LINK_STATE_DOWN); - else - if_link_state_change(ifp, LINK_STATE_UP); - } - return 0; -} - -static int cvm_oct_xaui_stop(struct ifnet *ifp) -{ - cvmx_gmxx_prtx_cfg_t gmx_cfg; - cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - int interface = INTERFACE(priv->port); - int index = INDEX(priv->port); - - gmx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); - gmx_cfg.s.en = 0; - cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64); - return 0; -} - -static void cvm_oct_xaui_poll(struct ifnet *ifp) -{ - cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - cvmx_helper_link_info_t link_info; - - link_info = cvmx_helper_link_get(priv->port); - if (link_info.u64 == priv->link_info) - return; - - link_info = cvmx_helper_link_autoconf(priv->port); - priv->link_info = link_info.u64; - priv->need_link_update = 1; -} - - int cvm_oct_xaui_init(struct ifnet *ifp) { cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; cvm_oct_common_init(ifp); - priv->open = cvm_oct_xaui_open; - priv->stop = cvm_oct_xaui_stop; + priv->open = cvm_oct_common_open; + priv->stop = cvm_oct_common_stop; priv->stop(ifp); if (!octeon_is_simulation()) - priv->poll = cvm_oct_xaui_poll; + priv->poll = cvm_oct_common_poll; return 0; } - -void cvm_oct_xaui_uninit(struct ifnet *ifp) -{ - cvm_oct_common_uninit(ifp); -} - Modified: head/sys/mips/cavium/octe/ethernet.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet.c Sun Nov 28 05:51:31 2010 (r215973) +++ head/sys/mips/cavium/octe/ethernet.c Sun Nov 28 05:57:24 2010 (r215974) @@ -74,13 +74,6 @@ TUNABLE_INT("hw.octe.pow_receive_group", "\t\tgroup. Also any other software can submit packets to this\n" "\t\tgroup for the kernel to process." */ -static int disable_core_queueing = 1; -TUNABLE_INT("hw.octe.disable_core_queueing", &disable_core_queueing); -/* - "\t\tWhen set the networking core's tx_queue_len is set to zero. This\n" - "\t\tallows packets to be sent without lock contention in the packet scheduler\n" - "\t\tresulting in some cases in improved throughput.\n" */ - extern int octeon_is_simulation(void); /** @@ -176,9 +169,6 @@ static void cvm_do_timer(void *arg) priv->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } } -#if 0 - cvm_oct_device[port]->get_stats(cvm_oct_device[port]); -#endif } port++; /* Poll the next port in a 50th of a second. @@ -312,9 +302,6 @@ int cvm_oct_init_module(device_t bus) printf("cavium-ethernet: %s\n", OCTEON_SDK_VERSION_STRING); -#if 0 - cvm_oct_proc_initialize(); -#endif cvm_oct_rx_initialize(); cvm_oct_configure_common_hw(bus); @@ -364,11 +351,6 @@ int cvm_oct_init_module(device_t bus) printf("\t\tFailed to allocate ethernet device for port %d\n", port); continue; } - /* XXX/juli set max send q len. */ -#if 0 - if (disable_core_queueing) - ifp->tx_queue_len = 0; -#endif /* Initialize the device private structure. */ device_probe(dev); @@ -399,7 +381,7 @@ int cvm_oct_init_module(device_t bus) case CVMX_HELPER_INTERFACE_MODE_XAUI: priv->init = cvm_oct_xaui_init; - priv->uninit = cvm_oct_xaui_uninit; + priv->uninit = cvm_oct_common_uninit; device_set_desc(dev, "Cavium Octeon XAUI Ethernet"); break; @@ -411,7 +393,7 @@ int cvm_oct_init_module(device_t bus) case CVMX_HELPER_INTERFACE_MODE_SGMII: priv->init = cvm_oct_sgmii_init; - priv->uninit = cvm_oct_sgmii_uninit; + priv->uninit = cvm_oct_common_uninit; device_set_desc(dev, "Cavium Octeon SGMII Ethernet"); break; @@ -506,9 +488,6 @@ void cvm_oct_cleanup_module(void) } cvmx_pko_shutdown(); -#if 0 - cvm_oct_proc_shutdown(); -#endif cvmx_ipd_free_ptr(); From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 08:09:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B39D6106564A; Sun, 28 Nov 2010 08:09:20 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0EA48FC14; Sun, 28 Nov 2010 08:09:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS89Kro078753; Sun, 28 Nov 2010 08:09:20 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS89KQp078751; Sun, 28 Nov 2010 08:09:20 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201011280809.oAS89KQp078751@svn.freebsd.org> From: Juli Mallett Date: Sun, 28 Nov 2010 08:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215988 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 08:09:20 -0000 Author: jmallett Date: Sun Nov 28 08:09:20 2010 New Revision: 215988 URL: http://svn.freebsd.org/changeset/base/215988 Log: Bump up MIPS limits once again; the new Cavium Octeon SDK requires even higher limits. I'd rather disable the warning and keep the limits at a sane level, but for now they'll be ridiculously-high. Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Sun Nov 28 07:29:56 2010 (r215987) +++ head/sys/conf/kern.pre.mk Sun Nov 28 08:09:20 2010 (r215988) @@ -100,8 +100,9 @@ CFLAGS+= --param inline-unit-growth=100 CFLAGS+= --param large-function-growth=1000 .else # XXX Actually a gross hack just for Octeon because of the Simple Executive. -CFLAGS+= --param inline-unit-growth=1000 +CFLAGS+= --param inline-unit-growth=10000 CFLAGS+= --param large-function-growth=100000 +CFLAGS+= --param max-inline-insns-single=10000 .endif .endif WERROR?= -Werror From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 08:11:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C256106566B; Sun, 28 Nov 2010 08:11:06 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27E9A8FC23; Sun, 28 Nov 2010 08:11:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS8B6iW079110; Sun, 28 Nov 2010 08:11:06 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS8B6n8079105; Sun, 28 Nov 2010 08:11:06 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201011280811.oAS8B6n8079105@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 28 Nov 2010 08:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215989 - head/sys/mips/cavium X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 08:11:06 -0000 Author: gonzo Date: Sun Nov 28 08:11:05 2010 New Revision: 215989 URL: http://svn.freebsd.org/changeset/base/215989 Log: - Add watchdog driver for Cavium Octeon. At the moment only UP systems are supported. Added: head/sys/mips/cavium/octeon_nmi.S (contents, props changed) head/sys/mips/cavium/octeon_wdog.c (contents, props changed) Modified: head/sys/mips/cavium/files.octeon1 Modified: head/sys/mips/cavium/files.octeon1 ============================================================================== --- head/sys/mips/cavium/files.octeon1 Sun Nov 28 08:09:20 2010 (r215988) +++ head/sys/mips/cavium/files.octeon1 Sun Nov 28 08:11:05 2010 (r215989) @@ -16,6 +16,8 @@ mips/mips/intr_machdep.c standard mips/mips/tick.c standard mips/cavium/octeon_rnd.c optional random +mips/cavium/octeon_wdog.c optional octeon_wdog +mips/cavium/octeon_nmi.S optional octeon_wdog mips/cavium/cryptocteon/cavium_crypto.c optional cryptocteon mips/cavium/cryptocteon/cryptocteon.c optional cryptocteon Added: head/sys/mips/cavium/octeon_nmi.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/octeon_nmi.S Sun Nov 28 08:11:05 2010 (r215989) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2010 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +.set noreorder + +/* + * Only first 128 bytes of handler is used + */ +NESTED_NOPROFILE(octeon_wdog_nmi_handler, 32, ra) + .set push + .set noat + PTR_LA k0, _C_LABEL(octeon_wdog_nmi) + jr k0 + nop +1: + nop + j 1b + nop + .set at +END(octeon_wdog_nmi_handler) Added: head/sys/mips/cavium/octeon_wdog.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/octeon_wdog.c Sun Nov 28 08:11:05 2010 (r215989) @@ -0,0 +1,259 @@ +/*- + * Copyright (c) 2009, Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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. + */ + +/* + * Watchdog driver for Cavium Octeon + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define DEFAULT_TIMER_VAL 65535 + +struct octeon_wdog_softc { + device_t dev; + /* XXX: replace with repscive CVMX_ constant */ + struct resource *irq_res[16]; + void *intr_hdl[16]; + int armed; + int debug; +}; + +extern void octeon_wdog_nmi_handler(void); +void octeon_wdog_nmi(void); + +static void octeon_watchdog_arm_core(int core, unsigned long timer_val); +static void octeon_watchdog_disarm_core(int core); +static int octeon_wdog_attach(device_t dev); +static void octeon_wdog_identify(driver_t *drv, device_t parent); +static int octeon_wdog_intr(void *);; +static int octeon_wdog_probe(device_t dev); +static void octeon_wdog_setup(struct octeon_wdog_softc *sc, int cpu); +static void octeon_wdog_sysctl(device_t dev); +static void octeon_wdog_watchdog_fn(void *private, u_int cmd, int *error); + +void +octeon_wdog_nmi() +{ + + /* XXX: Add something useful here */ + printf("NMI detected\n"); + + /* + * This is the end + * Beautiful friend + * + * Just wait for Soft Reset to come and take us + */ + for (;;) + ; +} + +static void +octeon_watchdog_arm_core(int core, unsigned long timer_val) +{ + cvmx_ciu_wdogx_t ciu_wdog; + + /* Poke it! */ + cvmx_write_csr(CVMX_CIU_PP_POKEX(core), 1); + + ciu_wdog.u64 = 0; + ciu_wdog.s.len = timer_val; + ciu_wdog.s.mode = 3; + cvmx_write_csr(CVMX_CIU_WDOGX(core), ciu_wdog.u64); +} + +static void +octeon_watchdog_disarm_core(int core) +{ + + cvmx_write_csr(CVMX_CIU_WDOGX(core), 0); +} + + + +static void +octeon_wdog_watchdog_fn(void *private, u_int cmd, int *error) +{ + struct octeon_wdog_softc *sc = private; + uint64_t timer_val = 0; + + cmd &= WD_INTERVAL; + if (sc->debug) + device_printf(sc->dev, "octeon_wdog_watchdog_fn: cmd: %x\n", cmd); + if (cmd > 0) { + if (sc->debug) + device_printf(sc->dev, "octeon_wdog_watchdog_fn: programming timer: %jx\n", (uintmax_t) timer_val); + /* + * XXX: This should be done for every core and with value + * calculated based on CPU frquency + */ + octeon_watchdog_arm_core(cvmx_get_core_num(), DEFAULT_TIMER_VAL); + sc->armed = 1; + *error = 0; + } else { + if (sc->debug) + device_printf(sc->dev, "octeon_wdog_watchdog_fn: disarming\n"); + if (sc->armed) { + sc->armed = 0; + /* XXX: This should be done for every core */ + octeon_watchdog_disarm_core(cvmx_get_core_num()); + } + } +} + +static void +octeon_wdog_sysctl(device_t dev) +{ + struct octeon_wdog_softc *sc = device_get_softc(dev); + + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->dev); + struct sysctl_oid *tree = device_get_sysctl_tree(sc->dev); + + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "debug", CTLFLAG_RW, &sc->debug, 0, + "enable watchdog debugging"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "armed", CTLFLAG_RD, &sc->armed, 0, + "whether the watchdog is armed"); +} + +static void +octeon_wdog_setup(struct octeon_wdog_softc *sc, int cpu) +{ + int core, rid, err; + + /* XXX: map cpu id to core here ? */ + core = cvmx_get_core_num(); + + /* Interrupt part */ + rid = 0; + sc->irq_res[core] = + bus_alloc_resource(sc->dev, SYS_RES_IRQ, &rid, + CVMX_IRQ_WDOG0+core, + CVMX_IRQ_WDOG0+core, 1, RF_ACTIVE); + if (!(sc->irq_res[core])) + goto error; + + err = bus_setup_intr(sc->dev, sc->irq_res[core], INTR_TYPE_MISC, + octeon_wdog_intr, NULL, sc, &sc->intr_hdl[core]); + if (err) + goto error; + + /* XXX: pin interrupt handler to the respective core */ + + /* Disarm by default */ + octeon_watchdog_disarm_core(core); + + return; + +error: + panic("failed to setup watchdog interrupt for core %d", core); +} + + +static int +octeon_wdog_intr(void *sc) +{ + + /* Poke it! */ + cvmx_write_csr(CVMX_CIU_PP_POKEX(cvmx_get_core_num()), 1); + + return (FILTER_HANDLED); +} + +static int +octeon_wdog_probe(device_t dev) +{ + + device_set_desc(dev, "Cavium Octeon watchdog timer"); + return (0); +} + +static int +octeon_wdog_attach(device_t dev) +{ + struct octeon_wdog_softc *sc = device_get_softc(dev); + int i; + uint64_t *nmi_handler = (uint64_t*)octeon_wdog_nmi_handler; + + /* Initialise */ + sc->armed = 0; + sc->debug = 0; + + sc->dev = dev; + EVENTHANDLER_REGISTER(watchdog_list, octeon_wdog_watchdog_fn, sc, 0); + octeon_wdog_sysctl(dev); + + for (i = 0; i < 16; i++) { + cvmx_write_csr(CVMX_MIO_BOOT_LOC_ADR, i * 8); + cvmx_write_csr(CVMX_MIO_BOOT_LOC_DAT, nmi_handler[i]); + } + + cvmx_write_csr(CVMX_MIO_BOOT_LOC_CFGX(0), 0x81fc0000); + + /* XXX: This should be done for every core */ + octeon_wdog_setup(sc, cvmx_get_core_num()); + return (0); +} + +static void +octeon_wdog_identify(driver_t *drv, device_t parent) +{ + + BUS_ADD_CHILD(parent, 0, "octeon_wdog", 0); +} + +static device_method_t octeon_wdog_methods[] = { + DEVMETHOD(device_identify, octeon_wdog_identify), + + DEVMETHOD(device_probe, octeon_wdog_probe), + DEVMETHOD(device_attach, octeon_wdog_attach), + {0, 0}, +}; + +static driver_t octeon_wdog_driver = { + "octeon_wdog", + octeon_wdog_methods, + sizeof(struct octeon_wdog_softc), +}; +static devclass_t octeon_wdog_devclass; + +DRIVER_MODULE(octeon_wdog, ciu, octeon_wdog_driver, octeon_wdog_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 08:18:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DA3C1065675; Sun, 28 Nov 2010 08:18:17 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA5CC8FC1A; Sun, 28 Nov 2010 08:18:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS8IGnX080416; Sun, 28 Nov 2010 08:18:16 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS8IGK7080408; Sun, 28 Nov 2010 08:18:16 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201011280818.oAS8IGK7080408@svn.freebsd.org> From: Juli Mallett Date: Sun, 28 Nov 2010 08:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215990 - in head/sys: contrib/octeon-sdk contrib/octeon-sdk/cvmx-malloc mips/cavium mips/cavium/octe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 08:18:17 -0000 Author: jmallett Date: Sun Nov 28 08:18:16 2010 New Revision: 215990 URL: http://svn.freebsd.org/changeset/base/215990 Log: Merge Cavium Octeon SDK 2.0 Simple Executive; this brings some fixes and new facilities as well as support for the Octeon 2 family of SoCs. XXX Note that with our antediluvian assembler, we can't support some Octeon 2 instructions and fall back to using the old ones instead. Added: head/sys/contrib/octeon-sdk/cvmx-agl-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-agl-defs.h head/sys/contrib/octeon-sdk/cvmx-app-hotplug.c - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-app-hotplug.c head/sys/contrib/octeon-sdk/cvmx-app-hotplug.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-app-hotplug.h head/sys/contrib/octeon-sdk/cvmx-asx0-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-asx0-defs.h head/sys/contrib/octeon-sdk/cvmx-asxx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-asxx-defs.h head/sys/contrib/octeon-sdk/cvmx-ciu-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-ciu-defs.h head/sys/contrib/octeon-sdk/cvmx-clock.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-clock.c head/sys/contrib/octeon-sdk/cvmx-clock.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-clock.h head/sys/contrib/octeon-sdk/cvmx-crypto.c - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-crypto.c head/sys/contrib/octeon-sdk/cvmx-crypto.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-crypto.h head/sys/contrib/octeon-sdk/cvmx-dbg-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-dbg-defs.h head/sys/contrib/octeon-sdk/cvmx-debug-handler.S - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-debug-handler.S head/sys/contrib/octeon-sdk/cvmx-debug-remote.c - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-debug-remote.c head/sys/contrib/octeon-sdk/cvmx-debug-uart.c - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-debug-uart.c head/sys/contrib/octeon-sdk/cvmx-debug.c - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-debug.c head/sys/contrib/octeon-sdk/cvmx-debug.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-debug.h head/sys/contrib/octeon-sdk/cvmx-dfa-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-dfa-defs.h head/sys/contrib/octeon-sdk/cvmx-dfm-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-dfm-defs.h head/sys/contrib/octeon-sdk/cvmx-dpi-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-dpi-defs.h head/sys/contrib/octeon-sdk/cvmx-error-custom.c - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-error-custom.c head/sys/contrib/octeon-sdk/cvmx-error-custom.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-error-custom.h head/sys/contrib/octeon-sdk/cvmx-error-init-cn30xx.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-error-init-cn30xx.c head/sys/contrib/octeon-sdk/cvmx-error-init-cn31xx.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-error-init-cn31xx.c head/sys/contrib/octeon-sdk/cvmx-error-init-cn38xx.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-error-init-cn38xx.c head/sys/contrib/octeon-sdk/cvmx-error-init-cn38xxp2.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-error-init-cn38xxp2.c head/sys/contrib/octeon-sdk/cvmx-error-init-cn50xx.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-error-init-cn50xx.c head/sys/contrib/octeon-sdk/cvmx-error-init-cn52xx.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-error-init-cn52xx.c head/sys/contrib/octeon-sdk/cvmx-error-init-cn52xxp1.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-error-init-cn52xxp1.c head/sys/contrib/octeon-sdk/cvmx-error-init-cn56xx.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-error-init-cn56xx.c head/sys/contrib/octeon-sdk/cvmx-error-init-cn56xxp1.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-error-init-cn56xxp1.c head/sys/contrib/octeon-sdk/cvmx-error-init-cn58xx.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-error-init-cn58xx.c head/sys/contrib/octeon-sdk/cvmx-error-init-cn58xxp1.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-error-init-cn58xxp1.c head/sys/contrib/octeon-sdk/cvmx-error-init-cn63xx.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-error-init-cn63xx.c head/sys/contrib/octeon-sdk/cvmx-error-init-cn63xxp1.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-error-init-cn63xxp1.c head/sys/contrib/octeon-sdk/cvmx-error.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-error.c head/sys/contrib/octeon-sdk/cvmx-error.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-error.h head/sys/contrib/octeon-sdk/cvmx-fpa-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-fpa-defs.h head/sys/contrib/octeon-sdk/cvmx-gmxx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-gmxx-defs.h head/sys/contrib/octeon-sdk/cvmx-gpio-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-gpio-defs.h head/sys/contrib/octeon-sdk/cvmx-helper-jtag.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-helper-jtag.c head/sys/contrib/octeon-sdk/cvmx-helper-jtag.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-helper-jtag.h head/sys/contrib/octeon-sdk/cvmx-helper-srio.c - copied, changed from r215989, vendor-sys/octeon-sdk/dist/cvmx-helper-srio.c head/sys/contrib/octeon-sdk/cvmx-helper-srio.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-helper-srio.h head/sys/contrib/octeon-sdk/cvmx-iob-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-iob-defs.h head/sys/contrib/octeon-sdk/cvmx-ipd-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-ipd-defs.h head/sys/contrib/octeon-sdk/cvmx-ixf18201.c - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-ixf18201.c head/sys/contrib/octeon-sdk/cvmx-ixf18201.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-ixf18201.h head/sys/contrib/octeon-sdk/cvmx-key-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-key-defs.h head/sys/contrib/octeon-sdk/cvmx-l2c-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-l2c-defs.h head/sys/contrib/octeon-sdk/cvmx-l2d-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-l2d-defs.h head/sys/contrib/octeon-sdk/cvmx-l2t-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-l2t-defs.h head/sys/contrib/octeon-sdk/cvmx-led-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-led-defs.h head/sys/contrib/octeon-sdk/cvmx-lmcx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-lmcx-defs.h head/sys/contrib/octeon-sdk/cvmx-mio-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-mio-defs.h head/sys/contrib/octeon-sdk/cvmx-mixx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-mixx-defs.h head/sys/contrib/octeon-sdk/cvmx-mpi-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-mpi-defs.h head/sys/contrib/octeon-sdk/cvmx-ndf-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-ndf-defs.h head/sys/contrib/octeon-sdk/cvmx-npei-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-npei-defs.h head/sys/contrib/octeon-sdk/cvmx-npi-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-npi-defs.h head/sys/contrib/octeon-sdk/cvmx-pci-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-pci-defs.h head/sys/contrib/octeon-sdk/cvmx-pcieepx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-pcieepx-defs.h head/sys/contrib/octeon-sdk/cvmx-pciercx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-pciercx-defs.h head/sys/contrib/octeon-sdk/cvmx-pcm-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-pcm-defs.h head/sys/contrib/octeon-sdk/cvmx-pcmx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-pcmx-defs.h head/sys/contrib/octeon-sdk/cvmx-pcsx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-pcsx-defs.h head/sys/contrib/octeon-sdk/cvmx-pcsxx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-pcsxx-defs.h head/sys/contrib/octeon-sdk/cvmx-pemx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-pemx-defs.h head/sys/contrib/octeon-sdk/cvmx-pescx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-pescx-defs.h head/sys/contrib/octeon-sdk/cvmx-pexp-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-pexp-defs.h head/sys/contrib/octeon-sdk/cvmx-pip-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-pip-defs.h head/sys/contrib/octeon-sdk/cvmx-pko-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-pko-defs.h head/sys/contrib/octeon-sdk/cvmx-pow-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-pow-defs.h head/sys/contrib/octeon-sdk/cvmx-power-throttle.c - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-power-throttle.c head/sys/contrib/octeon-sdk/cvmx-power-throttle.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-power-throttle.h head/sys/contrib/octeon-sdk/cvmx-rad-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-rad-defs.h head/sys/contrib/octeon-sdk/cvmx-rnm-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-rnm-defs.h head/sys/contrib/octeon-sdk/cvmx-shmem.c - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-shmem.c head/sys/contrib/octeon-sdk/cvmx-shmem.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-shmem.h head/sys/contrib/octeon-sdk/cvmx-sim-magic.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-sim-magic.h head/sys/contrib/octeon-sdk/cvmx-sli-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-sli-defs.h head/sys/contrib/octeon-sdk/cvmx-smi-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-smi-defs.h head/sys/contrib/octeon-sdk/cvmx-smix-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-smix-defs.h head/sys/contrib/octeon-sdk/cvmx-spx0-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-spx0-defs.h head/sys/contrib/octeon-sdk/cvmx-spxx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-spxx-defs.h head/sys/contrib/octeon-sdk/cvmx-srio.c - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-srio.c head/sys/contrib/octeon-sdk/cvmx-srio.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-srio.h head/sys/contrib/octeon-sdk/cvmx-sriomaintx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-sriomaintx-defs.h head/sys/contrib/octeon-sdk/cvmx-sriox-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-sriox-defs.h head/sys/contrib/octeon-sdk/cvmx-srxx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-srxx-defs.h head/sys/contrib/octeon-sdk/cvmx-stxx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-stxx-defs.h head/sys/contrib/octeon-sdk/cvmx-tim-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-tim-defs.h head/sys/contrib/octeon-sdk/cvmx-tlb.c - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-tlb.c head/sys/contrib/octeon-sdk/cvmx-tlb.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-tlb.h head/sys/contrib/octeon-sdk/cvmx-tra-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-tra-defs.h head/sys/contrib/octeon-sdk/cvmx-uahcx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-uahcx-defs.h head/sys/contrib/octeon-sdk/cvmx-uart.c - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-uart.c head/sys/contrib/octeon-sdk/cvmx-uctlx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-uctlx-defs.h head/sys/contrib/octeon-sdk/cvmx-usbcx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-usbcx-defs.h head/sys/contrib/octeon-sdk/cvmx-usbd.c - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-usbd.c head/sys/contrib/octeon-sdk/cvmx-usbd.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-usbd.h head/sys/contrib/octeon-sdk/cvmx-usbnx-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-usbnx-defs.h head/sys/contrib/octeon-sdk/cvmx-zip-defs.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-zip-defs.h head/sys/contrib/octeon-sdk/octeon-boot-info.h - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/octeon-boot-info.h Replaced: head/sys/contrib/octeon-sdk/cvmx-interrupt-handler.S - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-interrupt-handler.S head/sys/contrib/octeon-sdk/cvmx-log-arc.S - copied unchanged from r215989, vendor-sys/octeon-sdk/dist/cvmx-log-arc.S Deleted: head/sys/contrib/octeon-sdk/README.txt head/sys/contrib/octeon-sdk/cvmx-asx.h head/sys/contrib/octeon-sdk/cvmx-ciu.h head/sys/contrib/octeon-sdk/cvmx-csr-addresses.h head/sys/contrib/octeon-sdk/cvmx-cvmmem.h head/sys/contrib/octeon-sdk/cvmx-interrupt-decodes.c head/sys/contrib/octeon-sdk/cvmx-interrupt-rsl.c head/sys/contrib/octeon-sdk/cvmx-iob.h head/sys/contrib/octeon-sdk/cvmx-lmc.h head/sys/contrib/octeon-sdk/cvmx-malloc/ head/sys/contrib/octeon-sdk/cvmx-mio.h head/sys/contrib/octeon-sdk/cvmx-resources.config head/sys/contrib/octeon-sdk/cvmx-shared-linux-n32.ld head/sys/contrib/octeon-sdk/cvmx-shared-linux-o32.ld head/sys/contrib/octeon-sdk/cvmx-shared-linux.ld head/sys/contrib/octeon-sdk/cvmx-twsi-raw.c head/sys/contrib/octeon-sdk/cvmx-twsi-raw.h head/sys/contrib/octeon-sdk/cvmx.mk head/sys/contrib/octeon-sdk/executive-config.h.template Modified: head/sys/contrib/octeon-sdk/cvmip.h head/sys/contrib/octeon-sdk/cvmx-abi.h head/sys/contrib/octeon-sdk/cvmx-access-native.h head/sys/contrib/octeon-sdk/cvmx-access.h head/sys/contrib/octeon-sdk/cvmx-address.h head/sys/contrib/octeon-sdk/cvmx-app-init-linux.c head/sys/contrib/octeon-sdk/cvmx-app-init.c head/sys/contrib/octeon-sdk/cvmx-app-init.h head/sys/contrib/octeon-sdk/cvmx-asm.h head/sys/contrib/octeon-sdk/cvmx-atomic.h head/sys/contrib/octeon-sdk/cvmx-bootloader.h head/sys/contrib/octeon-sdk/cvmx-bootmem.c head/sys/contrib/octeon-sdk/cvmx-bootmem.h head/sys/contrib/octeon-sdk/cvmx-cmd-queue.c head/sys/contrib/octeon-sdk/cvmx-cmd-queue.h head/sys/contrib/octeon-sdk/cvmx-cn3010-evb-hs5.c head/sys/contrib/octeon-sdk/cvmx-cn3010-evb-hs5.h head/sys/contrib/octeon-sdk/cvmx-compactflash.c head/sys/contrib/octeon-sdk/cvmx-compactflash.h head/sys/contrib/octeon-sdk/cvmx-core.c head/sys/contrib/octeon-sdk/cvmx-core.h head/sys/contrib/octeon-sdk/cvmx-coremask.c head/sys/contrib/octeon-sdk/cvmx-coremask.h head/sys/contrib/octeon-sdk/cvmx-csr-db-support.c head/sys/contrib/octeon-sdk/cvmx-csr-db.c head/sys/contrib/octeon-sdk/cvmx-csr-db.h head/sys/contrib/octeon-sdk/cvmx-csr-enums.h head/sys/contrib/octeon-sdk/cvmx-csr-typedefs.h head/sys/contrib/octeon-sdk/cvmx-csr.h head/sys/contrib/octeon-sdk/cvmx-dfa.c head/sys/contrib/octeon-sdk/cvmx-dfa.h head/sys/contrib/octeon-sdk/cvmx-dma-engine.c head/sys/contrib/octeon-sdk/cvmx-dma-engine.h head/sys/contrib/octeon-sdk/cvmx-ebt3000.c head/sys/contrib/octeon-sdk/cvmx-ebt3000.h head/sys/contrib/octeon-sdk/cvmx-fau.h head/sys/contrib/octeon-sdk/cvmx-flash.c head/sys/contrib/octeon-sdk/cvmx-flash.h head/sys/contrib/octeon-sdk/cvmx-fpa.c head/sys/contrib/octeon-sdk/cvmx-fpa.h head/sys/contrib/octeon-sdk/cvmx-gmx.h head/sys/contrib/octeon-sdk/cvmx-gpio.h head/sys/contrib/octeon-sdk/cvmx-helper-board.c head/sys/contrib/octeon-sdk/cvmx-helper-board.h head/sys/contrib/octeon-sdk/cvmx-helper-check-defines.h head/sys/contrib/octeon-sdk/cvmx-helper-errata.c head/sys/contrib/octeon-sdk/cvmx-helper-errata.h head/sys/contrib/octeon-sdk/cvmx-helper-fpa.c head/sys/contrib/octeon-sdk/cvmx-helper-fpa.h head/sys/contrib/octeon-sdk/cvmx-helper-loop.c head/sys/contrib/octeon-sdk/cvmx-helper-loop.h head/sys/contrib/octeon-sdk/cvmx-helper-npi.c head/sys/contrib/octeon-sdk/cvmx-helper-npi.h head/sys/contrib/octeon-sdk/cvmx-helper-rgmii.c head/sys/contrib/octeon-sdk/cvmx-helper-rgmii.h head/sys/contrib/octeon-sdk/cvmx-helper-sgmii.c head/sys/contrib/octeon-sdk/cvmx-helper-sgmii.h head/sys/contrib/octeon-sdk/cvmx-helper-spi.c head/sys/contrib/octeon-sdk/cvmx-helper-spi.h head/sys/contrib/octeon-sdk/cvmx-helper-util.c head/sys/contrib/octeon-sdk/cvmx-helper-util.h head/sys/contrib/octeon-sdk/cvmx-helper-xaui.c head/sys/contrib/octeon-sdk/cvmx-helper-xaui.h head/sys/contrib/octeon-sdk/cvmx-helper.c head/sys/contrib/octeon-sdk/cvmx-helper.h head/sys/contrib/octeon-sdk/cvmx-higig.h head/sys/contrib/octeon-sdk/cvmx-interrupt.c head/sys/contrib/octeon-sdk/cvmx-interrupt.h head/sys/contrib/octeon-sdk/cvmx-ipd.h head/sys/contrib/octeon-sdk/cvmx-key.h head/sys/contrib/octeon-sdk/cvmx-l2c.c head/sys/contrib/octeon-sdk/cvmx-l2c.h head/sys/contrib/octeon-sdk/cvmx-llm.c head/sys/contrib/octeon-sdk/cvmx-llm.h head/sys/contrib/octeon-sdk/cvmx-log.c head/sys/contrib/octeon-sdk/cvmx-log.h head/sys/contrib/octeon-sdk/cvmx-malloc.h head/sys/contrib/octeon-sdk/cvmx-mdio.h head/sys/contrib/octeon-sdk/cvmx-mgmt-port.c head/sys/contrib/octeon-sdk/cvmx-mgmt-port.h head/sys/contrib/octeon-sdk/cvmx-nand.c head/sys/contrib/octeon-sdk/cvmx-nand.h head/sys/contrib/octeon-sdk/cvmx-npi.h head/sys/contrib/octeon-sdk/cvmx-packet.h head/sys/contrib/octeon-sdk/cvmx-pci.h head/sys/contrib/octeon-sdk/cvmx-pcie.c head/sys/contrib/octeon-sdk/cvmx-pcie.h head/sys/contrib/octeon-sdk/cvmx-pip.h head/sys/contrib/octeon-sdk/cvmx-pko.c head/sys/contrib/octeon-sdk/cvmx-pko.h head/sys/contrib/octeon-sdk/cvmx-platform.h head/sys/contrib/octeon-sdk/cvmx-pow.c head/sys/contrib/octeon-sdk/cvmx-pow.h head/sys/contrib/octeon-sdk/cvmx-raid.c head/sys/contrib/octeon-sdk/cvmx-raid.h head/sys/contrib/octeon-sdk/cvmx-rng.h head/sys/contrib/octeon-sdk/cvmx-rtc.h head/sys/contrib/octeon-sdk/cvmx-rwlock.h head/sys/contrib/octeon-sdk/cvmx-scratch.h head/sys/contrib/octeon-sdk/cvmx-spi.c head/sys/contrib/octeon-sdk/cvmx-spi.h head/sys/contrib/octeon-sdk/cvmx-spi4000.c head/sys/contrib/octeon-sdk/cvmx-spinlock.h head/sys/contrib/octeon-sdk/cvmx-swap.h head/sys/contrib/octeon-sdk/cvmx-sysinfo.c head/sys/contrib/octeon-sdk/cvmx-sysinfo.h head/sys/contrib/octeon-sdk/cvmx-thunder.c head/sys/contrib/octeon-sdk/cvmx-thunder.h head/sys/contrib/octeon-sdk/cvmx-tim.c head/sys/contrib/octeon-sdk/cvmx-tim.h head/sys/contrib/octeon-sdk/cvmx-tra.c head/sys/contrib/octeon-sdk/cvmx-tra.h head/sys/contrib/octeon-sdk/cvmx-twsi.c head/sys/contrib/octeon-sdk/cvmx-twsi.h head/sys/contrib/octeon-sdk/cvmx-uart.h head/sys/contrib/octeon-sdk/cvmx-usb.c head/sys/contrib/octeon-sdk/cvmx-usb.h head/sys/contrib/octeon-sdk/cvmx-utils.h head/sys/contrib/octeon-sdk/cvmx-version.h head/sys/contrib/octeon-sdk/cvmx-warn.c head/sys/contrib/octeon-sdk/cvmx-warn.h head/sys/contrib/octeon-sdk/cvmx-wqe.h head/sys/contrib/octeon-sdk/cvmx-zip.c head/sys/contrib/octeon-sdk/cvmx-zip.h head/sys/contrib/octeon-sdk/cvmx-zone.c head/sys/contrib/octeon-sdk/cvmx.h head/sys/contrib/octeon-sdk/octeon-feature.h head/sys/contrib/octeon-sdk/octeon-model.c head/sys/contrib/octeon-sdk/octeon-model.h head/sys/contrib/octeon-sdk/octeon-pci-console.c head/sys/contrib/octeon-sdk/octeon-pci-console.h head/sys/mips/cavium/files.octeon1 head/sys/mips/cavium/octe/ethernet.c head/sys/mips/cavium/octe/wrapper-cvmx-includes.h head/sys/mips/cavium/octeon_machdep.c Directory Properties: head/sys/contrib/octeon-sdk/ (props changed) Modified: head/sys/contrib/octeon-sdk/cvmip.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmip.h Sun Nov 28 08:11:05 2010 (r215989) +++ head/sys/contrib/octeon-sdk/cvmip.h Sun Nov 28 08:18:16 2010 (r215990) @@ -1,39 +1,40 @@ /***********************license start*************** - * Copyright (c) 2003-2008 Cavium Networks (support@cavium.com). All rights - * reserved. + * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). 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 Cavium Networks nor the names of - * its contributors may be used to endorse or promote products - * derived from this software without specific prior written - * permission. - * - * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" - * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS - * OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH - * RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY - * REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT - * DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES - * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR - * PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET - * POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT - * OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU. - * - * - * For any questions regarding licensing please contact marketing@caviumnetworks.com - * + * 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 Cavium Networks 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, including technical data, may be subject to U.S. export control + * laws, including the U.S. Export Administration Act and its associated + * regulations, and may be subject to export or import regulations in other + * countries. + + * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" + * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR + * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO + * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR + * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM + * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, + * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF + * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR + * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR + * PERFORMANCE OF THE SOFTWARE LIES WITH YOU. ***********************license end**************************************/ @@ -41,6 +42,7 @@ + /** * @file * @@ -48,7 +50,7 @@ * * Definitions for the Internet Protocol (IP) support. * - *
$Revision: 41586 $
+ *
$Revision: 49448 $
* */ Modified: head/sys/contrib/octeon-sdk/cvmx-abi.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-abi.h Sun Nov 28 08:11:05 2010 (r215989) +++ head/sys/contrib/octeon-sdk/cvmx-abi.h Sun Nov 28 08:18:16 2010 (r215990) @@ -1,39 +1,40 @@ /***********************license start*************** - * Copyright (c) 2003-2008 Cavium Networks (support@cavium.com). All rights - * reserved. + * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). 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 Cavium Networks nor the names of - * its contributors may be used to endorse or promote products - * derived from this software without specific prior written - * permission. - * - * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" - * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS - * OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH - * RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY - * REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT - * DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES - * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR - * PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET - * POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT - * OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU. - * - * - * For any questions regarding licensing please contact marketing@caviumnetworks.com - * + * 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 Cavium Networks 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, including technical data, may be subject to U.S. export control + * laws, including the U.S. Export Administration Act and its associated + * regulations, and may be subject to export or import regulations in other + * countries. + + * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" + * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR + * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO + * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR + * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM + * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, + * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF + * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR + * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR + * PERFORMANCE OF THE SOFTWARE LIES WITH YOU. ***********************license end**************************************/ @@ -41,12 +42,13 @@ + /** * @file * * This file defines macros for use in determining the current calling ABI. * - *
$Revision: 41586 $
+ *
$Revision: 49448 $
*/ #ifndef __CVMX_ABI_H__ Modified: head/sys/contrib/octeon-sdk/cvmx-access-native.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-access-native.h Sun Nov 28 08:11:05 2010 (r215989) +++ head/sys/contrib/octeon-sdk/cvmx-access-native.h Sun Nov 28 08:18:16 2010 (r215990) @@ -1,41 +1,43 @@ /***********************license start*************** - * Copyright (c) 2003-2009 Cavium Networks (support@cavium.com). All rights - * reserved. + * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). 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 Cavium Networks nor the names of - * its contributors may be used to endorse or promote products - * derived from this software without specific prior written - * permission. - * - * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" - * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS - * OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH - * RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY - * REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT - * DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES - * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR - * PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET - * POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT - * OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU. - * - * - * For any questions regarding licensing please contact marketing@caviumnetworks.com - * + * 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 Cavium Networks 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, including technical data, may be subject to U.S. export control + * laws, including the U.S. Export Administration Act and its associated + * regulations, and may be subject to export or import regulations in other + * countries. + + * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" + * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR + * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO + * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR + * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM + * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, + * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF + * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR + * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR + * PERFORMANCE OF THE SOFTWARE LIES WITH YOU. ***********************license end**************************************/ + /** * @file * Functions for accessing memory and CSRs on Octeon when we are compiling @@ -81,9 +83,24 @@ static inline uint64_t cvmx_ptr_to_phys( cvmx_warn_if(ptr==NULL, "cvmx_ptr_to_phys() passed a NULL pointer\n"); #ifdef CVMX_BUILD_FOR_UBOOT - /* U-boot is a special case, as it is running in error level, which disables the TLB completely. - ** U-boot may use kseg0 addresses, or may directly use physical addresses already */ - return(CAST64(ptr) & 0x7FFFFFFF); + uint64_t uboot_tlb_ptr_to_phys(void *ptr); + + if (((uint32_t)ptr) < 0x80000000) + { + /* Handle useg (unmapped due to ERL) here*/ + return(CAST64(ptr) & 0x7FFFFFFF); + } + else if (((uint32_t)ptr) < 0xC0000000) + { + /* Here we handle KSEG0/KSEG1 _pointers_. We know we are dealing + ** with 32 bit only values, so we treat them that way. Note that + ** a cvmx_phys_to_ptr(cvmx_ptr_to_phys(X)) will not return X in this case, + ** but the physical address of the KSEG0/KSEG1 address. */ + return(CAST64(ptr) & 0x1FFFFFFF); + } + else + return(uboot_tlb_ptr_to_phys(ptr)); /* Should not get get here in !TLB case */ + #endif #ifdef __linux__ @@ -166,14 +183,49 @@ static inline void *cvmx_phys_to_ptr(uin cvmx_warn_if(physical_address==0, "cvmx_phys_to_ptr() passed a zero address\n"); #ifdef CVMX_BUILD_FOR_UBOOT - /* U-boot is a special case, as it is running in error level, which disables the TLB completely. - ** U-boot may use kseg0 addresses, or may directly use physical addresses already */ +#if !CONFIG_OCTEON_UBOOT_TLB if (physical_address >= 0x80000000) return NULL; else return CASTPTR(void, (physical_address & 0x7FFFFFFF)); #endif + /* U-boot is a special case, as it is running in 32 bit mode, using the TLB to map code/data + ** which can have a physical address above the 32 bit address space. 1-1 mappings are used + ** to allow the low 2 GBytes to be accessed as in error level. + ** + ** NOTE: This conversion can cause problems in u-boot, as users may want to enter addresses + ** like 0xBFC00000 (kseg1 boot bus address), which is a valid 64 bit physical address, + ** but is likely intended to be a boot bus address. */ + + if (physical_address < 0x80000000) + { + /* Handle useg here. ERL is set, so useg is unmapped. This is the only physical + ** address range that is directly addressable by u-boot. */ + return CASTPTR(void, physical_address); + } + else + { + DECLARE_GLOBAL_DATA_PTR; + extern char uboot_start; + /* Above 0x80000000 we can only support one case - a physical address + ** that is mapped for u-boot code/data. We check against the u-boot mem range, + ** and return NULL if it is out of this range. + */ + if (physical_address >= gd->bd->bi_uboot_ram_addr + && physical_address < gd->bd->bi_uboot_ram_addr + gd->bd->bi_uboot_ram_used_size) + { + return ((char *)&uboot_start + (physical_address - gd->bd->bi_uboot_ram_addr)); + } + else + return(NULL); + } + + if (physical_address >= 0x80000000) + return NULL; + else +#endif + #ifdef __linux__ if (sizeof(void*) == 8) { @@ -199,7 +251,8 @@ static inline void *cvmx_phys_to_ptr(uin 2nd 256MB is mapped at 0x10000000 and the rest of memory is 1:1 */ if ((physical_address >= 0x10000000) && (physical_address < 0x20000000)) return CASTPTR(void, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, physical_address)); - else if ((physical_address >= 0x410000000ull) && (physical_address < 0x420000000ull)) + else if (!OCTEON_IS_MODEL(OCTEON_CN6XXX) && (physical_address >= 0x410000000ull) && + (physical_address < 0x420000000ull)) return CASTPTR(void, physical_address - 0x400000000ull); else return CASTPTR(void, physical_address); @@ -464,7 +517,7 @@ static inline void cvmx_write_csr(uint64 /* Perform an immediate read after every write to an RSL register to force the write to complete. It doesn't matter what RSL read we do, so we choose CVMX_MIO_BOOT_BIST_STAT because it is fast and harmless */ - if ((csr_addr >> 40) == (0x800118)) + if (((csr_addr >> 40) & 0x7ffff) == (0x118)) cvmx_read64_uint64(CVMX_MIO_BOOT_BIST_STAT); } @@ -503,7 +556,7 @@ static inline void cvmx_read_csr_async(u /** - * Number of the Core on which the program is currently running. + * Number of the Core on which the program is currently running. * * @return Number of cores */ @@ -548,53 +601,36 @@ static inline int cvmx_dpop(uint64_t val /** - * Provide current cycle counter as a return value + * @deprecated + * Provide current cycle counter as a return value. Deprecated, use + * cvmx_clock_get_count(CVMX_CLOCK_CORE) to get cycle counter. * * @return current cycle counter */ static inline uint64_t cvmx_get_cycle(void) { -#if defined(CVMX_ABI_O32) - uint32_t tmp_low, tmp_hi; - - asm volatile ( - " .set push \n" - " .set mips64r2 \n" - " .set noreorder \n" - " rdhwr %[tmpl], $31 \n" - " dsrl %[tmph], %[tmpl], 32 \n" - " sll %[tmpl], 0 \n" - " sll %[tmph], 0 \n" - " .set pop \n" - : [tmpl] "=&r" (tmp_low), [tmph] "=&r" (tmp_hi) : ); - - return(((uint64_t)tmp_hi << 32) + tmp_low); -#else - uint64_t cycle; - CVMX_RDHWR(cycle, 31); - return(cycle); -#endif + return cvmx_clock_get_count(CVMX_CLOCK_CORE); } /** - * Reads a chip global cycle counter. This counts CPU cycles since - * chip reset. The counter is 64 bit. - * This register does not exist on CN38XX pass 1 silicion + * @deprecated + * Reads a chip global cycle counter. This counts SCLK cycles since + * chip reset. The counter is 64 bit. This function is deprecated as the rate + * of the global cycle counter is different between Octeon+ and Octeon2, use + * cvmx_clock_get_count(CVMX_CLOCK_SCLK) instead. For Octeon2, the clock rate + * of SCLK may be differnet than the core clock. * * @return Global chip cycle count since chip reset. */ static inline uint64_t cvmx_get_cycle_global(void) { - if (OCTEON_IS_MODEL(OCTEON_CN38XX_PASS1)) - return 0; - else - return cvmx_read64_uint64(CVMX_IPD_CLK_COUNT); + return cvmx_clock_get_count(CVMX_CLOCK_IPD); } /** - * Wait for the specified number of cycle + * Wait for the specified number of core clock cycles * * @param cycles */ @@ -616,7 +652,7 @@ static inline void cvmx_wait(uint64_t cy */ static inline void cvmx_wait_usec(uint64_t usec) { - uint64_t done = cvmx_get_cycle() + usec * cvmx_sysinfo_get()->cpu_clock_hz / 1000000; + uint64_t done = cvmx_get_cycle() + usec * cvmx_clock_get_rate(CVMX_CLOCK_CORE) / 1000000; while (cvmx_get_cycle() < done) { /* Spin */ @@ -625,6 +661,22 @@ static inline void cvmx_wait_usec(uint64 /** + * Wait for the specified number of io clock cycles + * + * @param cycles + */ +static inline void cvmx_wait_io(uint64_t cycles) +{ + uint64_t done = cvmx_clock_get_count(CVMX_CLOCK_SCLK) + cycles; + + while (cvmx_clock_get_count(CVMX_CLOCK_SCLK) < done) + { + /* Spin */ + } +} + + +/** * Perform a soft reset of Octeon * * @return Modified: head/sys/contrib/octeon-sdk/cvmx-access.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-access.h Sun Nov 28 08:11:05 2010 (r215989) +++ head/sys/contrib/octeon-sdk/cvmx-access.h Sun Nov 28 08:18:16 2010 (r215990) @@ -1,41 +1,43 @@ /***********************license start*************** - * Copyright (c) 2003-2009 Cavium Networks (support@cavium.com). All rights - * reserved. + * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). 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 Cavium Networks nor the names of - * its contributors may be used to endorse or promote products - * derived from this software without specific prior written - * permission. - * - * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" - * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS - * OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH - * RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY - * REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT - * DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES - * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR - * PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET - * POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT - * OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU. - * - * - * For any questions regarding licensing please contact marketing@caviumnetworks.com - * + * 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 Cavium Networks 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, including technical data, may be subject to U.S. export control + * laws, including the U.S. Export Administration Act and its associated + * regulations, and may be subject to export or import regulations in other + * countries. + + * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" + * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR + * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO + * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR + * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM + * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, + * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF + * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR + * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR + * PERFORMANCE OF THE SOFTWARE LIES WITH YOU. ***********************license end**************************************/ + /** * @file * Function prototypes for accessing memory and CSRs on Octeon. @@ -138,7 +140,7 @@ CVMX_FUNCTION void cvmx_send_single(uint CVMX_FUNCTION void cvmx_read_csr_async(uint64_t scraddr, uint64_t csr_addr); /** - * Number of the Core on which the program is currently running. + * Number of the Core on which the program is currently running. * * @return Number of cores */ @@ -165,23 +167,28 @@ CVMX_FUNCTION uint32_t cvmx_pop(uint32_t CVMX_FUNCTION int cvmx_dpop(uint64_t val); /** - * Provide current cycle counter as a return value + * @deprecated + * Provide current cycle counter as a return value. Deprecated, use + * cvmx_clock_get_count(CVMX_CLOCK_CORE) to get cycle counter. * * @return current cycle counter */ CVMX_FUNCTION uint64_t cvmx_get_cycle(void); /** - * Reads a chip global cycle counter. This counts CPU cycles since - * chip reset. The counter is 64 bit. - * This register does not exist on CN38XX pass 1 silicion + * @deprecated + * Reads a chip global cycle counter. This counts SCLK cycles since + * chip reset. The counter is 64 bit. This function is deprecated as the rate + * of the global cycle counter is different between Octeon+ and Octeon2, use + * cvmx_clock_get_count(CVMX_CLOCK_SCLK) instead. For Octeon2, the clock rate + * of SCLK may be differnet than the core clock. * * @return Global chip cycle count since chip reset. */ -CVMX_FUNCTION uint64_t cvmx_get_cycle_global(void); +CVMX_FUNCTION uint64_t cvmx_get_cycle_global(void) __attribute__((deprecated)); /** - * Wait for the specified number of cycle + * Wait for the specified number of core clock cycles * * @param cycles */ @@ -195,6 +202,13 @@ CVMX_FUNCTION void cvmx_wait(uint64_t cy CVMX_FUNCTION void cvmx_wait_usec(uint64_t usec); /** + * Wait for the specified number of io clock cycles + * + * @param cycles + */ +CVMX_FUNCTION void cvmx_wait_io(uint64_t cycles); + +/** * Perform a soft reset of Octeon * * @return Modified: head/sys/contrib/octeon-sdk/cvmx-address.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-address.h Sun Nov 28 08:11:05 2010 (r215989) +++ head/sys/contrib/octeon-sdk/cvmx-address.h Sun Nov 28 08:18:16 2010 (r215990) @@ -1,41 +1,43 @@ /***********************license start*************** - * Copyright (c) 2003-2009 Cavium Networks (support@cavium.com). All rights - * reserved. + * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). 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 Cavium Networks nor the names of - * its contributors may be used to endorse or promote products - * derived from this software without specific prior written - * permission. - * - * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" - * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS - * OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH - * RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY - * REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT - * DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES - * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR - * PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET - * POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT - * OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU. - * - * - * For any questions regarding licensing please contact marketing@caviumnetworks.com - * + * 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 Cavium Networks 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, including technical data, may be subject to U.S. export control + * laws, including the U.S. Export Administration Act and its associated + * regulations, and may be subject to export or import regulations in other + * countries. + + * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" + * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR + * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO + * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR + * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM + * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, + * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF + * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR + * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR + * PERFORMANCE OF THE SOFTWARE LIES WITH YOU. ***********************license end**************************************/ + /** * @file * Typedefs and defines for working with Octeon physical addresses. @@ -63,29 +65,27 @@ typedef enum { CVMX_MIPS_XKSEG_SPACE_KSEG3 = 3LL } cvmx_mips_xkseg_space_t; -// decodes <14:13> of a kseg3 window address + /* decodes <14:13> of a kseg3 window address */ typedef enum { CVMX_ADD_WIN_SCR = 0L, - CVMX_ADD_WIN_DMA = 1L, // see cvmx_add_win_dma_dec_t for further decode + CVMX_ADD_WIN_DMA = 1L, /* see cvmx_add_win_dma_dec_t for further decode */ CVMX_ADD_WIN_UNUSED = 2L, CVMX_ADD_WIN_UNUSED2 = 3L } cvmx_add_win_dec_t; -// decode within DMA space + /* decode within DMA space */ typedef enum { - CVMX_ADD_WIN_DMA_ADD = 0L, // add store data to the write buffer entry, allocating it if necessary - CVMX_ADD_WIN_DMA_SENDMEM = 1L, // send out the write buffer entry to DRAM - // store data must be normal DRAM memory space address in this case - CVMX_ADD_WIN_DMA_SENDDMA = 2L, // send out the write buffer entry as an IOBDMA command - // see CVMX_ADD_WIN_DMA_SEND_DEC for data contents - CVMX_ADD_WIN_DMA_SENDIO = 3L, // send out the write buffer entry as an IO write - // store data must be normal IO space address in this case - CVMX_ADD_WIN_DMA_SENDSINGLE = 4L, // send out a single-tick command on the NCB bus - // no write buffer data needed/used + CVMX_ADD_WIN_DMA_ADD = 0L, /* add store data to the write buffer entry, allocating it if necessary */ + CVMX_ADD_WIN_DMA_SENDMEM = 1L, /* send out the write buffer entry to DRAM */ + /* store data must be normal DRAM memory space address in this case */ + CVMX_ADD_WIN_DMA_SENDDMA = 2L, /* send out the write buffer entry as an IOBDMA command */ + /* see CVMX_ADD_WIN_DMA_SEND_DEC for data contents */ + CVMX_ADD_WIN_DMA_SENDIO = 3L, /* send out the write buffer entry as an IO write */ + /* store data must be normal IO space address in this case */ + CVMX_ADD_WIN_DMA_SENDSINGLE = 4L, /* send out a single-tick command on the NCB bus */ + /* no write buffer data needed/used */ } cvmx_add_win_dma_dec_t; - - /** * Physical Address Decode * @@ -116,63 +116,63 @@ typedef union { struct { cvmx_mips_space_t R : 2; uint64_t offset :62; - } sva; // mapped or unmapped virtual address + } sva; /* mapped or unmapped virtual address */ struct { uint64_t zeroes :33; uint64_t offset :31; - } suseg; // mapped USEG virtual addresses (typically) + } suseg; /* mapped USEG virtual addresses (typically) */ struct { uint64_t ones :33; cvmx_mips_xkseg_space_t sp : 2; uint64_t offset :29; - } sxkseg; // mapped or unmapped virtual address + } sxkseg; /* mapped or unmapped virtual address */ struct { - cvmx_mips_space_t R : 2; // CVMX_MIPS_SPACE_XKPHYS in this case - uint64_t cca : 3; // ignored by octeon + cvmx_mips_space_t R : 2; /* CVMX_MIPS_SPACE_XKPHYS in this case */ + uint64_t cca : 3; /* ignored by octeon */ uint64_t mbz :10; - uint64_t pa :49; // physical address - } sxkphys; // physical address accessed through xkphys unmapped virtual address + uint64_t pa :49; /* physical address */ + } sxkphys; /* physical address accessed through xkphys unmapped virtual address */ struct { uint64_t mbz :15; - uint64_t is_io : 1; // if set, the address is uncached and resides on MCB bus - uint64_t did : 8; // the hardware ignores this field when is_io==0, else device ID - uint64_t unaddr: 4; // the hardware ignores <39:36> in Octeon I + uint64_t is_io : 1; /* if set, the address is uncached and resides on MCB bus */ + uint64_t did : 8; /* the hardware ignores this field when is_io==0, else device ID */ + uint64_t unaddr: 4; /* the hardware ignores <39:36> in Octeon I */ uint64_t offset :36; - } sphys; // physical address + } sphys; /* physical address */ struct { - uint64_t zeroes :24; // techically, <47:40> are dont-cares - uint64_t unaddr: 4; // the hardware ignores <39:36> in Octeon I + uint64_t zeroes :24; /* techically, <47:40> are dont-cares */ + uint64_t unaddr: 4; /* the hardware ignores <39:36> in Octeon I */ uint64_t offset :36; - } smem; // physical mem address + } smem; /* physical mem address */ struct { uint64_t mem_region :2; uint64_t mbz :13; - uint64_t is_io : 1; // 1 in this case - uint64_t did : 8; // the hardware ignores this field when is_io==0, else device ID - uint64_t unaddr: 4; // the hardware ignores <39:36> in Octeon I + uint64_t is_io : 1; /* 1 in this case */ + uint64_t did : 8; /* the hardware ignores this field when is_io==0, else device ID */ + uint64_t unaddr: 4; /* the hardware ignores <39:36> in Octeon I */ uint64_t offset :36; - } sio; // physical IO address + } sio; /* physical IO address */ struct { uint64_t ones : 49; - cvmx_add_win_dec_t csrdec : 2; // CVMX_ADD_WIN_SCR (0) in this case + cvmx_add_win_dec_t csrdec : 2; /* CVMX_ADD_WIN_SCR (0) in this case */ uint64_t addr : 13; - } sscr; // scratchpad virtual address - accessed through a window at the end of kseg3 + } sscr; /* scratchpad virtual address - accessed through a window at the end of kseg3 */ - // there should only be stores to IOBDMA space, no loads + /* there should only be stores to IOBDMA space, no loads */ struct { uint64_t ones : 49; - cvmx_add_win_dec_t csrdec : 2; // CVMX_ADD_WIN_DMA (1) in this case + cvmx_add_win_dec_t csrdec : 2; /* CVMX_ADD_WIN_DMA (1) in this case */ uint64_t unused2: 3; cvmx_add_win_dma_dec_t type : 3; uint64_t addr : 7; - } sdma; // IOBDMA virtual address - accessed through a window at the end of kseg3 + } sdma; /* IOBDMA virtual address - accessed through a window at the end of kseg3 */ struct { uint64_t didspace : 24; @@ -203,8 +203,8 @@ typedef union { #define CVMX_FULL_DID(did,subdid) (((did) << 3) | (subdid)) -// from include/ncb_rsl_id.v -#define CVMX_OCT_DID_MIS 0ULL // misc stuff + /* from include/ncb_rsl_id.v */ +#define CVMX_OCT_DID_MIS 0ULL /* misc stuff */ #define CVMX_OCT_DID_GMX0 1ULL #define CVMX_OCT_DID_GMX1 2ULL #define CVMX_OCT_DID_PCI 3ULL @@ -217,7 +217,7 @@ typedef union { #define CVMX_OCT_DID_PKT 10ULL #define CVMX_OCT_DID_TIM 11ULL #define CVMX_OCT_DID_TAG 12ULL -// the rest are not on the IO bus + /* the rest are not on the IO bus */ #define CVMX_OCT_DID_L2C 16ULL #define CVMX_OCT_DID_LMC 17ULL #define CVMX_OCT_DID_SPX0 18ULL Copied: head/sys/contrib/octeon-sdk/cvmx-agl-defs.h (from r215989, vendor-sys/octeon-sdk/dist/cvmx-agl-defs.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/octeon-sdk/cvmx-agl-defs.h Sun Nov 28 08:18:16 2010 (r215990, copy of r215989, vendor-sys/octeon-sdk/dist/cvmx-agl-defs.h) @@ -0,0 +1,4615 @@ +/***********************license start*************** + * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). 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 Cavium Networks 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, including technical data, may be subject to U.S. export control + * laws, including the U.S. Export Administration Act and its associated + * regulations, and may be subject to export or import regulations in other + * countries. + + * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" + * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR + * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO + * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR + * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM + * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, + * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF + * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR + * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR + * PERFORMANCE OF THE SOFTWARE LIES WITH YOU. + ***********************license end**************************************/ + + +/** + * cvmx-agl-defs.h + * + * Configuration and status register (CSR) type definitions for + * Octeon agl. + * + * This file is auto generated. Do not edit. + * + *
$Revision$
+ * + */ +#ifndef __CVMX_AGL_TYPEDEFS_H__ +#define __CVMX_AGL_TYPEDEFS_H__ + +#if CVMX_ENABLE_CSR_ADDRESS_CHECKING +#define CVMX_AGL_GMX_BAD_REG CVMX_AGL_GMX_BAD_REG_FUNC() +static inline uint64_t CVMX_AGL_GMX_BAD_REG_FUNC(void) +{ + if (!(OCTEON_IS_MODEL(OCTEON_CN52XX) || OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN63XX))) + cvmx_warn("CVMX_AGL_GMX_BAD_REG not supported on this chip\n"); + return CVMX_ADD_IO_SEG(0x00011800E0000518ull); +} +#else +#define CVMX_AGL_GMX_BAD_REG (CVMX_ADD_IO_SEG(0x00011800E0000518ull)) +#endif +#if CVMX_ENABLE_CSR_ADDRESS_CHECKING +#define CVMX_AGL_GMX_BIST CVMX_AGL_GMX_BIST_FUNC() +static inline uint64_t CVMX_AGL_GMX_BIST_FUNC(void) +{ + if (!(OCTEON_IS_MODEL(OCTEON_CN52XX) || OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN63XX))) + cvmx_warn("CVMX_AGL_GMX_BIST not supported on this chip\n"); + return CVMX_ADD_IO_SEG(0x00011800E0000400ull); +} +#else +#define CVMX_AGL_GMX_BIST (CVMX_ADD_IO_SEG(0x00011800E0000400ull)) +#endif +#if CVMX_ENABLE_CSR_ADDRESS_CHECKING +#define CVMX_AGL_GMX_DRV_CTL CVMX_AGL_GMX_DRV_CTL_FUNC() +static inline uint64_t CVMX_AGL_GMX_DRV_CTL_FUNC(void) +{ + if (!(OCTEON_IS_MODEL(OCTEON_CN52XX) || OCTEON_IS_MODEL(OCTEON_CN56XX))) + cvmx_warn("CVMX_AGL_GMX_DRV_CTL not supported on this chip\n"); + return CVMX_ADD_IO_SEG(0x00011800E00007F0ull); +} +#else +#define CVMX_AGL_GMX_DRV_CTL (CVMX_ADD_IO_SEG(0x00011800E00007F0ull)) +#endif +#if CVMX_ENABLE_CSR_ADDRESS_CHECKING +#define CVMX_AGL_GMX_INF_MODE CVMX_AGL_GMX_INF_MODE_FUNC() +static inline uint64_t CVMX_AGL_GMX_INF_MODE_FUNC(void) +{ + if (!(OCTEON_IS_MODEL(OCTEON_CN52XX) || OCTEON_IS_MODEL(OCTEON_CN56XX))) + cvmx_warn("CVMX_AGL_GMX_INF_MODE not supported on this chip\n"); + return CVMX_ADD_IO_SEG(0x00011800E00007F8ull); +} +#else +#define CVMX_AGL_GMX_INF_MODE (CVMX_ADD_IO_SEG(0x00011800E00007F8ull)) +#endif +#if CVMX_ENABLE_CSR_ADDRESS_CHECKING +static inline uint64_t CVMX_AGL_GMX_PRTX_CFG(unsigned long offset) +{ + if (!( + (OCTEON_IS_MODEL(OCTEON_CN52XX) && ((offset <= 1))) || + (OCTEON_IS_MODEL(OCTEON_CN56XX) && ((offset == 0))) || + (OCTEON_IS_MODEL(OCTEON_CN63XX) && ((offset <= 1))))) + cvmx_warn("CVMX_AGL_GMX_PRTX_CFG(%lu) is invalid on this chip\n", offset); + return CVMX_ADD_IO_SEG(0x00011800E0000010ull) + ((offset) & 1) * 2048; +} +#else +#define CVMX_AGL_GMX_PRTX_CFG(offset) (CVMX_ADD_IO_SEG(0x00011800E0000010ull) + ((offset) & 1) * 2048) +#endif +#if CVMX_ENABLE_CSR_ADDRESS_CHECKING +static inline uint64_t CVMX_AGL_GMX_RXX_ADR_CAM0(unsigned long offset) +{ + if (!( + (OCTEON_IS_MODEL(OCTEON_CN52XX) && ((offset <= 1))) || + (OCTEON_IS_MODEL(OCTEON_CN56XX) && ((offset == 0))) || + (OCTEON_IS_MODEL(OCTEON_CN63XX) && ((offset <= 1))))) + cvmx_warn("CVMX_AGL_GMX_RXX_ADR_CAM0(%lu) is invalid on this chip\n", offset); + return CVMX_ADD_IO_SEG(0x00011800E0000180ull) + ((offset) & 1) * 2048; +} +#else +#define CVMX_AGL_GMX_RXX_ADR_CAM0(offset) (CVMX_ADD_IO_SEG(0x00011800E0000180ull) + ((offset) & 1) * 2048) +#endif +#if CVMX_ENABLE_CSR_ADDRESS_CHECKING +static inline uint64_t CVMX_AGL_GMX_RXX_ADR_CAM1(unsigned long offset) +{ + if (!( + (OCTEON_IS_MODEL(OCTEON_CN52XX) && ((offset <= 1))) || + (OCTEON_IS_MODEL(OCTEON_CN56XX) && ((offset == 0))) || + (OCTEON_IS_MODEL(OCTEON_CN63XX) && ((offset <= 1))))) + cvmx_warn("CVMX_AGL_GMX_RXX_ADR_CAM1(%lu) is invalid on this chip\n", offset); + return CVMX_ADD_IO_SEG(0x00011800E0000188ull) + ((offset) & 1) * 2048; +} +#else +#define CVMX_AGL_GMX_RXX_ADR_CAM1(offset) (CVMX_ADD_IO_SEG(0x00011800E0000188ull) + ((offset) & 1) * 2048) +#endif +#if CVMX_ENABLE_CSR_ADDRESS_CHECKING +static inline uint64_t CVMX_AGL_GMX_RXX_ADR_CAM2(unsigned long offset) +{ + if (!( + (OCTEON_IS_MODEL(OCTEON_CN52XX) && ((offset <= 1))) || + (OCTEON_IS_MODEL(OCTEON_CN56XX) && ((offset == 0))) || + (OCTEON_IS_MODEL(OCTEON_CN63XX) && ((offset <= 1))))) + cvmx_warn("CVMX_AGL_GMX_RXX_ADR_CAM2(%lu) is invalid on this chip\n", offset); + return CVMX_ADD_IO_SEG(0x00011800E0000190ull) + ((offset) & 1) * 2048; +} +#else +#define CVMX_AGL_GMX_RXX_ADR_CAM2(offset) (CVMX_ADD_IO_SEG(0x00011800E0000190ull) + ((offset) & 1) * 2048) +#endif +#if CVMX_ENABLE_CSR_ADDRESS_CHECKING +static inline uint64_t CVMX_AGL_GMX_RXX_ADR_CAM3(unsigned long offset) +{ + if (!( + (OCTEON_IS_MODEL(OCTEON_CN52XX) && ((offset <= 1))) || + (OCTEON_IS_MODEL(OCTEON_CN56XX) && ((offset == 0))) || + (OCTEON_IS_MODEL(OCTEON_CN63XX) && ((offset <= 1))))) + cvmx_warn("CVMX_AGL_GMX_RXX_ADR_CAM3(%lu) is invalid on this chip\n", offset); + return CVMX_ADD_IO_SEG(0x00011800E0000198ull) + ((offset) & 1) * 2048; +} +#else +#define CVMX_AGL_GMX_RXX_ADR_CAM3(offset) (CVMX_ADD_IO_SEG(0x00011800E0000198ull) + ((offset) & 1) * 2048) +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 09:35:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D36B106566B; Sun, 28 Nov 2010 09:35:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A7788FC14; Sun, 28 Nov 2010 09:35:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAS9Zu2Y093079; Sun, 28 Nov 2010 09:35:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAS9ZuiW093076; Sun, 28 Nov 2010 09:35:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201011280935.oAS9ZuiW093076@svn.freebsd.org> From: Xin LI Date: Sun, 28 Nov 2010 09:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215991 - head/share/syscons/fonts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 09:35:56 -0000 Author: delphij Date: Sun Nov 28 09:35:56 2010 New Revision: 215991 URL: http://svn.freebsd.org/changeset/base/215991 Log: Add a manual shrinked version of swiss-8x16 as swiss-8x14. MFC after: 2 months Added: head/share/syscons/fonts/swiss-8x14.fnt (contents, props changed) Modified: head/share/syscons/fonts/Makefile Modified: head/share/syscons/fonts/Makefile ============================================================================== --- head/share/syscons/fonts/Makefile Sun Nov 28 08:18:16 2010 (r215990) +++ head/share/syscons/fonts/Makefile Sun Nov 28 09:35:56 2010 (r215991) @@ -26,7 +26,7 @@ FILES= armscii8-8x8.fnt armscii8-8x14.fn koi8-r-8x8.fnt koi8-r-8x14.fnt koi8-r-8x16.fnt \ koi8-rb-8x16.fnt koi8-rc-8x16.fnt \ koi8-u-8x8.fnt koi8-u-8x14.fnt koi8-u-8x16.fnt \ - swiss-8x16.fnt swiss-8x8.fnt \ + swiss-8x16.fnt swiss-8x14.fnt swiss-8x8.fnt \ swiss-1251-8x16.fnt swiss-1131-8x16.fnt \ INDEX.fonts Added: head/share/syscons/fonts/swiss-8x14.fnt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/syscons/fonts/swiss-8x14.fnt Sun Nov 28 09:35:56 2010 (r215991) @@ -0,0 +1,84 @@ +# $FreeBSD$ +begin 644 swiss-8x14 +M````````$```````````/$*!YZ69@9E"/``````\?O^9V^?_YWX\``````!L +M_O[^_OY\.!`````````0.'S^?#@0```````X.!#6_M80.'Q\`````!`X?/[^ +M5!`X?'P``````````!@\/!@``````/______Y\/#Y_______`````#QF0D)F +M/`````#_____PYF]O9G#_____P`>#AHP>,S,S,QX`````#QF9F8\&'X8&!@` +M```@,#@\-C8P'Q^?'AP8$`````"!@X>/GX^'@X&`@`````8/'X8&!@8?CP8````9F9F +M9F9F9@!F9@````!^]/3T=!04%!04````'C!XW,[G#'@````````````` +M_O[^_@`````8/'X8&!@8&'X\&`#_`!@\?A@8&!@8&!@8````&!@8&!@8&!A^ +M/!@````````,!O\&#````````````#!@_V`P````````,V;N```````````` +M```````D9O]F)```````````&#P\?G[__P````````#__WY^/#P8```````` +M`````````````````!@8&!@8&!@``!@8````=V;,``````````````!L;&S^ +M;&QL_FQL;```$'S6T-!P.!P6%M9\$```QL8,#!@P,&!@QL8````X;&PX<-;< +MS,S,=@```!P8,``````````````,&!@P,#`P,#`P&!@,`#`8&`P,#`P,#`P8 +M&#```````!@8_SP\9@``````````&!A^&!@````````````````````<&#`` +M````````?@``````````````````````&!@```,#!@8,#!@8,#!@8,#``'S& +MQL;6UM;&QL9\````&!@X>!@8&!@8&'X```!\Q@8&#!@P8,#`_@```'S&!@8\ +M!@8&!L9\````#`S,S,S,_@P,#`P```#^P,#`_`8&!@;&?````#Q@P,#\QL;& +MQL9\````_@8&#`P8&#`P,#````!\QL;&?,;&QL;&?````'S&QL;&?@8&#!AP +M```````8&``````8&````````!@8`````!P8,`````8,&#!@P&`P&`P&```` +M`````'X``'X```````#`8#`8#`8,&#!@P````'S&!@8,&#`P`#`P````?,;& +MQM[>WM[!@8&!@8&QL;&?````,;&S-CPX/#8S,;&````P,#`P,#`P,#`P/X```#& +M[O[^UM;&QL;&Q@```,;F]O[>SL;&QL;&````?,;&QL;&QL;&QGP```#\QL;& +MQOS`P,#`P````'S&QL;&QL;&]MY\#`8`_,;&QL;\V,S,QL8```!\QL#`8#@, +M!@;&?````/\8&!@8&!@8&!@8````QL;&QL;&QL;&QGP```#&QL;&QFQL;#@X +M$````,;&QL;&UM;^[L;&````QL9L;#@X.&QLQL8```##PV9F/#P8&!@8&``` +M`/X&#`P8&#!@8,#^````/#`P,#`P,#`P,#P``,#`8&`P,!@8#`P&!@,#`#P, +M#`P,#`P,#`P\```0.&S&`````````````````````````````/\``'`P&``` +M`````````````````'P&?L;&QGX```#`P,#`_,;&QL;&_`````````!\QL#` +MP,9\````!@8&!G[&QL;&QGX`````````?,;^P,#&?````#QF8&#P8&!@8&!@ +M````````?L;&QL;&?@;&?`#`P,#`_,;&QL;&Q@```!@8```8&!@8&!@8```` +M!@8```8&!@8&!L;&?```P,#`QLS8\-C,Q@```#@8&!@8&!@8&!@\```````` +M`.S^_M;&QL8`````````_,;&QL;&Q@````````!\QL;&QL9\````````_,;& +MQL;&_,#`P`````!^QL;&QL9^!@8&``````#\QL#`P,#``````````'S`````&#QF`'S&QL;&QGP` +M````;&P`?,;&QL;&?````&`P&`!\QL;&QL9\````&#QF`,;&QL;&QGP```!@ +M,!@`QL;&QL;&?`````!L;`#&QL;&QL9^!@9\;`!\QL;&QL;&QL9\``!L;`#& +MQL;&QL;&QGP`````&!A^P\#`P,-^&!@``#AL8/!@\&!@9OP`````9F9F/!A^ +M&'X8&`````#\QL;&QOS&S\;&!P````X;&!@8/!@8&!C8<``&#!@`?`9^QL;& +M?@````8,&``8&!@8&!@8````!@P8`'S&QL;&QGP````,&#``QL;&QL;&?``` +M``!VW`#\QL;&QL;&````=MP`QN;V_M[.QL;&````?`9^QL;&?@``_@````!\ +MQL;&QL9\``#^`````!@``!@8&`P&QGP``````````/[`P,`````````````` +M_@8&!@``````&#@8&!@`_P`8+!@P/``8.!@8&`#_`!@X:'P8```8```8&!@8 +M&!@8`````````#9LV-AL-@``````````V&PV-FS8`````$011!%$$4011!%$ +M$401JE6J5:I5JE6J5:I5JE5WW7?==]UWW7?==]UWW1@8&!@8&!@8&!@8&!@8 +M&!@8&!@8&/@8&!@8&!@8&!@8&/@8^!@8&!@8V-C8V-C;V-C8V-C8V```` +M`````/XV-C8V-C8``````/@8^!@8&!@8V-C8V]@;V-C8V-C8V-C8V-C8V +M-C8V-C8V-C8``````/X&]C8V-C8V-C8V-C8V]@;^````````-C8V-C8V-OX` +M```````8&!@8&/@8^`````````````````#X&!@8&!@8&!@8&!@8&!\````` +M```8&!@8&!@8_P````````````````#_&!@8&!@8&!@8&!@8&!\8&!@8&!@` +M````````_P```````!@8&!@8&!C_&!@8&!@8&!@8&!@?&!\8&!@8&!@V-C8V +M-C8V-S8V-C8V-C8V-C8V-S`_```````````````_,##`0`````-AL;&QL;```````````>,P8,&#\```````` +=`````'Q\?'Q\?'P````````````0"``````````` +` +end From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 12:13:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 57CF9106566B; Sun, 28 Nov 2010 12:13:38 +0000 (UTC) Date: Sun, 28 Nov 2010 12:13:38 +0000 From: Alexander Best To: Xin LI Message-ID: <20101128121338.GA77896@freebsd.org> References: <201011280935.oAS9ZuiW093076@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="7JfCtLOvnd9MIVvH" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201011280935.oAS9ZuiW093076@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215991 - head/share/syscons/fonts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 12:13:38 -0000 --7JfCtLOvnd9MIVvH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun Nov 28 10, Xin LI wrote: > Author: delphij > Date: Sun Nov 28 09:35:56 2010 > New Revision: 215991 > URL: http://svn.freebsd.org/changeset/base/215991 > > Log: > Add a manual shrinked version of swiss-8x16 as swiss-8x14. while you're at it, could you also commit the following patch? this makes fonts/INDEX.fonts and keymaps/INDEX.keymaps both use the german formal clause and thus makes them consistent. cheers. alex > > MFC after: 2 months > > Added: > head/share/syscons/fonts/swiss-8x14.fnt (contents, props changed) > Modified: > head/share/syscons/fonts/Makefile > > Modified: head/share/syscons/fonts/Makefile > ============================================================================== > --- head/share/syscons/fonts/Makefile Sun Nov 28 08:18:16 2010 (r215990) > +++ head/share/syscons/fonts/Makefile Sun Nov 28 09:35:56 2010 (r215991) > @@ -26,7 +26,7 @@ FILES= armscii8-8x8.fnt armscii8-8x14.fn > koi8-r-8x8.fnt koi8-r-8x14.fnt koi8-r-8x16.fnt \ > koi8-rb-8x16.fnt koi8-rc-8x16.fnt \ > koi8-u-8x8.fnt koi8-u-8x14.fnt koi8-u-8x16.fnt \ > - swiss-8x16.fnt swiss-8x8.fnt \ > + swiss-8x16.fnt swiss-8x14.fnt swiss-8x8.fnt \ > swiss-1251-8x16.fnt swiss-1131-8x16.fnt \ > INDEX.fonts > > > Added: head/share/syscons/fonts/swiss-8x14.fnt > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/syscons/fonts/swiss-8x14.fnt Sun Nov 28 09:35:56 2010 (r215991) > @@ -0,0 +1,84 @@ > +# $FreeBSD$ > +begin 644 swiss-8x14 > +M````````$```````````/$*!YZ69@9E"/``````\?O^9V^?_YWX\``````!L > +M_O[^_OY\.!`````````0.'S^?#@0```````X.!#6_M80.'Q\`````!`X?/[^ > +M5!`X?'P``````````!@\/!@``````/______Y\/#Y_______`````#QF0D)F > +M/`````#_____PYF]O9G#_____P`>#AHP>,S,S,QX`````#QF9F8\&'X8&!@` > +M```@,#@\-C8P +M0&!P>'Q^?'AP8$`````"!@X>/GX^'@X&`@`````8/'X8&!@8?CP8````9F9F > +M9F9F9@!F9@````!^]/3T=!04%!04````'C!XW,[G#'@````````````` > +M_O[^_@`````8/'X8&!@8&'X\&`#_`!@\?A@8&!@8&!@8````&!@8&!@8&!A^ > +M/!@````````,!O\&#````````````#!@_V`P````````,V;N```````````` > +M```````D9O]F)```````````&#P\?G[__P````````#__WY^/#P8```````` > +M`````````````````!@8&!@8&!@``!@8````=V;,``````````````!L;&S^ > +M;&QL_FQL;```$'S6T-!P.!P6%M9\$```QL8,#!@P,&!@QL8````X;&PX<-;< > +MS,S,=@```!P8,``````````````,&!@P,#`P,#`P&!@,`#`8&`P,#`P,#`P8 > +M&#```````!@8_SP\9@``````````&!A^&!@````````````````````<&#`` > +M````````?@``````````````````````&!@```,#!@8,#!@8,#!@8,#``'S& > +MQL;6UM;&QL9\````&!@X>!@8&!@8&'X```!\Q@8&#!@P8,#`_@```'S&!@8\ > +M!@8&!L9\````#`S,S,S,_@P,#`P```#^P,#`_`8&!@;&?````#Q@P,#\QL;& > +MQL9\````_@8&#`P8&#`P,#````!\QL;&?,;&QL;&?````'S&QL;&?@8&#!AP > +M```````8&``````8&````````!@8`````!P8,`````8,&#!@P&`P&`P&```` > +M`````'X``'X```````#`8#`8#`8,&#!@P````'S&!@8,&#`P`#`P````?,;& > +MQM[>WM[ +MP,#`9CP```#XS,;&QL;&QL;,^````/[`P,#\P,#`P,#^````_L#`P/S`P,#` > +MP,`````\9L#`P,[&QL9F/````,;&QL;&_L;&QL;&````/!@8&!@8&!@8&#P` > +M```>!@8&!@8&QL;&?````,;&S-CPX/#8S,;&````P,#`P,#`P,#`P/X```#& > +M[O[^UM;&QL;&Q@```,;F]O[>SL;&QL;&````?,;&QL;&QL;&QGP```#\QL;& > +MQOS`P,#`P````'S&QL;&QL;&]MY\#`8`_,;&QL;\V,S,QL8```!\QL#`8#@, > +M!@;&?````/\8&!@8&!@8&!@8````QL;&QL;&QL;&QGP```#&QL;&QFQL;#@X > +M$````,;&QL;&UM;^[L;&````QL9L;#@X.&QLQL8```##PV9F/#P8&!@8&``` > +M`/X&#`P8&#!@8,#^````/#`P,#`P,#`P,#P``,#`8&`P,!@8#`P&!@,#`#P, > +M#`P,#`P,#`P\```0.&S&`````````````````````````````/\``'`P&``` > +M`````````````````'P&?L;&QGX```#`P,#`_,;&QL;&_`````````!\QL#` > +MP,9\````!@8&!G[&QL;&QGX`````````?,;^P,#&?````#QF8&#P8&!@8&!@ > +M````````?L;&QL;&?@;&?`#`P,#`_,;&QL;&Q@```!@8```8&!@8&!@8```` > +M!@8```8&!@8&!L;&?```P,#`QLS8\-C,Q@```#@8&!@8&!@8&!@\```````` > +M`.S^_M;&QL8`````````_,;&QL;&Q@````````!\QL;&QL9\````````_,;& > +MQL;&_,#`P`````!^QL;&QL9^!@8&``````#\QL#`P,#``````````'S` +M!GP`````$#`P_#`P,#`P'`````````#&QL;&QL9\`````````,;&;&PX.!`` > +M````````QL;&UM;^Q@````````#&;#@X.&S&````````QL;&QL;&?@;&?``` > +M````_@8,&#!@_@````X8&!@P8#`8&!@.```8&!@8&!@8&!@8&!@```!P&!@8 > +M#`8,&!@8<````';<```````````````````0.&S&QL;^```````\9L#`P,#` > +MP&8\&)AP`&QL`,;&QL;&QGP````&#!@`?,;^P,#&?````!@\9@!\!G[&QL9^ > +M`````&QL`'P&?L;&QGX```!@,!@`?`9^QL;&?@```#AL;#@`?`9^QL;&?@`` > +M`````'S&P,#`QGPXF'`8/&8`?,;^P,#&?`````!L;`!\QO[`P,9\````8#`8 > +M`'S&_L#`QGP`````9F8`&!@8&!@8&````!@\9@`8&!@8&!@8````8#`8`!@8 > +M&!@8&!@```!L;!`X;,;&_L;&QL8``#AL;#ALQL;^QL;&Q@``&##^P,#`_,#` > +MP,#^````````?)(2?I"0;@````!^D)"0_)"0D)">````&#QF`'S&QL;&QGP` > +M````;&P`?,;&QL;&?````&`P&`!\QL;&QL9\````&#QF`,;&QL;&QGP```!@ > +M,!@`QL;&QL;&?`````!L;`#&QL;&QL9^!@9\;`!\QL;&QL;&QL9\``!L;`#& > +MQL;&QL;&QGP`````&!A^P\#`P,-^&!@``#AL8/!@\&!@9OP`````9F9F/!A^ > +M&'X8&`````#\QL;&QOS&S\;&!P````X;&!@8/!@8&!C8<``&#!@`?`9^QL;& > +M?@````8,&``8&!@8&!@8````!@P8`'S&QL;&QGP````,&#``QL;&QL;&?``` > +M``!VW`#\QL;&QL;&````=MP`QN;V_M[.QL;&````?`9^QL;&?@``_@````!\ > +MQL;&QL9\``#^`````!@``!@8&`P&QGP``````````/[`P,`````````````` > +M_@8&!@``````&#@8&!@`_P`8+!@P/``8.!@8&`#_`!@X:'P8```8```8&!@8 > +M&!@8`````````#9LV-AL-@``````````V&PV-FS8`````$011!%$$4011!%$ > +M$401JE6J5:I5JE6J5:I5JE5WW7?==]UWW7?==]UWW1@8&!@8&!@8&!@8&!@8 > +M&!@8&!@8&/@8&!@8&!@8&!@8&/@8^!@8&!@8V-C8V-C;V-C8V-C8V```` > +M`````/XV-C8V-C8``````/@8^!@8&!@8V-C8V]@;V-C8V-C8V-C8V-C8V > +M-C8V-C8V-C8``````/X&]C8V-C8V-C8V-C8V]@;^````````-C8V-C8V-OX` > +M```````8&!@8&/@8^`````````````````#X&!@8&!@8&!@8&!@8&!\````` > +M```8&!@8&!@8_P````````````````#_&!@8&!@8&!@8&!@8&!\8&!@8&!@` > +M````````_P```````!@8&!@8&!C_&!@8&!@8&!@8&!@?&!\8&!@8&!@V-C8V > +M-C8V-S8V-C8V-C8V-C8V-S`_```````````````_,# +M_P``````````````_P#W-C8V-C8V-C8V-C8W,# +M`````#8V-C8V]P#W-C8V-C8V&!@8&!C_`/\````````V-C8V-C8V_P`````` > +M````````_P#_&!@8&!@8`````````/\V-C8V-C8V-C8V-C8V/P```````!@8 > +M&!@8'Q@?```````````````?&!\8&!@8&!@`````````/S8V-C8V-C8V-C8V > +M-C;_-C8V-C8V&!@8&!C_`/\8&!@8&!@8&!@8&!@8^``````````````````? > +M&!@8&!@8__________________\`````````__________#P\/#P\/#P\/#P > +M\/#P#P\/#P\/#P\/#P\/#P__________````````````````=]S,S-YS```` > +M`'S&QLS8S,;&QMS`P```_L;&P,#`P,#`P`````````-^[&QL;&QH`````/[& > +M8#`8,&#`QOX`````````?_#8V-C8<`````````!F9F9F9F9\8&#`````=MP8 > +M&!@8&!@`````&!A^V]O;VWX8&``````X;,;&_L;&QFPX`````#QFP\/#PV9F > +MY^<`````'C`8##YF9F9F/`````````!^V]O;?@`````````#!G[/V_-^8,`` > +M````'#!@8'Q@8&`P'```````?,;&QL;&QL;&````````_@``_@``_@`````` > +M```8&'X8&```_P``````,!@,!@P8,`!^```````,&#!@,!@,`'X````````. > +M&QL8&!@8&!@8&!@8&!@8&!C8V'``````````&!@`?@`8&```````````=MP` > +M=MP````````X;&PX````````````````````&!@`````````````````&``` > +M```````#`P8&#`S8>#`0`````-AL;&QL;```````````>,P8,&#\```````` > +=`````'Q\?'Q\?'P````````````0"``````````` > +` > +end -- a13x --7JfCtLOvnd9MIVvH Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: attachment; filename="syscons.diff" Content-Transfer-Encoding: 8bit diff --git a/share/syscons/fonts/INDEX.fonts b/share/syscons/fonts/INDEX.fonts index b7a786c..8d2d477 100644 --- a/share/syscons/fonts/INDEX.fonts +++ b/share/syscons/fonts/INDEX.fonts @@ -49,7 +49,7 @@ # Language support: MENU, FONT # MENU:en:Choose your keyboard font -MENU:de:Wähle Deine Schrift +MENU:de:Wählen Sie Ihre Schrift MENU:fr:Choisissez votre fonte écran MENU:pl:Wybierz czcionkê ekranow± MENU:es:Escoja el juego de caracteres --7JfCtLOvnd9MIVvH-- From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 17:56:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4087106566B; Sun, 28 Nov 2010 17:56:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B15DD8FC16; Sun, 28 Nov 2010 17:56:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASHuYkS035500; Sun, 28 Nov 2010 17:56:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASHuYdQ035497; Sun, 28 Nov 2010 17:56:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011281756.oASHuYdQ035497@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 28 Nov 2010 17:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216012 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 17:56:35 -0000 Author: kib Date: Sun Nov 28 17:56:34 2010 New Revision: 216012 URL: http://svn.freebsd.org/changeset/base/216012 Log: Calling fill_fpregs() for curthread is legitimate, and ELF coredump does this. Reported and tested by: pho MFC after: 5 days Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sun Nov 28 17:23:28 2010 (r216011) +++ head/sys/amd64/amd64/machdep.c Sun Nov 28 17:56:34 2010 (r216012) @@ -1975,7 +1975,8 @@ int fill_fpregs(struct thread *td, struct fpreg *fpregs) { - KASSERT(TD_IS_SUSPENDED(td), ("not suspended thread %p", td)); + KASSERT(td == curthread || TD_IS_SUSPENDED(td), + ("not suspended thread %p", td)); fpugetregs(td); fill_fpregs_xmm(&td->td_pcb->pcb_user_save, fpregs); return (0); Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sun Nov 28 17:23:28 2010 (r216011) +++ head/sys/i386/i386/machdep.c Sun Nov 28 17:56:34 2010 (r216012) @@ -3203,7 +3203,8 @@ int fill_fpregs(struct thread *td, struct fpreg *fpregs) { - KASSERT(TD_IS_SUSPENDED(td), ("not suspended thread %p", td)); + KASSERT(td == curthread || TD_IS_SUSPENDED(td), + ("not suspended thread %p", td)); npxgetregs(td); #ifdef CPU_ENABLE_SSE if (cpu_fxsr) From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 18:53:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B108E106566B; Sun, 28 Nov 2010 18:53:30 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D69C8FC08; Sun, 28 Nov 2010 18:53:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASIrU1E038929; Sun, 28 Nov 2010 18:53:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASIrU8w038920; Sun, 28 Nov 2010 18:53:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011281853.oASIrU8w038920@svn.freebsd.org> From: Marius Strobl Date: Sun, 28 Nov 2010 18:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216013 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 18:53:30 -0000 Author: marius Date: Sun Nov 28 18:53:29 2010 New Revision: 216013 URL: http://svn.freebsd.org/changeset/base/216013 Log: Several chipset drivers alter parameters relevant for the DMA tag creation, i.e. alignment, max_address, max_iosize and segsize (only max_address is thought to have an negative impact regarding this issue though), after calling ata_dmainit() either directly or indirectly so these values have no effect or at least no effect on the DMA tags and the defaults are used for the latter instead. So change the drivers to set these parameters up-front and ata_dmainit() to honor them. Reviewd by: mav MFC after: 1 month Modified: head/sys/dev/ata/ata-dma.c head/sys/dev/ata/chipsets/ata-ahci.c head/sys/dev/ata/chipsets/ata-cyrix.c head/sys/dev/ata/chipsets/ata-marvell.c head/sys/dev/ata/chipsets/ata-national.c head/sys/dev/ata/chipsets/ata-promise.c head/sys/dev/ata/chipsets/ata-serverworks.c head/sys/dev/ata/chipsets/ata-siliconimage.c Modified: head/sys/dev/ata/ata-dma.c ============================================================================== --- head/sys/dev/ata/ata-dma.c Sun Nov 28 17:56:34 2010 (r216012) +++ head/sys/dev/ata/ata-dma.c Sun Nov 28 18:53:29 2010 (r216013) @@ -68,17 +68,28 @@ ata_dmainit(device_t dev) struct ata_channel *ch = device_get_softc(dev); struct ata_dc_cb_args dcba; - ch->dma.alloc = ata_dmaalloc; - ch->dma.free = ata_dmafree; - ch->dma.setprd = ata_dmasetprd; - ch->dma.load = ata_dmaload; - ch->dma.unload = ata_dmaunload; - ch->dma.alignment = 2; - ch->dma.boundary = 65536; - ch->dma.segsize = 65536; - ch->dma.max_iosize = MIN((ATA_DMA_ENTRIES - 1) * PAGE_SIZE, MAXPHYS); - ch->dma.max_address = BUS_SPACE_MAXADDR_32BIT; - ch->dma.dma_slots = 1; + if (ch->dma.alloc == NULL) + ch->dma.alloc = ata_dmaalloc; + if (ch->dma.free == NULL) + ch->dma.free = ata_dmafree; + if (ch->dma.setprd == NULL) + ch->dma.setprd = ata_dmasetprd; + if (ch->dma.load == NULL) + ch->dma.load = ata_dmaload; + if (ch->dma.unload == NULL) + ch->dma.unload = ata_dmaunload; + if (ch->dma.alignment == 0) + ch->dma.alignment = 2; + if (ch->dma.boundary == 0) + ch->dma.boundary = 65536; + if (ch->dma.segsize == 0) + ch->dma.segsize = 65536; + if (ch->dma.max_iosize == 0) + ch->dma.max_iosize = MIN((ATA_DMA_ENTRIES - 1) * PAGE_SIZE, MAXPHYS); + if (ch->dma.max_address == 0) + ch->dma.max_address = BUS_SPACE_MAXADDR_32BIT; + if (ch->dma.dma_slots == 0) + ch->dma.dma_slots = 1; if (bus_dma_tag_create(bus_get_dma_tag(dev), ch->dma.alignment, 0, ch->dma.max_address, BUS_SPACE_MAXADDR, Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Sun Nov 28 17:56:34 2010 (r216012) +++ head/sys/dev/ata/chipsets/ata-ahci.c Sun Nov 28 18:53:29 2010 (r216013) @@ -1005,12 +1005,12 @@ ata_ahci_dmainit(device_t dev) struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); - ata_dmainit(dev); /* note start and stop are not used here */ ch->dma.setprd = ata_ahci_dmasetprd; ch->dma.max_iosize = (ATA_AHCI_DMA_ENTRIES - 1) * PAGE_SIZE; if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_64BIT) ch->dma.max_address = BUS_SPACE_MAXADDR; + ata_dmainit(dev); } static int Modified: head/sys/dev/ata/chipsets/ata-cyrix.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-cyrix.c Sun Nov 28 17:56:34 2010 (r216012) +++ head/sys/dev/ata/chipsets/ata-cyrix.c Sun Nov 28 18:53:29 2010 (r216013) @@ -56,7 +56,6 @@ static int ata_cyrix_chipinit(device_t d static int ata_cyrix_ch_attach(device_t dev); static int ata_cyrix_setmode(device_t dev, int target, int mode); - /* * Cyrix chipset support functions */ @@ -89,15 +88,12 @@ static int ata_cyrix_ch_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); - int error; - error = ata_pci_ch_attach(dev); ch->dma.alignment = 16; ch->dma.max_iosize = 64 * DEV_BSIZE; - return (error); + return (ata_pci_ch_attach(dev)); } - static int ata_cyrix_setmode(device_t dev, int target, int mode) { Modified: head/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-marvell.c Sun Nov 28 17:56:34 2010 (r216012) +++ head/sys/dev/ata/chipsets/ata-marvell.c Sun Nov 28 18:53:29 2010 (r216013) @@ -614,7 +614,6 @@ ata_marvell_edma_dmainit(device_t dev) struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); - ata_dmainit(dev); /* note start and stop are not used here */ ch->dma.setprd = ata_marvell_edma_dmasetprd; @@ -625,6 +624,7 @@ ata_marvell_edma_dmainit(device_t dev) /* chip does not reliably do 64K DMA transfers */ if (ctlr->chip->cfg2 == MV_50XX || ctlr->chip->cfg2 == MV_60XX) ch->dma.max_iosize = 64 * DEV_BSIZE; + ata_dmainit(dev); } ATA_DECLARE_DRIVER(ata_marvell); Modified: head/sys/dev/ata/chipsets/ata-national.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-national.c Sun Nov 28 17:56:34 2010 (r216012) +++ head/sys/dev/ata/chipsets/ata-national.c Sun Nov 28 18:53:29 2010 (r216013) @@ -90,12 +90,10 @@ static int ata_national_ch_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); - int error; - error = ata_pci_ch_attach(dev); ch->dma.alignment = 16; ch->dma.max_iosize = 64 * DEV_BSIZE; - return (error); + return (ata_pci_ch_attach(dev)); } static int Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Sun Nov 28 17:56:34 2010 (r216012) +++ head/sys/dev/ata/chipsets/ata-promise.c Sun Nov 28 18:53:29 2010 (r216013) @@ -979,13 +979,12 @@ ata_promise_mio_dmainit(device_t dev) { struct ata_channel *ch = device_get_softc(dev); - ata_dmainit(dev); /* note start and stop are not used here */ ch->dma.setprd = ata_promise_mio_setprd; ch->dma.max_iosize = 65536; + ata_dmainit(dev); } - #define MAXLASTSGSIZE (32 * sizeof(u_int32_t)) static void ata_promise_mio_setprd(void *xsc, bus_dma_segment_t *segs, int nsegs, int error) Modified: head/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-serverworks.c Sun Nov 28 17:56:34 2010 (r216012) +++ head/sys/dev/ata/chipsets/ata-serverworks.c Sun Nov 28 18:53:29 2010 (r216013) @@ -179,8 +179,6 @@ ata_serverworks_ch_attach(device_t dev) int ch_offset; int i; - ata_pci_dmainit(dev); - ch_offset = ch->unit * 0x100; for (i = ATA_DATA; i < ATA_MAX_RES; i++) @@ -245,6 +243,8 @@ ata_serverworks_ch_attach(device_t dev) /* chip does not reliably do 64K DMA transfers */ ch->dma.max_iosize = 64 * DEV_BSIZE; + ata_pci_dmainit(dev); + return 0; } Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Sun Nov 28 17:56:34 2010 (r216012) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Sun Nov 28 18:53:29 2010 (r216013) @@ -289,8 +289,6 @@ ata_sii_ch_attach(device_t dev) int unit01 = (ch->unit & 1), unit10 = (ch->unit & 2); int i; - ata_pci_dmainit(dev); - for (i = ATA_DATA; i <= ATA_COMMAND; i++) { ch->r_io[i].res = ctlr->r_res2; ch->r_io[i].offset = 0x80 + i + (unit01 << 6) + (unit10 << 8); @@ -332,6 +330,9 @@ ata_sii_ch_attach(device_t dev) ch->hw.status = ata_sii_status; if (ctlr->chip->cfg2 & SII_SETCLK) ch->flags |= ATA_CHECKS_CABLE; + + ata_pci_dmainit(dev); + return 0; } @@ -915,11 +916,11 @@ ata_siiprb_dmainit(device_t dev) { struct ata_channel *ch = device_get_softc(dev); - ata_dmainit(dev); /* note start and stop are not used here */ ch->dma.setprd = ata_siiprb_dmasetprd; ch->dma.max_address = BUS_SPACE_MAXADDR; ch->dma.max_iosize = (ATA_SIIPRB_DMA_ENTRIES - 1) * PAGE_SIZE; + ata_dmainit(dev); } ATA_DECLARE_DRIVER(ata_sii); From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 18:53:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE3A2106564A; Sun, 28 Nov 2010 18:53:57 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC0C48FC12; Sun, 28 Nov 2010 18:53:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASIrvvI038981; Sun, 28 Nov 2010 18:53:57 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASIrvTn038978; Sun, 28 Nov 2010 18:53:57 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201011281853.oASIrvTn038978@svn.freebsd.org> From: Kai Wang Date: Sun, 28 Nov 2010 18:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216014 - head/usr.bin/ar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 18:53:57 -0000 Author: kaiw Date: Sun Nov 28 18:53:57 2010 New Revision: 216014 URL: http://svn.freebsd.org/changeset/base/216014 Log: Add option -D for ranlib(1). When -D is speicified, ranlib(1) will generate a deterministic archive symbol table (i.e. timestamp for the symbol table member header is set to 0). Submitted by: Erik Cederstrand Modified: head/usr.bin/ar/ar.1 head/usr.bin/ar/ar.c Modified: head/usr.bin/ar/ar.1 ============================================================================== --- head/usr.bin/ar/ar.1 Sun Nov 28 18:53:29 2010 (r216013) +++ head/usr.bin/ar/ar.1 Sun Nov 28 18:53:57 2010 (r216014) @@ -92,6 +92,7 @@ .Ar archive .Op Ar files ... .Nm ranlib +.Op Fl D .Ar archive ... .Sh DESCRIPTION The Modified: head/usr.bin/ar/ar.c ============================================================================== --- head/usr.bin/ar/ar.c Sun Nov 28 18:53:29 2010 (r216013) +++ head/usr.bin/ar/ar.c Sun Nov 28 18:53:57 2010 (r216014) @@ -113,12 +113,15 @@ main(int argc, char **argv) len = strlen(bsdar->progname); if (len >= strlen("ranlib") && strcmp(bsdar->progname + len - strlen("ranlib"), "ranlib") == 0) { - while ((opt = getopt_long(argc, argv, "tV", longopts, + while ((opt = getopt_long(argc, argv, "tDV", longopts, NULL)) != -1) { switch(opt) { case 't': /* Ignored. */ break; + case 'D': + bsdar->options |= AR_D; + break; case 'V': ranlib_version(); break; From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 19:26:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2BCD1065673; Sun, 28 Nov 2010 19:26:20 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 909D98FC20; Sun, 28 Nov 2010 19:26:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASJQKNe040691; Sun, 28 Nov 2010 19:26:20 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASJQKiE040689; Sun, 28 Nov 2010 19:26:20 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201011281926.oASJQKiE040689@svn.freebsd.org> From: Max Khon Date: Sun, 28 Nov 2010 19:26:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216016 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 19:26:20 -0000 Author: fjoe Date: Sun Nov 28 19:26:20 2010 New Revision: 216016 URL: http://svn.freebsd.org/changeset/base/216016 Log: Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with DEBUG_MEMGUARD panics early in kmeminit() with the message "kmem_suballoc: bad status return of 1" because of zero "size" argument passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. The problem also exists on ia64. Modified: head/sys/sparc64/include/vmparam.h Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Sun Nov 28 18:59:52 2010 (r216015) +++ head/sys/sparc64/include/vmparam.h Sun Nov 28 19:26:20 2010 (r216016) @@ -237,6 +237,14 @@ #endif /* + * Ceiling on amount of kmem_map kva space. + */ +#ifndef VM_KMEM_SIZE_MAX +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ + VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) +#endif + +/* * Initial pagein size of beginning of executable file. */ #ifndef VM_INITIAL_PAGEIN From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 19:45:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0E7F106566C; Sun, 28 Nov 2010 19:45:44 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 530BB8FC12; Sun, 28 Nov 2010 19:45:43 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id oASJjhrL007335; Sun, 28 Nov 2010 20:45:43 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id oASJjhiB007334; Sun, 28 Nov 2010 20:45:43 +0100 (CET) (envelope-from marius) Date: Sun, 28 Nov 2010 20:45:43 +0100 From: Marius Strobl To: Max Khon Message-ID: <20101128194542.GF9966@alchemy.franken.de> References: <201011281926.oASJQKiE040689@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201011281926.oASJQKiE040689@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216016 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 19:45:44 -0000 On Sun, Nov 28, 2010 at 07:26:20PM +0000, Max Khon wrote: > Author: fjoe > Date: Sun Nov 28 19:26:20 2010 > New Revision: 216016 > URL: http://svn.freebsd.org/changeset/base/216016 > > Log: > Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with > DEBUG_MEMGUARD panics early in kmeminit() with the message > "kmem_suballoc: bad status return of 1" because of zero "size" argument > passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. > > The problem also exists on ia64. > > Modified: > head/sys/sparc64/include/vmparam.h > > Modified: head/sys/sparc64/include/vmparam.h > ============================================================================== > --- head/sys/sparc64/include/vmparam.h Sun Nov 28 18:59:52 2010 (r216015) > +++ head/sys/sparc64/include/vmparam.h Sun Nov 28 19:26:20 2010 (r216016) > @@ -237,6 +237,14 @@ > #endif > > /* > + * Ceiling on amount of kmem_map kva space. > + */ > +#ifndef VM_KMEM_SIZE_MAX > +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ > + VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) > +#endif > + > +/* > * Initial pagein size of beginning of executable file. > */ > #ifndef VM_INITIAL_PAGEIN How was that value determined? Marius From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 22:49:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ACD6106566B; Sun, 28 Nov 2010 22:49:58 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88D708FC0A; Sun, 28 Nov 2010 22:49:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASMnws4054892; Sun, 28 Nov 2010 22:49:58 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASMnwIo054890; Sun, 28 Nov 2010 22:49:58 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011282249.oASMnwIo054890@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 28 Nov 2010 22:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216019 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 22:49:58 -0000 Author: jilles Date: Sun Nov 28 22:49:58 2010 New Revision: 216019 URL: http://svn.freebsd.org/changeset/base/216019 Log: sh: Make the test for cd/pwd with long pathnames more useful: * Use $(getconf PATH_MAX /) to make sure we actually exercise the hard part * Delete our test area even if the test fails Modified: head/tools/regression/bin/sh/builtins/cd2.0 Modified: head/tools/regression/bin/sh/builtins/cd2.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/cd2.0 Sun Nov 28 22:07:08 2010 (r216018) +++ head/tools/regression/bin/sh/builtins/cd2.0 Sun Nov 28 22:49:58 2010 (r216019) @@ -1,15 +1,16 @@ # $FreeBSD$ set -e +L=$(getconf PATH_MAX / 2>/dev/null) || L=4096 +[ "$L" -lt 100000 ] 2>/dev/null || L=4096 +L=$((L+100)) T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) +trap 'rm -rf ${T}' 0 cd $T D=$T -for i in 0 1 2 3 4 5 6 7 8 9; do - for j in 0 1 2 3 4 5 6 7 8 9; do - mkdir veryverylongdirectoryname - cd veryverylongdirectoryname - D=$D/veryverylongdirectoryname - done +while [ ${#D} -lt $L ]; do + mkdir veryverylongdirectoryname + cd veryverylongdirectoryname + D=$D/veryverylongdirectoryname done [ $(pwd | wc -c) -eq $((${#D} + 1)) ] # +\n -rm -rf ${T} From owner-svn-src-head@FreeBSD.ORG Sun Nov 28 23:34:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73B0B106566B; Sun, 28 Nov 2010 23:34:21 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 620898FC14; Sun, 28 Nov 2010 23:34:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oASNYLaK057089; Sun, 28 Nov 2010 23:34:21 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oASNYLN3057087; Sun, 28 Nov 2010 23:34:21 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201011282334.oASNYLN3057087@svn.freebsd.org> From: John-Mark Gurney Date: Sun, 28 Nov 2010 23:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216021 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2010 23:34:21 -0000 Author: jmg Date: Sun Nov 28 23:34:20 2010 New Revision: 216021 URL: http://svn.freebsd.org/changeset/base/216021 Log: document that most of ioctl requests in cd(4) are implemented by acd(4).. Modified: head/share/man/man4/ata.4 Modified: head/share/man/man4/ata.4 ============================================================================== --- head/share/man/man4/ata.4 Sun Nov 28 23:19:23 2010 (r216020) +++ head/share/man/man4/ata.4 Sun Nov 28 23:34:20 2010 (r216021) @@ -228,6 +228,13 @@ but be aware that your hardware might support it and can potentially .Em hang the entire system causing data loss. +.Pp +The +.Nm acd +driver implements most of the +.Fn ioctl +requests documented by +.Xr cd 4 . .Sh FILES .Bl -tag -width ".Pa /sys/i386/conf/GENERIC" -compact .It Pa /dev/ad* @@ -271,6 +278,7 @@ Native Command Queuing (NCQ) on SATA dri .Xr ataraid 4 , .Xr atacontrol 8 , .Xr burncd 8 , +.Xr cd 4 , .Xr siis 4 .Sh HISTORY The From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 00:04:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 494AA106566C; Mon, 29 Nov 2010 00:04:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 364AF8FC0C; Mon, 29 Nov 2010 00:04:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT049Ej062243; Mon, 29 Nov 2010 00:04:09 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT049xb062239; Mon, 29 Nov 2010 00:04:09 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201011290004.oAT049xb062239@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 29 Nov 2010 00:04:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216022 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 00:04:09 -0000 Author: bz Date: Mon Nov 29 00:04:08 2010 New Revision: 216022 URL: http://svn.freebsd.org/changeset/base/216022 Log: Plug well observed races on la_hold entries with the callout handler. Call the handler function with the lock held, return unlocked as we might free the entry. Rework functions later in the call graph to be either called with the lock held or, only if needed, unlocked. Place asserts to document and tighten assumptions on various lle locking, which were not always true before. We call nd6_ns_output() unlocked and the assignment of ip6->ip6_src was decentralized to minimize possible complexity introduced with the formerly missing locking there. This also resulted in a push down of local variable scopes into smaller blocks. Reported by: many PR: kern/148857 Submitted by: Dmitrij Tejblum (tejblum yandex-team.ru) (original version) MFC After: 4 days Modified: head/sys/netinet6/in6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sun Nov 28 23:34:20 2010 (r216021) +++ head/sys/netinet6/in6.c Mon Nov 29 00:04:08 2010 (r216022) @@ -2349,10 +2349,12 @@ in6_lltable_new(const struct sockaddr *l if (lle == NULL) /* NB: caller generates msg */ return NULL; - callout_init(&lle->base.ln_timer_ch, CALLOUT_MPSAFE); lle->l3_addr6 = *(const struct sockaddr_in6 *)l3addr; lle->base.lle_refcnt = 1; LLE_LOCK_INIT(&lle->base); + callout_init_rw(&lle->base.ln_timer_ch, &lle->base.lle_lock, + CALLOUT_RETURNUNLOCKED); + return &lle->base; } Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Sun Nov 28 23:34:20 2010 (r216021) +++ head/sys/netinet6/nd6.c Mon Nov 29 00:04:08 2010 (r216022) @@ -411,6 +411,8 @@ nd6_llinfo_settimer_locked(struct llentr { int canceled; + LLE_WLOCK_ASSERT(ln); + if (tick < 0) { ln->la_expire = 0; ln->ln_ntick = 0; @@ -451,6 +453,7 @@ nd6_llinfo_timer(void *arg) KASSERT(arg != NULL, ("%s: arg NULL", __func__)); ln = (struct llentry *)arg; + LLE_WLOCK_ASSERT(ln); ifp = ln->lle_tbl->llt_ifp; CURVNET_SET(ifp->if_vnet); @@ -458,10 +461,10 @@ nd6_llinfo_timer(void *arg) if (ln->ln_ntick > 0) { if (ln->ln_ntick > INT_MAX) { ln->ln_ntick -= INT_MAX; - nd6_llinfo_settimer(ln, INT_MAX); + nd6_llinfo_settimer_locked(ln, INT_MAX); } else { ln->ln_ntick = 0; - nd6_llinfo_settimer(ln, ln->ln_ntick); + nd6_llinfo_settimer_locked(ln, ln->ln_ntick); } goto done; } @@ -482,8 +485,10 @@ nd6_llinfo_timer(void *arg) case ND6_LLINFO_INCOMPLETE: if (ln->la_asked < V_nd6_mmaxtries) { ln->la_asked++; - nd6_llinfo_settimer(ln, (long)ndi->retrans * hz / 1000); + nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); + LLE_WUNLOCK(ln); nd6_ns_output(ifp, NULL, dst, ln, 0); + LLE_WLOCK(ln); } else { struct mbuf *m = ln->la_hold; if (m) { @@ -491,24 +496,24 @@ nd6_llinfo_timer(void *arg) /* * assuming every packet in la_hold has the - * same IP header + * same IP header. Send error after unlock. */ m0 = m->m_nextpkt; m->m_nextpkt = NULL; - icmp6_error2(m, ICMP6_DST_UNREACH, - ICMP6_DST_UNREACH_ADDR, 0, ifp); - ln->la_hold = m0; clear_llinfo_pqueue(ln); } (void)nd6_free(ln, 0); ln = NULL; + if (m != NULL) + icmp6_error2(m, ICMP6_DST_UNREACH, + ICMP6_DST_UNREACH_ADDR, 0, ifp); } break; case ND6_LLINFO_REACHABLE: if (!ND6_LLINFO_PERMANENT(ln)) { ln->ln_state = ND6_LLINFO_STALE; - nd6_llinfo_settimer(ln, (long)V_nd6_gctimer * hz); + nd6_llinfo_settimer_locked(ln, (long)V_nd6_gctimer * hz); } break; @@ -525,27 +530,34 @@ nd6_llinfo_timer(void *arg) /* We need NUD */ ln->la_asked = 1; ln->ln_state = ND6_LLINFO_PROBE; - nd6_llinfo_settimer(ln, (long)ndi->retrans * hz / 1000); + nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); + LLE_WUNLOCK(ln); nd6_ns_output(ifp, dst, dst, ln, 0); + LLE_WLOCK(ln); } else { ln->ln_state = ND6_LLINFO_STALE; /* XXX */ - nd6_llinfo_settimer(ln, (long)V_nd6_gctimer * hz); + nd6_llinfo_settimer_locked(ln, (long)V_nd6_gctimer * hz); } break; case ND6_LLINFO_PROBE: if (ln->la_asked < V_nd6_umaxtries) { ln->la_asked++; - nd6_llinfo_settimer(ln, (long)ndi->retrans * hz / 1000); + nd6_llinfo_settimer_locked(ln, (long)ndi->retrans * hz / 1000); + LLE_WUNLOCK(ln); nd6_ns_output(ifp, dst, dst, ln, 0); + LLE_WLOCK(ln); } else { (void)nd6_free(ln, 0); ln = NULL; } break; + default: + panic("%s: paths in a dark night can be confusing: %d", + __func__, ln->ln_state); } done: if (ln != NULL) - LLE_FREE(ln); + LLE_FREE_LOCKED(ln); CURVNET_RESTORE(); } @@ -996,7 +1008,9 @@ nd6_free(struct llentry *ln, int gc) { struct llentry *next; struct nd_defrouter *dr; - struct ifnet *ifp=NULL; + struct ifnet *ifp; + + LLE_WLOCK_ASSERT(ln); /* * we used to have pfctlinput(PRC_HOSTDEAD) here. @@ -1004,12 +1018,13 @@ nd6_free(struct llentry *ln, int gc) */ /* cancel timer */ - nd6_llinfo_settimer(ln, -1); + nd6_llinfo_settimer_locked(ln, -1); + + ifp = ln->lle_tbl->llt_ifp; if (!V_ip6_forwarding) { - int s; - s = splnet(); - dr = defrouter_lookup(&L3_ADDR_SIN6(ln)->sin6_addr, ln->lle_tbl->llt_ifp); + + dr = defrouter_lookup(&L3_ADDR_SIN6(ln)->sin6_addr, ifp); if (dr != NULL && dr->expire && ln->ln_state == ND6_LLINFO_STALE && gc) { @@ -1026,15 +1041,16 @@ nd6_free(struct llentry *ln, int gc) * but we intentionally keep it just in case. */ if (dr->expire > time_second) - nd6_llinfo_settimer(ln, + nd6_llinfo_settimer_locked(ln, (dr->expire - time_second) * hz); else - nd6_llinfo_settimer(ln, (long)V_nd6_gctimer * hz); - splx(s); - LLE_WLOCK(ln); + nd6_llinfo_settimer_locked(ln, + (long)V_nd6_gctimer * hz); + + next = LIST_NEXT(ln, lle_next); LLE_REMREF(ln); LLE_WUNLOCK(ln); - return (LIST_NEXT(ln, lle_next)); + return (next); } if (ln->ln_router || dr) { @@ -1043,7 +1059,7 @@ nd6_free(struct llentry *ln, int gc) * is in the Default Router List. * See a corresponding comment in nd6_na_input(). */ - rt6_flush(&L3_ADDR_SIN6(ln)->sin6_addr, ln->lle_tbl->llt_ifp); + rt6_flush(&L3_ADDR_SIN6(ln)->sin6_addr, ifp); } if (dr) { @@ -1071,11 +1087,13 @@ nd6_free(struct llentry *ln, int gc) pfxlist_onlink_check(); /* - * refresh default router list + * Refresh default router list. Have to unlock as + * it calls into nd6_lookup(), still holding a ref. */ + LLE_WUNLOCK(ln); defrouter_select(); + LLE_WLOCK(ln); } - splx(s); } /* @@ -1086,7 +1104,11 @@ nd6_free(struct llentry *ln, int gc) */ next = LIST_NEXT(ln, lle_next); - ifp = ln->lle_tbl->llt_ifp; + /* + * Save to unlock. We still hold an extra reference and will not + * free(9) in llentry_free() if someone else holds one as well. + */ + LLE_WUNLOCK(ln); IF_AFDATA_LOCK(ifp); LLE_WLOCK(ln); LLE_REMREF(ln); @@ -1875,6 +1897,9 @@ nd6_output_lle(struct ifnet *ifp, struct LLE_RUNLOCK(ln); goto retry; } + + LLE_WLOCK_ASSERT(ln); + if (ln->la_hold) { struct mbuf *m_hold; int i; @@ -1896,17 +1921,7 @@ nd6_output_lle(struct ifnet *ifp, struct } else { ln->la_hold = m; } - /* - * We did the lookup (no lle arg) so we - * need to do the unlock here - */ - if (lle == NULL) { - if (flags & LLE_EXCLUSIVE) - LLE_WUNLOCK(ln); - else - LLE_RUNLOCK(ln); - } - + /* * If there has been no NS for the neighbor after entering the * INCOMPLETE state, send the first solicitation. @@ -1914,10 +1929,21 @@ nd6_output_lle(struct ifnet *ifp, struct if (!ND6_LLINFO_PERMANENT(ln) && ln->la_asked == 0) { ln->la_asked++; - nd6_llinfo_settimer(ln, + nd6_llinfo_settimer_locked(ln, (long)ND_IFINFO(ifp)->retrans * hz / 1000); + LLE_WUNLOCK(ln); nd6_ns_output(ifp, NULL, &dst->sin6_addr, ln, 0); + if (lle != NULL && ln == lle) + LLE_WLOCK(lle); + + } else if (lle == NULL || ln != lle) { + /* + * We did the lookup (no lle arg) so we + * need to do the unlock here. + */ + LLE_WUNLOCK(ln); } + return (0); sendpkt: Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Sun Nov 28 23:34:20 2010 (r216021) +++ head/sys/netinet6/nd6_nbr.c Mon Nov 29 00:04:08 2010 (r216022) @@ -383,7 +383,6 @@ nd6_ns_output(struct ifnet *ifp, const s struct m_tag *mtag; struct ip6_hdr *ip6; struct nd_neighbor_solicit *nd_ns; - struct in6_addr *src, src_in; struct ip6_moptions im6o; int icmp6len; int maxlen; @@ -467,28 +466,35 @@ nd6_ns_output(struct ifnet *ifp, const s * - saddr6 belongs to the outgoing interface. * Otherwise, we perform the source address selection as usual. */ - struct ip6_hdr *hip6; /* hold ip6 */ - struct in6_addr *hsrc = NULL; + struct in6_addr *hsrc; - if ((ln != NULL) && ln->la_hold) { - /* - * assuming every packet in la_hold has the same IP - * header - */ - hip6 = mtod(ln->la_hold, struct ip6_hdr *); - /* XXX pullup? */ - if (sizeof(*hip6) < ln->la_hold->m_len) - hsrc = &hip6->ip6_src; - else - hsrc = NULL; + hsrc = NULL; + if (ln != NULL) { + LLE_RLOCK(ln); + if (ln->la_hold != NULL) { + struct ip6_hdr *hip6; /* hold ip6 */ + + /* + * assuming every packet in la_hold has the same IP + * header + */ + hip6 = mtod(ln->la_hold, struct ip6_hdr *); + /* XXX pullup? */ + if (sizeof(*hip6) < ln->la_hold->m_len) { + ip6->ip6_src = hip6->ip6_src; + hsrc = &hip6->ip6_src; + } + } + LLE_RUNLOCK(ln); } if (hsrc && (ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, hsrc)) != NULL) { - src = hsrc; + /* ip6_src set already. */ ifa_free(ifa); } else { int error; struct sockaddr_in6 dst_sa; + struct in6_addr src_in; bzero(&dst_sa, sizeof(dst_sa)); dst_sa.sin6_family = AF_INET6; @@ -506,7 +512,7 @@ nd6_ns_output(struct ifnet *ifp, const s error)); goto bad; } - src = &src_in; + ip6->ip6_src = src_in; } } else { /* @@ -516,10 +522,8 @@ nd6_ns_output(struct ifnet *ifp, const s * above), but we do so here explicitly to make the intention * clearer. */ - bzero(&src_in, sizeof(src_in)); - src = &src_in; + bzero(&ip6->ip6_src, sizeof(ip6->ip6_src)); } - ip6->ip6_src = *src; nd_ns = (struct nd_neighbor_solicit *)(ip6 + 1); nd_ns->nd_ns_type = ND_NEIGHBOR_SOLICIT; nd_ns->nd_ns_code = 0; From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 05:50:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49C0C106566B; Mon, 29 Nov 2010 05:50:21 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 382AD8FC12; Mon, 29 Nov 2010 05:50:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT5oLed099481; Mon, 29 Nov 2010 05:50:21 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT5oLeT099479; Mon, 29 Nov 2010 05:50:21 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201011290550.oAT5oLeT099479@svn.freebsd.org> From: Xin LI Date: Mon, 29 Nov 2010 05:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216040 - head/share/syscons/fonts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 05:50:21 -0000 Author: delphij Date: Mon Nov 29 05:50:20 2010 New Revision: 216040 URL: http://svn.freebsd.org/changeset/base/216040 Log: Make German formal clause to be consistent with the keymap counterpart. Submitted by: arundel MFC after: 1 week Modified: head/share/syscons/fonts/INDEX.fonts Modified: head/share/syscons/fonts/INDEX.fonts ============================================================================== --- head/share/syscons/fonts/INDEX.fonts Mon Nov 29 04:57:46 2010 (r216039) +++ head/share/syscons/fonts/INDEX.fonts Mon Nov 29 05:50:20 2010 (r216040) @@ -49,7 +49,7 @@ # Language support: MENU, FONT # MENU:en:Choose your keyboard font -MENU:de:Wähle Deine Schrift +MENU:de:Wählen Sie Ihre Schrift MENU:fr:Choisissez votre fonte écran MENU:pl:Wybierz czcionkê ekranow± MENU:es:Escoja el juego de caracteres From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 06:50:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F3DE1065670; Mon, 29 Nov 2010 06:50:31 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DEBD8FC12; Mon, 29 Nov 2010 06:50:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT6oUmO005297; Mon, 29 Nov 2010 06:50:30 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT6oUE2005295; Mon, 29 Nov 2010 06:50:30 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201011290650.oAT6oUE2005295@svn.freebsd.org> From: Colin Percival Date: Mon, 29 Nov 2010 06:50:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216041 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 06:50:31 -0000 Author: cperciva Date: Mon Nov 29 06:50:30 2010 New Revision: 216041 URL: http://svn.freebsd.org/changeset/base/216041 Log: Fix bug introduced by r194784: Under XEN, the page(s) allocated to dpcpu for CPU #0 weren't being properly reserved. Under VM pressure this would cause problems when the dpcpu structures were overwritten by arbitrary data; the most common symptom was a panic when netisr attempted to lock a mutex. For some reason the XEN code keeps track of the start of available memory in the variables 'first', 'physfree', and 'init_first'; as far as I can tell, we always have first == physfree == init_first * PAGE_SIZE. The earlier commit adjusted 'first' (which, on !XEN, is the only variable which tracks this value) but not the other two variables. Exercise for reader: Eliminate two of these three variables. Modified: head/sys/i386/i386/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Nov 29 05:50:20 2010 (r216040) +++ head/sys/i386/i386/machdep.c Mon Nov 29 06:50:30 2010 (r216041) @@ -2576,6 +2576,8 @@ init386(first) pmap_kenter(pa + KERNBASE, pa); dpcpu_init((void *)(first + KERNBASE), 0); first += DPCPU_SIZE; + physfree += DPCPU_SIZE; + init_first += DPCPU_SIZE / PAGE_SIZE; PCPU_SET(prvspace, pc); PCPU_SET(curthread, &thread0); From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 08:17:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 657E5106566B; Mon, 29 Nov 2010 08:17:44 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 546568FC08; Mon, 29 Nov 2010 08:17:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT8Hiid013937; Mon, 29 Nov 2010 08:17:44 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT8Hikq013934; Mon, 29 Nov 2010 08:17:44 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201011290817.oAT8Hikq013934@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 29 Nov 2010 08:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216045 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 08:17:44 -0000 Author: gavin Date: Mon Nov 29 08:17:44 2010 New Revision: 216045 URL: http://svn.freebsd.org/changeset/base/216045 Log: Support the Falcom Twist USB GSM/GPRS modem in uftdi(4) PR: usb/151862 Submitted by: Alessandro de Manzano MFC after: 1 week Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Mon Nov 29 08:16:48 2010 (r216044) +++ head/sys/dev/usb/serial/uftdi.c Mon Nov 29 08:17:44 2010 (r216045) @@ -213,6 +213,7 @@ static struct usb_device_id uftdi_devs[] UFTDI_DEV(ATMEL, STK541, 8U232AM), UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, 8U232AM), UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, 8U232AM), + UFTDI_DEV(FALCOM, TWIST, 8U232AM), UFTDI_DEV(FTDI, GAMMASCOUT, 8U232AM), UFTDI_DEV(FTDI, SERIAL_8U100AX, SIO), UFTDI_DEV(FTDI, SERIAL_2232C, 8U232AM), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Nov 29 08:16:48 2010 (r216044) +++ head/sys/dev/usb/usbdevs Mon Nov 29 08:17:44 2010 (r216045) @@ -1554,6 +1554,9 @@ product ETEK 1COM 0x8007 Serial /* Extended Systems products */ product EXTENDED XTNDACCESS 0x0100 XTNDAccess IrDA +/* Falcom products */ +product FALCOM TWIST 0x0001 USB GSM/GPRS Modem + /* FEIYA products */ product FEIYA 5IN1 0x1132 5-in-1 Card Reader From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 09:21:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66BBC106564A; Mon, 29 Nov 2010 09:21:27 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B0488FC12; Mon, 29 Nov 2010 09:21:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAT9LRGE019871; Mon, 29 Nov 2010 09:21:27 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAT9LRJe019869; Mon, 29 Nov 2010 09:21:27 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201011290921.oAT9LRJe019869@svn.freebsd.org> From: Kevin Lo Date: Mon, 29 Nov 2010 09:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216047 - head/usr.sbin/kbdmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 09:21:27 -0000 Author: kevlo Date: Mon Nov 29 09:21:26 2010 New Revision: 216047 URL: http://svn.freebsd.org/changeset/base/216047 Log: Fix fd leak in get_font Modified: head/usr.sbin/kbdmap/kbdmap.c Modified: head/usr.sbin/kbdmap/kbdmap.c ============================================================================== --- head/usr.sbin/kbdmap/kbdmap.c Mon Nov 29 08:44:32 2010 (r216046) +++ head/usr.sbin/kbdmap/kbdmap.c Mon Nov 29 09:21:26 2010 (r216047) @@ -229,6 +229,7 @@ get_font(void) } else fprintf(stderr, "Could not open %s for reading\n", sysconfig); + fclose(fp); return fnt; } From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 10:10:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC9A11065675; Mon, 29 Nov 2010 10:10:56 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAB738FC15; Mon, 29 Nov 2010 10:10:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oATAAuHV023382; Mon, 29 Nov 2010 10:10:56 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oATAAuAW023380; Mon, 29 Nov 2010 10:10:56 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011291010.oATAAuAW023380@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 29 Nov 2010 10:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216049 - head/sys/compat/ndis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 10:10:57 -0000 Author: bschmidt Date: Mon Nov 29 10:10:56 2010 New Revision: 216049 URL: http://svn.freebsd.org/changeset/base/216049 Log: Some drivers rely on the existence of certain keys. The Atheros 9xxx driver for example requests the NetCfgInstanceId but doesn't check the returned status code and will happily access random memory instead. Submitted by: Paul B Mahol MFC after: 2 weeks Modified: head/sys/compat/ndis/kern_ndis.c Modified: head/sys/compat/ndis/kern_ndis.c ============================================================================== --- head/sys/compat/ndis/kern_ndis.c Mon Nov 29 09:24:03 2010 (r216048) +++ head/sys/compat/ndis/kern_ndis.c Mon Nov 29 10:10:56 2010 (r216049) @@ -331,6 +331,16 @@ ndis_create_sysctls(arg) ndis_add_sysctl(sc, "NdisVersion", "NDIS API Version", "0x00050001", CTLFLAG_RD); + /* + * Some miniport drivers rely on the existence of the SlotNumber, + * NetCfgInstanceId and DriverDesc keys. + */ + ndis_add_sysctl(sc, "SlotNumber", "Slot Numer", "01", CTLFLAG_RD); + ndis_add_sysctl(sc, "NetCfgInstanceId", "NetCfgInstanceId", + "{12345678-1234-5678-CAFE0-123456789ABC}", CTLFLAG_RD); + ndis_add_sysctl(sc, "DriverDesc", "Driver Description", + "NDIS Network Adapter", CTLFLAG_RD); + /* Bus type (PCI, PCMCIA, etc...) */ sprintf(buf, "%d", (int)sc->ndis_iftype); ndis_add_sysctl(sc, "BusType", "Bus Type", buf, CTLFLAG_RD); From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 10:21:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DDA6106566C; Mon, 29 Nov 2010 10:21:45 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BDDD8FC14; Mon, 29 Nov 2010 10:21:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oATALjqZ024087; Mon, 29 Nov 2010 10:21:45 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oATALjBh024085; Mon, 29 Nov 2010 10:21:45 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011291021.oATALjBh024085@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 29 Nov 2010 10:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216050 - head/sys/compat/ndis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 10:21:45 -0000 Author: bschmidt Date: Mon Nov 29 10:21:45 2010 New Revision: 216050 URL: http://svn.freebsd.org/changeset/base/216050 Log: Add a dummy for IoOpenDeviceRegistryKey(). With that change the Atheros 9xxx driver is actually usable and does not panic anymore. Submitted by: Paul B Mahol MFC after: 2 weeks Modified: head/sys/compat/ndis/subr_ntoskrnl.c Modified: head/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- head/sys/compat/ndis/subr_ntoskrnl.c Mon Nov 29 10:10:56 2010 (r216049) +++ head/sys/compat/ndis/subr_ntoskrnl.c Mon Nov 29 10:21:45 2010 (r216050) @@ -228,6 +228,8 @@ static void srand(unsigned int); static void KeQuerySystemTime(uint64_t *); static uint32_t KeTickCount(void); static uint8_t IoIsWdmVersionAvailable(uint8_t, uint8_t); +static int32_t IoOpenDeviceRegistryKey(struct device_object *, uint32_t, + uint32_t, void **); static void ntoskrnl_thrfunc(void *); static ndis_status PsCreateSystemThread(ndis_handle *, uint32_t, void *, ndis_handle, void *, void *, void *); @@ -3199,6 +3201,13 @@ IoIsWdmVersionAvailable(uint8_t major, u return (FALSE); } +static int32_t +IoOpenDeviceRegistryKey(struct device_object *devobj, uint32_t type, + uint32_t mask, void **key) +{ + return (NDIS_STATUS_INVALID_DEVICE_REQUEST); +} + static ndis_status IoGetDeviceObjectPointer(name, reqaccess, fileobj, devobj) unicode_string *name; @@ -4378,6 +4387,7 @@ image_patch_table ntoskrnl_functbl[] = { IMPORT_SFUNC(MmUnmapIoSpace, 2), IMPORT_SFUNC(KeInitializeSpinLock, 1), IMPORT_SFUNC(IoIsWdmVersionAvailable, 2), + IMPORT_SFUNC(IoOpenDeviceRegistryKey, 4), IMPORT_SFUNC(IoGetDeviceObjectPointer, 4), IMPORT_SFUNC(IoGetDeviceProperty, 5), IMPORT_SFUNC(IoAllocateWorkItem, 1), From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 11:28:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CAC7106566B; Mon, 29 Nov 2010 11:28:31 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3258FC14; Mon, 29 Nov 2010 11:28:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oATBSVBZ031392; Mon, 29 Nov 2010 11:28:31 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oATBSVKM031389; Mon, 29 Nov 2010 11:28:31 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011291128.oATBSVKM031389@svn.freebsd.org> From: Bruce Cran Date: Mon, 29 Nov 2010 11:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216052 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 11:28:31 -0000 Author: brucec Date: Mon Nov 29 11:28:31 2010 New Revision: 216052 URL: http://svn.freebsd.org/changeset/base/216052 Log: Update the serial port device names. They changed in 8.0 because the default driver is now uart(4). PR: bin/140887 Submitted by: Joe Barbish MFC after: 3 days Modified: head/usr.sbin/sysinstall/devices.c head/usr.sbin/sysinstall/menus.c Modified: head/usr.sbin/sysinstall/devices.c ============================================================================== --- head/usr.sbin/sysinstall/devices.c Mon Nov 29 10:22:45 2010 (r216051) +++ head/usr.sbin/sysinstall/devices.c Mon Nov 29 11:28:31 2010 (r216052) @@ -91,7 +91,7 @@ static struct _devname { DISK("ipsd%d", "IBM ServeRAID RAID array", 4), DISK("mfid%d", "LSI MegaRAID SAS array", 4), FLOPPY("fd%d", "floppy drive unit A", 4), - SERIAL("cuad%d", "%s on device %s (COM%d)", 16), + SERIAL("cuau%d", "%s on device %s (COM%d)", 16), USB("da%da", "USB Mass Storage Device", 16), NETWORK("ae", "Attansic/Atheros L2 Fast Ethernet"), NETWORK("age", "Attansic/Atheros L1 Gigabit Ethernet"), Modified: head/usr.sbin/sysinstall/menus.c ============================================================================== --- head/usr.sbin/sysinstall/menus.c Mon Nov 29 10:22:45 2010 (r216051) +++ head/usr.sbin/sysinstall/menus.c Mon Nov 29 11:28:31 2010 (r216052) @@ -426,10 +426,10 @@ DMenu MenuMousePort = { { { "1 BusMouse", "PC-98x1 bus mouse (/dev/mse0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/mse0" }, - { "2 COM1", "Serial mouse on COM1 (/dev/cuad0)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad0" }, - { "3 COM2", "Serial mouse on COM2 (/dev/cuad1)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad1" }, + { "2 COM1", "Serial mouse on COM1 (/dev/cuau0)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau0" }, + { "3 COM2", "Serial mouse on COM2 (/dev/cuau1)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau1" }, { NULL } }, }; #else @@ -442,14 +442,14 @@ DMenu MenuMousePort = { NULL, { { "1 PS/2", "PS/2 style mouse (/dev/psm0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/psm0" }, - { "2 COM1", "Serial mouse on COM1 (/dev/cuad0)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad0" }, - { "3 COM2", "Serial mouse on COM2 (/dev/cuad1)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad1" }, - { "4 COM3", "Serial mouse on COM3 (/dev/cuad2)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad2" }, - { "5 COM4", "Serial mouse on COM4 (/dev/cuad3)", - dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuad3" }, + { "2 COM1", "Serial mouse on COM1 (/dev/cuau0)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau0" }, + { "3 COM2", "Serial mouse on COM2 (/dev/cuau1)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau1" }, + { "4 COM3", "Serial mouse on COM3 (/dev/cuau2)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau2" }, + { "5 COM4", "Serial mouse on COM4 (/dev/cuau3)", + dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuau3" }, { "6 BusMouse", "Logitech, ATI or MS bus mouse (/dev/mse0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/mse0" }, { NULL } }, From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 11:55:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A4631065674; Mon, 29 Nov 2010 11:55:18 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 283788FC1C; Mon, 29 Nov 2010 11:55:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oATBtIHo033838; Mon, 29 Nov 2010 11:55:18 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oATBtIh7033836; Mon, 29 Nov 2010 11:55:18 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011291155.oATBtIh7033836@svn.freebsd.org> From: Bruce Cran Date: Mon, 29 Nov 2010 11:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216053 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 11:55:18 -0000 Author: brucec Date: Mon Nov 29 11:55:17 2010 New Revision: 216053 URL: http://svn.freebsd.org/changeset/base/216053 Log: If no floppy drive is installed kldBrowser() can generate an error early on. Initialize menu and count so the cleanup code doesn't try and use their uninitialized values. PR: bin/152270 Submitted by: Remi LAURENT MFC after: 3 days Modified: head/usr.sbin/sysinstall/modules.c Modified: head/usr.sbin/sysinstall/modules.c ============================================================================== --- head/usr.sbin/sysinstall/modules.c Mon Nov 29 11:28:31 2010 (r216052) +++ head/usr.sbin/sysinstall/modules.c Mon Nov 29 11:55:17 2010 (r216053) @@ -123,13 +123,14 @@ driverFloppyCheck(void) int kldBrowser(dialogMenuItem *self) { - DMenu *menu; + DMenu *menu = NULL; int i, what = DITEM_SUCCESS, msize, count; DIR *dir; struct dirent *de; char *err; err = NULL; + count = 0; if (DITEM_STATUS(mediaSetFloppy(NULL)) == DITEM_FAILURE) { err = "Unable to set media device to floppy."; @@ -142,7 +143,6 @@ kldBrowser(dialogMenuItem *self) } msize = sizeof(DMenu) + (sizeof(dialogMenuItem) * 2); - count = 0; if ((menu = malloc(msize)) == NULL) { err = "Failed to allocate memory for menu"; goto errout; From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 15:08:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BA241065672; Mon, 29 Nov 2010 15:08:19 +0000 (UTC) (envelope-from sanpei@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 078BE8FC22; Mon, 29 Nov 2010 15:08:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oATF8IoB049722; Mon, 29 Nov 2010 15:08:18 GMT (envelope-from sanpei@svn.freebsd.org) Received: (from sanpei@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oATF8IET049718; Mon, 29 Nov 2010 15:08:18 GMT (envelope-from sanpei@svn.freebsd.org) Message-Id: <201011291508.oATF8IET049718@svn.freebsd.org> From: MIHIRA Sanpei Yoshiro Date: Mon, 29 Nov 2010 15:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216057 - in head: share/man/man4 sys/dev/usb sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 15:08:19 -0000 Author: sanpei Date: Mon Nov 29 15:08:18 2010 New Revision: 216057 URL: http://svn.freebsd.org/changeset/base/216057 Log: Add new device ids. Buffalo (Melco Inc.) WLI-UC-G PR: 141777 Modified: head/share/man/man4/rum.4 head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_rum.c Modified: head/share/man/man4/rum.4 ============================================================================== --- head/share/man/man4/rum.4 Mon Nov 29 14:47:59 2010 (r216056) +++ head/share/man/man4/rum.4 Mon Nov 29 15:08:18 2010 (r216057) @@ -93,6 +93,7 @@ including: .It "Buffalo WLI-U2-SG54HP" Ta USB .It "Buffalo WLI-U2-SG54HG" Ta USB .It "Buffalo WLI-U2-G54HP" Ta USB +.It "Buffalo WLI-UC-G" Ta USB .It "CNet CWD-854 ver F" Ta USB .It "Conceptronic C54RU ver 2" Ta USB .It "Corega CG-WLUSB2GO" Ta USB Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Nov 29 14:47:59 2010 (r216056) +++ head/sys/dev/usb/usbdevs Mon Nov 29 15:08:18 2010 (r216057) @@ -2140,6 +2140,7 @@ product MELCO SG54HG 0x00f4 WLI-U2-SG54 product MELCO WLRUCG 0x0116 WLR-UC-G product MELCO WLRUCGAOSS 0x0119 WLR-UC-G-AOSS product MELCO WLIUCAG300N 0x012e WLI-UC-AG300N +product MELCO WLIUCG 0x0137 WLI-UC-G product MELCO RT2870_1 0x0148 RT2870 product MELCO RT2870_2 0x0150 RT2870 product MELCO WLIUCGN 0x015d WLI-UC-GN Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Mon Nov 29 14:47:59 2010 (r216056) +++ head/sys/dev/usb/wlan/if_rum.c Mon Nov 29 15:08:18 2010 (r216057) @@ -118,6 +118,7 @@ static const struct usb_device_id rum_de RUM_DEV(HUAWEI3COM, WUB320G), RUM_DEV(MELCO, G54HP), RUM_DEV(MELCO, SG54HP), + RUM_DEV(MELCO, WLIUCG), RUM_DEV(MELCO, WLRUCG), RUM_DEV(MELCO, WLRUCGAOSS), RUM_DEV(MSI, RT2573_1), From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 18:17:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EFFE1065675; Mon, 29 Nov 2010 18:17:54 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12F2F8FC21; Mon, 29 Nov 2010 18:17:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oATIHrxi065145; Mon, 29 Nov 2010 18:17:53 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oATIHria065143; Mon, 29 Nov 2010 18:17:53 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201011291817.oATIHria065143@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 29 Nov 2010 18:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216058 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 18:17:54 -0000 Author: mdf Date: Mon Nov 29 18:17:53 2010 New Revision: 216058 URL: http://svn.freebsd.org/changeset/base/216058 Log: Use the SYSCTL_CHILDREN macro in kern_sysctl.c to help de-obfuscate the code. MFC after: 3 days Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Mon Nov 29 15:08:18 2010 (r216057) +++ head/sys/kern/kern_sysctl.c Mon Nov 29 18:17:53 2010 (r216058) @@ -676,7 +676,7 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS) if (oid->oid_handler) break; - lsp2 = (struct sysctl_oid_list *)oid->oid_arg1; + lsp2 = SYSCTL_CHILDREN(oid); break; } lsp = lsp2; @@ -707,7 +707,7 @@ sysctl_sysctl_next_ls(struct sysctl_oid_ if (oidp->oid_handler) /* We really should call the handler here...*/ return (0); - lsp = (struct sysctl_oid_list *)oidp->oid_arg1; + lsp = SYSCTL_CHILDREN(oidp); if (!sysctl_sysctl_next_ls(lsp, 0, 0, next+1, len, level+1, oidpp)) return (0); @@ -722,7 +722,7 @@ sysctl_sysctl_next_ls(struct sysctl_oid_ return (0); if (oidp->oid_handler) return (0); - lsp = (struct sysctl_oid_list *)oidp->oid_arg1; + lsp = SYSCTL_CHILDREN(oidp); if (!sysctl_sysctl_next_ls(lsp, name+1, namelen-1, next+1, len, level+1, oidpp)) return (0); @@ -734,7 +734,7 @@ sysctl_sysctl_next_ls(struct sysctl_oid_ if (oidp->oid_handler) continue; - lsp = (struct sysctl_oid_list *)oidp->oid_arg1; + lsp = SYSCTL_CHILDREN(oidp); if (!sysctl_sysctl_next_ls(lsp, name+1, namelen-1, next+1, len, level+1, oidpp)) return (0); @@ -812,7 +812,7 @@ name2oid(char *name, int *oid, int *len, if (oidp->oid_handler) break; - lsp = (struct sysctl_oid_list *)oidp->oid_arg1; + lsp = SYSCTL_CHILDREN(oidp); oidp = SLIST_FIRST(lsp); name = p+1; for (p = name; *p && *p != '.'; p++) @@ -1322,8 +1322,7 @@ sysctl_find_oid(int *name, u_int namelen *nindx = indx; return (0); } - oid = SLIST_FIRST( - (struct sysctl_oid_list *)oid->oid_arg1); + oid = SLIST_FIRST(SYSCTL_CHILDREN(oid)); } else if (indx == namelen) { *noid = oid; if (nindx != NULL) From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 18:18:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD20410656A9; Mon, 29 Nov 2010 18:18:01 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0FDF8FC08; Mon, 29 Nov 2010 18:18:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oATII0G3065194; Mon, 29 Nov 2010 18:18:00 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oATII0WI065191; Mon, 29 Nov 2010 18:18:00 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201011291818.oATII0WI065191@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 29 Nov 2010 18:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216059 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 18:18:01 -0000 Author: mdf Date: Mon Nov 29 18:18:00 2010 New Revision: 216059 URL: http://svn.freebsd.org/changeset/base/216059 Log: Slightly modify the logic in sysctl_find_oid to reduce the indentation. There should be no functional change. MFC after: 3 days Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Mon Nov 29 18:17:53 2010 (r216058) +++ head/sys/kern/kern_sysctl.c Mon Nov 29 18:18:00 2010 (r216059) @@ -1303,36 +1303,39 @@ int sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid, int *nindx, struct sysctl_req *req) { + struct sysctl_oid_list *lsp; struct sysctl_oid *oid; int indx; SYSCTL_ASSERT_LOCKED(); - oid = SLIST_FIRST(&sysctl__children); + lsp = &sysctl__children; indx = 0; - while (oid && indx < CTL_MAXNAME) { - if (oid->oid_number == name[indx]) { - indx++; - if (oid->oid_kind & CTLFLAG_NOLOCK) - req->lock = REQ_UNLOCKED; - if ((oid->oid_kind & CTLTYPE) == CTLTYPE_NODE) { - if (oid->oid_handler != NULL || - indx == namelen) { - *noid = oid; - if (nindx != NULL) - *nindx = indx; - return (0); - } - oid = SLIST_FIRST(SYSCTL_CHILDREN(oid)); - } else if (indx == namelen) { + while (indx < CTL_MAXNAME) { + SLIST_FOREACH(oid, lsp, oid_link) { + if (oid->oid_number == name[indx]) + break; + } + if (oid == NULL) + return (ENOENT); + + indx++; + if (oid->oid_kind & CTLFLAG_NOLOCK) + req->lock = REQ_UNLOCKED; + if ((oid->oid_kind & CTLTYPE) == CTLTYPE_NODE) { + if (oid->oid_handler != NULL || indx == namelen) { *noid = oid; if (nindx != NULL) *nindx = indx; return (0); - } else { - return (ENOTDIR); } + lsp = SYSCTL_CHILDREN(oid); + } else if (indx == namelen) { + *noid = oid; + if (nindx != NULL) + *nindx = indx; + return (0); } else { - oid = SLIST_NEXT(oid, oid_link); + return (ENOTDIR); } } return (ENOENT); From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 18:18:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0211D10656A7; Mon, 29 Nov 2010 18:18:08 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E329E8FC0C; Mon, 29 Nov 2010 18:18:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oATII7KU065251; Mon, 29 Nov 2010 18:18:07 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oATII7df065248; Mon, 29 Nov 2010 18:18:07 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201011291818.oATII7df065248@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 29 Nov 2010 18:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216060 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 18:18:08 -0000 Author: mdf Date: Mon Nov 29 18:18:07 2010 New Revision: 216060 URL: http://svn.freebsd.org/changeset/base/216060 Log: Do not hold the sysctl lock across a call to the handler. This fixes a general LOR issue where the sysctl lock had no good place in the hierarchy. One specific instance is #284 on http://sources.zabbadoz.net/freebsd/lor.html . Reviewed by: jhb MFC after: 1 month X-MFC-note: split oid_refcnt field for oid_running to preserve KBI Modified: head/sys/kern/kern_sysctl.c head/sys/sys/sysctl.h Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Mon Nov 29 18:18:00 2010 (r216059) +++ head/sys/kern/kern_sysctl.c Mon Nov 29 18:18:07 2010 (r216060) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" #include +#include #include #include #include @@ -86,13 +87,12 @@ static MALLOC_DEFINE(M_SYSCTLTMP, "sysct static struct sx sysctllock; static struct sx sysctlmemlock; -#define SYSCTL_SLOCK() sx_slock(&sysctllock) -#define SYSCTL_SUNLOCK() sx_sunlock(&sysctllock) #define SYSCTL_XLOCK() sx_xlock(&sysctllock) #define SYSCTL_XUNLOCK() sx_xunlock(&sysctllock) #define SYSCTL_ASSERT_XLOCKED() sx_assert(&sysctllock, SA_XLOCKED) -#define SYSCTL_ASSERT_LOCKED() sx_assert(&sysctllock, SA_LOCKED) #define SYSCTL_INIT() sx_init(&sysctllock, "sysctl lock") +#define SYSCTL_SLEEP(ch, wmesg, timo) \ + sx_sleep(ch, &sysctllock, 0, wmesg, timo) static int sysctl_root(SYSCTL_HANDLER_ARGS); @@ -106,7 +106,7 @@ sysctl_find_oidname(const char *name, st { struct sysctl_oid *oidp; - SYSCTL_ASSERT_LOCKED(); + SYSCTL_ASSERT_XLOCKED(); SLIST_FOREACH(oidp, list, oid_link) { if (strcmp(oidp->oid_name, name) == 0) { return (oidp); @@ -313,7 +313,7 @@ sysctl_ctx_entry_find(struct sysctl_ctx_ { struct sysctl_ctx_entry *e; - SYSCTL_ASSERT_LOCKED(); + SYSCTL_ASSERT_XLOCKED(); if (clist == NULL || oidp == NULL) return(NULL); TAILQ_FOREACH(e, clist, link) { @@ -409,6 +409,16 @@ sysctl_remove_oid_locked(struct sysctl_o } sysctl_unregister_oid(oidp); if (del) { + /* + * Wait for all threads running the handler to drain. + * This preserves the previous behavior when the + * sysctl lock was held across a handler invocation, + * and is necessary for module unload correctness. + */ + while (oidp->oid_running > 0) { + oidp->oid_kind |= CTLFLAG_DYING; + SYSCTL_SLEEP(&oidp->oid_running, "oidrm", 0); + } if (oidp->oid_descr) free((void *)(uintptr_t)(const void *)oidp->oid_descr, M_SYSCTLOID); free((void *)(uintptr_t)(const void *)oidp->oid_name, @@ -581,7 +591,7 @@ sysctl_sysctl_debug_dump_node(struct sys int k; struct sysctl_oid *oidp; - SYSCTL_ASSERT_LOCKED(); + SYSCTL_ASSERT_XLOCKED(); SLIST_FOREACH(oidp, l, oid_link) { for (k=0; ktd, PRIV_SYSCTL_DEBUG); if (error) return (error); + SYSCTL_XLOCK(); sysctl_sysctl_debug_dump_node(&sysctl__children, 0); + SYSCTL_XUNLOCK(); return (ENOENT); } @@ -640,7 +652,7 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS) struct sysctl_oid_list *lsp = &sysctl__children, *lsp2; char buf[10]; - SYSCTL_ASSERT_LOCKED(); + SYSCTL_XLOCK(); while (namelen) { if (!lsp) { snprintf(buf,sizeof(buf),"%d",*name); @@ -649,7 +661,7 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS) if (!error) error = SYSCTL_OUT(req, buf, strlen(buf)); if (error) - return (error); + goto out; namelen--; name++; continue; @@ -665,7 +677,7 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS) error = SYSCTL_OUT(req, oid->oid_name, strlen(oid->oid_name)); if (error) - return (error); + goto out; namelen--; name++; @@ -681,7 +693,10 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS) } lsp = lsp2; } - return (SYSCTL_OUT(req, "", 1)); + error = SYSCTL_OUT(req, "", 1); + out: + SYSCTL_XUNLOCK(); + return (error); } static SYSCTL_NODE(_sysctl, 1, name, CTLFLAG_RD, sysctl_sysctl_name, ""); @@ -692,7 +707,7 @@ sysctl_sysctl_next_ls(struct sysctl_oid_ { struct sysctl_oid *oidp; - SYSCTL_ASSERT_LOCKED(); + SYSCTL_ASSERT_XLOCKED(); *len = level; SLIST_FOREACH(oidp, lsp, oid_link) { *next = oidp->oid_number; @@ -756,7 +771,9 @@ sysctl_sysctl_next(SYSCTL_HANDLER_ARGS) struct sysctl_oid_list *lsp = &sysctl__children; int newoid[CTL_MAXNAME]; + SYSCTL_XLOCK(); i = sysctl_sysctl_next_ls(lsp, name, namelen, newoid, &j, 1, &oid); + SYSCTL_XUNLOCK(); if (i) return (ENOENT); error = SYSCTL_OUT(req, newoid, j * sizeof (int)); @@ -773,7 +790,7 @@ name2oid(char *name, int *oid, int *len, struct sysctl_oid_list *lsp = &sysctl__children; char *p; - SYSCTL_ASSERT_LOCKED(); + SYSCTL_ASSERT_XLOCKED(); if (!*name) return (ENOENT); @@ -831,8 +848,6 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_AR int error, oid[CTL_MAXNAME], len; struct sysctl_oid *op = 0; - SYSCTL_ASSERT_LOCKED(); - if (!req->newlen) return (ENOENT); if (req->newlen >= MAXPATHLEN) /* XXX arbitrary, undocumented */ @@ -848,7 +863,9 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_AR p [req->newlen] = '\0'; + SYSCTL_XLOCK(); error = name2oid(p, oid, &len, &op); + SYSCTL_XUNLOCK(); free(p, M_SYSCTL); @@ -868,16 +885,21 @@ sysctl_sysctl_oidfmt(SYSCTL_HANDLER_ARGS struct sysctl_oid *oid; int error; + SYSCTL_XLOCK(); error = sysctl_find_oid(arg1, arg2, &oid, NULL, req); if (error) - return (error); + goto out; - if (!oid->oid_fmt) - return (ENOENT); + if (oid->oid_fmt == NULL) { + error = ENOENT; + goto out; + } error = SYSCTL_OUT(req, &oid->oid_kind, sizeof(oid->oid_kind)); if (error) - return (error); + goto out; error = SYSCTL_OUT(req, oid->oid_fmt, strlen(oid->oid_fmt) + 1); + out: + SYSCTL_XUNLOCK(); return (error); } @@ -891,13 +913,18 @@ sysctl_sysctl_oiddescr(SYSCTL_HANDLER_AR struct sysctl_oid *oid; int error; + SYSCTL_XLOCK(); error = sysctl_find_oid(arg1, arg2, &oid, NULL, req); if (error) - return (error); + goto out; - if (!oid->oid_descr) - return (ENOENT); + if (oid->oid_descr == NULL) { + error = ENOENT; + goto out; + } error = SYSCTL_OUT(req, oid->oid_descr, strlen(oid->oid_descr) + 1); + out: + SYSCTL_XUNLOCK(); return (error); } @@ -1177,9 +1204,9 @@ kernel_sysctl(struct thread *td, int *na req.newfunc = sysctl_new_kernel; req.lock = REQ_LOCKED; - SYSCTL_SLOCK(); + SYSCTL_XLOCK(); error = sysctl_root(0, name, namelen, &req); - SYSCTL_SUNLOCK(); + SYSCTL_XUNLOCK(); if (req.lock == REQ_WIRED && req.validlen > 0) vsunlock(req.oldptr, req.validlen); @@ -1307,7 +1334,7 @@ sysctl_find_oid(int *name, u_int namelen struct sysctl_oid *oid; int indx; - SYSCTL_ASSERT_LOCKED(); + SYSCTL_ASSERT_XLOCKED(); lsp = &sysctl__children; indx = 0; while (indx < CTL_MAXNAME) { @@ -1326,6 +1353,8 @@ sysctl_find_oid(int *name, u_int namelen *noid = oid; if (nindx != NULL) *nindx = indx; + KASSERT((oid->oid_kind & CTLFLAG_DYING) == 0, + ("%s found DYING node %p", __func__, oid)); return (0); } lsp = SYSCTL_CHILDREN(oid); @@ -1333,6 +1362,8 @@ sysctl_find_oid(int *name, u_int namelen *noid = oid; if (nindx != NULL) *nindx = indx; + KASSERT((oid->oid_kind & CTLFLAG_DYING) == 0, + ("%s found DYING node %p", __func__, oid)); return (0); } else { return (ENOTDIR); @@ -1352,7 +1383,7 @@ sysctl_root(SYSCTL_HANDLER_ARGS) struct sysctl_oid *oid; int error, indx, lvl; - SYSCTL_ASSERT_LOCKED(); + SYSCTL_ASSERT_XLOCKED(); error = sysctl_find_oid(arg1, arg2, &oid, &indx, req); if (error) @@ -1416,12 +1447,21 @@ sysctl_root(SYSCTL_HANDLER_ARGS) if (error != 0) return (error); #endif + oid->oid_running++; + SYSCTL_XUNLOCK(); + if (!(oid->oid_kind & CTLFLAG_MPSAFE)) mtx_lock(&Giant); error = oid->oid_handler(oid, arg1, arg2, req); if (!(oid->oid_kind & CTLFLAG_MPSAFE)) mtx_unlock(&Giant); + KFAIL_POINT_ERROR(_debug_fail_point, sysctl_running, error); + + SYSCTL_XLOCK(); + oid->oid_running--; + if (oid->oid_running == 0 && (oid->oid_kind & CTLFLAG_DYING) != 0) + wakeup(&oid->oid_running); return (error); } @@ -1521,9 +1561,9 @@ userland_sysctl(struct thread *td, int * for (;;) { req.oldidx = 0; req.newidx = 0; - SYSCTL_SLOCK(); + SYSCTL_XLOCK(); error = sysctl_root(0, name, namelen, &req); - SYSCTL_SUNLOCK(); + SYSCTL_XUNLOCK(); if (error != EAGAIN) break; uio_yield(); Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Mon Nov 29 18:18:00 2010 (r216059) +++ head/sys/sys/sysctl.h Mon Nov 29 18:18:07 2010 (r216060) @@ -87,6 +87,7 @@ struct ctlname { #define CTLFLAG_MPSAFE 0x00040000 /* Handler is MP safe */ #define CTLFLAG_VNET 0x00020000 /* Prisons with vnet can fiddle */ #define CTLFLAG_RDTUN (CTLFLAG_RD|CTLFLAG_TUN) +#define CTLFLAG_DYING 0x00010000 /* oid is being removed */ /* * Secure level. Note that CTLFLAG_SECURE == CTLFLAG_SECURE1. @@ -163,6 +164,7 @@ struct sysctl_oid { int (*oid_handler)(SYSCTL_HANDLER_ARGS); const char *oid_fmt; int oid_refcnt; + u_int oid_running; const char *oid_descr; }; @@ -222,7 +224,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e #define SYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, descr) \ static struct sysctl_oid sysctl__##parent##_##name = { \ &sysctl_##parent##_children, { NULL }, nbr, kind, \ - a1, a2, #name, handler, fmt, 0, __DESCR(descr) }; \ + a1, a2, #name, handler, fmt, 0, 0, __DESCR(descr) }; \ DATA_SET(sysctl_set, sysctl__##parent##_##name) #define SYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, fmt, descr) \ From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 18:56:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FC4110656A3; Mon, 29 Nov 2010 18:56:52 +0000 (UTC) (envelope-from fjoe@samodelkin.net) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 995468FC1E; Mon, 29 Nov 2010 18:56:51 +0000 (UTC) Received: by vws9 with SMTP id 9so1423905vws.13 for ; Mon, 29 Nov 2010 10:56:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.185.1 with SMTP id cm1mr5226898qcb.29.1291055491671; Mon, 29 Nov 2010 10:31:31 -0800 (PST) Received: by 10.229.246.133 with HTTP; Mon, 29 Nov 2010 10:31:31 -0800 (PST) X-Originating-IP: [109.174.58.22] In-Reply-To: <20101128194542.GF9966@alchemy.franken.de> References: <201011281926.oASJQKiE040689@svn.freebsd.org> <20101128194542.GF9966@alchemy.franken.de> Date: Tue, 30 Nov 2010 00:31:31 +0600 Message-ID: From: Max Khon To: Marius Strobl Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216016 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 18:56:52 -0000 Marius, On Mon, Nov 29, 2010 at 1:45 AM, Marius Strobl wrote: On Sun, Nov 28, 2010 at 07:26:20PM +0000, Max Khon wrote: > > Author: fjoe > > Date: Sun Nov 28 19:26:20 2010 > > New Revision: 216016 > > URL: http://svn.freebsd.org/changeset/base/216016 > > > > Log: > > Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with > > DEBUG_MEMGUARD panics early in kmeminit() with the message > > "kmem_suballoc: bad status return of 1" because of zero "size" argument > > passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. > > > > The problem also exists on ia64. > > > > Modified: > > head/sys/sparc64/include/vmparam.h > > > > Modified: head/sys/sparc64/include/vmparam.h > > > ============================================================================== > > --- head/sys/sparc64/include/vmparam.h Sun Nov 28 18:59:52 2010 > (r216015) > > +++ head/sys/sparc64/include/vmparam.h Sun Nov 28 19:26:20 2010 > (r216016) > > @@ -237,6 +237,14 @@ > > #endif > > > > /* > > + * Ceiling on amount of kmem_map kva space. > > + */ > > +#ifndef VM_KMEM_SIZE_MAX > > +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ > > + VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) > > +#endif > > + > > +/* > > * Initial pagein size of beginning of executable file. > > */ > > #ifndef VM_INITIAL_PAGEIN > > How was that value determined? > I've just copied it from amd64 to be non-zero for now. Do you have a better idea of what it should look like? Max From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 19:23:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B20DC1065673; Mon, 29 Nov 2010 19:23:10 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 429B28FC1D; Mon, 29 Nov 2010 19:23:09 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id oATJN8ar018881; Mon, 29 Nov 2010 20:23:08 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id oATJN86v018880; Mon, 29 Nov 2010 20:23:08 +0100 (CET) (envelope-from marius) Date: Mon, 29 Nov 2010 20:23:08 +0100 From: Marius Strobl To: Max Khon Message-ID: <20101129192308.GX80343@alchemy.franken.de> References: <201011281926.oASJQKiE040689@svn.freebsd.org> <20101128194542.GF9966@alchemy.franken.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216016 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 19:23:10 -0000 On Tue, Nov 30, 2010 at 12:31:31AM +0600, Max Khon wrote: > Marius, > > On Mon, Nov 29, 2010 at 1:45 AM, Marius Strobl wrote: > > On Sun, Nov 28, 2010 at 07:26:20PM +0000, Max Khon wrote: > > > Author: fjoe > > > Date: Sun Nov 28 19:26:20 2010 > > > New Revision: 216016 > > > URL: http://svn.freebsd.org/changeset/base/216016 > > > > > > Log: > > > Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with > > > DEBUG_MEMGUARD panics early in kmeminit() with the message > > > "kmem_suballoc: bad status return of 1" because of zero "size" argument > > > passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. > > > > > > The problem also exists on ia64. > > > > > > Modified: > > > head/sys/sparc64/include/vmparam.h > > > > > > Modified: head/sys/sparc64/include/vmparam.h > > > > > ============================================================================== > > > --- head/sys/sparc64/include/vmparam.h Sun Nov 28 18:59:52 2010 > > (r216015) > > > +++ head/sys/sparc64/include/vmparam.h Sun Nov 28 19:26:20 2010 > > (r216016) > > > @@ -237,6 +237,14 @@ > > > #endif > > > > > > /* > > > + * Ceiling on amount of kmem_map kva space. > > > + */ > > > +#ifndef VM_KMEM_SIZE_MAX > > > +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ > > > + VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) > > > +#endif > > > + > > > +/* > > > * Initial pagein size of beginning of executable file. > > > */ > > > #ifndef VM_INITIAL_PAGEIN > > > > How was that value determined? > > > > I've just copied it from amd64 to be non-zero for now. Do you have a better > idea of what it should look like? > Well, on sparc64 VM_MAX_KERNEL_ADDRESS already is dynamically adjusted to the maximum appropriate for the specific CPU during the early cycles of the kernel so I'd think one could just use VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS for VM_KMEM_SIZE_MAX there, I'm not sure what the intention of the ceiling provided by that macro actually is though In any case, the commit message of r180210 which changed the amd64 version to the current one talks about limiting the kmem map to 3.6GB and while it also fails to explain where that value comes from it looks rather amd64 specific and the formula used by the macro will result in a different ceiling on sparc64 and thus inappropriate. I've CC'ed alc@ who hopefully can shed some light on this. Apart from this the actual bug here seems to be that memguard_fudge() can't deal with a km_max being zero or that zero is passed to it as kmeminit() allows for VM_KMEM_SIZE_MAX not being defined. Marius From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 19:24:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D1431065697; Mon, 29 Nov 2010 19:24:19 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id BF99B8FC15; Mon, 29 Nov 2010 19:24:18 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id oATJOH7L018910; Mon, 29 Nov 2010 20:24:17 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id oATJOHZM018909; Mon, 29 Nov 2010 20:24:17 +0100 (CET) (envelope-from marius) Date: Mon, 29 Nov 2010 20:24:17 +0100 From: Marius Strobl To: Max Khon Message-ID: <20101129192417.GA18893@alchemy.franken.de> References: <201011281926.oASJQKiE040689@svn.freebsd.org> <20101128194542.GF9966@alchemy.franken.de> <20101129192308.GX80343@alchemy.franken.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101129192308.GX80343@alchemy.franken.de> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, alc@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216016 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 19:24:19 -0000 On Mon, Nov 29, 2010 at 08:23:08PM +0100, Marius Strobl wrote: > On Tue, Nov 30, 2010 at 12:31:31AM +0600, Max Khon wrote: > > Marius, > > > > On Mon, Nov 29, 2010 at 1:45 AM, Marius Strobl wrote: > > > > On Sun, Nov 28, 2010 at 07:26:20PM +0000, Max Khon wrote: > > > > Author: fjoe > > > > Date: Sun Nov 28 19:26:20 2010 > > > > New Revision: 216016 > > > > URL: http://svn.freebsd.org/changeset/base/216016 > > > > > > > > Log: > > > > Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with > > > > DEBUG_MEMGUARD panics early in kmeminit() with the message > > > > "kmem_suballoc: bad status return of 1" because of zero "size" argument > > > > passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. > > > > > > > > The problem also exists on ia64. > > > > > > > > Modified: > > > > head/sys/sparc64/include/vmparam.h > > > > > > > > Modified: head/sys/sparc64/include/vmparam.h > > > > > > > ============================================================================== > > > > --- head/sys/sparc64/include/vmparam.h Sun Nov 28 18:59:52 2010 > > > (r216015) > > > > +++ head/sys/sparc64/include/vmparam.h Sun Nov 28 19:26:20 2010 > > > (r216016) > > > > @@ -237,6 +237,14 @@ > > > > #endif > > > > > > > > /* > > > > + * Ceiling on amount of kmem_map kva space. > > > > + */ > > > > +#ifndef VM_KMEM_SIZE_MAX > > > > +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ > > > > + VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) > > > > +#endif > > > > + > > > > +/* > > > > * Initial pagein size of beginning of executable file. > > > > */ > > > > #ifndef VM_INITIAL_PAGEIN > > > > > > How was that value determined? > > > > > > > I've just copied it from amd64 to be non-zero for now. Do you have a better > > idea of what it should look like? > > > > Well, on sparc64 VM_MAX_KERNEL_ADDRESS already is dynamically adjusted > to the maximum appropriate for the specific CPU during the early cycles > of the kernel so I'd think one could just use VM_MAX_KERNEL_ADDRESS - > VM_MIN_KERNEL_ADDRESS for VM_KMEM_SIZE_MAX there, I'm not sure what > the intention of the ceiling provided by that macro actually is though > In any case, the commit message of r180210 which changed the amd64 > version to the current one talks about limiting the kmem map to 3.6GB > and while it also fails to explain where that value comes from it > looks rather amd64 specific and the formula used by the macro will > result in a different ceiling on sparc64 and thus inappropriate. I've > CC'ed alc@ who hopefully can shed some light on this. > Apart from this the actual bug here seems to be that memguard_fudge() > can't deal with a km_max being zero or that zero is passed to it as > kmeminit() allows for VM_KMEM_SIZE_MAX not being defined. > Oops, forgot to actually CC alc@. Marius From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 20:16:08 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC8551065672; Mon, 29 Nov 2010 20:16:08 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 204338FC1A; Mon, 29 Nov 2010 20:16:07 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.4/8.14.2) with ESMTP id oATJdNf0070934; Mon, 29 Nov 2010 14:39:23 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.4/8.14.2/Submit) id oATJdMBh070933; Mon, 29 Nov 2010 14:39:22 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Mon, 29 Nov 2010 14:39:22 -0500 From: David Schultz To: Dimitry Andric Message-ID: <20101129193922.GA70555@zim.MIT.EDU> Mail-Followup-To: Dimitry Andric , mdf@freebsd.org, Gabor Kovesdan , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201008181740.o7IHeA4c075984@svn.freebsd.org> <4C6C4FDD.8080803@andric.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C6C4FDD.8080803@andric.com> Cc: svn-src-head@FreeBSD.ORG, mdf@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Gabor Kovesdan Subject: Re: svn commit: r211463 - head/usr.bin/grep X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 20:16:08 -0000 On Wed, Aug 18, 2010, Dimitry Andric wrote: > On 2010-08-18 22:48, mdf@FreeBSD.org wrote: > >> - Refactor file reading code to use pure syscalls and an internal buffer > >> instead of stdio. This gives BSD grep a very big performance boost, > >> its speed is now almost comparable to GNU grep. > > > > I didn't read all of the details in the profiling mails in the thread, > > but does this mean that work on stdio would give a performance boost > > to many apps? Or is there something specific about how grep(1) is > > using its input that makes it a horse of a different color? > > Originally, it was reading files 1 character at a time, using fgetc(3), > the locking version even. This is usually not the fastest way to read > a large file with stdio. :) > > If grep did not have to support .gz or .bz2 files, we could just have > plugged in stdio's fgetln(3). I tried this approach first on some > non-compressed files, and it performed much better than fgetc'ing. > > The reading code that was now committed, is basically the same algorithm > as fgetln() uses internally, but it can handle gzip and bzip2 input too. The gzip limitations you refer to could perhaps be worked around with a simple application of funopen(3). IIRC, the overhead inherent in using fgetln(3) or getline(3) on reasonably long lines is very small; if it's not, we should look at ways to improve stdio. There's still a locking operation and memcpy() that can't really be avoided with stdio, though. With getline(), you'd be able to delete most of file.c, but it would never be quite as fast. From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 20:53:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91007106564A; Mon, 29 Nov 2010 20:53:12 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id D55758FC0C; Mon, 29 Nov 2010 20:53:11 +0000 (UTC) Received: by wwf26 with SMTP id 26so689387wwf.31 for ; Mon, 29 Nov 2010 12:53:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.147.148 with SMTP id l20mr6569807wbv.118.1291063990509; Mon, 29 Nov 2010 12:53:10 -0800 (PST) Sender: andy@fud.org.nz Received: by 10.227.143.200 with HTTP; Mon, 29 Nov 2010 12:53:10 -0800 (PST) In-Reply-To: <20101016132753.GU2392@deviant.kiev.zoral.com.ua> References: <20101016100051.GS2392@deviant.kiev.zoral.com.ua> <201010161212.43749.hselasky@freebsd.org> <201010161330.31549.hselasky@c2i.net> <20101016132753.GU2392@deviant.kiev.zoral.com.ua> Date: Tue, 30 Nov 2010 09:53:10 +1300 X-Google-Sender-Auth: KiraqYxsVK5au1NTHxm7aKOIwM4 Message-ID: From: Andrew Thompson To: Kostik Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Hans Petter Selasky Subject: Re: svn commit: r213852 - in head: lib/libusb sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 20:53:12 -0000 On 17 October 2010 02:27, Kostik Belousov wrote: > On Sat, Oct 16, 2010 at 01:30:31PM +0200, Hans Petter Selasky wrote: >> On Saturday 16 October 2010 12:12:43 Hans Petter Selasky wrote: >> > On Saturday 16 October 2010 12:00:51 Kostik Belousov wrote: >> > > > USB has some shared memory structures which are used in both user-= land >> > > > and =A0kernel, which are not part of IOCTLs. Your approach means t= hat >> > > > there are two sets of IOCTL's of all kinds, one for 32-bit and one= for >> > > > 64-bit? >> > > >> > > For all kinds of structures that are not ABI-invariant, yes. >> > >> >> Hi, >> >> I've committed a patch to fix the buildworld breakage after feedback fro= m >> Andreas Tobler. >> >> http://svn.freebsd.org/changeset/base/213920 >> >> > The approach that was discussed by me and Andrew earlier this year, wa= s to >> > use uint64_t instead of "void *" in shared memory structures. The only >> > disadvantage is that this will force you to recompile libusb when you >> > update the kernel, and so we kind of put that approach aside to keep >> > seamless upgrade compatibility. >> >> This will also break the ABI on 8-stable and that was the main reason fo= r >> going the other route. However, most applications access USB via libusb,= so >> the breakage would probably be minimal. Do you have any opinions here? S= hould >> we make an exception for the general rule to not change the ABI within a >> stable branch? >> >> I'm attaching the other approach, which allows both 32 and 64 bit applic= ations >> to use USB using the same IOCTL's. >> >> See thread: [FreeBSD 8/9] [64-bit IOCTL] Using the USB stack from a 32-b= it >> application under a 64-bit kernel. >> > This is a choice of the poison :). > > Ideally, you would switch to the new ABI and keep old ABI shims around > for binary compatibility. In essence, this is equivalent to the proper > 32bit compat shims. Is this change something that could be merged to 8.2? libusb consumers should not be affected but I do not know if any other applications would be affected. Andrew From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 21:04:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDD48106564A; Mon, 29 Nov 2010 21:04:00 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C11ED8FC1A; Mon, 29 Nov 2010 21:04:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oATL40mq086209; Mon, 29 Nov 2010 21:04:00 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oATL40J3086207; Mon, 29 Nov 2010 21:04:00 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201011292104.oATL40J3086207@svn.freebsd.org> From: Juli Mallett Date: Mon, 29 Nov 2010 21:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216064 - head/sys/mips/cavium/octe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 21:04:02 -0000 Author: jmallett Date: Mon Nov 29 21:04:00 2010 New Revision: 216064 URL: http://svn.freebsd.org/changeset/base/216064 Log: Don't free the work queue entry that we're using to hold the scatter-gather list on exit from the transmit path. The scatter-gather list itself can be asynchronously DMAed to the transmit hardware, and we could actually lock up the transmitter if any of a number of races around this were lost. Instead, let the PKO free the scatter-gather list when it is done with it, and use the "i" bit in each segment of the packet to avoid having them go into the FPA. This fixes an unrecoverable transmit stall under transmit load. MFC after: 3 days Modified: head/sys/mips/cavium/octe/ethernet-tx.c Modified: head/sys/mips/cavium/octe/ethernet-tx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-tx.c Mon Nov 29 20:43:06 2010 (r216063) +++ head/sys/mips/cavium/octe/ethernet-tx.c Mon Nov 29 21:04:00 2010 (r216064) @@ -143,6 +143,7 @@ int cvm_oct_xmit(struct mbuf *m, struct /* Build the PKO command */ pko_command.u64 = 0; pko_command.s.segs = 1; + pko_command.s.dontfree = 1; /* Do not put this buffer into the FPA. */ work = NULL; } else { @@ -164,6 +165,7 @@ int cvm_oct_xmit(struct mbuf *m, struct /* Build the PKO buffer pointer */ hw_buffer.u64 = 0; + hw_buffer.s.i = 1; /* Do not put this buffer into the FPA. */ hw_buffer.s.addr = cvmx_ptr_to_phys(n->m_data); hw_buffer.s.pool = 0; hw_buffer.s.size = n->m_len; @@ -182,12 +184,11 @@ int cvm_oct_xmit(struct mbuf *m, struct pko_command.u64 = 0; pko_command.s.segs = segs; pko_command.s.gather = 1; + pko_command.s.dontfree = 0; /* Put the WQE above back into the FPA. */ } /* Finish building the PKO command */ pko_command.s.n2 = 1; /* Don't pollute L2 with the outgoing packet */ - pko_command.s.dontfree = 1; - pko_command.s.reg0 = priv->fau+qos*4; pko_command.s.reg0 = priv->fau+qos*4; pko_command.s.total_bytes = m->m_pkthdr.len; pko_command.s.size0 = CVMX_FAU_OP_SIZE_32; @@ -200,6 +201,11 @@ int cvm_oct_xmit(struct mbuf *m, struct pko_command.s.ipoffp1 = ETHER_HDR_LEN + 1; } + /* + * XXX + * Could use a different free queue (and different FAU address) per + * core instead of per QoS, to reduce contention here. + */ IF_LOCK(&priv->tx_free_queue[qos]); if (USE_ASYNC_IOBDMA) { /* Get the number of mbufs in use by the hardware */ @@ -242,8 +248,6 @@ int cvm_oct_xmit(struct mbuf *m, struct /* Pass it to any BPF listeners. */ ETHER_BPF_MTAP(ifp, m); } - if (work != NULL) - cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, DONT_WRITEBACK(1)); /* Free mbufs not in use by the hardware */ if (_IF_QLEN(&priv->tx_free_queue[qos]) > in_use) { From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 21:31:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA8A01065673; Mon, 29 Nov 2010 21:31:25 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98D778FC18; Mon, 29 Nov 2010 21:31:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oATLVPL9089167; Mon, 29 Nov 2010 21:31:25 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oATLVPug089165; Mon, 29 Nov 2010 21:31:25 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201011292131.oATLVPug089165@svn.freebsd.org> From: Doug Barton Date: Mon, 29 Nov 2010 21:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216065 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 21:31:25 -0000 Author: dougb Date: Mon Nov 29 21:31:25 2010 New Revision: 216065 URL: http://svn.freebsd.org/changeset/base/216065 Log: Update the description of green_saver.ko Improvements to my suggested text from: jhb Modified: head/share/man/man4/splash.4 Modified: head/share/man/man4/splash.4 ============================================================================== --- head/share/man/man4/splash.4 Mon Nov 29 21:04:00 2010 (r216064) +++ head/share/man/man4/splash.4 Mon Nov 29 21:31:25 2010 (r216065) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 7, 2010 +.Dd November 29, 2010 .Dt SPLASH 4 .Os .Sh NAME @@ -114,7 +114,10 @@ The screen will gradually fade away. .It Pa fire_saver.ko A fire which becomes higher as load increases. .It Pa green_saver.ko -If the monitor supports power saving mode, it will be turned off. +The screen will be blanked, similar to +.Pa blank_saver.ko . +If the monitor and the video card's BIOS support it +the screen will also be powered off. .It Pa logo_saver.ko Animated graphical .Fx From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 21:53:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAA121065670; Mon, 29 Nov 2010 21:53:21 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A928A8FC0A; Mon, 29 Nov 2010 21:53:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oATLrLtx091030; Mon, 29 Nov 2010 21:53:21 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oATLrL7p091028; Mon, 29 Nov 2010 21:53:21 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201011292153.oATLrL7p091028@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 29 Nov 2010 21:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216066 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 21:53:21 -0000 Author: mdf Date: Mon Nov 29 21:53:21 2010 New Revision: 216066 URL: http://svn.freebsd.org/changeset/base/216066 Log: Fix uninitialized variable warning that shows on Tinderbox but not my setup. (??) Submitted by: Michael Butler Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Mon Nov 29 21:31:25 2010 (r216065) +++ head/sys/kern/kern_sysctl.c Mon Nov 29 21:53:21 2010 (r216066) @@ -845,7 +845,7 @@ static int sysctl_sysctl_name2oid(SYSCTL_HANDLER_ARGS) { char *p; - int error, oid[CTL_MAXNAME], len; + int error, oid[CTL_MAXNAME], len = 0; struct sysctl_oid *op = 0; if (!req->newlen) From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 22:19:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 729F71065672; Mon, 29 Nov 2010 22:19:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4719D8FC24; Mon, 29 Nov 2010 22:19:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oATMJJL7093631; Mon, 29 Nov 2010 22:19:19 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oATMJJcH093629; Mon, 29 Nov 2010 22:19:19 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011292219.oATMJJcH093629@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 29 Nov 2010 22:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216067 - head/sys/dev/syscons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 22:19:19 -0000 Author: jkim Date: Mon Nov 29 22:19:19 2010 New Revision: 216067 URL: http://svn.freebsd.org/changeset/base/216067 Log: Honor font size for the video mode when default fonts are compiled in kernel and VESA mode is enabled from loader. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Nov 29 21:53:21 2010 (r216066) +++ head/sys/dev/syscons/syscons.c Mon Nov 29 22:19:19 2010 (r216067) @@ -348,7 +348,9 @@ static void sc_set_vesa_mode(scr_stat *scp, sc_softc_t *sc, int unit) { video_info_t info; + u_char *font; int depth; + int font_size; int i; int vmode; @@ -377,9 +379,37 @@ sc_set_vesa_mode(scr_stat *scp, sc_softc vidd_get_info(sc->adp, vmode, &info); } +#if !defined(SC_NO_FONT_LOADING) && defined(SC_DFLT_FONT) + font_size = info.vi_cheight; +#else + font_size = 16; +#endif + if (font_size < 14) + font_size = 8; + else if (font_size >= 16) + font_size = 16; + else + font_size = 14; #ifndef SC_NO_FONT_LOADING - if ((sc->fonts_loaded & FONT_16) == 0) - return; + switch (font_size) { + case 8: + if ((sc->fonts_loaded & FONT_8) == 0) + return; + font = sc->font_8; + break; + case 14: + if ((sc->fonts_loaded & FONT_14) == 0) + return; + font = sc->font_14; + break; + case 16: + if ((sc->fonts_loaded & FONT_16) == 0) + return; + font = sc->font_16; + break; + } +#else + font = NULL; #endif #ifdef DEV_SPLASH if ((sc->flags & SC_SPLASH_SCRN) != 0) @@ -398,16 +428,12 @@ sc_set_vesa_mode(scr_stat *scp, sc_softc scp->xpixel = info.vi_width; scp->ypixel = info.vi_height; scp->xsize = scp->xpixel / 8; - scp->ysize = scp->ypixel / 16; + scp->ysize = scp->ypixel / font_size; scp->xpos = 0; scp->ypos = scp->ysize - 1; scp->xoff = scp->yoff = 0; -#ifndef SC_NO_FONT_LOADING - scp->font = sc->font_16; -#else - scp->font = NULL; -#endif - scp->font_size = 16; + scp->font = font; + scp->font_size = font_size; scp->font_width = 8; scp->start = scp->xsize * scp->ysize - 1; scp->end = 0; From owner-svn-src-head@FreeBSD.ORG Mon Nov 29 22:20:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C16EE10656A4; Mon, 29 Nov 2010 22:20:44 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFE9E8FC18; Mon, 29 Nov 2010 22:20:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oATMKiN5093845; Mon, 29 Nov 2010 22:20:44 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oATMKiiT093843; Mon, 29 Nov 2010 22:20:44 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011292220.oATMKiiT093843@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 29 Nov 2010 22:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216068 - head/sys/dev/syscons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 22:20:44 -0000 Author: jkim Date: Mon Nov 29 22:20:44 2010 New Revision: 216068 URL: http://svn.freebsd.org/changeset/base/216068 Log: Clean up code a bit to make it more readable. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Nov 29 22:19:19 2010 (r216067) +++ head/sys/dev/syscons/syscons.c Mon Nov 29 22:20:44 2010 (r216068) @@ -3119,27 +3119,18 @@ init_scp(sc_softc_t *sc, int vty, scr_st scp->ypixel = scp->ysize*info.vi_cheight; } - scp->font_size = info.vi_cheight; - scp->font_width = info.vi_cwidth; - if (info.vi_cheight < 14) { + scp->font_size = info.vi_cheight; + scp->font_width = info.vi_cwidth; #ifndef SC_NO_FONT_LOADING - scp->font = sc->font_8; -#else - scp->font = NULL; -#endif - } else if (info.vi_cheight >= 16) { -#ifndef SC_NO_FONT_LOADING - scp->font = sc->font_16; -#else - scp->font = NULL; -#endif - } else { -#ifndef SC_NO_FONT_LOADING - scp->font = sc->font_14; + if (info.vi_cheight < 14) + scp->font = sc->font_8; + else if (info.vi_cheight >= 16) + scp->font = sc->font_16; + else + scp->font = sc->font_14; #else - scp->font = NULL; + scp->font = NULL; #endif - } sc_vtb_init(&scp->vtb, VTB_MEMORY, 0, 0, NULL, FALSE); #ifndef __sparc64__ From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 01:27:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 012C8106566B; Tue, 30 Nov 2010 01:27:55 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E33C68FC17; Tue, 30 Nov 2010 01:27:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAU1RsFi011356; Tue, 30 Nov 2010 01:27:54 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAU1RsaB011354; Tue, 30 Nov 2010 01:27:54 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201011300127.oAU1RsaB011354@svn.freebsd.org> From: Juli Mallett Date: Tue, 30 Nov 2010 01:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216069 - head/sys/mips/cavium X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 01:27:55 -0000 Author: jmallett Date: Tue Nov 30 01:27:54 2010 New Revision: 216069 URL: http://svn.freebsd.org/changeset/base/216069 Log: Display some Octeon 2 features and a feature for distinguishing between PCIe implementations. Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Mon Nov 29 22:20:44 2010 (r216068) +++ head/sys/mips/cavium/octeon_machdep.c Tue Nov 30 01:27:54 2010 (r216069) @@ -97,7 +97,9 @@ static const struct octeon_feature_descr { OCTEON_FEATURE_SAAD, "SAAD" }, { OCTEON_FEATURE_ZIP, "ZIP" }, { OCTEON_FEATURE_CRYPTO, "CRYPTO" }, + { OCTEON_FEATURE_DORM_CRYPTO, "DORM_CRYPTO" }, { OCTEON_FEATURE_PCIE, "PCIE" }, + { OCTEON_FEATURE_SRIO, "SRIO" }, { OCTEON_FEATURE_KEY_MEMORY, "KEY_MEMORY" }, { OCTEON_FEATURE_LED_CONTROLLER, "LED_CONTROLLER" }, { OCTEON_FEATURE_TRA, "TRA" }, @@ -107,6 +109,7 @@ static const struct octeon_feature_descr { OCTEON_FEATURE_NO_WPTR, "NO_WPTR" }, { OCTEON_FEATURE_DFA, "DFA" }, { OCTEON_FEATURE_MDIO_CLAUSE_45, "MDIO_CLAUSE_45" }, + { OCTEON_FEATURE_NPEI, "NPEI" }, { 0, NULL } }; From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 05:54:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ACE7106566B; Tue, 30 Nov 2010 05:54:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A71A8FC0A; Tue, 30 Nov 2010 05:54:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAU5sMai037777; Tue, 30 Nov 2010 05:54:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAU5sM80037774; Tue, 30 Nov 2010 05:54:22 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201011300554.oAU5sM80037774@svn.freebsd.org> From: Warner Losh Date: Tue, 30 Nov 2010 05:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216070 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 05:54:22 -0000 Author: imp Date: Tue Nov 30 05:54:21 2010 New Revision: 216070 URL: http://svn.freebsd.org/changeset/base/216070 Log: Remove redundant (and bogus) insertion of pnp info when announcing new and retiring devices. That's already inserted elsewhere. Submitted by: n_hibma MFC after: 3 days Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Nov 30 01:27:54 2010 (r216069) +++ head/sys/kern/subr_bus.c Tue Nov 30 05:54:21 2010 (r216070) @@ -708,25 +708,7 @@ bad: static void devadded(device_t dev) { - char *pnp = NULL; - char *tmp = NULL; - - pnp = malloc(1024, M_BUS, M_NOWAIT); - if (pnp == NULL) - goto fail; - tmp = malloc(1024, M_BUS, M_NOWAIT); - if (tmp == NULL) - goto fail; - *pnp = '\0'; - bus_child_pnpinfo_str(dev, pnp, 1024); - snprintf(tmp, 1024, "%s %s", device_get_nameunit(dev), pnp); - devaddq("+", tmp, dev); -fail: - if (pnp != NULL) - free(pnp, M_BUS); - if (tmp != NULL) - free(tmp, M_BUS); - return; + devaddq("+", device_get_nameunit(dev), dev); } /* @@ -736,24 +718,7 @@ fail: static void devremoved(device_t dev) { - char *pnp = NULL; - char *tmp = NULL; - - pnp = malloc(1024, M_BUS, M_NOWAIT); - if (pnp == NULL) - goto fail; - tmp = malloc(1024, M_BUS, M_NOWAIT); - if (tmp == NULL) - goto fail; - *pnp = '\0'; - bus_child_pnpinfo_str(dev, pnp, 1024); - snprintf(tmp, 1024, "%s %s", device_get_nameunit(dev), pnp); - devaddq("-", tmp, dev); -fail: - if (pnp != NULL) - free(pnp, M_BUS); - if (tmp != NULL) - free(tmp, M_BUS); + devaddq("+", device_get_nameunit(dev), dev); return; } From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 07:14:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1E02106566B; Tue, 30 Nov 2010 07:14:05 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B03B68FC19; Tue, 30 Nov 2010 07:14:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAU7E5Pb049036; Tue, 30 Nov 2010 07:14:05 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAU7E58o049028; Tue, 30 Nov 2010 07:14:05 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201011300714.oAU7E58o049028@svn.freebsd.org> From: Juli Mallett Date: Tue, 30 Nov 2010 07:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216071 - head/sys/mips/cavium/octe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 07:14:05 -0000 Author: jmallett Date: Tue Nov 30 07:14:05 2010 New Revision: 216071 URL: http://svn.freebsd.org/changeset/base/216071 Log: Run all poll requests through a single function that can either do the generic link state polling or media-specific ones, while avoidiing changing link state on interfaces that use miibus; this substantially speeds up link time on interface (re)initialization. Modified: head/sys/mips/cavium/octe/ethernet-common.c head/sys/mips/cavium/octe/ethernet-common.h head/sys/mips/cavium/octe/ethernet-rgmii.c head/sys/mips/cavium/octe/ethernet-sgmii.c head/sys/mips/cavium/octe/ethernet-xaui.c head/sys/mips/cavium/octe/ethernet.c head/sys/mips/cavium/octe/octe.c Modified: head/sys/mips/cavium/octe/ethernet-common.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-common.c Tue Nov 30 05:54:21 2010 (r216070) +++ head/sys/mips/cavium/octe/ethernet-common.c Tue Nov 30 07:14:05 2010 (r216071) @@ -188,7 +188,10 @@ int cvm_oct_common_open(struct ifnet *if gmx_cfg.s.en = 1; cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64); - if (!octeon_is_simulation()) { + /* + * Set the link state unless we are using MII. + */ + if (!octeon_is_simulation() && priv->miibus == NULL) { link_info = cvmx_helper_link_get(priv->port); if (!link_info.s.link_up) if_link_state_change(ifp, LINK_STATE_DOWN); @@ -224,6 +227,30 @@ void cvm_oct_common_poll(struct ifnet *i cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; cvmx_helper_link_info_t link_info; + /* + * If this is a simulation, do nothing. + */ + if (octeon_is_simulation()) + return; + + /* + * If there is a device-specific poll method, use it. + */ + if (priv->poll != NULL) { + priv->poll(ifp); + return; + } + + /* + * If an MII bus is attached, don't use the Simple Executive's link + * state routines. + */ + if (priv->miibus != NULL) + return; + + /* + * Use the Simple Executive's link state routines. + */ link_info = cvmx_helper_link_get(priv->port); if (link_info.u64 == priv->link_info) return; Modified: head/sys/mips/cavium/octe/ethernet-common.h ============================================================================== --- head/sys/mips/cavium/octe/ethernet-common.h Tue Nov 30 05:54:21 2010 (r216070) +++ head/sys/mips/cavium/octe/ethernet-common.h Tue Nov 30 07:14:05 2010 (r216071) @@ -48,8 +48,6 @@ void cvm_oct_cleanup_module(void); int cvm_oct_rgmii_init(struct ifnet *ifp); void cvm_oct_rgmii_uninit(struct ifnet *ifp); int cvm_oct_sgmii_init(struct ifnet *ifp); -void cvm_oct_sgmii_uninit(struct ifnet *ifp); int cvm_oct_spi_init(struct ifnet *ifp); void cvm_oct_spi_uninit(struct ifnet *ifp); int cvm_oct_xaui_init(struct ifnet *ifp); -void cvm_oct_xaui_uninit(struct ifnet *ifp); Modified: head/sys/mips/cavium/octe/ethernet-rgmii.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-rgmii.c Tue Nov 30 05:54:21 2010 (r216070) +++ head/sys/mips/cavium/octe/ethernet-rgmii.c Tue Nov 30 07:14:05 2010 (r216071) @@ -134,9 +134,11 @@ static void cvm_oct_rgmii_poll(struct if cvmx_write_csr(CVMX_GMXX_RXX_INT_REG(index, interface), gmxx_rxx_int_reg.u64); } - link_info = cvmx_helper_link_autoconf(priv->port); - priv->link_info = link_info.u64; - priv->need_link_update = 1; + if (priv->miibus == NULL) { + link_info = cvmx_helper_link_autoconf(priv->port); + priv->link_info = link_info.u64; + priv->need_link_update = 1; + } mtx_unlock_spin(&global_register_lock); } @@ -206,42 +208,6 @@ static int cvm_oct_rgmii_rml_interrupt(v } -static int cvm_oct_rgmii_open(struct ifnet *ifp) -{ - cvmx_gmxx_prtx_cfg_t gmx_cfg; - cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - int interface = INTERFACE(priv->port); - int index = INDEX(priv->port); - cvmx_helper_link_info_t link_info; - - gmx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); - gmx_cfg.s.en = 1; - cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64); - - if (!octeon_is_simulation()) { - link_info = cvmx_helper_link_get(priv->port); - if (!link_info.s.link_up) - if_link_state_change(ifp, LINK_STATE_DOWN); - else - if_link_state_change(ifp, LINK_STATE_UP); - } - - return 0; -} - -static int cvm_oct_rgmii_stop(struct ifnet *ifp) -{ - cvmx_gmxx_prtx_cfg_t gmx_cfg; - cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - int interface = INTERFACE(priv->port); - int index = INDEX(priv->port); - - gmx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); - gmx_cfg.s.en = 0; - cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64); - return 0; -} - int cvm_oct_rgmii_init(struct ifnet *ifp) { struct octebus_softc *sc; @@ -250,8 +216,8 @@ int cvm_oct_rgmii_init(struct ifnet *ifp int rid; cvm_oct_common_init(ifp); - priv->open = cvm_oct_rgmii_open; - priv->stop = cvm_oct_rgmii_stop; + priv->open = cvm_oct_common_open; + priv->stop = cvm_oct_common_stop; priv->stop(ifp); /* Due to GMX errata in CN3XXX series chips, it is necessary to take the Modified: head/sys/mips/cavium/octe/ethernet-sgmii.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-sgmii.c Tue Nov 30 05:54:21 2010 (r216070) +++ head/sys/mips/cavium/octe/ethernet-sgmii.c Tue Nov 30 07:14:05 2010 (r216071) @@ -53,8 +53,6 @@ int cvm_oct_sgmii_init(struct ifnet *ifp priv->open = cvm_oct_common_open; priv->stop = cvm_oct_common_stop; priv->stop(ifp); - if (!octeon_is_simulation()) - priv->poll = cvm_oct_common_poll; /* FIXME: Need autoneg logic */ return 0; Modified: head/sys/mips/cavium/octe/ethernet-xaui.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-xaui.c Tue Nov 30 05:54:21 2010 (r216070) +++ head/sys/mips/cavium/octe/ethernet-xaui.c Tue Nov 30 07:14:05 2010 (r216071) @@ -53,8 +53,6 @@ int cvm_oct_xaui_init(struct ifnet *ifp) priv->open = cvm_oct_common_open; priv->stop = cvm_oct_common_stop; priv->stop(ifp); - if (!octeon_is_simulation()) - priv->poll = cvm_oct_common_poll; - return 0; + return 0; } Modified: head/sys/mips/cavium/octe/ethernet.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet.c Tue Nov 30 05:54:21 2010 (r216070) +++ head/sys/mips/cavium/octe/ethernet.c Tue Nov 30 07:14:05 2010 (r216071) @@ -136,18 +136,11 @@ static void cvm_do_timer(void *arg) int queues_per_port; int qos; cvm_oct_private_t *priv = (cvm_oct_private_t *)cvm_oct_device[port]->if_softc; - if (priv->poll) - { - /* skip polling if we don't get the lock */ - if (MDIO_TRYLOCK()) { - priv->poll(cvm_oct_device[port]); - MDIO_UNLOCK(); - - if (priv->need_link_update) { - updated++; - taskqueue_enqueue(cvm_oct_link_taskq, &priv->link_task); - } - } + + cvm_oct_common_poll(priv->ifp); + if (priv->need_link_update) { + updated++; + taskqueue_enqueue(cvm_oct_link_taskq, &priv->link_task); } queues_per_port = cvmx_pko_get_num_queues(port); Modified: head/sys/mips/cavium/octe/octe.c ============================================================================== --- head/sys/mips/cavium/octe/octe.c Tue Nov 30 05:54:21 2010 (r216070) +++ head/sys/mips/cavium/octe/octe.c Tue Nov 30 07:14:05 2010 (r216071) @@ -281,8 +281,8 @@ octe_init(void *arg) cvm_oct_common_set_mac_address(ifp, IF_LLADDR(ifp)); - if (priv->poll != NULL) - priv->poll(ifp); + cvm_oct_common_poll(ifp); + if (priv->miibus != NULL) mii_mediachg(device_get_softc(priv->miibus)); From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 08:25:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 000EF1065674; Tue, 30 Nov 2010 08:25:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7A108FC1A; Tue, 30 Nov 2010 08:25:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAU8Pvdn058758; Tue, 30 Nov 2010 08:25:57 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAU8Pv1O058756; Tue, 30 Nov 2010 08:25:57 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201011300825.oAU8Pv1O058756@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 30 Nov 2010 08:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216072 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 08:25:58 -0000 Author: hselasky Date: Tue Nov 30 08:25:57 2010 New Revision: 216072 URL: http://svn.freebsd.org/changeset/base/216072 Log: We need to define a cdev variable associated with each USB device, hence existing applications like webcamd are expecting that. This problem was introduced by SVN change 214221 where cdev= was replaced by ugen= by accident. Solve this problem by redefining cdev= in devd notifications. MFC after 3 days. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Tue Nov 30 07:14:05 2010 (r216071) +++ head/sys/dev/usb/usb_device.c Tue Nov 30 08:25:57 2010 (r216072) @@ -2475,6 +2475,7 @@ usb_notify_addq(const char *type, struct sbuf_printf(sb, #if USB_HAVE_UGEN "ugen=%s " + "cdev=%s " #endif "vendor=0x%04x " "product=0x%04x " @@ -2490,6 +2491,7 @@ usb_notify_addq(const char *type, struct "", #if USB_HAVE_UGEN udev->ugen_name, + udev->ugen_name, #endif UGETW(udev->ddesc.idVendor), UGETW(udev->ddesc.idProduct), @@ -2521,6 +2523,7 @@ usb_notify_addq(const char *type, struct sbuf_printf(sb, #if USB_HAVE_UGEN "ugen=%s " + "cdev=%s " #endif "vendor=0x%04x " "product=0x%04x " @@ -2536,6 +2539,7 @@ usb_notify_addq(const char *type, struct "intprotocol=0x%02x", #if USB_HAVE_UGEN udev->ugen_name, + udev->ugen_name, #endif UGETW(udev->ddesc.idVendor), UGETW(udev->ddesc.idProduct), From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 09:34:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3912C1065693; Tue, 30 Nov 2010 09:34:48 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27A868FC08; Tue, 30 Nov 2010 09:34:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAU9YmLV067503; Tue, 30 Nov 2010 09:34:48 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAU9Ymis067501; Tue, 30 Nov 2010 09:34:48 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201011300934.oAU9Ymis067501@svn.freebsd.org> From: Nick Hibma Date: Tue, 30 Nov 2010 09:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216074 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 09:34:49 -0000 Author: n_hibma Date: Tue Nov 30 09:34:47 2010 New Revision: 216074 URL: http://svn.freebsd.org/changeset/base/216074 Log: Fix two errors in the man page Submitted by: ruslan MFC after: 1 day Modified: head/share/man/man4/usb_quirk.4 Modified: head/share/man/man4/usb_quirk.4 ============================================================================== --- head/share/man/man4/usb_quirk.4 Tue Nov 30 08:39:05 2010 (r216073) +++ head/share/man/man4/usb_quirk.4 Tue Nov 30 09:34:47 2010 (r216074) @@ -27,7 +27,7 @@ To compile this module into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent -.Cd "device ucom" +.Cd "device usb" .Ed .Pp Alternatively, to load the module at boot @@ -183,7 +183,6 @@ device which appears as a USB device on usbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT .Ed .Sh SEE ALSO -.Xr usb_quirk 4 , .Xr usbconfig 5 .Sh HISTORY The From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 15:57:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04E6D106566B; Tue, 30 Nov 2010 15:57:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD32A8FC17; Tue, 30 Nov 2010 15:57:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAUFv0jx007325; Tue, 30 Nov 2010 15:57:00 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAUFv0TC007320; Tue, 30 Nov 2010 15:57:00 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201011301557.oAUFv0TC007320@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 30 Nov 2010 15:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216075 - in head: sys/netinet usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 15:57:01 -0000 Author: glebius Date: Tue Nov 30 15:57:00 2010 New Revision: 216075 URL: http://svn.freebsd.org/changeset/base/216075 Log: Use time_uptime instead of non-monotonic time_second to drive ARP timeouts. Suggested by: bde Modified: head/sys/netinet/if_ether.c head/sys/netinet/in.c head/usr.sbin/arp/arp.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Tue Nov 30 09:34:47 2010 (r216074) +++ head/sys/netinet/if_ether.c Tue Nov 30 15:57:00 2010 (r216075) @@ -323,7 +323,7 @@ retry: } if ((la->la_flags & LLE_VALID) && - ((la->la_flags & LLE_STATIC) || la->la_expire > time_second)) { + ((la->la_flags & LLE_STATIC) || la->la_expire > time_uptime)) { bcopy(&la->ll_addr, desten, ifp->if_addrlen); /* * If entry has an expiry time and it is approaching, @@ -331,7 +331,7 @@ retry: * arpt_down interval. */ if (!(la->la_flags & LLE_STATIC) && - time_second + la->la_preempt > la->la_expire) { + time_uptime + la->la_preempt > la->la_expire) { arprequest(ifp, NULL, &SIN(dst)->sin_addr, IF_LLADDR(ifp)); @@ -351,7 +351,7 @@ retry: goto done; } - renew = (la->la_asked == 0 || la->la_expire != time_second); + renew = (la->la_asked == 0 || la->la_expire != time_uptime); if ((renew || m != NULL) && (flags & LLE_EXCLUSIVE) == 0) { flags |= LLE_EXCLUSIVE; LLE_RUNLOCK(la); @@ -403,7 +403,7 @@ retry: int canceled; LLE_ADDREF(la); - la->la_expire = time_second; + la->la_expire = time_uptime; canceled = callout_reset(&la->la_timer, hz * V_arpt_down, arptimer, la); if (canceled) @@ -713,7 +713,7 @@ match: int canceled; LLE_ADDREF(la); - la->la_expire = time_second + V_arpt_keep; + la->la_expire = time_uptime + V_arpt_keep; canceled = callout_reset(&la->la_timer, hz * V_arpt_keep, arptimer, la); if (canceled) Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue Nov 30 09:34:47 2010 (r216074) +++ head/sys/netinet/in.c Tue Nov 30 15:57:00 2010 (r216075) @@ -1333,7 +1333,7 @@ in_lltable_new(const struct sockaddr *l3 * For IPv4 this will trigger "arpresolve" to generate * an ARP request. */ - lle->base.la_expire = time_second; /* mark expired */ + lle->base.la_expire = time_uptime; /* mark expired */ lle->l3_addr4 = *(const struct sockaddr_in *)l3addr; lle->base.lle_refcnt = 1; LLE_LOCK_INIT(&lle->base); Modified: head/usr.sbin/arp/arp.c ============================================================================== --- head/usr.sbin/arp/arp.c Tue Nov 30 09:34:47 2010 (r216074) +++ head/usr.sbin/arp/arp.c Tue Nov 30 15:57:00 2010 (r216075) @@ -602,10 +602,10 @@ print_entry(struct sockaddr_dl *sdl, if (rtm->rtm_rmx.rmx_expire == 0) printf(" permanent"); else { - static struct timeval tv; - if (tv.tv_sec == 0) - gettimeofday(&tv, 0); - if ((expire_time = rtm->rtm_rmx.rmx_expire - tv.tv_sec) > 0) + static struct timespec tp; + if (tp.tv_sec == 0) + clock_gettime(CLOCK_MONOTONIC, &tp); + if ((expire_time = rtm->rtm_rmx.rmx_expire - tp.tv_sec) > 0) printf(" expires in %d seconds", (int)expire_time); else printf(" expired"); From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 16:00:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 944311065693; Tue, 30 Nov 2010 16:00:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82DF88FC1D; Tue, 30 Nov 2010 16:00:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAUG0xd2008235; Tue, 30 Nov 2010 16:00:59 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAUG0xlv008233; Tue, 30 Nov 2010 16:00:59 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201011301600.oAUG0xlv008233@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 30 Nov 2010 16:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216076 - head/usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 16:00:59 -0000 Author: glebius Date: Tue Nov 30 16:00:59 2010 New Revision: 216076 URL: http://svn.freebsd.org/changeset/base/216076 Log: That should belong to r216075. Pointy hat on me. Modified: head/usr.sbin/arp/arp.c Modified: head/usr.sbin/arp/arp.c ============================================================================== --- head/usr.sbin/arp/arp.c Tue Nov 30 15:57:00 2010 (r216075) +++ head/usr.sbin/arp/arp.c Tue Nov 30 16:00:59 2010 (r216076) @@ -319,9 +319,9 @@ set(int argc, char **argv) doing_proxy = flags = proxy_only = expire_time = 0; while (argc-- > 0) { if (strncmp(argv[0], "temp", 4) == 0) { - struct timeval tv; - gettimeofday(&tv, 0); - expire_time = tv.tv_sec + 20 * 60; + struct timespec tp; + clock_gettime(CLOCK_MONOTONIC, &tp); + expire_time = tp.tv_sec + 20 * 60; } else if (strncmp(argv[0], "pub", 3) == 0) { flags |= RTF_ANNOUNCE; doing_proxy = 1; From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 16:04:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACF5B1065673; Tue, 30 Nov 2010 16:04:40 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B7B58FC17; Tue, 30 Nov 2010 16:04:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAUG4emd008817; Tue, 30 Nov 2010 16:04:40 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAUG4edL008815; Tue, 30 Nov 2010 16:04:40 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201011301604.oAUG4edL008815@svn.freebsd.org> From: Colin Percival Date: Tue, 30 Nov 2010 16:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216077 - head/usr.sbin/crashinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 16:04:40 -0000 Author: cperciva Date: Tue Nov 30 16:04:40 2010 New Revision: 216077 URL: http://svn.freebsd.org/changeset/base/216077 Log: Teach crashinfo(8) to look at the currently running kernel (based on the kern.bootfile sysctl). Prior to this commit, crashinfo(8) only looks at /boot/*/kernel; this includes the usual places where kernels reside, so for most systems this will have no effect. Approved by: jhb MFC after: 3 days Modified: head/usr.sbin/crashinfo/crashinfo.sh Modified: head/usr.sbin/crashinfo/crashinfo.sh ============================================================================== --- head/usr.sbin/crashinfo/crashinfo.sh Tue Nov 30 16:00:59 2010 (r216076) +++ head/usr.sbin/crashinfo/crashinfo.sh Tue Nov 30 16:04:40 2010 (r216077) @@ -53,7 +53,7 @@ find_kernel() }' $INFO) # Look for a matching kernel version. - for k in /boot/kernel/kernel $(ls -t /boot/*/kernel); do + for k in `sysctl -n kern.bootfile` $(ls -t /boot/*/kernel); do kvers=$(echo 'printf " Version String: %s", version' | \ gdb -x /dev/stdin -batch $k 2>/dev/null) if [ "$ivers" = "$kvers" ]; then From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 16:14:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73998106566C; Tue, 30 Nov 2010 16:14:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6262C8FC08; Tue, 30 Nov 2010 16:14:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAUGEJPK010032; Tue, 30 Nov 2010 16:14:19 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAUGEJ69010030; Tue, 30 Nov 2010 16:14:19 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201011301614.oAUGEJ69010030@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 30 Nov 2010 16:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216078 - head/usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 16:14:19 -0000 Author: glebius Date: Tue Nov 30 16:14:19 2010 New Revision: 216078 URL: http://svn.freebsd.org/changeset/base/216078 Log: Do not hardcode (20*60), but use current ARP timeout value configured in kernel. Modified: head/usr.sbin/arp/arp.c Modified: head/usr.sbin/arp/arp.c ============================================================================== --- head/usr.sbin/arp/arp.c Tue Nov 30 16:04:40 2010 (r216077) +++ head/usr.sbin/arp/arp.c Tue Nov 30 16:14:19 2010 (r216078) @@ -320,8 +320,14 @@ set(int argc, char **argv) while (argc-- > 0) { if (strncmp(argv[0], "temp", 4) == 0) { struct timespec tp; + int max_age; + size_t len = sizeof(max_age); + clock_gettime(CLOCK_MONOTONIC, &tp); - expire_time = tp.tv_sec + 20 * 60; + if (sysctlbyname("net.link.ether.inet.max_age", + &max_age, &len, NULL, 0) != 0) + err(1, "sysctlbyname"); + expire_time = tp.tv_sec + max_age; } else if (strncmp(argv[0], "pub", 3) == 0) { flags |= RTF_ANNOUNCE; doing_proxy = 1; From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 16:46:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA8FD1065675; Tue, 30 Nov 2010 16:46:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F5418FC0C; Tue, 30 Nov 2010 16:46:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAUGkFIL014105; Tue, 30 Nov 2010 16:46:15 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAUGkFLk014103; Tue, 30 Nov 2010 16:46:15 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011301646.oAUGkFLk014103@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 30 Nov 2010 16:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216079 - head/sys/dev/syscons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 16:46:15 -0000 Author: jkim Date: Tue Nov 30 16:46:15 2010 New Revision: 216079 URL: http://svn.freebsd.org/changeset/base/216079 Log: Clean up code a bit to make it more readable. Modified: head/sys/dev/syscons/scvidctl.c Modified: head/sys/dev/syscons/scvidctl.c ============================================================================== --- head/sys/dev/syscons/scvidctl.c Tue Nov 30 16:14:19 2010 (r216078) +++ head/sys/dev/syscons/scvidctl.c Tue Nov 30 16:46:15 2010 (r216079) @@ -150,34 +150,33 @@ sc_set_text_mode(scr_stat *scp, struct t fontwidth = info.vi_cwidth; if (fontsize <= 0) fontsize = info.vi_cheight; - if (fontsize < 14) { + if (fontsize < 14) fontsize = 8; -#ifndef SC_NO_FONT_LOADING - if (!(scp->sc->fonts_loaded & FONT_8)) - return EINVAL; - font = scp->sc->font_8; -#else - font = NULL; -#endif - } else if (fontsize >= 16) { + else if (fontsize >= 16) fontsize = 16; -#ifndef SC_NO_FONT_LOADING - if (!(scp->sc->fonts_loaded & FONT_16)) - return EINVAL; - font = scp->sc->font_16; -#else - font = NULL; -#endif - } else { + else fontsize = 14; #ifndef SC_NO_FONT_LOADING - if (!(scp->sc->fonts_loaded & FONT_14)) - return EINVAL; + switch (fontsize) { + case 8: + if ((scp->sc->fonts_loaded & FONT_8) == 0) + return (EINVAL); + font = scp->sc->font_8; + break; + case 14: + if ((scp->sc->fonts_loaded & FONT_14) == 0) + return (EINVAL); font = scp->sc->font_14; + break; + case 16: + if ((scp->sc->fonts_loaded & FONT_16) == 0) + return (EINVAL); + font = scp->sc->font_16; + break; + } #else - font = NULL; + font = NULL; #endif - } if ((xsize <= 0) || (xsize > info.vi_width)) xsize = info.vi_width; if ((ysize <= 0) || (ysize > info.vi_height)) @@ -333,34 +332,33 @@ sc_set_pixel_mode(scr_stat *scp, struct /* adjust argument values */ if (fontsize <= 0) fontsize = info.vi_cheight; - if (fontsize < 14) { + if (fontsize < 14) fontsize = 8; -#ifndef SC_NO_FONT_LOADING - if (!(scp->sc->fonts_loaded & FONT_8)) - return EINVAL; - font = scp->sc->font_8; -#else - font = NULL; -#endif - } else if (fontsize >= 16) { + else if (fontsize >= 16) fontsize = 16; -#ifndef SC_NO_FONT_LOADING - if (!(scp->sc->fonts_loaded & FONT_16)) - return EINVAL; - font = scp->sc->font_16; -#else - font = NULL; -#endif - } else { + else fontsize = 14; #ifndef SC_NO_FONT_LOADING - if (!(scp->sc->fonts_loaded & FONT_14)) - return EINVAL; + switch (fontsize) { + case 8: + if ((scp->sc->fonts_loaded & FONT_8) == 0) + return (EINVAL); + font = scp->sc->font_8; + break; + case 14: + if ((scp->sc->fonts_loaded & FONT_14) == 0) + return (EINVAL); font = scp->sc->font_14; + break; + case 16: + if ((scp->sc->fonts_loaded & FONT_16) == 0) + return (EINVAL); + font = scp->sc->font_16; + break; + } #else - font = NULL; + font = NULL; #endif - } if (xsize <= 0) xsize = info.vi_width/8; if (ysize <= 0) From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 16:49:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44AEC10656A3; Tue, 30 Nov 2010 16:49:07 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33DE88FC08; Tue, 30 Nov 2010 16:49:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAUGn7k6014452; Tue, 30 Nov 2010 16:49:07 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAUGn7uX014450; Tue, 30 Nov 2010 16:49:07 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201011301649.oAUGn7uX014450@svn.freebsd.org> From: Max Khon Date: Tue, 30 Nov 2010 16:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216080 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 16:49:07 -0000 Author: fjoe Date: Tue Nov 30 16:49:06 2010 New Revision: 216080 URL: http://svn.freebsd.org/changeset/base/216080 Log: Change VM_KMEM_SIZE_MAX to be just (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) Suggested by: marius Modified: head/sys/sparc64/include/vmparam.h Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Tue Nov 30 16:46:15 2010 (r216079) +++ head/sys/sparc64/include/vmparam.h Tue Nov 30 16:49:06 2010 (r216080) @@ -240,8 +240,7 @@ * Ceiling on amount of kmem_map kva space. */ #ifndef VM_KMEM_SIZE_MAX -#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ - VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) +#define VM_KMEM_SIZE_MAX (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) #endif /* From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 16:51:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52C751065673; Tue, 30 Nov 2010 16:51:26 +0000 (UTC) (envelope-from fjoe@samodelkin.net) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id DAF2E8FC1F; Tue, 30 Nov 2010 16:51:25 +0000 (UTC) Received: by qyk8 with SMTP id 8so1381288qyk.13 for ; Tue, 30 Nov 2010 08:51:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.184.143 with SMTP id ck15mr6343285qcb.181.1291135884510; Tue, 30 Nov 2010 08:51:24 -0800 (PST) Received: by 10.229.246.133 with HTTP; Tue, 30 Nov 2010 08:51:24 -0800 (PST) X-Originating-IP: [109.174.58.22] In-Reply-To: <20101129192417.GA18893@alchemy.franken.de> References: <201011281926.oASJQKiE040689@svn.freebsd.org> <20101128194542.GF9966@alchemy.franken.de> <20101129192308.GX80343@alchemy.franken.de> <20101129192417.GA18893@alchemy.franken.de> Date: Tue, 30 Nov 2010 22:51:24 +0600 Message-ID: From: Max Khon To: Marius Strobl Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, alc@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216016 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 16:51:26 -0000 Marius, On Tue, Nov 30, 2010 at 1:24 AM, Marius Strobl wrote: > > > On Sun, Nov 28, 2010 at 07:26:20PM +0000, Max Khon wrote: > > > > > Author: fjoe > > > > > Date: Sun Nov 28 19:26:20 2010 > > > > > New Revision: 216016 > > > > > URL: http://svn.freebsd.org/changeset/base/216016 > > > > > > > > > > Log: > > > > > Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with > > > > > DEBUG_MEMGUARD panics early in kmeminit() with the message > > > > > "kmem_suballoc: bad status return of 1" because of zero "size" > argument > > > > > passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. > > > > > > > > > > The problem also exists on ia64. > > > > > > > > > > Modified: > > > > > head/sys/sparc64/include/vmparam.h > > > > > > > > > > Modified: head/sys/sparc64/include/vmparam.h > > > > > > > > > > ============================================================================== > > > > > --- head/sys/sparc64/include/vmparam.h Sun Nov 28 18:59:52 > 2010 > > > > (r216015) > > > > > +++ head/sys/sparc64/include/vmparam.h Sun Nov 28 19:26:20 > 2010 > > > > (r216016) > > > > > @@ -237,6 +237,14 @@ > > > > > #endif > > > > > > > > > > /* > > > > > + * Ceiling on amount of kmem_map kva space. > > > > > + */ > > > > > +#ifndef VM_KMEM_SIZE_MAX > > > > > +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ > > > > > + VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) > > > > > +#endif > > > > > + > > > > > +/* > > > > > * Initial pagein size of beginning of executable file. > > > > > */ > > > > > #ifndef VM_INITIAL_PAGEIN > > > > > > > > How was that value determined? > > > > > > > > > > I've just copied it from amd64 to be non-zero for now. Do you have a > better > > > idea of what it should look like? > > > > Well, on sparc64 VM_MAX_KERNEL_ADDRESS already is dynamically adjusted > > to the maximum appropriate for the specific CPU during the early cycles > > of the kernel so I'd think one could just use VM_MAX_KERNEL_ADDRESS - > > VM_MIN_KERNEL_ADDRESS for VM_KMEM_SIZE_MAX there, I'm not sure what > > the intention of the ceiling provided by that macro actually is though > Ok, this sounds reasonable. I changed it to be just (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) > In any case, the commit message of r180210 which changed the amd64 > > version to the current one talks about limiting the kmem map to 3.6GB > > and while it also fails to explain where that value comes from it > > looks rather amd64 specific and the formula used by the macro will > > result in a different ceiling on sparc64 and thus inappropriate. I've > > CC'ed alc@ who hopefully can shed some light on this. > > Apart from this the actual bug here seems to be that memguard_fudge() > > can't deal with a km_max being zero or that zero is passed to it as > > kmeminit() allows for VM_KMEM_SIZE_MAX not being defined. > I thought about fixing memguard_fudge() too, but defining VM_KMEM_SIZE_MAX seemed to be less intrusive change to me. Max From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 17:32:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9567F106566B; Tue, 30 Nov 2010 17:32:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 849528FC18; Tue, 30 Nov 2010 17:32:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAUHWShA019135; Tue, 30 Nov 2010 17:32:28 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAUHWSGL019133; Tue, 30 Nov 2010 17:32:28 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011301732.oAUHWSGL019133@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 30 Nov 2010 17:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216081 - head/sys/dev/syscons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 17:32:28 -0000 Author: jkim Date: Tue Nov 30 17:32:28 2010 New Revision: 216081 URL: http://svn.freebsd.org/changeset/base/216081 Log: Stop hardcoding default font size. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Tue Nov 30 16:49:06 2010 (r216080) +++ head/sys/dev/syscons/syscons.c Tue Nov 30 17:32:28 2010 (r216081) @@ -382,7 +382,7 @@ sc_set_vesa_mode(scr_stat *scp, sc_softc #if !defined(SC_NO_FONT_LOADING) && defined(SC_DFLT_FONT) font_size = info.vi_cheight; #else - font_size = 16; + font_size = scp->font_size; #endif if (font_size < 14) font_size = 8; From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 17:34:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D861010656A4; Tue, 30 Nov 2010 17:34:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7BAB8FC3B; Tue, 30 Nov 2010 17:34:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAUHYFEv019295; Tue, 30 Nov 2010 17:34:15 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAUHYF74019293; Tue, 30 Nov 2010 17:34:15 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201011301734.oAUHYF74019293@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 30 Nov 2010 17:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216082 - head/sys/dev/syscons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 17:34:16 -0000 Author: jkim Date: Tue Nov 30 17:34:15 2010 New Revision: 216082 URL: http://svn.freebsd.org/changeset/base/216082 Log: Rename a variable to match scvidctl.c. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Tue Nov 30 17:32:28 2010 (r216081) +++ head/sys/dev/syscons/syscons.c Tue Nov 30 17:34:15 2010 (r216082) @@ -350,7 +350,7 @@ sc_set_vesa_mode(scr_stat *scp, sc_softc video_info_t info; u_char *font; int depth; - int font_size; + int fontsize; int i; int vmode; @@ -380,18 +380,18 @@ sc_set_vesa_mode(scr_stat *scp, sc_softc } #if !defined(SC_NO_FONT_LOADING) && defined(SC_DFLT_FONT) - font_size = info.vi_cheight; + fontsize = info.vi_cheight; #else - font_size = scp->font_size; + fontsize = scp->font_size; #endif - if (font_size < 14) - font_size = 8; - else if (font_size >= 16) - font_size = 16; + if (fontsize < 14) + fontsize = 8; + else if (fontsize >= 16) + fontsize = 16; else - font_size = 14; + fontsize = 14; #ifndef SC_NO_FONT_LOADING - switch (font_size) { + switch (fontsize) { case 8: if ((sc->fonts_loaded & FONT_8) == 0) return; @@ -428,12 +428,12 @@ sc_set_vesa_mode(scr_stat *scp, sc_softc scp->xpixel = info.vi_width; scp->ypixel = info.vi_height; scp->xsize = scp->xpixel / 8; - scp->ysize = scp->ypixel / font_size; + scp->ysize = scp->ypixel / fontsize; scp->xpos = 0; scp->ypos = scp->ysize - 1; scp->xoff = scp->yoff = 0; scp->font = font; - scp->font_size = font_size; + scp->font_size = fontsize; scp->font_width = 8; scp->start = scp->xsize * scp->ysize - 1; scp->end = 0; From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 20:54:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38267106564A; Tue, 30 Nov 2010 20:54:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26A378FC1D; Tue, 30 Nov 2010 20:54:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAUKsFfX033585; Tue, 30 Nov 2010 20:54:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAUKsFZh033583; Tue, 30 Nov 2010 20:54:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011302054.oAUKsFZh033583@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Nov 2010 20:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216083 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 20:54:15 -0000 Author: marius Date: Tue Nov 30 20:54:14 2010 New Revision: 216083 URL: http://svn.freebsd.org/changeset/base/216083 Log: Several chipset drivers alter parameters relevant for the DMA tag creation, i.e. alignment, max_address, max_iosize and segsize (only max_address is thought to have an negative impact regarding this issue though), after calling ata_dmainit() either directly or indirectly so these values have no effect or at least no effect on the DMA tags and the defaults are used for the latter instead. So change the drivers to set these parameters up-front and ata_dmainit() to honor them. This file was missed in r216013. Submitted by: nwhitehorn Modified: head/sys/powerpc/powermac/ata_dbdma.c Modified: head/sys/powerpc/powermac/ata_dbdma.c ============================================================================== --- head/sys/powerpc/powermac/ata_dbdma.c Tue Nov 30 17:34:15 2010 (r216082) +++ head/sys/powerpc/powermac/ata_dbdma.c Tue Nov 30 20:54:14 2010 (r216083) @@ -268,7 +268,6 @@ ata_dbdma_dmainit(device_t dev) dbdma_insert_stop(sc->dbdma,0); sc->next_dma_slot=1; - ata_dmainit(dev); sc->sc_ch.dma.start = ata_dbdma_start; sc->sc_ch.dma.stop = ata_dbdma_stop; sc->sc_ch.dma.load = ata_dbdma_load; @@ -279,9 +278,9 @@ ata_dbdma_dmainit(device_t dev) * if we try to do a 64K transfer, so stop short of 64K. */ sc->sc_ch.dma.segsize = 126 * DEV_BSIZE; + ata_dmainit(dev); sc->sc_ch.hw.status = ata_dbdma_status; mtx_init(&sc->dbdma_mtx, "ATA DBDMA", NULL, MTX_DEF); } - From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 21:04:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9C5A106564A; Tue, 30 Nov 2010 21:04:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97E088FC0C; Tue, 30 Nov 2010 21:04:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAUL45lK034095; Tue, 30 Nov 2010 21:04:05 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAUL45KN034093; Tue, 30 Nov 2010 21:04:05 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201011302104.oAUL45KN034093@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 30 Nov 2010 21:04:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216084 - head/sys/cddl/compat/opensolaris/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 21:04:05 -0000 Author: trasz Date: Tue Nov 30 21:04:05 2010 New Revision: 216084 URL: http://svn.freebsd.org/changeset/base/216084 Log: Don't panic when we read an empty ACL from ZFS. Apparently this may happen with filesystems created under MacOS X ZFS port. This is kind of filesystem corruption (we don't allow for setting empty ACLs), so make acl_get_file(3) and related syscalls fail with EINVAL in that case. In theory, we could return empty ACL to userland, but I'm afraid this would break some code. MFC after: 3 days Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c Tue Nov 30 20:54:14 2010 (r216083) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c Tue Nov 30 21:04:05 2010 (r216084) @@ -105,7 +105,10 @@ acl_from_aces(struct acl *aclp, const ac struct acl_entry *entry; const ace_t *ace; - KASSERT(nentries >= 1, ("empty ZFS ACL")); + if (nentries < 1) { + printf("acl_from_aces: empty ZFS ACL; returning EINVAL.\n"); + return (EINVAL); + } if (nentries > ACL_MAX_ENTRIES) { /* From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 21:09:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E307106564A; Tue, 30 Nov 2010 21:09:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C5E48FC16; Tue, 30 Nov 2010 21:09:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAUL90p0034356; Tue, 30 Nov 2010 21:09:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAUL907B034354; Tue, 30 Nov 2010 21:09:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011302109.oAUL907B034354@svn.freebsd.org> From: Marius Strobl Date: Tue, 30 Nov 2010 21:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216085 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 21:09:00 -0000 Author: marius Date: Tue Nov 30 21:08:59 2010 New Revision: 216085 URL: http://svn.freebsd.org/changeset/base/216085 Log: - Remove the remaining support for older (in this case pre-7.0-RELEASE) versions of FreeBSD. In fact we are already missing a lot of conditional code necessary to support older versions of FreeBSD, including alternatives for vital functionality not yet provided by the respective subsystem back then (see for example r199663). So this change shouldn't actually break this driver on versions of FreeBSD that were supported before. Besides, this driver also isn't maintained as an multi-release version outside of the main repository, so removing the conditional code shouldn't be a problem in that regard either. - Sprinkle some more const on tables. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Nov 30 21:04:05 2010 (r216084) +++ head/sys/dev/bge/if_bge.c Tue Nov 30 21:08:59 2010 (r216085) @@ -139,7 +139,7 @@ MODULE_DEPEND(bge, miibus, 1, 1, 1); static const struct bge_type { uint16_t bge_vid; uint16_t bge_did; -} bge_devs[] = { +} const bge_devs[] = { { ALTEON_VENDORID, ALTEON_DEVICEID_BCM5700 }, { ALTEON_VENDORID, ALTEON_DEVICEID_BCM5701 }, @@ -232,7 +232,7 @@ static const struct bge_type { static const struct bge_vendor { uint16_t v_id; const char *v_name; -} bge_vendors[] = { +} const bge_vendors[] = { { ALTEON_VENDORID, "Alteon" }, { ALTIMA_VENDORID, "Altima" }, { APPLE_VENDORID, "Apple" }, @@ -247,7 +247,7 @@ static const struct bge_vendor { static const struct bge_revision { uint32_t br_chipid; const char *br_name; -} bge_revisions[] = { +} const bge_revisions[] = { { BGE_CHIPID_BCM5700_A0, "BCM5700 A0" }, { BGE_CHIPID_BCM5700_A1, "BCM5700 A1" }, { BGE_CHIPID_BCM5700_B0, "BCM5700 B0" }, @@ -317,7 +317,7 @@ static const struct bge_revision { * Some defaults for major revisions, so that newer steppings * that we don't know about have a shot at working. */ -static const struct bge_revision bge_majorrevs[] = { +static const struct bge_revision const bge_majorrevs[] = { { BGE_ASICREV_BCM5700, "unknown BCM5700" }, { BGE_ASICREV_BCM5701, "unknown BCM5701" }, { BGE_ASICREV_BCM5703, "unknown BCM5703" }, @@ -2143,20 +2143,21 @@ bge_lookup_vendor(uint16_t vid) static int bge_probe(device_t dev) { - const struct bge_type *t = bge_devs; + char buf[96]; + char model[64]; + const struct bge_revision *br; + const char *pname; struct bge_softc *sc = device_get_softc(dev); - uint16_t vid, did; + const struct bge_type *t = bge_devs; + const struct bge_vendor *v; + uint32_t id; + uint16_t did, vid; sc->bge_dev = dev; vid = pci_get_vendor(dev); did = pci_get_device(dev); while(t->bge_vid != 0) { if ((vid == t->bge_vid) && (did == t->bge_did)) { - char model[64], buf[96]; - const struct bge_revision *br; - const struct bge_vendor *v; - uint32_t id; - id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> BGE_PCIMISCCTL_ASICREV_SHIFT; if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) { @@ -2177,20 +2178,13 @@ bge_probe(device_t dev) } br = bge_lookup_rev(id); v = bge_lookup_vendor(vid); - { -#if __FreeBSD_version > 700024 - const char *pname; - - if (bge_has_eaddr(sc) && - pci_get_vpd_ident(dev, &pname) == 0) - snprintf(model, 64, "%s", pname); - else -#endif - snprintf(model, 64, "%s %s", - v->v_name, - br != NULL ? br->br_name : - "NetXtreme Ethernet Controller"); - } + if (bge_has_eaddr(sc) && + pci_get_vpd_ident(dev, &pname) == 0) + snprintf(model, 64, "%s", pname); + else + snprintf(model, 64, "%s %s", v->v_name, + br != NULL ? br->br_name : + "NetXtreme Ethernet Controller"); snprintf(buf, 96, "%s, %sASIC rev. %#08x", model, br != NULL ? "" : "unknown ", id); device_set_desc_copy(dev, buf); @@ -3167,7 +3161,6 @@ again: /* * Hookup IRQ last. */ -#if __FreeBSD_version > 700030 if (BGE_IS_5755_PLUS(sc) && sc->bge_flags & BGE_FLAG_MSI) { /* Take advantage of single-shot MSI. */ CSR_WRITE_4(sc, BGE_MSI_MODE, CSR_READ_4(sc, BGE_MSI_MODE) & @@ -3191,10 +3184,6 @@ again: error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, NULL, bge_intr, sc, &sc->bge_intrhand); -#else - error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, - bge_intr, sc, &sc->bge_intrhand); -#endif if (error) { bge_detach(dev); @@ -3643,14 +3632,8 @@ bge_rxeof(struct bge_softc *sc, uint16_t * attach that information to the packet. */ if (have_tag) { -#if __FreeBSD_version > 700022 m->m_pkthdr.ether_vtag = vlan_tag; m->m_flags |= M_VLANTAG; -#else - VLAN_INPUT_TAG_NEW(ifp, m, vlan_tag); - if (m == NULL) - continue; -#endif } if (holdlck != 0) { @@ -4456,21 +4439,10 @@ bge_encap(struct bge_softc *sc, struct m bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag, map, BUS_DMASYNC_PREWRITE); -#if __FreeBSD_version > 700022 if (m->m_flags & M_VLANTAG) { csum_flags |= BGE_TXBDFLAG_VLAN_TAG; vlan_tag = m->m_pkthdr.ether_vtag; } -#else - { - struct m_tag *mtag; - - if ((mtag = VLAN_OUTPUT_TAG(sc->bge_ifp, m)) != NULL) { - csum_flags |= BGE_TXBDFLAG_VLAN_TAG; - vlan_tag = VLAN_TAG_VALUE(mtag); - } - } -#endif for (i = 0; ; i++) { d = &sc->bge_ldata.bge_tx_ring[idx]; d->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[i].ds_addr); From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 21:26:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5A301065674; Tue, 30 Nov 2010 21:26:21 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B43CE8FC13; Tue, 30 Nov 2010 21:26:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAULQLR9035124; Tue, 30 Nov 2010 21:26:21 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAULQL2d035122; Tue, 30 Nov 2010 21:26:21 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201011302126.oAULQL2d035122@svn.freebsd.org> From: David Schultz Date: Tue, 30 Nov 2010 21:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216086 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 21:26:21 -0000 Author: das Date: Tue Nov 30 21:26:21 2010 New Revision: 216086 URL: http://svn.freebsd.org/changeset/base/216086 Log: Update the documentation to reflect changes to the implementation in r197752, which is related to handling of null buffer pointers. Also make a few minor wording changes. Reported by: jh@ Modified: head/lib/libc/stdio/getline.3 Modified: head/lib/libc/stdio/getline.3 ============================================================================== --- head/lib/libc/stdio/getline.3 Tue Nov 30 21:08:59 2010 (r216085) +++ head/lib/libc/stdio/getline.3 Tue Nov 30 21:26:21 2010 (r216086) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2009 +.Dd November 30, 2010 .Dt GETLINE 3 .Os .Sh NAME @@ -54,23 +54,23 @@ function is equivalent to with the newline character as the delimiter. The delimiter character is included as part of the line, unless the end of the file is reached. -The caller may provide a pointer to a malloc buffer for the line in +.Pp +The caller may provide a pointer to a malloced buffer for the line in .Fa *linep , and the capacity of that buffer in -.Fa *linecapp ; -if -.Fa *linecapp -is 0, then -.Fa *linep -is treated as -.Dv NULL . -These functions may expand the buffer as needed, as if via -.Fn realloc , -and update +.Fa *linecapp . +These functions expand the buffer as needed, as if via +.Fn realloc . +If +.Fa linep +points to a +.Dv NULL +pointer, a new buffer will be allocated. +In either case, .Fa *linep and .Fa *linecapp -accordingly. +will be updated accordingly. .Sh RETURN VALUES The .Fn getdelim @@ -140,7 +140,7 @@ No delimiter was found in the first characters. .El .Pp -These functions may also fail for any of the errors specified for +These functions may also fail due to any of the errors specified for .Fn fgets and .Fn malloc . From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 22:27:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22C7D1065693; Tue, 30 Nov 2010 22:27:55 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id B01CB8FC0C; Tue, 30 Nov 2010 22:27:54 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id ADB021DD79C; Tue, 30 Nov 2010 23:27:53 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id 95169170CB; Tue, 30 Nov 2010 23:27:53 +0100 (CET) Date: Tue, 30 Nov 2010 23:27:53 +0100 From: Jilles Tjoelker To: Gleb Smirnoff Message-ID: <20101130222753.GA93292@stack.nl> References: <201011301557.oAUFv0TC007320@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201011301557.oAUFv0TC007320@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 Subject: Re: svn commit: r216075 - in head: sys/netinet usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 22:27:55 -0000 On Tue, Nov 30, 2010 at 03:57:00PM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Nov 30 15:57:00 2010 > New Revision: 216075 > URL: http://svn.freebsd.org/changeset/base/216075 > Log: > Use time_uptime instead of non-monotonic time_second to drive ARP > timeouts. > Suggested by: bde > Modified: > head/sys/netinet/if_ether.c > head/sys/netinet/in.c > head/usr.sbin/arp/arp.c > Modified: head/usr.sbin/arp/arp.c > ============================================================================== > --- head/usr.sbin/arp/arp.c Tue Nov 30 09:34:47 2010 (r216074) > +++ head/usr.sbin/arp/arp.c Tue Nov 30 15:57:00 2010 (r216075) > @@ -602,10 +602,10 @@ print_entry(struct sockaddr_dl *sdl, > if (rtm->rtm_rmx.rmx_expire == 0) > printf(" permanent"); > else { > - static struct timeval tv; > - if (tv.tv_sec == 0) > - gettimeofday(&tv, 0); > - if ((expire_time = rtm->rtm_rmx.rmx_expire - tv.tv_sec) > 0) > + static struct timespec tp; > + if (tp.tv_sec == 0) > + clock_gettime(CLOCK_MONOTONIC, &tp); > + if ((expire_time = rtm->rtm_rmx.rmx_expire - tp.tv_sec) > 0) > printf(" expires in %d seconds", (int)expire_time); > else > printf(" expired"); Hmm, doesn't this break the API between arp(8) and the kernel? Assuming we care, perhaps arp(8) should send/receive realtime, converted at the time it requests the data. The kernel can then continue to use monotonic time internally (which I agree is better). -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Tue Nov 30 22:39:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96EA5106566B; Tue, 30 Nov 2010 22:39:46 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8273C8FC16; Tue, 30 Nov 2010 22:39:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAUMdkBU041565; Tue, 30 Nov 2010 22:39:46 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAUMdkRW041560; Tue, 30 Nov 2010 22:39:46 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201011302239.oAUMdkRW041560@svn.freebsd.org> From: "Kenneth D. Merry" Date: Tue, 30 Nov 2010 22:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216088 - in head: lib/libcam sbin/camcontrol sys/cam sys/cam/scsi sys/conf sys/dev/mps sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2010 22:39:46 -0000 Author: ken Date: Tue Nov 30 22:39:46 2010 New Revision: 216088 URL: http://svn.freebsd.org/changeset/base/216088 Log: Add Serial Management Protocol (SMP) passthrough support to CAM. This includes support in the kernel, camcontrol(8), libcam and the mps(4) driver for SMP passthrough. The CAM SCSI probe code has been modified to fetch Inquiry VPD page 0x00 to determine supported pages, and will now fetch page 0x83 in addition to page 0x80 if supported. Add two new CAM CCBs, XPT_SMP_IO, and XPT_GDEV_ADVINFO. The SMP CCB is intended for SMP requests and responses. The ADVINFO is currently used to fetch cached VPD page 0x83 data from the transport layer, but is intended to be extensible to fetch other types of device-specific data. SMP-only devices are not currently represented in the CAM topology, and so the current semantics are that the SIM will route SMP CCBs to either the addressed device, if it contains an SMP target, or its parent, if it contains an SMP target. (This is noted in cam_ccb.h, since it will change later once we have the ability to have SMP-only devices in CAM's topology.) smp_all.c, smp_all.h: New helper routines for SMP. This includes SMP request building routines, response parsing routines, error decoding routines, and structure definitions for a number of SMP commands. libcam/Makefile: Add smp_all.c to libcam, so that SMP functionality is available to userland applications. camcontrol.8, camcontrol.c: Add smp passthrough support to camcontrol. Several new subcommands are now available: 'smpcmd' functions much like 'cmd', except that it allows the user to send generic SMP commands. 'smprg' sends the SMP report general command, and displays the decoded output. It will automatically fetch extended output if it is available. 'smppc' sends the SMP phy control command, with any number of potential options. Among other things, this allows the user to reset a phy on a SAS expander, or disable a phy on an expander. 'smpmaninfo' sends the SMP report manufacturer information and displays the decoded output. 'smpphylist' displays a list of phys on an expander, and the CAM devices attached to those phys, if any. cam.h, cam.c: Add a status value for SMP errors (CAM_SMP_STATUS_ERROR). Add a missing description for CAM_SCSI_IT_NEXUS_LOST. Add support for SMP commands to cam_error_string(). cam_ccb.h: Rename the CAM_DIR_RESV flag to CAM_DIR_BOTH. SMP commands are by nature bi-directional, and we may need to support bi-directional SCSI commands later. Add the XPT_SMP_IO CCB. Since SMP commands are bi-directional, there are pointers for both the request and response. Add a fill routine for SMP CCBs. Add the XPT_GDEV_ADVINFO CCB. This is currently used to fetch cached page 0x83 data from the transport later, but is extensible to fetch many other types of data. cam_periph.c: Add support in cam_periph_mapmem() for XPT_SMP_IO and XPT_GDEV_ADVINFO CCBs. cam_xpt.c: Add support for executing XPT_SMP_IO CCBs. cam_xpt_internal.h: Add fields for VPD pages 0x00 and 0x83 in struct cam_ed. scsi_all.c: Add scsi_get_sas_addr(), a function that parses VPD page 0x83 data and pulls out a SAS address. scsi_all.h: Add VPD page 0x00 and 0x83 structures, and a prototype for scsi_get_sas_addr(). scsi_pass.c: Add support for mapping buffers in XPT_SMP_IO and XPT_GDEV_ADVINFO CCBs. scsi_xpt.c: In the SCSI probe code, first ask the device for VPD page 0x00. If any VPD pages are supported, that page is required to be implemented. Based on the response, we may probe for the serial number (page 0x80) or device id (page 0x83). Add support for the XPT_GDEV_ADVINFO CCB. sys/conf/files: Add smp_all.c. mps.c: Add support for passing in a uio in mps_map_command(), so we can map a S/G list at once. Add support for SMP passthrough commands in mps_data_cb(). SMP is a special case, because the first buffer in the S/G list is outbound and the second buffer is inbound. Add support for warning the user if the busdma code comes back with more buffers than will work for the command. This will, for example, help the user determine why an SMP command failed if busdma comes back with three buffers. mps_pci.c: Add sys/uio.h. mps_sas.c: Add the SAS address and the parent handle to the list of fields we pull from device page 0 and cache in struct mpssas_target. These are needed for SMP passthrough. Add support for the XPT_SMP_IO CCB. For now, this CCB is routed to the addressed device if it supports SMP, or to its parent if it does not and the parent does. This is necessary because CAM does not currently support SMP-only nodes in the topology. Make SMP passthrough support conditional on __FreeBSD_version >= 900026. This will make it easier to MFC this change to the driver without MFCing the CAM changes as well. mps_user.c: Un-staticize mpi_init_sge() so we can use it for the SMP passthrough code. mpsvar.h: Add a uio and iovecs into struct mps_command for SMP passthrough commands. Add a cm_max_segs field to struct mps_command so that we can warn the user if busdma comes back with too many segments. Clear the cm_reply when a command gets freed. If it is not cleared, reply frames will eventually get freed into the pool multiple times and corrupt the pool. (This fix is from scottl.) Add a prototype for mpi_init_sge(). sys/param.h: Bump __FreeBSD_version to 900026 for the for the inclusion of the XPT_GDEV_ADVINFO and XPT_SMP_IO CAM CCBs. Added: head/sys/cam/scsi/smp_all.c (contents, props changed) head/sys/cam/scsi/smp_all.h (contents, props changed) Modified: head/lib/libcam/Makefile head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c head/sys/cam/cam.c head/sys/cam/cam.h head/sys/cam/cam_ccb.h head/sys/cam/cam_periph.c head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt_internal.h head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_pass.c head/sys/cam/scsi/scsi_xpt.c head/sys/conf/files head/sys/dev/mps/mps.c head/sys/dev/mps/mps_pci.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_user.c head/sys/dev/mps/mpsvar.h head/sys/sys/param.h Modified: head/lib/libcam/Makefile ============================================================================== --- head/lib/libcam/Makefile Tue Nov 30 22:25:44 2010 (r216087) +++ head/lib/libcam/Makefile Tue Nov 30 22:39:46 2010 (r216088) @@ -3,7 +3,7 @@ LIB= cam SHLIBDIR?= /lib SRCS= camlib.c scsi_cmdparse.c scsi_all.c scsi_da.c scsi_sa.c cam.c \ - ata_all.c + ata_all.c smp_all.c INCS= camlib.h DPADD= ${LIBSBUF} Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Tue Nov 30 22:25:44 2010 (r216087) +++ head/sbin/camcontrol/camcontrol.8 Tue Nov 30 22:39:46 2010 (r216088) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2010 +.Dd November 30, 2010 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -131,6 +131,43 @@ .Op Fl r Ar fmt .Ek .Nm +.Ic smpcmd +.Op device id +.Op generic args +.Aq Fl r Ar len Ar fmt Op args +.Aq Fl R Ar len Ar fmt Op args +.Nm +.Ic smprg +.Op device id +.Op generic args +.Op Fl l +.Nm +.Ic smppc +.Op device id +.Op generic args +.Aq Fl p Ar phy +.Op Fl l +.Op Fl o Ar operation +.Op Fl d Ar name +.Op Fl m Ar rate +.Op Fl M Ar rate +.Op Fl T Ar pp_timeout +.Op Fl a Ar enable|disable +.Op Fl A Ar enable|disable +.Op Fl s Ar enable|disable +.Op Fl S Ar enable|disable +.Nm +.Ic smpphylist +.Op device id +.Op generic args +.Op Fl l +.Op Fl q +.Nm +.Ic smpmaninfo +.Op device id +.Op generic args +.Op Fl l +.Nm .Ic debug .Op Fl I .Op Fl P @@ -554,6 +591,177 @@ If the format is .Sq - , 11 result registers will be written to standard output in hex. .El +.It Ic smpcmd +Allows the user to send an arbitrary Serial +Management Protocol (SMP) command to a device. +The +.Ic smpcmd +function requires the +.Fl r +argument to specify the SMP request to be sent, and the +.Fl R +argument to specify the format of the SMP response. +The syntax for the SMP request and response arguments is documented in +.Xr cam_cdbparse 3 . +.Pp +Note that SAS adapters that support SMP passthrough (at least the currently +known adapters) do not accept CRC bytes from the user in the request and do +not pass CRC bytes back to the user in the response. +Therefore users should not include the CRC bytes in the length of the +request and not expect CRC bytes to be returned in the response. +.Bl -tag -width 17n +.It Fl r Ar len Ar fmt Op args +This specifies the size of the SMP request, without the CRC bytes, and the +SMP request format. If the format is +.Sq - , +.Ar len +bytes of data will be read from standard input and written as the SMP +request. +.It Fl R Ar len Ar fmt Op args +This specifies the size of the buffer allocated for the SMP response, and +the SMP response format. +If the format is +.Sq - , +.Ar len +bytes of data will be allocated for the response and the response will be +written to standard output. +.El +.It Ic smprg +Allows the user to send the Serial Management Protocol (SMP) Report General +command to a device. +.Nm +will display the data returned by the Report General command. +If the SMP target supports the long response format, the additional data +will be requested and displayed automatically. +.Bl -tag -width 8n +.It Fl l +Request the long response format only. +Not all SMP targets support the long response format. +This option causes +.Nm +to skip sending the initial report general request without the long bit set +and only issue a report general request with the long bit set. +.El +.It Ic smppc +Allows the user to issue the Serial Management Protocol (SMP) PHY Control +command to a device. +This function should be used with some caution, as it can render devices +inaccessible, and could potentially cause data corruption as well. +The +.Fl p +argument is required to specify the PHY to operate on. +.Bl -tag -width 17n +.It Fl p Ar phy +Specify the PHY to operate on. +This argument is required. +.It Fl l +Request the long request/response format. +Not all SMP targets support the long response format. +For the PHY Control command, this currently only affects whether the +request length is set to a value other than 0. +.It Fl o Ar operation +Specify a PHY control operation. +Only one +.Fl o +operation may be specified. +The operation may be specified numerically (in decimal, hexadecimal, or octal) +or one of the following operation names may be specified: +.Bl -tag -width 16n +.It nop +No operation. +It is not necessary to specify this argument. +.It linkreset +Send the LINK RESET command to the phy. +.It hardreset +Send the HARD RESET command to the phy. +.It disable +Send the DISABLE command to the phy. +Note that the LINK RESET or HARD RESET commands should re-enable the phy. +.It clearerrorlog +Send the CLEAR ERROR LOG command. +This clears the error log counters for the specified phy. +.It clearaffiliation +Send the CLEAR AFFILIATION command. +This clears the affiliation from the STP initiator port with the same SAS +address as the SMP initiator that requests the clear operation. +.It sataportsel +Send the TRANSMIT SATA PORT SELECTION SIGNAL command to the phy. +This will cause a SATA port selector to use the given phy as its active phy +and make the other phy inactive. +.It clearitnl +Send the CLEAR STP I_T NEXUS LOSS command to the PHY. +.It setdevname +Send the SET ATTACHED DEVICE NAME command to the PHY. +This requires the +.Fl d +argument to specify the device name. +.El +.It Fl d Ar name +Specify the attached device name. +This option is needed with the +.Fl o Ar setdevname +phy operation. +The name is a 64-bit number, and can be specified in decimal, hexadecimal +or octal format. +.It Fl m Ar rate +Set the minimum physical link rate for the phy. +This is a numeric argument. +Currently known link rates are: +.Bl -tag -width 5n +.It 0x0 +Do not change current value. +.It 0x8 +1.5 Gbps +.It 0x9 +3 Gbps +.It 0xa +6 Gbps +.El +.Pp +Other values may be specified for newer physical link rates. +.It Fl M Ar rate +Set the maximum physical link rate for the phy. +This is a numeric argument. +See the +.Fl m +argument description for known link rate arguments. +.It Fl T Ar pp_timeout +Set the partial pathway timeout value, in microseconds. +See the +.Tn ANSI +.Tn SAS +Protcol Layer (SPL) +specification for more information on this field. +.It Fl a Ar enable|disable +Enable or disable SATA slumber phy power conditions. +.It Fl A Ar enable|disable +Enable or disable SATA partial power conditions. +.It Fl s Ar enable|disable +Enable or disable SAS slumber phy power conditions. +.It Fl S Ar enable|disable +Enable or disable SAS partial phy power conditions. +.El +.It Ic smpphylist +List phys attached to a SAS expander, the address of the end device +attached to the phy, and the inquiry data for that device and peripheral +devices attached to that device. +The inquiry data and peripheral devices are displayed if available. +.Bl -tag -width 5n +.It Fl l +Turn on the long response format for the underlying SMP commands used for +this command. +.It Fl q +Only print out phys that are attached to a device in the CAM EDT (Existing +Device Table). +.El +.It Ic smpmaninfo +Send the SMP Report Manufacturer Information command to the device and +display the response. +.Bl -tag -width 5n +.It Fl l +Turn on the long response format for the underlying SMP commands used for +this command. +.El .It Ic debug Turn on CAM debugging printfs in the kernel. This requires options CAMDEBUG @@ -965,6 +1173,14 @@ camcontrol negotiate -n da -u 3 -R 20.00 Negotiate a sync rate of 20MHz and an offset of 15 with da3. Then send a Test Unit Ready command to make the settings take effect. +.Pp +.Bd -literal -offset indent +camcontrol smpcmd ses0 -v -r 4 "40 0 00 0" -R 1020 "s9 i1" +.Ed +.Pp +Send the SMP REPORT GENERAL command to ses0, and display the number of PHYs +it contains. +Display SMP errors if the command fails. .Sh SEE ALSO .Xr cam 3 , .Xr cam_cdbparse 3 , Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Tue Nov 30 22:25:44 2010 (r216087) +++ head/sbin/camcontrol/camcontrol.c Tue Nov 30 22:39:46 2010 (r216088) @@ -33,11 +33,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include +#include #include #include #include @@ -50,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include "camcontrol.h" @@ -77,7 +81,12 @@ typedef enum { CAM_CMD_IDENTIFY = 0x00000013, CAM_CMD_IDLE = 0x00000014, CAM_CMD_STANDBY = 0x00000015, - CAM_CMD_SLEEP = 0x00000016 + CAM_CMD_SLEEP = 0x00000016, + CAM_CMD_SMP_CMD = 0x00000017, + CAM_CMD_SMP_RG = 0x00000018, + CAM_CMD_SMP_PC = 0x00000019, + CAM_CMD_SMP_PHYLIST = 0x0000001a, + CAM_CMD_SMP_MANINFO = 0x0000001b } cam_cmdmask; typedef enum { @@ -117,7 +126,7 @@ typedef enum { struct camcontrol_opts { const char *optname; - cam_cmdmask cmdnum; + uint32_t cmdnum; cam_argmask argnum; const char *subopt; }; @@ -126,6 +135,9 @@ struct camcontrol_opts { static const char scsicmd_opts[] = "a:c:dfi:o:r"; static const char readdefect_opts[] = "f:GP"; static const char negotiate_opts[] = "acD:M:O:qR:T:UW:"; +static const char smprg_opts[] = "l"; +static const char smppc_opts[] = "a:A:d:lm:M:o:p:s:S:T:"; +static const char smpphylist_opts[] = "lq"; #endif struct camcontrol_opts option_table[] = { @@ -145,6 +157,14 @@ struct camcontrol_opts option_table[] = #ifndef MINIMALISTIC {"cmd", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts}, {"command", CAM_CMD_SCSI_CMD, CAM_ARG_NONE, scsicmd_opts}, + {"smpcmd", CAM_CMD_SMP_CMD, CAM_ARG_NONE, "r:R:"}, + {"smprg", CAM_CMD_SMP_RG, CAM_ARG_NONE, smprg_opts}, + {"smpreportgeneral", CAM_CMD_SMP_RG, CAM_ARG_NONE, smprg_opts}, + {"smppc", CAM_CMD_SMP_PC, CAM_ARG_NONE, smppc_opts}, + {"smpphycontrol", CAM_CMD_SMP_PC, CAM_ARG_NONE, smppc_opts}, + {"smpplist", CAM_CMD_SMP_PHYLIST, CAM_ARG_NONE, smpphylist_opts}, + {"smpphylist", CAM_CMD_SMP_PHYLIST, CAM_ARG_NONE, smpphylist_opts}, + {"smpmaninfo", CAM_CMD_SMP_MANINFO, CAM_ARG_NONE, "l"}, {"defects", CAM_CMD_READ_DEFECTS, CAM_ARG_NONE, readdefect_opts}, {"defectlist", CAM_CMD_READ_DEFECTS, CAM_ARG_NONE, readdefect_opts}, #endif /* MINIMALISTIC */ @@ -173,11 +193,25 @@ typedef enum { CC_OR_FOUND } camcontrol_optret; +struct cam_devitem { + struct device_match_result dev_match; + int num_periphs; + struct periph_match_result *periph_matches; + struct scsi_vpd_device_id *device_id; + int device_id_len; + STAILQ_ENTRY(cam_devitem) links; +}; + +struct cam_devlist { + STAILQ_HEAD(, cam_devitem) dev_queue; + path_id_t path_id; +}; + cam_cmdmask cmdlist; cam_argmask arglist; - -camcontrol_optret getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, +camcontrol_optret getoption(struct camcontrol_opts *table, char *arg, + uint32_t *cmdnum, cam_argmask *argnum, const char **subopt); #ifndef MINIMALISTIC static int getdevlist(struct cam_device *device); @@ -206,6 +240,21 @@ static void modepage(struct cam_device * char *combinedopt, int retry_count, int timeout); static int scsicmd(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); +static int smpcmd(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout); +static int smpreportgeneral(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout); +static int smpphycontrol(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout); +static int smpmaninfo(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout); +static int getdevid(struct cam_devitem *item); +static int buildbusdevlist(struct cam_devlist *devlist); +static void freebusdevlist(struct cam_devlist *devlist); +static struct cam_devitem *findsasdevice(struct cam_devlist *devlist, + uint64_t sasaddr); +static int smpphylist(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout); static int tagcontrol(struct cam_device *device, int argc, char **argv, char *combinedopt); static void cts_print(struct cam_device *device, @@ -234,13 +283,13 @@ static int atapm(struct cam_device *devi #endif camcontrol_optret -getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, - const char **subopt) +getoption(struct camcontrol_opts *table, char *arg, uint32_t *cmdnum, + cam_argmask *argnum, const char **subopt) { struct camcontrol_opts *opts; int num_matches = 0; - for (opts = option_table; (opts != NULL) && (opts->optname != NULL); + for (opts = table; (opts != NULL) && (opts->optname != NULL); opts++) { if (strncmp(opts->optname, arg, strlen(arg)) == 0) { *cmdnum = opts->cmdnum; @@ -2455,10 +2504,12 @@ scsicmd(struct cam_device *device, int a if (((retval = cam_send_ccb(device, ccb)) < 0) || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + const char *warnstr = "error sending command"; + if (retval < 0) - warn("error sending command"); + warn(warnstr); else - warnx("error sending command"); + warnx(warnstr); if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, @@ -4274,125 +4325,1336 @@ bailout: } static int -atapm(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) +smpcmd(struct cam_device *device, int argc, char **argv, char *combinedopt, + int retry_count, int timeout) { + int c, error; union ccb *ccb; - int retval = 0; - int t = -1; - int c; - u_char cmd, sc; + uint8_t *smp_request = NULL, *smp_response = NULL; + int request_size = 0, response_size = 0; + int fd_request = 0, fd_response = 0; + char *datastr = NULL; + struct get_hook hook; + int retval; + int flags = 0; + /* + * Note that at the moment we don't support sending SMP CCBs to + * devices that aren't probed by CAM. + */ ccb = cam_getccb(device); - if (ccb == NULL) { - warnx("%s: error allocating ccb", __func__); + warnx("%s: error allocating CCB", __func__); return (1); } + bzero(&(&ccb->ccb_h)[1], + sizeof(union ccb) - sizeof(struct ccb_hdr)); + while ((c = getopt(argc, argv, combinedopt)) != -1) { switch (c) { - case 't': - t = atoi(optarg); + case 'R': + arglist |= CAM_ARG_CMD_IN; + response_size = strtol(optarg, NULL, 0); + if (response_size <= 0) { + warnx("invalid number of response bytes %d", + response_size); + error = 1; + goto smpcmd_bailout; + } + hook.argc = argc - optind; + hook.argv = argv + optind; + hook.got = 0; + optind++; + datastr = cget(&hook, NULL); + /* + * If the user supplied "-" instead of a format, he + * wants the data to be written to stdout. + */ + if ((datastr != NULL) + && (datastr[0] == '-')) + fd_response = 1; + + smp_response = (u_int8_t *)malloc(response_size); + if (smp_response == NULL) { + warn("can't malloc memory for SMP response"); + error = 1; + goto smpcmd_bailout; + } + break; + case 'r': + arglist |= CAM_ARG_CMD_OUT; + request_size = strtol(optarg, NULL, 0); + if (request_size <= 0) { + warnx("invalid number of request bytes %d", + request_size); + error = 1; + goto smpcmd_bailout; + } + hook.argc = argc - optind; + hook.argv = argv + optind; + hook.got = 0; + datastr = cget(&hook, NULL); + smp_request = (u_int8_t *)malloc(request_size); + if (smp_request == NULL) { + warn("can't malloc memory for SMP request"); + error = 1; + goto smpcmd_bailout; + } + bzero(smp_request, request_size); + /* + * If the user supplied "-" instead of a format, he + * wants the data to be read from stdin. + */ + if ((datastr != NULL) + && (datastr[0] == '-')) + fd_request = 1; + else + buff_encode_visit(smp_request, request_size, + datastr, + iget, &hook); + optind += hook.got; break; default: break; } } - if (strcmp(argv[1], "idle") == 0) { - if (t == -1) - cmd = ATA_IDLE_IMMEDIATE; - else - cmd = ATA_IDLE_CMD; - } else if (strcmp(argv[1], "standby") == 0) { - if (t == -1) - cmd = ATA_STANDBY_IMMEDIATE; - else - cmd = ATA_STANDBY_CMD; - } else { - cmd = ATA_SLEEP; - t = -1; + + /* + * If fd_data is set, and we're writing to the device, we need to + * read the data the user wants written from stdin. + */ + if ((fd_request == 1) && (arglist & CAM_ARG_CMD_OUT)) { + ssize_t amt_read; + int amt_to_read = request_size; + u_int8_t *buf_ptr = smp_request; + + for (amt_read = 0; amt_to_read > 0; + amt_read = read(STDIN_FILENO, buf_ptr, amt_to_read)) { + if (amt_read == -1) { + warn("error reading data from stdin"); + error = 1; + goto smpcmd_bailout; + } + amt_to_read -= amt_read; + buf_ptr += amt_read; + } } - if (t < 0) - sc = 0; - else if (t <= (240 * 5)) - sc = (t + 4) / 5; - else if (t <= (252 * 5)) - /* special encoding for 21 minutes */ - sc = 252; - else if (t <= (11 * 30 * 60)) - sc = (t - 1) / (30 * 60) + 241; - else - sc = 253; + if (((arglist & CAM_ARG_CMD_IN) == 0) + || ((arglist & CAM_ARG_CMD_OUT) == 0)) { + warnx("%s: need both the request (-r) and response (-R) " + "arguments", __func__); + error = 1; + goto smpcmd_bailout; + } - cam_fill_ataio(&ccb->ataio, - retry_count, - NULL, - /*flags*/CAM_DIR_NONE, - MSG_SIMPLE_Q_TAG, - /*data_ptr*/NULL, - /*dxfer_len*/0, - timeout ? timeout : 30 * 1000); - ata_28bit_cmd(&ccb->ataio, cmd, 0, 0, sc); + flags |= CAM_DEV_QFRZDIS; - /* Disable freezing the device queue */ - ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + cam_fill_smpio(&ccb->smpio, + /*retries*/ retry_count, + /*cbfcnp*/ NULL, + /*flags*/ flags, + /*smp_request*/ smp_request, + /*smp_request_len*/ request_size, + /*smp_response*/ smp_response, + /*smp_response_len*/ response_size, + /*timeout*/ timeout ? timeout : 5000); - if (arglist & CAM_ARG_ERR_RECOVER) - ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + ccb->smpio.flags = SMP_FLAG_NONE; - if (cam_send_ccb(device, ccb) < 0) { - warn("error sending command"); + if (((retval = cam_send_ccb(device, ccb)) < 0) + || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + const char *warnstr = "error sending command"; - if (arglist & CAM_ARG_VERBOSE) + if (retval < 0) + warn(warnstr); + else + warnx(warnstr); + + if (arglist & CAM_ARG_VERBOSE) { cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); + } + } - retval = 1; + if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) + && (response_size > 0)) { + if (fd_response == 0) { + buff_decode_visit(smp_response, response_size, + datastr, arg_put, NULL); + fprintf(stdout, "\n"); + } else { + ssize_t amt_written; + int amt_to_write = response_size; + u_int8_t *buf_ptr = smp_response; + + for (amt_written = 0; (amt_to_write > 0) && + (amt_written = write(STDOUT_FILENO, buf_ptr, + amt_to_write)) > 0;){ + amt_to_write -= amt_written; + buf_ptr += amt_written; + } + if (amt_written == -1) { + warn("error writing data to stdout"); + error = 1; + goto smpcmd_bailout; + } else if ((amt_written == 0) + && (amt_to_write > 0)) { + warnx("only wrote %u bytes out of %u", + response_size - amt_to_write, + response_size); + } + } + } +smpcmd_bailout: + if (ccb != NULL) + cam_freeccb(ccb); + + if (smp_request != NULL) + free(smp_request); + + if (smp_response != NULL) + free(smp_response); + + return (error); +} + +static int +smpreportgeneral(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout) +{ + union ccb *ccb; + struct smp_report_general_request *request = NULL; + struct smp_report_general_response *response = NULL; + struct sbuf *sb = NULL; + int error = 0; + int c, long_response = 0; + int retval; + + /* + * Note that at the moment we don't support sending SMP CCBs to + * devices that aren't probed by CAM. + */ + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + return (1); + } + + bzero(&(&ccb->ccb_h)[1], + sizeof(union ccb) - sizeof(struct ccb_hdr)); + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch (c) { + case 'l': + long_response = 1; + break; + default: + break; + } + } + request = malloc(sizeof(*request)); + if (request == NULL) { + warn("%s: unable to allocate %zd bytes", __func__, + sizeof(*request)); + error = 1; goto bailout; } - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); - retval = 1; + response = malloc(sizeof(*response)); + if (response == NULL) { + warn("%s: unable to allocate %zd bytes", __func__, + sizeof(*response)); + error = 1; + goto bailout; + } + +try_long: + smp_report_general(&ccb->smpio, + retry_count, + /*cbfcnp*/ NULL, + request, + /*request_len*/ sizeof(*request), + (uint8_t *)response, + /*response_len*/ sizeof(*response), + /*long_response*/ long_response, + timeout); + + if (((retval = cam_send_ccb(device, ccb)) < 0) + || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) { + const char *warnstr = "error sending command"; + + if (retval < 0) + warn(warnstr); + else + warnx(warnstr); + + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + error = 1; + goto bailout; + } + + /* + * If the device supports the long response bit, try again and see + * if we can get all of the data. + */ + if ((response->long_response & SMP_RG_LONG_RESPONSE) + && (long_response == 0)) { + ccb->ccb_h.status = CAM_REQ_INPROG; + bzero(&(&ccb->ccb_h)[1], + sizeof(union ccb) - sizeof(struct ccb_hdr)); + long_response = 1; + goto try_long; + } + + /* + * XXX KDM detect and decode SMP errors here. + */ + sb = sbuf_new_auto(); + if (sb == NULL) { + warnx("%s: error allocating sbuf", __func__); goto bailout; } + + smp_report_general_sbuf(response, sizeof(*response), sb); + + sbuf_finish(sb); + + printf("%s", sbuf_data(sb)); + bailout: - cam_freeccb(ccb); - return (retval); + if (ccb != NULL) + cam_freeccb(ccb); + + if (request != NULL) + free(request); + + if (response != NULL) + free(response); + + if (sb != NULL) + sbuf_delete(sb); + + return (error); } -#endif /* MINIMALISTIC */ +struct camcontrol_opts phy_ops[] = { + {"nop", SMP_PC_PHY_OP_NOP, CAM_ARG_NONE, NULL}, + {"linkreset", SMP_PC_PHY_OP_LINK_RESET, CAM_ARG_NONE, NULL}, + {"hardreset", SMP_PC_PHY_OP_HARD_RESET, CAM_ARG_NONE, NULL}, + {"disable", SMP_PC_PHY_OP_DISABLE, CAM_ARG_NONE, NULL}, + {"clearerrlog", SMP_PC_PHY_OP_CLEAR_ERR_LOG, CAM_ARG_NONE, NULL}, + {"clearaffiliation", SMP_PC_PHY_OP_CLEAR_AFFILIATON, CAM_ARG_NONE,NULL}, + {"sataportsel", SMP_PC_PHY_OP_TRANS_SATA_PSS, CAM_ARG_NONE, NULL}, + {"clearitnl", SMP_PC_PHY_OP_CLEAR_STP_ITN_LS, CAM_ARG_NONE, NULL}, + {"setdevname", SMP_PC_PHY_OP_SET_ATT_DEV_NAME, CAM_ARG_NONE, NULL}, + {NULL, 0, 0, NULL} +}; -void -usage(int verbose) +static int +smpphycontrol(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout) { - fprintf(verbose ? stdout : stderr, -"usage: camcontrol [device id][generic args][command args]\n" -" camcontrol devlist [-v]\n" -#ifndef MINIMALISTIC -" camcontrol periphlist [dev_id][-n dev_name] [-u unit]\n" -" camcontrol tur [dev_id][generic args]\n" -" camcontrol inquiry [dev_id][generic args] [-D] [-S] [-R]\n" -" camcontrol identify [dev_id][generic args] [-v]\n" -" camcontrol reportluns [dev_id][generic args] [-c] [-l] [-r report]\n" -" camcontrol readcap [dev_id][generic args] [-b] [-h] [-H] [-N]\n" -" [-q] [-s]\n" -" camcontrol start [dev_id][generic args]\n" -" camcontrol stop [dev_id][generic args]\n" -" camcontrol load [dev_id][generic args]\n" -" camcontrol eject [dev_id][generic args]\n" -#endif /* MINIMALISTIC */ -" camcontrol rescan \n" -" camcontrol reset \n" -#ifndef MINIMALISTIC -" camcontrol defects [dev_id][generic args] <-f format> [-P][-G]\n" -" camcontrol modepage [dev_id][generic args] <-m page | -l>\n" -" [-P pagectl][-e | -b][-d]\n" -" camcontrol cmd [dev_id][generic args]\n" + union ccb *ccb; + struct smp_phy_control_request *request = NULL; + struct smp_phy_control_response *response = NULL; + int long_response = 0; + int retval = 0; + int phy = -1; + uint32_t phy_operation = SMP_PC_PHY_OP_NOP; + int phy_op_set = 0; + uint64_t attached_dev_name = 0; + int dev_name_set = 0; + uint32_t min_plr = 0, max_plr = 0; + uint32_t pp_timeout_val = 0; + int slumber_partial = 0; + int set_pp_timeout_val = 0; + int c; + + /* + * Note that at the moment we don't support sending SMP CCBs to + * devices that aren't probed by CAM. + */ + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + return (1); + } + + bzero(&(&ccb->ccb_h)[1], + sizeof(union ccb) - sizeof(struct ccb_hdr)); + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch (c) { + case 'a': + case 'A': + case 's': + case 'S': { + int enable = -1; + + if (strcasecmp(optarg, "enable") == 0) + enable = 1; + else if (strcasecmp(optarg, "disable") == 0) + enable = 2; + else { + warnx("%s: Invalid argument %s", __func__, + optarg); + retval = 1; + goto bailout; + } + switch (c) { + case 's': + slumber_partial |= enable << + SMP_PC_SAS_SLUMBER_SHIFT; + break; + case 'S': + slumber_partial |= enable << + SMP_PC_SAS_PARTIAL_SHIFT; + break; + case 'a': + slumber_partial |= enable << + SMP_PC_SATA_SLUMBER_SHIFT; + break; + case 'A': + slumber_partial |= enable << + SMP_PC_SATA_PARTIAL_SHIFT; + break; + default: + warnx("%s: programmer error", __func__); + retval = 1; + goto bailout; + break; /*NOTREACHED*/ + } + break; + } + case 'd': + attached_dev_name = (uintmax_t)strtoumax(optarg, + NULL,0); + dev_name_set = 1; + break; + case 'l': + long_response = 1; + break; + case 'm': + /* + * We don't do extensive checking here, so this + * will continue to work when new speeds come out. + */ + min_plr = strtoul(optarg, NULL, 0); + if ((min_plr == 0) + || (min_plr > 0xf)) { + warnx("%s: invalid link rate %x", + __func__, min_plr); + retval = 1; + goto bailout; + } + break; + case 'M': + /* + * We don't do extensive checking here, so this + * will continue to work when new speeds come out. + */ + max_plr = strtoul(optarg, NULL, 0); + if ((max_plr == 0) + || (max_plr > 0xf)) { + warnx("%s: invalid link rate %x", + __func__, max_plr); + retval = 1; + goto bailout; + } + break; + case 'o': { + camcontrol_optret optreturn; + cam_argmask argnums; + const char *subopt; + + if (phy_op_set != 0) { + warnx("%s: only one phy operation argument " + "(-o) allowed", __func__); + retval = 1; + goto bailout; + } + + phy_op_set = 1; + + /* + * Allow the user to specify the phy operation + * numerically, as well as with a name. This will + * future-proof it a bit, so options that are added + * in future specs can be used. + */ + if (isdigit(optarg[0])) { + phy_operation = strtoul(optarg, NULL, 0); + if ((phy_operation == 0) + || (phy_operation > 0xff)) { + warnx("%s: invalid phy operation %#x", + __func__, phy_operation); + retval = 1; + goto bailout; + } + break; + } + optreturn = getoption(phy_ops, optarg, &phy_operation, + &argnums, &subopt); + + if (optreturn == CC_OR_AMBIGUOUS) { + warnx("%s: ambiguous option %s", __func__, + optarg); + usage(0); + retval = 1; + goto bailout; + } else if (optreturn == CC_OR_NOT_FOUND) { + warnx("%s: option %s not found", __func__, + optarg); + usage(0); + retval = 1; + goto bailout; + } + break; + } + case 'p': + phy = atoi(optarg); + break; + case 'T': + pp_timeout_val = strtoul(optarg, NULL, 0); + if (pp_timeout_val > 15) { + warnx("%s: invalid partial pathway timeout " + "value %u, need a value less than 16", + __func__, pp_timeout_val); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Dec 1 03:24:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FB4B106564A; Wed, 1 Dec 2010 03:24:39 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E3668FC18; Wed, 1 Dec 2010 03:24:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB13OdGP060242; Wed, 1 Dec 2010 03:24:39 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB13OdL8060240; Wed, 1 Dec 2010 03:24:39 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201012010324.oB13OdL8060240@svn.freebsd.org> From: Weongyo Jeong Date: Wed, 1 Dec 2010 03:24:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216089 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 03:24:39 -0000 Author: weongyo Date: Wed Dec 1 03:24:38 2010 New Revision: 216089 URL: http://svn.freebsd.org/changeset/base/216089 Log: Don't print usbus[0-9] interfaces that it's not the interesting interface type for ifconfig(8). Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Tue Nov 30 22:39:46 2010 (r216088) +++ head/sbin/ifconfig/ifconfig.c Wed Dec 1 03:24:38 2010 (r216089) @@ -295,6 +295,8 @@ main(int argc, char *argv[]) sdl = (const struct sockaddr_dl *) ifa->ifa_addr; else sdl = NULL; + if (sdl != NULL && sdl->sdl_type == IFT_USB) + continue; if (cp != NULL && strcmp(cp, ifa->ifa_name) == 0 && !namesonly) continue; iflen = strlcpy(name, ifa->ifa_name, sizeof(name)); From owner-svn-src-head@FreeBSD.ORG Wed Dec 1 03:35:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61773106564A; Wed, 1 Dec 2010 03:35:20 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35CF98FC0A; Wed, 1 Dec 2010 03:35:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB13ZKBE061132; Wed, 1 Dec 2010 03:35:20 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB13ZKPW061130; Wed, 1 Dec 2010 03:35:20 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201012010335.oB13ZKPW061130@svn.freebsd.org> From: Alan Cox Date: Wed, 1 Dec 2010 03:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216090 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 03:35:20 -0000 Author: alc Date: Wed Dec 1 03:35:19 2010 New Revision: 216090 URL: http://svn.freebsd.org/changeset/base/216090 Log: Correct an error in the allocation of the vm_page_dump array in vm_page_startup(). Specifically, the dump_avail array should be used instead of the phys_avail array to calculate the size of vm_page_dump. For example, the pages for the message buffer are allocated prior to vm_page_startup() by subtracting them from the last entry in the phys_avail array, but the first thing that vm_page_startup() does after creating the vm_page_dump array is to set the bits corresponding to the message buffer pages in that array. However, these bits might not actually exist in the array, because the size of the array is determined by the current value in the last entry of the phys_avail array. In general, the only reason why this doesn't always result in an out-of-bounds array access is that the size of the vm_page_dump array is rounded up to the next page boundary. This change eliminates that dependence on rounding (and luck). MFC after: 6 weeks Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Dec 1 03:24:38 2010 (r216089) +++ head/sys/vm/vm_page.c Wed Dec 1 03:35:19 2010 (r216090) @@ -282,7 +282,6 @@ vm_page_startup(vm_offset_t vaddr) vm_paddr_t new_end; int i; vm_paddr_t pa; - int nblocks; vm_paddr_t last_pa; char *list; @@ -294,7 +293,6 @@ vm_page_startup(vm_offset_t vaddr) biggestsize = 0; biggestone = 0; - nblocks = 0; vaddr = round_page(vaddr); for (i = 0; phys_avail[i + 1]; i += 2) { @@ -316,7 +314,6 @@ vm_page_startup(vm_offset_t vaddr) low_water = phys_avail[i]; if (phys_avail[i + 1] > high_water) high_water = phys_avail[i + 1]; - ++nblocks; } #ifdef XEN @@ -372,7 +369,11 @@ vm_page_startup(vm_offset_t vaddr) * minidump code. In theory, they are not needed on i386, but are * included should the sf_buf code decide to use them. */ - page_range = phys_avail[(nblocks - 1) * 2 + 1] / PAGE_SIZE; + last_pa = 0; + for (i = 0; dump_avail[i + 1] != 0; i += 2) + if (dump_avail[i + 1] > last_pa) + last_pa = dump_avail[i + 1]; + page_range = last_pa / PAGE_SIZE; vm_page_dump_size = round_page(roundup2(page_range, NBBY) / NBBY); new_end -= vm_page_dump_size; vm_page_dump = (void *)(uintptr_t)pmap_map(&vaddr, new_end, From owner-svn-src-head@FreeBSD.ORG Wed Dec 1 03:51:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D664106564A; Wed, 1 Dec 2010 03:51:07 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BF668FC0C; Wed, 1 Dec 2010 03:51:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB13p6Dk062511; Wed, 1 Dec 2010 03:51:06 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB13p6du062509; Wed, 1 Dec 2010 03:51:06 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201012010351.oB13p6du062509@svn.freebsd.org> From: Weongyo Jeong Date: Wed, 1 Dec 2010 03:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216091 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 03:51:07 -0000 Author: weongyo Date: Wed Dec 1 03:51:06 2010 New Revision: 216091 URL: http://svn.freebsd.org/changeset/base/216091 Log: Explicitly UP and DOWN the usbus interfaces (IFT_USB) when it's attached or detached. Normally it should be changed through user land ioctl(2) system calls but it looks there's no apps for USB and no need. With this patch, libpcap would detect the usbus interfaces correctly and tcpdump(1) could dump the USB packets into PCAP format with -w option. However it couldn't print the output to console because there's no printer-routine at tcpdump(1). Modified: head/sys/dev/usb/usb_pf.c Modified: head/sys/dev/usb/usb_pf.c ============================================================================== --- head/sys/dev/usb/usb_pf.c Wed Dec 1 03:35:19 2010 (r216090) +++ head/sys/dev/usb/usb_pf.c Wed Dec 1 03:51:06 2010 (r216091) @@ -65,6 +65,7 @@ usbpf_attach(struct usb_bus *ubus) ifp = ubus->ifp = if_alloc(IFT_USB); if_initname(ifp, "usbus", device_get_unit(ubus->bdev)); if_attach(ifp); + if_up(ifp); KASSERT(sizeof(struct usbpf_pkthdr) == USBPF_HDR_LEN, ("wrong USB pf header length (%zd)", sizeof(struct usbpf_pkthdr))); @@ -86,6 +87,7 @@ usbpf_detach(struct usb_bus *ubus) if (ifp != NULL) { bpfdetach(ifp); + if_down(ifp); if_detach(ifp); if_free(ifp); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 1 05:25:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E8DA1065F43; Wed, 1 Dec 2010 05:24:30 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CBBE8FC19; Wed, 1 Dec 2010 05:24:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB15OUwG071154; Wed, 1 Dec 2010 05:24:30 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB15OTYD071153; Wed, 1 Dec 2010 05:24:29 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201012010524.oB15OTYD071153@svn.freebsd.org> From: Juli Mallett Date: Wed, 1 Dec 2010 05:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216092 - head/sys/mips/cavium X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 05:25:20 -0000 Author: jmallett Date: Wed Dec 1 05:24:29 2010 New Revision: 216092 URL: http://svn.freebsd.org/changeset/base/216092 Log: Add interrupt describing and binding to CIU. Modified: head/sys/mips/cavium/ciu.c Modified: head/sys/mips/cavium/ciu.c ============================================================================== --- head/sys/mips/cavium/ciu.c Wed Dec 1 03:51:06 2010 (r216091) +++ head/sys/mips/cavium/ciu.c Wed Dec 1 05:24:29 2010 (r216092) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -80,13 +81,24 @@ static int ciu_setup_intr(device_t, dev void *, void **); static int ciu_teardown_intr(device_t, device_t, struct resource *, void *); +static int ciu_bind_intr(device_t, device_t, struct resource *, + int); +static int ciu_describe_intr(device_t, device_t, + struct resource *, void *, + const char *); static void ciu_hinted_child(device_t, const char *, int); static void ciu_en0_intr_mask(void *); static void ciu_en0_intr_unmask(void *); +#ifdef SMP +static int ciu_en0_intr_bind(void *, u_char); +#endif static void ciu_en1_intr_mask(void *); static void ciu_en1_intr_unmask(void *); +#ifdef SMP +static int ciu_en1_intr_bind(void *, u_char); +#endif static int ciu_intr(void *); @@ -196,6 +208,7 @@ ciu_setup_intr(device_t bus, device_t ch struct intr_event *event, **eventp; void (*mask_func)(void *); void (*unmask_func)(void *); + int (*bind_func)(void *, u_char); mips_intrcnt_t intrcnt; int error; int irq; @@ -206,16 +219,25 @@ ciu_setup_intr(device_t bus, device_t ch intrcnt = ciu_en0_intrcnt[irq - CIU_IRQ_EN0_BEGIN]; mask_func = ciu_en0_intr_mask; unmask_func = ciu_en0_intr_unmask; +#ifdef SMP + bind_func = ciu_en0_intr_bind; +#endif } else { eventp = &ciu_en1_intr_events[irq - CIU_IRQ_EN1_BEGIN]; intrcnt = ciu_en1_intrcnt[irq - CIU_IRQ_EN1_BEGIN]; mask_func = ciu_en1_intr_mask; unmask_func = ciu_en1_intr_unmask; +#ifdef SMP + bind_func = ciu_en1_intr_bind; +#endif } +#if !defined(SMP) + bind_func = NULL; +#endif if ((event = *eventp) == NULL) { error = intr_event_create(eventp, (void *)(uintptr_t)irq, 0, - irq, mask_func, unmask_func, NULL, NULL, "int%d", irq); + irq, mask_func, unmask_func, NULL, bind_func, "int%d", irq); if (error != 0) return (error); @@ -245,6 +267,50 @@ ciu_teardown_intr(device_t bus, device_t return (0); } +#ifdef SMP +static int +ciu_bind_intr(device_t bus, device_t child, struct resource *res, int cpu) +{ + struct intr_event *event; + int irq; + + irq = rman_get_start(res); + if (irq <= CIU_IRQ_EN0_END) + event = ciu_en0_intr_events[irq - CIU_IRQ_EN0_BEGIN]; + else + event = ciu_en1_intr_events[irq - CIU_IRQ_EN1_BEGIN]; + + return (intr_event_bind(event, cpu)); +} +#endif + +static int +ciu_describe_intr(device_t bus, device_t child, struct resource *res, + void *cookie, const char *descr) +{ + struct intr_event *event; + mips_intrcnt_t intrcnt; + int error; + int irq; + + irq = rman_get_start(res); + if (irq <= CIU_IRQ_EN0_END) { + event = ciu_en0_intr_events[irq - CIU_IRQ_EN0_BEGIN]; + intrcnt = ciu_en0_intrcnt[irq - CIU_IRQ_EN0_BEGIN]; + } else { + event = ciu_en1_intr_events[irq - CIU_IRQ_EN1_BEGIN]; + intrcnt = ciu_en1_intrcnt[irq - CIU_IRQ_EN1_BEGIN]; + } + + error = intr_event_describe_handler(event, cookie, descr); + if (error != 0) + return (error); + + mips_intrcnt_setname(intrcnt, event->ie_fullname); + + return (0); +} + static void ciu_hinted_child(device_t bus, const char *dname, int dunit) { @@ -275,6 +341,28 @@ ciu_en0_intr_unmask(void *arg) cvmx_write_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num()*2), mask); } +#ifdef SMP +static int +ciu_en0_intr_bind(void *arg, u_char target) +{ + uint64_t mask; + int core; + int irq; + + irq = (uintptr_t)arg; + CPU_FOREACH(core) { + mask = cvmx_read_csr(CVMX_CIU_INTX_EN0(core*2)); + if (core == target) + mask |= 1ull << (irq - CIU_IRQ_EN0_BEGIN); + else + mask &= ~(1ull << (irq - CIU_IRQ_EN0_BEGIN)); + cvmx_write_csr(CVMX_CIU_INTX_EN0(core*2), mask); + } + + return (0); +} +#endif + static void ciu_en1_intr_mask(void *arg) { @@ -299,6 +387,28 @@ ciu_en1_intr_unmask(void *arg) cvmx_write_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num()*2), mask); } +#ifdef SMP +static int +ciu_en1_intr_bind(void *arg, u_char target) +{ + uint64_t mask; + int core; + int irq; + + irq = (uintptr_t)arg; + CPU_FOREACH(core) { + mask = cvmx_read_csr(CVMX_CIU_INTX_EN1(core*2)); + if (core == target) + mask |= 1ull << (irq - CIU_IRQ_EN1_BEGIN); + else + mask &= ~(1ull << (irq - CIU_IRQ_EN1_BEGIN)); + cvmx_write_csr(CVMX_CIU_INTX_EN1(core*2), mask); + } + + return (0); +} +#endif + static int ciu_intr(void *arg) { @@ -358,6 +468,10 @@ static device_method_t ciu_methods[] = { DEVMETHOD(bus_activate_resource,bus_generic_activate_resource), DEVMETHOD(bus_setup_intr, ciu_setup_intr), DEVMETHOD(bus_teardown_intr, ciu_teardown_intr), +#ifdef SMP + DEVMETHOD(bus_bind_intr, ciu_bind_intr), +#endif + DEVMETHOD(bus_describe_intr, ciu_describe_intr), DEVMETHOD(bus_add_child, bus_generic_add_child), DEVMETHOD(bus_hinted_child, ciu_hinted_child), From owner-svn-src-head@FreeBSD.ORG Wed Dec 1 05:39:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F8571065673; Wed, 1 Dec 2010 05:39:02 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E6548FC13; Wed, 1 Dec 2010 05:39:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB15d2Mh072446; Wed, 1 Dec 2010 05:39:02 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB15d2Vf072444; Wed, 1 Dec 2010 05:39:02 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201012010539.oB15d2Vf072444@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 1 Dec 2010 05:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216093 - head/sys/modules/cam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 05:39:02 -0000 Author: ken Date: Wed Dec 1 05:39:02 2010 New Revision: 216093 URL: http://svn.freebsd.org/changeset/base/216093 Log: Add smp_all.c to the cam module build to un-break it. Reported by: jkim Modified: head/sys/modules/cam/Makefile Modified: head/sys/modules/cam/Makefile ============================================================================== --- head/sys/modules/cam/Makefile Wed Dec 1 05:24:29 2010 (r216092) +++ head/sys/modules/cam/Makefile Wed Dec 1 05:39:02 2010 (r216093) @@ -25,6 +25,7 @@ SRCS+= scsi_ses.c SRCS+= scsi_sg.c SRCS+= scsi_targ_bh.c scsi_target.c SRCS+= scsi_xpt.c +SRCS+= smp_all.c SRCS+= ata_all.c SRCS+= ata_xpt.c SRCS+= ata_da.c From owner-svn-src-head@FreeBSD.ORG Wed Dec 1 05:52:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92E37106564A; Wed, 1 Dec 2010 05:52:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81F5C8FC1A; Wed, 1 Dec 2010 05:52:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB15qRE1073553; Wed, 1 Dec 2010 05:52:27 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB15qRVZ073551; Wed, 1 Dec 2010 05:52:27 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201012010552.oB15qRVZ073551@svn.freebsd.org> From: Alan Cox Date: Wed, 1 Dec 2010 05:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216094 - head/sys/ia64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 05:52:27 -0000 Author: alc Date: Wed Dec 1 05:52:27 2010 New Revision: 216094 URL: http://svn.freebsd.org/changeset/base/216094 Log: phys_avail[] is correctly defined as an array of vm_paddr_t's in machdep.c. Use that same type, and not vm_offset_t, in this include file. Modified: head/sys/ia64/include/pmap.h Modified: head/sys/ia64/include/pmap.h ============================================================================== --- head/sys/ia64/include/pmap.h Wed Dec 1 05:39:02 2010 (r216093) +++ head/sys/ia64/include/pmap.h Wed Dec 1 05:52:27 2010 (r216094) @@ -112,7 +112,7 @@ typedef struct pv_entry { #ifdef _KERNEL -extern vm_offset_t phys_avail[]; +extern vm_paddr_t phys_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; From owner-svn-src-head@FreeBSD.ORG Wed Dec 1 06:19:55 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89864106564A; Wed, 1 Dec 2010 06:19:55 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 42A798FC12; Wed, 1 Dec 2010 06:19:54 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.4/8.14.2) with ESMTP id oB16JswW001731; Wed, 1 Dec 2010 01:19:54 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.4/8.14.2/Submit) id oB16Jslf001730; Wed, 1 Dec 2010 01:19:54 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Wed, 1 Dec 2010 01:19:54 -0500 From: David Schultz To: Bruce Evans Message-ID: <20101201061954.GA1350@zim.MIT.EDU> Mail-Followup-To: Bruce Evans , Alexander Best , Steve Kargl , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ulrich Spoerlein References: <201011131054.oADAsA7I045096@svn.freebsd.org> <20101113125648.GA25183@freebsd.org> <20101113164645.GB69612@troutmask.apl.washington.edu> <20101115005123.GA46134@freebsd.org> <20101115124817.O1683@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101115124817.O1683@besplex.bde.org> Cc: src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Steve Kargl , Ulrich Spoerlein , svn-src-head@FreeBSD.ORG, Alexander Best Subject: Re: svn commit: r215237 - head/lib/msun/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 06:19:55 -0000 On Mon, Nov 15, 2010, Bruce Evans wrote: > On Mon, 15 Nov 2010, Alexander Best wrote: > > >also it seems one of the regression tests in tools/regression/lib/msun > >fails > >(assert tripped): test-lrint. The test is failing due to an actual deficiency in gcc; you need to disable the built-in versions of lrint and friends for it to pass. I considered working around that in the test (as in test-conj.c) and tricking the compiler into using the library versions, but that really just hides the problem. > I get this on amd64, and lots more failures starting with csqrt() on > i386. Yes, some work is needed to deal with i386's special precision issues. As you know, it's often hard to get gcc to even produce the right code on i386, and I didn't spend an inordinate amount of effort trying to get tests for long doubles to pass on that platform. From owner-svn-src-head@FreeBSD.ORG Wed Dec 1 08:07:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CD4A10656A3; Wed, 1 Dec 2010 08:07:32 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B5618FC19; Wed, 1 Dec 2010 08:07:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB187W5r085315; Wed, 1 Dec 2010 08:07:32 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB187WPN085313; Wed, 1 Dec 2010 08:07:32 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012010807.oB187WPN085313@svn.freebsd.org> From: Kevin Lo Date: Wed, 1 Dec 2010 08:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216095 - head/sbin/bsdlabel X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 08:07:32 -0000 Author: kevlo Date: Wed Dec 1 08:07:32 2010 New Revision: 216095 URL: http://svn.freebsd.org/changeset/base/216095 Log: Closing file descriptors when it's done Modified: head/sbin/bsdlabel/bsdlabel.c Modified: head/sbin/bsdlabel/bsdlabel.c ============================================================================== --- head/sbin/bsdlabel/bsdlabel.c Wed Dec 1 05:52:27 2010 (r216094) +++ head/sbin/bsdlabel/bsdlabel.c Wed Dec 1 08:07:32 2010 (r216095) @@ -370,10 +370,12 @@ readboot(void) p[60] = (st.st_size + secsize - 1) / secsize; p[61] = 1; p[62] = 0; + close(fd); return; } else if ((!alphacksum) && st.st_size <= BBSIZE) { if (read(fd, bootarea, st.st_size) != st.st_size) err(1, "read error %s", xxboot); + close(fd); return; } errx(1, "boot code %s is wrong size", xxboot); From owner-svn-src-head@FreeBSD.ORG Wed Dec 1 18:19:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EA201065694; Wed, 1 Dec 2010 18:19:20 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh5.mail.rice.edu (mh5.mail.rice.edu [128.42.199.32]) by mx1.freebsd.org (Postfix) with ESMTP id F0A378FC24; Wed, 1 Dec 2010 18:19:19 +0000 (UTC) Received: from mh5.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh5.mail.rice.edu (Postfix) with ESMTP id 3806D28F768; Wed, 1 Dec 2010 12:19:19 -0600 (CST) X-Virus-Scanned: by amavis-2.6.4 at mh5.mail.rice.edu, auth channel Received: from mh5.mail.rice.edu ([127.0.0.1]) by mh5.mail.rice.edu (mh5.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id XjDwn5xtIUlb; Wed, 1 Dec 2010 12:19:19 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh5.mail.rice.edu (Postfix) with ESMTPSA id 2E13928F778; Wed, 1 Dec 2010 12:19:18 -0600 (CST) Message-ID: <4CF691A5.8070608@rice.edu> Date: Wed, 01 Dec 2010 12:19:17 -0600 From: Alan Cox User-Agent: Thunderbird 2.0.0.24 (X11/20100725) MIME-Version: 1.0 To: Marius Strobl References: <201011281926.oASJQKiE040689@svn.freebsd.org> <20101128194542.GF9966@alchemy.franken.de> <20101129192308.GX80343@alchemy.franken.de> <20101129192417.GA18893@alchemy.franken.de> In-Reply-To: <20101129192417.GA18893@alchemy.franken.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, alc@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Max Khon Subject: Re: svn commit: r216016 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 18:19:20 -0000 Marius Strobl wrote: > On Mon, Nov 29, 2010 at 08:23:08PM +0100, Marius Strobl wrote: > >> On Tue, Nov 30, 2010 at 12:31:31AM +0600, Max Khon wrote: >> >>> Marius, >>> >>> On Mon, Nov 29, 2010 at 1:45 AM, Marius Strobl wrote: >>> >>> On Sun, Nov 28, 2010 at 07:26:20PM +0000, Max Khon wrote: >>> >>>>> Author: fjoe >>>>> Date: Sun Nov 28 19:26:20 2010 >>>>> New Revision: 216016 >>>>> URL: http://svn.freebsd.org/changeset/base/216016 >>>>> >>>>> Log: >>>>> Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with >>>>> DEBUG_MEMGUARD panics early in kmeminit() with the message >>>>> "kmem_suballoc: bad status return of 1" because of zero "size" argument >>>>> passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. >>>>> >>>>> The problem also exists on ia64. >>>>> >>>>> Modified: >>>>> head/sys/sparc64/include/vmparam.h >>>>> >>>>> Modified: head/sys/sparc64/include/vmparam.h >>>>> >>>>> >>>> ============================================================================== >>>> >>>>> --- head/sys/sparc64/include/vmparam.h Sun Nov 28 18:59:52 2010 >>>>> >>>> (r216015) >>>> >>>>> +++ head/sys/sparc64/include/vmparam.h Sun Nov 28 19:26:20 2010 >>>>> >>>> (r216016) >>>> >>>>> @@ -237,6 +237,14 @@ >>>>> #endif >>>>> >>>>> /* >>>>> + * Ceiling on amount of kmem_map kva space. >>>>> + */ >>>>> +#ifndef VM_KMEM_SIZE_MAX >>>>> +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ >>>>> + VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) >>>>> +#endif >>>>> + >>>>> +/* >>>>> * Initial pagein size of beginning of executable file. >>>>> */ >>>>> #ifndef VM_INITIAL_PAGEIN >>>>> >>>> How was that value determined? >>>> >>>> >>> I've just copied it from amd64 to be non-zero for now. Do you have a better >>> idea of what it should look like? >>> >>> >> Well, on sparc64 VM_MAX_KERNEL_ADDRESS already is dynamically adjusted >> to the maximum appropriate for the specific CPU during the early cycles >> of the kernel so I'd think one could just use VM_MAX_KERNEL_ADDRESS - >> VM_MIN_KERNEL_ADDRESS for VM_KMEM_SIZE_MAX there, I'm not sure what >> the intention of the ceiling provided by that macro actually is though >> In any case, the commit message of r180210 which changed the amd64 >> version to the current one talks about limiting the kmem map to 3.6GB >> and while it also fails to explain where that value comes from it >> looks rather amd64 specific and the formula used by the macro will >> result in a different ceiling on sparc64 and thus inappropriate. I've >> CC'ed alc@ who hopefully can shed some light on this. >> Apart from this the actual bug here seems to be that memguard_fudge() >> can't deal with a km_max being zero or that zero is passed to it as >> kmeminit() allows for VM_KMEM_SIZE_MAX not being defined. >> >> > > Oops, forgot to actually CC alc@. > There's nothing particularly amd64-specific about the definition. In general, if you allow the kmem_map, which is basically the kernel's heap, to consume the entire kernel address space as you propose, then you're leaving no room for the buffer cache, thread stacks, pipes, and a few other things. Since the cap on the kmem_map size as defined by r180210 is a fraction of the overall kernel address space size, it scales automatically with the kernel address space size and should be a reasonable cap definition for most architectures. In the specific case of sparc64, I think it's fair to say that the kernel virtual address is sufficiently large and the amount of physical memory in any of the supported machines is small enough in comparison that it hasn't mattered that a kmem_map cap doesn't exist, because most of the aforementioned structures are scaled based on the amount of physical memory. In fact, it probably won't matter any time soon. All of that said, I would suggest fixing memguard_fudge() and reverting r216016 and the follow up change. All I think that is required to fix memguard_fudge() is Index: vm/memguard.c =================================================================== --- vm/memguard.c (revision 216070) +++ vm/memguard.c (working copy) @@ -186,7 +186,7 @@ memguard_fudge(unsigned long km_size, unsigned lon memguard_mapsize = round_page(memguard_mapsize); if (memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) memguard_mapsize = mem_pgs * 2 * PAGE_SIZE; - if (km_size + memguard_mapsize > km_max) + if (km_max > 0 && km_size + memguard_mapsize > km_max) return (km_max); return (km_size + memguard_mapsize); } Regards, Alan From owner-svn-src-head@FreeBSD.ORG Wed Dec 1 19:24:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 576DE106567A; Wed, 1 Dec 2010 19:24:08 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46B518FC15; Wed, 1 Dec 2010 19:24:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB1JO8xs043862; Wed, 1 Dec 2010 19:24:08 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB1JO8DC043860; Wed, 1 Dec 2010 19:24:08 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201012011924.oB1JO8DC043860@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 1 Dec 2010 19:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216098 - head/sys/geom/label X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 19:24:08 -0000 Author: jh Date: Wed Dec 1 19:24:07 2010 New Revision: 216098 URL: http://svn.freebsd.org/changeset/base/216098 Log: - Report an error when a label with invalid name is attempted to be created with glabel(8). - Fix a typo in an error message. - Fix comment typos. Approved by: pjd Modified: head/sys/geom/label/g_label.c Modified: head/sys/geom/label/g_label.c ============================================================================== --- head/sys/geom/label/g_label.c Wed Dec 1 15:31:31 2010 (r216097) +++ head/sys/geom/label/g_label.c Wed Dec 1 19:24:07 2010 (r216098) @@ -124,13 +124,13 @@ g_label_is_name_ok(const char *label) { const char *s; - /* Check is the label starts from ../ */ + /* Check if the label starts from ../ */ if (strncmp(label, "../", 3) == 0) return (0); - /* Check is the label contains /../ */ + /* Check if the label contains /../ */ if (strstr(label, "/../") != NULL) return (0); - /* Check is the label ends at ../ */ + /* Check if the label ends at ../ */ if ((s = strstr(label, "/..")) != NULL && s[3] == '\0') return (0); return (1); @@ -151,6 +151,8 @@ g_label_create(struct gctl_req *req, str G_LABEL_DEBUG(0, "%s contains suspicious label, skipping.", pp->name); G_LABEL_DEBUG(1, "%s suspicious label is: %s", pp->name, label); + if (req != NULL) + gctl_error(req, "Label name %s is invalid.", label); return (NULL); } gp = NULL; @@ -346,7 +348,7 @@ g_label_ctl_create(struct gctl_req *req, return; } if (*nargs != 2) { - gctl_error(req, "Invalid number of argument."); + gctl_error(req, "Invalid number of arguments."); return; } /* From owner-svn-src-head@FreeBSD.ORG Wed Dec 1 21:19:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E75010656A9; Wed, 1 Dec 2010 21:19:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DB688FC19; Wed, 1 Dec 2010 21:19:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB1LJCw0049406; Wed, 1 Dec 2010 21:19:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB1LJCWR049404; Wed, 1 Dec 2010 21:19:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012012119.oB1LJCWR049404@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Dec 2010 21:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216099 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 21:19:12 -0000 Author: kib Date: Wed Dec 1 21:19:11 2010 New Revision: 216099 URL: http://svn.freebsd.org/changeset/base/216099 Log: Journal start looks up .sujournal file by doing lookup on the root dvp. As result, failed softdep_mount() might leave up to two vnodes on the mp mountlist, preventing mnt_ref from going to zero. Call ffs_flushfiles() after failed softdep_mount() to clean mountlist. Initial report by: Garrett Cooper Reproduced and tested by: pho Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Wed Dec 1 19:24:07 2010 (r216098) +++ head/sys/ufs/ffs/ffs_vfsops.c Wed Dec 1 21:19:11 2010 (r216099) @@ -928,6 +928,7 @@ ffs_mountfs(devvp, mp, td) if ((fs->fs_flags & FS_DOSOFTDEP) && (error = softdep_mount(devvp, mp, fs, cred)) != 0) { free(fs->fs_csp, M_UFSMNT); + ffs_flushfiles(mp, FORCECLOSE, td); goto out; } if (fs->fs_snapinum[0] != 0) From owner-svn-src-head@FreeBSD.ORG Wed Dec 1 23:26:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A65F1065695; Wed, 1 Dec 2010 23:26:33 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 091F58FC19; Wed, 1 Dec 2010 23:26:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB1NQWcr056330; Wed, 1 Dec 2010 23:26:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB1NQW5n056328; Wed, 1 Dec 2010 23:26:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012012326.oB1NQW5n056328@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 1 Dec 2010 23:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216100 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 23:26:33 -0000 Author: jilles Date: Wed Dec 1 23:26:32 2010 New Revision: 216100 URL: http://svn.freebsd.org/changeset/base/216100 Log: sh(1): Document that command's -p option also works with -v/-V. This was implemented in r201343. Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Wed Dec 1 21:19:11 2010 (r216099) +++ head/bin/sh/sh.1 Wed Dec 1 23:26:32 2010 (r216100) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd November 19, 2010 +.Dd December 1, 2010 .Dt SH 1 .Os .Sh NAME @@ -1712,7 +1712,8 @@ A synonym for the .Ic cd built-in command. .It Ic command Oo Fl p Oc Op Ar utility Op Ar argument ... -.It Ic command Oo Fl v | V Oc Op Ar utility +.It Ic command Oo Fl p Oc Fl v Ar utility +.It Ic command Oo Fl p Oc Fl V Ar utility The first form of invocation executes the specified .Ar utility , ignoring shell functions in the search. From owner-svn-src-head@FreeBSD.ORG Wed Dec 1 23:58:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 74FFE1065675; Wed, 1 Dec 2010 23:58:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Wed, 1 Dec 2010 18:58:18 -0500 User-Agent: KMail/1.6.2 References: <201012010351.oB13p6du062509@svn.freebsd.org> In-Reply-To: <201012010351.oB13p6du062509@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201012011858.19748.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Weongyo Jeong Subject: Re: svn commit: r216091 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Dec 2010 23:58:28 -0000 On Tuesday 30 November 2010 10:51 pm, Weongyo Jeong wrote: > Author: weongyo > Date: Wed Dec 1 03:51:06 2010 > New Revision: 216091 > URL: http://svn.freebsd.org/changeset/base/216091 > > Log: > Explicitly UP and DOWN the usbus interfaces (IFT_USB) when it's > attached or detached. Normally it should be changed through user > land ioctl(2) system calls but it looks there's no apps for USB and > no need. > > With this patch, libpcap would detect the usbus interfaces > correctly and tcpdump(1) could dump the USB packets into PCAP > format with -w option. However it couldn't print the output to > console because there's no printer-routine at tcpdump(1). I have written a very hackish USB packet printer for tcpdump based on Linux version. http://people.freebsd.org/~jkim/tcpdump-usb.diff Note we can only print headers as Linux version does. Are you planning on adopting DLT_USB_LINUX or DLT_USB_LINUX_MMAPPED or applying for our own DLT, BTW? Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 00:47:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD9FC106566C; Thu, 2 Dec 2010 00:47:55 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBE7D8FC08; Thu, 2 Dec 2010 00:47:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB20ltfo062104; Thu, 2 Dec 2010 00:47:55 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB20lte1062102; Thu, 2 Dec 2010 00:47:55 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201012020047.oB20lte1062102@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 2 Dec 2010 00:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216101 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 00:47:55 -0000 Author: lstewart Date: Thu Dec 2 00:47:55 2010 New Revision: 216101 URL: http://svn.freebsd.org/changeset/base/216101 Log: Pass NULL instead of 0 for the th pointer value. NULL != 0 on all platforms. Submitted by: David Hayes MFC after: 9 weeks X-MFC with: r215166 Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Wed Dec 1 23:26:32 2010 (r216100) +++ head/sys/netinet/tcp_timer.c Thu Dec 2 00:47:55 2010 (r216101) @@ -567,7 +567,7 @@ tcp_timer_rexmt(void * xtp) */ tp->t_rtttime = 0; - cc_cong_signal(tp, 0, CC_RTO); + cc_cong_signal(tp, NULL, CC_RTO); (void) tcp_output(tp); From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 00:57:02 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17143106566C; Thu, 2 Dec 2010 00:57:02 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id CC4A48FC14; Thu, 2 Dec 2010 00:57:01 +0000 (UTC) Received: from lawrence1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 1189D7E8A3; Thu, 2 Dec 2010 11:56:59 +1100 (EST) Message-ID: <4CF6EEDA.7090609@freebsd.org> Date: Thu, 02 Dec 2010 11:56:58 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.2.12) Gecko/20101117 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: src-committers@FreeBSD.org References: <201012020047.oB20lte1062102@svn.freebsd.org> In-Reply-To: <201012020047.oB20lte1062102@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r216101 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 00:57:02 -0000 On 12/02/10 11:47, Lawrence Stewart wrote: > Author: lstewart > Date: Thu Dec 2 00:47:55 2010 > New Revision: 216101 > URL: http://svn.freebsd.org/changeset/base/216101 > > Log: > Pass NULL instead of 0 for the th pointer value. NULL != 0 on all platforms. > Sponsored by: FreeBSD Foundation > Submitted by: David Hayes > MFC after: 9 weeks > X-MFC with: r215166 > > Modified: > head/sys/netinet/tcp_timer.c From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 01:01:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9712C106566C; Thu, 2 Dec 2010 01:01:37 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 857428FC12; Thu, 2 Dec 2010 01:01:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB211b3l063261; Thu, 2 Dec 2010 01:01:37 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB211bJv063259; Thu, 2 Dec 2010 01:01:37 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201012020101.oB211bJv063259@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 2 Dec 2010 01:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216103 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 01:01:37 -0000 Author: lstewart Date: Thu Dec 2 01:01:37 2010 New Revision: 216103 URL: http://svn.freebsd.org/changeset/base/216103 Log: Set ssthresh appropriately on RTO. This change was accidentally not ported from the pre modular CC stack. Sponsored by: FreeBSD Foundation Submitted by: David Hayes MFC after: 9 weeks X-MFC with: r215166 Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Dec 2 00:49:02 2010 (r216102) +++ head/sys/netinet/tcp_input.c Thu Dec 2 01:01:37 2010 (r216103) @@ -378,6 +378,8 @@ cc_cong_signal(struct tcpcb *tp, struct tp->t_dupacks = 0; tp->t_bytes_acked = 0; EXIT_RECOVERY(tp->t_flags); + tp->snd_ssthresh = max(2, min(tp->snd_wnd, tp->snd_cwnd) / 2 / + tp->t_maxseg) * tp->t_maxseg; tp->snd_cwnd = tp->t_maxseg; break; case CC_RTO_ERR: From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 01:14:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3490A106566C; Thu, 2 Dec 2010 01:14:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 087DE8FC08; Thu, 2 Dec 2010 01:14:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB21EjGL064274; Thu, 2 Dec 2010 01:14:45 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB21Ejg9064271; Thu, 2 Dec 2010 01:14:45 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201012020114.oB21Ejg9064271@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 2 Dec 2010 01:14:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216104 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 01:14:46 -0000 Author: trasz Date: Thu Dec 2 01:14:45 2010 New Revision: 216104 URL: http://svn.freebsd.org/changeset/base/216104 Log: Remove useless NULL checks for M_WAITOK mallocs. Modified: head/sys/kern/sysv_msg.c head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Thu Dec 2 01:01:37 2010 (r216103) +++ head/sys/kern/sysv_msg.c Thu Dec 2 01:14:45 2010 (r216104) @@ -200,18 +200,10 @@ msginit() TUNABLE_INT_FETCH("kern.ipc.msgtql", &msginfo.msgtql); msgpool = malloc(msginfo.msgmax, M_MSG, M_WAITOK); - if (msgpool == NULL) - panic("msgpool is NULL"); msgmaps = malloc(sizeof(struct msgmap) * msginfo.msgseg, M_MSG, M_WAITOK); - if (msgmaps == NULL) - panic("msgmaps is NULL"); msghdrs = malloc(sizeof(struct msg) * msginfo.msgtql, M_MSG, M_WAITOK); - if (msghdrs == NULL) - panic("msghdrs is NULL"); msqids = malloc(sizeof(struct msqid_kernel) * msginfo.msgmni, M_MSG, M_WAITOK); - if (msqids == NULL) - panic("msqids is NULL"); /* * msginfo.msgssz should be a power of two for efficiency reasons. @@ -233,9 +225,6 @@ msginit() panic("msginfo.msgseg > 32767"); } - if (msgmaps == NULL) - panic("msgmaps is NULL"); - for (i = 0; i < msginfo.msgseg; i++) { if (i > 0) msgmaps[i-1].next = i; @@ -244,9 +233,6 @@ msginit() free_msgmaps = 0; nfree_msgmaps = msginfo.msgseg; - if (msghdrs == NULL) - panic("msghdrs is NULL"); - for (i = 0; i < msginfo.msgtql; i++) { msghdrs[i].msg_type = 0; if (i > 0) @@ -258,9 +244,6 @@ msginit() } free_msghdrs = &msghdrs[0]; - if (msqids == NULL) - panic("msqids is NULL"); - for (i = 0; i < msginfo.msgmni; i++) { msqids[i].u.msg_qbytes = 0; /* implies entry is available */ msqids[i].u.msg_perm.seq = 0; /* reset to a known value */ Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Thu Dec 2 01:01:37 2010 (r216103) +++ head/sys/kern/sysv_shm.c Thu Dec 2 01:14:45 2010 (r216104) @@ -878,8 +878,6 @@ shminit() shmalloced = shminfo.shmmni; shmsegs = malloc(shmalloced * sizeof(shmsegs[0]), M_SHM, M_WAITOK); - if (shmsegs == NULL) - panic("cannot allocate initial memory for sysvshm"); for (i = 0; i < shmalloced; i++) { shmsegs[i].u.shm_perm.mode = SHMSEG_FREE; shmsegs[i].u.shm_perm.seq = 0; From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 01:36:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B736106564A; Thu, 2 Dec 2010 01:36:00 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 791F48FC08; Thu, 2 Dec 2010 01:36:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB21a0tB065983; Thu, 2 Dec 2010 01:36:00 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB21a0PQ065980; Thu, 2 Dec 2010 01:36:00 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201012020136.oB21a0PQ065980@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 2 Dec 2010 01:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216105 - in head/sys/netinet: . cc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 01:36:00 -0000 Author: lstewart Date: Thu Dec 2 01:36:00 2010 New Revision: 216105 URL: http://svn.freebsd.org/changeset/base/216105 Log: - Reinstantiate the after_idle hook call in tcp_output(), which got lost somewhere along the way due to mismerging r211464 in our development tree. - Capture the essence of r211464 in NewReno's after_idle() hook. We don't use V_ss_fltsz/V_ss_fltsz_local yet which needs to be revisited. Sponsored by: FreeBSD Foundation Submitted by: David Hayes MFC after: 9 weeks X-MFC with: r215166 Modified: head/sys/netinet/cc/cc_newreno.c head/sys/netinet/tcp_output.c Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Thu Dec 2 01:14:45 2010 (r216104) +++ head/sys/netinet/cc/cc_newreno.c Thu Dec 2 01:36:00 2010 (r216105) @@ -216,15 +216,28 @@ newreno_post_recovery(struct cc_var *ccv void newreno_after_idle(struct cc_var *ccv) { + int rw; + /* - * We have been idle for "a while" and no acks are expected to clock out - * any data we send -- slow start to get ack "clock" running again. + * If we've been idle for more than one retransmit timeout the old + * congestion window is no longer current and we have to reduce it to + * the restart window before we can transmit again. + * + * The restart window is the initial window or the last CWND, whichever + * is smaller. + * + * This is done to prevent us from flooding the path with a full CWND at + * wirespeed, overloading router and switch buffers along the way. + * + * See RFC5681 Section 4.1. "Restarting Idle Connections". */ if (V_tcp_do_rfc3390) - CCV(ccv, snd_cwnd) = min(4 * CCV(ccv, t_maxseg), + rw = min(4 * CCV(ccv, t_maxseg), max(2 * CCV(ccv, t_maxseg), 4380)); else - CCV(ccv, snd_cwnd) = CCV(ccv, t_maxseg) * 2; + rw = CCV(ccv, t_maxseg) * 2; + + CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd)); } Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Dec 2 01:14:45 2010 (r216104) +++ head/sys/netinet/tcp_output.c Thu Dec 2 01:36:00 2010 (r216105) @@ -148,7 +148,7 @@ tcp_output(struct tcpcb *tp) { struct socket *so = tp->t_inpcb->inp_socket; long len, recwin, sendwin; - int off, flags, error, rw; + int off, flags, error; struct mbuf *m; struct ip *ip = NULL; struct ipovly *ipov = NULL; @@ -182,37 +182,8 @@ tcp_output(struct tcpcb *tp) * to send, then transmit; otherwise, investigate further. */ idle = (tp->t_flags & TF_LASTIDLE) || (tp->snd_max == tp->snd_una); - if (idle && ticks - tp->t_rcvtime >= tp->t_rxtcur) { - /* - * If we've been idle for more than one retransmit - * timeout the old congestion window is no longer - * current and we have to reduce it to the restart - * window before we can transmit again. - * - * The restart window is the initial window or the last - * CWND, whichever is smaller. - * - * This is done to prevent us from flooding the path with - * a full CWND at wirespeed, overloading router and switch - * buffers along the way. - * - * See RFC5681 Section 4.1. "Restarting Idle Connections". - */ - if (V_tcp_do_rfc3390) - rw = min(4 * tp->t_maxseg, - max(2 * tp->t_maxseg, 4380)); -#ifdef INET6 - else if ((isipv6 ? in6_localaddr(&tp->t_inpcb->in6p_faddr) : - in_localaddr(tp->t_inpcb->inp_faddr))) -#else - else if (in_localaddr(tp->t_inpcb->inp_faddr)) -#endif - rw = V_ss_fltsz_local * tp->t_maxseg; - else - rw = V_ss_fltsz * tp->t_maxseg; - - tp->snd_cwnd = min(rw, tp->snd_cwnd); - } + if (idle && ticks - tp->t_rcvtime >= tp->t_rxtcur) + cc_after_idle(tp); tp->t_flags &= ~TF_LASTIDLE; if (idle) { if (tp->t_flags & TF_MORETOCOME) { From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 01:46:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A07D1065679; Thu, 2 Dec 2010 01:46:06 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88B0C8FC0A; Thu, 2 Dec 2010 01:46:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB21k6M8066822; Thu, 2 Dec 2010 01:46:06 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB21k6RI066820; Thu, 2 Dec 2010 01:46:06 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012020146.oB21k6RI066820@svn.freebsd.org> From: Kevin Lo Date: Thu, 2 Dec 2010 01:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216106 - head/usr.bin/find X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 01:46:06 -0000 Author: kevlo Date: Thu Dec 2 01:46:06 2010 New Revision: 216106 URL: http://svn.freebsd.org/changeset/base/216106 Log: Don't error out while searching for empty directories. Submitted by: Bakul Shah Modified: head/usr.bin/find/function.c Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Thu Dec 2 01:36:00 2010 (r216105) +++ head/usr.bin/find/function.c Thu Dec 2 01:46:06 2010 (r216106) @@ -559,7 +559,7 @@ f_empty(PLAN *plan __unused, FTSENT *ent empty = 1; dir = opendir(entry->fts_accpath); if (dir == NULL) - err(1, "%s", entry->fts_accpath); + return 0; for (dp = readdir(dir); dp; dp = readdir(dir)) if (dp->d_name[0] != '.' || (dp->d_name[1] != '\0' && From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 02:32:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A83AD106566C; Thu, 2 Dec 2010 02:32:46 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95F0E8FC08; Thu, 2 Dec 2010 02:32:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB22WkmJ070451; Thu, 2 Dec 2010 02:32:46 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB22WkNS070449; Thu, 2 Dec 2010 02:32:46 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201012020232.oB22WkNS070449@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 2 Dec 2010 02:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216107 - head/sys/netinet/cc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 02:32:46 -0000 Author: lstewart Date: Thu Dec 2 02:32:46 2010 New Revision: 216107 URL: http://svn.freebsd.org/changeset/base/216107 Log: General cleanup of the NewReno CC module (no functional changes): - Remove superfluous includes and unhelpful comments. - Alphabetically order functions. - Make functions static. Sponsored by: FreeBSD Foundation MFC after: 9 weeks X-MFC with: r215166 Modified: head/sys/netinet/cc/cc_newreno.c Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Thu Dec 2 01:46:06 2010 (r216106) +++ head/sys/netinet/cc/cc_newreno.c Thu Dec 2 02:32:46 2010 (r216107) @@ -52,41 +52,35 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include +#include -#include -#include +#include #include -#include -#include #include #include #include -void newreno_ack_received(struct cc_var *ccv, uint16_t type); -void newreno_cong_signal(struct cc_var *ccv, uint32_t type); -void newreno_post_recovery(struct cc_var *ccv); -void newreno_after_idle(struct cc_var *ccv); +static void newreno_ack_received(struct cc_var *ccv, uint16_t type); +static void newreno_after_idle(struct cc_var *ccv); +static void newreno_cong_signal(struct cc_var *ccv, uint32_t type); +static void newreno_post_recovery(struct cc_var *ccv); struct cc_algo newreno_cc_algo = { .name = "newreno", .ack_received = newreno_ack_received, + .after_idle = newreno_after_idle, .cong_signal = newreno_cong_signal, .post_recovery = newreno_post_recovery, - .after_idle = newreno_after_idle }; -/* - * Increase cwnd on receipt of a successful ACK: - * if cwnd <= ssthresh, increases by 1 MSS per ACK - * if cwnd > ssthresh, increase by ~1 MSS per RTT - */ -void +static void newreno_ack_received(struct cc_var *ccv, uint16_t type) { if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && @@ -153,10 +147,37 @@ newreno_ack_received(struct cc_var *ccv, } } +static void +newreno_after_idle(struct cc_var *ccv) +{ + int rw; + + /* + * If we've been idle for more than one retransmit timeout the old + * congestion window is no longer current and we have to reduce it to + * the restart window before we can transmit again. + * + * The restart window is the initial window or the last CWND, whichever + * is smaller. + * + * This is done to prevent us from flooding the path with a full CWND at + * wirespeed, overloading router and switch buffers along the way. + * + * See RFC5681 Section 4.1. "Restarting Idle Connections". + */ + if (V_tcp_do_rfc3390) + rw = min(4 * CCV(ccv, t_maxseg), + max(2 * CCV(ccv, t_maxseg), 4380)); + else + rw = CCV(ccv, t_maxseg) * 2; + + CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd)); +} + /* - * manage congestion signals + * Perform any necessary tasks before we enter congestion recovery. */ -void +static void newreno_cong_signal(struct cc_var *ccv, uint32_t type) { u_int win; @@ -183,11 +204,9 @@ newreno_cong_signal(struct cc_var *ccv, } /* - * decrease the cwnd in response to packet loss or a transmit timeout. - * th can be null, in which case cwnd will be set according to reno instead - * of new reno. + * Perform any necessary tasks before we exit congestion recovery. */ -void +static void newreno_post_recovery(struct cc_var *ccv) { if (IN_FASTRECOVERY(CCV(ccv, t_flags))) { @@ -209,36 +228,5 @@ newreno_post_recovery(struct cc_var *ccv } } -/* - * if a connection has been idle for a while and more data is ready to be sent, - * reset cwnd - */ -void -newreno_after_idle(struct cc_var *ccv) -{ - int rw; - - /* - * If we've been idle for more than one retransmit timeout the old - * congestion window is no longer current and we have to reduce it to - * the restart window before we can transmit again. - * - * The restart window is the initial window or the last CWND, whichever - * is smaller. - * - * This is done to prevent us from flooding the path with a full CWND at - * wirespeed, overloading router and switch buffers along the way. - * - * See RFC5681 Section 4.1. "Restarting Idle Connections". - */ - if (V_tcp_do_rfc3390) - rw = min(4 * CCV(ccv, t_maxseg), - max(2 * CCV(ccv, t_maxseg), 4380)); - else - rw = CCV(ccv, t_maxseg) * 2; - - CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd)); -} - DECLARE_CC_MODULE(newreno, &newreno_cc_algo); From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 03:10:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3F88106566C; Thu, 2 Dec 2010 03:10:35 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C23568FC19; Thu, 2 Dec 2010 03:10:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB23AZPg072572; Thu, 2 Dec 2010 03:10:35 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB23AZ4m072569; Thu, 2 Dec 2010 03:10:35 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201012020310.oB23AZ4m072569@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 2 Dec 2010 03:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216109 - in head/sys/modules: . cc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 03:10:35 -0000 Author: lstewart Date: Thu Dec 2 03:10:35 2010 New Revision: 216109 URL: http://svn.freebsd.org/changeset/base/216109 Log: Add build infrastructure for the forthcoming CC algorithm modules. Sponsored by: FreeBSD Foundation Submitted by: David Hayes MFC after: 3 months Added: head/sys/modules/cc/ head/sys/modules/cc/Makefile (contents, props changed) Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Dec 2 02:34:39 2010 (r216108) +++ head/sys/modules/Makefile Thu Dec 2 03:10:35 2010 (r216109) @@ -51,6 +51,7 @@ SUBDIR= ${_3dfx} \ ${_cardbus} \ cas \ ${_cbb} \ + cc \ cd9660 \ cd9660_iconv \ ${_ce} \ Added: head/sys/modules/cc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/cc/Makefile Thu Dec 2 03:10:35 2010 (r216109) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= + +.include From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 03:45:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2581106564A; Thu, 2 Dec 2010 03:45:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 5D4288FC13; Thu, 2 Dec 2010 03:45:47 +0000 (UTC) Received: from c122-106-145-124.carlnfd1.nsw.optusnet.com.au (c122-106-145-124.carlnfd1.nsw.optusnet.com.au [122.106.145.124]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB23jiMr020143 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Dec 2010 14:45:45 +1100 Date: Thu, 2 Dec 2010 14:45:44 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Lawrence Stewart In-Reply-To: <201012020047.oB20lte1062102@svn.freebsd.org> Message-ID: <20101202141735.B1174@besplex.bde.org> References: <201012020047.oB20lte1062102@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216101 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 03:45:48 -0000 On Thu, 2 Dec 2010, Lawrence Stewart wrote: > Log: > Pass NULL instead of 0 for the th pointer value. NULL != 0 on all platforms. > > Submitted by: David Hayes > MFC after: 9 weeks > X-MFC with: r215166 > > Modified: > head/sys/netinet/tcp_timer.c > > Modified: head/sys/netinet/tcp_timer.c > ============================================================================== > --- head/sys/netinet/tcp_timer.c Wed Dec 1 23:26:32 2010 (r216100) > +++ head/sys/netinet/tcp_timer.c Thu Dec 2 00:47:55 2010 (r216101) > @@ -567,7 +567,7 @@ tcp_timer_rexmt(void * xtp) > */ > tp->t_rtttime = 0; > > - cc_cong_signal(tp, 0, CC_RTO); > + cc_cong_signal(tp, NULL, CC_RTO); > > (void) tcp_output(tp); > Er this never passed 0, (provided a prototype is in scope), and can neverpass either 0 or NULL, since 0 and NULL are null pointer constants and functions cannot pass constants. It used to pass a null pointer, after converting the null pointer constant 0 according to the prototype. Now it passes the same null pointer after converting the possibly-different null pointer constant NULL according to the prototype. NULL == 0 on all platform, since both are null pointer constants, and one of the following cases applies: - if NULL is an integer constant with value 0, then of course it equals plain int 0. Moreover, even if the type of NULL is different from the type of plain int 0, the types become identical before the comparison is done, since both operands are converted to a common type. - if NULL is an integer constant with value 0 cast to (void *), then it certainly has a different type than plain int 0, and may have a different representation. However, when compared with plain 0, both operands are converted to a common type, which is necessarily that of NULL. This is a pointer type, so so both operands are null pointers. These null pointers may have different representations, but any two null pointers to the same type are specified to compare equal. So NULL == 0 in this case too. The last case is essentially what applies in function calls. Now the conversion of either NULL or 0 or any other null pointer constant to a null pointer is done according to the prototype. The results are not necessarily the same like I said above, but they compare the same. Thus spelling the null pointer constant as 0 made no difference to the higher-level results on any platform (unless you do something like memcmp of null pointers, and use an exotic platform where null pointers have different representations). It was just a style bug. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 03:53:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF3A21065696; Thu, 2 Dec 2010 03:53:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D66B8FC15; Thu, 2 Dec 2010 03:53:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB23rTgs074218; Thu, 2 Dec 2010 03:53:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB23rTYV074216; Thu, 2 Dec 2010 03:53:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012020353.oB23rTYV074216@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 2 Dec 2010 03:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216111 - head/sys/dev/fxp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 03:53:29 -0000 Author: yongari Date: Thu Dec 2 03:53:29 2010 New Revision: 216111 URL: http://svn.freebsd.org/changeset/base/216111 Log: If RX lockup workaround is enabled, fxp(4) will periodically reset the controller to workaround silicon bug of i82557. Each reset will re-establish link which in turn triggers MII status change callback. The callback will try to reconfigure controller if the controller is not i82557 to enable flow-control. This caused endless link UP/DOWN when the workaround was enabled on non-i82557 controller. To fix the issue, apply RX lockup workaround only for i82557. Previously it blindly checked undocumented EEPROM location such that it sometimes enabled the workaround for other controllers. At this time, only i82557 is known to have the silicon bug. This fixes a regression introduced in r215906 which enabled flow control support for all controllers except i82557. Reported by: Karl Denninger (karl <> denninger dot net) Tested by: Karl Denninger (karl <> denninger dot net) MFC after: 3 days Modified: head/sys/dev/fxp/if_fxp.c Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Thu Dec 2 03:34:27 2010 (r216110) +++ head/sys/dev/fxp/if_fxp.c Thu Dec 2 03:53:29 2010 (r216111) @@ -526,10 +526,12 @@ fxp_attach(device_t dev) } /* Receiver lock-up workaround detection. */ - fxp_read_eeprom(sc, &data, 3, 1); - if ((data & 0x03) != 0x03) { - sc->flags |= FXP_FLAG_RXBUG; - device_printf(dev, "Enabling Rx lock-up workaround\n"); + if (sc->revision < FXP_REV_82558_A4) { + fxp_read_eeprom(sc, &data, 3, 1); + if ((data & 0x03) != 0x03) { + sc->flags |= FXP_FLAG_RXBUG; + device_printf(dev, "Enabling Rx lock-up workaround\n"); + } } /* From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 04:28:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BB931065696; Thu, 2 Dec 2010 04:28:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FE5D8FC16; Thu, 2 Dec 2010 04:28:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB24S20n077417; Thu, 2 Dec 2010 04:28:02 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB24S2O5077415; Thu, 2 Dec 2010 04:28:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201012020428.oB24S2O5077415@svn.freebsd.org> From: Warner Losh Date: Thu, 2 Dec 2010 04:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216112 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 04:28:02 -0000 Author: imp Date: Thu Dec 2 04:28:01 2010 New Revision: 216112 URL: http://svn.freebsd.org/changeset/base/216112 Log: removed tag is '-', not '+'. remove extra return. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Thu Dec 2 03:53:29 2010 (r216111) +++ head/sys/kern/subr_bus.c Thu Dec 2 04:28:01 2010 (r216112) @@ -718,8 +718,7 @@ devadded(device_t dev) static void devremoved(device_t dev) { - devaddq("+", device_get_nameunit(dev), dev); - return; + devaddq("-", device_get_nameunit(dev), dev); } /* From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 04:44:42 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBF5D1065673; Thu, 2 Dec 2010 04:44:42 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 4D2D78FC1A; Thu, 2 Dec 2010 04:44:42 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id 9934E7E84A; Thu, 2 Dec 2010 15:44:40 +1100 (EST) Message-ID: <4CF72434.8@freebsd.org> Date: Thu, 02 Dec 2010 15:44:36 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101117 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Bruce Evans References: <201012020047.oB20lte1062102@svn.freebsd.org> <20101202141735.B1174@besplex.bde.org> In-Reply-To: <20101202141735.B1174@besplex.bde.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216101 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 04:44:42 -0000 On 12/02/10 14:45, Bruce Evans wrote: > On Thu, 2 Dec 2010, Lawrence Stewart wrote: > >> Log: >> Pass NULL instead of 0 for the th pointer value. NULL != 0 on all >> platforms. >> >> Submitted by: David Hayes >> MFC after: 9 weeks >> X-MFC with: r215166 >> >> Modified: >> head/sys/netinet/tcp_timer.c >> >> Modified: head/sys/netinet/tcp_timer.c >> ============================================================================== >> >> --- head/sys/netinet/tcp_timer.c Wed Dec 1 23:26:32 2010 (r216100) >> +++ head/sys/netinet/tcp_timer.c Thu Dec 2 00:47:55 2010 (r216101) >> @@ -567,7 +567,7 @@ tcp_timer_rexmt(void * xtp) >> */ >> tp->t_rtttime = 0; >> >> - cc_cong_signal(tp, 0, CC_RTO); >> + cc_cong_signal(tp, NULL, CC_RTO); >> >> (void) tcp_output(tp); >> > > Er this never passed 0, (provided a prototype is in scope), and can > neverpass > either 0 or NULL, since 0 and NULL are null pointer constants and functions > cannot pass constants. > > It used to pass a null pointer, after converting the null pointer > constant 0 according to the prototype. Now it passes the same null > pointer after converting the possibly-different null pointer constant > NULL according to the prototype. > > NULL == 0 on all platform, since both are null pointer constants, and > one of the following cases applies: > - if NULL is an integer constant with value 0, then of course it equals > plain int 0. Moreover, even if the type of NULL is different from > the type of plain int 0, the types become identical before the > comparison is done, since both operands are converted to a common > type. > - if NULL is an integer constant with value 0 cast to (void *), then it > certainly has a different type than plain int 0, and may have a > different representation. However, when compared with plain 0, both > operands are converted to a common type, which is necessarily that > of NULL. This is a pointer type, so so both operands are null > pointers. These null pointers may have different representations, > but any two null pointers to the same type are specified to compare > equal. So NULL == 0 in this case too. > > The last case is essentially what applies in function calls. Now the > conversion of either NULL or 0 or any other null pointer constant to a > null pointer is done according to the prototype. The results are not > necessarily the same like I said above, but they compare the same. > Thus spelling the null pointer constant as 0 made no difference to > the higher-level results on any platform (unless you do something like > memcmp of null pointers, and use an exotic platform where null pointers > have different representations). It was just a style bug. hmm, thanks for the informative response. I'm not sure where I got it in my head that NULL != 0 on all platforms, but you've now corrected that bit of misunderstanding. For the record, the now known to be bogus commit log was my own creation based on my (mis)understanding and did not come from David. When it comes time to MFC, should I use the bogus log message or correct it to something like: "Fix a minor style nit by passing NULL instead of 0 for the th pointer value." Cheers, Lawrence From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 04:57:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 742021065670; Thu, 2 Dec 2010 04:57:30 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 198AD8FC14; Thu, 2 Dec 2010 04:57:29 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.4/8.14.2) with ESMTP id oB24vT24023435; Wed, 1 Dec 2010 23:57:29 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.4/8.14.2/Submit) id oB24vSgk023434; Wed, 1 Dec 2010 23:57:28 -0500 (EST) (envelope-from das@freebsd.org) Date: Wed, 1 Dec 2010 23:57:28 -0500 From: David Schultz To: Kostik Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20101202045728.GA19295@zim.MIT.EDU> Mail-Followup-To: Kostik Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201006121732.o5CHW5Cs065722@svn.freebsd.org> <20100615084939.GL13238@deviant.kiev.zoral.com.ua> <20100615131443.GA93094@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100615131443.GA93094@zim.MIT.EDU> Cc: Subject: Re: svn commit: r209110 - in head/lib/msun: . src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 04:57:30 -0000 On Tue, Jun 15, 2010, David Schultz wrote: > On Tue, Jun 15, 2010, Kostik Belousov wrote: > > On Sat, Jun 12, 2010 at 05:32:05PM +0000, David Schultz wrote: > > > Author: das > > > Date: Sat Jun 12 17:32:05 2010 > > > New Revision: 209110 > > > URL: http://svn.freebsd.org/changeset/base/209110 > > > > > > Log: > > > Introduce __isnanf() as an alias for isnanf(), and make the isnan() > > > macro expand to __isnanf() instead of isnanf() for float arguments. > > > This change is needed because isnanf() isn't declared in strict POSIX > > > or C99 mode. > > > > > > Compatibility note: Apps using isnan(float) that are compiled after > > > this change won't link against an older libm. > > > > > > Reported by: Florian Forster > > > > May be, it makes sense to remove the default version for the isnan symbol ? > > Wouldn't this mean apps that use isnanf() directly will no longer > compile? isnanf() is a historical BSD interface, and although > it's been deprecated for many years, it's still declared (if > __BSD_VISIBLE). > > Oops, to complicate matters further, I just noticed that we > already have isnanf and __isnanf symbols in libc, so maybe the new > symbol isn't needed. (isnan() and isnanf() are in libc because > that's where they were historically.) The second version in > libm looks like a mistake (wrong scope of the #if 0 in s_isnan.c.) > Perhaps we could just remove the duplicate symbols from libm. Any thoughts on removing the isnanf and __isnanf symbols from libm? Both symbols are already in libc for historical reasons, so the duplication isn't needed. Although we've had the duplicate isnanf symbol in libm for several releases, I don't believe removing it will cause problems; apps will just pick up the libc version. __isnanf is only present in libm in 9-CURRENT (due to the commit referenced above). Because of symbol version differences, however, removing it will affect apps that were linked under 9-CURRENT AND rely on isnanf AND link against libm before libc. On my system, libwebkit is the only affected binary I could find. From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 04:58:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 843A4106566B; Thu, 2 Dec 2010 04:58:07 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 724168FC19; Thu, 2 Dec 2010 04:58:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB24w7PR079941; Thu, 2 Dec 2010 04:58:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB24w7IY079939; Thu, 2 Dec 2010 04:58:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201012020458.oB24w7IY079939@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 2 Dec 2010 04:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216113 - head/gnu/usr.bin/cc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 04:58:07 -0000 Author: nwhitehorn Date: Thu Dec 2 04:58:07 2010 New Revision: 216113 URL: http://svn.freebsd.org/changeset/base/216113 Log: The driver-XXX.c files used for host CPU detection with -march=native should not be compiled in the cross-tools case (where -march=native makes no sense). This fixes cross-building x86 toolchains on non-x86 systems. Modified: head/gnu/usr.bin/cc/Makefile.fe Modified: head/gnu/usr.bin/cc/Makefile.fe ============================================================================== --- head/gnu/usr.bin/cc/Makefile.fe Thu Dec 2 04:28:01 2010 (r216112) +++ head/gnu/usr.bin/cc/Makefile.fe Thu Dec 2 04:58:07 2010 (r216113) @@ -19,7 +19,8 @@ CFLAGS+= ${DRIVER_DEFINES} SRCS= gcc.c opts-common.c options.c intl.c prefix.c version.c -.if exists(${GCCDIR}/config/${GCC_CPU}/driver-${GCC_CPU}.c) +.if ${TARGET_ARCH} == ${MACHINE_ARCH} && \ + exists(${GCCDIR}/config/${GCC_CPU}/driver-${GCC_CPU}.c) SRCS+= driver-${GCC_CPU}.c .endif From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 05:16:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C2EB10656A3; Thu, 2 Dec 2010 05:16:06 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 79B148FC19; Thu, 2 Dec 2010 05:16:05 +0000 (UTC) Received: by wyf19 with SMTP id 19so7757449wyf.13 for ; Wed, 01 Dec 2010 21:16:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; bh=O/hGI7o6p7qbPaER3NwvbDHU2PkSk8ufderTEfk7yII=; b=FKzvdTYz2dIhOcj/zSbMTLSz0/Wfjyp4ujLfU+x0++fLrMZl+2OmiwkUd6uBMQ8Kxn enStKsbms6WGKbn9sTKDjBY52w2/nxjwPnaiy4vnW7wDtn6BgNsKYIJi8wN7eskc8IYA rI/FAfjnwkKTPjD9fQmnMxJuIH5oZI4yr7XNE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=jmVuI/3MYfudI2TyKvu/5AvRaeFxgREVMuE/GYfKHEzDhM/KhnnHDofwa9FcghAcMd hGqFrJk9q0rI/96UDKizEi4uqOXICTE34OAvAdfcPcOF1bqrTb9B+IkYB+RsHPiSY7N+ rfFzyupWrxXEiDq64Nq3ShXlLHR3yfRqfV97g= MIME-Version: 1.0 Received: by 10.216.71.209 with SMTP id r59mr1068789wed.15.1291266964057; Wed, 01 Dec 2010 21:16:04 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.198.27 with HTTP; Wed, 1 Dec 2010 21:16:04 -0800 (PST) In-Reply-To: <20101202045728.GA19295@zim.MIT.EDU> References: <201006121732.o5CHW5Cs065722@svn.freebsd.org> <20100615084939.GL13238@deviant.kiev.zoral.com.ua> <20100615131443.GA93094@zim.MIT.EDU> <20101202045728.GA19295@zim.MIT.EDU> Date: Wed, 1 Dec 2010 21:16:04 -0800 X-Google-Sender-Auth: xfMeC5F0YV4lQVR_LXivyl36v-o Message-ID: From: Garrett Cooper To: Kostik Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r209110 - in head/lib/msun: . src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 05:16:06 -0000 On Wed, Dec 1, 2010 at 8:57 PM, David Schultz wrote: > On Tue, Jun 15, 2010, David Schultz wrote: >> On Tue, Jun 15, 2010, Kostik Belousov wrote: >> > On Sat, Jun 12, 2010 at 05:32:05PM +0000, David Schultz wrote: >> > > Author: das >> > > Date: Sat Jun 12 17:32:05 2010 >> > > New Revision: 209110 >> > > URL: http://svn.freebsd.org/changeset/base/209110 >> > > >> > > Log: >> > > =A0 Introduce __isnanf() as an alias for isnanf(), and make the isna= n() >> > > =A0 macro expand to __isnanf() instead of isnanf() for float argumen= ts. >> > > =A0 This change is needed because isnanf() isn't declared in strict = POSIX >> > > =A0 or C99 mode. >> > > >> > > =A0 Compatibility note: Apps using isnan(float) that are compiled af= ter >> > > =A0 this change won't link against an older libm. >> > > >> > > =A0 Reported by: =A0 =A0Florian Forster >> > >> > May be, it makes sense to remove the default version for the isnan sym= bol ? >> >> Wouldn't this mean apps that use isnanf() directly will no longer >> compile? =A0isnanf() is a historical BSD interface, and although >> it's been deprecated for many years, it's still declared (if >> __BSD_VISIBLE). >> >> Oops, to complicate matters further, I just noticed that we >> already have isnanf and __isnanf symbols in libc, so maybe the new >> symbol isn't needed. =A0(isnan() and isnanf() are in libc because >> that's where they were historically.) =A0The second version in >> libm looks like a mistake (wrong scope of the #if 0 in s_isnan.c.) >> Perhaps we could just remove the duplicate symbols from libm. > > Any thoughts on removing the isnanf and __isnanf symbols from > libm? =A0Both symbols are already in libc for historical reasons, so > the duplication isn't needed. > > Although we've had the duplicate isnanf symbol in libm for several > releases, I don't believe removing it will cause problems; apps > will just pick up the libc version. =A0__isnanf is only present in > libm in 9-CURRENT (due to the commit referenced above). =A0Because > of symbol version differences, however, removing it will affect > apps that were linked under 9-CURRENT AND rely on isnanf AND link > against libm before libc. =A0On my system, libwebkit is the only > affected binary I could find. Yeah... it's going to be broken according to the manpage (manpage explicitly calls out -lm and math.h) and POSIX (POSIX only calls out math.h) as math.h lives in lib/msun for C apps: $ find /usr/src/ -name math.h /usr/src/contrib/libstdc++/include/tr1/math.h /usr/src/contrib/libstdc++/include/c_compatibility/math.h /usr/src/lib/msun/src/math.h So unless math.h is going to move to libc, I'd leave it alone if I was making the final call. Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 05:17:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3DF81065672; Thu, 2 Dec 2010 05:17:38 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id EEC238FC23; Thu, 2 Dec 2010 05:17:37 +0000 (UTC) Received: by wyf19 with SMTP id 19so7758376wyf.13 for ; Wed, 01 Dec 2010 21:17:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; bh=JfLC2HNSLpxs7WWGkUR7kMlN+7gKN4ONEudpMKxOuho=; b=Ubz6a5BVje8dM7zeqX65yq2YLJfpfnHOoR6uZHR4svoxvSq8SXGRCEwHrQfEi7JwR4 WrC7a/iIUwMgwMe334apEf0kyI10hT1ejrwYJluS/UKrSWsDy5AuPkDKXKwSEQjunChI ZyKMd0fju391INowwfzaFWFPwiX10bNomrpdI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=lnqxwDUIYhe+Uts5KiK+EXjl/wFTIFb9k6Opbau+Wsw2TzLS7jqDtnXz8txMfNkua/ jpBTZ6wt9PZxNYuM8ohKVbmz0A874Q/sTeUblLmy2KVX4Q0n1Eg3DqSHdO/m7EYTmg41 P+SH6kVXCVGyWNQavWsvLYbM05ICKeIwLJ35E= MIME-Version: 1.0 Received: by 10.216.82.197 with SMTP id o47mr2910922wee.45.1291267056252; Wed, 01 Dec 2010 21:17:36 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.198.27 with HTTP; Wed, 1 Dec 2010 21:17:36 -0800 (PST) In-Reply-To: References: <201006121732.o5CHW5Cs065722@svn.freebsd.org> <20100615084939.GL13238@deviant.kiev.zoral.com.ua> <20100615131443.GA93094@zim.MIT.EDU> <20101202045728.GA19295@zim.MIT.EDU> Date: Wed, 1 Dec 2010 21:17:36 -0800 X-Google-Sender-Auth: 39j35Hsq7nr8qujqKBVMzIn6x10 Message-ID: From: Garrett Cooper To: Kostik Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r209110 - in head/lib/msun: . src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 05:17:39 -0000 On Wed, Dec 1, 2010 at 9:16 PM, Garrett Cooper wrote: > On Wed, Dec 1, 2010 at 8:57 PM, David Schultz wrote: >> On Tue, Jun 15, 2010, David Schultz wrote: >>> On Tue, Jun 15, 2010, Kostik Belousov wrote: >>> > On Sat, Jun 12, 2010 at 05:32:05PM +0000, David Schultz wrote: >>> > > Author: das >>> > > Date: Sat Jun 12 17:32:05 2010 >>> > > New Revision: 209110 >>> > > URL: http://svn.freebsd.org/changeset/base/209110 >>> > > >>> > > Log: >>> > > =A0 Introduce __isnanf() as an alias for isnanf(), and make the isn= an() >>> > > =A0 macro expand to __isnanf() instead of isnanf() for float argume= nts. >>> > > =A0 This change is needed because isnanf() isn't declared in strict= POSIX >>> > > =A0 or C99 mode. >>> > > >>> > > =A0 Compatibility note: Apps using isnan(float) that are compiled a= fter >>> > > =A0 this change won't link against an older libm. >>> > > >>> > > =A0 Reported by: =A0 =A0Florian Forster >>> > >>> > May be, it makes sense to remove the default version for the isnan sy= mbol ? >>> >>> Wouldn't this mean apps that use isnanf() directly will no longer >>> compile? =A0isnanf() is a historical BSD interface, and although >>> it's been deprecated for many years, it's still declared (if >>> __BSD_VISIBLE). >>> >>> Oops, to complicate matters further, I just noticed that we >>> already have isnanf and __isnanf symbols in libc, so maybe the new >>> symbol isn't needed. =A0(isnan() and isnanf() are in libc because >>> that's where they were historically.) =A0The second version in >>> libm looks like a mistake (wrong scope of the #if 0 in s_isnan.c.) >>> Perhaps we could just remove the duplicate symbols from libm. >> >> Any thoughts on removing the isnanf and __isnanf symbols from >> libm? =A0Both symbols are already in libc for historical reasons, so >> the duplication isn't needed. >> >> Although we've had the duplicate isnanf symbol in libm for several >> releases, I don't believe removing it will cause problems; apps >> will just pick up the libc version. =A0__isnanf is only present in >> libm in 9-CURRENT (due to the commit referenced above). =A0Because >> of symbol version differences, however, removing it will affect >> apps that were linked under 9-CURRENT AND rely on isnanf AND link >> against libm before libc. =A0On my system, libwebkit is the only >> affected binary I could find. > > =A0 =A0Yeah... it's going to be broken according to the manpage (manpage > explicitly calls out -lm and math.h) and POSIX (POSIX only calls out > math.h) as math.h lives in lib/msun for C apps: > > $ find /usr/src/ -name math.h > /usr/src/contrib/libstdc++/include/tr1/math.h > /usr/src/contrib/libstdc++/include/c_compatibility/math.h > /usr/src/lib/msun/src/math.h > > =A0 =A0So unless math.h is going to move to libc, I'd leave it alone if I > was making the final call. Arg -- please ignore this email. I did another search and you said isnanf, not isnan. It's not mentioned anywhere in POSIX land or in any of our manpages. Sorry bout that, -Garrett From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 06:05:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D68B0106564A; Thu, 2 Dec 2010 06:05:44 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C260B8FC08; Thu, 2 Dec 2010 06:05:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB265ip8083555; Thu, 2 Dec 2010 06:05:44 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB265iKq083550; Thu, 2 Dec 2010 06:05:44 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201012020605.oB265iKq083550@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 2 Dec 2010 06:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216114 - in head/sys: modules/cc modules/cc/cc_cubic netinet/cc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 06:05:44 -0000 Author: lstewart Date: Thu Dec 2 06:05:44 2010 New Revision: 216114 URL: http://svn.freebsd.org/changeset/base/216114 Log: Import a clean-room implementation of the experimental CUBIC congestion control algorithm based on the Internet-Draft "draft-rhee-tcpm-cubic-02.txt". It is implemented as a kernel module compatible with the recently committed modular congestion control framework. CUBIC was designed for provide increased throughput in fast and long-distance networks. It attempts to maintain fairness when competing with legacy NewReno TCP in lower speed scenarios where NewReno is able to operate adequately. The paper "CUBIC: A New TCP-Friendly High-Speed TCP Variant" provides additional detail. In collaboration with: David Hayes and Grenville Armitage Sponsored by: FreeBSD Foundation Reviewed by: rpaulo (older patch from a few weeks ago) MFC after: 3 months Added: head/sys/modules/cc/cc_cubic/ head/sys/modules/cc/cc_cubic/Makefile (contents, props changed) head/sys/netinet/cc/cc_cubic.c (contents, props changed) head/sys/netinet/cc/cc_cubic.h (contents, props changed) Modified: head/sys/modules/cc/Makefile Modified: head/sys/modules/cc/Makefile ============================================================================== --- head/sys/modules/cc/Makefile Thu Dec 2 04:58:07 2010 (r216113) +++ head/sys/modules/cc/Makefile Thu Dec 2 06:05:44 2010 (r216114) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= +SUBDIR= cc_cubic .include Added: head/sys/modules/cc/cc_cubic/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/cc/cc_cubic/Makefile Thu Dec 2 06:05:44 2010 (r216114) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.include + +.PATH: ${.CURDIR}/../../../netinet/cc +KMOD= cc_cubic +SRCS= cc_cubic.c + +.include Added: head/sys/netinet/cc/cc_cubic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/cc/cc_cubic.c Thu Dec 2 06:05:44 2010 (r216114) @@ -0,0 +1,396 @@ +/*- + * Copyright (c) 2008-2010 Lawrence Stewart + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Lawrence Stewart while studying at the Centre + * for Advanced Internet Architectures, Swinburne University, made possible in + * part by a grant from the Cisco University Research Program Fund at Community + * Foundation Silicon Valley. + * + * Portions of this software were developed at the Centre for Advanced + * Internet Architectures, Swinburne University of Technology, Melbourne, + * Australia by David Hayes 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. + */ + +/* + * An implementation of the CUBIC congestion control algorithm for FreeBSD, + * based on the Internet Draft "draft-rhee-tcpm-cubic-02" by Rhee, Xu and Ha. + * Originally released as part of the NewTCP research project at Swinburne + * University's Centre for Advanced Internet Architectures, Melbourne, + * Australia, which was made possible in part by a grant from the Cisco + * University Research Program Fund at Community Foundation Silicon Valley. More + * details are available at: + * http://caia.swin.edu.au/urp/newtcp/ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +static void cubic_ack_received(struct cc_var *ccv, uint16_t type); +static void cubic_cb_destroy(struct cc_var *ccv); +static int cubic_cb_init(struct cc_var *ccv); +static void cubic_cong_signal(struct cc_var *ccv, uint32_t type); +static void cubic_conn_init(struct cc_var *ccv); +static int cubic_mod_init(void); +static void cubic_post_recovery(struct cc_var *ccv); +static void cubic_record_rtt(struct cc_var *ccv); +static void cubic_ssthresh_update(struct cc_var *ccv); + +struct cubic { + /* Cubic K in fixed point form with CUBIC_SHIFT worth of precision. */ + int64_t K; + /* Sum of RTT samples across an epoch in ticks. */ + int64_t sum_rtt_ticks; + /* cwnd at the most recent congestion event. */ + unsigned long max_cwnd; + /* cwnd at the previous congestion event. */ + unsigned long prev_max_cwnd; + /* Number of congestion events. */ + uint32_t num_cong_events; + /* Minimum observed rtt in ticks. */ + int min_rtt_ticks; + /* Mean observed rtt between congestion epochs. */ + int mean_rtt_ticks; + /* ACKs since last congestion event. */ + int epoch_ack_count; + /* Time of last congestion event in ticks. */ + int t_last_cong; +}; + +MALLOC_DECLARE(M_CUBIC); +MALLOC_DEFINE(M_CUBIC, "cubic data", + "Per connection data required for the CUBIC congestion control algorithm"); + +struct cc_algo cubic_cc_algo = { + .name = "cubic", + .ack_received = cubic_ack_received, + .cb_destroy = cubic_cb_destroy, + .cb_init = cubic_cb_init, + .cong_signal = cubic_cong_signal, + .conn_init = cubic_conn_init, + .mod_init = cubic_mod_init, + .post_recovery = cubic_post_recovery, +}; + +static void +cubic_ack_received(struct cc_var *ccv, uint16_t type) +{ + struct cubic *cubic_data; + unsigned long w_tf, w_cubic_next; + int ticks_since_cong; + + cubic_data = ccv->cc_data; + cubic_record_rtt(ccv); + + /* + * Regular ACK and we're not in cong/fast recovery and we're cwnd + * limited and we're either not doing ABC or are slow starting or are + * doing ABC and we've sent a cwnd's worth of bytes. + */ + if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && + (ccv->flags & CCF_CWND_LIMITED) && (!V_tcp_do_rfc3465 || + CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh) || + (V_tcp_do_rfc3465 && ccv->flags & CCF_ABC_SENTAWND))) { + /* Use the logic in NewReno ack_received() for slow start. */ + if (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh) || + cubic_data->min_rtt_ticks == TCPTV_SRTTBASE) + newreno_cc_algo.ack_received(ccv, type); + else { + ticks_since_cong = ticks - cubic_data->t_last_cong; + + /* + * The mean RTT is used to best reflect the equations in + * the I-D. Using min_rtt in the tf_cwnd calculation + * causes w_tf to grow much faster than it should if the + * RTT is dominated by network buffering rather than + * propogation delay. + */ + w_tf = tf_cwnd(ticks_since_cong, + cubic_data->mean_rtt_ticks, cubic_data->max_cwnd, + CCV(ccv, t_maxseg)); + + w_cubic_next = cubic_cwnd(ticks_since_cong + + cubic_data->mean_rtt_ticks, cubic_data->max_cwnd, + CCV(ccv, t_maxseg), cubic_data->K); + + ccv->flags &= ~CCF_ABC_SENTAWND; + + if (w_cubic_next < w_tf) + /* + * TCP-friendly region, follow tf + * cwnd growth. + */ + CCV(ccv, snd_cwnd) = w_tf; + + else if (CCV(ccv, snd_cwnd) < w_cubic_next) { + /* + * Concave or convex region, follow CUBIC + * cwnd growth. + */ + if (V_tcp_do_rfc3465) + CCV(ccv, snd_cwnd) = w_cubic_next; + else + CCV(ccv, snd_cwnd) += ((w_cubic_next - + CCV(ccv, snd_cwnd)) * + CCV(ccv, t_maxseg)) / + CCV(ccv, snd_cwnd); + } + + /* + * If we're not in slow start and we're probing for a + * new cwnd limit at the start of a connection + * (happens when hostcache has a relevant entry), + * keep updating our current estimate of the + * max_cwnd. + */ + if (cubic_data->num_cong_events == 0 && + cubic_data->max_cwnd < CCV(ccv, snd_cwnd)) + cubic_data->max_cwnd = CCV(ccv, snd_cwnd); + } + } +} + +static void +cubic_cb_destroy(struct cc_var *ccv) +{ + + if (ccv->cc_data != NULL) + free(ccv->cc_data, M_CUBIC); +} + +static int +cubic_cb_init(struct cc_var *ccv) +{ + struct cubic *cubic_data; + + cubic_data = malloc(sizeof(struct cubic), M_CUBIC, M_NOWAIT|M_ZERO); + + if (cubic_data == NULL) + return (ENOMEM); + + /* Init some key variables with sensible defaults. */ + cubic_data->t_last_cong = ticks; + cubic_data->min_rtt_ticks = TCPTV_SRTTBASE; + cubic_data->mean_rtt_ticks = TCPTV_SRTTBASE; + + ccv->cc_data = cubic_data; + + return (0); +} + +/* + * Perform any necessary tasks before we enter congestion recovery. + */ +static void +cubic_cong_signal(struct cc_var *ccv, uint32_t type) +{ + struct cubic *cubic_data; + + cubic_data = ccv->cc_data; + + switch (type) { + case CC_NDUPACK: + if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { + if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { + cubic_ssthresh_update(ccv); + cubic_data->num_cong_events++; + cubic_data->prev_max_cwnd = cubic_data->max_cwnd; + cubic_data->max_cwnd = CCV(ccv, snd_cwnd); + } + ENTER_RECOVERY(CCV(ccv, t_flags)); + } + break; + + case CC_ECN: + if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { + cubic_ssthresh_update(ccv); + cubic_data->num_cong_events++; + cubic_data->prev_max_cwnd = cubic_data->max_cwnd; + cubic_data->max_cwnd = CCV(ccv, snd_cwnd); + cubic_data->t_last_cong = ticks; + CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); + ENTER_CONGRECOVERY(CCV(ccv, t_flags)); + } + break; + + case CC_RTO: + /* + * Grab the current time and record it so we know when the + * most recent congestion event was. Only record it when the + * timeout has fired more than once, as there is a reasonable + * chance the first one is a false alarm and may not indicate + * congestion. + */ + if (CCV(ccv, t_rxtshift) >= 2) + cubic_data->num_cong_events++; + cubic_data->t_last_cong = ticks; + break; + } +} + +static void +cubic_conn_init(struct cc_var *ccv) +{ + struct cubic *cubic_data; + + cubic_data = ccv->cc_data; + + /* + * Ensure we have a sane initial value for max_cwnd recorded. Without + * this here bad things happen when entries from the TCP hostcache + * get used. + */ + cubic_data->max_cwnd = CCV(ccv, snd_cwnd); +} + +static int +cubic_mod_init(void) +{ + + cubic_cc_algo.after_idle = newreno_cc_algo.after_idle; + + return (0); +} + +/* + * Perform any necessary tasks before we exit congestion recovery. + */ +static void +cubic_post_recovery(struct cc_var *ccv) +{ + struct cubic *cubic_data; + + cubic_data = ccv->cc_data; + + /* Fast convergence heuristic. */ + if (cubic_data->max_cwnd < cubic_data->prev_max_cwnd) + cubic_data->max_cwnd = (cubic_data->max_cwnd * CUBIC_FC_FACTOR) + >> CUBIC_SHIFT; + + if (IN_FASTRECOVERY(CCV(ccv, t_flags))) { + /* + * If inflight data is less than ssthresh, set cwnd + * conservatively to avoid a burst of data, as suggested in + * the NewReno RFC. Otherwise, use the CUBIC method. + * + * XXXLAS: Find a way to do this without needing curack + */ + if (SEQ_GT(ccv->curack + CCV(ccv, snd_ssthresh), + CCV(ccv, snd_max))) + CCV(ccv, snd_cwnd) = CCV(ccv, snd_max) - ccv->curack + + CCV(ccv, t_maxseg); + else + /* Update cwnd based on beta and adjusted max_cwnd. */ + CCV(ccv, snd_cwnd) = max(1, ((CUBIC_BETA * + cubic_data->max_cwnd) >> CUBIC_SHIFT)); + } + cubic_data->t_last_cong = ticks; + + /* Calculate the average RTT between congestion epochs. */ + if (cubic_data->epoch_ack_count > 0 && cubic_data->sum_rtt_ticks > 0) + cubic_data->mean_rtt_ticks = (int)(cubic_data->sum_rtt_ticks / + cubic_data->epoch_ack_count); + else + /* For safety. */ + cubic_data->mean_rtt_ticks = cubic_data->min_rtt_ticks; + + cubic_data->epoch_ack_count = 0; + cubic_data->sum_rtt_ticks = 0; + cubic_data->K = cubic_k(cubic_data->max_cwnd / CCV(ccv, t_maxseg)); +} + +/* + * Record the min RTT and sum samples for the epoch average RTT calculation. + */ +static void +cubic_record_rtt(struct cc_var *ccv) +{ + struct cubic *cubic_data; + int t_srtt_ticks; + + /* Ignore srtt until a min number of samples have been taken. */ + if (CCV(ccv, t_rttupdated) >= CUBIC_MIN_RTT_SAMPLES) { + cubic_data = ccv->cc_data; + t_srtt_ticks = CCV(ccv, t_srtt) / TCP_RTT_SCALE; + + /* + * Record the current SRTT as our minrtt if it's the smallest + * we've seen or minrtt is currently equal to its initialised + * value. + * + * XXXLAS: Should there be some hysteresis for minrtt? + */ + if ((t_srtt_ticks < cubic_data->min_rtt_ticks || + cubic_data->min_rtt_ticks == TCPTV_SRTTBASE)) + cubic_data->min_rtt_ticks = max(1, t_srtt_ticks); + + /* Sum samples for epoch average RTT calculation. */ + cubic_data->sum_rtt_ticks += t_srtt_ticks; + cubic_data->epoch_ack_count++; + } +} + +/* + * Update the ssthresh in the event of congestion. + */ +static void +cubic_ssthresh_update(struct cc_var *ccv) +{ + struct cubic *cubic_data; + + cubic_data = ccv->cc_data; + + /* + * On the first congestion event, set ssthresh to cwnd * 0.5, on + * subsequent congestion events, set it to cwnd * beta. + */ + if (cubic_data->num_cong_events == 0) + CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd) >> 1; + else + CCV(ccv, snd_ssthresh) = (CCV(ccv, snd_cwnd) * CUBIC_BETA) + >> CUBIC_SHIFT; +} + + +DECLARE_CC_MODULE(cubic, &cubic_cc_algo); Added: head/sys/netinet/cc/cc_cubic.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/cc/cc_cubic.h Thu Dec 2 06:05:44 2010 (r216114) @@ -0,0 +1,229 @@ +/*- + * Copyright (c) 2008-2010 Lawrence Stewart + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Lawrence Stewart while studying at the Centre + * for Advanced Internet Architectures, Swinburne University, made possible in + * part by a grant from the Cisco University Research Program Fund at Community + * Foundation Silicon Valley. + * + * Portions of this software were developed at the Centre for Advanced + * Internet Architectures, Swinburne University of Technology, Melbourne, + * Australia by David Hayes 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. + * + * $FreeBSD$ + */ + +#ifndef _NETINET_CC_CUBIC_H_ +#define _NETINET_CC_CUBIC_H_ + +/* Number of bits of precision for fixed point math calcs. */ +#define CUBIC_SHIFT 8 + +#define CUBIC_SHIFT_4 32 + +/* 0.5 << CUBIC_SHIFT. */ +#define RENO_BETA 128 + +/* ~0.8 << CUBIC_SHIFT. */ +#define CUBIC_BETA 204 + +/* ~0.2 << CUBIC_SHIFT. */ +#define ONE_SUB_CUBIC_BETA 51 + +/* 3 * ONE_SUB_CUBIC_BETA. */ +#define THREE_X_PT2 153 + +/* (2 << CUBIC_SHIFT) - ONE_SUB_CUBIC_BETA. */ +#define TWO_SUB_PT2 461 + +/* ~0.4 << CUBIC_SHIFT. */ +#define CUBIC_C_FACTOR 102 + +/* CUBIC fast convergence factor: ~0.9 << CUBIC_SHIFT. */ +#define CUBIC_FC_FACTOR 230 + +/* Don't trust s_rtt until this many rtt samples have been taken. */ +#define CUBIC_MIN_RTT_SAMPLES 8 + +/* Userland only bits. */ +#ifndef _KERNEL + +extern int hz; + +/* + * Implementation based on the formulae found in the CUBIC Internet Draft + * "draft-rhee-tcpm-cubic-02". + * + * Note BETA used in cc_cubic is equal to (1-beta) in the I-D + */ + +static __inline float +theoretical_cubic_k(double wmax_pkts) +{ + double C; + + C = 0.4; + + return (pow((wmax_pkts * 0.2) / C, (1.0 / 3.0)) * pow(2, CUBIC_SHIFT)); +} + +static __inline unsigned long +theoretical_cubic_cwnd(int ticks_since_cong, unsigned long wmax, uint32_t smss) +{ + double C, wmax_pkts; + + C = 0.4; + wmax_pkts = wmax / (double)smss; + + return (smss * (wmax_pkts + + (C * pow(ticks_since_cong / (double)hz - + theoretical_cubic_k(wmax_pkts) / pow(2, CUBIC_SHIFT), 3.0)))); +} + +static __inline unsigned long +theoretical_reno_cwnd(int ticks_since_cong, int rtt_ticks, unsigned long wmax, + uint32_t smss) +{ + + return ((wmax * 0.5) + ((ticks_since_cong / (float)rtt_ticks) * smss)); +} + +static __inline unsigned long +theoretical_tf_cwnd(int ticks_since_cong, int rtt_ticks, unsigned long wmax, + uint32_t smss) +{ + + return ((wmax * 0.8) + ((3 * 0.2) / (2 - 0.2) * + (ticks_since_cong / (float)rtt_ticks) * smss)); +} + +#endif /* !_KERNEL */ + +/* + * Compute the CUBIC K value used in the cwnd calculation, using an + * implementation of eqn 2 in the I-D. The method used + * here is adapted from Apple Computer Technical Report #KT-32. + */ +static __inline int64_t +cubic_k(unsigned long wmax_pkts) +{ + int64_t s, K; + uint16_t p; + + K = s = 0; + p = 0; + + /* (wmax * beta)/C with CUBIC_SHIFT worth of precision. */ + s = ((wmax_pkts * ONE_SUB_CUBIC_BETA) << CUBIC_SHIFT) / CUBIC_C_FACTOR; + + /* Rebase s to be between 1 and 1/8 with a shift of CUBIC_SHIFT. */ + while (s >= 256) { + s >>= 3; + p++; + } + + /* + * Some magic constants taken from the Apple TR with appropriate + * shifts: 275 == 1.072302 << CUBIC_SHIFT, 98 == 0.3812513 << + * CUBIC_SHIFT, 120 == 0.46946116 << CUBIC_SHIFT. + */ + K = (((s * 275) >> CUBIC_SHIFT) + 98) - + (((s * s * 120) >> CUBIC_SHIFT) >> CUBIC_SHIFT); + + /* Multiply by 2^p to undo the rebasing of s from above. */ + return (K <<= p); +} + +/* + * Compute the new cwnd value using an implementation of eqn 1 from the I-D. + * Thanks to Kip Macy for help debugging this function. + * + * XXXLAS: Characterise bounds for overflow. + */ +static __inline unsigned long +cubic_cwnd(int ticks_since_cong, unsigned long wmax, uint32_t smss, int64_t K) +{ + int64_t cwnd; + + /* K is in fixed point form with CUBIC_SHIFT worth of precision. */ + + /* t - K, with CUBIC_SHIFT worth of precision. */ + cwnd = ((int64_t)(ticks_since_cong << CUBIC_SHIFT) - (K * hz)) / hz; + + /* (t - K)^3, with CUBIC_SHIFT^3 worth of precision. */ + cwnd *= (cwnd * cwnd); + + /* + * C(t - K)^3 + wmax + * The down shift by CUBIC_SHIFT_4 is because cwnd has 4 lots of + * CUBIC_SHIFT included in the value. 3 from the cubing of cwnd above, + * and an extra from multiplying through by CUBIC_C_FACTOR. + */ + cwnd = ((cwnd * CUBIC_C_FACTOR * smss) >> CUBIC_SHIFT_4) + wmax; + + return ((unsigned long)cwnd); +} + +/* + * Compute an approximation of the NewReno cwnd some number of ticks after a + * congestion event. RTT should be the average RTT estimate for the path + * measured over the previous congestion epoch and wmax is the value of cwnd at + * the last congestion event. The "TCP friendly" concept in the CUBIC I-D is + * rather tricky to understand and it turns out this function is not required. + * It is left here for reference. + */ +static __inline unsigned long +reno_cwnd(int ticks_since_cong, int rtt_ticks, unsigned long wmax, + uint32_t smss) +{ + + /* + * For NewReno, beta = 0.5, therefore: W_tcp(t) = wmax*0.5 + t/RTT + * W_tcp(t) deals with cwnd/wmax in pkts, so because our cwnd is in + * bytes, we have to multiply by smss. + */ + return (((wmax * RENO_BETA) + (((ticks_since_cong * smss) + << CUBIC_SHIFT) / rtt_ticks)) >> CUBIC_SHIFT); +} + +/* + * Compute an approximation of the "TCP friendly" cwnd some number of ticks + * after a congestion event that is designed to yield the same average cwnd as + * NewReno while using CUBIC's beta of 0.8. RTT should be the average RTT + * estimate for the path measured over the previous congestion epoch and wmax is + * the value of cwnd at the last congestion event. + */ +static __inline unsigned long +tf_cwnd(int ticks_since_cong, int rtt_ticks, unsigned long wmax, + uint32_t smss) +{ + + /* Equation 4 of I-D. */ + return (((wmax * CUBIC_BETA) + (((THREE_X_PT2 * ticks_since_cong * + smss) << CUBIC_SHIFT) / TWO_SUB_PT2 / rtt_ticks)) >> CUBIC_SHIFT); +} + +#endif /* _NETINET_CC_CUBIC_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 06:40:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8DF41065675; Thu, 2 Dec 2010 06:40:21 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94D1C8FC1D; Thu, 2 Dec 2010 06:40:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB26eLrQ085664; Thu, 2 Dec 2010 06:40:21 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB26eLsV085660; Thu, 2 Dec 2010 06:40:21 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201012020640.oB26eLsV085660@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 2 Dec 2010 06:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216115 - in head/sys: modules/cc modules/cc/cc_htcp netinet/cc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 06:40:21 -0000 Author: lstewart Date: Thu Dec 2 06:40:21 2010 New Revision: 216115 URL: http://svn.freebsd.org/changeset/base/216115 Log: Import a clean-room implementation of the experimental H-TCP congestion control algorithm based on the Internet-Draft "draft-leith-tcp-htcp-06.txt". It is implemented as a kernel module compatible with the recently committed modular congestion control framework. H-TCP was designed to provide increased throughput in fast and long-distance networks. It attempts to maintain fairness when competing with legacy NewReno TCP in lower speed scenarios where NewReno is able to operate adequately. The paper "H-TCP: A framework for congestion control in high-speed and long-distance networks" provides additional detail. In collaboration with: David Hayes and Grenville Armitage Sponsored by: FreeBSD Foundation Reviewed by: rpaulo (older patch from a few weeks ago) MFC after: 3 months Added: head/sys/modules/cc/cc_htcp/ head/sys/modules/cc/cc_htcp/Makefile (contents, props changed) head/sys/netinet/cc/cc_htcp.c (contents, props changed) Modified: head/sys/modules/cc/Makefile Modified: head/sys/modules/cc/Makefile ============================================================================== --- head/sys/modules/cc/Makefile Thu Dec 2 06:05:44 2010 (r216114) +++ head/sys/modules/cc/Makefile Thu Dec 2 06:40:21 2010 (r216115) @@ -1,5 +1,6 @@ # $FreeBSD$ -SUBDIR= cc_cubic +SUBDIR= cc_cubic \ + cc_htcp .include Added: head/sys/modules/cc/cc_htcp/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/cc/cc_htcp/Makefile Thu Dec 2 06:40:21 2010 (r216115) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.include + +.PATH: ${.CURDIR}/../../../netinet/cc +KMOD= cc_htcp +SRCS= cc_htcp.c + +.include Added: head/sys/netinet/cc/cc_htcp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/cc/cc_htcp.c Thu Dec 2 06:40:21 2010 (r216115) @@ -0,0 +1,521 @@ +/*- + * Copyright (c) 2007-2008 + * Swinburne University of Technology, Melbourne, Australia + * Copyright (c) 2009-2010 Lawrence Stewart + * Copyright (c) 2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed at the Centre for Advanced Internet + * Architectures, Swinburne University, by Lawrence Stewart and James Healy, + * made possible in part by a grant from the Cisco University Research Program + * Fund at Community Foundation Silicon Valley. + * + * Portions of this software were developed at the Centre for Advanced + * Internet Architectures, Swinburne University of Technology, Melbourne, + * Australia by David Hayes 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. + */ + +/* + * An implementation of the H-TCP congestion control algorithm for FreeBSD, + * based on the Internet Draft "draft-leith-tcp-htcp-06.txt" by Leith and + * Shorten. Originally released as part of the NewTCP research project at + * Swinburne University's Centre for Advanced Internet Architectures, Melbourne, + * Australia, which was made possible in part by a grant from the Cisco + * University Research Program Fund at Community Foundation Silicon Valley. More + * details are available at: + * http://caia.swin.edu.au/urp/newtcp/ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +/* Fixed point math shifts. */ +#define HTCP_SHIFT 8 +#define HTCP_ALPHA_INC_SHIFT 4 + +#define HTCP_INIT_ALPHA 1 +#define HTCP_DELTA_L hz /* 1 sec in ticks. */ +#define HTCP_MINBETA 128 /* 0.5 << HTCP_SHIFT. */ +#define HTCP_MAXBETA 204 /* ~0.8 << HTCP_SHIFT. */ +#define HTCP_MINROWE 26 /* ~0.1 << HTCP_SHIFT. */ +#define HTCP_MAXROWE 512 /* 2 << HTCP_SHIFT. */ + +/* RTT_ref (ms) used in the calculation of alpha if RTT scaling is enabled. */ +#define HTCP_RTT_REF 100 + +/* Don't trust SRTT until this many samples have been taken. */ +#define HTCP_MIN_RTT_SAMPLES 8 + +/* + * HTCP_CALC_ALPHA performs a fixed point math calculation to determine the + * value of alpha, based on the function defined in the HTCP spec. + * + * i.e. 1 + 10(delta - delta_l) + ((delta - delta_l) / 2) ^ 2 + * + * "diff" is passed in to the macro as "delta - delta_l" and is expected to be + * in units of ticks. + * + * The joyousnous of fixed point maths means our function implementation looks a + * little funky... + * + * In order to maintain some precision in the calculations, a fixed point shift + * HTCP_ALPHA_INC_SHIFT is used to ensure the integer divisions don't + * truncate the results too badly. + * + * The "16" value is the "1" term in the alpha function shifted up by + * HTCP_ALPHA_INC_SHIFT + * + * The "160" value is the "10" multiplier in the alpha function multiplied by + * 2^HTCP_ALPHA_INC_SHIFT + * + * Specifying these as constants reduces the computations required. After + * up-shifting all the terms in the function and performing the required + * calculations, we down-shift the final result by HTCP_ALPHA_INC_SHIFT to + * ensure it is back in the correct range. + * + * The "hz" terms are required as kernels can be configured to run with + * different tick timers, which we have to adjust for in the alpha calculation + * (which originally was defined in terms of seconds). + * + * We also have to be careful to constrain the value of diff such that it won't + * overflow whilst performing the calculation. The middle term i.e. (160 * diff) + * / hz is the limiting factor in the calculation. We must constrain diff to be + * less than the max size of an int divided by the constant 160 figure + * i.e. diff < INT_MAX / 160 + * + * NB: Changing HTCP_ALPHA_INC_SHIFT will require you to MANUALLY update the + * constants used in this function! + */ +#define HTCP_CALC_ALPHA(diff) \ +((\ + (16) + \ + ((160 * (diff)) / hz) + \ + (((diff) / hz) * (((diff) << HTCP_ALPHA_INC_SHIFT) / (4 * hz))) \ +) >> HTCP_ALPHA_INC_SHIFT) + +static void htcp_ack_received(struct cc_var *ccv, uint16_t type); +static void htcp_cb_destroy(struct cc_var *ccv); +static int htcp_cb_init(struct cc_var *ccv); +static void htcp_cong_signal(struct cc_var *ccv, uint32_t type); +static int htcp_mod_init(void); +static void htcp_post_recovery(struct cc_var *ccv); +static void htcp_recalc_alpha(struct cc_var *ccv); +static void htcp_recalc_beta(struct cc_var *ccv); +static void htcp_record_rtt(struct cc_var *ccv); +static void htcp_ssthresh_update(struct cc_var *ccv); + +struct htcp { + /* cwnd before entering cong recovery. */ + unsigned long prev_cwnd; + /* cwnd additive increase parameter. */ + int alpha; + /* cwnd multiplicative decrease parameter. */ + int beta; + /* Largest rtt seen for the flow. */ + int maxrtt; + /* Shortest rtt seen for the flow. */ + int minrtt; + /* Time of last congestion event in ticks. */ + int t_last_cong; +}; + +static int htcp_rtt_ref; +/* + * The maximum number of ticks the value of diff can reach in + * htcp_recalc_alpha() before alpha will stop increasing due to overflow. + * See comment above HTCP_CALC_ALPHA for more info. + */ +static int htcp_max_diff = INT_MAX / ((1 << HTCP_ALPHA_INC_SHIFT) * 10); + +/* Per-netstack vars. */ +static VNET_DEFINE(uint8_t, htcp_adaptive_backoff) = 0; +static VNET_DEFINE(uint8_t, htcp_rtt_scaling) = 0; +#define V_htcp_adaptive_backoff VNET(htcp_adaptive_backoff) +#define V_htcp_rtt_scaling VNET(htcp_rtt_scaling) + +MALLOC_DECLARE(M_HTCP); +MALLOC_DEFINE(M_HTCP, "htcp data", + "Per connection data required for the HTCP congestion control algorithm"); + +struct cc_algo htcp_cc_algo = { + .name = "htcp", + .ack_received = htcp_ack_received, + .cb_destroy = htcp_cb_destroy, + .cb_init = htcp_cb_init, + .cong_signal = htcp_cong_signal, + .mod_init = htcp_mod_init, + .post_recovery = htcp_post_recovery, +}; + +static void +htcp_ack_received(struct cc_var *ccv, uint16_t type) +{ + struct htcp *htcp_data; + + htcp_data = ccv->cc_data; + htcp_record_rtt(ccv); + + /* + * Regular ACK and we're not in cong/fast recovery and we're cwnd + * limited and we're either not doing ABC or are slow starting or are + * doing ABC and we've sent a cwnd's worth of bytes. + */ + if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && + (ccv->flags & CCF_CWND_LIMITED) && (!V_tcp_do_rfc3465 || + CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh) || + (V_tcp_do_rfc3465 && ccv->flags & CCF_ABC_SENTAWND))) { + htcp_recalc_beta(ccv); + htcp_recalc_alpha(ccv); + /* + * Use the logic in NewReno ack_received() for slow start and + * for the first HTCP_DELTA_L ticks after either the flow starts + * or a congestion event (when alpha equals 1). + */ + if (htcp_data->alpha == 1 || + CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh)) + newreno_cc_algo.ack_received(ccv, type); + else { + if (V_tcp_do_rfc3465) { + /* Increment cwnd by alpha segments. */ + CCV(ccv, snd_cwnd) += htcp_data->alpha * + CCV(ccv, t_maxseg); + ccv->flags &= ~CCF_ABC_SENTAWND; + } else + /* + * Increment cwnd by alpha/cwnd segments to + * approximate an increase of alpha segments + * per RTT. + */ + CCV(ccv, snd_cwnd) += (((htcp_data->alpha << + HTCP_SHIFT) / (CCV(ccv, snd_cwnd) / + CCV(ccv, t_maxseg))) * CCV(ccv, t_maxseg)) + >> HTCP_SHIFT; + } + } +} + +static void +htcp_cb_destroy(struct cc_var *ccv) +{ + + if (ccv->cc_data != NULL) + free(ccv->cc_data, M_HTCP); +} + +static int +htcp_cb_init(struct cc_var *ccv) +{ + struct htcp *htcp_data; + + htcp_data = malloc(sizeof(struct htcp), M_HTCP, M_NOWAIT); + + if (htcp_data == NULL) + return (ENOMEM); + + /* Init some key variables with sensible defaults. */ + htcp_data->alpha = HTCP_INIT_ALPHA; + htcp_data->beta = HTCP_MINBETA; + htcp_data->maxrtt = TCPTV_SRTTBASE; + htcp_data->minrtt = TCPTV_SRTTBASE; + htcp_data->prev_cwnd = 0; + htcp_data->t_last_cong = ticks; + + ccv->cc_data = htcp_data; + + return (0); +} + +/* + * Perform any necessary tasks before we enter congestion recovery. + */ +static void +htcp_cong_signal(struct cc_var *ccv, uint32_t type) +{ + struct htcp *htcp_data; + + htcp_data = ccv->cc_data; + + switch (type) { + case CC_NDUPACK: + if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { + if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { + /* + * Apply hysteresis to maxrtt to ensure + * reductions in the RTT are reflected in our + * measurements. + */ + htcp_data->maxrtt = (htcp_data->minrtt + + (htcp_data->maxrtt - htcp_data->minrtt) * + 95) / 100; + htcp_ssthresh_update(ccv); + htcp_data->t_last_cong = ticks; + htcp_data->prev_cwnd = CCV(ccv, snd_cwnd); + } + ENTER_RECOVERY(CCV(ccv, t_flags)); + } + break; + + case CC_ECN: + if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { + /* + * Apply hysteresis to maxrtt to ensure reductions in + * the RTT are reflected in our measurements. + */ + htcp_data->maxrtt = (htcp_data->minrtt + (htcp_data->maxrtt - + htcp_data->minrtt) * 95) / 100; + htcp_ssthresh_update(ccv); + CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); + htcp_data->t_last_cong = ticks; + htcp_data->prev_cwnd = CCV(ccv, snd_cwnd); + ENTER_CONGRECOVERY(CCV(ccv, t_flags)); + } + break; + + case CC_RTO: + /* + * Grab the current time and record it so we know when the + * most recent congestion event was. Only record it when the + * timeout has fired more than once, as there is a reasonable + * chance the first one is a false alarm and may not indicate + * congestion. + */ + if (CCV(ccv, t_rxtshift) >= 2) + htcp_data->t_last_cong = ticks; + break; + } +} + +static int +htcp_mod_init(void) +{ + + htcp_cc_algo.after_idle = newreno_cc_algo.after_idle; + + /* + * HTCP_RTT_REF is defined in ms, and t_srtt in the tcpcb is stored in + * units of TCP_RTT_SCALE*hz. Scale HTCP_RTT_REF to be in the same units + * as t_srtt. + */ + htcp_rtt_ref = (HTCP_RTT_REF * TCP_RTT_SCALE * hz) / 1000; + + return (0); +} + +/* + * Perform any necessary tasks before we exit congestion recovery. + */ +static void +htcp_post_recovery(struct cc_var *ccv) +{ + struct htcp *htcp_data; + + htcp_data = ccv->cc_data; + + if (IN_FASTRECOVERY(CCV(ccv, t_flags))) { + /* + * If inflight data is less than ssthresh, set cwnd + * conservatively to avoid a burst of data, as suggested in the + * NewReno RFC. Otherwise, use the HTCP method. + * + * XXXLAS: Find a way to do this without needing curack + */ + if (SEQ_GT(ccv->curack + CCV(ccv, snd_ssthresh), + CCV(ccv, snd_max))) + CCV(ccv, snd_cwnd) = CCV(ccv, snd_max) - ccv->curack + + CCV(ccv, t_maxseg); + else + CCV(ccv, snd_cwnd) = max(1, ((htcp_data->beta * + htcp_data->prev_cwnd / CCV(ccv, t_maxseg)) + >> HTCP_SHIFT)) * CCV(ccv, t_maxseg); + } +} + +static void +htcp_recalc_alpha(struct cc_var *ccv) +{ + struct htcp *htcp_data; + int alpha, diff, now; + + htcp_data = ccv->cc_data; + now = ticks; + + /* + * If ticks has wrapped around (will happen approximately once every 49 + * days on a machine with the default kern.hz=1000) and a flow straddles + * the wrap point, our alpha calcs will be completely wrong. We cut our + * losses and restart alpha from scratch by setting t_last_cong = now - + * HTCP_DELTA_L. + * + * This does not deflate our cwnd at all. It simply slows the rate cwnd + * is growing by until alpha regains the value it held prior to taking + * this drastic measure. + */ + if (now < htcp_data->t_last_cong) + htcp_data->t_last_cong = now - HTCP_DELTA_L; + + diff = now - htcp_data->t_last_cong - HTCP_DELTA_L; + + /* Cap alpha if the value of diff would overflow HTCP_CALC_ALPHA(). */ + if (diff < htcp_max_diff) { + /* + * If it has been more than HTCP_DELTA_L ticks since congestion, + * increase alpha according to the function defined in the spec. + */ + if (diff > 0) { + alpha = HTCP_CALC_ALPHA(diff); + + /* + * Adaptive backoff fairness adjustment: + * 2 * (1 - beta) * alpha_raw + */ + if (V_htcp_adaptive_backoff) + alpha = max(1, (2 * ((1 << HTCP_SHIFT) - + htcp_data->beta) * alpha) >> HTCP_SHIFT); + + /* + * RTT scaling: (RTT / RTT_ref) * alpha + * alpha will be the raw value from HTCP_CALC_ALPHA() if + * adaptive backoff is off, or the adjusted value if + * adaptive backoff is on. + */ + if (V_htcp_rtt_scaling) + alpha = max(1, (min(max(HTCP_MINROWE, + (CCV(ccv, t_srtt) << HTCP_SHIFT) / + htcp_rtt_ref), HTCP_MAXROWE) * alpha) + >> HTCP_SHIFT); + + } else + alpha = 1; + + htcp_data->alpha = alpha; + } +} + +static void +htcp_recalc_beta(struct cc_var *ccv) +{ + struct htcp *htcp_data; + + htcp_data = ccv->cc_data; + + /* + * TCPTV_SRTTBASE is the initialised value of each connection's SRTT, so + * we only calc beta if the connection's SRTT has been changed from its + * inital value. beta is bounded to ensure it is always between + * HTCP_MINBETA and HTCP_MAXBETA. + */ + if (V_htcp_adaptive_backoff && htcp_data->minrtt != TCPTV_SRTTBASE && + htcp_data->maxrtt != TCPTV_SRTTBASE) + htcp_data->beta = min(max(HTCP_MINBETA, + (htcp_data->minrtt << HTCP_SHIFT) / htcp_data->maxrtt), + HTCP_MAXBETA); + else + htcp_data->beta = HTCP_MINBETA; +} + +/* + * Record the minimum and maximum RTT seen for the connection. These are used in + * the calculation of beta if adaptive backoff is enabled. + */ +static void +htcp_record_rtt(struct cc_var *ccv) +{ + struct htcp *htcp_data; + + htcp_data = ccv->cc_data; + + /* XXXLAS: Should there be some hysteresis for minrtt? */ + + /* + * Record the current SRTT as our minrtt if it's the smallest we've seen + * or minrtt is currently equal to its initialised value. Ignore SRTT + * until a min number of samples have been taken. + */ + if ((CCV(ccv, t_srtt) < htcp_data->minrtt || + htcp_data->minrtt == TCPTV_SRTTBASE) && + (CCV(ccv, t_rttupdated) >= HTCP_MIN_RTT_SAMPLES)) + htcp_data->minrtt = CCV(ccv, t_srtt); + + /* + * Record the current SRTT as our maxrtt if it's the largest we've + * seen. Ignore SRTT until a min number of samples have been taken. + */ + if (CCV(ccv, t_srtt) > htcp_data->maxrtt + && CCV(ccv, t_rttupdated) >= HTCP_MIN_RTT_SAMPLES) + htcp_data->maxrtt = CCV(ccv, t_srtt); +} + +/* + * Update the ssthresh in the event of congestion. + */ +static void +htcp_ssthresh_update(struct cc_var *ccv) +{ + struct htcp *htcp_data; + + htcp_data = ccv->cc_data; + + /* + * On the first congestion event, set ssthresh to cwnd * 0.5, on + * subsequent congestion events, set it to cwnd * beta. + */ + if (CCV(ccv, snd_ssthresh) == TCP_MAXWIN << TCP_MAX_WINSHIFT) + CCV(ccv, snd_ssthresh) = (CCV(ccv, snd_cwnd) * HTCP_MINBETA) + >> HTCP_SHIFT; + else { + htcp_recalc_beta(ccv); + CCV(ccv, snd_ssthresh) = (CCV(ccv, snd_cwnd) * htcp_data->beta) + >> HTCP_SHIFT; + } +} + + +SYSCTL_DECL(_net_inet_tcp_cc_htcp); +SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, htcp, CTLFLAG_RW, + NULL, "H-TCP related settings"); +SYSCTL_VNET_UINT(_net_inet_tcp_cc_htcp, OID_AUTO, adaptive_backoff, CTLFLAG_RW, + &VNET_NAME(htcp_adaptive_backoff), 0, "enable H-TCP adaptive backoff"); +SYSCTL_VNET_UINT(_net_inet_tcp_cc_htcp, OID_AUTO, rtt_scaling, CTLFLAG_RW, + &VNET_NAME(htcp_rtt_scaling), 0, "enable H-TCP RTT scaling"); + +DECLARE_CC_MODULE(htcp, &htcp_cc_algo); From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 09:03:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A4EF1065697; Thu, 2 Dec 2010 09:03:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id EE1688FC15; Thu, 2 Dec 2010 09:03:10 +0000 (UTC) Received: from c122-106-145-124.carlnfd1.nsw.optusnet.com.au (c122-106-145-124.carlnfd1.nsw.optusnet.com.au [122.106.145.124]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB2936Fs002998 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Dec 2010 20:03:08 +1100 Date: Thu, 2 Dec 2010 20:03:06 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Lawrence Stewart In-Reply-To: <4CF72434.8@freebsd.org> Message-ID: <20101202200155.R2170@besplex.bde.org> References: <201012020047.oB20lte1062102@svn.freebsd.org> <20101202141735.B1174@besplex.bde.org> <4CF72434.8@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r216101 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 09:03:11 -0000 On Thu, 2 Dec 2010, Lawrence Stewart wrote: > On 12/02/10 14:45, Bruce Evans wrote: >> On Thu, 2 Dec 2010, Lawrence Stewart wrote: >> >>> Log: >>> Pass NULL instead of 0 for the th pointer value. NULL != 0 on all >>> platforms. >> ... >> The last case is essentially what applies in function calls. Now the >> conversion of either NULL or 0 or any other null pointer constant to a >> null pointer is done according to the prototype. The results are not >> necessarily the same like I said above, but they compare the same. >> Thus spelling the null pointer constant as 0 made no difference to >> the higher-level results on any platform (unless you do something like >> memcmp of null pointers, and use an exotic platform where null pointers >> have different representations). It was just a style bug. > > hmm, thanks for the informative response. I'm not sure where I got it in > my head that NULL != 0 on all platforms, but you've now corrected that > bit of misunderstanding. For the record, the now known to be bogus > commit log was my own creation based on my (mis)understanding and did > not come from David. > > When it comes time to MFC, should I use the bogus log message or correct > it to something like: > > "Fix a minor style nit by passing NULL instead of 0 for the th pointer > value." Thanks. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 09:57:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AF0D1065675; Thu, 2 Dec 2010 09:57:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 901AB8FC26; Thu, 2 Dec 2010 09:57:25 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oB29urjl012527 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Dec 2010 11:56:53 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oB29uqUL051260; Thu, 2 Dec 2010 11:56:52 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oB29uqo0051259; Thu, 2 Dec 2010 11:56:52 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 2 Dec 2010 11:56:52 +0200 From: Kostik Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20101202095652.GQ2392@deviant.kiev.zoral.com.ua> References: <201006121732.o5CHW5Cs065722@svn.freebsd.org> <20100615084939.GL13238@deviant.kiev.zoral.com.ua> <20100615131443.GA93094@zim.MIT.EDU> <20101202045728.GA19295@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="avqUsdiGFGJoDW7x" Content-Disposition: inline In-Reply-To: <20101202045728.GA19295@zim.MIT.EDU> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r209110 - in head/lib/msun: . src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 09:57:26 -0000 --avqUsdiGFGJoDW7x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 01, 2010 at 11:57:28PM -0500, David Schultz wrote: > On Tue, Jun 15, 2010, David Schultz wrote: > > On Tue, Jun 15, 2010, Kostik Belousov wrote: > > > On Sat, Jun 12, 2010 at 05:32:05PM +0000, David Schultz wrote: > > > > Author: das > > > > Date: Sat Jun 12 17:32:05 2010 > > > > New Revision: 209110 > > > > URL: http://svn.freebsd.org/changeset/base/209110 > > > >=20 > > > > Log: > > > > Introduce __isnanf() as an alias for isnanf(), and make the isnan= () > > > > macro expand to __isnanf() instead of isnanf() for float argument= s. > > > > This change is needed because isnanf() isn't declared in strict P= OSIX > > > > or C99 mode. > > > > =20 > > > > Compatibility note: Apps using isnan(float) that are compiled aft= er > > > > this change won't link against an older libm. > > > > =20 > > > > Reported by: Florian Forster > > >=20 > > > May be, it makes sense to remove the default version for the isnan sy= mbol ? > >=20 > > Wouldn't this mean apps that use isnanf() directly will no longer > > compile? isnanf() is a historical BSD interface, and although > > it's been deprecated for many years, it's still declared (if > > __BSD_VISIBLE). > >=20 > > Oops, to complicate matters further, I just noticed that we > > already have isnanf and __isnanf symbols in libc, so maybe the new > > symbol isn't needed. (isnan() and isnanf() are in libc because > > that's where they were historically.) The second version in > > libm looks like a mistake (wrong scope of the #if 0 in s_isnan.c.) > > Perhaps we could just remove the duplicate symbols from libm. >=20 > Any thoughts on removing the isnanf and __isnanf symbols from > libm? Both symbols are already in libc for historical reasons, so > the duplication isn't needed. >=20 > Although we've had the duplicate isnanf symbol in libm for several > releases, I don't believe removing it will cause problems; apps > will just pick up the libc version. __isnanf is only present in > libm in 9-CURRENT (due to the commit referenced above). Because > of symbol version differences, however, removing it will affect > apps that were linked under 9-CURRENT AND rely on isnanf AND link > against libm before libc. On my system, libwebkit is the only > affected binary I could find. Both libc and libm export FBSD_1.X versions. For isnanf, both libc and libm export isnanf@FBSD_1.0, this means that isnanf can be removed from libm (we do not believe that some binary or library links against libm but not libc). For __isnanf, libc exports __isnanf@FBSD_1.0, and libm exports __isnanf@FBSD_1.2. I suspect that we could export both __isnanf@FBSD_1.0 and __isnanf@FBSD_1.2 from libc. Then, isnanf and __isnanf may be removed from libm. --avqUsdiGFGJoDW7x Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAkz3bWQACgkQC3+MBN1Mb4ic6QCgg4MaOkshd0V8nUQmBZ2mmuvJ YegAnjZh4IXkn/qbKbmLsqy4jFJpNpR7 =/gpl -----END PGP SIGNATURE----- --avqUsdiGFGJoDW7x-- From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 10:15:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB95A1065679; Thu, 2 Dec 2010 10:15:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 3EE9B8FC0C; Thu, 2 Dec 2010 10:15:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 92E4C41C747; Thu, 2 Dec 2010 11:15:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id hIDNdrxRuijF; Thu, 2 Dec 2010 11:15:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id AF0EE41C735; Thu, 2 Dec 2010 11:15:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id AD3614448F3; Thu, 2 Dec 2010 10:13:24 +0000 (UTC) Date: Thu, 2 Dec 2010 10:13:24 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Nathan Whitehorn In-Reply-To: <201012020458.oB24w7IY079939@svn.freebsd.org> Message-ID: <20101202100954.Q6126@maildrop.int.zabbadoz.net> References: <201012020458.oB24w7IY079939@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216113 - head/gnu/usr.bin/cc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 10:15:08 -0000 On Thu, 2 Dec 2010, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Thu Dec 2 04:58:07 2010 > New Revision: 216113 > URL: http://svn.freebsd.org/changeset/base/216113 > > Log: > The driver-XXX.c files used for host CPU detection with -march=native > should not be compiled in the cross-tools case (where -march=native makes > no sense). This fixes cross-building x86 toolchains on non-x86 systems. I think it's wrong. And it seems people running into the case now cross compiling i386 on amd64 not picking up driver-i386.c anymore and thus missing host_detect_local_cpu. It could be this is related to a fix I had started to do for the cross-gcc port: http://people.freebsd.org/~bz/20101202-01-ports-devel-cross-gcc-za.diff (the port still dies later on, thus not submitted yet). but given that it was fine before, yu are simply removing the extra file from compilation in that case now as I understand. > Modified: > head/gnu/usr.bin/cc/Makefile.fe > > Modified: head/gnu/usr.bin/cc/Makefile.fe > ============================================================================== > --- head/gnu/usr.bin/cc/Makefile.fe Thu Dec 2 04:28:01 2010 (r216112) > +++ head/gnu/usr.bin/cc/Makefile.fe Thu Dec 2 04:58:07 2010 (r216113) > @@ -19,7 +19,8 @@ CFLAGS+= ${DRIVER_DEFINES} > > SRCS= gcc.c opts-common.c options.c intl.c prefix.c version.c > > -.if exists(${GCCDIR}/config/${GCC_CPU}/driver-${GCC_CPU}.c) > +.if ${TARGET_ARCH} == ${MACHINE_ARCH} && \ > + exists(${GCCDIR}/config/${GCC_CPU}/driver-${GCC_CPU}.c) > SRCS+= driver-${GCC_CPU}.c > .endif > > -- Bjoern A. Zeeb Welcome a new stage of life. Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 10:46:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D0DE1065675; Thu, 2 Dec 2010 10:46:06 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0ACEA8FC14; Thu, 2 Dec 2010 10:46:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB2Ak56T000584; Thu, 2 Dec 2010 10:46:05 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB2Ak5EV000582; Thu, 2 Dec 2010 10:46:05 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201012021046.oB2Ak5EV000582@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 2 Dec 2010 10:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216119 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 10:46:06 -0000 Author: uqs Date: Thu Dec 2 10:46:05 2010 New Revision: 216119 URL: http://svn.freebsd.org/changeset/base/216119 Log: Remove more duplicates. Just so that I can lookup the command for the next time: for t in `make -V TARGETS universe`; do __MAKE_CONF=/dev/null make -f Makefile.inc1 -m $PWD/share/mk TARGET=$t \ -V OLD_FILES -V OLD_LIBS -V OLD_DIRS delete-old | \ xargs -n1|sort|uniq -c|egrep -v "^ *1 "; done Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Dec 2 10:39:44 2010 (r216118) +++ head/ObsoleteFiles.inc Thu Dec 2 10:46:05 2010 (r216119) @@ -1158,12 +1158,6 @@ OLD_FILES+=usr/include/machine/i4b_rbch_ OLD_FILES+=usr/include/machine/i4b_tel_ioctl.h OLD_FILES+=usr/include/machine/i4b_trace.h .endif -# 20070704: I4B 'modules' temporary disconnected (removed 20080525) -.if ${TARGET_ARCH} == "i386" -OLD_FILES+=usr/share/man/man4/i4bing.4.gz -OLD_FILES+=usr/share/man/man4/i4bipr.4.gz -OLD_FILES+=usr/share/man/man4/i4bisppp.4.gz -.endif # 20070703: pf 4.1 import OLD_FILES+=usr/libexec/ftp-proxy # 20070701: KAME IPSec removal @@ -1342,12 +1336,8 @@ OLD_LIBS+=usr/lib/libusbhid.so.2 OLD_LIBS+=usr/lib/libvgl.so.4 OLD_LIBS+=usr/lib/libwrap.so.4 OLD_LIBS+=usr/lib/libypclnt.so.2 -OLD_LIBS+=usr/lib/snmp_atm.so.3 OLD_LIBS+=usr/lib/snmp_bridge.so.3 OLD_LIBS+=usr/lib/snmp_hostres.so.3 -OLD_LIBS+=usr/lib/snmp_mibII.so.3 -OLD_LIBS+=usr/lib/snmp_netgraph.so.3 -OLD_LIBS+=usr/lib/snmp_pf.so.3 .if ${TARGET_ARCH} == "amd64" OLD_LIBS+=usr/lib32/libatm.so.4 OLD_LIBS+=usr/lib32/libbegemot.so.2 @@ -4551,7 +4541,6 @@ OLD_FILES+=usr/games/worm OLD_FILES+=usr/games/worms OLD_FILES+=usr/games/wump OLD_FILES+=sbin/mount_reiserfs -OLD_FILES+=usr/include/c++/3.4/ext/demangle.h OLD_FILES+=usr/include/cam/cam_extend.h OLD_FILES+=usr/include/dev/wi/wi_hostap.h OLD_FILES+=usr/include/disktab.h @@ -4814,7 +4803,6 @@ OLD_FILES+=usr/include/posix4/posix4.h OLD_FILES+=usr/include/posix4/sched.h OLD_FILES+=usr/include/posix4/semaphore.h OLD_DIRS+=usr/include/posix4 -OLD_FILES+=usr/include/rune.h OLD_FILES+=usr/include/security/_pam_compat.h OLD_FILES+=usr/include/security/_pam_macros.h OLD_FILES+=usr/include/security/_pam_types.h @@ -4960,37 +4948,14 @@ OLD_FILES+=usr/share/doc/ntp/release.htm OLD_FILES+=usr/share/doc/ntp/tickadj.htm OLD_FILES+=usr/share/doc/papers/nqnfs.ascii.gz OLD_FILES+=usr/share/doc/papers/px.ascii.gz -OLD_FILES+=usr/share/man/man3/mbrune.3.gz -OLD_FILES+=usr/share/man/man3/rune.3.gz -OLD_FILES+=usr/share/man/man3/mac_is_present_np.3.gz -OLD_FILES+=usr/share/man/man3/fpsetsticky.3.gz -OLD_FILES+=usr/share/man/man3/gss_krb5_copy_ccache.3.gz -OLD_FILES+=usr/share/man/man3/gss_krb5_compat_des3_mic.3.gz -OLD_FILES+=usr/share/man/man3/exp10f.3.gz OLD_FILES+=usr/share/man/man3/exp10.3.gz -OLD_FILES+=usr/share/man/man3/mbrrune.3.gz -OLD_FILES+=usr/share/man/man3/mbmb.3.gz -OLD_FILES+=usr/share/man/man3/sputrune.3.gz -OLD_FILES+=usr/share/man/man3/sgetrune.3.gz -OLD_FILES+=usr/share/man/man3/setrunelocale.3.gz -OLD_FILES+=usr/share/man/man3/setinvalidrune.3.gz -OLD_FILES+=usr/share/man/man3/mbrune.3.gz -OLD_FILES+=usr/share/man/man3/rune.3.gz -OLD_FILES+=usr/share/man/man3/mac_is_present_np.3.gz +OLD_FILES+=usr/share/man/man3/exp10f.3.gz OLD_FILES+=usr/share/man/man3/fpsetsticky.3.gz -OLD_FILES+=usr/share/man/man3/gss_krb5_copy_ccache.3.gz OLD_FILES+=usr/share/man/man3/gss_krb5_compat_des3_mic.3.gz -OLD_FILES+=usr/share/man/man3/exp10f.3.gz -OLD_FILES+=usr/share/man/man3/exp10.3.gz -OLD_FILES+=usr/share/man/man3/mbrrune.3.gz +OLD_FILES+=usr/share/man/man3/gss_krb5_copy_ccache.3.gz +OLD_FILES+=usr/share/man/man3/mac_is_present_np.3.gz OLD_FILES+=usr/share/man/man3/mbmb.3.gz -OLD_FILES+=usr/share/man/man3/sputrune.3.gz -OLD_FILES+=usr/share/man/man3/sgetrune.3.gz OLD_FILES+=usr/share/man/man3/setrunelocale.3.gz -OLD_FILES+=usr/share/man/man3/setinvalidrune.3.gz -OLD_FILES+=usr/share/man/man3/fungetrune.3.gz -OLD_FILES+=usr/share/man/man3/fputrune.3.gz -OLD_FILES+=usr/share/man/man3/fgetrune.3.gz OLD_FILES+=usr/share/man/man5/usbd.conf.5.gz .if ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "amd64" OLD_FILES+=usr/share/man/man8/boot_i386.8.gz @@ -5088,11 +5053,7 @@ OLD_LIBS+=lib/libgpib.so.1 # 20060413: libpcap.so.4 moved to /lib/ OLD_LIBS+=usr/lib/libpcap.so.4 # 20060412: libpthread.so.2 moved to /lib/ -.if ${TARGET_ARCH} != "sparc64" OLD_LIBS+=usr/lib/libpthread.so.2 -.else -OLD_LIBS+=usr/lib/libthr.so.2 -.endif # 20060127: revert libdisk to static-only OLD_LIBS+=usr/lib/libdisk.so.3 # 20051027: libc_r discontinued (removed 20101113) @@ -5211,8 +5172,6 @@ OLD_LIBS+=usr/lib/snmp_atm.so.3 OLD_LIBS+=usr/lib/snmp_mibII.so.3 OLD_LIBS+=usr/lib/snmp_netgraph.so.3 OLD_LIBS+=usr/lib/snmp_pf.so.3 -# 20050603: network related ABI change on 64bit systems -OLD_LIBS+=usr/lib/libpcap.so.3 # 200505XX: ? OLD_LIBS+=usr/lib/snmp_atm.so.2 OLD_LIBS+=usr/lib/snmp_mibII.so.2 @@ -5233,10 +5192,6 @@ OLD_LIBS+=usr/lib/libpcap.so.2 OLD_LIBS+=usr/lib/libisc.so.1 # 200408XX OLD_LIBS+=usr/lib/snmp_netgraph.so.1 -.if ${TARGET_ARCH} != "sparc64" -# 20040130: libkse renamed to libpthread -OLD_LIBS+=usr/lib/libkse.so.1 -.endif # 200404XX OLD_LIBS+=usr/lib/libsnmp.so.1 OLD_LIBS+=usr/lib/snmp_mibII.so.1 From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 12:44:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC2A01065672; Thu, 2 Dec 2010 12:44:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA3F48FC0A; Thu, 2 Dec 2010 12:44:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB2CipFl007301; Thu, 2 Dec 2010 12:44:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB2Cipfm007298; Thu, 2 Dec 2010 12:44:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012021244.oB2Cipfm007298@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 2 Dec 2010 12:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216120 - head/sys/fs/procfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 12:44:51 -0000 Author: kib Date: Thu Dec 2 12:44:51 2010 New Revision: 216120 URL: http://svn.freebsd.org/changeset/base/216120 Log: For non-stopped threads, td_frame pointer is undefined. As a consequence, fill_regs() and fill_fpregs() access random data, usually on the thread kernel stack. Most often the td_frame points to the previous frame saved by last kernel entry sequence, but this is not guaranteed. For /proc//{regs,fpregs} read access, require the thread to be in stopped state. Otherwise, return EBUSY as is done for write case. Reported and tested by: pho Approved by: des (procfs maintainer) MFC after: 1 week Modified: head/sys/fs/procfs/procfs_fpregs.c head/sys/fs/procfs/procfs_regs.c Modified: head/sys/fs/procfs/procfs_fpregs.c ============================================================================== --- head/sys/fs/procfs/procfs_fpregs.c Thu Dec 2 10:46:05 2010 (r216119) +++ head/sys/fs/procfs/procfs_fpregs.c Thu Dec 2 12:44:51 2010 (r216120) @@ -97,6 +97,10 @@ procfs_doprocfpregs(PFS_FILL_ARGS) PROC_UNLOCK(p); return (EPERM); } + if (!P_SHOULDSTOP(p)) { + PROC_UNLOCK(p); + return (EBUSY); + } /* XXXKSE: */ td2 = FIRST_THREAD_IN_PROC(p); Modified: head/sys/fs/procfs/procfs_regs.c ============================================================================== --- head/sys/fs/procfs/procfs_regs.c Thu Dec 2 10:46:05 2010 (r216119) +++ head/sys/fs/procfs/procfs_regs.c Thu Dec 2 12:44:51 2010 (r216120) @@ -97,6 +97,10 @@ procfs_doprocregs(PFS_FILL_ARGS) PROC_UNLOCK(p); return (EPERM); } + if (!P_SHOULDSTOP(p)) { + PROC_UNLOCK(p); + return (EBUSY); + } /* XXXKSE: */ td2 = FIRST_THREAD_IN_PROC(p); From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 13:40:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E24AF1065670; Thu, 2 Dec 2010 13:40:21 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D095A8FC1A; Thu, 2 Dec 2010 13:40:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB2DeLBj009710; Thu, 2 Dec 2010 13:40:21 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB2DeLYR009708; Thu, 2 Dec 2010 13:40:21 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201012021340.oB2DeLYR009708@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 2 Dec 2010 13:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216121 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 13:40:22 -0000 Author: gavin Date: Thu Dec 2 13:40:21 2010 New Revision: 216121 URL: http://svn.freebsd.org/changeset/base/216121 Log: Remove two unused variables, left over from the refactoring in r180104. PR: bin/152551 Submitted by: Henning Petersen MFC after: 2 weeks Modified: head/lib/libc/stdio/printf-pos.c Modified: head/lib/libc/stdio/printf-pos.c ============================================================================== --- head/lib/libc/stdio/printf-pos.c Thu Dec 2 12:44:51 2010 (r216120) +++ head/lib/libc/stdio/printf-pos.c Thu Dec 2 13:40:21 2010 (r216121) @@ -248,7 +248,6 @@ __find_arguments (const char *fmt0, va_l int n; /* handy integer (short term usage) */ int error; int flags; /* flags as above */ - int width; /* width from format (%8d), or 0 */ struct typetable types; /* table of types */ fmt = (char *)fmt0; @@ -266,7 +265,6 @@ __find_arguments (const char *fmt0, va_l fmt++; /* skip over '%' */ flags = 0; - width = 0; rflag: ch = *fmt++; reswitch: switch (ch) { @@ -304,7 +302,6 @@ reswitch: switch (ch) { types.nextarg = n; goto rflag; } - width = n; goto reswitch; #ifndef NO_FLOATING_POINT case 'L': @@ -439,7 +436,6 @@ __find_warguments (const wchar_t *fmt0, int n; /* handy integer (short term usage) */ int error; int flags; /* flags as above */ - int width; /* width from format (%8d), or 0 */ struct typetable types; /* table of types */ fmt = (wchar_t *)fmt0; @@ -457,7 +453,6 @@ __find_warguments (const wchar_t *fmt0, fmt++; /* skip over '%' */ flags = 0; - width = 0; rflag: ch = *fmt++; reswitch: switch (ch) { @@ -495,7 +490,6 @@ reswitch: switch (ch) { types.nextarg = n; goto rflag; } - width = n; goto reswitch; #ifndef NO_FLOATING_POINT case 'L': From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 14:45:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 997F1106566B; Thu, 2 Dec 2010 14:45:39 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3CA888FC23; Thu, 2 Dec 2010 14:45:38 +0000 (UTC) Received: from outgoing.leidinger.net (p57B3A614.dip.t-dialin.net [87.179.166.20]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id DC09B844168; Thu, 2 Dec 2010 15:45:31 +0100 (CET) Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102]) by outgoing.leidinger.net (Postfix) with ESMTP id 7CBAC1321; Thu, 2 Dec 2010 15:45:27 +0100 (CET) Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id oB2EjMqU016739; Thu, 2 Dec 2010 15:45:22 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Thu, 02 Dec 2010 15:45:22 +0100 Message-ID: <20101202154522.76174hkekl2ct4pw@webmail.leidinger.net> Date: Thu, 02 Dec 2010 15:45:22 +0100 From: Alexander Leidinger To: Ulrich Spoerlein References: <201012021046.oB2Ak5EV000582@svn.freebsd.org> In-Reply-To: <201012021046.oB2Ak5EV000582@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: DC09B844168.A355E X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=1.351, required 6, autolearn=disabled, RDNS_NONE 1.27, TW_SV 0.08) X-EBL-MailScanner-SpamScore: s X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1291905932.99569@J4EHQohSQPgE02hg5QWV7g X-EBL-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216119 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 14:45:39 -0000 Quoting Ulrich Spoerlein (from Thu, 2 Dec 2010 10:46:05 +0000 (UTC)): > Author: uqs > Date: Thu Dec 2 10:46:05 2010 > New Revision: 216119 > URL: http://svn.freebsd.org/changeset/base/216119 > > Log: > Remove more duplicates. > > Just so that I can lookup the command for the next time: Can you please add it to OldFiles.inc instead, with a comment what it does? > for t in `make -V TARGETS universe`; do > __MAKE_CONF=/dev/null make -f Makefile.inc1 -m $PWD/share/mk TARGET=$t \ > -V OLD_FILES -V OLD_LIBS -V OLD_DIRS delete-old | \ > xargs -n1|sort|uniq -c|egrep -v "^ *1 "; > done While it does not matter for "-V OLD*", the spirit of the command is more like the check-old target (which is including shared libs) than the delete-old target (which does not delete shared libs but only static libs). Using check-old would also remove the (wrong, but not far fetched) fear of actually deleting something with this command. Bye, Alexander. -- Each kiss is as the first. -- Miramanee, Kirk's wife, "The Paradise Syndrome", stardate 4842.6 http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 15:10:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9AD3106566B; Thu, 2 Dec 2010 15:10:27 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C1278FC14; Thu, 2 Dec 2010 15:10:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB2FARwE012914; Thu, 2 Dec 2010 15:10:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB2FARBU012912; Thu, 2 Dec 2010 15:10:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201012021510.oB2FARBU012912@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 2 Dec 2010 15:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216122 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 15:10:27 -0000 Author: nwhitehorn Date: Thu Dec 2 15:10:27 2010 New Revision: 216122 URL: http://svn.freebsd.org/changeset/base/216122 Log: Define bswap macros for constants to allow the compiler to pre-compute byte-swapped versions of compile-time constants. This allows use of bswap() and htole*() in initializers, which is required to cross-build btxld. Obtained from: sparc64 Modified: head/sys/powerpc/include/endian.h Modified: head/sys/powerpc/include/endian.h ============================================================================== --- head/sys/powerpc/include/endian.h Thu Dec 2 13:40:21 2010 (r216121) +++ head/sys/powerpc/include/endian.h Thu Dec 2 15:10:27 2010 (r216122) @@ -27,7 +27,6 @@ * SUCH DAMAGE. * * @(#)endian.h 8.1 (Berkeley) 6/10/93 - * $NetBSD: endian.h,v 1.7 1999/08/21 05:53:51 simonb Exp $ * $FreeBSD$ */ @@ -79,17 +78,36 @@ #define BYTE_ORDER _BYTE_ORDER #endif -#ifdef __CC_SUPPORTS___INLINE +#if defined(__GNUCLIKE_BUILTIN_CONSTANT_P) +#define __is_constant(x) __builtin_constant_p(x) +#else +#define __is_constant(x) 0 +#endif + +#define __bswap16_const(x) ((((__uint16_t)(x) >> 8) & 0xff) | \ + (((__uint16_t)(x) << 8) & 0xff00)) +#define __bswap32_const(x) ((((__uint32_t)(x) >> 24) & 0xff) | \ + (((__uint32_t)(x) >> 8) & 0xff00) | \ + (((__uint32_t)(x)<< 8) & 0xff0000) | \ + (((__uint32_t)(x) << 24) & 0xff000000)) +#define __bswap64_const(x) ((((__uint64_t)(x) >> 56) & 0xff) | \ + (((__uint64_t)(x) >> 40) & 0xff00) | \ + (((__uint64_t)(x) >> 24) & 0xff0000) | \ + (((__uint64_t)(x) >> 8) & 0xff000000) | \ + (((__uint64_t)(x) << 8) & ((__uint64_t)0xff << 32)) | \ + (((__uint64_t)(x) << 24) & ((__uint64_t)0xff << 40)) | \ + (((__uint64_t)(x) << 40) & ((__uint64_t)0xff << 48)) | \ + (((__uint64_t)(x) << 56) & ((__uint64_t)0xff << 56))) static __inline __uint16_t -__bswap16(__uint16_t _x) +__bswap16_var(__uint16_t _x) { return ((_x >> 8) | ((_x << 8) & 0xff00)); } static __inline __uint32_t -__bswap32(__uint32_t _x) +__bswap32_var(__uint32_t _x) { return ((_x >> 24) | ((_x >> 8) & 0xff00) | ((_x << 8) & 0xff0000) | @@ -97,7 +115,7 @@ __bswap32(__uint32_t _x) } static __inline __uint64_t -__bswap64(__uint64_t _x) +__bswap64_var(__uint64_t _x) { return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) | @@ -106,20 +124,16 @@ __bswap64(__uint64_t _x) ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); } +#define __bswap16(x) (__is_constant(x) ? __bswap16_const(x) : \ + __bswap16_var(x)) +#define __bswap32(x) (__is_constant(x) ? __bswap32_const(x) : \ + __bswap32_var(x)) +#define __bswap64(x) (__is_constant(x) ? __bswap64_const(x) : \ + __bswap64_var(x)) + #define __htonl(x) ((__uint32_t)(x)) #define __htons(x) ((__uint16_t)(x)) #define __ntohl(x) ((__uint32_t)(x)) #define __ntohs(x) ((__uint16_t)(x)) -#else /* !__CC_SUPPORTS___INLINE */ - -/* - * No optimizations are available for this compiler. Fall back to - * non-optimized functions by defining the constant usually used to prevent - * redefinition. - */ -#define _BYTEORDER_FUNC_DEFINED - -#endif /* __CC_SUPPORTS___INLINE */ - #endif /* !_MACHINE_ENDIAN_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 16:47:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87BD310656A3; Thu, 2 Dec 2010 16:47:30 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 7222A8FC16; Thu, 2 Dec 2010 16:47:29 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id oB2GlR0B039433; Thu, 2 Dec 2010 17:47:28 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id oB2GlRUV039432; Thu, 2 Dec 2010 17:47:27 +0100 (CET) (envelope-from marius) Date: Thu, 2 Dec 2010 17:47:27 +0100 From: Marius Strobl To: Alan Cox Message-ID: <20101202164727.GB38282@alchemy.franken.de> References: <201011281926.oASJQKiE040689@svn.freebsd.org> <20101128194542.GF9966@alchemy.franken.de> <20101129192308.GX80343@alchemy.franken.de> <20101129192417.GA18893@alchemy.franken.de> <4CF691A5.8070608@rice.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CF691A5.8070608@rice.edu> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, alc@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Max Khon Subject: Re: svn commit: r216016 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 16:47:30 -0000 On Wed, Dec 01, 2010 at 12:19:17PM -0600, Alan Cox wrote: > Marius Strobl wrote: > >On Mon, Nov 29, 2010 at 08:23:08PM +0100, Marius Strobl wrote: > > > >>On Tue, Nov 30, 2010 at 12:31:31AM +0600, Max Khon wrote: > >> > >>>Marius, > >>> > >>>On Mon, Nov 29, 2010 at 1:45 AM, Marius Strobl > >>>wrote: > >>> > >>>On Sun, Nov 28, 2010 at 07:26:20PM +0000, Max Khon wrote: > >>> > >>>>>Author: fjoe > >>>>>Date: Sun Nov 28 19:26:20 2010 > >>>>>New Revision: 216016 > >>>>>URL: http://svn.freebsd.org/changeset/base/216016 > >>>>> > >>>>>Log: > >>>>> Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with > >>>>> DEBUG_MEMGUARD panics early in kmeminit() with the message > >>>>> "kmem_suballoc: bad status return of 1" because of zero "size" > >>>>> argument > >>>>> passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. > >>>>> > >>>>> The problem also exists on ia64. > >>>>> > >>>>>Modified: > >>>>> head/sys/sparc64/include/vmparam.h > >>>>> > >>>>>Modified: head/sys/sparc64/include/vmparam.h > >>>>> > >>>>> > >>>>============================================================================== > >>>> > >>>>>--- head/sys/sparc64/include/vmparam.h Sun Nov 28 18:59:52 2010 > >>>>> > >>>> (r216015) > >>>> > >>>>>+++ head/sys/sparc64/include/vmparam.h Sun Nov 28 19:26:20 2010 > >>>>> > >>>> (r216016) > >>>> > >>>>>@@ -237,6 +237,14 @@ > >>>>> #endif > >>>>> > >>>>> /* > >>>>>+ * Ceiling on amount of kmem_map kva space. > >>>>>+ */ > >>>>>+#ifndef VM_KMEM_SIZE_MAX > >>>>>+#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ > >>>>>+ VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) > >>>>>+#endif > >>>>>+ > >>>>>+/* > >>>>> * Initial pagein size of beginning of executable file. > >>>>> */ > >>>>> #ifndef VM_INITIAL_PAGEIN > >>>>> > >>>>How was that value determined? > >>>> > >>>> > >>>I've just copied it from amd64 to be non-zero for now. Do you have a > >>>better > >>>idea of what it should look like? > >>> > >>> > >>Well, on sparc64 VM_MAX_KERNEL_ADDRESS already is dynamically adjusted > >>to the maximum appropriate for the specific CPU during the early cycles > >>of the kernel so I'd think one could just use VM_MAX_KERNEL_ADDRESS - > >>VM_MIN_KERNEL_ADDRESS for VM_KMEM_SIZE_MAX there, I'm not sure what > >>the intention of the ceiling provided by that macro actually is though > >>In any case, the commit message of r180210 which changed the amd64 > >>version to the current one talks about limiting the kmem map to 3.6GB > >>and while it also fails to explain where that value comes from it > >>looks rather amd64 specific and the formula used by the macro will > >>result in a different ceiling on sparc64 and thus inappropriate. I've > >>CC'ed alc@ who hopefully can shed some light on this. > >>Apart from this the actual bug here seems to be that memguard_fudge() > >>can't deal with a km_max being zero or that zero is passed to it as > >>kmeminit() allows for VM_KMEM_SIZE_MAX not being defined. > >> > >> > > > >Oops, forgot to actually CC alc@. > > > > There's nothing particularly amd64-specific about the definition. In > general, if you allow the kmem_map, which is basically the kernel's > heap, to consume the entire kernel address space as you propose, then > you're leaving no room for the buffer cache, thread stacks, pipes, and a > few other things. Since the cap on the kmem_map size as defined by > r180210 is a fraction of the overall kernel address space size, it > scales automatically with the kernel address space size and should be a > reasonable cap definition for most architectures. > > In the specific case of sparc64, I think it's fair to say that the > kernel virtual address is sufficiently large and the amount of physical > memory in any of the supported machines is small enough in comparison > that it hasn't mattered that a kmem_map cap doesn't exist, because most > of the aforementioned structures are scaled based on the amount of > physical memory. In fact, it probably won't matter any time soon. > > All of that said, I would suggest fixing memguard_fudge() and reverting > r216016 and the follow up change. All I think that is required to fix > memguard_fudge() is > > Index: vm/memguard.c > =================================================================== > --- vm/memguard.c (revision 216070) > +++ vm/memguard.c (working copy) > @@ -186,7 +186,7 @@ memguard_fudge(unsigned long km_size, unsigned lon > memguard_mapsize = round_page(memguard_mapsize); > if (memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) > memguard_mapsize = mem_pgs * 2 * PAGE_SIZE; > - if (km_size + memguard_mapsize > km_max) > + if (km_max > 0 && km_size + memguard_mapsize > km_max) > return (km_max); > return (km_size + memguard_mapsize); > } > Thanks but unfortunately this variant then still panics in kmem_suballoc() when called by memguard_init(): KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2010 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 9.0-CURRENT #17 r215249:216120M: Thu Dec 2 15:17:35 CET 2010 marius@v20z.zeist.de:/home/marius/co/build/head2/sparc64.sparc64/usr/home/m4 WARNING: WITNESS option enabled, expect reduced performance. panic: kmem_suballoc: bad status return of 1 cpuid = 0 KDB: enter: panic [ thread pid 0 tid 0 ] Stopped at 0xc03b04c0: ta %xcc, 1 db> bt Tracing pid 0 tid 0 td 0xc089ca10 (null)() at 0xc0371bac (null)() at 0xc054d2dc (null)() at 0xc0547dc8 (null)() at 0xc0359a78 (null)() at 0xc031e930 (null)() at 0xc0070028 Marius From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 17:27:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79BF7106564A; Thu, 2 Dec 2010 17:27:48 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by mx1.freebsd.org (Postfix) with ESMTP id 3D67C8FC15; Thu, 2 Dec 2010 17:27:47 +0000 (UTC) Received: from mh3.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh3.mail.rice.edu (Postfix) with ESMTP id 514E128F6FE; Thu, 2 Dec 2010 11:27:47 -0600 (CST) X-Virus-Scanned: by amavis-2.6.4 at mh3.mail.rice.edu, auth channel Received: from mh3.mail.rice.edu ([127.0.0.1]) by mh3.mail.rice.edu (mh3.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id zg76JzpJDaBT; Thu, 2 Dec 2010 11:27:47 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id 7BD4F28F6FA; Thu, 2 Dec 2010 11:27:46 -0600 (CST) Message-ID: <4CF7D711.9040505@rice.edu> Date: Thu, 02 Dec 2010 11:27:45 -0600 From: Alan Cox User-Agent: Thunderbird 2.0.0.24 (X11/20100725) MIME-Version: 1.0 To: Marius Strobl References: <201011281926.oASJQKiE040689@svn.freebsd.org> <20101128194542.GF9966@alchemy.franken.de> <20101129192308.GX80343@alchemy.franken.de> <20101129192417.GA18893@alchemy.franken.de> <4CF691A5.8070608@rice.edu> <20101202164727.GB38282@alchemy.franken.de> In-Reply-To: <20101202164727.GB38282@alchemy.franken.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, alc@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Max Khon Subject: Re: svn commit: r216016 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 17:27:48 -0000 Marius Strobl wrote: > On Wed, Dec 01, 2010 at 12:19:17PM -0600, Alan Cox wrote: > >> Marius Strobl wrote: >> >>> On Mon, Nov 29, 2010 at 08:23:08PM +0100, Marius Strobl wrote: >>> >>> >>>> On Tue, Nov 30, 2010 at 12:31:31AM +0600, Max Khon wrote: >>>> >>>> >>>>> Marius, >>>>> >>>>> On Mon, Nov 29, 2010 at 1:45 AM, Marius Strobl >>>>> wrote: >>>>> >>>>> On Sun, Nov 28, 2010 at 07:26:20PM +0000, Max Khon wrote: >>>>> >>>>> >>>>>>> Author: fjoe >>>>>>> Date: Sun Nov 28 19:26:20 2010 >>>>>>> New Revision: 216016 >>>>>>> URL: http://svn.freebsd.org/changeset/base/216016 >>>>>>> >>>>>>> Log: >>>>>>> Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with >>>>>>> DEBUG_MEMGUARD panics early in kmeminit() with the message >>>>>>> "kmem_suballoc: bad status return of 1" because of zero "size" >>>>>>> argument >>>>>>> passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. >>>>>>> >>>>>>> The problem also exists on ia64. >>>>>>> >>>>>>> Modified: >>>>>>> head/sys/sparc64/include/vmparam.h >>>>>>> >>>>>>> Modified: head/sys/sparc64/include/vmparam.h >>>>>>> >>>>>>> >>>>>>> >>>>>> ============================================================================== >>>>>> >>>>>> >>>>>>> --- head/sys/sparc64/include/vmparam.h Sun Nov 28 18:59:52 2010 >>>>>>> >>>>>>> >>>>>> (r216015) >>>>>> >>>>>> >>>>>>> +++ head/sys/sparc64/include/vmparam.h Sun Nov 28 19:26:20 2010 >>>>>>> >>>>>>> >>>>>> (r216016) >>>>>> >>>>>> >>>>>>> @@ -237,6 +237,14 @@ >>>>>>> #endif >>>>>>> >>>>>>> /* >>>>>>> + * Ceiling on amount of kmem_map kva space. >>>>>>> + */ >>>>>>> +#ifndef VM_KMEM_SIZE_MAX >>>>>>> +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ >>>>>>> + VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) >>>>>>> +#endif >>>>>>> + >>>>>>> +/* >>>>>>> * Initial pagein size of beginning of executable file. >>>>>>> */ >>>>>>> #ifndef VM_INITIAL_PAGEIN >>>>>>> >>>>>>> >>>>>> How was that value determined? >>>>>> >>>>>> >>>>>> >>>>> I've just copied it from amd64 to be non-zero for now. Do you have a >>>>> better >>>>> idea of what it should look like? >>>>> >>>>> >>>>> >>>> Well, on sparc64 VM_MAX_KERNEL_ADDRESS already is dynamically adjusted >>>> to the maximum appropriate for the specific CPU during the early cycles >>>> of the kernel so I'd think one could just use VM_MAX_KERNEL_ADDRESS - >>>> VM_MIN_KERNEL_ADDRESS for VM_KMEM_SIZE_MAX there, I'm not sure what >>>> the intention of the ceiling provided by that macro actually is though >>>> In any case, the commit message of r180210 which changed the amd64 >>>> version to the current one talks about limiting the kmem map to 3.6GB >>>> and while it also fails to explain where that value comes from it >>>> looks rather amd64 specific and the formula used by the macro will >>>> result in a different ceiling on sparc64 and thus inappropriate. I've >>>> CC'ed alc@ who hopefully can shed some light on this. >>>> Apart from this the actual bug here seems to be that memguard_fudge() >>>> can't deal with a km_max being zero or that zero is passed to it as >>>> kmeminit() allows for VM_KMEM_SIZE_MAX not being defined. >>>> >>>> >>>> >>> Oops, forgot to actually CC alc@. >>> >>> >> There's nothing particularly amd64-specific about the definition. In >> general, if you allow the kmem_map, which is basically the kernel's >> heap, to consume the entire kernel address space as you propose, then >> you're leaving no room for the buffer cache, thread stacks, pipes, and a >> few other things. Since the cap on the kmem_map size as defined by >> r180210 is a fraction of the overall kernel address space size, it >> scales automatically with the kernel address space size and should be a >> reasonable cap definition for most architectures. >> >> In the specific case of sparc64, I think it's fair to say that the >> kernel virtual address is sufficiently large and the amount of physical >> memory in any of the supported machines is small enough in comparison >> that it hasn't mattered that a kmem_map cap doesn't exist, because most >> of the aforementioned structures are scaled based on the amount of >> physical memory. In fact, it probably won't matter any time soon. >> >> All of that said, I would suggest fixing memguard_fudge() and reverting >> r216016 and the follow up change. All I think that is required to fix >> memguard_fudge() is >> >> Index: vm/memguard.c >> =================================================================== >> --- vm/memguard.c (revision 216070) >> +++ vm/memguard.c (working copy) >> @@ -186,7 +186,7 @@ memguard_fudge(unsigned long km_size, unsigned lon >> memguard_mapsize = round_page(memguard_mapsize); >> if (memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) >> memguard_mapsize = mem_pgs * 2 * PAGE_SIZE; >> - if (km_size + memguard_mapsize > km_max) >> + if (km_max > 0 && km_size + memguard_mapsize > km_max) >> return (km_max); >> return (km_size + memguard_mapsize); >> } >> >> > > Thanks but unfortunately this variant then still panics in kmem_suballoc() > when called by memguard_init(): > KDB: debugger backends: ddb > KDB: current backend: ddb > Copyright (c) 1992-2010 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 9.0-CURRENT #17 r215249:216120M: Thu Dec 2 15:17:35 CET 2010 > marius@v20z.zeist.de:/home/marius/co/build/head2/sparc64.sparc64/usr/home/m4 > WARNING: WITNESS option enabled, expect reduced performance. > panic: kmem_suballoc: bad status return of 1 > cpuid = 0 > KDB: enter: panic > [ thread pid 0 tid 0 ] > Stopped at 0xc03b04c0: ta %xcc, 1 > db> bt > Tracing pid 0 tid 0 td 0xc089ca10 > (null)() at 0xc0371bac > (null)() at 0xc054d2dc > (null)() at 0xc0547dc8 > (null)() at 0xc0359a78 > (null)() at 0xc031e930 > (null)() at 0xc0070028 > > Sorry, I overlooked another use of km_max in memguard_fudge(). Please try this instead: Index: vm/memguard.c =================================================================== --- vm/memguard.c (revision 216070) +++ vm/memguard.c (working copy) @@ -184,9 +184,10 @@ memguard_fudge(unsigned long km_size, unsigned lon memguard_mapsize = km_max / vm_memguard_divisor; /* size must be multiple of PAGE_SIZE */ memguard_mapsize = round_page(memguard_mapsize); - if (memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) + if (memguard_mapsize == 0 || + memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) memguard_mapsize = mem_pgs * 2 * PAGE_SIZE; - if (km_size + memguard_mapsize > km_max) + if (km_max > 0 && km_size + memguard_mapsize > km_max) return (km_max); return (km_size + memguard_mapsize); } From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 17:36:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EAF91065679; Thu, 2 Dec 2010 17:36:48 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A6E78FC13; Thu, 2 Dec 2010 17:36:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB2HamkN020109; Thu, 2 Dec 2010 17:36:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB2Halhq020107; Thu, 2 Dec 2010 17:36:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201012021736.oB2Halhq020107@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 2 Dec 2010 17:36:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216127 - head/gnu/usr.bin/cc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 17:36:48 -0000 Author: nwhitehorn Date: Thu Dec 2 17:36:47 2010 New Revision: 216127 URL: http://svn.freebsd.org/changeset/base/216127 Log: Unbreak amd64<->i386 cross builds. Modified: head/gnu/usr.bin/cc/Makefile.fe Modified: head/gnu/usr.bin/cc/Makefile.fe ============================================================================== --- head/gnu/usr.bin/cc/Makefile.fe Thu Dec 2 16:46:28 2010 (r216126) +++ head/gnu/usr.bin/cc/Makefile.fe Thu Dec 2 17:36:47 2010 (r216127) @@ -19,8 +19,9 @@ CFLAGS+= ${DRIVER_DEFINES} SRCS= gcc.c opts-common.c options.c intl.c prefix.c version.c -.if ${TARGET_ARCH} == ${MACHINE_ARCH} && \ - exists(${GCCDIR}/config/${GCC_CPU}/driver-${GCC_CPU}.c) +# Include -march=native support for native-ish compilers only +.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64") && \ + ${GCC_CPU} == "i386" SRCS+= driver-${GCC_CPU}.c .endif From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 17:37:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B89661065679; Thu, 2 Dec 2010 17:37:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A59C48FC16; Thu, 2 Dec 2010 17:37:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB2HbGeL020184; Thu, 2 Dec 2010 17:37:16 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB2HbGVA020172; Thu, 2 Dec 2010 17:37:16 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201012021737.oB2HbGVA020172@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 2 Dec 2010 17:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216128 - in head/sys: fs/procfs kern vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 17:37:16 -0000 Author: trasz Date: Thu Dec 2 17:37:16 2010 New Revision: 216128 URL: http://svn.freebsd.org/changeset/base/216128 Log: Replace pointer to "struct uidinfo" with pointer to "struct ucred" in "struct vm_object". This is required to make it possible to account for per-jail swap usage. Reviewed by: kib@ Tested by: pho@ Sponsored by: FreeBSD Foundation Modified: head/sys/fs/procfs/procfs_map.c head/sys/kern/uipc_shm.c head/sys/vm/default_pager.c head/sys/vm/swap_pager.c head/sys/vm/vm.h head/sys/vm/vm_fault.c head/sys/vm/vm_map.c head/sys/vm/vm_map.h head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/fs/procfs/procfs_map.c ============================================================================== --- head/sys/fs/procfs/procfs_map.c Thu Dec 2 17:36:47 2010 (r216127) +++ head/sys/fs/procfs/procfs_map.c Thu Dec 2 17:37:16 2010 (r216128) @@ -83,7 +83,7 @@ procfs_doprocmap(PFS_FILL_ARGS) vm_map_entry_t entry, tmp_entry; struct vnode *vp; char *fullpath, *freepath; - struct uidinfo *uip; + struct ucred *cred; int error, vfslocked; unsigned int last_timestamp; #ifdef COMPAT_FREEBSD32 @@ -136,7 +136,7 @@ procfs_doprocmap(PFS_FILL_ARGS) if (obj->shadow_count == 1) privateresident = obj->resident_page_count; } - uip = (entry->uip) ? entry->uip : (obj ? obj->uip : NULL); + cred = (entry->cred) ? entry->cred : (obj ? obj->cred : NULL); resident = 0; addr = entry->start; @@ -221,7 +221,7 @@ procfs_doprocmap(PFS_FILL_ARGS) (e_eflags & MAP_ENTRY_COW)?"COW":"NCOW", (e_eflags & MAP_ENTRY_NEEDS_COPY)?"NC":"NNC", type, fullpath, - uip ? "CH":"NCH", uip ? uip->ui_uid : -1); + cred ? "CH":"NCH", cred ? cred->cr_ruid : -1); if (freepath != NULL) free(freepath, M_TEMP); Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Thu Dec 2 17:36:47 2010 (r216127) +++ head/sys/kern/uipc_shm.c Thu Dec 2 17:37:16 2010 (r216128) @@ -271,7 +271,7 @@ shm_dotruncate(struct shmfd *shmfd, off_ swap_pager_freespace(object, nobjsize, delta); /* Free the swap accounted for shm */ - swap_release_by_uid(delta, object->uip); + swap_release_by_cred(delta, object->cred); object->charge -= delta; /* @@ -314,7 +314,7 @@ shm_dotruncate(struct shmfd *shmfd, off_ /* Attempt to reserve the swap */ delta = ptoa(nobjsize - object->size); - if (!swap_reserve_by_uid(delta, object->uip)) { + if (!swap_reserve_by_cred(delta, object->cred)) { VM_OBJECT_UNLOCK(object); return (ENOMEM); } Modified: head/sys/vm/default_pager.c ============================================================================== --- head/sys/vm/default_pager.c Thu Dec 2 17:36:47 2010 (r216127) +++ head/sys/vm/default_pager.c Thu Dec 2 17:37:16 2010 (r216128) @@ -80,21 +80,19 @@ default_pager_alloc(void *handle, vm_oof vm_ooffset_t offset, struct ucred *cred) { vm_object_t object; - struct uidinfo *uip; if (handle != NULL) panic("default_pager_alloc: handle specified"); if (cred != NULL) { - uip = cred->cr_ruidinfo; - if (!swap_reserve_by_uid(size, uip)) + if (!swap_reserve_by_cred(size, cred)) return (NULL); - uihold(uip); + crhold(cred); } object = vm_object_allocate(OBJT_DEFAULT, OFF_TO_IDX(round_page(offset + size))); if (cred != NULL) { VM_OBJECT_LOCK(object); - object->uip = uip; + object->cred = cred; object->charge = size; VM_OBJECT_UNLOCK(object); } Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Thu Dec 2 17:36:47 2010 (r216127) +++ head/sys/vm/swap_pager.c Thu Dec 2 17:37:16 2010 (r216128) @@ -174,16 +174,19 @@ int swap_reserve(vm_ooffset_t incr) { - return (swap_reserve_by_uid(incr, curthread->td_ucred->cr_ruidinfo)); + return (swap_reserve_by_cred(incr, curthread->td_ucred)); } int -swap_reserve_by_uid(vm_ooffset_t incr, struct uidinfo *uip) +swap_reserve_by_cred(vm_ooffset_t incr, struct ucred *cred) { vm_ooffset_t r, s; int res, error; static int curfail; static struct timeval lastfail; + struct uidinfo *uip; + + uip = cred->cr_ruidinfo; if (incr & PAGE_MASK) panic("swap_reserve: & PAGE_MASK"); @@ -249,17 +252,20 @@ swap_reserve_force(vm_ooffset_t incr) void swap_release(vm_ooffset_t decr) { - struct uidinfo *uip; + struct ucred *cred; PROC_LOCK(curproc); - uip = curthread->td_ucred->cr_ruidinfo; - swap_release_by_uid(decr, uip); + cred = curthread->td_ucred; + swap_release_by_cred(decr, cred); PROC_UNLOCK(curproc); } void -swap_release_by_uid(vm_ooffset_t decr, struct uidinfo *uip) +swap_release_by_cred(vm_ooffset_t decr, struct ucred *cred) { + struct uidinfo *uip; + + uip = cred->cr_ruidinfo; if (decr & PAGE_MASK) panic("swap_release: & PAGE_MASK"); @@ -579,9 +585,7 @@ swap_pager_alloc(void *handle, vm_ooffse { vm_object_t object; vm_pindex_t pindex; - struct uidinfo *uip; - uip = NULL; pindex = OFF_TO_IDX(offset + PAGE_MASK + size); if (handle) { mtx_lock(&Giant); @@ -595,19 +599,18 @@ swap_pager_alloc(void *handle, vm_ooffse object = vm_pager_object_lookup(NOBJLIST(handle), handle); if (object == NULL) { if (cred != NULL) { - uip = cred->cr_ruidinfo; - if (!swap_reserve_by_uid(size, uip)) { + if (!swap_reserve_by_cred(size, cred)) { sx_xunlock(&sw_alloc_sx); mtx_unlock(&Giant); return (NULL); } - uihold(uip); + crhold(cred); } object = vm_object_allocate(OBJT_DEFAULT, pindex); VM_OBJECT_LOCK(object); object->handle = handle; if (cred != NULL) { - object->uip = uip; + object->cred = cred; object->charge = size; } swp_pager_meta_build(object, 0, SWAPBLK_NONE); @@ -617,15 +620,14 @@ swap_pager_alloc(void *handle, vm_ooffse mtx_unlock(&Giant); } else { if (cred != NULL) { - uip = cred->cr_ruidinfo; - if (!swap_reserve_by_uid(size, uip)) + if (!swap_reserve_by_cred(size, cred)) return (NULL); - uihold(uip); + crhold(cred); } object = vm_object_allocate(OBJT_DEFAULT, pindex); VM_OBJECT_LOCK(object); if (cred != NULL) { - object->uip = uip; + object->cred = cred; object->charge = size; } swp_pager_meta_build(object, 0, SWAPBLK_NONE); Modified: head/sys/vm/vm.h ============================================================================== --- head/sys/vm/vm.h Thu Dec 2 17:36:47 2010 (r216127) +++ head/sys/vm/vm.h Thu Dec 2 17:37:16 2010 (r216128) @@ -141,12 +141,12 @@ struct kva_md_info { extern struct kva_md_info kmi; extern void vm_ksubmap_init(struct kva_md_info *); -struct uidinfo; +struct ucred; int swap_reserve(vm_ooffset_t incr); -int swap_reserve_by_uid(vm_ooffset_t incr, struct uidinfo *uip); +int swap_reserve_by_cred(vm_ooffset_t incr, struct ucred *cred); void swap_reserve_force(vm_ooffset_t incr); void swap_release(vm_ooffset_t decr); -void swap_release_by_uid(vm_ooffset_t decr, struct uidinfo *uip); +void swap_release_by_cred(vm_ooffset_t decr, struct ucred *cred); #endif /* VM_H */ Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Dec 2 17:36:47 2010 (r216127) +++ head/sys/vm/vm_fault.c Thu Dec 2 17:37:16 2010 (r216128) @@ -1166,14 +1166,14 @@ vm_fault_copy_entry(vm_map_t dst_map, vm dst_entry->offset = 0; dst_object->charge = dst_entry->end - dst_entry->start; if (fork_charge != NULL) { - KASSERT(dst_entry->uip == NULL, + KASSERT(dst_entry->cred == NULL, ("vm_fault_copy_entry: leaked swp charge")); - dst_object->uip = curthread->td_ucred->cr_ruidinfo; - uihold(dst_object->uip); + dst_object->cred = curthread->td_ucred; + crhold(dst_object->cred); *fork_charge += dst_object->charge; } else { - dst_object->uip = dst_entry->uip; - dst_entry->uip = NULL; + dst_object->cred = dst_entry->cred; + dst_entry->cred = NULL; } access = prot = dst_entry->protection; /* Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Thu Dec 2 17:36:47 2010 (r216127) +++ head/sys/vm/vm_map.c Thu Dec 2 17:37:16 2010 (r216128) @@ -137,8 +137,8 @@ static void vm_map_zdtor(void *mem, int static void vmspace_zdtor(void *mem, int size, void *arg); #endif -#define ENTRY_CHARGED(e) ((e)->uip != NULL || \ - ((e)->object.vm_object != NULL && (e)->object.vm_object->uip != NULL && \ +#define ENTRY_CHARGED(e) ((e)->cred != NULL || \ + ((e)->object.vm_object != NULL && (e)->object.vm_object->cred != NULL && \ !((e)->eflags & MAP_ENTRY_NEEDS_COPY))) /* @@ -1095,7 +1095,7 @@ vm_map_insert(vm_map_t map, vm_object_t vm_map_entry_t prev_entry; vm_map_entry_t temp_entry; vm_eflags_t protoeflags; - struct uidinfo *uip; + struct ucred *cred; boolean_t charge_prev_obj; VM_MAP_ASSERT_LOCKED(map); @@ -1140,7 +1140,7 @@ vm_map_insert(vm_map_t map, vm_object_t if (cow & MAP_DISABLE_COREDUMP) protoeflags |= MAP_ENTRY_NOCOREDUMP; - uip = NULL; + cred = NULL; KASSERT((object != kmem_object && object != kernel_object) || ((object == kmem_object || object == kernel_object) && !(protoeflags & MAP_ENTRY_NEEDS_COPY)), @@ -1152,10 +1152,10 @@ vm_map_insert(vm_map_t map, vm_object_t if (!(cow & MAP_ACC_CHARGED) && !swap_reserve(end - start)) return (KERN_RESOURCE_SHORTAGE); KASSERT(object == NULL || (protoeflags & MAP_ENTRY_NEEDS_COPY) || - object->uip == NULL, + object->cred == NULL, ("OVERCOMMIT: vm_map_insert o %p", object)); - uip = curthread->td_ucred->cr_ruidinfo; - uihold(uip); + cred = curthread->td_ucred; + crhold(cred); if (object == NULL && !(protoeflags & MAP_ENTRY_NEEDS_COPY)) charge_prev_obj = TRUE; } @@ -1181,9 +1181,9 @@ charged: (prev_entry->eflags == protoeflags) && (prev_entry->end == start) && (prev_entry->wired_count == 0) && - (prev_entry->uip == uip || + (prev_entry->cred == cred || (prev_entry->object.vm_object != NULL && - (prev_entry->object.vm_object->uip == uip))) && + (prev_entry->object.vm_object->cred == cred))) && vm_object_coalesce(prev_entry->object.vm_object, prev_entry->offset, (vm_size_t)(prev_entry->end - prev_entry->start), @@ -1200,8 +1200,8 @@ charged: prev_entry->end = end; vm_map_entry_resize_free(map, prev_entry); vm_map_simplify_entry(map, prev_entry); - if (uip != NULL) - uifree(uip); + if (cred != NULL) + crfree(cred); return (KERN_SUCCESS); } @@ -1215,11 +1215,11 @@ charged: offset = prev_entry->offset + (prev_entry->end - prev_entry->start); vm_object_reference(object); - if (uip != NULL && object != NULL && object->uip != NULL && + if (cred != NULL && object != NULL && object->cred != NULL && !(prev_entry->eflags & MAP_ENTRY_NEEDS_COPY)) { /* Object already accounts for this uid. */ - uifree(uip); - uip = NULL; + crfree(cred); + cred = NULL; } } @@ -1235,7 +1235,7 @@ charged: new_entry = vm_map_entry_create(map); new_entry->start = start; new_entry->end = end; - new_entry->uip = NULL; + new_entry->cred = NULL; new_entry->eflags = protoeflags; new_entry->object.vm_object = object; @@ -1247,9 +1247,9 @@ charged: new_entry->max_protection = max; new_entry->wired_count = 0; - KASSERT(uip == NULL || !ENTRY_CHARGED(new_entry), + KASSERT(cred == NULL || !ENTRY_CHARGED(new_entry), ("OVERCOMMIT: vm_map_insert leaks vm_map %p", new_entry)); - new_entry->uip = uip; + new_entry->cred = cred; /* * Insert the new entry into the list @@ -1466,7 +1466,7 @@ vm_map_simplify_entry(vm_map_t map, vm_m (prev->max_protection == entry->max_protection) && (prev->inheritance == entry->inheritance) && (prev->wired_count == entry->wired_count) && - (prev->uip == entry->uip)) { + (prev->cred == entry->cred)) { vm_map_entry_unlink(map, prev); entry->start = prev->start; entry->offset = prev->offset; @@ -1484,8 +1484,8 @@ vm_map_simplify_entry(vm_map_t map, vm_m */ if (prev->object.vm_object) vm_object_deallocate(prev->object.vm_object); - if (prev->uip != NULL) - uifree(prev->uip); + if (prev->cred != NULL) + crfree(prev->cred); vm_map_entry_dispose(map, prev); } } @@ -1502,7 +1502,7 @@ vm_map_simplify_entry(vm_map_t map, vm_m (next->max_protection == entry->max_protection) && (next->inheritance == entry->inheritance) && (next->wired_count == entry->wired_count) && - (next->uip == entry->uip)) { + (next->cred == entry->cred)) { vm_map_entry_unlink(map, next); entry->end = next->end; vm_map_entry_resize_free(map, entry); @@ -1512,8 +1512,8 @@ vm_map_simplify_entry(vm_map_t map, vm_m */ if (next->object.vm_object) vm_object_deallocate(next->object.vm_object); - if (next->uip != NULL) - uifree(next->uip); + if (next->cred != NULL) + crfree(next->cred); vm_map_entry_dispose(map, next); } } @@ -1562,21 +1562,21 @@ _vm_map_clip_start(vm_map_t map, vm_map_ atop(entry->end - entry->start)); entry->object.vm_object = object; entry->offset = 0; - if (entry->uip != NULL) { - object->uip = entry->uip; + if (entry->cred != NULL) { + object->cred = entry->cred; object->charge = entry->end - entry->start; - entry->uip = NULL; + entry->cred = NULL; } } else if (entry->object.vm_object != NULL && ((entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) && - entry->uip != NULL) { + entry->cred != NULL) { VM_OBJECT_LOCK(entry->object.vm_object); - KASSERT(entry->object.vm_object->uip == NULL, - ("OVERCOMMIT: vm_entry_clip_start: both uip e %p", entry)); - entry->object.vm_object->uip = entry->uip; + KASSERT(entry->object.vm_object->cred == NULL, + ("OVERCOMMIT: vm_entry_clip_start: both cred e %p", entry)); + entry->object.vm_object->cred = entry->cred; entry->object.vm_object->charge = entry->end - entry->start; VM_OBJECT_UNLOCK(entry->object.vm_object); - entry->uip = NULL; + entry->cred = NULL; } new_entry = vm_map_entry_create(map); @@ -1585,8 +1585,8 @@ _vm_map_clip_start(vm_map_t map, vm_map_ new_entry->end = start; entry->offset += (start - entry->start); entry->start = start; - if (new_entry->uip != NULL) - uihold(entry->uip); + if (new_entry->cred != NULL) + crhold(entry->cred); vm_map_entry_link(map, entry->prev, new_entry); @@ -1632,21 +1632,21 @@ _vm_map_clip_end(vm_map_t map, vm_map_en atop(entry->end - entry->start)); entry->object.vm_object = object; entry->offset = 0; - if (entry->uip != NULL) { - object->uip = entry->uip; + if (entry->cred != NULL) { + object->cred = entry->cred; object->charge = entry->end - entry->start; - entry->uip = NULL; + entry->cred = NULL; } } else if (entry->object.vm_object != NULL && ((entry->eflags & MAP_ENTRY_NEEDS_COPY) == 0) && - entry->uip != NULL) { + entry->cred != NULL) { VM_OBJECT_LOCK(entry->object.vm_object); - KASSERT(entry->object.vm_object->uip == NULL, - ("OVERCOMMIT: vm_entry_clip_end: both uip e %p", entry)); - entry->object.vm_object->uip = entry->uip; + KASSERT(entry->object.vm_object->cred == NULL, + ("OVERCOMMIT: vm_entry_clip_end: both cred e %p", entry)); + entry->object.vm_object->cred = entry->cred; entry->object.vm_object->charge = entry->end - entry->start; VM_OBJECT_UNLOCK(entry->object.vm_object); - entry->uip = NULL; + entry->cred = NULL; } /* @@ -1657,8 +1657,8 @@ _vm_map_clip_end(vm_map_t map, vm_map_en new_entry->start = entry->end = end; new_entry->offset += (end - entry->start); - if (new_entry->uip != NULL) - uihold(entry->uip); + if (new_entry->cred != NULL) + crhold(entry->cred); vm_map_entry_link(map, entry, new_entry); @@ -1812,7 +1812,7 @@ vm_map_protect(vm_map_t map, vm_offset_t { vm_map_entry_t current, entry; vm_object_t obj; - struct uidinfo *uip; + struct ucred *cred; vm_prot_t old_prot; vm_map_lock(map); @@ -1858,7 +1858,7 @@ vm_map_protect(vm_map_t map, vm_offset_t continue; } - uip = curthread->td_ucred->cr_ruidinfo; + cred = curthread->td_ucred; obj = current->object.vm_object; if (obj == NULL || (current->eflags & MAP_ENTRY_NEEDS_COPY)) { @@ -1866,8 +1866,8 @@ vm_map_protect(vm_map_t map, vm_offset_t vm_map_unlock(map); return (KERN_RESOURCE_SHORTAGE); } - uihold(uip); - current->uip = uip; + crhold(cred); + current->cred = cred; continue; } @@ -1890,8 +1890,8 @@ vm_map_protect(vm_map_t map, vm_offset_t return (KERN_RESOURCE_SHORTAGE); } - uihold(uip); - obj->uip = uip; + crhold(cred); + obj->cred = cred; obj->charge = ptoa(obj->size); VM_OBJECT_UNLOCK(obj); } @@ -2640,16 +2640,16 @@ vm_map_entry_delete(vm_map_t map, vm_map size = entry->end - entry->start; map->size -= size; - if (entry->uip != NULL) { - swap_release_by_uid(size, entry->uip); - uifree(entry->uip); + if (entry->cred != NULL) { + swap_release_by_cred(size, entry->cred); + crfree(entry->cred); } if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0 && (object != NULL)) { - KASSERT(entry->uip == NULL || object->uip == NULL || + KASSERT(entry->cred == NULL || object->cred == NULL || (entry->eflags & MAP_ENTRY_NEEDS_COPY), - ("OVERCOMMIT vm_map_entry_delete: both uip %p", entry)); + ("OVERCOMMIT vm_map_entry_delete: both cred %p", entry)); count = OFF_TO_IDX(size); offidxstart = OFF_TO_IDX(entry->offset); offidxend = offidxstart + count; @@ -2665,11 +2665,11 @@ vm_map_entry_delete(vm_map_t map, vm_map offidxstart < object->size) { size1 = object->size; object->size = offidxstart; - if (object->uip != NULL) { + if (object->cred != NULL) { size1 -= object->size; KASSERT(object->charge >= ptoa(size1), ("vm_map_entry_delete: object->charge < 0")); - swap_release_by_uid(ptoa(size1), object->uip); + swap_release_by_cred(ptoa(size1), object->cred); object->charge -= ptoa(size1); } } @@ -2855,7 +2855,7 @@ vm_map_copy_entry( { vm_object_t src_object; vm_offset_t size; - struct uidinfo *uip; + struct ucred *cred; int charged; VM_MAP_ASSERT_LOCKED(dst_map); @@ -2894,25 +2894,25 @@ vm_map_copy_entry( } vm_object_reference_locked(src_object); vm_object_clear_flag(src_object, OBJ_ONEMAPPING); - if (src_entry->uip != NULL && + if (src_entry->cred != NULL && !(src_entry->eflags & MAP_ENTRY_NEEDS_COPY)) { - KASSERT(src_object->uip == NULL, - ("OVERCOMMIT: vm_map_copy_entry: uip %p", + KASSERT(src_object->cred == NULL, + ("OVERCOMMIT: vm_map_copy_entry: cred %p", src_object)); - src_object->uip = src_entry->uip; + src_object->cred = src_entry->cred; src_object->charge = size; } VM_OBJECT_UNLOCK(src_object); dst_entry->object.vm_object = src_object; if (charged) { - uip = curthread->td_ucred->cr_ruidinfo; - uihold(uip); - dst_entry->uip = uip; + cred = curthread->td_ucred; + crhold(cred); + dst_entry->cred = cred; *fork_charge += size; if (!(src_entry->eflags & MAP_ENTRY_NEEDS_COPY)) { - uihold(uip); - src_entry->uip = uip; + crhold(cred); + src_entry->cred = cred; *fork_charge += size; } } @@ -2922,9 +2922,9 @@ vm_map_copy_entry( } else { dst_entry->object.vm_object = NULL; dst_entry->offset = 0; - if (src_entry->uip != NULL) { - dst_entry->uip = curthread->td_ucred->cr_ruidinfo; - uihold(dst_entry->uip); + if (src_entry->cred != NULL) { + dst_entry->cred = curthread->td_ucred; + crhold(dst_entry->cred); *fork_charge += size; } } @@ -3026,11 +3026,11 @@ vmspace_fork(struct vmspace *vm1, vm_oof atop(old_entry->end - old_entry->start)); old_entry->object.vm_object = object; old_entry->offset = 0; - if (old_entry->uip != NULL) { - object->uip = old_entry->uip; + if (old_entry->cred != NULL) { + object->cred = old_entry->cred; object->charge = old_entry->end - old_entry->start; - old_entry->uip = NULL; + old_entry->cred = NULL; } } @@ -3058,11 +3058,11 @@ vmspace_fork(struct vmspace *vm1, vm_oof } VM_OBJECT_LOCK(object); vm_object_clear_flag(object, OBJ_ONEMAPPING); - if (old_entry->uip != NULL) { - KASSERT(object->uip == NULL, ("vmspace_fork both uip")); - object->uip = old_entry->uip; + if (old_entry->cred != NULL) { + KASSERT(object->cred == NULL, ("vmspace_fork both cred")); + object->cred = old_entry->cred; object->charge = old_entry->end - old_entry->start; - old_entry->uip = NULL; + old_entry->cred = NULL; } VM_OBJECT_UNLOCK(object); @@ -3102,7 +3102,7 @@ vmspace_fork(struct vmspace *vm1, vm_oof MAP_ENTRY_IN_TRANSITION); new_entry->wired_count = 0; new_entry->object.vm_object = NULL; - new_entry->uip = NULL; + new_entry->cred = NULL; vm_map_entry_link(new_map, new_map->header.prev, new_entry); vmspace_map_entry_forked(vm1, vm2, new_entry); @@ -3241,7 +3241,7 @@ vm_map_growstack(struct proc *p, vm_offs size_t grow_amount, max_grow; rlim_t stacklim, vmemlim; int is_procstack, rv; - struct uidinfo *uip; + struct ucred *cred; Retry: PROC_LOCK(p); @@ -3412,17 +3412,17 @@ Retry: } grow_amount = addr - stack_entry->end; - uip = stack_entry->uip; - if (uip == NULL && stack_entry->object.vm_object != NULL) - uip = stack_entry->object.vm_object->uip; - if (uip != NULL && !swap_reserve_by_uid(grow_amount, uip)) + cred = stack_entry->cred; + if (cred == NULL && stack_entry->object.vm_object != NULL) + cred = stack_entry->object.vm_object->cred; + if (cred != NULL && !swap_reserve_by_cred(grow_amount, cred)) rv = KERN_NO_SPACE; /* Grow the underlying object if applicable. */ else if (stack_entry->object.vm_object == NULL || vm_object_coalesce(stack_entry->object.vm_object, stack_entry->offset, (vm_size_t)(stack_entry->end - stack_entry->start), - (vm_size_t)grow_amount, uip != NULL)) { + (vm_size_t)grow_amount, cred != NULL)) { map->size += (addr - stack_entry->end); /* Update the current entry. */ stack_entry->end = addr; @@ -3503,7 +3503,7 @@ vmspace_unshare(struct proc *p) newvmspace = vmspace_fork(oldvmspace, &fork_charge); if (newvmspace == NULL) return (ENOMEM); - if (!swap_reserve_by_uid(fork_charge, p->p_ucred->cr_ruidinfo)) { + if (!swap_reserve_by_cred(fork_charge, p->p_ucred)) { vmspace_free(newvmspace); return (ENOMEM); } @@ -3553,7 +3553,7 @@ vm_map_lookup(vm_map_t *var_map, /* IN/ vm_prot_t prot; vm_prot_t fault_type = fault_typea; vm_object_t eobject; - struct uidinfo *uip; + struct ucred *cred; vm_ooffset_t size; RetryLookup:; @@ -3627,19 +3627,19 @@ RetryLookup:; if (vm_map_lock_upgrade(map)) goto RetryLookup; - if (entry->uip == NULL) { + if (entry->cred == NULL) { /* * The debugger owner is charged for * the memory. */ - uip = curthread->td_ucred->cr_ruidinfo; - uihold(uip); - if (!swap_reserve_by_uid(size, uip)) { - uifree(uip); + cred = curthread->td_ucred; + crhold(cred); + if (!swap_reserve_by_cred(size, cred)) { + crfree(cred); vm_map_unlock(map); return (KERN_RESOURCE_SHORTAGE); } - entry->uip = uip; + entry->cred = cred; } vm_object_shadow( &entry->object.vm_object, @@ -3647,19 +3647,19 @@ RetryLookup:; atop(size)); entry->eflags &= ~MAP_ENTRY_NEEDS_COPY; eobject = entry->object.vm_object; - if (eobject->uip != NULL) { + if (eobject->cred != NULL) { /* * The object was not shadowed. */ - swap_release_by_uid(size, entry->uip); - uifree(entry->uip); - entry->uip = NULL; - } else if (entry->uip != NULL) { + swap_release_by_cred(size, entry->cred); + crfree(entry->cred); + entry->cred = NULL; + } else if (entry->cred != NULL) { VM_OBJECT_LOCK(eobject); - eobject->uip = entry->uip; + eobject->cred = entry->cred; eobject->charge = size; VM_OBJECT_UNLOCK(eobject); - entry->uip = NULL; + entry->cred = NULL; } vm_map_lock_downgrade(map); @@ -3682,12 +3682,12 @@ RetryLookup:; entry->object.vm_object = vm_object_allocate(OBJT_DEFAULT, atop(size)); entry->offset = 0; - if (entry->uip != NULL) { + if (entry->cred != NULL) { VM_OBJECT_LOCK(entry->object.vm_object); - entry->object.vm_object->uip = entry->uip; + entry->object.vm_object->cred = entry->cred; entry->object.vm_object->charge = size; VM_OBJECT_UNLOCK(entry->object.vm_object); - entry->uip = NULL; + entry->cred = NULL; } vm_map_lock_downgrade(map); } @@ -3861,14 +3861,14 @@ DB_SHOW_COMMAND(map, vm_map_print) db_indent -= 2; } } else { - if (entry->uip != NULL) - db_printf(", uip %d", entry->uip->ui_uid); + if (entry->cred != NULL) + db_printf(", ruid %d", entry->cred->cr_ruid); db_printf(", object=%p, offset=0x%jx", (void *)entry->object.vm_object, (uintmax_t)entry->offset); - if (entry->object.vm_object && entry->object.vm_object->uip) - db_printf(", obj uip %d charge %jx", - entry->object.vm_object->uip->ui_uid, + if (entry->object.vm_object && entry->object.vm_object->cred) + db_printf(", obj ruid %d charge %jx", + entry->object.vm_object->cred->cr_ruid, (uintmax_t)entry->object.vm_object->charge); if (entry->eflags & MAP_ENTRY_COW) db_printf(", copy (%s)", Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Thu Dec 2 17:36:47 2010 (r216127) +++ head/sys/vm/vm_map.h Thu Dec 2 17:37:16 2010 (r216128) @@ -114,7 +114,7 @@ struct vm_map_entry { vm_inherit_t inheritance; /* inheritance */ int wired_count; /* can be paged if = 0 */ vm_pindex_t lastr; /* last read */ - struct uidinfo *uip; /* tmp storage for creator ref */ + struct ucred *cred; /* tmp storage for creator ref */ }; #define MAP_ENTRY_NOSYNC 0x0001 Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu Dec 2 17:36:47 2010 (r216127) +++ head/sys/vm/vm_object.c Thu Dec 2 17:37:16 2010 (r216128) @@ -213,7 +213,7 @@ _vm_object_allocate(objtype_t type, vm_p object->ref_count = 1; object->memattr = VM_MEMATTR_DEFAULT; object->flags = 0; - object->uip = NULL; + object->cred = NULL; object->charge = 0; if ((object->type == OBJT_DEFAULT) || (object->type == OBJT_SWAP)) object->flags = OBJ_ONEMAPPING; @@ -634,15 +634,15 @@ vm_object_destroy(vm_object_t object) /* * Release the allocation charge. */ - if (object->uip != NULL) { + if (object->cred != NULL) { KASSERT(object->type == OBJT_DEFAULT || object->type == OBJT_SWAP, - ("vm_object_terminate: non-swap obj %p has uip", + ("vm_object_terminate: non-swap obj %p has cred", object)); - swap_release_by_uid(object->charge, object->uip); + swap_release_by_cred(object->charge, object->cred); object->charge = 0; - uifree(object->uip); - object->uip = NULL; + crfree(object->cred); + object->cred = NULL; } /* @@ -1247,9 +1247,9 @@ vm_object_split(vm_map_entry_t entry) orig_object->backing_object_offset + entry->offset; new_object->backing_object = source; } - if (orig_object->uip != NULL) { - new_object->uip = orig_object->uip; - uihold(orig_object->uip); + if (orig_object->cred != NULL) { + new_object->cred = orig_object->cred; + crhold(orig_object->cred); new_object->charge = ptoa(size); KASSERT(orig_object->charge >= ptoa(size), ("orig_object->charge < 0")); @@ -1928,20 +1928,20 @@ vm_object_coalesce(vm_object_t prev_obje /* * Account for the charge. */ - if (prev_object->uip != NULL) { + if (prev_object->cred != NULL) { /* * If prev_object was charged, then this mapping, * althought not charged now, may become writable - * later. Non-NULL uip in the object would prevent + * later. Non-NULL cred in the object would prevent * swap reservation during enabling of the write * access, so reserve swap now. Failed reservation * cause allocation of the separate object for the map * entry, and swap reservation for this entry is * managed in appropriate time. */ - if (!reserved && !swap_reserve_by_uid(ptoa(next_size), - prev_object->uip)) { + if (!reserved && !swap_reserve_by_cred(ptoa(next_size), + prev_object->cred)) { return (FALSE); } prev_object->charge += ptoa(next_size); @@ -1959,7 +1959,7 @@ vm_object_coalesce(vm_object_t prev_obje swap_pager_freespace(prev_object, next_pindex, next_size); #if 0 - if (prev_object->uip != NULL) { + if (prev_object->cred != NULL) { KASSERT(prev_object->charge >= ptoa(prev_object->size - next_pindex), ("object %p overcharged 1 %jx %jx", prev_object, @@ -2111,10 +2111,10 @@ DB_SHOW_COMMAND(object, vm_object_print_ return; db_iprintf( - "Object %p: type=%d, size=0x%jx, res=%d, ref=%d, flags=0x%x uip %d charge %jx\n", + "Object %p: type=%d, size=0x%jx, res=%d, ref=%d, flags=0x%x ruid %d charge %jx\n", object, (int)object->type, (uintmax_t)object->size, object->resident_page_count, object->ref_count, object->flags, - object->uip ? object->uip->ui_uid : -1, (uintmax_t)object->charge); + object->cred ? object->cred->cr_ruid : -1, (uintmax_t)object->charge); db_iprintf(" sref=%d, backing_object(%d)=(%p)+0x%jx\n", object->shadow_count, object->backing_object ? object->backing_object->ref_count : 0, Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Thu Dec 2 17:36:47 2010 (r216127) +++ head/sys/vm/vm_object.h Thu Dec 2 17:37:16 2010 (r216128) @@ -143,7 +143,7 @@ struct vm_object { int swp_bcount; } swp; } un_pager; - struct uidinfo *uip; + struct ucred *cred; vm_ooffset_t charge; }; From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 18:24:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 525E71065679; Thu, 2 Dec 2010 18:24:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40BA18FC21; Thu, 2 Dec 2010 18:24:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB2IONGE022535; Thu, 2 Dec 2010 18:24:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB2IONIv022533; Thu, 2 Dec 2010 18:24:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201012021824.oB2IONIv022533@svn.freebsd.org> From: Xin LI Date: Thu, 2 Dec 2010 18:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216130 - head/usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 18:24:23 -0000 Author: delphij Date: Thu Dec 2 18:24:22 2010 New Revision: 216130 URL: http://svn.freebsd.org/changeset/base/216130 Log: Decode IPC_CREAT and IPC_EXCL for semget(2). PR: bin/152781 Submitted by: Anton Yuzhaninov MFC after: 2 weeks Modified: head/usr.bin/kdump/mksubr Modified: head/usr.bin/kdump/mksubr ============================================================================== --- head/usr.bin/kdump/mksubr Thu Dec 2 18:01:18 2010 (r216129) +++ head/usr.bin/kdump/mksubr Thu Dec 2 18:24:22 2010 (r216130) @@ -254,6 +254,8 @@ shmctlname (int cmd) { void semgetname (int flag) { int or = 0; + if_print_or(flag, IPC_CREAT, or); + if_print_or(flag, IPC_EXCL, or); if_print_or(flag, SEM_R, or); if_print_or(flag, SEM_A, or); if_print_or(flag, (SEM_R>>3), or); From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 18:37:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B17C710656A4; Thu, 2 Dec 2010 18:37:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F7F98FC18; Thu, 2 Dec 2010 18:37:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB2IbZi8023100; Thu, 2 Dec 2010 18:37:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB2IbZrj023098; Thu, 2 Dec 2010 18:37:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012021837.oB2IbZrj023098@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 2 Dec 2010 18:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216131 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 18:37:35 -0000 Author: yongari Date: Thu Dec 2 18:37:34 2010 New Revision: 216131 URL: http://svn.freebsd.org/changeset/base/216131 Log: Document loader tunable hw.re.prefer_iomap. Modified: head/share/man/man4/re.4 Modified: head/share/man/man4/re.4 ============================================================================== --- head/share/man/man4/re.4 Thu Dec 2 18:24:22 2010 (r216130) +++ head/share/man/man4/re.4 Thu Dec 2 18:37:34 2010 (r216131) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 27, 2010 +.Dd December 2, 2010 .Dt RE 4 .Os .Sh NAME @@ -178,6 +178,11 @@ prompt before booting the kernel or stor .It Va hw.re.msi_disable This tunable disables MSI support on the Ethernet hardware. The default value is 0. +.It Va hw.re.prefer_iomap +This tunable controls which register mapping should be used on the +specified device. +A non-zero value enables I/O space register mapping. +The default value is 0 to use memory space register mapping. .El .Sh DIAGNOSTICS .Bl -diag From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 18:58:25 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAC75106566B; Thu, 2 Dec 2010 18:58:25 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 7B66E8FC08; Thu, 2 Dec 2010 18:58:25 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.4/8.14.2) with ESMTP id oB2IwOxL028634; Thu, 2 Dec 2010 13:58:24 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.4/8.14.2/Submit) id oB2IwO71028633; Thu, 2 Dec 2010 13:58:24 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Thu, 2 Dec 2010 13:58:24 -0500 From: David Schultz To: Garrett Cooper Message-ID: <20101202185824.GA28587@zim.MIT.EDU> Mail-Followup-To: Garrett Cooper , Kostik Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201006121732.o5CHW5Cs065722@svn.freebsd.org> <20100615084939.GL13238@deviant.kiev.zoral.com.ua> <20100615131443.GA93094@zim.MIT.EDU> <20101202045728.GA19295@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Cc: Kostik Belousov , svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r209110 - in head/lib/msun: . src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 18:58:25 -0000 On Wed, Dec 01, 2010, Garrett Cooper wrote: > >> Any thoughts on removing the isnanf and __isnanf symbols from > >> libm?  Both symbols are already in libc for historical reasons, so > >> the duplication isn't needed. > >> > >> Although we've had the duplicate isnanf symbol in libm for several > >> releases, I don't believe removing it will cause problems; apps > >> will just pick up the libc version.  __isnanf is only present in > >> libm in 9-CURRENT (due to the commit referenced above).  Because > >> of symbol version differences, however, removing it will affect > >> apps that were linked under 9-CURRENT AND rely on isnanf AND link > >> against libm before libc.  On my system, libwebkit is the only > >> affected binary I could find. > > > >    Yeah... it's going to be broken according to the manpage (manpage > > explicitly calls out -lm and math.h) and POSIX (POSIX only calls out > > math.h) as math.h lives in lib/msun for C apps: > > > > $ find /usr/src/ -name math.h > > /usr/src/contrib/libstdc++/include/tr1/math.h > > /usr/src/contrib/libstdc++/include/c_compatibility/math.h > > /usr/src/lib/msun/src/math.h > > > >    So unless math.h is going to move to libc, I'd leave it alone if I > > was making the final call. A few math library functions are in libc because they've always been there historically, and it seems impractical to change that. In a few cases, they're in libc because other parts of libc (e.g., printf) require their functionality anyway. libm also depends on libc, so the fact that a few things are in libc instead of libm isn't a problem. > Arg -- please ignore this email. I did another search and you said > isnanf, not isnan. It's not mentioned anywhere in POSIX land or in any > of our manpages. > Sorry bout that, > -Garrett In C99, isnan() is actually a type-generic macro, and in FreeBSD, it expands to __isnanf() when the argument is a float. From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 19:00:18 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6422A1065693; Thu, 2 Dec 2010 19:00:17 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 9FBEE8FC19; Thu, 2 Dec 2010 19:00:11 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.4/8.14.2) with ESMTP id oB2J0AcW028670; Thu, 2 Dec 2010 14:00:10 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.4/8.14.2/Submit) id oB2J0AXC028669; Thu, 2 Dec 2010 14:00:10 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Thu, 2 Dec 2010 14:00:10 -0500 From: David Schultz To: Kostik Belousov Message-ID: <20101202190010.GB28587@zim.MIT.EDU> Mail-Followup-To: Kostik Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201006121732.o5CHW5Cs065722@svn.freebsd.org> <20100615084939.GL13238@deviant.kiev.zoral.com.ua> <20100615131443.GA93094@zim.MIT.EDU> <20101202045728.GA19295@zim.MIT.EDU> <20101202095652.GQ2392@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101202095652.GQ2392@deviant.kiev.zoral.com.ua> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r209110 - in head/lib/msun: . src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 19:00:18 -0000 On Thu, Dec 02, 2010, Kostik Belousov wrote: > For __isnanf, libc exports __isnanf@FBSD_1.0, and libm exports > __isnanf@FBSD_1.2. I suspect that we could export both > __isnanf@FBSD_1.0 and __isnanf@FBSD_1.2 from libc. I like the idea of adding an __isnanf@FBSD_1.2 alias to libc for the benefit of people running -CURRENT. From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 19:47:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F8FC106567A; Thu, 2 Dec 2010 19:47:28 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DAC38FC1E; Thu, 2 Dec 2010 19:47:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB2JlS5h025541; Thu, 2 Dec 2010 19:47:28 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB2JlSkO025539; Thu, 2 Dec 2010 19:47:28 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201012021947.oB2JlSkO025539@svn.freebsd.org> From: Ivan Voras Date: Thu, 2 Dec 2010 19:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216132 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 19:47:28 -0000 Author: ivoras Date: Thu Dec 2 19:47:27 2010 New Revision: 216132 URL: http://svn.freebsd.org/changeset/base/216132 Log: Add a note about the magic number 20. Actually, 22.75 entries fit in a 512 byte sector but when choosing magic numbers, 20 looks nicer. Discussed with: marcel Modified: head/sys/geom/part/g_part_bsd.c Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Thu Dec 2 18:37:34 2010 (r216131) +++ head/sys/geom/part/g_part_bsd.c Thu Dec 2 19:47:27 2010 (r216132) @@ -99,7 +99,7 @@ static struct g_part_scheme g_part_bsd_s sizeof(struct g_part_bsd_table), .gps_entrysz = sizeof(struct g_part_bsd_entry), .gps_minent = 8, - .gps_maxent = 20, + .gps_maxent = 20, /* Only 22 entries fit in 512 byte sectors */ .gps_bootcodesz = BBSIZE, }; G_PART_SCHEME_DECLARE(g_part_bsd); From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 20:24:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B172E106564A; Thu, 2 Dec 2010 20:24:11 +0000 (UTC) (envelope-from weongyo.jeong@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id D66888FC1C; Thu, 2 Dec 2010 20:24:10 +0000 (UTC) Received: by eyb7 with SMTP id 7so4789414eyb.13 for ; Thu, 02 Dec 2010 12:24:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent:organization:x-operation-sytem; bh=7pvPorq+PaA3/oMaHLuJ1DppZ1yFGbj/qm6Y3PtBavw=; b=CNSA4ARSfxERcyscMmkVYNSo6VFBWDOty/mwqrhr0HRrf/AJ8ZSj7Ou4bHmFzkMW5C +UOwfcWIg6bIDc+DxSffTnA+Wj01wG4reBiYpK1hiyebx1wIx7LYCj2qh3gUW1sKX2HL QNSMUN8/DTIYNxTPDwR3SSk9ph2GdrjKZiKZ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent:organization:x-operation-sytem; b=YtecrKBXAKn99nOmf5E6TpnL8nLadUqDg+0aF1vTf+I9ecbiPi6qD3lnYCrPk5lkfm Gc+8M9PhwGzhE1kDyxNp1sHgOwEV+l8VBtxe8wDRkYbxDoTyE8W5APxv1AKytGtfc7DJ J3p3muoybrn0yuFy3zoXuiQykReIZWF49INjU= Received: by 10.223.101.196 with SMTP id d4mr1092312fao.23.1291319841758; Thu, 02 Dec 2010 11:57:21 -0800 (PST) Received: from weongyo ([174.35.1.224]) by mx.google.com with ESMTPS id f24sm358003fak.24.2010.12.02.11.57.17 (version=SSLv3 cipher=RC4-MD5); Thu, 02 Dec 2010 11:57:20 -0800 (PST) Received: by weongyo (sSMTP sendmail emulation); Thu, 02 Dec 2010 11:57:22 -0800 From: Weongyo Jeong Date: Thu, 2 Dec 2010 11:57:22 -0800 To: Jung-uk Kim Message-ID: <20101202195722.GD2033@weongyo> Mail-Followup-To: Jung-uk Kim , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201012010351.oB13p6du062509@svn.freebsd.org> <201012011858.19748.jkim@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012011858.19748.jkim@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Organization: CDNetworks. X-Operation-Sytem: FreeBSD Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216091 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Weongyo Jeong List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 20:24:11 -0000 On Wed, Dec 01, 2010 at 06:58:18PM -0500, Jung-uk Kim wrote: > On Tuesday 30 November 2010 10:51 pm, Weongyo Jeong wrote: > > Author: weongyo > > Date: Wed Dec 1 03:51:06 2010 > > New Revision: 216091 > > URL: http://svn.freebsd.org/changeset/base/216091 > > > > Log: > > Explicitly UP and DOWN the usbus interfaces (IFT_USB) when it's > > attached or detached. Normally it should be changed through user > > land ioctl(2) system calls but it looks there's no apps for USB and > > no need. > > > > With this patch, libpcap would detect the usbus interfaces > > correctly and tcpdump(1) could dump the USB packets into PCAP > > format with -w option. However it couldn't print the output to > > console because there's no printer-routine at tcpdump(1). > > I have written a very hackish USB packet printer for tcpdump based on > Linux version. > > http://people.freebsd.org/~jkim/tcpdump-usb.diff Looks good to me. > Note we can only print headers as Linux version does. > > Are you planning on adopting DLT_USB_LINUX or DLT_USB_LINUX_MMAPPED or > applying for our own DLT, BTW? Frankly speaking, not sure yet. As you know, DLT_USB_LINUX and DLT_USB_LINUX_MMAPPED types are very specific only for Linux and each types has different structure size (48 bytes and 64 bytes). IMHO linux thought their own format only instead of thinking/defining a generic format. I think we have some cases we could select as follows: 1) Define a generic USB packet header form and make a consensus with linux guys then uses DLT_USB type. 2) Define DLT_USB_BSD and write our own code. 3) Changes `struct usbpf_pkthdr' to be compatible with linux format though it's expected to have some wasted variables (e.g. time stamp). regards, Weongyo Jeong From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 20:43:51 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 272A8106564A; Thu, 2 Dec 2010 20:43:51 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9C6028FC1E; Thu, 2 Dec 2010 20:43:50 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id oB2Khn9A076631 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Dec 2010 21:43:49 +0100 (CET) (envelope-from uqs@FreeBSD.org) Date: Thu, 2 Dec 2010 21:43:49 +0100 From: Ulrich Spoerlein To: Alexander Leidinger Message-ID: <20101202204349.GB3256@acme.spoerlein.net> Mail-Followup-To: Ulrich Spoerlein , Alexander Leidinger , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201012021046.oB2Ak5EV000582@svn.freebsd.org> <20101202154522.76174hkekl2ct4pw@webmail.leidinger.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="IJpNTDwzlM2Ie8A6" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20101202154522.76174hkekl2ct4pw@webmail.leidinger.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216119 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 20:43:51 -0000 --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, 02.12.2010 at 15:45:22 +0100, Alexander Leidinger wrote: > Quoting Ulrich Spoerlein (from Thu, 2 Dec 2010 > 10:46:05 +0000 (UTC)): > > > Author: uqs > > Date: Thu Dec 2 10:46:05 2010 > > New Revision: 216119 > > URL: http://svn.freebsd.org/changeset/base/216119 > > > > Log: > > Remove more duplicates. > > > > Just so that I can lookup the command for the next time: > > Can you please add it to OldFiles.inc instead, with a comment what it does? > > > for t in `make -V TARGETS universe`; do > > __MAKE_CONF=/dev/null make -f Makefile.inc1 -m $PWD/share/mk TARGET=$t \ > > -V OLD_FILES -V OLD_LIBS -V OLD_DIRS delete-old | \ > > xargs -n1|sort|uniq -c|egrep -v "^ *1 "; > > done > > While it does not matter for "-V OLD*", the spirit of the command is > more like the check-old target (which is including shared libs) than > the delete-old target (which does not delete shared libs but only > static libs). Using check-old would also remove the (wrong, but not > far fetched) fear of actually deleting something with this command. Something that bugs me more, is all the TARGET_ARCH conditionals in that file, that serve practically no purpose. If a file only existed on i386, and it has been removed on i386, there's no point in wrapping this under TARGET_ARCH=i386. The wrapping of all lib32 files for amd64 is a great example :/ The wrapping is only ever required, if some file has been removed from a set of arches, but must be retained on others. Anyway, please see attached. Uli --IJpNTDwzlM2Ie8A6 Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="obsolete.diff" Content-Transfer-Encoding: 8bit commit 2c5b79ffde80760690baee61d30b0f533e511ca3 Author: Ulrich Spörlein Date: Thu Dec 2 21:23:58 2010 +0100 Document two more ways to find duplicates in the obsolete file list. Remove the only duplicate found by the optional files check. Fix typos, while here. Suggested by: netchild diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 0756547..e406532 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -22,16 +22,31 @@ # grep '+=' /usr/src/tools/build/mk/OptionalObsoleteFiles.inc | sort -u) | \ # sort | uniq -d # +# To find regular duplicates not dependant on optional components, you can +# also use something that will not give you false positives, e.g.: +# for t in `make -V TARGETS universe`; do +# __MAKE_CONF=/dev/null make -f Makefile.inc1 TARGET=$t \ +# -V OLD_FILES -V OLD_LIBS -V OLD_DIRS check-old | \ +# xargs -n1 | sort | uniq -d; +# done +# +# For optional components, you can use the following to see if some entries +# in OptionalObsoleteFiles.inc have been obsoleted by ObsoleteFiles.inc +# for o in tools/build/options/WITH*; do +# __MAKE_CONF=/dev/null make -f Makefile.inc1 -D${o##*/} \ +# -V OLD_FILES -V OLD_LIBS -V OLD_DIRS check-old | \ +# xargs -n1 | sort | uniq -d; +# done # 20101112: vgonel(9) has gone to private API a while ago OLD_FILES+=usr/share/man/man9/vgonel.9.gz # 20101112: removed gasp.info OLD_FILES+=usr/share/info/gasp.info.gz -# 20101109: headers moved to machine/ to x86/ +# 20101109: headers moved from machine/ to x86/ .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/machine/mptable.h .endif -# 20101101: headers moved to machine/ to x86/ +# 20101101: headers moved from machine/ to x86/ .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/machine/apicreg.h OLD_FILES+=usr/include/machine/mca.h diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 02a4ce3..db8251c 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -1869,7 +1869,6 @@ OLD_FILES+=usr/lib/libfl_p.a OLD_FILES+=usr/lib/libform_p.a OLD_FILES+=usr/lib/libformw_p.a OLD_FILES+=usr/lib/libftpio_p.a -OLD_FILES+=usr/lib/libg2c_p.a OLD_FILES+=usr/lib/libgcc_p.a OLD_FILES+=usr/lib/libgeom_p.a OLD_FILES+=usr/lib/libgnuregex_p.a --IJpNTDwzlM2Ie8A6-- From owner-svn-src-head@FreeBSD.ORG Thu Dec 2 22:19:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 988CF106564A; Thu, 2 Dec 2010 22:19:30 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82BE38FC12; Thu, 2 Dec 2010 22:19:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB2MJUq8031480; Thu, 2 Dec 2010 22:19:30 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB2MJUx5031472; Thu, 2 Dec 2010 22:19:30 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201012022219.oB2MJUx5031472@svn.freebsd.org> From: Bruce Cran Date: Thu, 2 Dec 2010 22:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216134 - in head: share/man/man9 sys/amd64/include sys/arm/include sys/i386/include sys/ia64/include sys/mips/include sys/pc98/include sys/powerpc/include sys/sparc64/include sys/sun4v... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 22:19:30 -0000 Author: brucec Date: Thu Dec 2 22:19:30 2010 New Revision: 216134 URL: http://svn.freebsd.org/changeset/base/216134 Log: Disallow passing in a count of zero bytes to the bus_space(9) functions. Passing a count of zero on i386 and amd64 for [I386|AMD64]_BUS_SPACE_MEM causes a crash/hang since the 'loop' instruction decrements the counter before checking if it's zero. PR: kern/80980 Discussed with: jhb Modified: head/share/man/man9/bus_space.9 head/sys/amd64/include/bus.h head/sys/arm/include/bus.h head/sys/i386/include/bus.h head/sys/ia64/include/bus.h head/sys/mips/include/bus.h head/sys/pc98/include/bus.h head/sys/powerpc/include/bus.h head/sys/sparc64/include/bus.h head/sys/sun4v/include/bus.h Modified: head/share/man/man9/bus_space.9 ============================================================================== --- head/share/man/man9/bus_space.9 Thu Dec 2 22:00:57 2010 (r216133) +++ head/share/man/man9/bus_space.9 Thu Dec 2 22:19:30 2010 (r216134) @@ -719,6 +719,9 @@ or which return data read from bus space do not obviously return an error code) do not fail. They could only fail if given invalid arguments, and in that case their behaviour is undefined. +Functions which take a count of bytes must not pass in a count of zero; +doing so will cause a panic if the kernel was compiled with +.Cd "options INVARIANTS" . .Sh TYPES Several types are defined in .In machine/bus.h Modified: head/sys/amd64/include/bus.h ============================================================================== --- head/sys/amd64/include/bus.h Thu Dec 2 22:00:57 2010 (r216133) +++ head/sys/amd64/include/bus.h Thu Dec 2 22:19:30 2010 (r216134) @@ -104,6 +104,9 @@ #ifndef _AMD64_BUS_H_ #define _AMD64_BUS_H_ +#include +#include + #include #include @@ -268,7 +271,7 @@ static __inline void bus_space_read_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int8_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) insb(bsh + offset, addr, count); else { @@ -289,7 +292,7 @@ static __inline void bus_space_read_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int16_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) insw(bsh + offset, addr, count); else { @@ -310,7 +313,7 @@ static __inline void bus_space_read_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int32_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) insl(bsh + offset, addr, count); else { @@ -356,7 +359,7 @@ static __inline void bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int8_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -388,7 +391,7 @@ static __inline void bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int16_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -420,7 +423,7 @@ static __inline void bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int32_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -532,7 +535,7 @@ static __inline void bus_space_write_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int8_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) outsb(bsh + offset, addr, count); else { @@ -553,7 +556,7 @@ static __inline void bus_space_write_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int16_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) outsw(bsh + offset, addr, count); else { @@ -574,7 +577,7 @@ static __inline void bus_space_write_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int32_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) outsl(bsh + offset, addr, count); else { @@ -621,7 +624,7 @@ static __inline void bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int8_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -653,7 +656,7 @@ static __inline void bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int16_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -685,7 +688,7 @@ static __inline void bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int32_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -877,6 +880,7 @@ bus_space_copy_region_1(bus_space_tag_t bus_space_handle_t addr1 = bsh1 + off1; bus_space_handle_t addr2 = bsh2 + off2; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) { if (addr1 >= addr2) { /* src after dest: copy forward */ @@ -912,6 +916,7 @@ bus_space_copy_region_2(bus_space_tag_t bus_space_handle_t addr1 = bsh1 + off1; bus_space_handle_t addr2 = bsh2 + off2; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) { if (addr1 >= addr2) { /* src after dest: copy forward */ @@ -947,6 +952,7 @@ bus_space_copy_region_4(bus_space_tag_t bus_space_handle_t addr1 = bsh1 + off1; bus_space_handle_t addr2 = bsh2 + off2; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) { if (addr1 >= addr2) { /* src after dest: copy forward */ Modified: head/sys/arm/include/bus.h ============================================================================== --- head/sys/arm/include/bus.h Thu Dec 2 22:00:57 2010 (r216133) +++ head/sys/arm/include/bus.h Thu Dec 2 22:19:30 2010 (r216134) @@ -66,6 +66,9 @@ #ifndef _MACHINE_BUS_H_ #define _MACHINE_BUS_H_ +#include +#include + #include /* @@ -318,21 +321,29 @@ struct bus_space { * Bus read multiple operations. */ #define bus_space_read_multi_1(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_1: count == 0")); \ __bs_nonsingle(rm,1,(t),(h),(o),(a),(c)) #define bus_space_read_multi_2(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_2: count == 0")); \ __bs_nonsingle(rm,2,(t),(h),(o),(a),(c)) #define bus_space_read_multi_4(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_4: count == 0")); \ __bs_nonsingle(rm,4,(t),(h),(o),(a),(c)) #define bus_space_read_multi_8(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_8: count == 0")); \ __bs_nonsingle(rm,8,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_1(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_stream_1: count == 0")); \ __bs_nonsingle_s(rm,1,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_2(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_stream_2: count == 0")); \ __bs_nonsingle_s(rm,2,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_4(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_stream_4: count == 0")); \ __bs_nonsingle_s(rm,4,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_8(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_stream_8: count == 0")); \ __bs_nonsingle_s(rm,8,(t),(h),(o),(a),(c)) @@ -340,21 +351,29 @@ struct bus_space { * Bus read region operations. */ #define bus_space_read_region_1(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_region_1: count == 0")); \ __bs_nonsingle(rr,1,(t),(h),(o),(a),(c)) #define bus_space_read_region_2(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_region_2: count == 0")); \ __bs_nonsingle(rr,2,(t),(h),(o),(a),(c)) #define bus_space_read_region_4(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_region_4: count == 0")); \ __bs_nonsingle(rr,4,(t),(h),(o),(a),(c)) #define bus_space_read_region_8(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_region_8: count == 0")); \ __bs_nonsingle(rr,8,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_1(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_region_stream_1: count == 0"));\ __bs_nonsingle_s(rr,1,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_2(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_region_stream_2: count == 0"));\ __bs_nonsingle_s(rr,2,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_4(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_region_stream_4: count == 0"));\ __bs_nonsingle_s(rr,4,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_8(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_region_stream_8 count == 0")); \ __bs_nonsingle_s(rr,8,(t),(h),(o),(a),(c)) @@ -376,21 +395,29 @@ struct bus_space { * Bus write multiple operations. */ #define bus_space_write_multi_1(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_multi_1: count == 0")); \ __bs_nonsingle(wm,1,(t),(h),(o),(a),(c)) #define bus_space_write_multi_2(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_multi_2: count == 0")); \ __bs_nonsingle(wm,2,(t),(h),(o),(a),(c)) #define bus_space_write_multi_4(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_multi_4: count == 0")); \ __bs_nonsingle(wm,4,(t),(h),(o),(a),(c)) #define bus_space_write_multi_8(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_multi_8: count == 0")); \ __bs_nonsingle(wm,8,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_1(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_multi_stream_1: count == 0"));\ __bs_nonsingle_s(wm,1,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_2(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_multi_stream_2: count == 0"));\ __bs_nonsingle_s(wm,2,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_4(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_multi_stream_4: count == 0"));\ __bs_nonsingle_s(wm,4,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_8(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_multi_stream_8: count == 0"));\ __bs_nonsingle_s(wm,8,(t),(h),(o),(a),(c)) @@ -398,34 +425,50 @@ struct bus_space { * Bus write region operations. */ #define bus_space_write_region_1(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_region_1: count == 0")); \ __bs_nonsingle(wr,1,(t),(h),(o),(a),(c)) #define bus_space_write_region_2(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_region_2: count == 0")); \ __bs_nonsingle(wr,2,(t),(h),(o),(a),(c)) #define bus_space_write_region_4(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_region_4: count == 0")); \ __bs_nonsingle(wr,4,(t),(h),(o),(a),(c)) #define bus_space_write_region_8(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_region_8: count == 0")); \ __bs_nonsingle(wr,8,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_1(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_write_region_stream_1: count == 0")); \ __bs_nonsingle_s(wr,1,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_2(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_write_region_stream_2: count == 0")); \ __bs_nonsingle_s(wr,2,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_4(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_write_region_stream_4: count == 0")); \ __bs_nonsingle_s(wr,4,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_8(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_write_region_stream_8: count == 0")); \ __bs_nonsingle_s(wr,8,(t),(h),(o),(a),(c)) /* * Set multiple operations. */ -#define bus_space_set_multi_1(t, h, o, v, c) \ +#define bus_space_set_multi_1(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_multi_1: count == 0")); \ __bs_set(sm,1,(t),(h),(o),(v),(c)) -#define bus_space_set_multi_2(t, h, o, v, c) \ +#define bus_space_set_multi_2(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_multi_2: count == 0")); \ __bs_set(sm,2,(t),(h),(o),(v),(c)) -#define bus_space_set_multi_4(t, h, o, v, c) \ +#define bus_space_set_multi_4(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_multi_4: count == 0")); \ __bs_set(sm,4,(t),(h),(o),(v),(c)) -#define bus_space_set_multi_8(t, h, o, v, c) \ +#define bus_space_set_multi_8(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_multi_8: count == 0")); \ __bs_set(sm,8,(t),(h),(o),(v),(c)) @@ -433,25 +476,33 @@ struct bus_space { * Set region operations. */ #define bus_space_set_region_1(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_region_1: count == 0")); \ __bs_set(sr,1,(t),(h),(o),(v),(c)) #define bus_space_set_region_2(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_region_2: count == 0")); \ __bs_set(sr,2,(t),(h),(o),(v),(c)) #define bus_space_set_region_4(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_region_4: count == 0")); \ __bs_set(sr,4,(t),(h),(o),(v),(c)) #define bus_space_set_region_8(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_region_8: count == 0")); \ __bs_set(sr,8,(t),(h),(o),(v),(c)) /* * Copy operations. */ -#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \ +#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \ + KASSERT(c != 0, ("bus_space_copy_region_1: count == 0")); \ __bs_copy(1, t, h1, o1, h2, o2, c) -#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \ +#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \ + KASSERT(c != 0, ("bus_space_copy_region_2: count == 0")); \ __bs_copy(2, t, h1, o1, h2, o2, c) -#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \ +#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \ + KASSERT(c != 0, ("bus_space_copy_region_4: count == 0")); \ __bs_copy(4, t, h1, o1, h2, o2, c) -#define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \ +#define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \ + KASSERT(c != 0, ("bus_space_copy_region_8: count == 0")); \ __bs_copy(8, t, h1, o1, h2, o2, c) /* Modified: head/sys/i386/include/bus.h ============================================================================== --- head/sys/i386/include/bus.h Thu Dec 2 22:00:57 2010 (r216133) +++ head/sys/i386/include/bus.h Thu Dec 2 22:19:30 2010 (r216134) @@ -104,6 +104,9 @@ #ifndef _I386_BUS_H_ #define _I386_BUS_H_ +#include +#include + #include #include @@ -272,7 +275,7 @@ static __inline void bus_space_read_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int8_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) insb(bsh + offset, addr, count); else { @@ -297,7 +300,7 @@ static __inline void bus_space_read_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int16_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) insw(bsh + offset, addr, count); else { @@ -322,7 +325,7 @@ static __inline void bus_space_read_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int32_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) insl(bsh + offset, addr, count); else { @@ -372,7 +375,7 @@ static __inline void bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int8_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -412,7 +415,7 @@ static __inline void bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int16_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -452,7 +455,7 @@ static __inline void bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int32_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -572,7 +575,7 @@ static __inline void bus_space_write_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int8_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) outsb(bsh + offset, addr, count); else { @@ -597,7 +600,7 @@ static __inline void bus_space_write_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int16_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) outsw(bsh + offset, addr, count); else { @@ -622,7 +625,7 @@ static __inline void bus_space_write_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int32_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) outsl(bsh + offset, addr, count); else { @@ -673,7 +676,7 @@ static __inline void bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int8_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -713,7 +716,7 @@ static __inline void bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int16_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -753,7 +756,7 @@ static __inline void bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int32_t *addr, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -818,6 +821,7 @@ bus_space_set_multi_1(bus_space_tag_t ta { bus_space_handle_t addr = bsh + offset; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) while (count--) outb(addr, value); @@ -832,6 +836,7 @@ bus_space_set_multi_2(bus_space_tag_t ta { bus_space_handle_t addr = bsh + offset; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) while (count--) outw(addr, value); @@ -846,6 +851,7 @@ bus_space_set_multi_4(bus_space_tag_t ta { bus_space_handle_t addr = bsh + offset; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) while (count--) outl(addr, value); @@ -882,6 +888,7 @@ bus_space_set_region_1(bus_space_tag_t t { bus_space_handle_t addr = bsh + offset; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) for (; count != 0; count--, addr++) outb(addr, value); @@ -896,6 +903,7 @@ bus_space_set_region_2(bus_space_tag_t t { bus_space_handle_t addr = bsh + offset; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) for (; count != 0; count--, addr += 2) outw(addr, value); @@ -910,6 +918,7 @@ bus_space_set_region_4(bus_space_tag_t t { bus_space_handle_t addr = bsh + offset; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) for (; count != 0; count--, addr += 4) outl(addr, value); @@ -953,6 +962,7 @@ bus_space_copy_region_1(bus_space_tag_t bus_space_handle_t addr1 = bsh1 + off1; bus_space_handle_t addr2 = bsh2 + off2; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) { if (addr1 >= addr2) { /* src after dest: copy forward */ @@ -988,6 +998,7 @@ bus_space_copy_region_2(bus_space_tag_t bus_space_handle_t addr1 = bsh1 + off1; bus_space_handle_t addr2 = bsh2 + off2; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) { if (addr1 >= addr2) { /* src after dest: copy forward */ @@ -1023,6 +1034,7 @@ bus_space_copy_region_4(bus_space_tag_t bus_space_handle_t addr1 = bsh1 + off1; bus_space_handle_t addr2 = bsh2 + off2; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) { if (addr1 >= addr2) { /* src after dest: copy forward */ Modified: head/sys/ia64/include/bus.h ============================================================================== --- head/sys/ia64/include/bus.h Thu Dec 2 22:00:57 2010 (r216133) +++ head/sys/ia64/include/bus.h Thu Dec 2 22:19:30 2010 (r216134) @@ -91,6 +91,9 @@ #ifndef _MACHINE_BUS_H_ #define _MACHINE_BUS_H_ +#include +#include + #include #include @@ -298,7 +301,7 @@ static __inline void bus_space_read_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_multi_io_1(bsh + ofs, bufp, count); else { @@ -311,7 +314,7 @@ static __inline void bus_space_read_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_multi_io_2(bsh + ofs, bufp, count); else { @@ -324,7 +327,7 @@ static __inline void bus_space_read_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_multi_io_4(bsh + ofs, bufp, count); else { @@ -337,7 +340,7 @@ static __inline void bus_space_read_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_multi_io_8(bsh + ofs, bufp, count); else { @@ -361,7 +364,7 @@ static __inline void bus_space_write_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_multi_io_1(bsh + ofs, bufp, count); else { @@ -374,7 +377,7 @@ static __inline void bus_space_write_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_multi_io_2(bsh + ofs, bufp, count); else { @@ -387,7 +390,7 @@ static __inline void bus_space_write_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_multi_io_4(bsh + ofs, bufp, count); else { @@ -400,7 +403,7 @@ static __inline void bus_space_write_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_multi_io_8(bsh + ofs, bufp, count); else { @@ -425,7 +428,7 @@ static __inline void bus_space_read_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_region_io_1(bsh + ofs, bufp, count); else { @@ -439,7 +442,7 @@ static __inline void bus_space_read_region_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_region_io_2(bsh + ofs, bufp, count); else { @@ -453,7 +456,7 @@ static __inline void bus_space_read_region_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_region_io_4(bsh + ofs, bufp, count); else { @@ -467,7 +470,7 @@ static __inline void bus_space_read_region_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_region_io_8(bsh + ofs, bufp, count); else { @@ -493,7 +496,7 @@ static __inline void bus_space_write_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_region_io_1(bsh + ofs, bufp, count); else { @@ -507,7 +510,7 @@ static __inline void bus_space_write_region_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_region_io_2(bsh + ofs, bufp, count); else { @@ -521,7 +524,7 @@ static __inline void bus_space_write_region_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_region_io_4(bsh + ofs, bufp, count); else { @@ -535,7 +538,7 @@ static __inline void bus_space_write_region_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *bufp, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_region_io_8(bsh + ofs, bufp, count); else { @@ -555,7 +558,7 @@ static __inline void bus_space_set_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); while (count-- > 0) bus_space_write_1(bst, bsh, ofs, val); } @@ -564,7 +567,7 @@ static __inline void bus_space_set_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); while (count-- > 0) bus_space_write_2(bst, bsh, ofs, val); } @@ -573,7 +576,7 @@ static __inline void bus_space_set_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); while (count-- > 0) bus_space_write_4(bst, bsh, ofs, val); } @@ -582,7 +585,7 @@ static __inline void bus_space_set_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); while (count-- > 0) bus_space_write_8(bst, bsh, ofs, val); } @@ -603,7 +606,7 @@ static __inline void bus_space_set_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_set_region_io_1(bsh + ofs, val, count); else { @@ -617,7 +620,7 @@ static __inline void bus_space_set_region_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_set_region_io_2(bsh + ofs, val, count); else { @@ -631,7 +634,7 @@ static __inline void bus_space_set_region_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_set_region_io_4(bsh + ofs, val, count); else { @@ -645,7 +648,7 @@ static __inline void bus_space_set_region_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t count) { - + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_set_region_io_4(bsh + ofs, val, count); else { @@ -674,6 +677,7 @@ bus_space_copy_region_1(bus_space_tag_t { uint8_t *dst, *src; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) { bus_space_copy_region_io_1(sbsh + sofs, dbsh + dofs, count); return; @@ -698,6 +702,7 @@ bus_space_copy_region_2(bus_space_tag_t { uint16_t *dst, *src; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) { bus_space_copy_region_io_2(sbsh + sofs, dbsh + dofs, count); return; @@ -722,6 +727,7 @@ bus_space_copy_region_4(bus_space_tag_t { uint32_t *dst, *src; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) { bus_space_copy_region_io_4(sbsh + sofs, dbsh + dofs, count); return; @@ -746,6 +752,7 @@ bus_space_copy_region_8(bus_space_tag_t { uint64_t *dst, *src; + KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) { bus_space_copy_region_io_8(sbsh + sofs, dbsh + dofs, count); return; Modified: head/sys/mips/include/bus.h ============================================================================== --- head/sys/mips/include/bus.h Thu Dec 2 22:00:57 2010 (r216133) +++ head/sys/mips/include/bus.h Thu Dec 2 22:19:30 2010 (r216134) @@ -73,6 +73,9 @@ #ifndef _MACHINE_BUS_H_ #define _MACHINE_BUS_H_ +#include +#include + #include struct bus_space { @@ -314,21 +317,29 @@ struct bus_space { * Bus read multiple operations. */ #define bus_space_read_multi_1(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_1: count == 0")); \ __bs_nonsingle(rm,1,(t),(h),(o),(a),(c)) #define bus_space_read_multi_2(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_2: count == 0")); \ __bs_nonsingle(rm,2,(t),(h),(o),(a),(c)) #define bus_space_read_multi_4(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_4: count == 0")); \ __bs_nonsingle(rm,4,(t),(h),(o),(a),(c)) #define bus_space_read_multi_8(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_8: count == 0")); \ __bs_nonsingle(rm,8,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_1(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_stream_1: count == 0")); \ __bs_nonsingle_s(rm,1,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_2(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_stream_2: count == 0")); \ __bs_nonsingle_s(rm,2,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_4(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_stream_4: count == 0")); \ __bs_nonsingle_s(rm,4,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_8(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_multi_stream_8: count == 0")); \ __bs_nonsingle_s(rm,8,(t),(h),(o),(a),(c)) @@ -336,21 +347,33 @@ struct bus_space { * Bus read region operations. */ #define bus_space_read_region_1(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_region_1: count == 0")); \ __bs_nonsingle(rr,1,(t),(h),(o),(a),(c)) #define bus_space_read_region_2(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_region_2: count == 0")); \ __bs_nonsingle(rr,2,(t),(h),(o),(a),(c)) #define bus_space_read_region_4(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_region_4: count == 0")); \ __bs_nonsingle(rr,4,(t),(h),(o),(a),(c)) #define bus_space_read_region_8(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_read_region_8: count == 0")); \ __bs_nonsingle(rr,8,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_1(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_read_region_stream_1: count == 0")); \ __bs_nonsingle_s(rr,1,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_2(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_read_region_stream_2: count == 0")); \ __bs_nonsingle_s(rr,2,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_4(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_read_region_stream_4: count == 0")); \ __bs_nonsingle_s(rr,4,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_8(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_read_region_stream_8: count == 0")); \ __bs_nonsingle_s(rr,8,(t),(h),(o),(a),(c)) @@ -372,21 +395,33 @@ struct bus_space { * Bus write multiple operations. */ #define bus_space_write_multi_1(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_multi_1: count == 0")); \ __bs_nonsingle(wm,1,(t),(h),(o),(a),(c)) #define bus_space_write_multi_2(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_multi_2: count == 0")); \ __bs_nonsingle(wm,2,(t),(h),(o),(a),(c)) #define bus_space_write_multi_4(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_multi_4: count == 0")); \ __bs_nonsingle(wm,4,(t),(h),(o),(a),(c)) #define bus_space_write_multi_8(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_multi_8: count == 0")); \ __bs_nonsingle(wm,8,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_1(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_write_multi_stream_1: count == 0")); \ __bs_nonsingle_s(wm,1,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_2(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_write_multi_stream_2: count == 0")); \ __bs_nonsingle_s(wm,2,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_4(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_write_multi_stream_4: count == 0")); \ __bs_nonsingle_s(wm,4,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_8(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_write_multi_stream_8: count == 0")); \ __bs_nonsingle_s(wm,8,(t),(h),(o),(a),(c)) @@ -394,34 +429,50 @@ struct bus_space { * Bus write region operations. */ #define bus_space_write_region_1(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_region_1: count == 0")); \ __bs_nonsingle(wr,1,(t),(h),(o),(a),(c)) #define bus_space_write_region_2(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_region_2: count == 0")); \ __bs_nonsingle(wr,2,(t),(h),(o),(a),(c)) #define bus_space_write_region_4(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_region_4: count == 0")); \ __bs_nonsingle(wr,4,(t),(h),(o),(a),(c)) #define bus_space_write_region_8(t, h, o, a, c) \ + KASSERT(c != 0, ("bus_space_write_region_8: count == 0")); \ __bs_nonsingle(wr,8,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_1(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_write_region_stream_1: count == 0")); \ __bs_nonsingle_s(wr,1,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_2(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_write_region_stream_2: count == 0")); \ __bs_nonsingle_s(wr,2,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_4(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_write_region_stream_4: count == 0")); \ __bs_nonsingle_s(wr,4,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_8(t, h, o, a, c) \ + KASSERT(c != 0, \ + ("bus_space_write_region_stream_8: count == 0")); \ __bs_nonsingle_s(wr,8,(t),(h),(o),(a),(c)) /* * Set multiple operations. */ -#define bus_space_set_multi_1(t, h, o, v, c) \ +#define bus_space_set_multi_1(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_multi_1: count == 0")); \ __bs_set(sm,1,(t),(h),(o),(v),(c)) -#define bus_space_set_multi_2(t, h, o, v, c) \ +#define bus_space_set_multi_2(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_multi_2: count == 0")); \ __bs_set(sm,2,(t),(h),(o),(v),(c)) -#define bus_space_set_multi_4(t, h, o, v, c) \ +#define bus_space_set_multi_4(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_multi_4: count == 0")); \ __bs_set(sm,4,(t),(h),(o),(v),(c)) -#define bus_space_set_multi_8(t, h, o, v, c) \ +#define bus_space_set_multi_8(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_multi_8: count == 0")); \ __bs_set(sm,8,(t),(h),(o),(v),(c)) @@ -429,25 +480,33 @@ struct bus_space { * Set region operations. */ #define bus_space_set_region_1(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_region_1: count == 0")); \ __bs_set(sr,1,(t),(h),(o),(v),(c)) #define bus_space_set_region_2(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_region_2: count == 0")); \ __bs_set(sr,2,(t),(h),(o),(v),(c)) #define bus_space_set_region_4(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_region_4: count == 0")); \ __bs_set(sr,4,(t),(h),(o),(v),(c)) #define bus_space_set_region_8(t, h, o, v, c) \ + KASSERT(c != 0, ("bus_space_set_region_8: count == 0")); \ __bs_set(sr,8,(t),(h),(o),(v),(c)) /* * Copy operations. */ -#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \ +#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \ + KASSERT(c != 0, ("bus_space_copy_region_1: count == 0")); \ __bs_copy(1, t, h1, o1, h2, o2, c) -#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \ +#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \ + KASSERT(c != 0, ("bus_space_copy_region_2: count == 0")); \ __bs_copy(2, t, h1, o1, h2, o2, c) -#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \ +#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \ + KASSERT(c != 0, ("bus_space_copy_region_4: count == 0")); \ __bs_copy(4, t, h1, o1, h2, o2, c) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 00:05:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1ED531065694; Fri, 3 Dec 2010 00:05:50 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA1228FC0C; Fri, 3 Dec 2010 00:05:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB305nTD038511; Fri, 3 Dec 2010 00:05:49 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB305n9a038509; Fri, 3 Dec 2010 00:05:49 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201012030005.oB305n9a038509@svn.freebsd.org> From: David Schultz Date: Fri, 3 Dec 2010 00:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216137 - head/lib/msun X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 00:05:50 -0000 Author: das Date: Fri Dec 3 00:05:49 2010 New Revision: 216137 URL: http://svn.freebsd.org/changeset/base/216137 Log: Disable gcc's built-in rint() function when compiling s_nearbyint.c. It results in incorrect optimizations that break nearbyint(). PR: 143358 Reviewed by: bde Modified: head/lib/msun/Makefile Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Thu Dec 2 22:37:50 2010 (r216136) +++ head/lib/msun/Makefile Fri Dec 3 00:05:49 2010 (r216137) @@ -113,6 +113,12 @@ COMMON_SRCS:= ${COMMON_SRCS:N${i:R}.c} .endfor .endif +# Some files need certain gcc built-in functions to be disabled, since gcc's +# model of the functions bogusly assumes -fno-trapping-math. +XRINT_CFLAGS= -fno-builtin-rint -fno-builtin-rintf -fno-builtin-rintl +CFLAGS+= ${XRINT_CFLAGS} +XRINT_CFLAGS:= ${.IMPSRC:M*/s_nearbyint.c:C/^.+$/${XRINT_CFLAGS}/:C/^$//} + SRCS= ${COMMON_SRCS} ${ARCH_SRCS} INCS= fenv.h math.h From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 00:44:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C590C1065698; Fri, 3 Dec 2010 00:44:07 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3C348FC1C; Fri, 3 Dec 2010 00:44:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB30i79l040837; Fri, 3 Dec 2010 00:44:07 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB30i7b3040835; Fri, 3 Dec 2010 00:44:07 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201012030044.oB30i7b3040835@svn.freebsd.org> From: Weongyo Jeong Date: Fri, 3 Dec 2010 00:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216138 - head/usr.sbin/usbdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 00:44:07 -0000 Author: weongyo Date: Fri Dec 3 00:44:07 2010 New Revision: 216138 URL: http://svn.freebsd.org/changeset/base/216138 Log: Changes the meaning of each characters '<' and '>' that it could be confused with USB OUT or USB IN packets though it just represents USB submit or done. To know the USB packet direction, the endpoint address should be referred. Requested by: jkim Modified: head/usr.sbin/usbdump/usbdump.c Modified: head/usr.sbin/usbdump/usbdump.c ============================================================================== --- head/usr.sbin/usbdump/usbdump.c Fri Dec 3 00:05:49 2010 (r216137) +++ head/usr.sbin/usbdump/usbdump.c Fri Dec 3 00:44:07 2010 (r216138) @@ -247,7 +247,7 @@ print_apacket(const struct bpf_xhdr *hdr printf(" usbus%d.%d 0x%02x %s %s", up->up_busunit, up->up_address, up->up_endpoint, xfertype_table[up->up_xfertype], - up->up_type == USBPF_XFERTAP_SUBMIT ? ">" : "<"); + up->up_type == USBPF_XFERTAP_SUBMIT ? "S" : "D"); printf(" (%d/%d)", up->up_frames, up->up_length); if (up->up_type == USBPF_XFERTAP_DONE) printf(" %s", errstr_table[up->up_error]); From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 00:44:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81FD310656A9; Fri, 3 Dec 2010 00:44:32 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38DCC8FC20; Fri, 3 Dec 2010 00:44:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB30iW1L040888; Fri, 3 Dec 2010 00:44:32 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB30iWTu040884; Fri, 3 Dec 2010 00:44:32 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201012030044.oB30iWTu040884@svn.freebsd.org> From: David Schultz Date: Fri, 3 Dec 2010 00:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216139 - head/tools/regression/lib/msun X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 00:44:32 -0000 Author: das Date: Fri Dec 3 00:44:31 2010 New Revision: 216139 URL: http://svn.freebsd.org/changeset/base/216139 Log: Add some basic regression tests for nearbyint(). Added: head/tools/regression/lib/msun/test-nearbyint.c (contents, props changed) head/tools/regression/lib/msun/test-nearbyint.t (contents, props changed) Modified: head/tools/regression/lib/msun/Makefile Modified: head/tools/regression/lib/msun/Makefile ============================================================================== --- head/tools/regression/lib/msun/Makefile Fri Dec 3 00:44:07 2010 (r216138) +++ head/tools/regression/lib/msun/Makefile Fri Dec 3 00:44:31 2010 (r216139) @@ -2,7 +2,7 @@ TESTS= test-conj test-csqrt test-exponential test-fenv test-fma \ test-fmaxmin test-ilogb test-invtrig test-lrint \ - test-lround test-nan test-next test-rem test-trig + test-lround test-nan test-nearbyint test-next test-rem test-trig CFLAGS+= -O0 -lm .PHONY: tests Added: head/tools/regression/lib/msun/test-nearbyint.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/msun/test-nearbyint.c Fri Dec 3 00:44:31 2010 (r216139) @@ -0,0 +1,100 @@ +/*- + * Copyright (c) 2010 David Schultz + * 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. + */ + +/* + * Tests for nearbyint{,f,l}() + * + * TODO: + * - adapt tests for rint(3) + * - tests for harder values (more mantissa bits than float) + * - tests in other rounding modes + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#define ALL_STD_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \ + FE_OVERFLOW | FE_UNDERFLOW) + +/* + * Compare d1 and d2 using special rules: NaN == NaN and +0 != -0. + * Fail an assertion if they differ. + */ +static int +fpequal(long double d1, long double d2) +{ + + if (d1 != d2) + return (isnan(d1) && isnan(d2)); + return (copysignl(1.0, d1) == copysignl(1.0, d2)); +} + +static void testit(int testnum, float in, float out) +{ + + feclearexcept(ALL_STD_EXCEPT); + assert(fpequal(out, nearbyintf(in))); + assert(fpequal(-out, nearbyintf(-in))); + assert(fetestexcept(ALL_STD_EXCEPT) == 0); + + assert(fpequal(out, nearbyint(in))); + assert(fpequal(-out, nearbyint(-in))); + assert(fetestexcept(ALL_STD_EXCEPT) == 0); + + assert(fpequal(out, nearbyintl(in))); + assert(fpequal(-out, nearbyintl(-in))); + assert(fetestexcept(ALL_STD_EXCEPT) == 0); + + printf("ok %d\t\t# nearbyint(%g)\n", testnum, in); +} + +static const float tests[] = { +/* input output (expected) */ + 0.0, 0.0, + 0.5, 0.0, + M_PI, 3, + 65536.5, 65536, + INFINITY, INFINITY, + NAN, NAN, +}; + +int +main(int argc, char *argv[]) +{ + static const int ntests = sizeof(tests) / sizeof(tests[0]) / 2; + int i; + + printf("1..%d\n", ntests); + for (i = 0; i < ntests; i++) + testit(i + 1, tests[i * 2], tests[i * 2 + 1]); + + return (0); +} Added: head/tools/regression/lib/msun/test-nearbyint.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/msun/test-nearbyint.t Fri Dec 3 00:44:31 2010 (r216139) @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 00:54:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2E791065670; Fri, 3 Dec 2010 00:54:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 6AA638FC17; Fri, 3 Dec 2010 00:54:21 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oB30sHbZ075974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 3 Dec 2010 02:54:17 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oB30sHSK057674; Fri, 3 Dec 2010 02:54:17 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oB30sHv5057673; Fri, 3 Dec 2010 02:54:17 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 3 Dec 2010 02:54:17 +0200 From: Kostik Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20101203005417.GZ2392@deviant.kiev.zoral.com.ua> References: <201006121732.o5CHW5Cs065722@svn.freebsd.org> <20100615084939.GL13238@deviant.kiev.zoral.com.ua> <20100615131443.GA93094@zim.MIT.EDU> <20101202045728.GA19295@zim.MIT.EDU> <20101202095652.GQ2392@deviant.kiev.zoral.com.ua> <20101202190010.GB28587@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qTVLnNpb55K94rUF" Content-Disposition: inline In-Reply-To: <20101202190010.GB28587@zim.MIT.EDU> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r209110 - in head/lib/msun: . src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 00:54:22 -0000 --qTVLnNpb55K94rUF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 02, 2010 at 02:00:10PM -0500, David Schultz wrote: > On Thu, Dec 02, 2010, Kostik Belousov wrote: > > For __isnanf, libc exports __isnanf@FBSD_1.0, and libm exports > > __isnanf@FBSD_1.2. I suspect that we could export both > > __isnanf@FBSD_1.0 and __isnanf@FBSD_1.2 from libc. >=20 > I like the idea of adding an __isnanf@FBSD_1.2 alias to libc for > the benefit of people running -CURRENT. Ok, draft of the change is below, I am not sure is it worth the churn. I was unable to make the ld support two versions of the same symbol. lib/msun would benefit from elimination of isnan sources if this is committed. diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index d55bc46..f7c722e 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -19,8 +19,8 @@ SRCS+=3D __getosreldate.c __xuname.c \ getosreldate.c getpagesize.c getpagesizes.c \ getpeereid.c getprogname.c getpwent.c getttyent.c \ getusershell.c getutxent.c getvfsbyname.c glob.c \ - initgroups.c isatty.c isinf.c isnan.c jrand48.c lcong48.c \ - lockf.c lrand48.c mrand48.c nftw.c nice.c \ + initgroups.c isatty.c isinf.c isnan.c isnan_compat.c jrand48.c \ + lcong48.c lockf.c lrand48.c mrand48.c nftw.c nice.c \ nlist.c nrand48.c opendir.c \ pause.c pmadvise.c popen.c posix_spawn.c \ psignal.c pututxline.c pw_scan.c pwcache.c \ diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index f9abab5..fd0a896 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -200,7 +200,6 @@ FBSD_1.0 { getvfsbyname; __isnan; isnan; - __isnanf; isnanf; __isinf; isinf; @@ -378,6 +377,7 @@ FBSD_1.2 { sem_wait; setutxdb; setutxent; + __isnanf; }; =20 FBSDprivate_1.0 { diff --git a/lib/libc/gen/isnan_compat.c b/lib/libc/gen/isnan_compat.c new file mode 100644 index 0000000..f4749eb --- /dev/null +++ b/lib/libc/gen/isnan_compat.c @@ -0,0 +1,17 @@ +/* + * The file is in public domain. + * Written by Konstantin Belousov + * + * $FreeBSD$ + */ + +#include + +__sym_compat(__isnanf, __isnanf_compat, FBSD_1.0); + +int +__isnanf_compat(float f) +{ + + return (__isnanf(f)); +} diff --git a/lib/msun/Symbol.map b/lib/msun/Symbol.map index 429a76f..8b33dca 100644 --- a/lib/msun/Symbol.map +++ b/lib/msun/Symbol.map @@ -118,7 +118,6 @@ FBSD_1.0 { __isfinite; __isfinitef; __isfinitel; - isnanf; __isnanl; __isnormal; __isnormalf; @@ -221,5 +220,4 @@ FBSD_1.1 { =20 /* First added in 9.0-CURRENT */ FBSD_1.2 { - __isnanf; }; --qTVLnNpb55K94rUF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAkz4P7gACgkQC3+MBN1Mb4hf9wCfSZev80/VIH33QRqf28zO/4Ht ixMAoIsO/bX10XDP4xf2iwYshSKQLPe9 =XUP/ -----END PGP SIGNATURE----- --qTVLnNpb55K94rUF-- From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 02:07:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F112F1065693; Fri, 3 Dec 2010 02:07:34 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEAAA8FC0A; Fri, 3 Dec 2010 02:07:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB327YhA044060; Fri, 3 Dec 2010 02:07:34 GMT (envelope-from gordon@svn.freebsd.org) Received: (from gordon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB327Y7G044058; Fri, 3 Dec 2010 02:07:34 GMT (envelope-from gordon@svn.freebsd.org) Message-Id: <201012030207.oB327Y7G044058@svn.freebsd.org> From: Gordon Tetlow Date: Fri, 3 Dec 2010 02:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216140 - head/usr.bin/man X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 02:07:35 -0000 Author: gordon Date: Fri Dec 3 02:07:34 2010 New Revision: 216140 URL: http://svn.freebsd.org/changeset/base/216140 Log: Add ability to decompress different format manual pages. Add support for .so directive in manual pages. Approved by: mentor (wes@) Modified: head/usr.bin/man/man.sh Modified: head/usr.bin/man/man.sh ============================================================================== --- head/usr.bin/man/man.sh Fri Dec 3 00:44:31 2010 (r216139) +++ head/usr.bin/man/man.sh Fri Dec 3 02:07:34 2010 (r216140) @@ -94,6 +94,7 @@ check_cat() { if exists "$1"; then use_cat=yes catpage=$found + setup_cattool $catpage decho " Found catpage $catpage" return 0 else @@ -108,12 +109,14 @@ check_man() { if exists "$1"; then # We have a match, check for a cat page manpage=$found + setup_cattool $manpage decho " Found manpage $manpage" if exists "$2" && is_newer $found $manpage; then # cat page found and is newer, use that use_cat=yes catpage=$found + setup_cattool $catpage decho " Using catpage $catpage" else # no cat page or is older @@ -240,6 +243,35 @@ manpath_warnings() { fi } +# Usage: man_check_for_so page path +# Returns: True if able to resolve the file, false if it ended in tears. +# Detects the presence of the .so directive and causes the file to be +# redirected to another source file. +man_check_for_so() { + local IFS line tstr + + unset IFS + + # We need to loop to accommodate multiple .so directives. + while true + do + line=$($cattool $manpage | head -1) + case "$line" in + .so*) trim "${line#.so}" + decho "$manpage includes $tstr" + # Glob and check for the file. + if ! check_man "$path/$tstr*" ""; then + decho " Unable to find $tstr" + return 1 + fi + ;; + *) break ;; + esac + done + + return 0 +} + # Usage: man_display_page # Display either the manpage or catpage depending on the use_cat variable man_display_page() { @@ -258,10 +290,10 @@ man_display_page() { ret=0 else if [ $debug -gt 0 ]; then - decho "Command: $ZCAT $catpage | $PAGER" + decho "Command: $cattool $catpage | $PAGER" ret=0 else - eval "$ZCAT $catpage | $PAGER" + eval "$cattool $catpage | $PAGER" ret=$? fi fi @@ -343,10 +375,10 @@ man_display_page() { fi if [ $debug -gt 0 ]; then - decho "Command: $ZCAT $manpage | $pipeline" + decho "Command: $cattool $manpage | $pipeline" ret=0 else - eval "$ZCAT $manpage | $pipeline" + eval "$cattool $manpage | $pipeline" ret=$? fi } @@ -361,10 +393,13 @@ man_find_and_display() { case "$1" in */*) if [ -f "$1" -a -r "$1" ]; then decho "Found a usable page, displaying that" - found_page=yes unset use_cat manpage="$1" - man_display_page + setup_cattool $manpage + if man_check_for_so $manpage $(dirname $manpage); then + found_page=yes + man_display_page + fi return fi ;; @@ -380,35 +415,41 @@ man_find_and_display() { # Check if there is a MACHINE specific manpath. if find_file $p $sect $MACHINE "$1"; then - found_page=yes - man_display_page - if [ -n "$aflag" ]; then - continue 2 - else - return + if man_check_for_so $manpage $p; then + found_page=yes + man_display_page + if [ -n "$aflag" ]; then + continue 2 + else + return + fi fi fi # Check if there is a MACHINE_ARCH # specific manpath. if find_file $p $sect $MACHINE_ARCH "$1"; then - found_page=yes - man_display_page - if [ -n "$aflag" ]; then - continue 2 - else - return + if man_check_for_so $manpage $p; then + found_page=yes + man_display_page + if [ -n "$aflag" ]; then + continue 2 + else + return + fi fi fi # Check plain old manpath. if find_file $p $sect '' "$1"; then - found_page=yes - man_display_page - if [ -n "$aflag" ]; then - continue 2 - else - return + if man_check_for_so $manpage $p; then + found_page=yes + man_display_page + if [ -n "$aflag" ]; then + continue 2 + else + return + fi fi fi done @@ -749,6 +790,19 @@ search_whatis() { exit $rval } +# Usage: setup_cattool page +# Finds an appropriate decompressor based on extension +setup_cattool() { + case "$1" in + *.bz) cattool='/usr/bin/bzcat' ;; + *.bz2) cattool='/usr/bin/bzcat' ;; + *.gz) cattool='/usr/bin/zcat' ;; + *.lzma) cattool='/usr/bin/lzcat' ;; + *.xz) cattool='/usr/bin/xzcat' ;; + *) cattool='/usr/bin/zcat -f' ;; + esac +} + # Usage: setup_pager # Correctly sets $PAGER setup_pager() { @@ -845,11 +899,11 @@ TBL=/usr/bin/tbl TROFF='/usr/bin/groff -S -man' REFER=/usr/bin/refer VGRIND=/usr/bin/vgrind -ZCAT='/usr/bin/zcat -f' debug=0 man_default_sections='1:1aout:8:2:3:n:4:5:6:7:9:l' man_default_path='/usr/share/man:/usr/share/openssl/man:/usr/local/man' +cattool='/usr/bin/zcat -f' config_global='/etc/man.conf' From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 04:39:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 966E21065698; Fri, 3 Dec 2010 04:39:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84C6D8FC0A; Fri, 3 Dec 2010 04:39:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB34dmsT049255; Fri, 3 Dec 2010 04:39:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB34dmpu049253; Fri, 3 Dec 2010 04:39:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201012030439.oB34dmpu049253@svn.freebsd.org> From: Warner Losh Date: Fri, 3 Dec 2010 04:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216141 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 04:39:48 -0000 Author: imp Date: Fri Dec 3 04:39:48 2010 New Revision: 216141 URL: http://svn.freebsd.org/changeset/base/216141 Log: To make minidumps work properly on mips for memory that's direct mapped and entered via vm_page_setup, keep track of it like we do for amd64. # A separate commit will be made to move this to a capability-based ifdef # rather than arch-based ifdef. Submitted by: alc@ MFC after: 1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Dec 3 02:07:34 2010 (r216140) +++ head/sys/vm/vm_page.c Fri Dec 3 04:39:48 2010 (r216141) @@ -430,11 +430,12 @@ vm_page_startup(vm_offset_t vaddr) */ new_end = vm_reserv_startup(&vaddr, new_end, high_water); #endif -#ifdef __amd64__ +#if defined(__amd64__) || defined(__mips__) /* - * pmap_map on amd64 comes out of the direct-map, not kvm like i386, - * so the pages must be tracked for a crashdump to include this data. - * This includes the vm_page_array and the early UMA bootstrap pages. + * pmap_map on amd64 and mips can come out of the direct-map, not kvm + * like i386, so the pages must be tracked for a crashdump to include + * this data. This includes the vm_page_array and the early UMA + * bootstrap pages. */ for (pa = new_end; pa < phys_avail[biggestone + 1]; pa += PAGE_SIZE) dump_add_page(pa); From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 07:01:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A9631065694; Fri, 3 Dec 2010 07:01:08 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 063C18FC1A; Fri, 3 Dec 2010 07:01:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3717Tg058151; Fri, 3 Dec 2010 07:01:07 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3717YD058149; Fri, 3 Dec 2010 07:01:07 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201012030701.oB3717YD058149@svn.freebsd.org> From: David Schultz Date: Fri, 3 Dec 2010 07:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216142 - head/share/man/man3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 07:01:08 -0000 Author: das Date: Fri Dec 3 07:01:07 2010 New Revision: 216142 URL: http://svn.freebsd.org/changeset/base/216142 Log: Explain some of the reasons that fpsetprec() is unlikely to work as one might expect. (These functions have already been deprecated for many years.) PR: 133583 Modified: head/share/man/man3/fpgetround.3 Modified: head/share/man/man3/fpgetround.3 ============================================================================== --- head/share/man/man3/fpgetround.3 Fri Dec 3 04:39:48 2010 (r216141) +++ head/share/man/man3/fpgetround.3 Fri Dec 3 07:01:07 2010 (r216142) @@ -32,7 +32,7 @@ .\" @(#)fpgetround.3 1.0 (Berkeley) 9/23/93 .\" $FreeBSD$ .\" -.Dd August 23, 1993 +.Dd December 3, 2010 .Dt FPGETROUND 3 .Os .Sh NAME @@ -164,6 +164,10 @@ and .Fn fpsetprec functions provide functionality unavailable on many platforms. At present, they are implemented only on the i386 and amd64 platforms. +Changing precision isn't a supported feature: +it may be ineffective when code is compiled to take advantage of SSE, +and many library functions and compiler optimizations depend upon the +default precision for correct behavior. .Sh SEE ALSO .Xr fenv 3 , .Xr isnan 3 From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 07:08:06 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60F79106566C; Fri, 3 Dec 2010 07:08:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id D916C8FC16; Fri, 3 Dec 2010 07:08:05 +0000 (UTC) Received: from c211-30-187-94.carlnfd1.nsw.optusnet.com.au (c211-30-187-94.carlnfd1.nsw.optusnet.com.au [211.30.187.94]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB3782mp005589 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 3 Dec 2010 18:08:03 +1100 Date: Fri, 3 Dec 2010 18:08:02 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Nathan Whitehorn In-Reply-To: <201012021510.oB2FARBU012912@svn.freebsd.org> Message-ID: <20101203165036.P1131@besplex.bde.org> References: <201012021510.oB2FARBU012912@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216122 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 07:08:06 -0000 On Thu, 2 Dec 2010, Nathan Whitehorn wrote: > Log: > Define bswap macros for constants to allow the compiler to pre-compute > byte-swapped versions of compile-time constants. This allows use of > bswap() and htole*() in initializers, which is required to cross-build > btxld. The constant case is MI so it shouldn't be repeated in many (now many + 1) MD files. I got cognet@ to clean this up a bit, but he wasn't able to commit the main part (due to unresolved namespace problems IIRC). > Obtained from: sparc64 amd64 is a better base. > Modified: head/sys/powerpc/include/endian.h > ============================================================================== > --- head/sys/powerpc/include/endian.h Thu Dec 2 13:40:21 2010 (r216121) > +++ head/sys/powerpc/include/endian.h Thu Dec 2 15:10:27 2010 (r216122) > @@ -27,7 +27,6 @@ > * SUCH DAMAGE. > * > * @(#)endian.h 8.1 (Berkeley) 6/10/93 > - * $NetBSD: endian.h,v 1.7 1999/08/21 05:53:51 simonb Exp $ > * $FreeBSD$ > */ > > @@ -79,17 +78,36 @@ > #define BYTE_ORDER _BYTE_ORDER > #endif > > -#ifdef __CC_SUPPORTS___INLINE __inline is still used, but is no longer ifdefed. Probably best. Most of the __CC_SUPPORTS macros are just usless obfuscations since they are only used in a few places, and `inline' (but not __inline__) is now Standard. E.g., even amd64 and i386 don't use __CC_SUPPORTS___INLINE in endian.h. After this commit, only ia64's endian.h uses __CC_SUPPORTS___INLINE. The __CC_SUPPORTS_INLINE and __CC_SUPPORTS___INLINE__ macros are even more useless than __CC_SUPPORTS___INLINE (the former since plain inline is Standard and the latter since __inline__ is a style bug which is used mainly in contrib'ed code that is very unlikely to ifdef its mistakes. > +#if defined(__GNUCLIKE_BUILTIN_CONSTANT_P) > +#define __is_constant(x) __builtin_constant_p(x) > +#else > +#define __is_constant(x) 0 > +#endif This won't actually work if __GNUCLIKE_BUILTIN_CONSTANT_P is not defined, since it says that everything is variable in that case, so it will generate inline function calls in static initializers and fail messily. amd64 and i386 use a better ifdef which results in _BYTEORDER_FUNC_DEFINED being defined. This should result in upper layers don't the right thing, which must include handling the const case so that the interfaces can be used in static initializers, but in fact upper layers are more broken than here: - of course upper layers don't handle the constant case - the only upper layers headers that test _BYTEORDER_FUNC_DEFINED are sys/param.h and netinet/in.h. Since these are not sys/endian.h, and since the MD endian.h is included directly in other places than these (mainly sys/types.h), there are namespace problems. - in sys/param.h and netinet/in.h, _BYTEORDER_FUNC_DEFINED only affects the definitions of hton*() and ntohs*(). So most MD byteorder functions are left undefined. In MD layers, only amd64, i386, ia64, and previously powerpc, define _BYTEORDER_FUNC_DEFINED. These declarations are confusing but not wrong. The byteorder functions that are covered by this macro are only __hton*() and __ntoh*(). When these are defined, upper layers refrain from defining hton*() and ntoh*(), so that in the usual case where the latter are already defined, they are not redefined (although they should be since redefinition of macros is harmless unless there is a bug that makes the definitions differ), and in the unusual case where the underscored functions are not defined, the non-underscored functions remain undefined too, so that extern functions are used for the latter. Untangling this will be difficult, although it is just an obfuscation in the usual case. > + > +#define __bswap16_const(x) ((((__uint16_t)(x) >> 8) & 0xff) | \ > + (((__uint16_t)(x) << 8) & 0xff00)) > +#define __bswap32_const(x) ((((__uint32_t)(x) >> 24) & 0xff) | \ > + (((__uint32_t)(x) >> 8) & 0xff00) | \ > + (((__uint32_t)(x)<< 8) & 0xff0000) | \ > + (((__uint32_t)(x) << 24) & 0xff000000)) > +#define __bswap64_const(x) ((((__uint64_t)(x) >> 56) & 0xff) | \ > + (((__uint64_t)(x) >> 40) & 0xff00) | \ > + (((__uint64_t)(x) >> 24) & 0xff0000) | \ > + (((__uint64_t)(x) >> 8) & 0xff000000) | \ > + (((__uint64_t)(x) << 8) & ((__uint64_t)0xff << 32)) | \ > + (((__uint64_t)(x) << 24) & ((__uint64_t)0xff << 40)) | \ > + (((__uint64_t)(x) << 40) & ((__uint64_t)0xff << 48)) | \ > + (((__uint64_t)(x) << 56) & ((__uint64_t)0xff << 56))) All MI. Even on mips, all these macros, and corresponding functions too, are MI, despite endianness differences. All the swap APIs are MI. It is only the hton*() and ntoh*() APIs that are MD, since they sometimes don't swap. Mips has different mistakes in the ifdef for the constant case: % #ifndef __ASSEMBLER__ % #if defined(__GNUCLIKE_BUILTIN_CONSTANT_P) && defined(__OPTIMIZE__) % #define __is_constant(x) __builtin_constant_p(x) % #else % #define __is_constant(x) 0 % #endif __ASSEMBLER__ is not needed for the macros, and shouldn't be needed to hide the functions, since this file shouldn't be included in asm files. Using __OPTIMIZE__ mainly breaks the case of static initializers when compiled without optimizations. > > static __inline __uint16_t > -__bswap16(__uint16_t _x) > +__bswap16_var(__uint16_t _x) > { > > return ((_x >> 8) | ((_x << 8) & 0xff00)); > } > > static __inline __uint32_t > -__bswap32(__uint32_t _x) > +__bswap32_var(__uint32_t _x) > { > > return ((_x >> 24) | ((_x >> 8) & 0xff00) | ((_x << 8) & 0xff0000) | > @@ -97,7 +115,7 @@ __bswap32(__uint32_t _x) > } > > static __inline __uint64_t > -__bswap64(__uint64_t _x) > +__bswap64_var(__uint64_t _x) > { > > return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) | > @@ -106,20 +124,16 @@ __bswap64(__uint64_t _x) > ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); > } All the functions are MI too, since they don't use asm. All the functions use essentially the same as the "constant" or "optimized" code, again since they don't use asm. They should use the macros instead of repeating them. All they do better than the macros is supply safety (avoid evalating args more than once). But functions are not needed for this -- old i386 macros were safe at the cost of using a gcc extension (statement-expression) to be both safe and an expression. i386 now only uses 1 MD macro, for 32-bit swaps. It doesn't support 64-bit swaps. "constant"/"optimized" 16-bit swaps are apparently not needed, since i386 only has an inline function for them (the asm "optimization" for this case and perhaps the constant "optimization" for this case were removed a year or 2 ago). The function versions also convert the arg in the correct way (only once via the prototype), where the macros now have cast for each use of the arg, and used to be broken since they were missing some casts. IIRC, it was cleaning up the last 2 points that cognet@ mad most progress in. > > +#define __bswap16(x) (__is_constant(x) ? __bswap16_const(x) : \ > + __bswap16_var(x)) > +#define __bswap32(x) (__is_constant(x) ? __bswap32_const(x) : \ > + __bswap32_var(x)) > +#define __bswap64(x) (__is_constant(x) ? __bswap64_const(x) : \ > + __bswap64_var(x)) > + Unless the functions are in asm, this should be (in MI code): #define __bswap16(x) __bswap16_generic(x) where __bswap_16_generic() is a macro, etc., except you probably wouldn't even have another layer of macros for it. sys/endian.h does all of this quite differently. It doesn't attempt any optimizations, except where it uses MD functions that might have them. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 07:09:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A9161065672; Fri, 3 Dec 2010 07:09:23 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 741B98FC08; Fri, 3 Dec 2010 07:09:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB379NfT058729; Fri, 3 Dec 2010 07:09:23 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB379NOH058721; Fri, 3 Dec 2010 07:09:23 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201012030709.oB379NOH058721@svn.freebsd.org> From: Bruce Cran Date: Fri, 3 Dec 2010 07:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216143 - in head: share/man/man9 sys/amd64/include sys/arm/include sys/i386/include sys/ia64/include sys/mips/include sys/pc98/include sys/powerpc/include sys/sparc64/include sys/sun4v... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 07:09:23 -0000 Author: brucec Date: Fri Dec 3 07:09:23 2010 New Revision: 216143 URL: http://svn.freebsd.org/changeset/base/216143 Log: Revert r216134. This checkin broke platforms where bus_space are macros: they need to be a single statement, and do { } while (0) doesn't work in this situation so revert until a solution can be devised. Modified: head/share/man/man9/bus_space.9 head/sys/amd64/include/bus.h head/sys/arm/include/bus.h head/sys/i386/include/bus.h head/sys/ia64/include/bus.h head/sys/mips/include/bus.h head/sys/pc98/include/bus.h head/sys/powerpc/include/bus.h head/sys/sparc64/include/bus.h head/sys/sun4v/include/bus.h Modified: head/share/man/man9/bus_space.9 ============================================================================== --- head/share/man/man9/bus_space.9 Fri Dec 3 07:01:07 2010 (r216142) +++ head/share/man/man9/bus_space.9 Fri Dec 3 07:09:23 2010 (r216143) @@ -719,9 +719,6 @@ or which return data read from bus space do not obviously return an error code) do not fail. They could only fail if given invalid arguments, and in that case their behaviour is undefined. -Functions which take a count of bytes must not pass in a count of zero; -doing so will cause a panic if the kernel was compiled with -.Cd "options INVARIANTS" . .Sh TYPES Several types are defined in .In machine/bus.h Modified: head/sys/amd64/include/bus.h ============================================================================== --- head/sys/amd64/include/bus.h Fri Dec 3 07:01:07 2010 (r216142) +++ head/sys/amd64/include/bus.h Fri Dec 3 07:09:23 2010 (r216143) @@ -104,9 +104,6 @@ #ifndef _AMD64_BUS_H_ #define _AMD64_BUS_H_ -#include -#include - #include #include @@ -271,7 +268,7 @@ static __inline void bus_space_read_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int8_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == AMD64_BUS_SPACE_IO) insb(bsh + offset, addr, count); else { @@ -292,7 +289,7 @@ static __inline void bus_space_read_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int16_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == AMD64_BUS_SPACE_IO) insw(bsh + offset, addr, count); else { @@ -313,7 +310,7 @@ static __inline void bus_space_read_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int32_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == AMD64_BUS_SPACE_IO) insl(bsh + offset, addr, count); else { @@ -359,7 +356,7 @@ static __inline void bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int8_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == AMD64_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -391,7 +388,7 @@ static __inline void bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int16_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == AMD64_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -423,7 +420,7 @@ static __inline void bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int32_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == AMD64_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -535,7 +532,7 @@ static __inline void bus_space_write_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int8_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == AMD64_BUS_SPACE_IO) outsb(bsh + offset, addr, count); else { @@ -556,7 +553,7 @@ static __inline void bus_space_write_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int16_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == AMD64_BUS_SPACE_IO) outsw(bsh + offset, addr, count); else { @@ -577,7 +574,7 @@ static __inline void bus_space_write_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int32_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == AMD64_BUS_SPACE_IO) outsl(bsh + offset, addr, count); else { @@ -624,7 +621,7 @@ static __inline void bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int8_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == AMD64_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -656,7 +653,7 @@ static __inline void bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int16_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == AMD64_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -688,7 +685,7 @@ static __inline void bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int32_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == AMD64_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -880,7 +877,6 @@ bus_space_copy_region_1(bus_space_tag_t bus_space_handle_t addr1 = bsh1 + off1; bus_space_handle_t addr2 = bsh2 + off2; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) { if (addr1 >= addr2) { /* src after dest: copy forward */ @@ -916,7 +912,6 @@ bus_space_copy_region_2(bus_space_tag_t bus_space_handle_t addr1 = bsh1 + off1; bus_space_handle_t addr2 = bsh2 + off2; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) { if (addr1 >= addr2) { /* src after dest: copy forward */ @@ -952,7 +947,6 @@ bus_space_copy_region_4(bus_space_tag_t bus_space_handle_t addr1 = bsh1 + off1; bus_space_handle_t addr2 = bsh2 + off2; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == AMD64_BUS_SPACE_IO) { if (addr1 >= addr2) { /* src after dest: copy forward */ Modified: head/sys/arm/include/bus.h ============================================================================== --- head/sys/arm/include/bus.h Fri Dec 3 07:01:07 2010 (r216142) +++ head/sys/arm/include/bus.h Fri Dec 3 07:09:23 2010 (r216143) @@ -66,9 +66,6 @@ #ifndef _MACHINE_BUS_H_ #define _MACHINE_BUS_H_ -#include -#include - #include /* @@ -321,29 +318,21 @@ struct bus_space { * Bus read multiple operations. */ #define bus_space_read_multi_1(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_1: count == 0")); \ __bs_nonsingle(rm,1,(t),(h),(o),(a),(c)) #define bus_space_read_multi_2(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_2: count == 0")); \ __bs_nonsingle(rm,2,(t),(h),(o),(a),(c)) #define bus_space_read_multi_4(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_4: count == 0")); \ __bs_nonsingle(rm,4,(t),(h),(o),(a),(c)) #define bus_space_read_multi_8(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_8: count == 0")); \ __bs_nonsingle(rm,8,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_1(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_stream_1: count == 0")); \ __bs_nonsingle_s(rm,1,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_2(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_stream_2: count == 0")); \ __bs_nonsingle_s(rm,2,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_4(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_stream_4: count == 0")); \ __bs_nonsingle_s(rm,4,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_8(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_stream_8: count == 0")); \ __bs_nonsingle_s(rm,8,(t),(h),(o),(a),(c)) @@ -351,29 +340,21 @@ struct bus_space { * Bus read region operations. */ #define bus_space_read_region_1(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_region_1: count == 0")); \ __bs_nonsingle(rr,1,(t),(h),(o),(a),(c)) #define bus_space_read_region_2(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_region_2: count == 0")); \ __bs_nonsingle(rr,2,(t),(h),(o),(a),(c)) #define bus_space_read_region_4(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_region_4: count == 0")); \ __bs_nonsingle(rr,4,(t),(h),(o),(a),(c)) #define bus_space_read_region_8(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_region_8: count == 0")); \ __bs_nonsingle(rr,8,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_1(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_region_stream_1: count == 0"));\ __bs_nonsingle_s(rr,1,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_2(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_region_stream_2: count == 0"));\ __bs_nonsingle_s(rr,2,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_4(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_region_stream_4: count == 0"));\ __bs_nonsingle_s(rr,4,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_8(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_region_stream_8 count == 0")); \ __bs_nonsingle_s(rr,8,(t),(h),(o),(a),(c)) @@ -395,29 +376,21 @@ struct bus_space { * Bus write multiple operations. */ #define bus_space_write_multi_1(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_multi_1: count == 0")); \ __bs_nonsingle(wm,1,(t),(h),(o),(a),(c)) #define bus_space_write_multi_2(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_multi_2: count == 0")); \ __bs_nonsingle(wm,2,(t),(h),(o),(a),(c)) #define bus_space_write_multi_4(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_multi_4: count == 0")); \ __bs_nonsingle(wm,4,(t),(h),(o),(a),(c)) #define bus_space_write_multi_8(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_multi_8: count == 0")); \ __bs_nonsingle(wm,8,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_1(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_multi_stream_1: count == 0"));\ __bs_nonsingle_s(wm,1,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_2(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_multi_stream_2: count == 0"));\ __bs_nonsingle_s(wm,2,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_4(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_multi_stream_4: count == 0"));\ __bs_nonsingle_s(wm,4,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_8(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_multi_stream_8: count == 0"));\ __bs_nonsingle_s(wm,8,(t),(h),(o),(a),(c)) @@ -425,50 +398,34 @@ struct bus_space { * Bus write region operations. */ #define bus_space_write_region_1(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_region_1: count == 0")); \ __bs_nonsingle(wr,1,(t),(h),(o),(a),(c)) #define bus_space_write_region_2(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_region_2: count == 0")); \ __bs_nonsingle(wr,2,(t),(h),(o),(a),(c)) #define bus_space_write_region_4(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_region_4: count == 0")); \ __bs_nonsingle(wr,4,(t),(h),(o),(a),(c)) #define bus_space_write_region_8(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_region_8: count == 0")); \ __bs_nonsingle(wr,8,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_1(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_write_region_stream_1: count == 0")); \ __bs_nonsingle_s(wr,1,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_2(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_write_region_stream_2: count == 0")); \ __bs_nonsingle_s(wr,2,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_4(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_write_region_stream_4: count == 0")); \ __bs_nonsingle_s(wr,4,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_8(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_write_region_stream_8: count == 0")); \ __bs_nonsingle_s(wr,8,(t),(h),(o),(a),(c)) /* * Set multiple operations. */ -#define bus_space_set_multi_1(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_multi_1: count == 0")); \ +#define bus_space_set_multi_1(t, h, o, v, c) \ __bs_set(sm,1,(t),(h),(o),(v),(c)) -#define bus_space_set_multi_2(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_multi_2: count == 0")); \ +#define bus_space_set_multi_2(t, h, o, v, c) \ __bs_set(sm,2,(t),(h),(o),(v),(c)) -#define bus_space_set_multi_4(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_multi_4: count == 0")); \ +#define bus_space_set_multi_4(t, h, o, v, c) \ __bs_set(sm,4,(t),(h),(o),(v),(c)) -#define bus_space_set_multi_8(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_multi_8: count == 0")); \ +#define bus_space_set_multi_8(t, h, o, v, c) \ __bs_set(sm,8,(t),(h),(o),(v),(c)) @@ -476,33 +433,25 @@ struct bus_space { * Set region operations. */ #define bus_space_set_region_1(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_region_1: count == 0")); \ __bs_set(sr,1,(t),(h),(o),(v),(c)) #define bus_space_set_region_2(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_region_2: count == 0")); \ __bs_set(sr,2,(t),(h),(o),(v),(c)) #define bus_space_set_region_4(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_region_4: count == 0")); \ __bs_set(sr,4,(t),(h),(o),(v),(c)) #define bus_space_set_region_8(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_region_8: count == 0")); \ __bs_set(sr,8,(t),(h),(o),(v),(c)) /* * Copy operations. */ -#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \ - KASSERT(c != 0, ("bus_space_copy_region_1: count == 0")); \ +#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \ __bs_copy(1, t, h1, o1, h2, o2, c) -#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \ - KASSERT(c != 0, ("bus_space_copy_region_2: count == 0")); \ +#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \ __bs_copy(2, t, h1, o1, h2, o2, c) -#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \ - KASSERT(c != 0, ("bus_space_copy_region_4: count == 0")); \ +#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \ __bs_copy(4, t, h1, o1, h2, o2, c) -#define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \ - KASSERT(c != 0, ("bus_space_copy_region_8: count == 0")); \ +#define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \ __bs_copy(8, t, h1, o1, h2, o2, c) /* Modified: head/sys/i386/include/bus.h ============================================================================== --- head/sys/i386/include/bus.h Fri Dec 3 07:01:07 2010 (r216142) +++ head/sys/i386/include/bus.h Fri Dec 3 07:09:23 2010 (r216143) @@ -104,9 +104,6 @@ #ifndef _I386_BUS_H_ #define _I386_BUS_H_ -#include -#include - #include #include @@ -275,7 +272,7 @@ static __inline void bus_space_read_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int8_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == I386_BUS_SPACE_IO) insb(bsh + offset, addr, count); else { @@ -300,7 +297,7 @@ static __inline void bus_space_read_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int16_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == I386_BUS_SPACE_IO) insw(bsh + offset, addr, count); else { @@ -325,7 +322,7 @@ static __inline void bus_space_read_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int32_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == I386_BUS_SPACE_IO) insl(bsh + offset, addr, count); else { @@ -375,7 +372,7 @@ static __inline void bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int8_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == I386_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -415,7 +412,7 @@ static __inline void bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int16_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == I386_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -455,7 +452,7 @@ static __inline void bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, u_int32_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == I386_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -575,7 +572,7 @@ static __inline void bus_space_write_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int8_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == I386_BUS_SPACE_IO) outsb(bsh + offset, addr, count); else { @@ -600,7 +597,7 @@ static __inline void bus_space_write_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int16_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == I386_BUS_SPACE_IO) outsw(bsh + offset, addr, count); else { @@ -625,7 +622,7 @@ static __inline void bus_space_write_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int32_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == I386_BUS_SPACE_IO) outsl(bsh + offset, addr, count); else { @@ -676,7 +673,7 @@ static __inline void bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int8_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == I386_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -716,7 +713,7 @@ static __inline void bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int16_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == I386_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -756,7 +753,7 @@ static __inline void bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, bus_size_t offset, const u_int32_t *addr, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (tag == I386_BUS_SPACE_IO) { int _port_ = bsh + offset; #ifdef __GNUCLIKE_ASM @@ -821,7 +818,6 @@ bus_space_set_multi_1(bus_space_tag_t ta { bus_space_handle_t addr = bsh + offset; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) while (count--) outb(addr, value); @@ -836,7 +832,6 @@ bus_space_set_multi_2(bus_space_tag_t ta { bus_space_handle_t addr = bsh + offset; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) while (count--) outw(addr, value); @@ -851,7 +846,6 @@ bus_space_set_multi_4(bus_space_tag_t ta { bus_space_handle_t addr = bsh + offset; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) while (count--) outl(addr, value); @@ -888,7 +882,6 @@ bus_space_set_region_1(bus_space_tag_t t { bus_space_handle_t addr = bsh + offset; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) for (; count != 0; count--, addr++) outb(addr, value); @@ -903,7 +896,6 @@ bus_space_set_region_2(bus_space_tag_t t { bus_space_handle_t addr = bsh + offset; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) for (; count != 0; count--, addr += 2) outw(addr, value); @@ -918,7 +910,6 @@ bus_space_set_region_4(bus_space_tag_t t { bus_space_handle_t addr = bsh + offset; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) for (; count != 0; count--, addr += 4) outl(addr, value); @@ -962,7 +953,6 @@ bus_space_copy_region_1(bus_space_tag_t bus_space_handle_t addr1 = bsh1 + off1; bus_space_handle_t addr2 = bsh2 + off2; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) { if (addr1 >= addr2) { /* src after dest: copy forward */ @@ -998,7 +988,6 @@ bus_space_copy_region_2(bus_space_tag_t bus_space_handle_t addr1 = bsh1 + off1; bus_space_handle_t addr2 = bsh2 + off2; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) { if (addr1 >= addr2) { /* src after dest: copy forward */ @@ -1034,7 +1023,6 @@ bus_space_copy_region_4(bus_space_tag_t bus_space_handle_t addr1 = bsh1 + off1; bus_space_handle_t addr2 = bsh2 + off2; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (tag == I386_BUS_SPACE_IO) { if (addr1 >= addr2) { /* src after dest: copy forward */ Modified: head/sys/ia64/include/bus.h ============================================================================== --- head/sys/ia64/include/bus.h Fri Dec 3 07:01:07 2010 (r216142) +++ head/sys/ia64/include/bus.h Fri Dec 3 07:09:23 2010 (r216143) @@ -91,9 +91,6 @@ #ifndef _MACHINE_BUS_H_ #define _MACHINE_BUS_H_ -#include -#include - #include #include @@ -301,7 +298,7 @@ static __inline void bus_space_read_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_multi_io_1(bsh + ofs, bufp, count); else { @@ -314,7 +311,7 @@ static __inline void bus_space_read_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_multi_io_2(bsh + ofs, bufp, count); else { @@ -327,7 +324,7 @@ static __inline void bus_space_read_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_multi_io_4(bsh + ofs, bufp, count); else { @@ -340,7 +337,7 @@ static __inline void bus_space_read_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_multi_io_8(bsh + ofs, bufp, count); else { @@ -364,7 +361,7 @@ static __inline void bus_space_write_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_multi_io_1(bsh + ofs, bufp, count); else { @@ -377,7 +374,7 @@ static __inline void bus_space_write_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_multi_io_2(bsh + ofs, bufp, count); else { @@ -390,7 +387,7 @@ static __inline void bus_space_write_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_multi_io_4(bsh + ofs, bufp, count); else { @@ -403,7 +400,7 @@ static __inline void bus_space_write_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_multi_io_8(bsh + ofs, bufp, count); else { @@ -428,7 +425,7 @@ static __inline void bus_space_read_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_region_io_1(bsh + ofs, bufp, count); else { @@ -442,7 +439,7 @@ static __inline void bus_space_read_region_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_region_io_2(bsh + ofs, bufp, count); else { @@ -456,7 +453,7 @@ static __inline void bus_space_read_region_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_region_io_4(bsh + ofs, bufp, count); else { @@ -470,7 +467,7 @@ static __inline void bus_space_read_region_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_read_region_io_8(bsh + ofs, bufp, count); else { @@ -496,7 +493,7 @@ static __inline void bus_space_write_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_region_io_1(bsh + ofs, bufp, count); else { @@ -510,7 +507,7 @@ static __inline void bus_space_write_region_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_region_io_2(bsh + ofs, bufp, count); else { @@ -524,7 +521,7 @@ static __inline void bus_space_write_region_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_region_io_4(bsh + ofs, bufp, count); else { @@ -538,7 +535,7 @@ static __inline void bus_space_write_region_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *bufp, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_write_region_io_8(bsh + ofs, bufp, count); else { @@ -558,7 +555,7 @@ static __inline void bus_space_set_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + while (count-- > 0) bus_space_write_1(bst, bsh, ofs, val); } @@ -567,7 +564,7 @@ static __inline void bus_space_set_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + while (count-- > 0) bus_space_write_2(bst, bsh, ofs, val); } @@ -576,7 +573,7 @@ static __inline void bus_space_set_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + while (count-- > 0) bus_space_write_4(bst, bsh, ofs, val); } @@ -585,7 +582,7 @@ static __inline void bus_space_set_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + while (count-- > 0) bus_space_write_8(bst, bsh, ofs, val); } @@ -606,7 +603,7 @@ static __inline void bus_space_set_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_set_region_io_1(bsh + ofs, val, count); else { @@ -620,7 +617,7 @@ static __inline void bus_space_set_region_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_set_region_io_2(bsh + ofs, val, count); else { @@ -634,7 +631,7 @@ static __inline void bus_space_set_region_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_set_region_io_4(bsh + ofs, val, count); else { @@ -648,7 +645,7 @@ static __inline void bus_space_set_region_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t count) { - KASSERT(count != 0, ("%s: count == 0", __func__)); + if (__predict_false(bst == IA64_BUS_SPACE_IO)) bus_space_set_region_io_4(bsh + ofs, val, count); else { @@ -677,7 +674,6 @@ bus_space_copy_region_1(bus_space_tag_t { uint8_t *dst, *src; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) { bus_space_copy_region_io_1(sbsh + sofs, dbsh + dofs, count); return; @@ -702,7 +698,6 @@ bus_space_copy_region_2(bus_space_tag_t { uint16_t *dst, *src; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) { bus_space_copy_region_io_2(sbsh + sofs, dbsh + dofs, count); return; @@ -727,7 +722,6 @@ bus_space_copy_region_4(bus_space_tag_t { uint32_t *dst, *src; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) { bus_space_copy_region_io_4(sbsh + sofs, dbsh + dofs, count); return; @@ -752,7 +746,6 @@ bus_space_copy_region_8(bus_space_tag_t { uint64_t *dst, *src; - KASSERT(count != 0, ("%s: count == 0", __func__)); if (__predict_false(bst == IA64_BUS_SPACE_IO)) { bus_space_copy_region_io_8(sbsh + sofs, dbsh + dofs, count); return; Modified: head/sys/mips/include/bus.h ============================================================================== --- head/sys/mips/include/bus.h Fri Dec 3 07:01:07 2010 (r216142) +++ head/sys/mips/include/bus.h Fri Dec 3 07:09:23 2010 (r216143) @@ -73,9 +73,6 @@ #ifndef _MACHINE_BUS_H_ #define _MACHINE_BUS_H_ -#include -#include - #include struct bus_space { @@ -317,29 +314,21 @@ struct bus_space { * Bus read multiple operations. */ #define bus_space_read_multi_1(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_1: count == 0")); \ __bs_nonsingle(rm,1,(t),(h),(o),(a),(c)) #define bus_space_read_multi_2(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_2: count == 0")); \ __bs_nonsingle(rm,2,(t),(h),(o),(a),(c)) #define bus_space_read_multi_4(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_4: count == 0")); \ __bs_nonsingle(rm,4,(t),(h),(o),(a),(c)) #define bus_space_read_multi_8(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_8: count == 0")); \ __bs_nonsingle(rm,8,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_1(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_stream_1: count == 0")); \ __bs_nonsingle_s(rm,1,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_2(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_stream_2: count == 0")); \ __bs_nonsingle_s(rm,2,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_4(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_stream_4: count == 0")); \ __bs_nonsingle_s(rm,4,(t),(h),(o),(a),(c)) #define bus_space_read_multi_stream_8(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_multi_stream_8: count == 0")); \ __bs_nonsingle_s(rm,8,(t),(h),(o),(a),(c)) @@ -347,33 +336,21 @@ struct bus_space { * Bus read region operations. */ #define bus_space_read_region_1(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_region_1: count == 0")); \ __bs_nonsingle(rr,1,(t),(h),(o),(a),(c)) #define bus_space_read_region_2(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_region_2: count == 0")); \ __bs_nonsingle(rr,2,(t),(h),(o),(a),(c)) #define bus_space_read_region_4(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_region_4: count == 0")); \ __bs_nonsingle(rr,4,(t),(h),(o),(a),(c)) #define bus_space_read_region_8(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_read_region_8: count == 0")); \ __bs_nonsingle(rr,8,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_1(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_read_region_stream_1: count == 0")); \ __bs_nonsingle_s(rr,1,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_2(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_read_region_stream_2: count == 0")); \ __bs_nonsingle_s(rr,2,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_4(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_read_region_stream_4: count == 0")); \ __bs_nonsingle_s(rr,4,(t),(h),(o),(a),(c)) #define bus_space_read_region_stream_8(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_read_region_stream_8: count == 0")); \ __bs_nonsingle_s(rr,8,(t),(h),(o),(a),(c)) @@ -395,33 +372,21 @@ struct bus_space { * Bus write multiple operations. */ #define bus_space_write_multi_1(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_multi_1: count == 0")); \ __bs_nonsingle(wm,1,(t),(h),(o),(a),(c)) #define bus_space_write_multi_2(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_multi_2: count == 0")); \ __bs_nonsingle(wm,2,(t),(h),(o),(a),(c)) #define bus_space_write_multi_4(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_multi_4: count == 0")); \ __bs_nonsingle(wm,4,(t),(h),(o),(a),(c)) #define bus_space_write_multi_8(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_multi_8: count == 0")); \ __bs_nonsingle(wm,8,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_1(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_write_multi_stream_1: count == 0")); \ __bs_nonsingle_s(wm,1,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_2(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_write_multi_stream_2: count == 0")); \ __bs_nonsingle_s(wm,2,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_4(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_write_multi_stream_4: count == 0")); \ __bs_nonsingle_s(wm,4,(t),(h),(o),(a),(c)) #define bus_space_write_multi_stream_8(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_write_multi_stream_8: count == 0")); \ __bs_nonsingle_s(wm,8,(t),(h),(o),(a),(c)) @@ -429,50 +394,34 @@ struct bus_space { * Bus write region operations. */ #define bus_space_write_region_1(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_region_1: count == 0")); \ __bs_nonsingle(wr,1,(t),(h),(o),(a),(c)) #define bus_space_write_region_2(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_region_2: count == 0")); \ __bs_nonsingle(wr,2,(t),(h),(o),(a),(c)) #define bus_space_write_region_4(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_region_4: count == 0")); \ __bs_nonsingle(wr,4,(t),(h),(o),(a),(c)) #define bus_space_write_region_8(t, h, o, a, c) \ - KASSERT(c != 0, ("bus_space_write_region_8: count == 0")); \ __bs_nonsingle(wr,8,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_1(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_write_region_stream_1: count == 0")); \ __bs_nonsingle_s(wr,1,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_2(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_write_region_stream_2: count == 0")); \ __bs_nonsingle_s(wr,2,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_4(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_write_region_stream_4: count == 0")); \ __bs_nonsingle_s(wr,4,(t),(h),(o),(a),(c)) #define bus_space_write_region_stream_8(t, h, o, a, c) \ - KASSERT(c != 0, \ - ("bus_space_write_region_stream_8: count == 0")); \ __bs_nonsingle_s(wr,8,(t),(h),(o),(a),(c)) /* * Set multiple operations. */ -#define bus_space_set_multi_1(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_multi_1: count == 0")); \ +#define bus_space_set_multi_1(t, h, o, v, c) \ __bs_set(sm,1,(t),(h),(o),(v),(c)) -#define bus_space_set_multi_2(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_multi_2: count == 0")); \ +#define bus_space_set_multi_2(t, h, o, v, c) \ __bs_set(sm,2,(t),(h),(o),(v),(c)) -#define bus_space_set_multi_4(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_multi_4: count == 0")); \ +#define bus_space_set_multi_4(t, h, o, v, c) \ __bs_set(sm,4,(t),(h),(o),(v),(c)) -#define bus_space_set_multi_8(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_multi_8: count == 0")); \ +#define bus_space_set_multi_8(t, h, o, v, c) \ __bs_set(sm,8,(t),(h),(o),(v),(c)) @@ -480,33 +429,25 @@ struct bus_space { * Set region operations. */ #define bus_space_set_region_1(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_region_1: count == 0")); \ __bs_set(sr,1,(t),(h),(o),(v),(c)) #define bus_space_set_region_2(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_region_2: count == 0")); \ __bs_set(sr,2,(t),(h),(o),(v),(c)) #define bus_space_set_region_4(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_region_4: count == 0")); \ __bs_set(sr,4,(t),(h),(o),(v),(c)) #define bus_space_set_region_8(t, h, o, v, c) \ - KASSERT(c != 0, ("bus_space_set_region_8: count == 0")); \ __bs_set(sr,8,(t),(h),(o),(v),(c)) /* * Copy operations. */ -#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \ - KASSERT(c != 0, ("bus_space_copy_region_1: count == 0")); \ +#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \ __bs_copy(1, t, h1, o1, h2, o2, c) -#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \ - KASSERT(c != 0, ("bus_space_copy_region_2: count == 0")); \ +#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \ __bs_copy(2, t, h1, o1, h2, o2, c) -#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \ - KASSERT(c != 0, ("bus_space_copy_region_4: count == 0")); \ +#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \ __bs_copy(4, t, h1, o1, h2, o2, c) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 07:33:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37E6110656A3; Fri, 3 Dec 2010 07:33:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25F768FC17; Fri, 3 Dec 2010 07:33:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB37Xi85060555; Fri, 3 Dec 2010 07:33:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB37XiEu060553; Fri, 3 Dec 2010 07:33:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201012030733.oB37XiEu060553@svn.freebsd.org> From: Warner Losh Date: Fri, 3 Dec 2010 07:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216144 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 07:33:44 -0000 Author: imp Date: Fri Dec 3 07:33:43 2010 New Revision: 216144 URL: http://svn.freebsd.org/changeset/base/216144 Log: _WITHOUT_SRCCONF has too much baggage. Instead, use the simpler SRCCONF=/dev/null. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Dec 3 07:09:23 2010 (r216143) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Dec 3 07:33:43 2010 (r216144) @@ -182,7 +182,7 @@ make_conf_build ( ) ( echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_BUILD} echo "${CONF_BUILD}" >> ${NANO_MAKE_CONF_BUILD} - echo "_WITHOUT_SRCCONF=t" >> ${NANO_MAKE_CONF_BUILD} + echo "SRCCONF=/dev/null" >> ${NANO_MAKE_CONF_BUILD} ) build_world ( ) ( From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 07:39:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA8361065674; Fri, 3 Dec 2010 07:39:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D89DB8FC19; Fri, 3 Dec 2010 07:39:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB37dTHv061092; Fri, 3 Dec 2010 07:39:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB37dTKC061090; Fri, 3 Dec 2010 07:39:29 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201012030739.oB37dTKC061090@svn.freebsd.org> From: Warner Losh Date: Fri, 3 Dec 2010 07:39:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216145 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 07:39:30 -0000 Author: imp Date: Fri Dec 3 07:39:29 2010 New Revision: 216145 URL: http://svn.freebsd.org/changeset/base/216145 Log: o Mount the device async when we're doing the copy. o Create a sparse file instead of a fully zerod one. This trades the possibiltiy of running out of space during the build for the speed gain not having do write all those zeros... Submitted by: n_hibma Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Dec 3 07:33:43 2010 (r216144) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Dec 3 07:39:29 2010 (r216145) @@ -404,7 +404,7 @@ newfs_part ( ) ( lbl=$3 echo newfs ${NANO_NEWFS} ${NANO_LABEL:+-L${NANO_LABEL}${lbl}} ${dev} newfs ${NANO_NEWFS} ${NANO_LABEL:+-L${NANO_LABEL}${lbl}} ${dev} - mount ${dev} ${mnt} + mount -o async ${dev} ${mnt} ) populate_slice ( ) ( @@ -513,8 +513,8 @@ create_i386_diskimage ( ) ( -y ${NANO_HEADS}` else echo "Creating md backing file..." - dd if=/dev/zero of=${IMG} bs=${NANO_SECTS}b \ - count=`expr ${NANO_MEDIASIZE} / ${NANO_SECTS}` + rm -f ${IMG} + dd if=/dev/zero of=${IMG} seek=${NANO_MEDIASIZE} count=0 MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \ -y ${NANO_HEADS}` fi From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 09:45:16 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A25DF10656AA; Fri, 3 Dec 2010 09:45:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 3ADCC8FC12; Fri, 3 Dec 2010 09:45:15 +0000 (UTC) Received: from c211-30-187-94.carlnfd1.nsw.optusnet.com.au (c211-30-187-94.carlnfd1.nsw.optusnet.com.au [211.30.187.94]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB39jCUl020765 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 3 Dec 2010 20:45:13 +1100 Date: Fri, 3 Dec 2010 20:45:12 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Cran In-Reply-To: <201012022219.oB2MJUx5031472@svn.freebsd.org> Message-ID: <20101203201705.O2228@besplex.bde.org> References: <201012022219.oB2MJUx5031472@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216134 - in head: share/man/man9 sys/amd64/include sys/arm/include sys/i386/include sys/ia64/include sys/mips/include sys/pc98/include sys/powerpc/include sys/sparc64/include sys/sun4v... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 09:45:16 -0000 On Thu, 2 Dec 2010, Bruce Cran wrote: > Log: > Disallow passing in a count of zero bytes to the bus_space(9) functions. > > Passing a count of zero on i386 and amd64 for [I386|AMD64]_BUS_SPACE_MEM > causes a crash/hang since the 'loop' instruction decrements the counter > before checking if it's zero. > > PR: kern/80980 > Discussed with: jhb > ... > Modified: head/sys/amd64/include/bus.h > ============================================================================== > --- head/sys/amd64/include/bus.h Thu Dec 2 22:00:57 2010 (r216133) > +++ head/sys/amd64/include/bus.h Thu Dec 2 22:19:30 2010 (r216134) > @@ -104,6 +104,9 @@ > #ifndef _AMD64_BUS_H_ > #define _AMD64_BUS_H_ > > +#include > +#include > + This is massive namespace pollution. Most kernel .c files should include these first, and most already do. (Ones that try to be smart and only include instead of , or without , or include after other headers, may already be broken, since KASSERT() is declared in , but it may be used in other header (like this one now). KASSERT() should probably be declared in or even in . That gives more pollution there but less overall.) > #include > #include Including is correct (_bus.h exist to avoid namespace pollution that is about 1000 times smaller than now here), but including is older namespace pollution/historical mislayering (we only need i/o functions from cpufunc.h, and they should be declared here directly). Now it has no effect, since is standard namespace pollution in . > > @@ -268,7 +271,7 @@ static __inline void > bus_space_read_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, > bus_size_t offset, u_int8_t *addr, size_t count) > { > - > + KASSERT(count != 0, ("%s: count == 0", __func__)); > if (tag == AMD64_BUS_SPACE_IO) > insb(bsh + offset, addr, count); > else { KASSERT() in little inline functions gives a lot of bloat for such an unlikely error. Stupid callers can still pass any garbage count except 0. The function name of a leaf function is not very interesting. In some of the other bus.h's, the caller's name is available since the interface is a macro, but there __func__ (which should only be used in macros) is not used, apparently since it would give a name that is useful but inconsistent with arches that don't use a macro. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 10:06:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 691771065698; Fri, 3 Dec 2010 10:06:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56F9D8FC14; Fri, 3 Dec 2010 10:06:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3A6J5n070690; Fri, 3 Dec 2010 10:06:19 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3A6J1S070688; Fri, 3 Dec 2010 10:06:19 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201012031006.oB3A6J1S070688@svn.freebsd.org> From: Xin LI Date: Fri, 3 Dec 2010 10:06:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216147 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 10:06:19 -0000 Author: delphij Date: Fri Dec 3 10:06:19 2010 New Revision: 216147 URL: http://svn.freebsd.org/changeset/base/216147 Log: * Recommend a overwrite of whole geli provider before use. * Correct a typo while I'm there. Reviewed by: pjd MFC after: 2 weeks Modified: head/sbin/geom/class/eli/geli.8 Modified: head/sbin/geom/class/eli/geli.8 ============================================================================== --- head/sbin/geom/class/eli/geli.8 Fri Dec 3 09:26:56 2010 (r216146) +++ head/sbin/geom/class/eli/geli.8 Fri Dec 3 10:06:19 2010 (r216147) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2010 +.Dd December 3, 2010 .Dt GELI 8 .Os .Sh NAME @@ -842,7 +842,7 @@ Enter passphrase: .Nm supports two encryption modes: .Nm XTS , -which was standarized as +which was standardized as .Nm IEE P1619 and .Nm CBC @@ -873,6 +873,10 @@ changes with the data he owns without no In other words .Nm will not protect your data against replay attacks. +.Pp +It is recommended to write the whole provider before the first use, +in order to make sure that all sectors and their corresponding +checksums are properly initialized into a consistent state. .Sh SEE ALSO .Xr crypto 4 , .Xr gbde 4 , From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 10:17:10 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82F1B106566B; Fri, 3 Dec 2010 10:17:10 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 355808FC0A; Fri, 3 Dec 2010 10:17:10 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 5EC75E7167; Fri, 3 Dec 2010 10:17:09 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=39vjrn6mjJhz P4VqxfAAJW0ySRY=; b=DpJumU8Hu0ryTFFQN0w53RgW6zwLfWA56/l53ZiGgZ46 F9X0eOAdZ0iXShgoxdbVPIxCsMS+aDixOWI6Cy7xAalfDQTJRPKrFGfjTWWX22OH jMegYQZmGDhlBlPbnXfNy3bRsqLp38A6KO8lXL2hmaZoo1N+MDAsT9hiWAkpDQ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:to :cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=SFthpL cdwaqoNncG/bTD6BlVA37tWLmaZCUzKnjtcrb6StCq4fJFryrEUJLYRURq6Vdvum e7Pgk+W0IxR+xlcFT1cj7phY9b1SJxGZNildqxtW21CR35+Lvkt6ek1Hg6I/CtW7 cVhnhSlaw3lnyo6xMryJWQtuB6C7UWWwUK3OM= Received: from core.draftnet (client-86-31-8-12.midd.adsl.virginmedia.com [86.31.8.12]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id DE70CE7161; Fri, 3 Dec 2010 10:17:08 +0000 (GMT) Date: Fri, 3 Dec 2010 10:16:51 +0000 From: Bruce Cran To: Bruce Evans Message-ID: <20101203101651.7461ced0@core.draftnet> In-Reply-To: <20101203201705.O2228@besplex.bde.org> References: <201012022219.oB2MJUx5031472@svn.freebsd.org> <20101203201705.O2228@besplex.bde.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Cran Subject: Re: svn commit: r216134 - in head: share/man/man9 sys/amd64/include sys/arm/include sys/i386/include sys/ia64/include sys/mips/include sys/pc98/include sys/powerpc/include sys/sparc64/include sys/sun4v... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 10:17:10 -0000 On Fri, 3 Dec 2010 20:45:12 +1100 (EST) Bruce Evans wrote: > KASSERT() in little inline functions gives a lot of bloat for such an > unlikely error. Stupid callers can still pass any garbage count > except 0. Yes, this catches a specific case that hps raised a few years ago: sending zero-length packets/frames would fail by causing the system to hang. Should we just document the restriction in the man page and not try and prevent it at runtime? -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 10:52:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2F6A1065696; Fri, 3 Dec 2010 10:52:07 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2D4B48FC1D; Fri, 3 Dec 2010 10:52:07 +0000 (UTC) Received: from outgoing.leidinger.net (p57B3A9BC.dip.t-dialin.net [87.179.169.188]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 043DC844012; Fri, 3 Dec 2010 11:52:01 +0100 (CET) Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102]) by outgoing.leidinger.net (Postfix) with ESMTP id 5782313D7; Fri, 3 Dec 2010 11:51:57 +0100 (CET) Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id oB3ApqXm005781; Fri, 3 Dec 2010 11:51:52 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Fri, 03 Dec 2010 11:51:51 +0100 Message-ID: <20101203115151.211764ip6uxfggow@webmail.leidinger.net> Date: Fri, 03 Dec 2010 11:51:51 +0100 From: Alexander Leidinger To: Ulrich Spoerlein References: <201012021046.oB2Ak5EV000582@svn.freebsd.org> <20101202154522.76174hkekl2ct4pw@webmail.leidinger.net> <20101202204349.GB3256@acme.spoerlein.net> In-Reply-To: <20101202204349.GB3256@acme.spoerlein.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 043DC844012.A7CC6 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=1.351, required 6, autolearn=disabled, RDNS_NONE 1.27, TW_SV 0.08) X-EBL-MailScanner-SpamScore: s X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1291978323.39351@1gCL29362Zl+SVl6svy/tg X-EBL-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216119 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 10:52:07 -0000 Quoting Ulrich Spoerlein (from Thu, 2 Dec 2010 21:43:49 +0100): > On Thu, 02.12.2010 at 15:45:22 +0100, Alexander Leidinger wrote: >> Quoting Ulrich Spoerlein (from Thu, 2 Dec 2010 >> 10:46:05 +0000 (UTC)): >> >> > Author: uqs >> > Date: Thu Dec 2 10:46:05 2010 >> > New Revision: 216119 >> > URL: http://svn.freebsd.org/changeset/base/216119 >> > >> > Log: >> > Remove more duplicates. >> > >> > Just so that I can lookup the command for the next time: >> >> Can you please add it to OldFiles.inc instead, with a comment what it does? >> >> > for t in `make -V TARGETS universe`; do >> > __MAKE_CONF=/dev/null make -f Makefile.inc1 -m $PWD/share/mk >> TARGET=$t \ >> > -V OLD_FILES -V OLD_LIBS -V OLD_DIRS delete-old | \ >> > xargs -n1|sort|uniq -c|egrep -v "^ *1 "; >> > done >> >> While it does not matter for "-V OLD*", the spirit of the command is >> more like the check-old target (which is including shared libs) than >> the delete-old target (which does not delete shared libs but only >> static libs). Using check-old would also remove the (wrong, but not >> far fetched) fear of actually deleting something with this command. > > Something that bugs me more, is all the TARGET_ARCH conditionals in that > file, that serve practically no purpose. If a file only existed on i386, > and it has been removed on i386, there's no point in wrapping this under > TARGET_ARCH=i386. The wrapping of all lib32 files for amd64 is a great > example :/ My initial conditionals where only for things which where available everywhere, but got removed only on some platforms. Examples are the change in the threading libs, which where changed on most arches except for one or two, and the disk labeling things (IIRC the MBR stuff was removed from non-x86ish platforms). If this changed, it is a bug when you still have the initial design in mind. > The wrapping is only ever required, if some file has been removed from a > set of arches, but must be retained on others. Correct. > Anyway, please see attached. Does not look bad... Bye, Alexander. -- If at first you don't succeed, try, try again. Then quit. No use being a damn fool about it. -- W. C. Fields [Also attributed to Roy Mengot. Ed.] http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 13:02:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EAAB1065694; Fri, 3 Dec 2010 13:02:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EF9FE8FC1D; Fri, 3 Dec 2010 13:02:07 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id A192146B7E; Fri, 3 Dec 2010 08:02:07 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A30688A027; Fri, 3 Dec 2010 08:02:06 -0500 (EST) From: John Baldwin To: Bruce Cran Date: Fri, 3 Dec 2010 07:46:44 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201012022219.oB2MJUx5031472@svn.freebsd.org> <20101203201705.O2228@besplex.bde.org> <20101203101651.7461ced0@core.draftnet> In-Reply-To: <20101203101651.7461ced0@core.draftnet> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201012030746.44967.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 03 Dec 2010 08:02:06 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans , Bruce Cran Subject: Re: svn commit: r216134 - in head: share/man/man9 sys/amd64/include sys/arm/include sys/i386/include sys/ia64/include sys/mips/include sys/pc98/include sys/powerpc/include sys/sparc64/include sys/sun4v... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 13:02:08 -0000 On Friday, December 03, 2010 5:16:51 am Bruce Cran wrote: > On Fri, 3 Dec 2010 20:45:12 +1100 (EST) > Bruce Evans wrote: > > > KASSERT() in little inline functions gives a lot of bloat for such an > > unlikely error. Stupid callers can still pass any garbage count > > except 0. > > Yes, this catches a specific case that hps raised a few years ago: > sending zero-length packets/frames would fail by causing the system to > hang. Should we just document the restriction in the man page and not > try and prevent it at runtime? Documenting it is probably sufficient. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 13:08:09 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB10A106566B; Fri, 3 Dec 2010 13:08:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 6FAB58FC0C; Fri, 3 Dec 2010 13:08:09 +0000 (UTC) Received: from c211-30-187-94.carlnfd1.nsw.optusnet.com.au (c211-30-187-94.carlnfd1.nsw.optusnet.com.au [211.30.187.94]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB3D816a014993 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 Dec 2010 00:08:06 +1100 Date: Sat, 4 Dec 2010 00:08:01 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Schultz In-Reply-To: <201012030701.oB3717YD058149@svn.freebsd.org> Message-ID: <20101203224218.P2687@besplex.bde.org> References: <201012030701.oB3717YD058149@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216142 - head/share/man/man3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 13:08:10 -0000 On Fri, 3 Dec 2010, David Schultz wrote: > Log: > Explain some of the reasons that fpsetprec() is unlikely to work as > one might expect. (These functions have already been deprecated for > many years.) Um, only the functions other than fpsetprec() are deprecated (since it is a bug in the fenv family of functions that it has no replacement). > Modified: head/share/man/man3/fpgetround.3 > ============================================================================== > --- head/share/man/man3/fpgetround.3 Fri Dec 3 04:39:48 2010 (r216141) > +++ head/share/man/man3/fpgetround.3 Fri Dec 3 07:01:07 2010 (r216142) > @@ -32,7 +32,7 @@ > .\" @(#)fpgetround.3 1.0 (Berkeley) 9/23/93 > .\" $FreeBSD$ > .\" > -.Dd August 23, 1993 > +.Dd December 3, 2010 > .Dt FPGETROUND 3 > .Os > .Sh NAME > @@ -164,6 +164,10 @@ and > .Fn fpsetprec > functions provide functionality unavailable on many platforms. > At present, they are implemented only on the i386 and amd64 platforms. > +Changing precision isn't a supported feature: > +it may be ineffective when code is compiled to take advantage of SSE, > +and many library functions and compiler optimizations depend upon the > +default precision for correct behavior. But it is much more needed for correct behaviour than when it was "deprecated". There are now several long double library functions that depend on it having been used to change the rounding precision across calls to them, else they produce garbage or are useless. Not to mention user code that uses long doubles so must use it if it wants long doubles to actually be useful. Of course, it is so difficult to use correctly that long doubles are almost useless anyway. For the library functions, you have to know which can benefit from it, and then you probably have to keep the extended precision across more than the function call, to actually use the results. The use in the PR seems to be an un-useful use that can only cause problems: keep extended precision while calling a non-long-double libm function. Analysis of safety and correctness of most long double precision functions in libm: Ones that work when called with any rounding precision, with no known major bugs (some known minor bugs for unsupported formats): ceill() copysignl() fabsl() fdiml() floorl() fmal() fmaxl() fminl() fmodl() frexpl() fpclassify() and other classification functions ilogbl() ldexpl() llrintl() llroundl() lrintl() logbl() lroundl() modfl() nearbyintl() next*() rintl() roundl() scalblnl() scalbnl() signbitl() sqrtl() (the C version needs extended precision, but i386 uses the asm version) truncl() These can work since they mostly only use integer operations. ceill(), floorl(), lrintl() and a couple of others actually use the FPU dangerously on i386, so I'm not sure if they work. Need extended precision, and believed to work with it acosl() asinl() atan2l() atanl() hypotl() remainderl() (not sure if this needs it) remquol() (not sure if this needs it) Need extended precision, but known to be broken even with it: cosl() sinl() tanl() These fail because arg reduction doesn't work in extended precision. This bug used to affect float precision, but only for large args, and was fixed long ago, first by using the STRICT_ASSIGN() macro and then by always doing the reduction in double precision, which works provided assignments to double precision variable work, which doesn't happen for gcc in extended precision. For long doubles, it doesn't help that the general case of arg reduction is used for almost all args, so that arg reduction is very slow and the bug is active for almost all args. The arg reduction is one of the few places that takes precautions against this. It uses STRICT_ASSIGN(), but STRICT_ASSIGN() intentionally doesn't work with extended precision because that would pessimize the usual case of non-extended precision. Compiler bugs in this area are to avoid the same pessimization, except if extended precision is the default then the buggy case is the usual case. FreeBSD makes the buggy case the unusual case by defaulting to double precision. Special: exp2l() This falls back to using exp() if the precision is not already extended, and is the only libm function with such a fallback. It, and all other functions that need extended precision, should do the same test as this one to see if the precision is already, and if not then switch to it, and back later. This would be slower, but only slightly slower in what should be the usual case of the caller already having switched unconditionally. exp2l() has been more tested than the other long double transcendenta functions, and is known to have some inaccuracies, probably due to a buggy polynomial. According to saved data, the worst case that I could find was: x = 0.003906249999999999805394000000 = 0.003906249999999999805394180368 when rounded to 64 bits exp2l(x) = 1.002711275050202485151000000 (according to libm) = 1.002711275050202485150871445 when rounded to 64 bits = 0x8058d7d2d5e5f6ae.0p-63 exp2l(x rounded) = 1.002711275050202485295489388 (according to pari; 28 decimal digs) = 1.002711275050202485259291663 when rounded to 64 bits = 0x8058d7d2d5e5f6af55.0p-71" The error is about 1 + 0x55/0x100 ulps (this is the difference in the 0xp values after the 64th mantissa bit), but the claimed accuracy is < 0.511 ulps. The value of 0.003906... is related to the endpoints of the intervals used by exp2l(). There are large errors for many values close to the endpoint x = 1/256.0. This value less 333 ulps is another. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 13:16:30 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 368BC10656A7; Fri, 3 Dec 2010 13:16:30 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from ixe-mta-27.emailfiltering.com (ixe-mta-27-tx.emailfiltering.com [194.116.199.158]) by mx1.freebsd.org (Postfix) with ESMTP id 04C198FC15; Fri, 3 Dec 2010 13:16:28 +0000 (UTC) Received: from mail-gw12.york.ac.uk ([144.32.129.162]) by ixe-mta-27.emailfiltering.com with emfmta (version 4.6.0.72) by TLS id 840702758 for src-committers@FreeBSD.org; dd031def5239703c; Fri, 03 Dec 2010 12:43:07 +0000 Received: from buffy-128.york.ac.uk ([144.32.128.160]:57527 helo=buffy.york.ac.uk) by mail-gw12.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1POUyg-0001wU-Aq; Fri, 03 Dec 2010 12:43:06 +0000 Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.14.4/8.14.4) with ESMTP id oB2DJSPS060087; Thu, 2 Dec 2010 13:19:28 GMT (envelope-from gavin@FreeBSD.org) Received: (from ga9@localhost) by buffy.york.ac.uk (8.14.4/8.14.4/Submit) id oB2DJRuG060086; Thu, 2 Dec 2010 13:19:27 GMT (envelope-from gavin@FreeBSD.org) X-Authentication-Warning: buffy.york.ac.uk: ga9 set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson To: Weongyo Jeong In-Reply-To: <201012010324.oB13OdL8060240@svn.freebsd.org> References: <201012010324.oB13OdL8060240@svn.freebsd.org> Content-Type: text/plain; charset="ASCII" Content-Transfer-Encoding: quoted-printable Date: Thu, 02 Dec 2010 13:19:27 +0000 Message-ID: <1291295967.58583.59.camel@buffy.york.ac.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.30.1.2 FreeBSD GNOME Team Port Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216089 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 13:16:30 -0000 On Wed, 2010-12-01 at 03:24 +0000, Weongyo Jeong wrote: > Author: weongyo > Date: Wed Dec 1 03:24:38 2010 > New Revision: 216089 > URL: http://svn.freebsd.org/changeset/base/216089 >=20 > Log: > Don't print usbus[0-9] interfaces that it's not the interesting > interface type for ifconfig(8). >=20 > Modified: > head/sbin/ifconfig/ifconfig.c >=20 > Modified: head/sbin/ifconfig/ifconfig.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/ifconfig/ifconfig.c Tue Nov 30 22:39:46 2010 (r216088) > +++ head/sbin/ifconfig/ifconfig.c Wed Dec 1 03:24:38 2010 (r216089) > @@ -295,6 +295,8 @@ main(int argc, char *argv[]) > sdl =3D (const struct sockaddr_dl *) ifa->ifa_addr; > else > sdl =3D NULL; > + if (sdl !=3D NULL && sdl->sdl_type =3D=3D IFT_USB) > + continue; > if (cp !=3D NULL && strcmp(cp, ifa->ifa_name) =3D=3D 0 && !namesonly) > continue; > iflen =3D strlcpy(name, ifa->ifa_name, sizeof(name)); I may be misunderstanding, but isn't this more of a hack than the correct solution? I appreciate that there are a large number of defined interface types, but I wonder if we should instead check for interface types we are prepared to accept, rather than skipping ones we know we don't want? Was this issue introduced with the introduction of the USB pcap changes? Thanks, Gavin --=20 Gavin Atkinson FreeBSD committer and bugmeister GPG: A093262B (313A A79F 697D 3A5C 216A EDF5 935D EF44 A093 262B) From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 14:20:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E13B11065693; Fri, 3 Dec 2010 14:20:20 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEC488FC0C; Fri, 3 Dec 2010 14:20:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3EKKoK090440; Fri, 3 Dec 2010 14:20:20 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3EKKhv090437; Fri, 3 Dec 2010 14:20:20 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201012031420.oB3EKKhv090437@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 3 Dec 2010 14:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216148 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 14:20:21 -0000 Author: jchandra Date: Fri Dec 3 14:20:20 2010 New Revision: 216148 URL: http://svn.freebsd.org/changeset/base/216148 Log: Fixup for r216141, dump_add_page needs to be non-static now. Add it to sys/mips/include/md_var.h, make dump_drop_page non-static too for completeness. Modified: head/sys/mips/include/md_var.h head/sys/mips/mips/minidump_machdep.c Modified: head/sys/mips/include/md_var.h ============================================================================== --- head/sys/mips/include/md_var.h Fri Dec 3 10:06:19 2010 (r216147) +++ head/sys/mips/include/md_var.h Fri Dec 3 14:20:20 2010 (r216148) @@ -77,6 +77,8 @@ void platform_identify(void); extern int busdma_swi_pending; void busdma_swi(void); -struct dumperinfo; -void minidumpsys(struct dumperinfo *); +struct dumperinfo; +void dump_add_page(vm_paddr_t); +void dump_drop_page(vm_paddr_t); +void minidumpsys(struct dumperinfo *); #endif /* !_MACHINE_MD_VAR_H_ */ Modified: head/sys/mips/mips/minidump_machdep.c ============================================================================== --- head/sys/mips/mips/minidump_machdep.c Fri Dec 3 10:06:19 2010 (r216147) +++ head/sys/mips/mips/minidump_machdep.c Fri Dec 3 14:20:20 2010 (r216148) @@ -83,7 +83,7 @@ is_dumpable(vm_paddr_t pa) return (0); } -static void +void dump_add_page(vm_paddr_t pa) { int idx, bit; @@ -94,7 +94,7 @@ dump_add_page(vm_paddr_t pa) atomic_set_int(&vm_page_dump[idx], 1ul << bit); } -static void +void dump_drop_page(vm_paddr_t pa) { int idx, bit; From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 14:27:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A32710656A4; Fri, 3 Dec 2010 14:27:56 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id ABFF18FC08; Fri, 3 Dec 2010 14:27:55 +0000 (UTC) Received: by qyk8 with SMTP id 8so838790qyk.13 for ; Fri, 03 Dec 2010 06:27:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=AnLFMrz1E/EhZd/geB2qGmCnJle1edrT+GJlvt9Cabo=; b=Lb3YmOWfCwfKxCiIcS/mDi1jzRQvadfETDgXqfOEVbyADVSmRZSjOFGXHNfE1YMAEr 6ladOWucGWK9AIl4JPdFtkxKtmK6Tm+Fp9yiCiux2GwQSub9APKf7ZHakvICUjdcfRaX tL5JtDE9B/kWZwfyiZnDreSvkxZlgtn1VDRNA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=e8vV13nnJcNjLZ6XOWLobCL9gArPMyEEu00HgK9dkJMyIOTS4c4S3ERsU3Ic4pRnHI kBi4tQbSglTNJitOPRRpo9JXX0FNaQM4OfRmUVeIl0ok0MldMVRPuBdHNZPoXh1k145x pDsSynsOrwOMKmLH3hnKP3AaVuQXndWG0XT4Q= Received: by 10.229.246.136 with SMTP id ly8mr1267174qcb.237.1291386474684; Fri, 03 Dec 2010 06:27:54 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.231.143 with HTTP; Fri, 3 Dec 2010 06:27:13 -0800 (PST) In-Reply-To: <201012030746.44967.jhb@freebsd.org> References: <201012022219.oB2MJUx5031472@svn.freebsd.org> <20101203201705.O2228@besplex.bde.org> <20101203101651.7461ced0@core.draftnet> <201012030746.44967.jhb@freebsd.org> From: Ivan Voras Date: Fri, 3 Dec 2010 15:27:13 +0100 X-Google-Sender-Auth: oSTo9np0lDfCp2ql3lkkMX_n2BU Message-ID: To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Bruce Cran , src-committers@freebsd.org, svn-src-all@freebsd.org, Bruce Evans , Bruce Cran , svn-src-head@freebsd.org Subject: Re: svn commit: r216134 - in head: share/man/man9 sys/amd64/include sys/arm/include sys/i386/include sys/ia64/include sys/mips/include sys/pc98/include sys/powerpc/include sys/sparc64/include sys/sun4v... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 14:27:56 -0000 On 3 December 2010 13:46, John Baldwin wrote: > On Friday, December 03, 2010 5:16:51 am Bruce Cran wrote: >> On Fri, 3 Dec 2010 20:45:12 +1100 (EST) >> Bruce Evans wrote: >> >> > KASSERT() in little inline functions gives a lot of bloat for such an >> > unlikely error. =C2=A0Stupid callers can still pass any garbage count >> > except 0. >> >> Yes, this catches a specific case that hps raised a few years ago: >> sending zero-length packets/frames would fail by causing the system to >> hang. Should we just document the restriction in the man page and not >> try and prevent it at runtime? > > Documenting it is probably sufficient. I'd say it depends on if the "specific case that hps raised a few years ago" sentence part refers to an actual problem; i.e. did it happen in practice? If yes, leaving KASSERTs looks like the best option. From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 14:41:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 886391065670; Fri, 3 Dec 2010 14:41:24 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 104598FC17; Fri, 3 Dec 2010 14:41:24 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 3A685E7167; Fri, 3 Dec 2010 14:41:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=ZssQ//EKEAYT 2kMp41HOLQ8ZiV8=; b=qeDrYzrwWYDlJaLBYB/Mt3YH2wzXvJ5gP5tBFFTd0Huu IXYImLOl36H+F7HmvfZplaMu80NMrvoN+kWqsADD2n8MrCIevMTh/TvUwim2+Mmp cA/KlsxllQKn5iWWZmAhyr/jsSaON0ryRPF64Ynwhn3R4H9fGUQqQ5AHhYdbvOE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:to :cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=BDLQO0 NCanFt9I5IjGyn362YNiFFkAL4L1/iVrxsPx47rEZR6qfFPFfFo91fCTruxXfUQR iep8GBrbZkzysKLRHA4n/wYzxdd6Xo7vITNE/dzIbNd9zmIBaDssbLit5XXlCcMt gddAwa+iBMP3TjUBHUszsShL18tlNw8GYh5XE= Received: from unknown (client-86-31-8-12.midd.adsl.virginmedia.com [86.31.8.12]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id A992CE60D0; Fri, 3 Dec 2010 14:41:22 +0000 (GMT) Date: Fri, 3 Dec 2010 14:41:03 +0000 From: Bruce Cran To: Ivan Voras Message-ID: <20101203144103.00005a78@unknown> In-Reply-To: References: <201012022219.oB2MJUx5031472@svn.freebsd.org> <20101203201705.O2228@besplex.bde.org> <20101203101651.7461ced0@core.draftnet> <201012030746.44967.jhb@freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Bruce Evans , Bruce Cran , svn-src-head@freebsd.org Subject: Re: svn commit: r216134 - in head: share/man/man9 sys/amd64/include sys/arm/include sys/i386/include sys/ia64/include sys/mips/include sys/pc98/include sys/powerpc/include sys/sparc64/include sys/sun4v... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 14:41:24 -0000 On Fri, 3 Dec 2010 15:27:13 +0100 Ivan Voras wrote: > I'd say it depends on if the "specific case that hps raised a few > years ago" sentence part refers to an actual problem; i.e. did it > happen in practice? If yes, leaving KASSERTs looks like the best > option. I've found hps's original email thread, which is at http://lists.freebsd.org/pipermail/freebsd-hackers/2005-June/012342.html . The argument for allowing zero-length reads/writes is at http://lists.freebsd.org/pipermail/freebsd-hackers/2005-June/012348.html . I suspect the mistake occurred due to a misunderstanding of the API. NetBSD have documented it in their man page but not added asserts in the code: "Functions which take a count of bytes have undefined results if the specified count is zero." -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 15:49:07 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D90411065672; Fri, 3 Dec 2010 15:49:07 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 6E92E8FC16; Fri, 3 Dec 2010 15:49:07 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id oB3FDhS1007665; Fri, 3 Dec 2010 09:13:43 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id oB3FDhnq007664; Fri, 3 Dec 2010 09:13:43 -0600 (CST) (envelope-from brooks) Date: Fri, 3 Dec 2010 09:13:43 -0600 From: Brooks Davis To: Gavin Atkinson Message-ID: <20101203151343.GA7429@lor.one-eyed-alien.net> References: <201012010324.oB13OdL8060240@svn.freebsd.org> <1291295967.58583.59.camel@buffy.york.ac.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline In-Reply-To: <1291295967.58583.59.camel@buffy.york.ac.uk> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Fri, 03 Dec 2010 09:13:43 -0600 (CST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Weongyo Jeong Subject: Re: svn commit: r216089 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 15:49:07 -0000 --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 02, 2010 at 01:19:27PM +0000, Gavin Atkinson wrote: > On Wed, 2010-12-01 at 03:24 +0000, Weongyo Jeong wrote: > > Author: weongyo > > Date: Wed Dec 1 03:24:38 2010 > > New Revision: 216089 > > URL: http://svn.freebsd.org/changeset/base/216089 > >=20 > > Log: > > Don't print usbus[0-9] interfaces that it's not the interesting > > interface type for ifconfig(8). > >=20 > > Modified: > > head/sbin/ifconfig/ifconfig.c > >=20 > > Modified: head/sbin/ifconfig/ifconfig.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sbin/ifconfig/ifconfig.c Tue Nov 30 22:39:46 2010 (r216088) > > +++ head/sbin/ifconfig/ifconfig.c Wed Dec 1 03:24:38 2010 (r216089) > > @@ -295,6 +295,8 @@ main(int argc, char *argv[]) > > sdl =3D (const struct sockaddr_dl *) ifa->ifa_addr; > > else > > sdl =3D NULL; > > + if (sdl !=3D NULL && sdl->sdl_type =3D=3D IFT_USB) > > + continue; > > if (cp !=3D NULL && strcmp(cp, ifa->ifa_name) =3D=3D 0 && !namesonly) > > continue; > > iflen =3D strlcpy(name, ifa->ifa_name, sizeof(name)); >=20 > I may be misunderstanding, but isn't this more of a hack than the > correct solution? I appreciate that there are a large number of defined > interface types, but I wonder if we should instead check for interface > types we are prepared to accept, rather than skipping ones we know we > don't want? >=20 > Was this issue introduced with the introduction of the USB pcap changes? We might consider an interface flag for interfaces that aren't configurable in a meaninful way by ifconfig. Then ifconfig wouldn't have to change going forward. -- Brooks --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFM+QkmXY6L6fI4GtQRAk1NAKDEHiFPICAU7S7mbxZLwDPJLrYXhwCeO921 bjqBRJIGdg6iCPJGKQ7jRvo= =EOJN -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s-- From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 16:07:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E16A91065670; Fri, 3 Dec 2010 16:07:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFAA38FC08; Fri, 3 Dec 2010 16:07:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3G7oHZ096335; Fri, 3 Dec 2010 16:07:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3G7oXB096333; Fri, 3 Dec 2010 16:07:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012031607.oB3G7oXB096333@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 3 Dec 2010 16:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216149 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 16:07:51 -0000 Author: kib Date: Fri Dec 3 16:07:50 2010 New Revision: 216149 URL: http://svn.freebsd.org/changeset/base/216149 Log: Add SLIST_SWAP() macro. MFC after: 1 week Modified: head/sys/sys/queue.h Modified: head/sys/sys/queue.h ============================================================================== --- head/sys/sys/queue.h Fri Dec 3 14:20:20 2010 (r216148) +++ head/sys/sys/queue.h Fri Dec 3 16:07:50 2010 (r216149) @@ -213,6 +213,12 @@ struct { \ SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ } while (0) +#define SLIST_SWAP(head1, head2, type) do { \ + struct type *swap_first = SLIST_FIRST(head1); \ + SLIST_FIRST(head1) = SLIST_FIRST(head2); \ + SLIST_FIRST(head2) = swap_first; \ +} while (0) + /* * Singly-linked Tail queue declarations. */ From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 16:15:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4BC0106566B; Fri, 3 Dec 2010 16:15:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2CC68FC16; Fri, 3 Dec 2010 16:15:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3GFiQD096706; Fri, 3 Dec 2010 16:15:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3GFimB096704; Fri, 3 Dec 2010 16:15:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012031615.oB3GFimB096704@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 3 Dec 2010 16:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216150 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 16:15:44 -0000 Author: kib Date: Fri Dec 3 16:15:44 2010 New Revision: 216150 URL: http://svn.freebsd.org/changeset/base/216150 Log: Reviewed by: jeff, rwatson MFC after: 1 week Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Dec 3 16:07:50 2010 (r216149) +++ head/sys/kern/uipc_usrreq.c Fri Dec 3 16:15:44 2010 (r216150) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -115,6 +116,13 @@ static struct unp_head unp_shead; /* (l) static struct unp_head unp_dhead; /* (l) List of datagram sockets. */ static struct unp_head unp_sphead; /* (l) List of seqpacket sockets. */ +struct unp_defer { + SLIST_ENTRY(unp_defer) ud_link; + struct file *ud_fp; +}; +static SLIST_HEAD(, unp_defer) unp_defers; +static int unp_defers_count; + static const struct sockaddr sun_noname = { sizeof(sun_noname), AF_LOCAL }; /* @@ -126,6 +134,13 @@ static const struct sockaddr sun_noname static struct task unp_gc_task; /* + * The close of unix domain sockets attached as SCM_RIGHTS is + * postponed to the taskqueue, to avoid arbitrary recursion depth. + * The attached sockets might have another sockets attached. + */ +static struct task unp_defer_task; + +/* * Both send and receive buffers are allocated PIPSIZ bytes of buffering for * stream sockets, although the total for sender and receiver is actually * only PIPSIZ. @@ -164,6 +179,9 @@ SYSCTL_ULONG(_net_local_seqpacket, OID_A &unpsp_recvspace, 0, "Default seqpacket receive space."); SYSCTL_INT(_net_local, OID_AUTO, inflight, CTLFLAG_RD, &unp_rights, 0, "File descriptors in flight."); +SYSCTL_INT(_net_local, OID_AUTO, deferred, CTLFLAG_RD, + &unp_defers_count, 0, + "File descriptors deferred to taskqueue for close."); /* * Locking and synchronization: @@ -213,6 +231,7 @@ SYSCTL_INT(_net_local, OID_AUTO, infligh */ static struct rwlock unp_link_rwlock; static struct mtx unp_list_lock; +static struct mtx unp_defers_lock; #define UNP_LINK_LOCK_INIT() rw_init(&unp_link_rwlock, \ "unp_link_rwlock") @@ -234,6 +253,11 @@ static struct mtx unp_list_lock; #define UNP_LIST_LOCK() mtx_lock(&unp_list_lock) #define UNP_LIST_UNLOCK() mtx_unlock(&unp_list_lock) +#define UNP_DEFERRED_LOCK_INIT() mtx_init(&unp_defers_lock, \ + "unp_defer", NULL, MTX_DEF) +#define UNP_DEFERRED_LOCK() mtx_lock(&unp_defers_lock) +#define UNP_DEFERRED_UNLOCK() mtx_unlock(&unp_defers_lock) + #define UNP_PCB_LOCK_INIT(unp) mtx_init(&(unp)->unp_mtx, \ "unp_mtx", "unp_mtx", \ MTX_DUPOK|MTX_DEF|MTX_RECURSE) @@ -259,8 +283,9 @@ static void unp_init(void); static int unp_internalize(struct mbuf **, struct thread *); static void unp_internalize_fp(struct file *); static int unp_externalize(struct mbuf *, struct mbuf **); -static void unp_externalize_fp(struct file *); +static int unp_externalize_fp(struct file *); static struct mbuf *unp_addsockcred(struct thread *, struct mbuf *); +static void unp_process_defers(void * __unused, int); /* * Definitions of protocols supported in the LOCAL domain. @@ -1764,9 +1789,12 @@ unp_init(void) LIST_INIT(&unp_dhead); LIST_INIT(&unp_shead); LIST_INIT(&unp_sphead); + SLIST_INIT(&unp_defers); TASK_INIT(&unp_gc_task, 0, unp_gc, NULL); + TASK_INIT(&unp_defer_task, 0, unp_process_defers, NULL); UNP_LINK_LOCK_INIT(); UNP_LIST_LOCK_INIT(); + UNP_DEFERRED_LOCK_INIT(); } static int @@ -1970,9 +1998,45 @@ fptounp(struct file *fp) static void unp_discard(struct file *fp) { + struct unp_defer *dr; + + if (unp_externalize_fp(fp)) { + dr = malloc(sizeof(*dr), M_TEMP, M_WAITOK); + dr->ud_fp = fp; + UNP_DEFERRED_LOCK(); + SLIST_INSERT_HEAD(&unp_defers, dr, ud_link); + UNP_DEFERRED_UNLOCK(); + atomic_add_int(&unp_defers_count, 1); + taskqueue_enqueue(taskqueue_thread, &unp_defer_task); + } else + (void) closef(fp, (struct thread *)NULL); +} + +static void +unp_process_defers(void *arg __unused, int pending) +{ + struct unp_defer *dr; + SLIST_HEAD(, unp_defer) drl; + int count; - unp_externalize_fp(fp); - (void) closef(fp, (struct thread *)NULL); + SLIST_INIT(&drl); + for (;;) { + UNP_DEFERRED_LOCK(); + if (SLIST_FIRST(&unp_defers) == NULL) { + UNP_DEFERRED_UNLOCK(); + break; + } + SLIST_SWAP(&unp_defers, &drl, unp_defer); + UNP_DEFERRED_UNLOCK(); + count = 0; + while ((dr = SLIST_FIRST(&drl)) != NULL) { + SLIST_REMOVE_HEAD(&drl, ud_link); + closef(dr->ud_fp, NULL); + free(dr, M_TEMP); + count++; + } + atomic_add_int(&unp_defers_count, -count); + } } static void @@ -1990,16 +2054,21 @@ unp_internalize_fp(struct file *fp) UNP_LINK_WUNLOCK(); } -static void +static int unp_externalize_fp(struct file *fp) { struct unpcb *unp; + int ret; UNP_LINK_WLOCK(); - if ((unp = fptounp(fp)) != NULL) + if ((unp = fptounp(fp)) != NULL) { unp->unp_msgcount--; + ret = 1; + } else + ret = 0; unp_rights--; UNP_LINK_WUNLOCK(); + return (ret); } /* From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 16:17:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF5291065670; Fri, 3 Dec 2010 16:17:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 830D58FC12; Fri, 3 Dec 2010 16:17:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3GHr5v096844; Fri, 3 Dec 2010 16:17:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3GHr2Q096842; Fri, 3 Dec 2010 16:17:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012031617.oB3GHr2Q096842@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 3 Dec 2010 16:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216151 - head/tools/regression/sockets/unix_gc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 16:17:53 -0000 Author: kib Date: Fri Dec 3 16:17:53 2010 New Revision: 216151 URL: http://svn.freebsd.org/changeset/base/216151 Log: Extend the unix gc regression test to cover the case of r216150. Requested and reviewed by: rwatson MFC after: 1 week Modified: head/tools/regression/sockets/unix_gc/unix_gc.c Modified: head/tools/regression/sockets/unix_gc/unix_gc.c ============================================================================== --- head/tools/regression/sockets/unix_gc/unix_gc.c Fri Dec 3 16:15:44 2010 (r216150) +++ head/tools/regression/sockets/unix_gc/unix_gc.c Fri Dec 3 16:17:53 2010 (r216151) @@ -55,27 +55,36 @@ static char dpath[PATH_MAX]; static const char *test; static int -getopenfiles(void) +getsysctl(const char *name) { size_t len; int i; len = sizeof(i); - if (sysctlbyname("kern.openfiles", &i, &len, NULL, 0) < 0) - err(-1, "kern.openfiles"); + if (sysctlbyname(name, &i, &len, NULL, 0) < 0) + err(-1, "%s", name); return (i); } static int +getopenfiles(void) +{ + + return (getsysctl("kern.openfiles")); +} + +static int getinflight(void) { - size_t len; - int i; - len = sizeof(i); - if (sysctlbyname("net.local.inflight", &i, &len, NULL, 0) < 0) - err(-1, "net.local.inflight"); - return (i); + return (getsysctl("net.local.inflight")); +} + +static int +getdeferred(void) +{ + + return (getsysctl("net.local.deferred")); } static void @@ -707,6 +716,40 @@ listen_connect_drop(void) test_sysctls(inflight, openfiles); } +static void +recursion(void) +{ + int fd[2], ff[2]; + int inflight, openfiles, deferred, deferred1; + + test = "recursion"; + printf("%s\n", test); + save_sysctls(&inflight, &openfiles); + deferred = getdeferred(); + + my_socketpair(fd); + + for (;;) { + if (socketpair(PF_UNIX, SOCK_STREAM, 0, ff) == -1) { + if (errno == EMFILE || errno == ENFILE) + break; + err(-1, "socketpair"); + } + sendfd(ff[0], fd[0]); + sendfd(ff[0], fd[1]); + close2(fd[1], fd[0]); + fd[0] = ff[0]; + fd[1] = ff[1]; + } + close2(fd[0], fd[1]); + sleep(1); + test_sysctls(inflight, openfiles); + deferred1 = getdeferred(); + if (deferred != deferred1) + errx(-1, "recursion: deferred before %d after %d", deferred, + deferred1); +} + #define RMDIR "rm -Rf " int main(int argc, char *argv[]) @@ -757,6 +800,8 @@ main(int argc, char *argv[]) listen_connect_nothing(); listen_connect_drop(); + recursion(); + printf("Finish: inflight %d open %d\n", getinflight(), getopenfiles()); return (0); From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 16:19:10 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE6A6106564A; Fri, 3 Dec 2010 16:19:09 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id A72ED8FC1E; Fri, 3 Dec 2010 16:19:09 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.4/8.14.2) with ESMTP id oB3GJ8N0036144; Fri, 3 Dec 2010 11:19:08 -0500 (EST) (envelope-from das@FreeBSD.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.4/8.14.2/Submit) id oB3GJ8Ph036143; Fri, 3 Dec 2010 11:19:08 -0500 (EST) (envelope-from das@FreeBSD.org) Date: Fri, 3 Dec 2010 11:19:08 -0500 From: David Schultz To: Bruce Evans Message-ID: <20101203161908.GA35978@zim.MIT.EDU> Mail-Followup-To: Bruce Evans , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201012030701.oB3717YD058149@svn.freebsd.org> <20101203224218.P2687@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101203224218.P2687@besplex.bde.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216142 - head/share/man/man3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 16:19:10 -0000 On Sat, Dec 04, 2010, Bruce Evans wrote: > On Fri, 3 Dec 2010, David Schultz wrote: > > >Log: > > Explain some of the reasons that fpsetprec() is unlikely to work as > > one might expect. (These functions have already been deprecated for > > many years.) > > Um, only the functions other than fpsetprec() are deprecated (since it > is a bug in the fenv family of functions that it has no replacement). I think "unsupported" is a better term. It may be useful for people who know what they're doing, but there are numerous rough edges that nobody plans to fix any time soon. With gcc now assuming that all constant-folding is to be done in double precision, it is virtually unusable. I'm not picky about the wording; I just want to make sure we're not claiming that something works when that's far from the case. > Special: > exp2l() > This falls back to using exp() if the precision is not already extended, > and is the only libm function with such a fallback. It, and all other > functions that need extended precision, should do the same test as > this one to see if the precision is already, and if not then switch to > it, and back later. This would be slower, but only slightly slower in > what should be the usual case of the caller already having switched > unconditionally. I'd forgotten I added that. IIRC, that was to work around really egregious errors -- probably the reduction using long double arithmetic and double constants. For consistency, maybe we should just declare defeat on the issue, like most other places in libm. > exp2l() has been more tested than the other long double transcendenta > functions, and is known to have some inaccuracies, probably due to > a buggy polynomial. According to saved data, the worst case that I > could find was: > > x = 0.003906249999999999805394000000 > = 0.003906249999999999805394180368 when rounded to 64 bits > > exp2l(x) = 1.002711275050202485151000000 (according to libm) > = 1.002711275050202485150871445 when rounded to 64 bits > = 0x8058d7d2d5e5f6ae.0p-63 > > exp2l(x rounded) = > 1.002711275050202485295489388 (according to pari; 28 decimal > digs) > = 1.002711275050202485259291663 when rounded to 64 bits > = 0x8058d7d2d5e5f6af55.0p-71" > > The error is about 1 + 0x55/0x100 ulps (this is the difference in the 0xp > values after the 64th mantissa bit), but the claimed accuracy is < 0.511 > ulps. > > The value of 0.003906... is related to the endpoints of the intervals > used by exp2l(). There are large errors for many values close to the > endpoint x = 1/256.0. This value less 333 ulps is another. Hmm, that wouldn't be surprising. I forget which program I used to compute the polynomial, but it may have neglected to check for extrema at the endpoints. Perhaps you can find a better one? From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 16:37:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34C26106566C; Fri, 3 Dec 2010 16:37:38 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20E3A8FC14; Fri, 3 Dec 2010 16:37:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3GbccC098089; Fri, 3 Dec 2010 16:37:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3Gbcns098083; Fri, 3 Dec 2010 16:37:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201012031637.oB3Gbcns098083@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 3 Dec 2010 16:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216154 - in head/sys: conf powerpc/include powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 16:37:38 -0000 Author: nwhitehorn Date: Fri Dec 3 16:37:37 2010 New Revision: 216154 URL: http://svn.freebsd.org/changeset/base/216154 Log: Provide a simple IOMMU framework on PowerPC, which is required to support PPC hypervisors. Added: head/sys/powerpc/powerpc/iommu_if.m (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/include/bus_dma.h head/sys/powerpc/powerpc/busdma_machdep.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Fri Dec 3 16:21:39 2010 (r216153) +++ head/sys/conf/files.powerpc Fri Dec 3 16:37:37 2010 (r216154) @@ -177,6 +177,7 @@ powerpc/powerpc/fuswintr.c standard powerpc/powerpc/gdb_machdep.c optional gdb powerpc/powerpc/in_cksum.c optional inet powerpc/powerpc/intr_machdep.c standard +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 Modified: head/sys/powerpc/include/bus_dma.h ============================================================================== --- head/sys/powerpc/include/bus_dma.h Fri Dec 3 16:21:39 2010 (r216153) +++ head/sys/powerpc/include/bus_dma.h Fri Dec 3 16:37:37 2010 (r216154) @@ -30,4 +30,8 @@ #include +struct device; + +int bus_dma_tag_set_iommu(bus_dma_tag_t, struct device *iommu, void *cookie); + #endif /* _POWERPC_BUS_DMA_H_ */ Modified: head/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/busdma_machdep.c Fri Dec 3 16:21:39 2010 (r216153) +++ head/sys/powerpc/powerpc/busdma_machdep.c Fri Dec 3 16:37:37 2010 (r216154) @@ -53,7 +53,9 @@ __FBSDID("$FreeBSD$"); #include #include -#define MAX_BPAGES 8192 +#include "iommu_if.h" + +#define MAX_BPAGES MIN(8192, physmem/40) struct bounce_zone; @@ -73,8 +75,9 @@ struct bus_dma_tag { int map_count; bus_dma_lock_t *lockfunc; void *lockfuncarg; - bus_dma_segment_t *segments; struct bounce_zone *bounce_zone; + device_t iommu; + void *iommu_cookie; }; struct bounce_page { @@ -121,6 +124,8 @@ struct bus_dmamap { bus_dma_tag_t dmat; void *buf; /* unmapped buffer pointer */ bus_size_t buflen; /* unmapped buffer length */ + bus_dma_segment_t *segments; + int nsegs; bus_dmamap_callback_t *callback; void *callback_arg; STAILQ_ENTRY(bus_dmamap) links; @@ -128,7 +133,6 @@ struct bus_dmamap { static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; -static struct bus_dmamap nobounce_dmamap; static void init_bounce_pages(void *dummy); static int alloc_bounce_zone(bus_dma_tag_t dmat); @@ -156,10 +160,14 @@ run_filter(bus_dma_tag_t dmat, bus_addr_ retval = 0; do { - if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr) - || ((paddr & (dmat->alignment - 1)) != 0)) - && (dmat->filter == NULL - || (*dmat->filter)(dmat->filterarg, paddr) != 0)) + if (dmat->filter == NULL && dmat->iommu == NULL && + paddr > dmat->lowaddr && paddr <= dmat->highaddr) + retval = 1; + if (dmat->filter == NULL && + (paddr & (dmat->alignment - 1)) != 0) + retval = 1; + if (dmat->filter != NULL && + (*dmat->filter)(dmat->filterarg, paddr) != 0) retval = 1; dmat = dmat->parent; @@ -258,7 +266,6 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->lockfunc = dflt_lock; newtag->lockfuncarg = NULL; } - newtag->segments = NULL; /* Take into account any restrictions imposed by our parent tag */ if (parent != NULL) { @@ -280,10 +287,14 @@ bus_dma_tag_create(bus_dma_tag_t parent, } if (newtag->parent != NULL) atomic_add_int(&parent->ref_count, 1); + newtag->iommu = parent->iommu; + newtag->iommu_cookie = parent->iommu_cookie; } - if (newtag->lowaddr < ptoa((vm_paddr_t)Maxmem) - || newtag->alignment > 1) + if (newtag->lowaddr < ptoa((vm_paddr_t)Maxmem) && newtag->iommu == NULL) + newtag->flags |= BUS_DMA_COULD_BOUNCE; + + if (newtag->alignment > 1) newtag->flags |= BUS_DMA_COULD_BOUNCE; if (((newtag->flags & BUS_DMA_COULD_BOUNCE) != 0) && @@ -343,8 +354,6 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) parent = dmat->parent; atomic_subtract_int(&dmat->ref_count, 1); if (dmat->ref_count == 0) { - if (dmat->segments != NULL) - free(dmat->segments, M_DEVBUF); free(dmat, M_DEVBUF); /* * Last reference count, so @@ -372,17 +381,15 @@ bus_dmamap_create(bus_dma_tag_t dmat, in error = 0; - if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, - M_NOWAIT); - if (dmat->segments == NULL) { - CTR3(KTR_BUSDMA, "%s: tag %p error %d", - __func__, dmat, ENOMEM); - return (ENOMEM); - } + *mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (*mapp == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); } + /* * Bouncing might be required if the driver asks for an active * exclusion region, a data alignment that is stricter than 1, and/or @@ -400,14 +407,6 @@ bus_dmamap_create(bus_dma_tag_t dmat, in } bz = dmat->bounce_zone; - *mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF, - M_NOWAIT | M_ZERO); - if (*mapp == NULL) { - CTR3(KTR_BUSDMA, "%s: tag %p error %d", - __func__, dmat, ENOMEM); - return (ENOMEM); - } - /* Initialize the new map */ STAILQ_INIT(&((*mapp)->bpages)); @@ -437,9 +436,18 @@ bus_dmamap_create(bus_dma_tag_t dmat, in } } bz->map_count++; - } else { - *mapp = NULL; } + + (*mapp)->nsegs = 0; + (*mapp)->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, + M_NOWAIT); + if ((*mapp)->segments == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + if (error == 0) dmat->map_count++; CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", @@ -454,7 +462,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in int bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) { - if (map != NULL && map != &nobounce_dmamap) { + if (dmat->flags & BUS_DMA_COULD_BOUNCE) { if (STAILQ_FIRST(&map->bpages) != NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, EBUSY); @@ -462,8 +470,9 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, b } if (dmat->bounce_zone) dmat->bounce_zone->map_count--; - free(map, M_DEVBUF); } + free(map->segments, M_DEVBUF); + free(map, M_DEVBUF); dmat->map_count--; CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); return (0); @@ -486,19 +495,8 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi else mflags = M_WAITOK; - /* If we succeed, no mapping/bouncing will be required */ - *mapp = NULL; + bus_dmamap_create(dmat, flags, mapp); - if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, - mflags); - if (dmat->segments == NULL) { - CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", - __func__, dmat, dmat->flags, ENOMEM); - return (ENOMEM); - } - } if (flags & BUS_DMA_ZERO) mflags |= M_ZERO; @@ -535,7 +533,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi #ifdef NOTYET if (flags & BUS_DMA_NOCACHE) pmap_change_attr((vm_offset_t)*vaddr, dmat->maxsize, - PAT_UNCACHEABLE); + VM_MEMATTR_UNCACHEABLE); #endif CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->flags, 0); @@ -549,14 +547,10 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi void bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) { - /* - * dmamem does not need to be bounced, so the map should be - * NULL - */ - if (map != NULL) - panic("bus_dmamem_free: Invalid map freed\n"); + bus_dmamap_destroy(dmat, map); + #ifdef NOTYET - pmap_change_attr((vm_offset_t)vaddr, dmat->maxsize, PAT_WRITE_BACK); + pmap_change_attr((vm_offset_t)vaddr, dmat->maxsize, VM_MEMATTR_DEFAULT); #endif if ((dmat->maxsize <= PAGE_SIZE) && (dmat->alignment < dmat->maxsize) && @@ -591,18 +585,13 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm bus_addr_t paddr; int seg; - if (map == NULL) - map = &nobounce_dmamap; - - if ((map != &nobounce_dmamap && map->pagesneeded == 0) - && ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0)) { + if (map->pagesneeded == 0 && ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0)) { vm_offset_t vendaddr; CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " "alignment= %d", dmat->lowaddr, ptoa((vm_paddr_t)Maxmem), dmat->boundary, dmat->alignment); - CTR3(KTR_BUSDMA, "map= %p, nobouncemap= %p, pagesneeded= %d", - map, &nobounce_dmamap, map->pagesneeded); + CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d", map, map->pagesneeded); /* * Count the number of bounce pages * needed in order to complete this transfer @@ -731,29 +720,36 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ bus_size_t buflen, bus_dmamap_callback_t *callback, void *callback_arg, int flags) { - bus_addr_t lastaddr = 0; - int error, nsegs = 0; + bus_addr_t lastaddr = 0; + int error; - if (map != NULL) { + if (dmat->flags & BUS_DMA_COULD_BOUNCE) { flags |= BUS_DMA_WAITOK; map->callback = callback; map->callback_arg = callback_arg; } + map->nsegs = 0; error = _bus_dmamap_load_buffer(dmat, map, buf, buflen, NULL, flags, - &lastaddr, dmat->segments, &nsegs, 1); + &lastaddr, map->segments, &map->nsegs, 1); + map->nsegs++; CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, dmat->flags, error, nsegs + 1); + __func__, dmat, dmat->flags, error, map->nsegs); if (error == EINPROGRESS) { return (error); } + if (dmat->iommu != NULL) + IOMMU_MAP(dmat->iommu, map->segments, &map->nsegs, dmat->lowaddr, + dmat->highaddr, dmat->alignment, dmat->boundary, + dmat->iommu_cookie); + if (error) - (*callback)(callback_arg, dmat->segments, 0, error); + (*callback)(callback_arg, map->segments, 0, error); else - (*callback)(callback_arg, dmat->segments, nsegs + 1, 0); + (*callback)(callback_arg, map->segments, map->nsegs, 0); /* * Return ENOMEM to the caller so that it can pass it up the stack. @@ -775,12 +771,12 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_callback2_t *callback, void *callback_arg, int flags) { - int nsegs, error; + int error; M_ASSERTPKTHDR(m0); flags |= BUS_DMA_NOWAIT; - nsegs = 0; + map->nsegs = 0; error = 0; if (m0->m_pkthdr.len <= dmat->maxsize) { int first = 1; @@ -792,7 +788,7 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, error = _bus_dmamap_load_buffer(dmat, map, m->m_data, m->m_len, NULL, flags, &lastaddr, - dmat->segments, &nsegs, first); + map->segments, &map->nsegs, first); first = 0; } } @@ -800,15 +796,21 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, error = EINVAL; } + map->nsegs++; + if (dmat->iommu != NULL) + IOMMU_MAP(dmat->iommu, map->segments, &map->nsegs, dmat->lowaddr, + dmat->highaddr, dmat->alignment, dmat->boundary, + dmat->iommu_cookie); + if (error) { /* force "no valid mappings" in callback */ - (*callback)(callback_arg, dmat->segments, 0, 0, error); + (*callback)(callback_arg, map->segments, 0, 0, error); } else { - (*callback)(callback_arg, dmat->segments, - nsegs+1, m0->m_pkthdr.len, error); + (*callback)(callback_arg, map->segments, + map->nsegs, m0->m_pkthdr.len, error); } CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, dmat->flags, error, nsegs + 1); + __func__, dmat, dmat->flags, error, map->nsegs); return (error); } @@ -844,6 +846,15 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dm /* XXX FIXME: Having to increment nsegs is really annoying */ ++*nsegs; + + if (dmat->iommu != NULL) + IOMMU_MAP(dmat->iommu, segs, nsegs, dmat->lowaddr, + dmat->highaddr, dmat->alignment, dmat->boundary, + dmat->iommu_cookie); + + map->nsegs = *nsegs; + memcpy(map->segments, segs, map->nsegs*sizeof(segs[0])); + CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", __func__, dmat, dmat->flags, error, *nsegs); return (error); @@ -859,7 +870,7 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, int flags) { bus_addr_t lastaddr = 0; - int nsegs, error, first, i; + int error, first, i; bus_size_t resid; struct iovec *iov; pmap_t pmap; @@ -875,7 +886,7 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, } else pmap = NULL; - nsegs = 0; + map->nsegs = 0; error = 0; first = 1; for (i = 0; i < uio->uio_iovcnt && resid != 0 && !error; i++) { @@ -890,22 +901,28 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, if (minlen > 0) { error = _bus_dmamap_load_buffer(dmat, map, addr, minlen, pmap, flags, &lastaddr, - dmat->segments, &nsegs, first); + map->segments, &map->nsegs, first); first = 0; resid -= minlen; } } + map->nsegs++; + if (dmat->iommu != NULL) + IOMMU_MAP(dmat->iommu, map->segments, &map->nsegs, dmat->lowaddr, + dmat->highaddr, dmat->alignment, dmat->boundary, + dmat->iommu_cookie); + if (error) { /* force "no valid mappings" in callback */ - (*callback)(callback_arg, dmat->segments, 0, 0, error); + (*callback)(callback_arg, map->segments, 0, 0, error); } else { - (*callback)(callback_arg, dmat->segments, - nsegs+1, uio->uio_resid, error); + (*callback)(callback_arg, map->segments, + map->nsegs, uio->uio_resid, error); } CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", - __func__, dmat, dmat->flags, error, nsegs + 1); + __func__, dmat, dmat->flags, error, map->nsegs); return (error); } @@ -917,6 +934,11 @@ _bus_dmamap_unload(bus_dma_tag_t dmat, b { struct bounce_page *bpage; + if (dmat->iommu) { + IOMMU_UNMAP(dmat->iommu, map->segments, map->nsegs, dmat->iommu_cookie); + map->nsegs = 0; + } + while ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { STAILQ_REMOVE_HEAD(&map->bpages, links); free_bounce_page(dmat, bpage); @@ -1122,8 +1144,6 @@ add_bounce_page(bus_dma_tag_t dmat, bus_ struct bounce_page *bpage; KASSERT(dmat->bounce_zone != NULL, ("no bounce zone in dma tag")); - KASSERT(map != NULL && map != &nobounce_dmamap, - ("add_bounce_page: bad map %p", map)); bz = dmat->bounce_zone; if (map->pagesneeded == 0) @@ -1210,3 +1230,13 @@ busdma_swi(void) } mtx_unlock(&bounce_lock); } + +int +bus_dma_tag_set_iommu(bus_dma_tag_t tag, struct device *iommu, void *cookie) +{ + tag->iommu = iommu; + tag->iommu_cookie = cookie; + + return (0); +} + Added: head/sys/powerpc/powerpc/iommu_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powerpc/iommu_if.m Fri Dec 3 16:37:37 2010 (r216154) @@ -0,0 +1,54 @@ +#- +# Copyright (c) 2010 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. +# +# from: src/sys/kern/bus_if.m,v 1.21 2002/04/21 11:16:10 markm Exp +# $FreeBSD$ +# + +#include + +#include +#include + +INTERFACE iommu; + +METHOD int map { + device_t iommu; + bus_dma_segment_t *segs; + int *nsegs; + bus_addr_t lowaddr; + bus_addr_t highaddr; + bus_size_t alignment; + bus_size_t boundary; + void *cookie; +}; + +METHOD int unmap { + device_t iommu; + bus_dma_segment_t *segs; + int nsegs; + void *cookie; +}; + From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 16:38:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 3798A1065672; Fri, 3 Dec 2010 16:38:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Brooks Davis Date: Fri, 3 Dec 2010 11:37:55 -0500 User-Agent: KMail/1.6.2 References: <201012010324.oB13OdL8060240@svn.freebsd.org> <1291295967.58583.59.camel@buffy.york.ac.uk> <20101203151343.GA7429@lor.one-eyed-alien.net> In-Reply-To: <20101203151343.GA7429@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201012031138.08347.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gavin Atkinson , Weongyo Jeong , src-committers@freebsd.org Subject: Re: svn commit: r216089 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 16:38:15 -0000 On Friday 03 December 2010 10:13 am, Brooks Davis wrote: > On Thu, Dec 02, 2010 at 01:19:27PM +0000, Gavin Atkinson wrote: > > On Wed, 2010-12-01 at 03:24 +0000, Weongyo Jeong wrote: > > > Author: weongyo > > > Date: Wed Dec 1 03:24:38 2010 > > > New Revision: 216089 > > > URL: http://svn.freebsd.org/changeset/base/216089 > > > > > > Log: > > > Don't print usbus[0-9] interfaces that it's not the > > > interesting interface type for ifconfig(8). > > > > > > Modified: > > > head/sbin/ifconfig/ifconfig.c > > > > > > Modified: head/sbin/ifconfig/ifconfig.c > > > =============================================================== > > >=============== --- head/sbin/ifconfig/ifconfig.c Tue Nov 30 > > > 22:39:46 2010 (r216088) +++ head/sbin/ifconfig/ifconfig.c Wed > > > Dec 1 03:24:38 2010 (r216089) @@ -295,6 +295,8 @@ main(int > > > argc, char *argv[]) > > > sdl = (const struct sockaddr_dl *) ifa->ifa_addr; > > > else > > > sdl = NULL; > > > + if (sdl != NULL && sdl->sdl_type == IFT_USB) > > > + continue; > > > if (cp != NULL && strcmp(cp, ifa->ifa_name) == 0 && > > > !namesonly) continue; > > > iflen = strlcpy(name, ifa->ifa_name, sizeof(name)); > > > > I may be misunderstanding, but isn't this more of a hack than the > > correct solution? I appreciate that there are a large number of > > defined interface types, but I wonder if we should instead check > > for interface types we are prepared to accept, rather than > > skipping ones we know we don't want? > > > > Was this issue introduced with the introduction of the USB pcap > > changes? > > We might consider an interface flag for interfaces that aren't > configurable in a meaninful way by ifconfig. Then ifconfig > wouldn't have to change going forward. +1 Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 16:52:02 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 571731065670; Fri, 3 Dec 2010 16:52:02 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 13C888FC13; Fri, 3 Dec 2010 16:52:01 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.4/8.14.2) with ESMTP id oB3Gq1bJ036434; Fri, 3 Dec 2010 11:52:01 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.4/8.14.2/Submit) id oB3Gq1Pf036433; Fri, 3 Dec 2010 11:52:01 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Fri, 3 Dec 2010 11:52:01 -0500 From: David Schultz To: Kostik Belousov Message-ID: <20101203165201.GA36319@zim.MIT.EDU> Mail-Followup-To: Kostik Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201006121732.o5CHW5Cs065722@svn.freebsd.org> <20100615084939.GL13238@deviant.kiev.zoral.com.ua> <20100615131443.GA93094@zim.MIT.EDU> <20101202045728.GA19295@zim.MIT.EDU> <20101202095652.GQ2392@deviant.kiev.zoral.com.ua> <20101202190010.GB28587@zim.MIT.EDU> <20101203005417.GZ2392@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101203005417.GZ2392@deviant.kiev.zoral.com.ua> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r209110 - in head/lib/msun: . src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 16:52:02 -0000 On Fri, Dec 03, 2010, Kostik Belousov wrote: > On Thu, Dec 02, 2010 at 02:00:10PM -0500, David Schultz wrote: > > On Thu, Dec 02, 2010, Kostik Belousov wrote: > > > For __isnanf, libc exports __isnanf@FBSD_1.0, and libm exports > > > __isnanf@FBSD_1.2. I suspect that we could export both > > > __isnanf@FBSD_1.0 and __isnanf@FBSD_1.2 from libc. > > > > I like the idea of adding an __isnanf@FBSD_1.2 alias to libc for > > the benefit of people running -CURRENT. > > Ok, draft of the change is below, I am not sure is it worth the churn. > > I was unable to make the ld support two versions of the same symbol. > lib/msun would benefit from elimination of isnan sources if this is > committed. [...] > --- /dev/null > +++ b/lib/libc/gen/isnan_compat.c > @@ -0,0 +1,17 @@ > +/* > + * The file is in public domain. > + * Written by Konstantin Belousov > + * > + * $FreeBSD$ > + */ > + > +#include > + > +__sym_compat(__isnanf, __isnanf_compat, FBSD_1.0); > + > +int > +__isnanf_compat(float f) > +{ > + > + return (__isnanf(f)); > +} Thanks. Hmm... if it ultimately entails replacing a small amount of cruft in libm with a small amount of cruft in libc, it's probably not worth the churn. From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 17:03:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 577BA106566B; Fri, 3 Dec 2010 17:03:28 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id 1D87E8FC0C; Fri, 3 Dec 2010 17:03:28 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id oB3H3Rqr054950; Fri, 3 Dec 2010 09:03:27 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id oB3H3Ree054949; Fri, 3 Dec 2010 09:03:27 -0800 (PST) (envelope-from sgk) Date: Fri, 3 Dec 2010 09:03:27 -0800 From: Steve Kargl To: Konstantin Belousov Message-ID: <20101203170327.GA54937@troutmask.apl.washington.edu> References: <201012031615.oB3GFimB096704@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012031615.oB3GFimB096704@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216150 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 17:03:28 -0000 On Fri, Dec 03, 2010 at 04:15:44PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Fri Dec 3 16:15:44 2010 > New Revision: 216150 > URL: http://svn.freebsd.org/changeset/base/216150 > > Log: > Reviewed by: jeff, rwatson > MFC after: 1 week > > Modified: > head/sys/kern/uipc_usrreq.c > So what does this change do? -- Steve From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 17:07:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D51E9106564A; Fri, 3 Dec 2010 17:07:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9DF798FC14; Fri, 3 Dec 2010 17:07:18 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 2DC8646B7E; Fri, 3 Dec 2010 12:07:18 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 364CC8A009; Fri, 3 Dec 2010 12:07:17 -0500 (EST) From: John Baldwin To: Bruce Cran Date: Fri, 3 Dec 2010 10:31:32 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201012022219.oB2MJUx5031472@svn.freebsd.org> <20101203144103.00005a78@unknown> In-Reply-To: <20101203144103.00005a78@unknown> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201012031031.33073.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 03 Dec 2010 12:07:17 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Ivan Voras , Bruce Evans , Bruce Cran , svn-src-head@freebsd.org Subject: Re: svn commit: r216134 - in head: share/man/man9 sys/amd64/include sys/arm/include sys/i386/include sys/ia64/include sys/mips/include sys/pc98/include sys/powerpc/include sys/sparc64/include sys/sun4v... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 17:07:18 -0000 On Friday, December 03, 2010 9:41:03 am Bruce Cran wrote: > On Fri, 3 Dec 2010 15:27:13 +0100 > Ivan Voras wrote: > > > I'd say it depends on if the "specific case that hps raised a few > > years ago" sentence part refers to an actual problem; i.e. did it > > happen in practice? If yes, leaving KASSERTs looks like the best > > option. > > I've found hps's original email thread, which is at > http://lists.freebsd.org/pipermail/freebsd-hackers/2005-June/012342.html . > > The argument for allowing zero-length reads/writes is at > http://lists.freebsd.org/pipermail/freebsd-hackers/2005-June/012348.html . > > I suspect the mistake occurred due to a misunderstanding of the API. > NetBSD have documented it in their man page but not added asserts in > the code: > > "Functions which take a count of bytes have undefined results if the > specified count is zero." I think that is excellent wording and that this case is actually very rare. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 17:15:36 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EE38106566C; Fri, 3 Dec 2010 17:15:36 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id F329B8FC08; Fri, 3 Dec 2010 17:15:35 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id oB3HFYah065389 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 3 Dec 2010 18:15:34 +0100 (CET) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1291396534; bh=/2qXVopbXRYoGCgUS+Idr8mkgmvs4L4JMWUDyaL9Nxw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=XenJZqVM/SiHDaKVTaZ8A4Dv2WOP6uAlmb23ylSu3s81D6v5HVttX0FvyCzsOcKV+ LGlo8Bfd+bNjt5xuw8Yw2v2+vgThH/b1QVfZee0fPbGFLlPb8SrWTzyxJlIiZtsmEx 3nsCto4ovobNMnIKO2XwfgO+jxh9nVVHo1Lrdm88= Date: Fri, 3 Dec 2010 18:15:34 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Xin LI Message-ID: <20101203171534.GE3256@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201012031006.oB3A6J1S070688@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012031006.oB3A6J1S070688@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 Subject: Re: svn commit: r216147 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 17:15:36 -0000 On Fri, 03.12.2010 at 10:06:19 +0000, Xin LI wrote: > Author: delphij > Date: Fri Dec 3 10:06:19 2010 > New Revision: 216147 > URL: http://svn.freebsd.org/changeset/base/216147 > > Log: > * Recommend a overwrite of whole geli provider before use. > * Correct a typo while I'm there. > > Reviewed by: pjd > MFC after: 2 weeks > > Modified: > head/sbin/geom/class/eli/geli.8 > > Modified: head/sbin/geom/class/eli/geli.8 > ============================================================================== > --- head/sbin/geom/class/eli/geli.8 Fri Dec 3 09:26:56 2010 (r216146) > +++ head/sbin/geom/class/eli/geli.8 Fri Dec 3 10:06:19 2010 (r216147) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd October 20, 2010 > +.Dd December 3, 2010 > .Dt GELI 8 > .Os > .Sh NAME > @@ -842,7 +842,7 @@ Enter passphrase: > .Nm > supports two encryption modes: > .Nm XTS , > -which was standarized as > +which was standardized as > .Nm IEE P1619 > and > .Nm CBC > @@ -873,6 +873,10 @@ changes with the data he owns without no > In other words > .Nm > will not protect your data against replay attacks. > +.Pp > +It is recommended to write the whole provider before the first use, > +in order to make sure that all sectors and their corresponding > +checksums are properly initialized into a consistent state. > .Sh SEE ALSO > .Xr crypto 4 , > .Xr gbde 4 , I'm not sure this wording is very helpful. Why should there be a "consistent" state? In fact, if you write all zeros to the partition before creating the geom, then an attacker pretty much knows how much data you have written to the provider. I'm not saying this weakens any security, but I think the current phrasing will confuse the reader. What needs to be consistent? What does writing to the provider mean? Or am I mixing up provider and consumer here? Uli From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 17:17:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B9531065672; Fri, 3 Dec 2010 17:17:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 916278FC16; Fri, 3 Dec 2010 17:17:27 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oB3HHNur060080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 3 Dec 2010 19:17:23 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oB3HHNTb065010; Fri, 3 Dec 2010 19:17:23 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oB3HHNPU065009; Fri, 3 Dec 2010 19:17:23 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 3 Dec 2010 19:17:23 +0200 From: Kostik Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20101203171723.GD2392@deviant.kiev.zoral.com.ua> References: <201012031615.oB3GFimB096704@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4K4B5pKFuxi3JHFN" Content-Disposition: inline In-Reply-To: <201012031615.oB3GFimB096704@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r216150 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 17:17:28 -0000 --4K4B5pKFuxi3JHFN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 03, 2010 at 04:15:44PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Fri Dec 3 16:15:44 2010 > New Revision: 216150 > URL: http://svn.freebsd.org/changeset/base/216150 >=20 > Log: > Reviewed by: jeff, rwatson > MFC after: 1 week Oops, I failed to use proper -F file with svn ci :(. The commit log is (or, was supposed to be): If unix socket has a unix socket attached as the rights that has a unix socket attached as the rights that has a unix socket attached as the rights ... Kernel may overflow the stack on attempt to close such socket. Only close the rights file in the context of the current close if the file is not unix domain socket. Otherwise, postpone the work to taskqueue, preventing unlimited recursion. The pass of the unix domain sockets over the SCM_RIGHTS message control is not widely used, and more, the close of the socket with still attached rights is mostly an application failure. The change should not affect the performance of typical users of SCM_RIGHTS. Reviewed by: jeff, rwatson MFC after: 1 week --4K4B5pKFuxi3JHFN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAkz5JiIACgkQC3+MBN1Mb4gtZwCfT9LQRlUYqpZW82i6ADphthW1 pvwAoIwKNsIdt3E0TAzbtdee8agNaGTu =DLKL -----END PGP SIGNATURE----- --4K4B5pKFuxi3JHFN-- From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 17:18:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EF0F10656AB; Fri, 3 Dec 2010 17:18:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id DB2818FC19; Fri, 3 Dec 2010 17:18:50 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oB3HIcTi060134 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 3 Dec 2010 19:18:38 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oB3HIcZF065031; Fri, 3 Dec 2010 19:18:38 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oB3HIcQL065030; Fri, 3 Dec 2010 19:18:38 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 3 Dec 2010 19:18:38 +0200 From: Kostik Belousov To: Steve Kargl Message-ID: <20101203171838.GE2392@deviant.kiev.zoral.com.ua> References: <201012031615.oB3GFimB096704@svn.freebsd.org> <20101203170327.GA54937@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YojSMoxymTl190OJ" Content-Disposition: inline In-Reply-To: <20101203170327.GA54937@troutmask.apl.washington.edu> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216150 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 17:18:51 -0000 --YojSMoxymTl190OJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 03, 2010 at 09:03:27AM -0800, Steve Kargl wrote: > On Fri, Dec 03, 2010 at 04:15:44PM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Fri Dec 3 16:15:44 2010 > > New Revision: 216150 > > URL: http://svn.freebsd.org/changeset/base/216150 > >=20 > > Log: > > Reviewed by: jeff, rwatson > > MFC after: 1 week > >=20 > > Modified: > > head/sys/kern/uipc_usrreq.c > >=20 >=20 > So what does this change do? Sorry. I did a followup to the commit itself. Might consider doing a forced commit (or some whitespace tweak) to record proper commit message. Thanks for pointing this out. --YojSMoxymTl190OJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAkz5Jm0ACgkQC3+MBN1Mb4gBGwCgov12X7rS6x+LlIIk/eKFKidq XD4AoOY3UsKFT9qy9yV39z+8cgCeFhvI =jaIG -----END PGP SIGNATURE----- --YojSMoxymTl190OJ-- From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 18:02:06 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0591A106566B; Fri, 3 Dec 2010 18:02:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 785578FC1C; Fri, 3 Dec 2010 18:02:05 +0000 (UTC) Received: from c211-30-187-94.carlnfd1.nsw.optusnet.com.au (c211-30-187-94.carlnfd1.nsw.optusnet.com.au [211.30.187.94]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB3I1tYL031546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 Dec 2010 05:02:03 +1100 Date: Sat, 4 Dec 2010 05:01:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Cran In-Reply-To: <201012030709.oB379NOH058721@svn.freebsd.org> Message-ID: <20101204045754.T4046@besplex.bde.org> References: <201012030709.oB379NOH058721@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216143 - in head: share/man/man9 sys/amd64/include sys/arm/include sys/i386/include sys/ia64/include sys/mips/include sys/pc98/include sys/powerpc/include sys/sparc64/include sys/sun4v... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 18:02:06 -0000 On Fri, 3 Dec 2010, Bruce Cran wrote: > Log: > Revert r216134. This checkin broke platforms where bus_space are macros: > they need to be a single statement, and do { } while (0) doesn't work in this > situation so revert until a solution can be devised. Surprising that do-while doesn't work. > ... > Modified: head/sys/arm/include/bus.h > ============================================================================== > --- head/sys/arm/include/bus.h Fri Dec 3 07:01:07 2010 (r216142) > +++ head/sys/arm/include/bus.h Fri Dec 3 07:09:23 2010 (r216143) > ... > @@ -321,29 +318,21 @@ struct bus_space { > * Bus read multiple operations. > */ > #define bus_space_read_multi_1(t, h, o, a, c) \ > - KASSERT(c != 0, ("bus_space_read_multi_1: count == 0")); \ > __bs_nonsingle(rm,1,(t),(h),(o),(a),(c)) I just noticed the following possibly more serious problems for the macro versions: - the `c' arg is missing parentheses in the KASSERT() - the `c' arg is now evaluated twice. This turns safe macros into unsafe ones. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 18:12:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7E89106566B; Fri, 3 Dec 2010 18:12:38 +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 7A52B8FC18; Fri, 3 Dec 2010 18:12:36 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA29285; Fri, 03 Dec 2010 20:12:26 +0200 (EET) (envelope-from avg@freebsd.org) Message-ID: <4CF93309.4050009@freebsd.org> Date: Fri, 03 Dec 2010 20:12:25 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Bruce Evans References: <201012030709.oB379NOH058721@svn.freebsd.org> <20101204045754.T4046@besplex.bde.org> In-Reply-To: <20101204045754.T4046@besplex.bde.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Cran Subject: Re: svn commit: r216143 - in head: share/man/man9 sys/amd64/include sys/arm/include sys/i386/include sys/ia64/include sys/mips/include sys/pc98/include sys/powerpc/include sys/sparc64/include sys/sun4v... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 18:12:38 -0000 on 03/12/2010 20:01 Bruce Evans said the following: > On Fri, 3 Dec 2010, Bruce Cran wrote: > >> Log: >> Revert r216134. This checkin broke platforms where bus_space are macros: >> they need to be a single statement, and do { } while (0) doesn't work in this >> situation so revert until a solution can be devised. > > Surprising that do-while doesn't work. I think GCC extension that allows to put statements inside expressions could help here: http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html#Statement-Exprs I think that we already use the extension in some places. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 18:18:48 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E177B10656C0; Fri, 3 Dec 2010 18:18:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 5DD408FC0A; Fri, 3 Dec 2010 18:18:47 +0000 (UTC) Received: from c211-30-187-94.carlnfd1.nsw.optusnet.com.au (c211-30-187-94.carlnfd1.nsw.optusnet.com.au [211.30.187.94]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB3IIfg0029788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 Dec 2010 05:18:42 +1100 Date: Sat, 4 Dec 2010 05:18:41 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Cran In-Reply-To: <20101203101651.7461ced0@core.draftnet> Message-ID: <20101204050508.Q4074@besplex.bde.org> References: <201012022219.oB2MJUx5031472@svn.freebsd.org> <20101203201705.O2228@besplex.bde.org> <20101203101651.7461ced0@core.draftnet> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans , Bruce Cran Subject: Re: svn commit: r216134 - in head: share/man/man9 sys/amd64/include sys/arm/include sys/i386/include sys/ia64/include sys/mips/include sys/pc98/include sys/powerpc/include sys/sparc64/include sys/sun4v... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 18:18:49 -0000 On Fri, 3 Dec 2010, Bruce Cran wrote: > On Fri, 3 Dec 2010 20:45:12 +1100 (EST) > Bruce Evans wrote: > >> KASSERT() in little inline functions gives a lot of bloat for such an >> unlikely error. Stupid callers can still pass any garbage count >> except 0. > > Yes, this catches a specific case that hps raised a few years ago: > sending zero-length packets/frames would fail by causing the system to > hang. Should we just document the restriction in the man page and not > try and prevent it at runtime? That is enough for me, and hps should be the last person to write this bug :-). If zero lengths can be generated at runtime then they should be checked for in callers and not handled by panicing. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 18:30:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16F431065670; Fri, 3 Dec 2010 18:30:56 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 059288FC0A; Fri, 3 Dec 2010 18:30:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3IUtsR007174; Fri, 3 Dec 2010 18:30:55 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3IUtB5007172; Fri, 3 Dec 2010 18:30:55 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201012031830.oB3IUtB5007172@svn.freebsd.org> From: Bruce Cran Date: Fri, 3 Dec 2010 18:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216156 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 18:30:56 -0000 Author: brucec Date: Fri Dec 3 18:30:55 2010 New Revision: 216156 URL: http://svn.freebsd.org/changeset/base/216156 Log: Document the fact that passing in a count of zero to the bus_space functions will result in undefined behaviour. Taken from NetBSD's bus_space(9). Modified: head/share/man/man9/bus_space.9 Modified: head/share/man/man9/bus_space.9 ============================================================================== --- head/share/man/man9/bus_space.9 Fri Dec 3 16:40:47 2010 (r216155) +++ head/share/man/man9/bus_space.9 Fri Dec 3 18:30:55 2010 (r216156) @@ -719,6 +719,9 @@ or which return data read from bus space do not obviously return an error code) do not fail. They could only fail if given invalid arguments, and in that case their behaviour is undefined. +Functions which take a count of bytes have undefined results if the specified +.Fa count +is zero. .Sh TYPES Several types are defined in .In machine/bus.h From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 18:54:04 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E79E2106566C; Fri, 3 Dec 2010 18:54:04 +0000 (UTC) (envelope-from rea@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 6934C8FC08; Fri, 3 Dec 2010 18:54:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date; bh=Qwc+BeBTakB/M0mqldVuEZN7FWfZbokl5Gk6KHRj1Ms=; b=sUu7OmpRvl14tmAH+gFxVEQgi9WaFDFHuNcaENeE6zRUZHcL+HAT+0tNpwNOGNq0xqN1wXbp1DGIBzLzYHNUY/Kb1bjts1EYKke4AhsMiZPbjfyqPuaZiw6G+ETf9ShbHTwlTPfYb9IOzoK4GPPU4iJNqYj4K7jJ3oI8WaMKXqwQZNzvABowjYj+JIIKbj3I31QipUYGLcpoUTw8zKySV/hUPG67e7HZ+VZPkq1wlj1XzXraj9WXutp3azFtkSpGnH0v5ssQyTZJH7LGxvKj4IzeXeUdjdp0vDgzP6zrDab6RTF/CWGlpd3hP6gXSSIv1uipqnlyqMEEtIxlr3/cng==; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1POaW8-000HOs-6m; Fri, 03 Dec 2010 21:38:00 +0300 Date: Fri, 3 Dec 2010 21:37:57 +0300 From: Eygene Ryabinkin To: Ulrich Sp??rlein , Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-ID: References: <201012031006.oB3A6J1S070688@svn.freebsd.org> <20101203171534.GE3256@acme.spoerlein.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101203171534.GE3256@acme.spoerlein.net> Sender: rea@codelabs.ru Cc: Subject: Re: svn commit: r216147 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 18:54:05 -0000 Fri, Dec 03, 2010 at 06:15:34PM +0100, Ulrich Sp??rlein wrote: > On Fri, 03.12.2010 at 10:06:19 +0000, Xin LI wrote: [...] > > +.Pp > > +It is recommended to write the whole provider before the first use, > > +in order to make sure that all sectors and their corresponding > > +checksums are properly initialized into a consistent state. > > .Sh SEE ALSO > > .Xr crypto 4 , > > .Xr gbde 4 , > > I'm not sure this wording is very helpful. Why should there be a > "consistent" state? In fact, if you write all zeros to the partition > before creating the geom, No, partition should be fully overwritten _after_ you had created the encrypted partition and this should be done on the .eli partition to allow the GEOM_ELI to place the correct checksums into the sectors of the provider geli is operating at. "geli init" won't do this, because it is time-consuming, I think. But I wonder if it will be a good idea to arm "geli init" with the additional flag that will attach the created partition, overwrite it with some data and detach the provider afterwards. The data that will overwrite the provider should be "random" -- we can't just use some known one, since this will allow attacker to replay the blocks (overwrite them back) with the full knowledge of their contents. But perhaps we will need not the fully random data, but something that is derived from the secret key, because what we really need to hide from the attacker is a plain text that leaves inside the encrypted sectors. -- Eygene Ryabinkin ,,,^..^,,, [ Life's unfair - but root password helps! | codelabs.ru ] [ 82FE 06BC D497 C0DE 49EC 4FF0 16AF 9EAE 8152 ECFB | freebsd.org ] From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 19:22:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 905AC106566C; Fri, 3 Dec 2010 19:22:18 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 737EA8FC17; Fri, 3 Dec 2010 19:22:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3JMIYT012713; Fri, 3 Dec 2010 19:22:18 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3JMI71012710; Fri, 3 Dec 2010 19:22:18 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201012031922.oB3JMI71012710@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 3 Dec 2010 19:22:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216157 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 19:22:18 -0000 Author: jchandra Date: Fri Dec 3 19:22:18 2010 New Revision: 216157 URL: http://svn.freebsd.org/changeset/base/216157 Log: 1. Fix off by one errors in calls to MIPS_DIRECT_MAPPABLE, reported by alc@ 2. Remove unnecessary #defines from vmparam.h Submitted by: alc (2) Reviewed by: alc (1) Modified: head/sys/mips/include/vmparam.h head/sys/mips/mips/pmap.c Modified: head/sys/mips/include/vmparam.h ============================================================================== --- head/sys/mips/include/vmparam.h Fri Dec 3 18:30:55 2010 (r216156) +++ head/sys/mips/include/vmparam.h Fri Dec 3 19:22:18 2010 (r216157) @@ -46,11 +46,6 @@ /* * Machine dependent constants mips processors. */ -/* - * USRTEXT is the start of the user text/data space, while USRSTACK - * is the top (end) of the user stack. - */ -#define USRTEXT (1*PAGE_SIZE) /* * Virtual memory related constants, all in bytes @@ -94,7 +89,6 @@ #define VM_MAX_ADDRESS ((vm_offset_t)(intptr_t)(int32_t)0xffffffff) #define VM_MINUSER_ADDRESS ((vm_offset_t)0x00000000) -#define VM_MAX_MMAP_ADDR VM_MAXUSER_ADDRESS #ifdef __mips_n64 #define VM_MAXUSER_ADDRESS (VM_MINUSER_ADDRESS + (NPDEPG * NBSEG)) Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Fri Dec 3 18:30:55 2010 (r216156) +++ head/sys/mips/mips/pmap.c Fri Dec 3 19:22:18 2010 (r216157) @@ -196,14 +196,15 @@ static void pmap_update_page_action(void #ifndef __mips_n64 /* - * This structure is for high memory (memory above 512Meg in 32 bit) - * This memory area does not have direct mapping, so we a mechanism to do - * temporary per-CPU mapping to access these addresses. - * - * At bootup we reserve 2 virtual pages per CPU for mapping highmem pages, to - * access a highmem physical address on a CPU, we will disable interrupts and - * add the mapping from the reserved virtual address for the CPU to the physical - * address in the kernel pagetable. + * This structure is for high memory (memory above 512Meg in 32 bit) support. + * The highmem area does not have a KSEG0 mapping, and we need a mechanism to + * do temporary per-CPU mappings for pmap_zero_page, pmap_copy_page etc. + * + * At bootup, we reserve 2 virtual pages per CPU for mapping highmem pages. To + * access a highmem physical address on a CPU, we map the physical address to + * the reserved virtual address for the CPU in the kernel pagetable. This is + * done with interrupts disabled(although a spinlock and sched_pin would be + * sufficient). */ struct local_sysmaps { vm_offset_t base; @@ -520,11 +521,11 @@ again: } /* - * In 32 bit, we may have memory which cannot be mapped directly - * this memory will need temporary mapping before it can be + * In 32 bit, we may have memory which cannot be mapped directly. + * This memory will need temporary mapping before it can be * accessed. */ - if (!MIPS_DIRECT_MAPPABLE(phys_avail[i - 1])) + if (!MIPS_DIRECT_MAPPABLE(phys_avail[i - 1] - 1)) need_local_mappings = 1; /* @@ -893,7 +894,7 @@ pmap_map(vm_offset_t *virt, vm_offset_t { vm_offset_t va, sva; - if (MIPS_DIRECT_MAPPABLE(end)) + if (MIPS_DIRECT_MAPPABLE(end - 1)) return (MIPS_PHYS_TO_DIRECT(start)); va = sva = *virt; From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 19:37:23 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93F6E106566C; Fri, 3 Dec 2010 19:37:23 +0000 (UTC) (envelope-from rea@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 138838FC23; Fri, 3 Dec 2010 19:37:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=GDQ6EencwDoQ9OWgemHxGCkQM2jCjUb6HvcalQgc8yk=; b=L19zYvhlkCwaRVG9+Yac1UFumoCp0C30A09s+khZy+J1nHWO8N+TvCu1LZT4OdpLrxhXUPpuP2xeYBpE1ijDkrTXYbSz2GOnQX0X4jDwhoU0TBIbLRuMUXAt4BeQFM9iP0VTki/tItsN9gob5RchBefygnfRpkGdKXoMm/P00HUNv18TjLD/gXvTCm5WWv391Ytui1pVylzFOEVUJB7eH7Yt6FkYXvznrICaudy1VaEYtpCGH3iMOClXQM2CjQCqqNnw9dZmhnRUQm/tPgi1C3n7LMynk1za3ls3YXrOUl4ynmewxevNmBA07Lk/twnbPaDgzm3c6C8CyVDpoQ9Kug==; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1PObRX-000MEN-4U; Fri, 03 Dec 2010 22:37:19 +0300 Date: Fri, 3 Dec 2010 22:37:16 +0300 From: Eygene Ryabinkin To: Bruce Evans Message-ID: References: <201012030709.oB379NOH058721@svn.freebsd.org> <20101204045754.T4046@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101204045754.T4046@besplex.bde.org> Sender: rea@codelabs.ru Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Cran Subject: Re: svn commit: r216143 - in head: share/man/man9 sys/amd64/include sys/arm/include sys/i386/include sys/ia64/include sys/mips/include sys/pc98/include sys/powerpc/include sys/sparc64/include sys/sun4v... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 19:37:23 -0000 Sat, Dec 04, 2010 at 05:01:55AM +1100, Bruce Evans wrote: > On Fri, 3 Dec 2010, Bruce Cran wrote: > > Log: > > Revert r216134. This checkin broke platforms where bus_space are macros: > > they need to be a single statement, and do { } while (0) doesn't > > work in this situation so revert until a solution can be devised. > > Surprising that do-while doesn't work. Prior to the revert, something like "a = bus_space_read_multi_1(...)" will generate improper code like "a = KASSERT(); __bs_nonsigle(XXX);" and making "do { KASSERT(); __bs_nonsingle(XXX); } while(0)" won't help either, since we can't generally assign the compound statement to the lvalue. > > Modified: head/sys/arm/include/bus.h > > ============================================================================== > > --- head/sys/arm/include/bus.h Fri Dec 3 07:01:07 2010 (r216142) > > +++ head/sys/arm/include/bus.h Fri Dec 3 07:09:23 2010 (r216143) > > ... > > @@ -321,29 +318,21 @@ struct bus_space { > > * Bus read multiple operations. > > */ > > #define bus_space_read_multi_1(t, h, o, a, c) \ > > - KASSERT(c != 0, ("bus_space_read_multi_1: count == 0")); \ > > __bs_nonsingle(rm,1,(t),(h),(o),(a),(c)) > > I just noticed the following possibly more serious problems for the macro > versions: > > - the `c' arg is missing parentheses in the KASSERT() > - the `c' arg is now evaluated twice. This turns safe macros into unsafe > ones. Perhaps we can define the macros as {{{ #define bus_space_read_multi_1(t, h, o, a, c) ({\ size_t count = (c); \ KASSERT(count != 0, ("bus_space_read_multi_1: count == 0")); \ __bs_nonsingle(rm,1,(t),(h),(o),(a),count); \ }) }}} This will both allow to avoid unsafety and will make this statement to be the correct assignment for any compiler that supports the "braced-groups within expressions" GNU extension. GNU C, Clang and Intel C both support it (but not with -pedantic -ansi -Werror flag combo). But, probably, the inline function will be better here from the portability point of view, since it is supported by the C standard and braced-groups -- aren't. So, the question is "why these statements were made to be macros at some platforms?". -- Eygene Ryabinkin ,,,^..^,,, [ Life's unfair - but root password helps! | codelabs.ru ] [ 82FE 06BC D497 C0DE 49EC 4FF0 16AF 9EAE 8152 ECFB | freebsd.org ] From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 19:47:14 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BB141065675; Fri, 3 Dec 2010 19:47:14 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8B5A98FC14; Fri, 3 Dec 2010 19:47:13 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id E1DCDA5A329; Sat, 4 Dec 2010 03:47:10 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id BRBhToNxG6ua; Sat, 4 Dec 2010 03:47:02 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id DFB47A59ADE; Sat, 4 Dec 2010 03:46:59 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:subject:references:in-reply-to:x-enigmail-version:openpgp:content-type; b=IavPqfYATT+eu/BNEXxVW7bLkCU3O/lkdK2KxFg/G/hOEhblKGyOsTK5wzqegWcr6 BqUmKmLz9v6xbJ2HKIpqw== Message-ID: <4CF9492F.8040301@delphij.net> Date: Fri, 03 Dec 2010 11:46:55 -0800 From: Xin LI Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.15) Gecko/20101028 Thunderbird/3.0.10 ThunderBrowse/3.3.4 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Ulrich_Sp=F6rlein?= , Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201012031006.oB3A6J1S070688@svn.freebsd.org> <20101203171534.GE3256@acme.spoerlein.net> In-Reply-To: <20101203171534.GE3256@acme.spoerlein.net> X-Enigmail-Version: 1.0.1 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: multipart/mixed; boundary="------------040402050204020709080306" Cc: Subject: Re: svn commit: r216147 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 19:47:14 -0000 This is a multi-part message in MIME format. --------------040402050204020709080306 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 12/03/10 09:15, Ulrich Spörlein wrote: > On Fri, 03.12.2010 at 10:06:19 +0000, Xin LI wrote: >> Author: delphij >> Date: Fri Dec 3 10:06:19 2010 >> New Revision: 216147 >> URL: http://svn.freebsd.org/changeset/base/216147 >> >> Log: >> * Recommend a overwrite of whole geli provider before use. >> * Correct a typo while I'm there. >> >> Reviewed by: pjd >> MFC after: 2 weeks >> >> Modified: >> head/sbin/geom/class/eli/geli.8 >> >> Modified: head/sbin/geom/class/eli/geli.8 >> ============================================================================== >> --- head/sbin/geom/class/eli/geli.8 Fri Dec 3 09:26:56 2010 (r216146) >> +++ head/sbin/geom/class/eli/geli.8 Fri Dec 3 10:06:19 2010 (r216147) >> @@ -24,7 +24,7 @@ >> .\" >> .\" $FreeBSD$ >> .\" >> -.Dd October 20, 2010 >> +.Dd December 3, 2010 >> .Dt GELI 8 >> .Os >> .Sh NAME >> @@ -842,7 +842,7 @@ Enter passphrase: >> .Nm >> supports two encryption modes: >> .Nm XTS , >> -which was standarized as >> +which was standardized as >> .Nm IEE P1619 >> and >> .Nm CBC >> @@ -873,6 +873,10 @@ changes with the data he owns without no >> In other words >> .Nm >> will not protect your data against replay attacks. >> +.Pp >> +It is recommended to write the whole provider before the first use, >> +in order to make sure that all sectors and their corresponding >> +checksums are properly initialized into a consistent state. >> .Sh SEE ALSO >> .Xr crypto 4 , >> .Xr gbde 4 , > > I'm not sure this wording is very helpful. Why should there be a > "consistent" state? In fact, if you write all zeros to the partition > before creating the geom, then an attacker pretty much knows how much > data you have written to the provider. I'm not saying this weakens any > security, but I think the current phrasing will confuse the reader. What > needs to be consistent? What does writing to the provider mean? > > Or am I mixing up provider and consumer here? How would you like the attached patch? Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iQEcBAEBCAAGBQJM+UkvAAoJEATO+BI/yjfBP1oIANH6E0mTqQWc8b0WFd61YYTr t2YTiJGyUXa1bt9LnhQr8iasCYKx9AqAHO0sDMjezo94jYfpyW/C0jYD7vj+fuIP m84CWUfbKC079REhvv/j9t+mbcEFiQK3u4I3nG/ArNSbjXZUOvkav3c20rGHtwEy ncwGWwTB/5Z5zIT4hPS4e6hiUSR5afBQu+Ww0CqyK2S3w6cdY/kQyyFH8De4TbnX MBhJw/74Y6mRM0PjsIuISP59ZxV5OelWz/DZmcP6tNXmpv3ExW6TmD4ov9X/9eYS WRNi2ygNpGMKHx/8RqKtDOdQ1R0nz9lKUt3Zg5q8GhGS0Lce4GuoaRr0XWQD19I= =ipPy -----END PGP SIGNATURE----- --------------040402050204020709080306 Content-Type: text/plain; name="geli.8.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="geli.8.diff" Index: geli.8 =================================================================== --- geli.8 (revision 216157) +++ geli.8 (working copy) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 3, 2010 +.Dd December 4, 2010 .Dt GELI 8 .Os .Sh NAME @@ -874,7 +874,15 @@ .Nm will not protect your data against replay attacks. .Pp -It is recommended to write the whole provider before the first use, +The +.Nm +class does not distinguish whether data is written after its creation, +therefore, read from +.Dq uninitialized +area may result in false positives on data corruption. +It is recommended to write the whole provider +.Pq for instance, Pa /dev/ Ns Ao prov Ac Ns .eli +before its first use, ideally with random data, in order to make sure that all sectors and their corresponding checksums are properly initialized into a consistent state. .Sh SEE ALSO --------------040402050204020709080306-- From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 20:13:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9767E106564A; Fri, 3 Dec 2010 20:13:06 +0000 (UTC) (envelope-from erwin@mail.droso.net) Received: from mail.droso.net (grizzly.droso.net [IPv6:2a01:4f8:130:7021::5]) by mx1.freebsd.org (Postfix) with ESMTP id 302C68FC19; Fri, 3 Dec 2010 20:13:06 +0000 (UTC) Received: by mail.droso.net (Postfix, from userid 1001) id D6D14F1FF; Fri, 3 Dec 2010 21:13:04 +0100 (CET) Date: Fri, 3 Dec 2010 21:13:04 +0100 From: Erwin Lansing To: Nathan Whitehorn Message-ID: <20101203201304.GM27077@droso.net> References: <201012021736.oB2Halhq020107@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WeojGOqAOUQyw5FN" Content-Disposition: inline In-Reply-To: <201012021736.oB2Halhq020107@svn.freebsd.org> X-Operating-System: FreeBSD/amd64 8.1-RELEASE User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216127 - head/gnu/usr.bin/cc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 20:13:06 -0000 --WeojGOqAOUQyw5FN Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 02, 2010 at 05:36:47PM +0000, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Thu Dec 2 17:36:47 2010 > New Revision: 216127 > URL: http://svn.freebsd.org/changeset/base/216127 >=20 > Log: > Unbreak amd64<->i386 cross builds. Thanks! This indeed fixes the issues I was having on the i386 cross build on amd64 on pointyhat yesterday. -erwin --=20 Erwin Lansing http://droso.org Prediction is very difficult especially about the future erwin@FreeBSD.org --WeojGOqAOUQyw5FN Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFM+U9Qqy9aWxUlaZARAvE5AKCm+W/ZxHSOPwKMJW1G2hOLXK0cgACg8fFb 9yi7hlj6+YvWp2jZI6tjfxM= =S+3J -----END PGP SIGNATURE----- --WeojGOqAOUQyw5FN-- From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 20:39:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFAC51065672; Fri, 3 Dec 2010 20:39:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE1008FC26; Fri, 3 Dec 2010 20:39:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3Kd6Ee020681; Fri, 3 Dec 2010 20:39:06 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3Kd6IB020679; Fri, 3 Dec 2010 20:39:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012032039.oB3Kd6IB020679@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 3 Dec 2010 20:39:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216158 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 20:39:07 -0000 Author: kib Date: Fri Dec 3 20:39:06 2010 New Revision: 216158 URL: http://svn.freebsd.org/changeset/base/216158 Log: Trim whitespaces at the end of lines. Use the commit to record proper log message for r216150. MFC after: 1 week If unix socket has a unix socket attached as the rights that has a unix socket attached as the rights that has a unix socket attached as the rights ... Kernel may overflow the stack on attempt to close such socket. Only close the rights file in the context of the current close if the file is not unix domain socket. Otherwise, postpone the work to taskqueue, preventing unlimited recursion. The pass of the unix domain sockets over the SCM_RIGHTS message control is not widely used, and more, the close of the socket with still attached rights is mostly an application failure. The change should not affect the performance of typical users of SCM_RIGHTS. Reviewed by: jeff, rwatson Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri Dec 3 19:22:18 2010 (r216157) +++ head/sys/kern/uipc_usrreq.c Fri Dec 3 20:39:06 2010 (r216158) @@ -177,10 +177,10 @@ SYSCTL_ULONG(_net_local_seqpacket, OID_A &unpsp_sendspace, 0, "Default seqpacket send space."); SYSCTL_ULONG(_net_local_seqpacket, OID_AUTO, recvspace, CTLFLAG_RW, &unpsp_recvspace, 0, "Default seqpacket receive space."); -SYSCTL_INT(_net_local, OID_AUTO, inflight, CTLFLAG_RD, &unp_rights, 0, +SYSCTL_INT(_net_local, OID_AUTO, inflight, CTLFLAG_RD, &unp_rights, 0, "File descriptors in flight."); SYSCTL_INT(_net_local, OID_AUTO, deferred, CTLFLAG_RD, - &unp_defers_count, 0, + &unp_defers_count, 0, "File descriptors deferred to taskqueue for close."); /* From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 21:06:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C6B21065693; Fri, 3 Dec 2010 21:06:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF1A68FC15; Fri, 3 Dec 2010 21:06:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3L6U5r025892; Fri, 3 Dec 2010 21:06:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3L6Uwd025889; Fri, 3 Dec 2010 21:06:30 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201012032106.oB3L6Uwd025889@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 3 Dec 2010 21:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216159 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 21:06:31 -0000 Author: jkim Date: Fri Dec 3 21:06:30 2010 New Revision: 216159 URL: http://svn.freebsd.org/changeset/base/216159 Log: Do not change CPU ticker frequency if TSC is P-state invariant. Note this change was meant to be committed with r184102 (and its subsequent MFCs) but it fell off somehow. Pointyhat to: jkim MFC after: 3 days Modified: head/sys/amd64/amd64/tsc.c head/sys/i386/i386/tsc.c Modified: head/sys/amd64/amd64/tsc.c ============================================================================== --- head/sys/amd64/amd64/tsc.c Fri Dec 3 20:39:06 2010 (r216158) +++ head/sys/amd64/amd64/tsc.c Fri Dec 3 21:06:30 2010 (r216159) @@ -146,6 +146,9 @@ tsc_levels_changed(void *arg, int unit) int count, error; uint64_t max_freq; + if (tsc_is_invariant) + return; + /* Only use values from the first CPU, assuming all are equal. */ if (unit != 0) return; Modified: head/sys/i386/i386/tsc.c ============================================================================== --- head/sys/i386/i386/tsc.c Fri Dec 3 20:39:06 2010 (r216158) +++ head/sys/i386/i386/tsc.c Fri Dec 3 21:06:30 2010 (r216159) @@ -174,6 +174,9 @@ tsc_levels_changed(void *arg, int unit) int count, error; uint64_t max_freq; + if (tsc_is_invariant) + return; + /* Only use values from the first CPU, assuming all are equal. */ if (unit != 0) return; From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 21:54:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A5D5106566C; Fri, 3 Dec 2010 21:54:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 594128FC1B; Fri, 3 Dec 2010 21:54:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3LsA8h035464; Fri, 3 Dec 2010 21:54:10 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3LsADC035461; Fri, 3 Dec 2010 21:54:10 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201012032154.oB3LsADC035461@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 3 Dec 2010 21:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216161 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 21:54:10 -0000 Author: jkim Date: Fri Dec 3 21:54:10 2010 New Revision: 216161 URL: http://svn.freebsd.org/changeset/base/216161 Log: Explicitly initialize TSC frequency. To calibrate TSC frequency, we use DELAY(9) and it may use TSC in turn if TSC frequency is non-zero. MFC after: 3 days Modified: head/sys/amd64/amd64/tsc.c head/sys/i386/i386/tsc.c Modified: head/sys/amd64/amd64/tsc.c ============================================================================== --- head/sys/amd64/amd64/tsc.c Fri Dec 3 21:52:01 2010 (r216160) +++ head/sys/amd64/amd64/tsc.c Fri Dec 3 21:54:10 2010 (r216161) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include "cpufreq_if.h" -uint64_t tsc_freq; +uint64_t tsc_freq = 0; int tsc_is_broken; int tsc_is_invariant; static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; Modified: head/sys/i386/i386/tsc.c ============================================================================== --- head/sys/i386/i386/tsc.c Fri Dec 3 21:52:01 2010 (r216160) +++ head/sys/i386/i386/tsc.c Fri Dec 3 21:54:10 2010 (r216161) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include "cpufreq_if.h" -uint64_t tsc_freq; +uint64_t tsc_freq = 0; int tsc_is_broken; int tsc_is_invariant; u_int tsc_present; From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 21:56:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F356106566C; Fri, 3 Dec 2010 21:56:30 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 364AF8FC0C; Fri, 3 Dec 2010 21:56:29 +0000 (UTC) Received: by iwn39 with SMTP id 39so11660793iwn.13 for ; Fri, 03 Dec 2010 13:56:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=NcNOkCzyd67B8PChdPXOZuBdj6vGQDwtJL74J1NYo90=; b=AQD+rEDoYPfrZRNV+uM7mRsl2hLlFqx5KTHtLy6rWvcpYF8limLRtfVSCwyy4YFl9t JDfKlr6CK8XKXKsfil2vfG4XpIQtqg3laXrBCQnyeYasw7fil+kBpz8p0tWntsEhEA4S 4Cxn7fFHF6cklw+c1bjOwRFl5NxSNbFO6L/yA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=eIDgY+KBPRXRJy9Mh1OmKkbwNsIDVMGmeDL7EPTZB0TwqY6bsoCdmE2Ht0tFS62vch Tx939lH55OC5AN+5njX8xLNzJ99uU5fJDnDaK3qi0Zc9DOUwc4BJ1WpstDnLgT+9zdHP q4iDNbmGav1mEKRD0uWS/QJYNFmSQszIArpBU= MIME-Version: 1.0 Received: by 10.231.11.9 with SMTP id r9mr2433582ibr.47.1291413389372; Fri, 03 Dec 2010 13:56:29 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.231.21.35 with HTTP; Fri, 3 Dec 2010 13:56:29 -0800 (PST) In-Reply-To: <201012032154.oB3LsADC035461@svn.freebsd.org> References: <201012032154.oB3LsADC035461@svn.freebsd.org> Date: Fri, 3 Dec 2010 13:56:29 -0800 X-Google-Sender-Auth: S6YIM_27mmK5EIAgBm0RgP9YnfM Message-ID: From: mdf@FreeBSD.org To: Jung-uk Kim Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216161 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 21:56:30 -0000 On Fri, Dec 3, 2010 at 1:54 PM, Jung-uk Kim wrote: > Author: jkim > Date: Fri Dec =A03 21:54:10 2010 > New Revision: 216161 > URL: http://svn.freebsd.org/changeset/base/216161 > > Log: > =A0Explicitly initialize TSC frequency. =A0To calibrate TSC frequency, we= use > =A0DELAY(9) and it may use TSC in turn if TSC frequency is non-zero. Doesn't ELF guarantee that the static data is already 0? On AIX the kernel had to explicitly zero the non-initialized data area, but AIX uses the a.out format. I thought FreeBSD/ELF meant that global variables without initializers were 0 by the time the OS started running. Thanks, matthew > > =A0MFC after: =A0 =A03 days > > Modified: > =A0head/sys/amd64/amd64/tsc.c > =A0head/sys/i386/i386/tsc.c > > Modified: head/sys/amd64/amd64/tsc.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/amd64/amd64/tsc.c =A0Fri Dec =A03 21:52:01 2010 =A0 =A0 =A0 = =A0(r216160) > +++ head/sys/amd64/amd64/tsc.c =A0Fri Dec =A03 21:54:10 2010 =A0 =A0 =A0 = =A0(r216161) > @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); > > =A0#include "cpufreq_if.h" > > -uint64_t =A0 =A0 =A0 tsc_freq; > +uint64_t =A0 =A0 =A0 tsc_freq =3D 0; > =A0int =A0 =A0 =A0 =A0 =A0 =A0tsc_is_broken; > =A0int =A0 =A0 =A0 =A0 =A0 =A0tsc_is_invariant; > =A0static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; > > Modified: head/sys/i386/i386/tsc.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/i386/i386/tsc.c =A0 =A0Fri Dec =A03 21:52:01 2010 =A0 =A0 = =A0 =A0(r216160) > +++ head/sys/i386/i386/tsc.c =A0 =A0Fri Dec =A03 21:54:10 2010 =A0 =A0 = =A0 =A0(r216161) > @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); > > =A0#include "cpufreq_if.h" > > -uint64_t =A0 =A0 =A0 tsc_freq; > +uint64_t =A0 =A0 =A0 tsc_freq =3D 0; > =A0int =A0 =A0 =A0 =A0 =A0 =A0tsc_is_broken; > =A0int =A0 =A0 =A0 =A0 =A0 =A0tsc_is_invariant; > =A0u_int =A0 =A0 =A0 =A0 =A0tsc_present; > From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 21:56:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D15861065777; Fri, 3 Dec 2010 21:56:35 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 359EE8FC16; Fri, 3 Dec 2010 21:56:33 +0000 (UTC) Received: by wwf26 with SMTP id 26so5662900wwf.31 for ; Fri, 03 Dec 2010 13:56:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=KL8EobKjnqdsK7/Khrqe/twrrrfaRkjKGLby08hpX0w=; b=r03rQZFbgdMtk29e8qjLxq9HRk8p82+9GEnSdSpVwYZcHmLbcyox4dxRLhkUUlQZEV wuG8UufsZWdqJjQ2L1PL5vFw0y+AF/XsO62HE0PYURPdYnwJ41i3fSVA7SA0tZlfTKTh wzvtKI20OiJO41p5NWLbfDWl/Il7pDYkzhrLM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=ZapGkotNSXYqMpXwKz1E2EYMQRudgnyMpBdo417DOU38Lpmp5STHA0fqIF2M84Q0xP oazmMOM4RaF8Y9fh53P/KPTALrtpuYrrkKVeXStXwnwplzzl+mQqNROgk3nKEGtbnuMc /7lc2+ayivLKoI9DygtNE4WHRB2tChZlavYmg= MIME-Version: 1.0 Received: by 10.216.11.203 with SMTP id 53mr2728958wex.15.1291413392965; Fri, 03 Dec 2010 13:56:32 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.198.27 with HTTP; Fri, 3 Dec 2010 13:56:32 -0800 (PST) In-Reply-To: <201012032154.oB3LsADC035461@svn.freebsd.org> References: <201012032154.oB3LsADC035461@svn.freebsd.org> Date: Fri, 3 Dec 2010 13:56:32 -0800 X-Google-Sender-Auth: FT2GsXJImv6Tw1u96hF6B0oI_wA Message-ID: From: Garrett Cooper To: Jung-uk Kim Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216161 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 21:56:37 -0000 On Fri, Dec 3, 2010 at 1:54 PM, Jung-uk Kim wrote: > Author: jkim > Date: Fri Dec =A03 21:54:10 2010 > New Revision: 216161 > URL: http://svn.freebsd.org/changeset/base/216161 > > Log: > =A0Explicitly initialize TSC frequency. =A0To calibrate TSC frequency, we= use > =A0DELAY(9) and it may use TSC in turn if TSC frequency is non-zero. > > =A0MFC after: =A0 =A03 days > > Modified: > =A0head/sys/amd64/amd64/tsc.c > =A0head/sys/i386/i386/tsc.c > > Modified: head/sys/amd64/amd64/tsc.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/amd64/amd64/tsc.c =A0Fri Dec =A03 21:52:01 2010 =A0 =A0 =A0 = =A0(r216160) > +++ head/sys/amd64/amd64/tsc.c =A0Fri Dec =A03 21:54:10 2010 =A0 =A0 =A0 = =A0(r216161) > @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); > > =A0#include "cpufreq_if.h" > > -uint64_t =A0 =A0 =A0 tsc_freq; > +uint64_t =A0 =A0 =A0 tsc_freq =3D 0; > =A0int =A0 =A0 =A0 =A0 =A0 =A0tsc_is_broken; > =A0int =A0 =A0 =A0 =A0 =A0 =A0tsc_is_invariant; > =A0static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; > > Modified: head/sys/i386/i386/tsc.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/i386/i386/tsc.c =A0 =A0Fri Dec =A03 21:52:01 2010 =A0 =A0 = =A0 =A0(r216160) > +++ head/sys/i386/i386/tsc.c =A0 =A0Fri Dec =A03 21:54:10 2010 =A0 =A0 = =A0 =A0(r216161) > @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); > > =A0#include "cpufreq_if.h" > > -uint64_t =A0 =A0 =A0 tsc_freq; > +uint64_t =A0 =A0 =A0 tsc_freq =3D 0; > =A0int =A0 =A0 =A0 =A0 =A0 =A0tsc_is_broken; > =A0int =A0 =A0 =A0 =A0 =A0 =A0tsc_is_invariant; > =A0u_int =A0 =A0 =A0 =A0 =A0tsc_present; This is unnecessary. Global values (like this) are initialized to 0 by default: $ cat ~/test_global.c #include int aglobal; int main(void) { printf("%d\n", aglobal); return 0; } $ ~/test_global 0 Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 21:59:15 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44BE3106566C; Fri, 3 Dec 2010 21:59:15 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 97E748FC12; Fri, 3 Dec 2010 21:59:14 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.4/8.14.2) with ESMTP id oB3LxDJp038506; Fri, 3 Dec 2010 16:59:13 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.4/8.14.2/Submit) id oB3LxDRi038505; Fri, 3 Dec 2010 16:59:13 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Fri, 3 Dec 2010 16:59:13 -0500 From: David Schultz To: Pawel Jakub Dawidek Message-ID: <20101203215913.GA38186@zim.MIT.EDU> Mail-Followup-To: Pawel Jakub Dawidek , Ulrich Spoerlein , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201010310921.o9V9LSo4075408@svn.freebsd.org> <20101031160603.GD2160@garage.freebsd.pl> <20101031191119.GM46314@acme.spoerlein.net> <20101031195003.GE2160@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101031195003.GE2160@garage.freebsd.pl> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Ulrich Spoerlein Subject: Re: svn commit: r214596 - head/bin/rm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 21:59:15 -0000 On Sun, Oct 31, 2010, Pawel Jakub Dawidek wrote: > On Sun, Oct 31, 2010 at 08:11:19PM +0100, Ulrich Spoerlein wrote: > > On Sun, 31.10.2010 at 17:06:03 +0100, Pawel Jakub Dawidek wrote: > > > IMHO this option should be removed and rm(1) should fail when a user is > > > trying to use it. > > > > No, this is a POLA violation for no apparent gain. The flag has been in > > FreeBSD since at least '94. Remember, that we are in the rope-selling > > business. We empower the users to shoot themselves in the foot. > > > > I, for one, am using the -P option in a certain case where I can be sure > > that ~99% of the data will be obliterated and I'm fine with that. For > > all other cases I'm using geli or gbde (where I can make sure, that data > > is lost). > > The question remains unanswered: If it is not a security feature then > what's the purpose? > > IMHO this is a security feature, just a really lame one. Too many > requirements have to be meet to make it work. > > I don't think you would want to read in GELI or GBDE manual page that it > encrypts the data sometimes, or if all the given requirements are meet. > Of course requirements are fine, but they have to be really clear to the > user and the list should be as short as possible, which is not the case > here. (apologies for the late reply) You guys are thinking mainly about physical attacks. The -P option provides effective protection against online attacks wherein an attacker has stashed a hard link to your sensitive file somewhere. It's also fair to say that rm -P makes a best-effort attempt to defend against simple commercial forensics tools, and it's about the best you can do if you didn't think to store your data encrypted in the first place. Anyway, I think the current list of caveats adequately warns about the limitations. The one thing I would add to the manpage is a reference to geli, recommending disk encryption to people who need stronger protection against offline attacks. From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 22:08:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE5451065670; Fri, 3 Dec 2010 22:08:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C1C258FC14; Fri, 3 Dec 2010 22:08:43 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 7CFEA46B5B; Fri, 3 Dec 2010 17:08:43 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7E5798A01D; Fri, 3 Dec 2010 17:08:41 -0500 (EST) From: John Baldwin To: "Jung-uk Kim" Date: Fri, 3 Dec 2010 17:08:30 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201012032154.oB3LsADC035461@svn.freebsd.org> In-Reply-To: <201012032154.oB3LsADC035461@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201012031708.30232.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 03 Dec 2010 17:08:41 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216161 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 22:08:44 -0000 On Friday, December 03, 2010 4:54:10 pm Jung-uk Kim wrote: > Author: jkim > Date: Fri Dec 3 21:54:10 2010 > New Revision: 216161 > URL: http://svn.freebsd.org/changeset/base/216161 > > Log: > Explicitly initialize TSC frequency. To calibrate TSC frequency, we use > DELAY(9) and it may use TSC in turn if TSC frequency is non-zero. We zero the BSS, so these were already zero. This just makes the actual kernel file on disk larger by wasting space in .data instead of .bss. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 22:27:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7AD2106564A; Fri, 3 Dec 2010 22:27:51 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B64228FC12; Fri, 3 Dec 2010 22:27:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3MRpfg041177; Fri, 3 Dec 2010 22:27:51 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3MRp7b041174; Fri, 3 Dec 2010 22:27:51 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201012032227.oB3MRp7b041174@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 3 Dec 2010 22:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216163 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 22:27:51 -0000 Author: jkim Date: Fri Dec 3 22:27:51 2010 New Revision: 216163 URL: http://svn.freebsd.org/changeset/base/216163 Log: Revert r216161. It is not necessary because we zero-fill BSS anyway. Requested by: jhb Modified: head/sys/amd64/amd64/tsc.c head/sys/i386/i386/tsc.c Modified: head/sys/amd64/amd64/tsc.c ============================================================================== --- head/sys/amd64/amd64/tsc.c Fri Dec 3 22:07:07 2010 (r216162) +++ head/sys/amd64/amd64/tsc.c Fri Dec 3 22:27:51 2010 (r216163) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include "cpufreq_if.h" -uint64_t tsc_freq = 0; +uint64_t tsc_freq; int tsc_is_broken; int tsc_is_invariant; static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; Modified: head/sys/i386/i386/tsc.c ============================================================================== --- head/sys/i386/i386/tsc.c Fri Dec 3 22:07:07 2010 (r216162) +++ head/sys/i386/i386/tsc.c Fri Dec 3 22:27:51 2010 (r216163) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include "cpufreq_if.h" -uint64_t tsc_freq = 0; +uint64_t tsc_freq; int tsc_is_broken; int tsc_is_invariant; u_int tsc_present; From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 22:44:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id DA164106564A; Fri, 3 Dec 2010 22:44:09 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Fri, 3 Dec 2010 17:43:53 -0500 User-Agent: KMail/1.6.2 References: <201012032154.oB3LsADC035461@svn.freebsd.org> <201012031708.30232.jhb@freebsd.org> In-Reply-To: <201012031708.30232.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201012031744.01956.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216161 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 22:44:10 -0000 On Friday 03 December 2010 05:08 pm, John Baldwin wrote: > On Friday, December 03, 2010 4:54:10 pm Jung-uk Kim wrote: > > Author: jkim > > Date: Fri Dec 3 21:54:10 2010 > > New Revision: 216161 > > URL: http://svn.freebsd.org/changeset/base/216161 > > > > Log: > > Explicitly initialize TSC frequency. To calibrate TSC > > frequency, we use DELAY(9) and it may use TSC in turn if TSC > > frequency is non-zero. > > We zero the BSS, so these were already zero. This just makes the > actual kernel file on disk larger by wasting space in .data instead > of .bss. Please note that I didn't touch other variables, e.g., tsc_is_broken, because I knew that. However, I just wanted to do that *explicitly*. Anyway, it is reverted now and SVN will remember what I wanted to do. ;-) BTW, if my memory serves, GCC (and all modern C compilers) put(s) zero-initialized variables back in .bss. Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 22:59:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 203D8106566B; Fri, 3 Dec 2010 22:59:55 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C2C58FC17; Fri, 3 Dec 2010 22:59:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3MxtAi044893; Fri, 3 Dec 2010 22:59:55 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3MxsjT044875; Fri, 3 Dec 2010 22:59:54 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201012032259.oB3MxsjT044875@svn.freebsd.org> From: "Simon L. Nielsen" Date: Fri, 3 Dec 2010 22:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216166 - in head/crypto/openssl: . crypto crypto/evp crypto/jpake crypto/stack doc/ssl ssl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 22:59:55 -0000 Author: simon Date: Fri Dec 3 22:59:54 2010 New Revision: 216166 URL: http://svn.freebsd.org/changeset/base/216166 Log: Merge OpenSSL 0.9.8q into head. Security: CVE-2010-4180 Security: http://www.openssl.org/news/secadv_20101202.txt MFC after: 3 days Added: head/crypto/openssl/ACKNOWLEDGMENTS - copied unchanged from r216165, vendor-crypto/openssl/dist/ACKNOWLEDGMENTS Modified: head/crypto/openssl/CHANGES head/crypto/openssl/FAQ head/crypto/openssl/Makefile head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/crypto/evp/p_sign.c head/crypto/openssl/crypto/evp/p_verify.c head/crypto/openssl/crypto/jpake/jpake.c head/crypto/openssl/crypto/jpake/jpake.h head/crypto/openssl/crypto/jpake/jpake_err.c head/crypto/openssl/crypto/opensslv.h head/crypto/openssl/crypto/stack/safestack.h head/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod head/crypto/openssl/openssl.spec head/crypto/openssl/ssl/s3_clnt.c head/crypto/openssl/ssl/s3_srvr.c Directory Properties: head/crypto/openssl/ (props changed) Copied: head/crypto/openssl/ACKNOWLEDGMENTS (from r216165, vendor-crypto/openssl/dist/ACKNOWLEDGMENTS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/crypto/openssl/ACKNOWLEDGMENTS Fri Dec 3 22:59:54 2010 (r216166, copy of r216165, vendor-crypto/openssl/dist/ACKNOWLEDGMENTS) @@ -0,0 +1,25 @@ +The OpenSSL project depends on volunteer efforts and financial support from +the end user community. That support comes in the form of donations and paid +sponsorships, software support contracts, paid consulting services +and commissioned software development. + +Since all these activities support the continued development and improvement +of OpenSSL we consider all these clients and customers as sponsors of the +OpenSSL project. + +We would like to identify and thank the following such sponsors for their past +or current significant support of the OpenSSL project: + +Very significant support: + + OpenGear: www.opengear.com + +Significant support: + + PSW Group: www.psw.net + +Please note that we ask permission to identify sponsors and that some sponsors +we consider eligible for inclusion here have requested to remain anonymous. + +Additional sponsorship or financial support is always welcome: for more +information please contact the OpenSSL Software Foundation. Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/CHANGES Fri Dec 3 22:59:54 2010 (r216166) @@ -2,6 +2,18 @@ OpenSSL CHANGES _______________ + Changes between 0.9.8p and 0.9.8q [2 Dec 2010] + + *) Disable code workaround for ancient and obsolete Netscape browsers + and servers: an attacker can use it in a ciphersuite downgrade attack. + Thanks to Martin Rex for discovering this bug. CVE-2010-4180 + [Steve Henson] + + *) Fixed J-PAKE implementation error, originally discovered by + Sebastien Martini, further info and confirmation from Stefan + Arentz and Feng Hao. Note that this fix is a security fix. CVE-2010-4252 + [Ben Laurie] + Changes between 0.9.8o and 0.9.8p [16 Nov 2010] *) Fix extension code to avoid race conditions which can result in a buffer Modified: head/crypto/openssl/FAQ ============================================================================== --- head/crypto/openssl/FAQ Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/FAQ Fri Dec 3 22:59:54 2010 (r216166) @@ -52,6 +52,9 @@ OpenSSL - Frequently Asked Questions * Why does the OpenSSL test suite fail in sha512t on x86 CPU? * Why does compiler fail to compile sha512.c? * Test suite still fails, what to do? +* I think I've found a bug, what should I do? +* I'm SURE I've found a bug, how do I report it? +* I've found a security issue, how do I report it? [PROG] Questions about programming with OpenSSL @@ -79,7 +82,7 @@ OpenSSL - Frequently Asked Questions * Which is the current version of OpenSSL? The current version is available from . -OpenSSL 1.0.0b was released on Nov 16th, 2010. +OpenSSL 1.0.0c was released on Dec 2nd, 2010. In addition to the current stable release, you can also access daily snapshots of the OpenSSL development version at . Some applications that use OpenSSL are distributed in binary form. When using such an application, you don't need to install OpenSSL @@ -463,7 +466,7 @@ administrators. Other projects do have other policies so you can for example extract the CA bundle used by Mozilla and/or modssl as described in this article: - http://www.mail-archive.com/modssl-users@modssl.org/msg16980.html + [BUILD] ======================================================================= @@ -505,7 +508,7 @@ when you run the test suite (using "make "bc: 1 not implemented". The best way to deal with this is to find another implementation of bc -and compile/install it. GNU bc (see http://www.gnu.org/software/software.html +and compile/install it. GNU bc (see for download instructions) can be safely used, for example. @@ -516,7 +519,7 @@ that the OpenSSL bntest throws at it. T test suite (using "make test"). The message returned is "bc: stack empty". The best way to deal with this is to find another implementation of bc -and compile/install it. GNU bc (see http://www.gnu.org/software/software.html +and compile/install it. GNU bc (see for download instructions) can be safely used, for example. @@ -709,6 +712,46 @@ never make sense, and tend to emerge whe to identify one, drop optimization level, e.g. by editing CFLAG line in top-level Makefile, recompile and re-run the test. +* I think I've found a bug, what should I do? + +If you are a new user then it is quite likely you haven't found a bug and +something is happening you aren't familiar with. Check this FAQ, the associated +documentation and the mailing lists for similar queries. If you are still +unsure whether it is a bug or not submit a query to the openssl-users mailing +list. + + +* I'm SURE I've found a bug, how do I report it? + +Bug reports with no security implications should be sent to the request +tracker. This can be done by mailing the report to (or its +alias ), please note that messages sent to the +request tracker also appear in the public openssl-dev mailing list. + +The report should be in plain text. Any patches should be sent as +plain text attachments because some mailers corrupt patches sent inline. +If your issue affects multiple versions of OpenSSL check any patches apply +cleanly and, if possible include patches to each affected version. + +The report should be given a meaningful subject line briefly summarising the +issue. Just "bug in OpenSSL" or "bug in OpenSSL 0.9.8n" is not very helpful. + +By sending reports to the request tracker the bug can then be given a priority +and assigned to the appropriate maintainer. The history of discussions can be +accessed and if the issue has been addressed or a reason why not. If patches +are only sent to openssl-dev they can be mislaid if a team member has to +wade through months of old messages to review the discussion. + +See also + + +* I've found a security issue, how do I report it? + +If you think your bug has security implications then please send it to +openssl-security@openssl.org if you don't get a prompt reply at least +acknowledging receipt then resend or mail it directly to one of the +more active team members (e.g. Steve). + [PROG] ======================================================================== * Is OpenSSL thread-safe? Modified: head/crypto/openssl/Makefile ============================================================================== --- head/crypto/openssl/Makefile Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/Makefile Fri Dec 3 22:59:54 2010 (r216166) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=0.9.8p +VERSION=0.9.8q MAJOR=0 MINOR=9.8 SHLIB_VERSION_NUMBER=0.9.8 Modified: head/crypto/openssl/NEWS ============================================================================== --- head/crypto/openssl/NEWS Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/NEWS Fri Dec 3 22:59:54 2010 (r216166) @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 0.9.8p and OpenSSL 0.9.8q: + + o Fix for security issue CVE-2010-4180 + o Fix for CVE-2010-4252 + Major changes between OpenSSL 0.9.8o and OpenSSL 0.9.8p: o Fix for security issue CVE-2010-3864. Modified: head/crypto/openssl/README ============================================================================== --- head/crypto/openssl/README Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/README Fri Dec 3 22:59:54 2010 (r216166) @@ -1,5 +1,5 @@ - OpenSSL 0.9.8p 16 Nov 2010 + OpenSSL 0.9.8q 2 Dec 2010 Copyright (c) 1998-2009 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: head/crypto/openssl/crypto/evp/p_sign.c ============================================================================== --- head/crypto/openssl/crypto/evp/p_sign.c Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/crypto/evp/p_sign.c Fri Dec 3 22:59:54 2010 (r216166) @@ -81,7 +81,7 @@ int EVP_SignFinal(EVP_MD_CTX *ctx, unsig unsigned char m[EVP_MAX_MD_SIZE]; unsigned int m_len; int i,ok=0,v; - MS_STATIC EVP_MD_CTX tmp_ctx; + EVP_MD_CTX tmp_ctx; *siglen=0; for (i=0; i<4; i++) Modified: head/crypto/openssl/crypto/evp/p_verify.c ============================================================================== --- head/crypto/openssl/crypto/evp/p_verify.c Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/crypto/evp/p_verify.c Fri Dec 3 22:59:54 2010 (r216166) @@ -68,7 +68,7 @@ int EVP_VerifyFinal(EVP_MD_CTX *ctx, con unsigned char m[EVP_MAX_MD_SIZE]; unsigned int m_len; int i,ok=0,v; - MS_STATIC EVP_MD_CTX tmp_ctx; + EVP_MD_CTX tmp_ctx; for (i=0; i<4; i++) { Modified: head/crypto/openssl/crypto/jpake/jpake.c ============================================================================== --- head/crypto/openssl/crypto/jpake/jpake.c Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/crypto/jpake/jpake.c Fri Dec 3 22:59:54 2010 (r216166) @@ -283,23 +283,53 @@ int JPAKE_STEP1_generate(JPAKE_STEP1 *se return 1; } +/* g^x is a legal value */ +static int is_legal(const BIGNUM *gx, const JPAKE_CTX *ctx) + { + BIGNUM *t; + int res; + + if(BN_is_negative(gx) || BN_is_zero(gx) || BN_cmp(gx, ctx->p.p) >= 0) + return 0; + + t = BN_new(); + BN_mod_exp(t, gx, ctx->p.q, ctx->p.p, ctx->ctx); + res = BN_is_one(t); + BN_free(t); + + return res; + } + int JPAKE_STEP1_process(JPAKE_CTX *ctx, const JPAKE_STEP1 *received) { - /* verify their ZKP(xc) */ + if(!is_legal(received->p1.gx, ctx)) + { + JPAKEerr(JPAKE_F_JPAKE_STEP1_PROCESS, JPAKE_R_G_TO_THE_X3_IS_NOT_LEGAL); + return 0; + } + + if(!is_legal(received->p2.gx, ctx)) + { + JPAKEerr(JPAKE_F_JPAKE_STEP1_PROCESS, JPAKE_R_G_TO_THE_X4_IS_NOT_LEGAL); + return 0; + } + + + /* verify their ZKP(xc) */ if(!verify_zkp(&received->p1, ctx->p.g, ctx)) { JPAKEerr(JPAKE_F_JPAKE_STEP1_PROCESS, JPAKE_R_VERIFY_X3_FAILED); return 0; } - /* verify their ZKP(xd) */ + /* verify their ZKP(xd) */ if(!verify_zkp(&received->p2, ctx->p.g, ctx)) { JPAKEerr(JPAKE_F_JPAKE_STEP1_PROCESS, JPAKE_R_VERIFY_X4_FAILED); return 0; } - /* g^xd != 1 */ + /* g^xd != 1 */ if(BN_is_one(received->p2.gx)) { JPAKEerr(JPAKE_F_JPAKE_STEP1_PROCESS, JPAKE_R_G_TO_THE_X4_IS_ONE); Modified: head/crypto/openssl/crypto/jpake/jpake.h ============================================================================== --- head/crypto/openssl/crypto/jpake/jpake.h Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/crypto/jpake/jpake.h Fri Dec 3 22:59:54 2010 (r216166) @@ -115,6 +115,8 @@ void ERR_load_JPAKE_strings(void); #define JPAKE_F_VERIFY_ZKP 100 /* Reason codes. */ +#define JPAKE_R_G_TO_THE_X3_IS_NOT_LEGAL 108 +#define JPAKE_R_G_TO_THE_X4_IS_NOT_LEGAL 109 #define JPAKE_R_G_TO_THE_X4_IS_ONE 105 #define JPAKE_R_HASH_OF_HASH_OF_KEY_MISMATCH 106 #define JPAKE_R_HASH_OF_KEY_MISMATCH 107 Modified: head/crypto/openssl/crypto/jpake/jpake_err.c ============================================================================== --- head/crypto/openssl/crypto/jpake/jpake_err.c Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/crypto/jpake/jpake_err.c Fri Dec 3 22:59:54 2010 (r216166) @@ -1,6 +1,6 @@ /* crypto/jpake/jpake_err.c */ /* ==================================================================== - * Copyright (c) 1999-2008 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2010 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -80,6 +80,8 @@ static ERR_STRING_DATA JPAKE_str_functs[ static ERR_STRING_DATA JPAKE_str_reasons[]= { +{ERR_REASON(JPAKE_R_G_TO_THE_X3_IS_NOT_LEGAL),"g to the x3 is not legal"}, +{ERR_REASON(JPAKE_R_G_TO_THE_X4_IS_NOT_LEGAL),"g to the x4 is not legal"}, {ERR_REASON(JPAKE_R_G_TO_THE_X4_IS_ONE) ,"g to the x4 is one"}, {ERR_REASON(JPAKE_R_HASH_OF_HASH_OF_KEY_MISMATCH),"hash of hash of key mismatch"}, {ERR_REASON(JPAKE_R_HASH_OF_KEY_MISMATCH),"hash of key mismatch"}, Modified: head/crypto/openssl/crypto/opensslv.h ============================================================================== --- head/crypto/openssl/crypto/opensslv.h Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/crypto/opensslv.h Fri Dec 3 22:59:54 2010 (r216166) @@ -25,11 +25,11 @@ * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -#define OPENSSL_VERSION_NUMBER 0x0090810f +#define OPENSSL_VERSION_NUMBER 0x0090811f #ifdef OPENSSL_FIPS -#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8p-fips 16 Nov 2010" +#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8q-fips 2 Dec 2010" #else -#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8p 16 Nov 2010" +#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8q 2 Dec 2010" #endif #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT Modified: head/crypto/openssl/crypto/stack/safestack.h ============================================================================== --- head/crypto/openssl/crypto/stack/safestack.h Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/crypto/stack/safestack.h Fri Dec 3 22:59:54 2010 (r216166) @@ -127,7 +127,7 @@ STACK_OF(type) \ sk_is_sorted(CHECKED_PTR_OF(STACK_OF(type), st)) #define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - (STACK_OF(type) *)d2i_ASN1_SET(CHECKED_PTR_OF(STACK_OF(type), st), \ + (STACK_OF(type) *)d2i_ASN1_SET(CHECKED_PTR_OF(STACK_OF(type)*, st), \ pp, length, \ CHECKED_D2I_OF(type, d2i_func), \ CHECKED_SK_FREE_FUNC(type, free_func), \ Modified: head/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod ============================================================================== --- head/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod Fri Dec 3 22:59:54 2010 (r216166) @@ -78,18 +78,7 @@ this breaks this server so 16 bytes is t =item SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG -ssl3.netscape.com:443, first a connection is established with RC4-MD5. -If it is then resumed, we end up using DES-CBC3-SHA. It should be -RC4-MD5 according to 7.6.1.3, 'cipher_suite'. - -Netscape-Enterprise/2.01 (https://merchant.netscape.com) has this bug. -It only really shows up when connecting via SSLv2/v3 then reconnecting -via SSLv3. The cipher list changes.... - -NEW INFORMATION. Try connecting with a cipher list of just -DES-CBC-SHA:RC4-MD5. For some weird reason, each new connection uses -RC4-MD5, but a re-connect tries to use DES-CBC-SHA. So netscape, when -doing a re-connect, always takes the first cipher in the cipher list. +As of OpenSSL 0.9.8q and 1.0.0c, this option has no effect. =item SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG Modified: head/crypto/openssl/openssl.spec ============================================================================== --- head/crypto/openssl/openssl.spec Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/openssl.spec Fri Dec 3 22:59:54 2010 (r216166) @@ -2,7 +2,7 @@ %define libmaj 0 %define libmin 9 %define librel 8 -%define librev p +%define librev q Release: 1 %define openssldir /var/ssl Modified: head/crypto/openssl/ssl/s3_clnt.c ============================================================================== --- head/crypto/openssl/ssl/s3_clnt.c Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/ssl/s3_clnt.c Fri Dec 3 22:59:54 2010 (r216166) @@ -814,8 +814,11 @@ int ssl3_get_server_hello(SSL *s) s->session->cipher_id = s->session->cipher->id; if (s->hit && (s->session->cipher_id != c->id)) { +/* Workaround is now obsolete */ +#if 0 if (!(s->options & SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG)) +#endif { al=SSL_AD_ILLEGAL_PARAMETER; SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED); Modified: head/crypto/openssl/ssl/s3_srvr.c ============================================================================== --- head/crypto/openssl/ssl/s3_srvr.c Fri Dec 3 22:48:15 2010 (r216165) +++ head/crypto/openssl/ssl/s3_srvr.c Fri Dec 3 22:59:54 2010 (r216166) @@ -927,6 +927,10 @@ int ssl3_get_client_hello(SSL *s) break; } } +/* Disabled because it can be used in a ciphersuite downgrade + * attack: CVE-2010-4180. + */ +#if 0 if (j == 0 && (s->options & SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG) && (sk_SSL_CIPHER_num(ciphers) == 1)) { /* Special case as client bug workaround: the previously used cipher may @@ -941,6 +945,7 @@ int ssl3_get_client_hello(SSL *s) j = 1; } } +#endif if (j == 0) { /* we need to have the cipher in the cipher From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 23:02:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 717E81065673; Fri, 3 Dec 2010 23:02:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Fri, 3 Dec 2010 18:02:37 -0500 User-Agent: KMail/1.6.2 References: <201012032154.oB3LsADC035461@svn.freebsd.org> <201012031708.30232.jhb@freebsd.org> <201012031744.01956.jkim@FreeBSD.org> In-Reply-To: <201012031744.01956.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201012031802.40083.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216161 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 23:02:48 -0000 On Friday 03 December 2010 05:43 pm, Jung-uk Kim wrote: > On Friday 03 December 2010 05:08 pm, John Baldwin wrote: > > On Friday, December 03, 2010 4:54:10 pm Jung-uk Kim wrote: > > > Author: jkim > > > Date: Fri Dec 3 21:54:10 2010 > > > New Revision: 216161 > > > URL: http://svn.freebsd.org/changeset/base/216161 > > > > > > Log: > > > Explicitly initialize TSC frequency. To calibrate TSC > > > frequency, we use DELAY(9) and it may use TSC in turn if TSC > > > frequency is non-zero. > > > > We zero the BSS, so these were already zero. This just makes the > > actual kernel file on disk larger by wasting space in .data > > instead of .bss. > > Please note that I didn't touch other variables, e.g., > tsc_is_broken, because I knew that. However, I just wanted to do > that *explicitly*. Anyway, it is reverted now and SVN will remember > what I wanted to do. ;-) > > BTW, if my memory serves, GCC (and all modern C compilers) put(s) > zero-initialized variables back in .bss. I just tried it. GCC generates identical binaries as I thought. However, Clang doesn't do the optimization. :-/ Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 23:07:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4862106566C; Fri, 3 Dec 2010 23:07:46 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFF198FC15; Fri, 3 Dec 2010 23:07:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3N7kgu045966; Fri, 3 Dec 2010 23:07:46 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3N7jh7045871; Fri, 3 Dec 2010 23:07:45 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201012032307.oB3N7jh7045871@svn.freebsd.org> From: "Simon L. Nielsen" Date: Fri, 3 Dec 2010 23:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216167 - in head/secure: lib/libcrypto lib/libcrypto/man lib/libssl/man usr.bin/openssl/man X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 23:07:46 -0000 Author: simon Date: Fri Dec 3 23:07:45 2010 New Revision: 216167 URL: http://svn.freebsd.org/changeset/base/216167 Log: Regenerate manual pages for OpenSSL 0.9.8q. Modified: head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/bio.3 head/secure/lib/libcrypto/man/blowfish.3 head/secure/lib/libcrypto/man/bn.3 head/secure/lib/libcrypto/man/bn_internal.3 head/secure/lib/libcrypto/man/buffer.3 head/secure/lib/libcrypto/man/crypto.3 head/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 head/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 head/secure/lib/libcrypto/man/d2i_X509_CRL.3 head/secure/lib/libcrypto/man/d2i_X509_NAME.3 head/secure/lib/libcrypto/man/d2i_X509_REQ.3 head/secure/lib/libcrypto/man/d2i_X509_SIG.3 head/secure/lib/libcrypto/man/des.3 head/secure/lib/libcrypto/man/dh.3 head/secure/lib/libcrypto/man/dsa.3 head/secure/lib/libcrypto/man/ecdsa.3 head/secure/lib/libcrypto/man/engine.3 head/secure/lib/libcrypto/man/err.3 head/secure/lib/libcrypto/man/evp.3 head/secure/lib/libcrypto/man/hmac.3 head/secure/lib/libcrypto/man/lh_stats.3 head/secure/lib/libcrypto/man/lhash.3 head/secure/lib/libcrypto/man/md5.3 head/secure/lib/libcrypto/man/mdc2.3 head/secure/lib/libcrypto/man/pem.3 head/secure/lib/libcrypto/man/rand.3 head/secure/lib/libcrypto/man/rc4.3 head/secure/lib/libcrypto/man/ripemd.3 head/secure/lib/libcrypto/man/rsa.3 head/secure/lib/libcrypto/man/sha.3 head/secure/lib/libcrypto/man/threads.3 head/secure/lib/libcrypto/man/ui.3 head/secure/lib/libcrypto/man/ui_compat.3 head/secure/lib/libcrypto/man/x509.3 head/secure/lib/libssl/man/SSL_CIPHER_get_name.3 head/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 head/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libssl/man/SSL_CTX_add_session.3 head/secure/lib/libssl/man/SSL_CTX_ctrl.3 head/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 head/secure/lib/libssl/man/SSL_CTX_free.3 head/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libssl/man/SSL_CTX_new.3 head/secure/lib/libssl/man/SSL_CTX_sess_number.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libssl/man/SSL_CTX_sessions.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libssl/man/SSL_CTX_set_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_options.3 head/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libssl/man/SSL_CTX_set_timeout.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_verify.3 head/secure/lib/libssl/man/SSL_CTX_use_certificate.3 head/secure/lib/libssl/man/SSL_SESSION_free.3 head/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_SESSION_get_time.3 head/secure/lib/libssl/man/SSL_accept.3 head/secure/lib/libssl/man/SSL_alert_type_string.3 head/secure/lib/libssl/man/SSL_clear.3 head/secure/lib/libssl/man/SSL_connect.3 head/secure/lib/libssl/man/SSL_do_handshake.3 head/secure/lib/libssl/man/SSL_free.3 head/secure/lib/libssl/man/SSL_get_SSL_CTX.3 head/secure/lib/libssl/man/SSL_get_ciphers.3 head/secure/lib/libssl/man/SSL_get_client_CA_list.3 head/secure/lib/libssl/man/SSL_get_current_cipher.3 head/secure/lib/libssl/man/SSL_get_default_timeout.3 head/secure/lib/libssl/man/SSL_get_error.3 head/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 head/secure/lib/libssl/man/SSL_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_get_fd.3 head/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 head/secure/lib/libssl/man/SSL_get_peer_certificate.3 head/secure/lib/libssl/man/SSL_get_rbio.3 head/secure/lib/libssl/man/SSL_get_session.3 head/secure/lib/libssl/man/SSL_get_verify_result.3 head/secure/lib/libssl/man/SSL_get_version.3 head/secure/lib/libssl/man/SSL_library_init.3 head/secure/lib/libssl/man/SSL_load_client_CA_file.3 head/secure/lib/libssl/man/SSL_new.3 head/secure/lib/libssl/man/SSL_pending.3 head/secure/lib/libssl/man/SSL_read.3 head/secure/lib/libssl/man/SSL_rstate_string.3 head/secure/lib/libssl/man/SSL_session_reused.3 head/secure/lib/libssl/man/SSL_set_bio.3 head/secure/lib/libssl/man/SSL_set_connect_state.3 head/secure/lib/libssl/man/SSL_set_fd.3 head/secure/lib/libssl/man/SSL_set_session.3 head/secure/lib/libssl/man/SSL_set_shutdown.3 head/secure/lib/libssl/man/SSL_set_verify_result.3 head/secure/lib/libssl/man/SSL_shutdown.3 head/secure/lib/libssl/man/SSL_state_string.3 head/secure/lib/libssl/man/SSL_want.3 head/secure/lib/libssl/man/SSL_write.3 head/secure/lib/libssl/man/d2i_SSL_SESSION.3 head/secure/lib/libssl/man/ssl.3 head/secure/usr.bin/openssl/man/CA.pl.1 head/secure/usr.bin/openssl/man/asn1parse.1 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/ciphers.1 head/secure/usr.bin/openssl/man/crl.1 head/secure/usr.bin/openssl/man/crl2pkcs7.1 head/secure/usr.bin/openssl/man/dgst.1 head/secure/usr.bin/openssl/man/dhparam.1 head/secure/usr.bin/openssl/man/dsa.1 head/secure/usr.bin/openssl/man/dsaparam.1 head/secure/usr.bin/openssl/man/ec.1 head/secure/usr.bin/openssl/man/ecparam.1 head/secure/usr.bin/openssl/man/enc.1 head/secure/usr.bin/openssl/man/errstr.1 head/secure/usr.bin/openssl/man/gendsa.1 head/secure/usr.bin/openssl/man/genrsa.1 head/secure/usr.bin/openssl/man/nseq.1 head/secure/usr.bin/openssl/man/ocsp.1 head/secure/usr.bin/openssl/man/openssl.1 head/secure/usr.bin/openssl/man/passwd.1 head/secure/usr.bin/openssl/man/pkcs12.1 head/secure/usr.bin/openssl/man/pkcs7.1 head/secure/usr.bin/openssl/man/pkcs8.1 head/secure/usr.bin/openssl/man/rand.1 head/secure/usr.bin/openssl/man/req.1 head/secure/usr.bin/openssl/man/rsa.1 head/secure/usr.bin/openssl/man/rsautl.1 head/secure/usr.bin/openssl/man/s_client.1 head/secure/usr.bin/openssl/man/s_server.1 head/secure/usr.bin/openssl/man/s_time.1 head/secure/usr.bin/openssl/man/sess_id.1 head/secure/usr.bin/openssl/man/smime.1 head/secure/usr.bin/openssl/man/speed.1 head/secure/usr.bin/openssl/man/spkac.1 head/secure/usr.bin/openssl/man/verify.1 head/secure/usr.bin/openssl/man/version.1 head/secure/usr.bin/openssl/man/x509.1 head/secure/usr.bin/openssl/man/x509v3_config.1 Modified: head/secure/lib/libcrypto/Makefile.inc ============================================================================== --- head/secure/lib/libcrypto/Makefile.inc Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/Makefile.inc Fri Dec 3 23:07:45 2010 (r216167) @@ -3,8 +3,8 @@ .include # OpenSSL version used for manual page generation -OPENSSL_VER= 0.9.8p -OPENSSL_DATE= 2010-11-16 +OPENSSL_VER= 0.9.8q +OPENSSL_DATE= 2010-12-02 LCRYPTO_SRC= ${.CURDIR}/../../../crypto/openssl LCRYPTO_DOC= ${.CURDIR}/../../../crypto/openssl/doc Modified: head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_OBJECT_new 3" -.TH ASN1_OBJECT_new 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH ASN1_OBJECT_new 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/ASN1_STRING_length.3 ============================================================================== --- head/secure/lib/libcrypto/man/ASN1_STRING_length.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/ASN1_STRING_length.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_length 3" -.TH ASN1_STRING_length 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH ASN1_STRING_length 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/ASN1_STRING_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/ASN1_STRING_new.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/ASN1_STRING_new.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_new 3" -.TH ASN1_STRING_new 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH ASN1_STRING_new 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 ============================================================================== --- head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_print_ex 3" -.TH ASN1_STRING_print_ex 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH ASN1_STRING_print_ex 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 ============================================================================== --- head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_generate_nconf 3" -.TH ASN1_generate_nconf 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH ASN1_generate_nconf 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_ctrl.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_ctrl.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_ctrl.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_ctrl 3" -.TH BIO_ctrl 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_ctrl 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_f_base64.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_f_base64.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_f_base64.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_f_base64 3" -.TH BIO_f_base64 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_f_base64 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_f_buffer.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_f_buffer.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_f_buffer.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_f_buffer 3" -.TH BIO_f_buffer 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_f_buffer 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_f_cipher.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_f_cipher.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_f_cipher.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_f_cipher 3" -.TH BIO_f_cipher 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_f_cipher 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_f_md.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_f_md.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_f_md.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_f_md 3" -.TH BIO_f_md 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_f_md 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_f_null.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_f_null.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_f_null.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_f_null 3" -.TH BIO_f_null 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_f_null 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_f_ssl.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_f_ssl.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_f_ssl.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_f_ssl 3" -.TH BIO_f_ssl 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_f_ssl 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_find_type.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_find_type.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_find_type.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_find_type 3" -.TH BIO_find_type 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_find_type 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_new.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_new.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_new 3" -.TH BIO_new 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_new 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_push.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_push.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_push.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_push 3" -.TH BIO_push 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_push 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_read.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_read.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_read.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_read 3" -.TH BIO_read 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_read 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_s_accept.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_accept.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_s_accept.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_accept 3" -.TH BIO_s_accept 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_s_accept 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_s_bio.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_bio.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_s_bio.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_bio 3" -.TH BIO_s_bio 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_s_bio 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_s_connect.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_connect.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_s_connect.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_connect 3" -.TH BIO_s_connect 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_s_connect 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_s_fd.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_fd.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_s_fd.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_fd 3" -.TH BIO_s_fd 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_s_fd 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_s_file.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_file.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_s_file.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_file 3" -.TH BIO_s_file 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_s_file 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_s_mem.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_mem.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_s_mem.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_mem 3" -.TH BIO_s_mem 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_s_mem 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_s_null.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_null.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_s_null.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_null 3" -.TH BIO_s_null 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_s_null 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_s_socket.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_socket.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_s_socket.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_socket 3" -.TH BIO_s_socket 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_s_socket 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_set_callback.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_set_callback.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_set_callback.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_set_callback 3" -.TH BIO_set_callback 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_set_callback 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BIO_should_retry.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_should_retry.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BIO_should_retry.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BIO_should_retry 3" -.TH BIO_should_retry 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BIO_should_retry 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_BLINDING_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_BLINDING_new.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_BLINDING_new.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_BLINDING_new 3" -.TH BN_BLINDING_new 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_BLINDING_new 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_CTX_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_CTX_new.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_CTX_new.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_CTX_new 3" -.TH BN_CTX_new 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_CTX_new 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_CTX_start.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_CTX_start.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_CTX_start.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_CTX_start 3" -.TH BN_CTX_start 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_CTX_start 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_add.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_add.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_add.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_add 3" -.TH BN_add 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_add 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_add_word.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_add_word.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_add_word.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_add_word 3" -.TH BN_add_word 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_add_word 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_bn2bin.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_bn2bin.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_bn2bin.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_bn2bin 3" -.TH BN_bn2bin 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_bn2bin 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_cmp.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_cmp.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_cmp.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_cmp 3" -.TH BN_cmp 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_cmp 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_copy.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_copy.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_copy.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_copy 3" -.TH BN_copy 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_copy 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_generate_prime.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_generate_prime.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_generate_prime.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_generate_prime 3" -.TH BN_generate_prime 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_generate_prime 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_mod_inverse.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_mod_inverse.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_mod_inverse.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_mod_inverse 3" -.TH BN_mod_inverse 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_mod_inverse 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_mod_mul_montgomery 3" -.TH BN_mod_mul_montgomery 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_mod_mul_montgomery 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_mod_mul_reciprocal 3" -.TH BN_mod_mul_reciprocal 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_mod_mul_reciprocal 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_new.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_new.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_new 3" -.TH BN_new 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_new 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_num_bytes.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_num_bytes.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_num_bytes.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_num_bytes 3" -.TH BN_num_bytes 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_num_bytes 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_rand.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_rand.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_rand.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_rand 3" -.TH BN_rand 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_rand 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_set_bit.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_set_bit.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_set_bit.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_set_bit 3" -.TH BN_set_bit 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_set_bit 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_swap.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_swap.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_swap.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_swap 3" -.TH BN_swap 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_swap 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/BN_zero.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_zero.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/BN_zero.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "BN_zero 3" -.TH BN_zero 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH BN_zero 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/CONF_modules_free.3 ============================================================================== --- head/secure/lib/libcrypto/man/CONF_modules_free.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/CONF_modules_free.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "CONF_modules_free 3" -.TH CONF_modules_free 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH CONF_modules_free 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/CONF_modules_load_file.3 ============================================================================== --- head/secure/lib/libcrypto/man/CONF_modules_load_file.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/CONF_modules_load_file.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "CONF_modules_load_file 3" -.TH CONF_modules_load_file 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH CONF_modules_load_file 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 ============================================================================== --- head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "CRYPTO_set_ex_data 3" -.TH CRYPTO_set_ex_data 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH CRYPTO_set_ex_data 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DH_generate_key.3 ============================================================================== --- head/secure/lib/libcrypto/man/DH_generate_key.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DH_generate_key.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DH_generate_key 3" -.TH DH_generate_key 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DH_generate_key 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DH_generate_parameters.3 ============================================================================== --- head/secure/lib/libcrypto/man/DH_generate_parameters.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DH_generate_parameters.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DH_generate_parameters 3" -.TH DH_generate_parameters 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DH_generate_parameters 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 ============================================================================== --- head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DH_get_ex_new_index 3" -.TH DH_get_ex_new_index 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DH_get_ex_new_index 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DH_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/DH_new.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DH_new.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DH_new 3" -.TH DH_new 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DH_new 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DH_set_method.3 ============================================================================== --- head/secure/lib/libcrypto/man/DH_set_method.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DH_set_method.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DH_set_method 3" -.TH DH_set_method 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DH_set_method 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DH_size.3 ============================================================================== --- head/secure/lib/libcrypto/man/DH_size.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DH_size.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DH_size 3" -.TH DH_size 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DH_size 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DSA_SIG_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/DSA_SIG_new.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DSA_SIG_new.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DSA_SIG_new 3" -.TH DSA_SIG_new 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DSA_SIG_new 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DSA_do_sign.3 ============================================================================== --- head/secure/lib/libcrypto/man/DSA_do_sign.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DSA_do_sign.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DSA_do_sign 3" -.TH DSA_do_sign 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DSA_do_sign 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DSA_dup_DH.3 ============================================================================== --- head/secure/lib/libcrypto/man/DSA_dup_DH.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DSA_dup_DH.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DSA_dup_DH 3" -.TH DSA_dup_DH 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DSA_dup_DH 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DSA_generate_key.3 ============================================================================== --- head/secure/lib/libcrypto/man/DSA_generate_key.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DSA_generate_key.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DSA_generate_key 3" -.TH DSA_generate_key 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DSA_generate_key 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DSA_generate_parameters.3 ============================================================================== --- head/secure/lib/libcrypto/man/DSA_generate_parameters.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DSA_generate_parameters.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DSA_generate_parameters 3" -.TH DSA_generate_parameters 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DSA_generate_parameters 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 ============================================================================== --- head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DSA_get_ex_new_index 3" -.TH DSA_get_ex_new_index 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DSA_get_ex_new_index 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DSA_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/DSA_new.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DSA_new.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DSA_new 3" -.TH DSA_new 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DSA_new 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DSA_set_method.3 ============================================================================== --- head/secure/lib/libcrypto/man/DSA_set_method.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DSA_set_method.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DSA_set_method 3" -.TH DSA_set_method 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DSA_set_method 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DSA_sign.3 ============================================================================== --- head/secure/lib/libcrypto/man/DSA_sign.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DSA_sign.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DSA_sign 3" -.TH DSA_sign 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DSA_sign 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/DSA_size.3 ============================================================================== --- head/secure/lib/libcrypto/man/DSA_size.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/DSA_size.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "DSA_size 3" -.TH DSA_size 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH DSA_size 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/ERR_GET_LIB.3 ============================================================================== --- head/secure/lib/libcrypto/man/ERR_GET_LIB.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/ERR_GET_LIB.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "ERR_GET_LIB 3" -.TH ERR_GET_LIB 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH ERR_GET_LIB 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/ERR_clear_error.3 ============================================================================== --- head/secure/lib/libcrypto/man/ERR_clear_error.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/ERR_clear_error.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "ERR_clear_error 3" -.TH ERR_clear_error 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH ERR_clear_error 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/ERR_error_string.3 ============================================================================== --- head/secure/lib/libcrypto/man/ERR_error_string.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/ERR_error_string.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "ERR_error_string 3" -.TH ERR_error_string 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH ERR_error_string 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/ERR_get_error.3 ============================================================================== --- head/secure/lib/libcrypto/man/ERR_get_error.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/ERR_get_error.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "ERR_get_error 3" -.TH ERR_get_error 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH ERR_get_error 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 ============================================================================== --- head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "ERR_load_crypto_strings 3" -.TH ERR_load_crypto_strings 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH ERR_load_crypto_strings 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/ERR_load_strings.3 ============================================================================== --- head/secure/lib/libcrypto/man/ERR_load_strings.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/ERR_load_strings.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "ERR_load_strings 3" -.TH ERR_load_strings 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH ERR_load_strings 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/ERR_print_errors.3 ============================================================================== --- head/secure/lib/libcrypto/man/ERR_print_errors.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/ERR_print_errors.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "ERR_print_errors 3" -.TH ERR_print_errors 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH ERR_print_errors 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/ERR_put_error.3 ============================================================================== --- head/secure/lib/libcrypto/man/ERR_put_error.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/ERR_put_error.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "ERR_put_error 3" -.TH ERR_put_error 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH ERR_put_error 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/ERR_remove_state.3 ============================================================================== --- head/secure/lib/libcrypto/man/ERR_remove_state.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/ERR_remove_state.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "ERR_remove_state 3" -.TH ERR_remove_state 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH ERR_remove_state 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/ERR_set_mark.3 ============================================================================== --- head/secure/lib/libcrypto/man/ERR_set_mark.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/ERR_set_mark.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "ERR_set_mark 3" -.TH ERR_set_mark 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH ERR_set_mark 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/EVP_BytesToKey.3 ============================================================================== --- head/secure/lib/libcrypto/man/EVP_BytesToKey.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/EVP_BytesToKey.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "EVP_BytesToKey 3" -.TH EVP_BytesToKey 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH EVP_BytesToKey 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/EVP_DigestInit.3 ============================================================================== --- head/secure/lib/libcrypto/man/EVP_DigestInit.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/EVP_DigestInit.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "EVP_DigestInit 3" -.TH EVP_DigestInit 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH EVP_DigestInit 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/EVP_EncryptInit.3 ============================================================================== --- head/secure/lib/libcrypto/man/EVP_EncryptInit.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/EVP_EncryptInit.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "EVP_EncryptInit 3" -.TH EVP_EncryptInit 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH EVP_EncryptInit 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/EVP_OpenInit.3 ============================================================================== --- head/secure/lib/libcrypto/man/EVP_OpenInit.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/EVP_OpenInit.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "EVP_OpenInit 3" -.TH EVP_OpenInit 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH EVP_OpenInit 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/EVP_PKEY_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/EVP_PKEY_new.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/EVP_PKEY_new.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "EVP_PKEY_new 3" -.TH EVP_PKEY_new 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH EVP_PKEY_new 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 ============================================================================== --- head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "EVP_PKEY_set1_RSA 3" -.TH EVP_PKEY_set1_RSA 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH EVP_PKEY_set1_RSA 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/EVP_SealInit.3 ============================================================================== --- head/secure/lib/libcrypto/man/EVP_SealInit.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/EVP_SealInit.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "EVP_SealInit 3" -.TH EVP_SealInit 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH EVP_SealInit 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/EVP_SignInit.3 ============================================================================== --- head/secure/lib/libcrypto/man/EVP_SignInit.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/EVP_SignInit.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "EVP_SignInit 3" -.TH EVP_SignInit 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH EVP_SignInit 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/EVP_VerifyInit.3 ============================================================================== --- head/secure/lib/libcrypto/man/EVP_VerifyInit.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/EVP_VerifyInit.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "EVP_VerifyInit 3" -.TH EVP_VerifyInit 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH EVP_VerifyInit 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/OBJ_nid2obj.3 ============================================================================== --- head/secure/lib/libcrypto/man/OBJ_nid2obj.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/OBJ_nid2obj.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "OBJ_nid2obj 3" -.TH OBJ_nid2obj 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH OBJ_nid2obj 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/OPENSSL_Applink.3 ============================================================================== --- head/secure/lib/libcrypto/man/OPENSSL_Applink.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/OPENSSL_Applink.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "OPENSSL_Applink 3" -.TH OPENSSL_Applink 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH OPENSSL_Applink 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 ============================================================================== --- head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "OPENSSL_VERSION_NUMBER 3" -.TH OPENSSL_VERSION_NUMBER 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH OPENSSL_VERSION_NUMBER 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/OPENSSL_config.3 ============================================================================== --- head/secure/lib/libcrypto/man/OPENSSL_config.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/OPENSSL_config.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "OPENSSL_config 3" -.TH OPENSSL_config 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH OPENSSL_config 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 ============================================================================== --- head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "OPENSSL_ia32cap 3" -.TH OPENSSL_ia32cap 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH OPENSSL_ia32cap 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 ============================================================================== --- head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "OPENSSL_load_builtin_modules 3" -.TH OPENSSL_load_builtin_modules 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH OPENSSL_load_builtin_modules 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 ============================================================================== --- head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "OpenSSL_add_all_algorithms 3" -.TH OpenSSL_add_all_algorithms 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH OpenSSL_add_all_algorithms 3 "2010-12-02" "0.9.8q" "OpenSSL" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l Modified: head/secure/lib/libcrypto/man/PKCS12_create.3 ============================================================================== --- head/secure/lib/libcrypto/man/PKCS12_create.3 Fri Dec 3 22:59:54 2010 (r216166) +++ head/secure/lib/libcrypto/man/PKCS12_create.3 Fri Dec 3 23:07:45 2010 (r216167) @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "PKCS12_create 3" -.TH PKCS12_create 3 "2010-11-16" "0.9.8p" "OpenSSL" +.TH PKCS12_create 3 "2010-12-02" "0.9.8q" "OpenSSL" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 23:17:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id EB8EA106564A; Fri, 3 Dec 2010 23:17:32 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Fri, 3 Dec 2010 18:17:16 -0500 User-Agent: KMail/1.6.2 References: <201012032154.oB3LsADC035461@svn.freebsd.org> <201012031744.01956.jkim@FreeBSD.org> <201012031802.40083.jkim@FreeBSD.org> In-Reply-To: <201012031802.40083.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201012031817.23834.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216161 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 23:17:33 -0000 On Friday 03 December 2010 06:02 pm, Jung-uk Kim wrote: > On Friday 03 December 2010 05:43 pm, Jung-uk Kim wrote: > > On Friday 03 December 2010 05:08 pm, John Baldwin wrote: > > > On Friday, December 03, 2010 4:54:10 pm Jung-uk Kim wrote: > > > > Author: jkim > > > > Date: Fri Dec 3 21:54:10 2010 > > > > New Revision: 216161 > > > > URL: http://svn.freebsd.org/changeset/base/216161 > > > > > > > > Log: > > > > Explicitly initialize TSC frequency. To calibrate TSC > > > > frequency, we use DELAY(9) and it may use TSC in turn if TSC > > > > frequency is non-zero. > > > > > > We zero the BSS, so these were already zero. This just makes > > > the actual kernel file on disk larger by wasting space in .data > > > instead of .bss. > > > > Please note that I didn't touch other variables, e.g., > > tsc_is_broken, because I knew that. However, I just wanted to do > > that *explicitly*. Anyway, it is reverted now and SVN will > > remember what I wanted to do. ;-) > > > > BTW, if my memory serves, GCC (and all modern C compilers) put(s) > > zero-initialized variables back in .bss. > > I just tried it. GCC generates identical binaries as I thought. > However, Clang doesn't do the optimization. :-/ Strangely, Clang increases .bss when a global variable is explicitly initialized to zero. - 2 .bss 00000004 0000000000000000 0000000000000000 00000540 2**2 + 2 .bss 00000014 0000000000000000 0000000000000000 00000540 2**3 8-) Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Fri Dec 3 23:24:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 447BD106564A; Fri, 3 Dec 2010 23:24:28 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18FC58FC19; Fri, 3 Dec 2010 23:24:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB3NORGn048468; Fri, 3 Dec 2010 23:24:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB3NORq4048465; Fri, 3 Dec 2010 23:24:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012032324.oB3NORq4048465@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 3 Dec 2010 23:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216168 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2010 23:24:28 -0000 Author: jilles Date: Fri Dec 3 23:24:27 2010 New Revision: 216168 URL: http://svn.freebsd.org/changeset/base/216168 Log: sh(1): Clean up documentation of built-in commands. Make sure all built-in commands are in the subsection named such, except exp, let and wordexp which are deliberately undocumented. The text said only built-ins that really need to be a built-in were documented there but in fact almost all of them were already documented. Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Fri Dec 3 23:07:45 2010 (r216167) +++ head/bin/sh/sh.1 Fri Dec 3 23:24:27 2010 (r216168) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd December 1, 2010 +.Dd December 3, 2010 .Dt SH 1 .Os .Sh NAME @@ -1593,12 +1593,7 @@ To include a .Ql - , make it the first or last character listed. .Ss Built-in Commands -This section lists the commands which -are built-in because they need to perform some operation -that cannot be performed by a separate process. -In addition to -these, built-in versions of essential utilities -are provided for efficiency. +This section lists the built-in commands. .Bl -tag -width indent .It Ic \&: A null command that returns a 0 (true) exit value. @@ -1649,15 +1644,19 @@ subsection. Continue the specified jobs (or the current job if no jobs are given) in the background. +.It Ic bind Oo Fl aeklrsv Oc Oo Ar key Oo Ar command Oc Oc +List or alter key bindings for the line editor. +This command is documented in +.Xr editrc 5 . +.It Ic break Op Ar num +See the +.Sx Flow-Control Constructs +subsection. .It Ic builtin Ar cmd Op Ar arg ... Execute the specified built-in command, .Ar cmd . This is useful when the user wishes to override a shell function with the same name as a built-in command. -.It Ic bind Oo Fl aeklrsv Oc Oo Ar key Oo Ar command Oc Oc -List or alter key bindings for the line editor. -This command is documented in -.Xr editrc 5 . .It Ic cd Oo Fl L | P Oc Op Ar directory Switch to the specified .Ar directory , @@ -1759,6 +1758,10 @@ a shell keyword or an alias for .Ar value . +.It Ic continue Op Ar num +See the +.Sx Flow-Control Constructs +subsection. .It Ic echo Oo Fl e | n Oc Op Ar string ... Print a space-separated list of the arguments to the standard output and append a newline character. From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 01:43:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 957D4106566C; Sat, 4 Dec 2010 01:43:38 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 841EE8FC17; Sat, 4 Dec 2010 01:43:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB41hcwI065478; Sat, 4 Dec 2010 01:43:38 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB41hcfH065476; Sat, 4 Dec 2010 01:43:38 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201012040143.oB41hcfH065476@svn.freebsd.org> From: Jack F Vogel Date: Sat, 4 Dec 2010 01:43:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216171 - head/sys/dev/ixgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 01:43:38 -0000 Author: jfv Date: Sat Dec 4 01:43:38 2010 New Revision: 216171 URL: http://svn.freebsd.org/changeset/base/216171 Log: This small little change is a bug that drove me nuts finding. The test to compare the mbuf m_len against a fixed value and then returning needs to be removed. When using VLANS and doing HW_TAGGING, and IPV6, the ICMP6 packets actually fail this condition, the constant assumes that the tag is IN the frame, and its not, so the length is actually tiny. Furthermore, I'm not sure what the point was to just return?? MFC after: 3 days Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sat Dec 4 00:43:21 2010 (r216170) +++ head/sys/dev/ixgbe/ixgbe.c Sat Dec 4 01:43:38 2010 (r216171) @@ -46,7 +46,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.3.6"; +char ixgbe_driver_version[] = "2.3.7"; /********************************************************************* * PCI Device ID Table @@ -3023,16 +3023,12 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, case ETHERTYPE_IP: ip = (struct ip *)(mp->m_data + ehdrlen); ip_hlen = ip->ip_hl << 2; - if (mp->m_len < ehdrlen + ip_hlen) - return (FALSE); ipproto = ip->ip_p; type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4; break; case ETHERTYPE_IPV6: ip6 = (struct ip6_hdr *)(mp->m_data + ehdrlen); ip_hlen = sizeof(struct ip6_hdr); - if (mp->m_len < ehdrlen + ip_hlen) - return (FALSE); ipproto = ip6->ip6_nxt; type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6; break; From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 01:59:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF06D106566C; Sat, 4 Dec 2010 01:59:58 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD3F48FC0A; Sat, 4 Dec 2010 01:59:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB41xwj2067779; Sat, 4 Dec 2010 01:59:58 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB41xw4r067777; Sat, 4 Dec 2010 01:59:58 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201012040159.oB41xw4r067777@svn.freebsd.org> From: Jack F Vogel Date: Sat, 4 Dec 2010 01:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216172 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 01:59:58 -0000 Author: jfv Date: Sat Dec 4 01:59:58 2010 New Revision: 216172 URL: http://svn.freebsd.org/changeset/base/216172 Log: Small cut and paste bug in flow control string fixed. Second, correct the discard/refresh_mbufs code to behave more like igb, there have been panics due to discards and this should fix them. MFC after: 3 days Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sat Dec 4 01:43:38 2010 (r216171) +++ head/sys/dev/e1000/if_em.c Sat Dec 4 01:59:58 2010 (r216172) @@ -525,7 +525,7 @@ em_attach(device_t dev) /* Sysctl for setting the interface flow control */ em_set_flow_cntrl(adapter, "flow_control", - "max number of rx packets to process", + "configure flow control", &adapter->fc_setting, em_fc_setting); /* @@ -3751,46 +3751,43 @@ em_refresh_mbufs(struct rx_ring *rxr, in cleaned = -1; while (i != limit) { rxbuf = &rxr->rx_buffers[i]; - /* - ** Just skip entries with a buffer, - ** they can only be due to an error - ** and are to be reused. - */ - if (rxbuf->m_head != NULL) - goto reuse; - m = m_getjcl(M_DONTWAIT, MT_DATA, - M_PKTHDR, adapter->rx_mbuf_sz); - /* - ** If we have a temporary resource shortage - ** that causes a failure, just abort refresh - ** for now, we will return to this point when - ** reinvoked from em_rxeof. - */ - if (m == NULL) - goto update; + if (rxbuf->m_head == NULL) { + m = m_getjcl(M_DONTWAIT, MT_DATA, + M_PKTHDR, adapter->rx_mbuf_sz); + /* + ** If we have a temporary resource shortage + ** that causes a failure, just abort refresh + ** for now, we will return to this point when + ** reinvoked from em_rxeof. + */ + if (m == NULL) + goto update; + } else + m = rxbuf->m_head; + m->m_len = m->m_pkthdr.len = adapter->rx_mbuf_sz; + m->m_flags |= M_PKTHDR; + m->m_data = m->m_ext.ext_buf; /* Use bus_dma machinery to setup the memory mapping */ error = bus_dmamap_load_mbuf_sg(rxr->rxtag, rxbuf->map, m, segs, &nsegs, BUS_DMA_NOWAIT); if (error != 0) { + printf("Refresh mbufs: hdr dmamap load" + " failure - %d\n", error); m_free(m); + rxbuf->m_head = NULL; goto update; } - - /* If nsegs is wrong then the stack is corrupt. */ - KASSERT(nsegs == 1, ("Too many segments returned!")); - + rxbuf->m_head = m; bus_dmamap_sync(rxr->rxtag, rxbuf->map, BUS_DMASYNC_PREREAD); - rxbuf->m_head = m; rxr->rx_base[i].buffer_addr = htole64(segs[0].ds_addr); -reuse: + cleaned = i; /* Calculate next index */ if (++i == adapter->num_rx_desc) i = 0; - /* This is the work marker for refresh */ rxr->next_to_refresh = i; } update: @@ -4208,8 +4205,8 @@ em_rxeof(struct rx_ring *rxr, int count, len = le16toh(cur->length); eop = (status & E1000_RXD_STAT_EOP) != 0; - if ((rxr->discard == TRUE) || (cur->errors & - E1000_RXD_ERR_FRAME_ERR_MASK)) { + if ((cur->errors & E1000_RXD_ERR_FRAME_ERR_MASK) || + (rxr->discard == TRUE)) { ifp->if_ierrors++; ++rxr->rx_discarded; if (!eop) /* Catch subsequent segs */ @@ -4308,7 +4305,6 @@ em_rx_discard(struct rx_ring *rxr, int i { struct adapter *adapter = rxr->adapter; struct em_buffer *rbuf; - struct mbuf *m; rbuf = &rxr->rx_buffers[i]; /* Free any previous pieces */ @@ -4318,14 +4314,14 @@ em_rx_discard(struct rx_ring *rxr, int i rxr->fmp = NULL; rxr->lmp = NULL; } - - /* Reset state, keep loaded DMA map and reuse */ - m = rbuf->m_head; - m->m_len = m->m_pkthdr.len = adapter->rx_mbuf_sz; - m->m_flags |= M_PKTHDR; - m->m_data = m->m_ext.ext_buf; - m->m_next = NULL; - + /* + ** Free buffer and allow em_refresh_mbufs() + ** to clean up and recharge buffer. + */ + if (rbuf->m_head) { + m_free(rbuf->m_head); + rbuf->m_head = NULL; + } return; } From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 02:04:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF3D5106566B; Sat, 4 Dec 2010 02:04:02 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDF258FC0A; Sat, 4 Dec 2010 02:04:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB42422K068422; Sat, 4 Dec 2010 02:04:02 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB4242ZE068420; Sat, 4 Dec 2010 02:04:02 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201012040204.oB4242ZE068420@svn.freebsd.org> From: Jack F Vogel Date: Sat, 4 Dec 2010 02:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216173 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 02:04:03 -0000 Author: jfv Date: Sat Dec 4 02:04:02 2010 New Revision: 216173 URL: http://svn.freebsd.org/changeset/base/216173 Log: Remove the bogus test in the TX context setup for IPV6, the size can be smaller than the constant when you are doing HW TAGGING, and you still need to process this packet in a normal way. I'm not sure where the notion to just return came from, but its wrong. MFC after: 3 days Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Sat Dec 4 01:59:58 2010 (r216172) +++ head/sys/dev/e1000/if_igb.c Sat Dec 4 02:04:02 2010 (r216173) @@ -3429,8 +3429,6 @@ igb_tx_ctx_setup(struct tx_ring *txr, st case ETHERTYPE_IPV6: ip6 = (struct ip6_hdr *)(mp->m_data + ehdrlen); ip_hlen = sizeof(struct ip6_hdr); - if (mp->m_len < ehdrlen + ip_hlen) - return (FALSE); ipproto = ip6->ip6_nxt; type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_IPV6; break; From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 02:42:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5417D106566C; Sat, 4 Dec 2010 02:42:53 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40B0F8FC18; Sat, 4 Dec 2010 02:42:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB42grWp074103; Sat, 4 Dec 2010 02:42:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB42gr3u074097; Sat, 4 Dec 2010 02:42:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201012040242.oB42gr3u074097@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 4 Dec 2010 02:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216174 - in head/sys: conf powerpc/aim powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 02:42:53 -0000 Author: nwhitehorn Date: Sat Dec 4 02:42:52 2010 New Revision: 216174 URL: http://svn.freebsd.org/changeset/base/216174 Log: Add an abstraction layer to the 64-bit AIM MMU's page table manipulation logic to support modifying the page table through a hypervisor. This uses KOBJ inheritance to provide subclasses of the base 64-bit AIM MMU class with additional methods for page table manipulation. Many thanks to Peter Grehan for suggesting this design and implementing the MMU KOBJ inheritance mechanism. Added: head/sys/powerpc/aim/mmu_oea64.h (contents, props changed) head/sys/powerpc/aim/moea64_if.m (contents, props changed) head/sys/powerpc/aim/moea64_native.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/include/pmap.h Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Dec 4 02:04:02 2010 (r216173) +++ head/sys/conf/files.powerpc Sat Dec 4 02:42:52 2010 (r216174) @@ -83,6 +83,8 @@ powerpc/aim/locore.S optional aim no-ob powerpc/aim/machdep.c optional aim powerpc/aim/mmu_oea.c optional aim powerpc 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/ofwmagic.S optional aim Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Sat Dec 4 02:04:02 2010 (r216173) +++ head/sys/powerpc/aim/mmu_oea.c Sat Dec 4 02:42:52 2010 (r216174) @@ -161,24 +161,6 @@ __FBSDID("$FreeBSD$"); #define VSID_TO_SR(vsid) ((vsid) & 0xf) #define VSID_TO_HASH(vsid) (((vsid) >> 4) & 0xfffff) -#define PVO_PTEGIDX_MASK 0x007 /* which PTEG slot */ -#define PVO_PTEGIDX_VALID 0x008 /* slot is valid */ -#define PVO_WIRED 0x010 /* PVO entry is wired */ -#define PVO_MANAGED 0x020 /* PVO entry is managed */ -#define PVO_EXECUTABLE 0x040 /* PVO entry is executable */ -#define PVO_BOOTSTRAP 0x080 /* PVO entry allocated during - bootstrap */ -#define PVO_FAKE 0x100 /* fictitious phys page */ -#define PVO_VADDR(pvo) ((pvo)->pvo_vaddr & ~ADDR_POFF) -#define PVO_ISEXECUTABLE(pvo) ((pvo)->pvo_vaddr & PVO_EXECUTABLE) -#define PVO_ISFAKE(pvo) ((pvo)->pvo_vaddr & PVO_FAKE) -#define PVO_PTEGIDX_GET(pvo) ((pvo)->pvo_vaddr & PVO_PTEGIDX_MASK) -#define PVO_PTEGIDX_ISSET(pvo) ((pvo)->pvo_vaddr & PVO_PTEGIDX_VALID) -#define PVO_PTEGIDX_CLR(pvo) \ - ((void)((pvo)->pvo_vaddr &= ~(PVO_PTEGIDX_VALID|PVO_PTEGIDX_MASK))) -#define PVO_PTEGIDX_SET(pvo, i) \ - ((void)((pvo)->pvo_vaddr |= (i)|PVO_PTEGIDX_VALID)) - #define MOEA_PVO_CHECK(pvo) struct ofw_map { Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sat Dec 4 02:04:02 2010 (r216173) +++ head/sys/powerpc/aim/mmu_oea64.c Sat Dec 4 02:42:52 2010 (r216174) @@ -155,79 +155,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include "mmu_oea64.h" #include "mmu_if.h" +#include "moea64_if.h" -#define MOEA_DEBUG - -#define TODO panic("%s: not implemented", __func__); void moea64_release_vsid(uint64_t vsid); uintptr_t moea64_get_unique_vsid(void); -static __inline register_t -cntlzd(volatile register_t a) { - register_t b; - __asm ("cntlzd %0, %1" : "=r"(b) : "r"(a)); - return b; -} - -#define PTESYNC() __asm __volatile("ptesync"); -#define TLBSYNC() __asm __volatile("tlbsync; ptesync"); -#define SYNC() __asm __volatile("sync"); -#define EIEIO() __asm __volatile("eieio"); - -/* - * The tlbie instruction must be executed in 64-bit mode - * so we have to twiddle MSR[SF] around every invocation. - * Just to add to the fun, exceptions must be off as well - * so that we can't trap in 64-bit mode. What a pain. - */ -struct mtx tlbie_mutex; - -static __inline void -TLBIE(uint64_t vpn) { -#ifndef __powerpc64__ - register_t vpn_hi, vpn_lo; - register_t msr; - register_t scratch; -#endif - - vpn <<= ADDR_PIDX_SHFT; - vpn &= ~(0xffffULL << 48); - - mtx_lock_spin(&tlbie_mutex); -#ifdef __powerpc64__ - __asm __volatile("\ - ptesync; \ - tlbie %0; \ - eieio; \ - tlbsync; \ - ptesync;" - :: "r"(vpn) : "memory"); -#else - vpn_hi = (uint32_t)(vpn >> 32); - vpn_lo = (uint32_t)vpn; - - __asm __volatile("\ - mfmsr %0; \ - mr %1, %0; \ - insrdi %1,%5,1,0; \ - mtmsrd %1; isync; \ - ptesync; \ - \ - sld %1,%2,%4; \ - or %1,%1,%3; \ - tlbie %1; \ - \ - mtmsrd %0; isync; \ - eieio; \ - tlbsync; \ - ptesync;" - : "=r"(msr), "=r"(scratch) : "r"(vpn_hi), "r"(vpn_lo), "r"(32), "r"(1) - : "memory"); -#endif - mtx_unlock_spin(&tlbie_mutex); -} - #define DISABLE_TRANS(msr) msr = mfmsr(); mtmsr(msr & ~PSL_DR); isync() #define ENABLE_TRANS(msr) mtmsr(msr); isync() @@ -235,24 +169,6 @@ TLBIE(uint64_t vpn) { #define VSID_TO_HASH(vsid) (((vsid) >> 4) & 0xfffff) #define VSID_HASH_MASK 0x0000007fffffffffULL -#define PVO_PTEGIDX_MASK 0x007UL /* which PTEG slot */ -#define PVO_PTEGIDX_VALID 0x008UL /* slot is valid */ -#define PVO_WIRED 0x010UL /* PVO entry is wired */ -#define PVO_MANAGED 0x020UL /* PVO entry is managed */ -#define PVO_BOOTSTRAP 0x080UL /* PVO entry allocated during - bootstrap */ -#define PVO_FAKE 0x100UL /* fictitious phys page */ -#define PVO_LARGE 0x200UL /* large page */ -#define PVO_VADDR(pvo) ((pvo)->pvo_vaddr & ~ADDR_POFF) -#define PVO_ISFAKE(pvo) ((pvo)->pvo_vaddr & PVO_FAKE) -#define PVO_PTEGIDX_GET(pvo) ((pvo)->pvo_vaddr & PVO_PTEGIDX_MASK) -#define PVO_PTEGIDX_ISSET(pvo) ((pvo)->pvo_vaddr & PVO_PTEGIDX_VALID) -#define PVO_PTEGIDX_CLR(pvo) \ - ((void)((pvo)->pvo_vaddr &= ~(PVO_PTEGIDX_VALID|PVO_PTEGIDX_MASK))) -#define PVO_PTEGIDX_SET(pvo, i) \ - ((void)((pvo)->pvo_vaddr |= (i)|PVO_PTEGIDX_VALID)) -#define PVO_VSID(pvo) ((pvo)->pvo_vpn >> 16) - #define MOEA_PVO_CHECK(pvo) #define LOCK_TABLE() mtx_lock(&moea64_table_mutex) @@ -277,7 +193,6 @@ static int regions_sz, pregions_sz; extern void bs_remap_earlyboot(void); - /* * Lock for the pteg and pvo tables. */ @@ -287,7 +202,6 @@ struct mtx moea64_slb_mutex; /* * PTEG data. */ -static struct lpteg *moea64_pteg_table; u_int moea64_pteg_count; u_int moea64_pteg_mask; @@ -337,8 +251,8 @@ SYSCTL_INT(_machdep, OID_AUTO, moea64_pv &moea64_pvo_remove_calls, 0, ""); vm_offset_t moea64_scratchpage_va[2]; -uint64_t moea64_scratchpage_vpn[2]; -struct lpte *moea64_scratchpage_pte[2]; +struct pvo_entry *moea64_scratchpage_pvo[2]; +uintptr_t moea64_scratchpage_pte[2]; struct mtx moea64_scratchpage_mtx; uint64_t moea64_large_page_mask = 0; @@ -346,41 +260,23 @@ int moea64_large_page_size = 0; int moea64_large_page_shift = 0; /* - * Allocate physical memory for use in moea64_bootstrap. - */ -static vm_offset_t moea64_bootstrap_alloc(vm_size_t, u_int); - -/* - * PTE calls. - */ -static int moea64_pte_insert(u_int, struct lpte *); - -/* * PVO calls. */ -static int moea64_pvo_enter(pmap_t, uma_zone_t, struct pvo_head *, +static int moea64_pvo_enter(mmu_t, pmap_t, uma_zone_t, struct pvo_head *, vm_offset_t, vm_offset_t, uint64_t, int); -static void moea64_pvo_remove(struct pvo_entry *); +static void moea64_pvo_remove(mmu_t, struct pvo_entry *); static struct pvo_entry *moea64_pvo_find_va(pmap_t, vm_offset_t); -static struct lpte *moea64_pvo_to_pte(const struct pvo_entry *); /* * Utility routines. */ -static void moea64_bootstrap(mmu_t mmup, - vm_offset_t kernelstart, vm_offset_t kernelend); -static void moea64_cpu_bootstrap(mmu_t, int ap); -static void moea64_enter_locked(pmap_t, vm_offset_t, vm_page_t, - vm_prot_t, boolean_t); -static boolean_t moea64_query_bit(vm_page_t, u_int64_t); -static u_int moea64_clear_bit(vm_page_t, u_int64_t); +static void moea64_enter_locked(mmu_t, pmap_t, vm_offset_t, + vm_page_t, vm_prot_t, boolean_t); +static boolean_t moea64_query_bit(mmu_t, vm_page_t, u_int64_t); +static u_int moea64_clear_bit(mmu_t, vm_page_t, u_int64_t); static void moea64_kremove(mmu_t, vm_offset_t); -static void moea64_syncicache(pmap_t pmap, vm_offset_t va, +static void moea64_syncicache(mmu_t, pmap_t pmap, vm_offset_t va, vm_offset_t pa, vm_size_t sz); -static void tlbia(void); -#ifdef __powerpc64__ -static void slbia(void); -#endif /* * Kernel MMU interface @@ -463,8 +359,6 @@ static mmu_method_t moea64_methods[] = { MMUMETHOD(mmu_page_set_memattr, moea64_page_set_memattr), /* Internal interfaces */ - MMUMETHOD(mmu_bootstrap, moea64_bootstrap), - MMUMETHOD(mmu_cpu_bootstrap, moea64_cpu_bootstrap), MMUMETHOD(mmu_mapdev, moea64_mapdev), MMUMETHOD(mmu_mapdev_attr, moea64_mapdev_attr), MMUMETHOD(mmu_unmapdev, moea64_unmapdev), @@ -476,7 +370,7 @@ static mmu_method_t moea64_methods[] = { { 0, 0 } }; -MMU_DEF(oea64_mmu, MMU_TYPE_G5, moea64_methods, 0); +MMU_DEF(oea64_mmu, "mmu_oea64_base", moea64_methods, 0); static __inline u_int va_to_pteg(uint64_t vsid, vm_offset_t addr, int large) @@ -542,81 +436,6 @@ moea64_pte_create(struct lpte *pt, uint6 pt->pte_lo = pte_lo; } -static __inline void -moea64_pte_synch(struct lpte *pt, struct lpte *pvo_pt) -{ - - ASSERT_TABLE_LOCK(); - - pvo_pt->pte_lo |= pt->pte_lo & (LPTE_REF | LPTE_CHG); -} - -static __inline void -moea64_pte_clear(struct lpte *pt, uint64_t vpn, u_int64_t ptebit) -{ - ASSERT_TABLE_LOCK(); - - /* - * As shown in Section 7.6.3.2.3 - */ - pt->pte_lo &= ~ptebit; - TLBIE(vpn); -} - -static __inline void -moea64_pte_set(struct lpte *pt, struct lpte *pvo_pt) -{ - - ASSERT_TABLE_LOCK(); - pvo_pt->pte_hi |= LPTE_VALID; - - /* - * Update the PTE as defined in section 7.6.3.1. - * Note that the REF/CHG bits are from pvo_pt and thus should have - * been saved so this routine can restore them (if desired). - */ - pt->pte_lo = pvo_pt->pte_lo; - EIEIO(); - pt->pte_hi = pvo_pt->pte_hi; - PTESYNC(); - moea64_pte_valid++; -} - -static __inline void -moea64_pte_unset(struct lpte *pt, struct lpte *pvo_pt, uint64_t vpn) -{ - ASSERT_TABLE_LOCK(); - pvo_pt->pte_hi &= ~LPTE_VALID; - - /* - * Force the reg & chg bits back into the PTEs. - */ - SYNC(); - - /* - * Invalidate the pte. - */ - pt->pte_hi &= ~LPTE_VALID; - TLBIE(vpn); - - /* - * Save the reg & chg bits. - */ - moea64_pte_synch(pt, pvo_pt); - moea64_pte_valid--; -} - -static __inline void -moea64_pte_change(struct lpte *pt, struct lpte *pvo_pt, uint64_t vpn) -{ - - /* - * Invalidate the PTE - */ - moea64_pte_unset(pt, pvo_pt, vpn); - moea64_pte_set(pt, pvo_pt); -} - static __inline uint64_t moea64_calc_wimg(vm_offset_t pa, vm_memattr_t ma) { @@ -696,49 +515,6 @@ om_cmp(const void *a, const void *b) } static void -moea64_cpu_bootstrap(mmu_t mmup, int ap) -{ - int i = 0; - #ifdef __powerpc64__ - struct slb *slb = PCPU_GET(slb); - #endif - - /* - * Initialize segment registers and MMU - */ - - mtmsr(mfmsr() & ~PSL_DR & ~PSL_IR); isync(); - - /* - * Install kernel SLB entries - */ - - #ifdef __powerpc64__ - slbia(); - - for (i = 0; i < 64; i++) { - if (!(slb[i].slbe & SLBE_VALID)) - continue; - - __asm __volatile ("slbmte %0, %1" :: - "r"(slb[i].slbv), "r"(slb[i].slbe)); - } - #else - for (i = 0; i < 16; i++) - mtsrin(i << ADDR_SR_SHFT, kernel_pmap->pm_sr[i]); - #endif - - /* - * Install page table - */ - - __asm __volatile ("ptesync; mtsdr1 %0; isync" - :: "r"((uintptr_t)moea64_pteg_table - | (64 - cntlzd(moea64_pteg_mask >> 11)))); - tlbia(); -} - -static void moea64_add_ofw_mappings(mmu_t mmup, phandle_t mmu, size_t sz) { struct ofw_map translations[sz/sizeof(struct ofw_map)]; @@ -874,7 +650,7 @@ moea64_setup_direct_map(mmu_t mmup, vm_o pregions[i].mr_start + pregions[i].mr_size) pte_lo |= LPTE_G; - moea64_pvo_enter(kernel_pmap, moea64_upvo_zone, + moea64_pvo_enter(mmup, kernel_pmap, moea64_upvo_zone, &moea64_pvo_kunmanaged, pa, pa, pte_lo, PVO_WIRED | PVO_LARGE | VM_PROT_EXECUTE); @@ -882,10 +658,6 @@ moea64_setup_direct_map(mmu_t mmup, vm_o } PMAP_UNLOCK(kernel_pmap); } else { - size = moea64_pteg_count * sizeof(struct lpteg); - off = (vm_offset_t)(moea64_pteg_table); - for (pa = off; pa < off + size; pa += PAGE_SIZE) - moea64_kenter(mmup, pa, pa); size = sizeof(struct pvo_head) * moea64_pteg_count; off = (vm_offset_t)(moea64_pvo_table); for (pa = off; pa < off + size; pa += PAGE_SIZE) @@ -911,18 +683,11 @@ moea64_setup_direct_map(mmu_t mmup, vm_o ENABLE_TRANS(msr); } -static void -moea64_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend) +void +moea64_early_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend) { - ihandle_t mmui; - phandle_t chosen; - phandle_t mmu; - size_t sz; int i, j; - vm_size_t size, physsz, hwphyssz; - vm_offset_t pa, va; - register_t msr; - void *dpcpu; + vm_size_t physsz, hwphyssz; #ifndef __powerpc64__ /* We don't have a direct map since there is no BAT */ @@ -1009,9 +774,6 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t physmem = btoc(physsz); - /* - * Allocate PTEG table. - */ #ifdef PTEGCOUNT moea64_pteg_count = PTEGCOUNT; #else @@ -1022,27 +784,20 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t moea64_pteg_count >>= 1; #endif /* PTEGCOUNT */ +} - size = moea64_pteg_count * sizeof(struct lpteg); - CTR2(KTR_PMAP, "moea64_bootstrap: %d PTEGs, %d bytes", - moea64_pteg_count, size); +void +moea64_mid_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend) +{ + vm_size_t size; + register_t msr; + int i; /* - * We now need to allocate memory. This memory, to be allocated, - * has to reside in a page table. The page table we are about to - * allocate. We don't have BAT. So drop to data real mode for a minute - * as a measure of last resort. We do this a couple times. + * Set PTEG mask */ - - moea64_pteg_table = (struct lpteg *)moea64_bootstrap_alloc(size, size); - DISABLE_TRANS(msr); - bzero((void *)moea64_pteg_table, moea64_pteg_count * sizeof(struct lpteg)); - ENABLE_TRANS(msr); - moea64_pteg_mask = moea64_pteg_count - 1; - CTR1(KTR_PMAP, "moea64_bootstrap: PTEG table at %p", moea64_pteg_table); - /* * Allocate pv/overflow lists. */ @@ -1066,11 +821,6 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t mtx_init(&moea64_slb_mutex, "SLB table", NULL, MTX_DEF); /* - * Initialize the TLBIE lock. TLBIE can only be executed by one CPU. - */ - mtx_init(&tlbie_mutex, "tlbie mutex", NULL, MTX_SPIN); - - /* * Initialise the unmanaged pvo pool. */ moea64_bpvo_pool = (struct pvo_entry *)moea64_bootstrap_alloc( @@ -1109,6 +859,18 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t */ moea64_setup_direct_map(mmup, kernelstart, kernelend); +} + +void +moea64_late_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend) +{ + ihandle_t mmui; + phandle_t chosen; + phandle_t mmu; + size_t sz; + int i; + vm_offset_t pa, va; + void *dpcpu; /* * Set up the Open Firmware pmap and add its mappings if not in real @@ -1137,7 +899,7 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t /* * Initialize MMU and remap early physical mappings */ - moea64_cpu_bootstrap(mmup,0); + MMU_CPU_BOOTSTRAP(mmup,0); mtmsr(mfmsr() | PSL_DR | PSL_IR); isync(); pmap_bootstrapped++; bs_remap_earlyboot(); @@ -1173,47 +935,6 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t #endif /* - * Allocate some things for page zeroing. We put this directly - * in the page table, marked with LPTE_LOCKED, to avoid any - * of the PVO book-keeping or other parts of the VM system - * from even knowing that this hack exists. - */ - - if (!hw_direct_map) { - mtx_init(&moea64_scratchpage_mtx, "pvo zero page", NULL, - MTX_DEF); - for (i = 0; i < 2; i++) { - struct lpte pt; - uint64_t vsid; - int pteidx, ptegidx; - - moea64_scratchpage_va[i] = (virtual_end+1) - PAGE_SIZE; - virtual_end -= PAGE_SIZE; - - LOCK_TABLE(); - - vsid = va_to_vsid(kernel_pmap, - moea64_scratchpage_va[i]); - moea64_pte_create(&pt, vsid, moea64_scratchpage_va[i], - LPTE_NOEXEC, 0); - pt.pte_hi |= LPTE_LOCKED; - - moea64_scratchpage_vpn[i] = (vsid << 16) | - ((moea64_scratchpage_va[i] & ADDR_PIDX) >> - ADDR_PIDX_SHFT); - ptegidx = va_to_pteg(vsid, moea64_scratchpage_va[i], 0); - pteidx = moea64_pte_insert(ptegidx, &pt); - if (pt.pte_hi & LPTE_HID) - ptegidx ^= moea64_pteg_mask; - - moea64_scratchpage_pte[i] = - &moea64_pteg_table[ptegidx].pt[pteidx]; - - UNLOCK_TABLE(); - } - } - - /* * Allocate a kernel stack with a guard page for thread0 and map it * into the kernel page map. */ @@ -1255,6 +976,36 @@ moea64_bootstrap(mmu_t mmup, vm_offset_t va += PAGE_SIZE; } dpcpu_init(dpcpu, 0); + + /* + * Allocate some things for page zeroing. We put this directly + * in the page table, marked with LPTE_LOCKED, to avoid any + * of the PVO book-keeping or other parts of the VM system + * from even knowing that this hack exists. + */ + + if (!hw_direct_map) { + mtx_init(&moea64_scratchpage_mtx, "pvo zero page", NULL, + MTX_DEF); + for (i = 0; i < 2; i++) { + moea64_scratchpage_va[i] = (virtual_end+1) - PAGE_SIZE; + virtual_end -= PAGE_SIZE; + + moea64_kenter(mmup, moea64_scratchpage_va[i], 0); + + moea64_scratchpage_pvo[i] = moea64_pvo_find_va( + kernel_pmap, (vm_offset_t)moea64_scratchpage_va[i]); + LOCK_TABLE(); + moea64_scratchpage_pte[i] = MOEA64_PVO_TO_PTE( + mmup, moea64_scratchpage_pvo[i]); + moea64_scratchpage_pvo[i]->pvo_pte.lpte.pte_hi + |= LPTE_LOCKED; + MOEA64_PTE_CHANGE(mmup, moea64_scratchpage_pte[i], + &moea64_scratchpage_pvo[i]->pvo_pte.lpte, + moea64_scratchpage_pvo[i]->pvo_vpn); + UNLOCK_TABLE(); + } + } } /* @@ -1294,7 +1045,7 @@ void moea64_change_wiring(mmu_t mmu, pmap_t pm, vm_offset_t va, boolean_t wired) { struct pvo_entry *pvo; - struct lpte *pt; + uintptr_t pt; uint64_t vsid; int i, ptegidx; @@ -1303,7 +1054,7 @@ moea64_change_wiring(mmu_t mmu, pmap_t p if (pvo != NULL) { LOCK_TABLE(); - pt = moea64_pvo_to_pte(pvo); + pt = MOEA64_PVO_TO_PTE(mmu, pvo); if (wired) { if ((pvo->pvo_vaddr & PVO_WIRED) == 0) @@ -1317,9 +1068,9 @@ moea64_change_wiring(mmu_t mmu, pmap_t p pvo->pvo_pte.lpte.pte_hi &= ~LPTE_WIRED; } - if (pt != NULL) { + if (pt != -1) { /* Update wiring flag in page table. */ - moea64_pte_change(pt, &pvo->pvo_pte.lpte, + MOEA64_PTE_CHANGE(mmu, pt, &pvo->pvo_pte.lpte, pvo->pvo_vpn); } else if (wired) { /* @@ -1330,7 +1081,8 @@ moea64_change_wiring(mmu_t mmu, pmap_t p ptegidx = va_to_pteg(vsid, PVO_VADDR(pvo), pvo->pvo_vaddr & PVO_LARGE); - i = moea64_pte_insert(ptegidx, &pvo->pvo_pte.lpte); + i = MOEA64_PTE_INSERT(mmu, ptegidx, &pvo->pvo_pte.lpte); + if (i >= 0) { PVO_PTEGIDX_CLR(pvo); PVO_PTEGIDX_SET(pvo, i); @@ -1350,22 +1102,18 @@ moea64_change_wiring(mmu_t mmu, pmap_t p */ static __inline -void moea64_set_scratchpage_pa(int which, vm_offset_t pa) { +void moea64_set_scratchpage_pa(mmu_t mmup, int which, vm_offset_t pa) { KASSERT(!hw_direct_map, ("Using OEA64 scratchpage with a direct map!")); mtx_assert(&moea64_scratchpage_mtx, MA_OWNED); - moea64_scratchpage_pte[which]->pte_hi &= ~LPTE_VALID; - TLBIE(moea64_scratchpage_vpn[which]); - - moea64_scratchpage_pte[which]->pte_lo &= + moea64_scratchpage_pvo[which]->pvo_pte.lpte.pte_lo &= ~(LPTE_WIMG | LPTE_RPGN); - moea64_scratchpage_pte[which]->pte_lo |= + moea64_scratchpage_pvo[which]->pvo_pte.lpte.pte_lo |= moea64_calc_wimg(pa, VM_MEMATTR_DEFAULT) | (uint64_t)pa; - EIEIO(); - - moea64_scratchpage_pte[which]->pte_hi |= LPTE_VALID; - PTESYNC(); isync(); + MOEA64_PTE_CHANGE(mmup, moea64_scratchpage_pte[which], + &moea64_scratchpage_pvo[which]->pvo_pte.lpte, + moea64_scratchpage_pvo[which]->pvo_vpn); } void @@ -1382,8 +1130,8 @@ moea64_copy_page(mmu_t mmu, vm_page_t ms } else { mtx_lock(&moea64_scratchpage_mtx); - moea64_set_scratchpage_pa(0,src); - moea64_set_scratchpage_pa(1,dst); + moea64_set_scratchpage_pa(mmu, 0, src); + moea64_set_scratchpage_pa(mmu, 1, dst); kcopy((void *)moea64_scratchpage_va[0], (void *)moea64_scratchpage_va[1], PAGE_SIZE); @@ -1406,7 +1154,7 @@ moea64_zero_page_area(mmu_t mmu, vm_page bzero((caddr_t)pa + off, size); } else { mtx_lock(&moea64_scratchpage_mtx); - moea64_set_scratchpage_pa(0,pa); + moea64_set_scratchpage_pa(mmu, 0, pa); bzero((caddr_t)moea64_scratchpage_va[0] + off, size); mtx_unlock(&moea64_scratchpage_mtx); } @@ -1427,7 +1175,7 @@ moea64_zero_page(mmu_t mmu, vm_page_t m) if (!hw_direct_map) { mtx_lock(&moea64_scratchpage_mtx); - moea64_set_scratchpage_pa(0,pa); + moea64_set_scratchpage_pa(mmu, 0, pa); va = moea64_scratchpage_va[0]; } else { va = pa; @@ -1459,7 +1207,7 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_ vm_page_lock_queues(); PMAP_LOCK(pmap); - moea64_enter_locked(pmap, va, m, prot, wired); + moea64_enter_locked(mmu, pmap, va, m, prot, wired); vm_page_unlock_queues(); PMAP_UNLOCK(pmap); } @@ -1473,8 +1221,8 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_ */ static void -moea64_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, - boolean_t wired) +moea64_enter_locked(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m, + vm_prot_t prot, boolean_t wired) { struct pvo_head *pvo_head; uma_zone_t zone; @@ -1528,20 +1276,20 @@ moea64_enter_locked(pmap_t pmap, vm_offs if ((m->flags & PG_FICTITIOUS) != 0) pvo_flags |= PVO_FAKE; - error = moea64_pvo_enter(pmap, zone, pvo_head, va, VM_PAGE_TO_PHYS(m), - pte_lo, pvo_flags); + error = moea64_pvo_enter(mmu, pmap, zone, pvo_head, va, + VM_PAGE_TO_PHYS(m), pte_lo, pvo_flags); /* * Flush the page from the instruction cache if this page is * mapped executable and cacheable. */ - if ((pte_lo & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { - moea64_syncicache(pmap, va, VM_PAGE_TO_PHYS(m), PAGE_SIZE); - } + if ((pte_lo & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) + moea64_syncicache(mmu, pmap, va, VM_PAGE_TO_PHYS(m), PAGE_SIZE); } static void -moea64_syncicache(pmap_t pmap, vm_offset_t va, vm_offset_t pa, vm_size_t sz) +moea64_syncicache(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_offset_t pa, + vm_size_t sz) { /* @@ -1568,7 +1316,7 @@ moea64_syncicache(pmap_t pmap, vm_offset mtx_lock(&moea64_scratchpage_mtx); - moea64_set_scratchpage_pa(1,pa & ~ADDR_POFF); + moea64_set_scratchpage_pa(mmu, 1, pa & ~ADDR_POFF); __syncicache((void *)(moea64_scratchpage_va[1] + (va & ADDR_POFF)), sz); @@ -1600,7 +1348,7 @@ moea64_enter_object(mmu_t mmu, pmap_t pm vm_page_lock_queues(); PMAP_LOCK(pm); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { - moea64_enter_locked(pm, start + ptoa(diff), m, prot & + moea64_enter_locked(mmu, pm, start + ptoa(diff), m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); m = TAILQ_NEXT(m, listq); } @@ -1615,8 +1363,8 @@ moea64_enter_quick(mmu_t mmu, pmap_t pm, vm_page_lock_queues(); PMAP_LOCK(pm); - moea64_enter_locked(pm, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), - FALSE); + moea64_enter_locked(mmu, pm, va, m, + prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); vm_page_unlock_queues(); PMAP_UNLOCK(pm); } @@ -1669,6 +1417,8 @@ retry: return (m); } +static mmu_t installed_mmu; + static void * moea64_uma_page_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) { @@ -1709,7 +1459,7 @@ moea64_uma_page_alloc(uma_zone_t zone, i va = VM_PAGE_TO_PHYS(m); - moea64_pvo_enter(kernel_pmap, moea64_upvo_zone, + moea64_pvo_enter(installed_mmu, kernel_pmap, moea64_upvo_zone, &moea64_pvo_kunmanaged, va, VM_PAGE_TO_PHYS(m), LPTE_M, PVO_WIRED | PVO_BOOTSTRAP); @@ -1736,6 +1486,7 @@ moea64_init(mmu_t mmu) UMA_ZONE_VM | UMA_ZONE_NOFREE); if (!hw_direct_map) { + installed_mmu = mmu; uma_zone_set_allocf(moea64_upvo_zone,moea64_uma_page_alloc); uma_zone_set_allocf(moea64_mpvo_zone,moea64_uma_page_alloc); } @@ -1749,7 +1500,7 @@ moea64_is_referenced(mmu_t mmu, vm_page_ KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, ("moea64_is_referenced: page %p is not managed", m)); - return (moea64_query_bit(m, PTE_REF)); + return (moea64_query_bit(mmu, m, PTE_REF)); } boolean_t @@ -1768,7 +1519,7 @@ moea64_is_modified(mmu_t mmu, vm_page_t if ((m->oflags & VPO_BUSY) == 0 && (m->flags & PG_WRITEABLE) == 0) return (FALSE); - return (moea64_query_bit(m, LPTE_CHG)); + return (moea64_query_bit(mmu, m, LPTE_CHG)); } boolean_t @@ -1790,7 +1541,7 @@ moea64_clear_reference(mmu_t mmu, vm_pag KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, ("moea64_clear_reference: page %p is not managed", m)); - moea64_clear_bit(m, LPTE_REF); + moea64_clear_bit(mmu, m, LPTE_REF); } void @@ -1810,7 +1561,7 @@ moea64_clear_modify(mmu_t mmu, vm_page_t */ if ((m->flags & PG_WRITEABLE) == 0) return; - moea64_clear_bit(m, LPTE_CHG); + moea64_clear_bit(mmu, m, LPTE_CHG); } /* @@ -1820,7 +1571,7 @@ void moea64_remove_write(mmu_t mmu, vm_page_t m) { struct pvo_entry *pvo; - struct lpte *pt; + uintptr_t pt; pmap_t pmap; uint64_t lo; @@ -1838,21 +1589,21 @@ moea64_remove_write(mmu_t mmu, vm_page_t return; vm_page_lock_queues(); lo = moea64_attr_fetch(m); - SYNC(); + powerpc_sync(); LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { pmap = pvo->pvo_pmap; PMAP_LOCK(pmap); LOCK_TABLE(); if ((pvo->pvo_pte.lpte.pte_lo & LPTE_PP) != LPTE_BR) { - pt = moea64_pvo_to_pte(pvo); + pt = MOEA64_PVO_TO_PTE(mmu, pvo); pvo->pvo_pte.lpte.pte_lo &= ~LPTE_PP; pvo->pvo_pte.lpte.pte_lo |= LPTE_BR; - if (pt != NULL) { - moea64_pte_synch(pt, &pvo->pvo_pte.lpte); + if (pt != -1) { + MOEA64_PTE_SYNCH(mmu, pt, &pvo->pvo_pte.lpte); lo |= pvo->pvo_pte.lpte.pte_lo; pvo->pvo_pte.lpte.pte_lo &= ~LPTE_CHG; - moea64_pte_change(pt, &pvo->pvo_pte.lpte, - pvo->pvo_vpn); + MOEA64_PTE_CHANGE(mmu, pt, + &pvo->pvo_pte.lpte, pvo->pvo_vpn); if (pvo->pvo_pmap == kernel_pmap) isync(); } @@ -1886,7 +1637,7 @@ moea64_ts_referenced(mmu_t mmu, vm_page_ KASSERT((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0, ("moea64_ts_referenced: page %p is not managed", m)); - return (moea64_clear_bit(m, LPTE_REF)); + return (moea64_clear_bit(mmu, m, LPTE_REF)); } /* @@ -1897,7 +1648,7 @@ moea64_page_set_memattr(mmu_t mmu, vm_pa { struct pvo_entry *pvo; struct pvo_head *pvo_head; - struct lpte *pt; + uintptr_t pt; pmap_t pmap; uint64_t lo; @@ -1913,11 +1664,11 @@ moea64_page_set_memattr(mmu_t mmu, vm_pa pmap = pvo->pvo_pmap; PMAP_LOCK(pmap); LOCK_TABLE(); - pt = moea64_pvo_to_pte(pvo); + pt = MOEA64_PVO_TO_PTE(mmu, pvo); pvo->pvo_pte.lpte.pte_lo &= ~LPTE_WIMG; pvo->pvo_pte.lpte.pte_lo |= lo; - if (pt != NULL) { - moea64_pte_change(pt, &pvo->pvo_pte.lpte, + if (pt != -1) { + MOEA64_PTE_CHANGE(mmu, pt, &pvo->pvo_pte.lpte, pvo->pvo_vpn); if (pvo->pvo_pmap == kernel_pmap) isync(); @@ -1941,7 +1692,7 @@ moea64_kenter_attr(mmu_t mmu, vm_offset_ pte_lo = moea64_calc_wimg(pa, ma); PMAP_LOCK(kernel_pmap); - error = moea64_pvo_enter(kernel_pmap, moea64_upvo_zone, + error = moea64_pvo_enter(mmu, kernel_pmap, moea64_upvo_zone, &moea64_pvo_kunmanaged, va, pa, pte_lo, PVO_WIRED | VM_PROT_EXECUTE); @@ -1952,9 +1703,8 @@ moea64_kenter_attr(mmu_t mmu, vm_offset_ /* * Flush the memory from the instruction cache. */ - if ((pte_lo & (LPTE_I | LPTE_G)) == 0) { + if ((pte_lo & (LPTE_I | LPTE_G)) == 0) __syncicache((void *)va, PAGE_SIZE); - } PMAP_UNLOCK(kernel_pmap); } @@ -2183,7 +1933,7 @@ moea64_protect(mmu_t mmu, pmap_t pm, vm_ vm_prot_t prot) { struct pvo_entry *pvo; - struct lpte *pt; + uintptr_t pt; CTR4(KTR_PMAP, "moea64_protect: pm=%p sva=%#x eva=%#x prot=%#x", pm, sva, eva, prot); @@ -2209,7 +1959,7 @@ moea64_protect(mmu_t mmu, pmap_t pm, vm_ * copy. */ LOCK_TABLE(); - pt = moea64_pvo_to_pte(pvo); + pt = MOEA64_PVO_TO_PTE(mmu, pvo); /* * Change the protection of the page. @@ -2223,11 +1973,12 @@ moea64_protect(mmu_t mmu, pmap_t pm, vm_ /* * If the PVO is in the page table, update that pte as well. */ - if (pt != NULL) { - moea64_pte_change(pt, &pvo->pvo_pte.lpte, pvo->pvo_vpn); + if (pt != -1) { + MOEA64_PTE_CHANGE(mmu, pt, &pvo->pvo_pte.lpte, + pvo->pvo_vpn); if ((pvo->pvo_pte.lpte.pte_lo & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { - moea64_syncicache(pm, sva, + moea64_syncicache(mmu, pm, sva, pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN, PAGE_SIZE); } @@ -2314,7 +2065,7 @@ moea64_remove(mmu_t mmu, pmap_t pm, vm_o for (; sva < eva; sva += PAGE_SIZE) { pvo = moea64_pvo_find_va(pm, sva); if (pvo != NULL) - moea64_pvo_remove(pvo); + moea64_pvo_remove(mmu, pvo); } vm_page_unlock_queues(); PMAP_UNLOCK(pm); @@ -2339,7 +2090,7 @@ moea64_remove_all(mmu_t mmu, vm_page_t m MOEA_PVO_CHECK(pvo); /* sanity check */ pmap = pvo->pvo_pmap; PMAP_LOCK(pmap); - moea64_pvo_remove(pvo); + moea64_pvo_remove(mmu, pvo); PMAP_UNLOCK(pmap); } if ((m->flags & PG_WRITEABLE) && moea64_is_modified(mmu, m)) { @@ -2355,7 +2106,7 @@ moea64_remove_all(mmu_t mmu, vm_page_t m * Can only be called from moea64_bootstrap before avail start and end are * calculated. */ -static vm_offset_t +vm_offset_t moea64_bootstrap_alloc(vm_size_t size, u_int align) { vm_offset_t s, e; @@ -2396,53 +2147,10 @@ moea64_bootstrap_alloc(vm_size_t size, u panic("moea64_bootstrap_alloc: could not allocate memory"); } -static void -tlbia(void) -{ - vm_offset_t i; - #ifndef __powerpc64__ - register_t msr, scratch; - #endif - - TLBSYNC(); - - for (i = 0; i < 0xFF000; i += 0x00001000) { - #ifdef __powerpc64__ - __asm __volatile("tlbiel %0" :: "r"(i)); - #else - __asm __volatile("\ - mfmsr %0; \ - mr %1, %0; \ - insrdi %1,%3,1,0; \ - mtmsrd %1; \ - isync; \ - \ - tlbiel %2; \ - \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 05:58:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26DD41065672; Sat, 4 Dec 2010 05:58:57 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 116268FC2F; Sat, 4 Dec 2010 05:58:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB45wv8R087994; Sat, 4 Dec 2010 05:58:57 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB45wusF087976; Sat, 4 Dec 2010 05:58:56 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012040558.oB45wusF087976@svn.freebsd.org> From: Doug Barton Date: Sat, 4 Dec 2010 05:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216175 - in head/contrib/bind9: . bin/check bin/dig bin/named bin/named/include/named lib/dns lib/dns/include/dns lib/isc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 05:58:57 -0000 Author: dougb Date: Sat Dec 4 05:58:56 2010 New Revision: 216175 URL: http://svn.freebsd.org/changeset/base/216175 Log: Update to version 9.6-ESV-R3, the latest from ISC, which addresses the following security vulnerabilities. For more information regarding these issues please see: http://www.isc.org/announcement/guidance-regarding-dec-1st-2010-security-advisories 1. Cache incorrectly allows ncache and rrsig for the same type http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-3613 Affects resolver operators whose servers are open to potential attackers. Triggering the bug will cause the server to crash. This bug applies even if you do not have DNSSEC enabled. 2. Key algorithm rollover http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-3614 Affects resolver operators who are validating with DNSSEC, and querying zones which are in a key rollover period. The bug will cause answers to incorrectly be marked as insecure. Added: head/contrib/bind9/RELEASE-NOTES-BIND-9.6-ESV.html - copied unchanged from r216170, vendor/bind9/dist/RELEASE-NOTES-BIND-9.6-ESV.html head/contrib/bind9/RELEASE-NOTES-BIND-9.6-ESV.pdf - copied unchanged from r216170, vendor/bind9/dist/RELEASE-NOTES-BIND-9.6-ESV.pdf head/contrib/bind9/RELEASE-NOTES-BIND-9.6-ESV.txt - copied unchanged from r216170, vendor/bind9/dist/RELEASE-NOTES-BIND-9.6-ESV.txt head/contrib/bind9/release-notes.css - copied unchanged from r216170, vendor/bind9/dist/release-notes.css Modified: head/contrib/bind9/CHANGES head/contrib/bind9/bin/check/check-tool.c head/contrib/bind9/bin/check/check-tool.h head/contrib/bind9/bin/check/named-checkconf.c head/contrib/bind9/bin/check/named-checkzone.c head/contrib/bind9/bin/dig/host.c head/contrib/bind9/bin/named/client.c head/contrib/bind9/bin/named/include/named/query.h head/contrib/bind9/bin/named/query.c head/contrib/bind9/bin/named/server.c head/contrib/bind9/lib/dns/api head/contrib/bind9/lib/dns/include/dns/view.h head/contrib/bind9/lib/dns/journal.c head/contrib/bind9/lib/dns/rbtdb.c head/contrib/bind9/lib/dns/validator.c head/contrib/bind9/lib/dns/view.c head/contrib/bind9/lib/isc/api head/contrib/bind9/lib/isc/print.c head/contrib/bind9/version Directory Properties: head/contrib/bind9/ (props changed) Modified: head/contrib/bind9/CHANGES ============================================================================== --- head/contrib/bind9/CHANGES Sat Dec 4 02:42:52 2010 (r216174) +++ head/contrib/bind9/CHANGES Sat Dec 4 05:58:56 2010 (r216175) @@ -1,3 +1,55 @@ + + --- 9.6-ESV-R3 released --- + +2972. [bug] win32: address windows socket errors. [RT #21906] + +2971. [bug] Fixed a bug that caused journal files not to be + compacted on Windows systems as a result of + non-POSIX-compliant rename() semantics. [RT #22434] + +2970. [security] Adding a NO DATA negative cache entry failed to clear + any matching RRSIG records. A subsequent lookup of + of NO DATA cache entry could trigger a INSIST when the + unexpected RRSIG was also returned with the NO DATA + cache entry. + + CVE-2010-3613, VU#706148. [RT #22288] + +2969. [security] Fix acl type processing so that allow-query works + in options and view statements. Also add a new + set of tests to verify proper functioning. + + CVE-2010-3615, VU#510208. [RT #22418] + +2968. [security] Named could fail to prove a data set was insecure + before marking it as insecure. One set of conditions + that can trigger this occurs naturally when rolling + DNSKEY algorithms. + + CVE-2010-3614, VU#837744. [RT #22309] + +2967. [bug] 'host -D' now turns on debugging messages earlier. + [RT #22361] + +2966. [bug] isc_print_vsnprintf() failed to check if there was + space available in the buffer when adding a left + justified character with a non zero width, + (e.g. "%-1c"). [RT #22270] + +2964. [bug] view->queryacl was being overloaded. Seperate the + usage into view->queryacl, view->cacheacl and + view->queryonacl. [RT #22114] + +2962. [port] win32: add more dependencies to BINDBuild.dsw. + [RT #22062] + +2952. [port] win32: named-checkzone and named-checkconf failed + to initialise winsock. [RT #21932] + +2951. [bug] named failed to generate a correct signed response + in a optout, delegation only zone with no secure + delegations. [RT #22007] + --- 9.6-ESV-R2 released --- 2939. [func] Check that named successfully skips NSEC3 records Copied: head/contrib/bind9/RELEASE-NOTES-BIND-9.6-ESV.html (from r216170, vendor/bind9/dist/RELEASE-NOTES-BIND-9.6-ESV.html) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/bind9/RELEASE-NOTES-BIND-9.6-ESV.html Sat Dec 4 05:58:56 2010 (r216175, copy of r216170, vendor/bind9/dist/RELEASE-NOTES-BIND-9.6-ESV.html) @@ -0,0 +1,225 @@ + + + + + + +

+ +

Introduction

+ +

+ BIND 9.6-ESV-R3 is a maintenance release for BIND 9.6-ESV. +

+

+ This document summarizes changes from BIND 9.6-ESV-R1 to BIND 9.6-ESV-R3. + Please see the CHANGES file in the source code release for a + complete list of all changes. +

+
+ +

Download

+ +

+ The latest release of BIND 9 software can always be found + on our web site at + http://www.isc.org/software/bind. + There you will find additional information about each release, + source code, and some pre-compiled versions for certain operating + systems. +

+
+ +

Support

+ +

Product support information is available on + http://www.isc.org/services/support + for paid support options. Free support is provided by our user + community via a mailing list. Information on all public email + lists is available at + https://lists.isc.org/mailman/listinfo. +

+
+ +

New Features

+ +

9.6-ESV-R2

+ +

None.

+
+

9.6-ESV-R3

+ +

None.

+
+
+ +

Feature Changes

+ +

9.6-ESV-R2

+ +

None.

+
+

9.6-ESV-R3

+ +

None.

+
+
+ +

Security Fixes

+ +

9.6-ESV-R2

+ +

None.

+
+

9.6-ESV-R3

+ +
  • + Adding a NO DATA signed negative response to cache failed to clear + any matching RRSIG records already in cache. A subsequent lookup + of the cached NO DATA entry could crash named (INSIST) when the + unexpected RRSIG was also returned with the NO DATA cache entry. + [RT #22288] [CVE-2010-3613] [VU#706148] +
  • + BIND, acting as a DNSSEC validator, was determining if the NS RRset + is insecure based on a value that could mean either that the RRset + is actually insecure or that there wasn't a matching key for the RRSIG + in the DNSKEY RRset when resuming from validating the DNSKEY RRset. + This can happen when in the middle of a DNSKEY algorithm rollover, + when two different algorithms were used to sign a zone but only the + new set of keys are in the zone DNSKEY RRset. + [RT #22309] [CVE-2010-3614] [VU#837744] +
+
+
+ +

Bug Fixes

+ +

9.6-ESV-R2

+ +
  • + Check that named successfully skips NSEC3 records + that fail to match the NSEC3PARAM record currently + in use. + [RT #21868] +
  • + Worked around a race condition in the cache database memory + handling. Without this fix a DNS cache DB or ADB could + incorrectly stay in an over memory state, effectively refusing + further caching, which subsequently made a BIND 9 caching + server unworkable. + [RT #21818] +
  • + BIND did not properly handle non-cacheable negative responses + from insecure zones. This caused several non-protocol-compliant + zones to become unresolvable. BIND is now more accepting of + responses it receives from less strict servers. + [RT #21555] +
  • + The resolver could attempt to destroy a fetch context too + soon, resulting in a crash. + [RT #19878] +
  • + The placeholder negative caching element was not + properly constructed triggering a crash (INSIST) in + dns_ncache_towire(). + [RT #21346] +
  • + Handle the introduction of new trusted-keys and + DS, DLV RRsets better. + [RT #21097] +
  • + Fix arguments to dns_keytable_findnextkeynode() call. + [RT #20877] +
+
+

9.6-ESV-R3

+ +
  • + Microsoft changed the behavior of sockets between NT/XP based + stacks vs Vista/windows7 stacks. Server 2003/2008 have the older + behavior, 2008r2 has the new behavior. With the change, different + error results are possible, so ISC adapted BIND to handle the new + error results. + This resolves an issue where sockets would shut down on + Windows servers causing named to stop responding to queries. + [RT #21906] +
  • + Windows has non-POSIX compliant behavior in its rename() and unlink() + calls. This caused journal compaction to fail on Windows BIND servers + with the log error: "dns_journal_compact failed: failure". + [RT #22434] +
  • + 'host -D' now turns on debugging messages earlier. + [RT #22361] +
  • + isc_print_vsnprintf() failed to check if there was + space available in the buffer when adding a left + justified character with a non zero width, + (e.g. "%-1c"). + [RT #22270] +
  • + view->queryacl was being overloaded. Seperate the + usage into view->queryacl, view->cacheacl and + view->queryonacl. + [RT #22114] +
  • + win32: add more dependencies to BINDBuild.dsw. + [RT #22062] +
  • + win32: named-checkzone and named-checkconf failed + to initialise winsock. + [RT #21932] +
  • + named failed to generate a correct signed response + in a optout, delegation only zone with no secure + delegations. + [RT #22007] +
+
+
+ +

Known issues in this release

+ +
  • +

    + "make test" will fail on OSX and possibly other operating systems. + The failure occurs in a new test to check for allow-query ACLs. + The failure is caused because the source address is not specified on + the dig commands issued in the test. +

    +

    + If running "make test" is part of your usual acceptance process, + please edit the file bin/tests/system/allow_query/test.sh + and add +

    + -b 10.53.0.2 +

    + to the DIGOPTS line. +

    +
+
+ +

Thank You

+ +

+ Thank you to everyone who assisted us in making this release possible. + If you would like to contribute to ISC to assist us in continuing to make + quality open source software, please visit our donations page at + http://www.isc.org/supportisc. +

+
+
Copied: head/contrib/bind9/RELEASE-NOTES-BIND-9.6-ESV.pdf (from r216170, vendor/bind9/dist/RELEASE-NOTES-BIND-9.6-ESV.pdf) ============================================================================== Binary file (source and/or target). No diff available. Copied: head/contrib/bind9/RELEASE-NOTES-BIND-9.6-ESV.txt (from r216170, vendor/bind9/dist/RELEASE-NOTES-BIND-9.6-ESV.txt) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/bind9/RELEASE-NOTES-BIND-9.6-ESV.txt Sat Dec 4 05:58:56 2010 (r216175, copy of r216170, vendor/bind9/dist/RELEASE-NOTES-BIND-9.6-ESV.txt) @@ -0,0 +1,133 @@ + __________________________________________________________________ + +Introduction + + BIND 9.6-ESV-R3 is a maintenance release for BIND 9.6-ESV. + + This document summarizes changes from BIND 9.6-ESV-R1 to BIND + 9.6-ESV-R3. Please see the CHANGES file in the source code release for + a complete list of all changes. + +Download + + The latest release of BIND 9 software can always be found on our web + site at http://www.isc.org/software/bind. There you will find + additional information about each release, source code, and some + pre-compiled versions for certain operating systems. + +Support + + Product support information is available on + http://www.isc.org/services/support for paid support options. Free + support is provided by our user community via a mailing list. + Information on all public email lists is available at + https://lists.isc.org/mailman/listinfo. + +New Features + +9.6-ESV-R2 + + None. + +9.6-ESV-R3 + + None. + +Feature Changes + +9.6-ESV-R2 + + None. + +9.6-ESV-R3 + + None. + +Security Fixes + +9.6-ESV-R2 + + None. + +9.6-ESV-R3 + + * Adding a NO DATA signed negative response to cache failed to clear + any matching RRSIG records already in cache. A subsequent lookup of + the cached NO DATA entry could crash named (INSIST) when the + unexpected RRSIG was also returned with the NO DATA cache entry. + [RT #22288] [CVE-2010-3613] [VU#706148] + * BIND, acting as a DNSSEC validator, was determining if the NS RRset + is insecure based on a value that could mean either that the RRset + is actually insecure or that there wasn't a matching key for the + RRSIG in the DNSKEY RRset when resuming from validating the DNSKEY + RRset. This can happen when in the middle of a DNSKEY algorithm + rollover, when two different algorithms were used to sign a zone + but only the new set of keys are in the zone DNSKEY RRset. [RT + #22309] [CVE-2010-3614] [VU#837744] + +Bug Fixes + +9.6-ESV-R2 + + * Check that named successfully skips NSEC3 records that fail to + match the NSEC3PARAM record currently in use. [RT #21868] + * Worked around a race condition in the cache database memory + handling. Without this fix a DNS cache DB or ADB could incorrectly + stay in an over memory state, effectively refusing further caching, + which subsequently made a BIND 9 caching server unworkable. [RT + #21818] + * BIND did not properly handle non-cacheable negative responses from + insecure zones. This caused several non-protocol-compliant zones to + become unresolvable. BIND is now more accepting of responses it + receives from less strict servers. [RT #21555] + * The resolver could attempt to destroy a fetch context too soon, + resulting in a crash. [RT #19878] + * The placeholder negative caching element was not properly + constructed triggering a crash (INSIST) in dns_ncache_towire(). [RT + #21346] + * Handle the introduction of new trusted-keys and DS, DLV RRsets + better. [RT #21097] + * Fix arguments to dns_keytable_findnextkeynode() call. [RT #20877] + +9.6-ESV-R3 + + * Microsoft changed the behavior of sockets between NT/XP based + stacks vs Vista/windows7 stacks. Server 2003/2008 have the older + behavior, 2008r2 has the new behavior. With the change, different + error results are possible, so ISC adapted BIND to handle the new + error results. This resolves an issue where sockets would shut down + on Windows servers causing named to stop responding to queries. [RT + #21906] + * Windows has non-POSIX compliant behavior in its rename() and + unlink() calls. This caused journal compaction to fail on Windows + BIND servers with the log error: "dns_journal_compact failed: + failure". [RT #22434] + * 'host -D' now turns on debugging messages earlier. [RT #22361] + * isc_print_vsnprintf() failed to check if there was space available + in the buffer when adding a left justified character with a non + zero width, (e.g. "%-1c"). [RT #22270] + * view->queryacl was being overloaded. Seperate the usage into + view->queryacl, view->cacheacl and view->queryonacl. [RT #22114] + * win32: add more dependencies to BINDBuild.dsw. [RT #22062] + * win32: named-checkzone and named-checkconf failed to initialise + winsock. [RT #21932] + * named failed to generate a correct signed response in a optout, + delegation only zone with no secure delegations. [RT #22007] + +Known issues in this release + + * "make test" will fail on OSX and possibly other operating systems. + The failure occurs in a new test to check for allow-query ACLs. The + failure is caused because the source address is not specified on + the dig commands issued in the test. + If running "make test" is part of your usual acceptance process, + please edit the file bin/tests/system/allow_query/test.sh and add + -b 10.53.0.2 + to the DIGOPTS line. + +Thank You + + Thank you to everyone who assisted us in making this release possible. + If you would like to contribute to ISC to assist us in continuing to + make quality open source software, please visit our donations page at + http://www.isc.org/supportisc. Modified: head/contrib/bind9/bin/check/check-tool.c ============================================================================== --- head/contrib/bind9/bin/check/check-tool.c Sat Dec 4 02:42:52 2010 (r216174) +++ head/contrib/bind9/bin/check/check-tool.c Sat Dec 4 05:58:56 2010 (r216175) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: check-tool.c,v 1.35.36.3 2009/01/20 02:03:18 marka Exp $ */ +/* $Id: check-tool.c,v 1.35.36.3.24.2 2010/09/07 23:46:25 tbox Exp $ */ /*! \file */ @@ -23,6 +23,10 @@ #include +#ifdef _WIN32 +#include +#endif + #include "check-tool.h" #include #include @@ -662,3 +666,26 @@ dump_zone(const char *zonename, dns_zone return (result); } + +#ifdef _WIN32 +void +InitSockets(void) { + WORD wVersionRequested; + WSADATA wsaData; + int err; + + wVersionRequested = MAKEWORD(2, 0); + + err = WSAStartup( wVersionRequested, &wsaData ); + if (err != 0) { + fprintf(stderr, "WSAStartup() failed: %d\n", err); + exit(1); + } +} + +void +DestroySockets(void) { + WSACleanup(); +} +#endif + Modified: head/contrib/bind9/bin/check/check-tool.h ============================================================================== --- head/contrib/bind9/bin/check/check-tool.h Sat Dec 4 02:42:52 2010 (r216174) +++ head/contrib/bind9/bin/check/check-tool.h Sat Dec 4 05:58:56 2010 (r216175) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: check-tool.h,v 1.14 2007/06/18 23:47:17 tbox Exp $ */ +/* $Id: check-tool.h,v 1.14.628.2 2010/09/07 23:46:26 tbox Exp $ */ #ifndef CHECK_TOOL_H #define CHECK_TOOL_H @@ -43,6 +43,11 @@ isc_result_t dump_zone(const char *zonename, dns_zone_t *zone, const char *filename, dns_masterformat_t fileformat, const dns_master_style_t *style); +#ifdef _WIN32 +void InitSockets(void); +void DestroySockets(void); +#endif + extern int debug; extern isc_boolean_t nomerge; extern isc_boolean_t docheckmx; Modified: head/contrib/bind9/bin/check/named-checkconf.c ============================================================================== --- head/contrib/bind9/bin/check/named-checkconf.c Sat Dec 4 02:42:52 2010 (r216174) +++ head/contrib/bind9/bin/check/named-checkconf.c Sat Dec 4 05:58:56 2010 (r216175) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009, 2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: named-checkconf.c,v 1.46.222.2 2009/02/16 23:47:15 tbox Exp $ */ +/* $Id: named-checkconf.c,v 1.46.222.2.24.2 2010/09/07 23:46:26 tbox Exp $ */ /*! \file */ @@ -453,6 +453,10 @@ main(int argc, char **argv) { if (conffile == NULL || conffile[0] == '\0') conffile = NAMED_CONFFILE; +#ifdef _WIN32 + InitSockets(); +#endif + RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS); RUNTIME_CHECK(setup_logging(mctx, stdout, &logc) == ISC_R_SUCCESS); @@ -494,5 +498,9 @@ main(int argc, char **argv) { isc_mem_destroy(&mctx); +#ifdef _WIN32 + DestroySockets(); +#endif + return (exit_status); } Modified: head/contrib/bind9/bin/check/named-checkzone.c ============================================================================== --- head/contrib/bind9/bin/check/named-checkzone.c Sat Dec 4 02:42:52 2010 (r216174) +++ head/contrib/bind9/bin/check/named-checkzone.c Sat Dec 4 05:58:56 2010 (r216175) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: named-checkzone.c,v 1.51.34.4 2009/11/10 20:01:41 each Exp $ */ +/* $Id: named-checkzone.c,v 1.51.34.4.10.2 2010/09/07 23:46:26 tbox Exp $ */ /*! \file */ @@ -419,6 +419,10 @@ main(int argc, char **argv) { if (isc_commandline_index + 2 != argc) usage(); +#ifdef _WIN32 + InitSockets(); +#endif + RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS); if (!quiet) RUNTIME_CHECK(setup_logging(mctx, errout, &lctx) @@ -453,5 +457,8 @@ main(int argc, char **argv) { isc_hash_destroy(); isc_entropy_detach(&ectx); isc_mem_destroy(&mctx); +#ifdef _WIN32 + DestroySockets(); +#endif return ((result == ISC_R_SUCCESS) ? 0 : 1); } Modified: head/contrib/bind9/bin/dig/host.c ============================================================================== --- head/contrib/bind9/bin/dig/host.c Sat Dec 4 02:42:52 2010 (r216174) +++ head/contrib/bind9/bin/dig/host.c Sat Dec 4 05:58:56 2010 (r216175) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009, 2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: host.c,v 1.116.216.3 2009/09/08 23:28:20 marka Exp $ */ +/* $Id: host.c,v 1.116.216.3.10.2 2010/10/19 23:46:25 tbox Exp $ */ /*! \file */ @@ -625,7 +625,9 @@ pre_parse_args(int argc, char **argv) { case 'v': break; case 'w': break; case 'C': break; - case 'D': break; + case 'D': + debugging = ISC_TRUE; + break; case 'N': break; case 'R': break; case 'T': break; @@ -792,7 +794,7 @@ parse_args(isc_boolean_t is_batchfile, i ndots = atoi(isc_commandline_argument); break; case 'D': - debugging = ISC_TRUE; + /* Handled by pre_parse_args(). */ break; case '4': if (have_ipv4) { Modified: head/contrib/bind9/bin/named/client.c ============================================================================== --- head/contrib/bind9/bin/named/client.c Sat Dec 4 02:42:52 2010 (r216174) +++ head/contrib/bind9/bin/named/client.c Sat Dec 4 05:58:56 2010 (r216175) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: client.c,v 1.259.12.3 2009/01/29 22:40:33 jinmei Exp $ */ +/* $Id: client.c,v 1.259.12.3.24.2 2010/09/29 23:46:31 tbox Exp $ */ #include @@ -1859,13 +1859,13 @@ client_request(isc_task_t *task, isc_eve client->view->recursionacl, ISC_TRUE) == ISC_R_SUCCESS && ns_client_checkaclsilent(client, NULL, - client->view->queryacl, + client->view->cacheacl, ISC_TRUE) == ISC_R_SUCCESS && ns_client_checkaclsilent(client, &client->interface->addr, client->view->recursiononacl, ISC_TRUE) == ISC_R_SUCCESS && ns_client_checkaclsilent(client, &client->interface->addr, - client->view->queryonacl, + client->view->cacheonacl, ISC_TRUE) == ISC_R_SUCCESS) ra = ISC_TRUE; Modified: head/contrib/bind9/bin/named/include/named/query.h ============================================================================== --- head/contrib/bind9/bin/named/include/named/query.h Sat Dec 4 02:42:52 2010 (r216174) +++ head/contrib/bind9/bin/named/include/named/query.h Sat Dec 4 05:58:56 2010 (r216175) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.h,v 1.40 2007/06/19 23:46:59 tbox Exp $ */ +/* $Id: query.h,v 1.40.626.2 2010/09/29 23:46:31 tbox Exp $ */ #ifndef NAMED_QUERY_H #define NAMED_QUERY_H 1 @@ -71,6 +71,8 @@ struct ns_query { #define NS_QUERYATTR_SECURE 0x0200 #define NS_QUERYATTR_NOAUTHORITY 0x0400 #define NS_QUERYATTR_NOADDITIONAL 0x0800 +#define NS_QUERYATTR_CACHEACLOKVALID 0x1000 +#define NS_QUERYATTR_CACHEACLOK 0x2000 isc_result_t ns_query_init(ns_client_t *client); Modified: head/contrib/bind9/bin/named/query.c ============================================================================== --- head/contrib/bind9/bin/named/query.c Sat Dec 4 02:42:52 2010 (r216174) +++ head/contrib/bind9/bin/named/query.c Sat Dec 4 05:58:56 2010 (r216175) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.313.20.16.10.2 2010/06/26 23:46:14 tbox Exp $ */ +/* $Id: query.c,v 1.313.20.16.10.3 2010/09/29 00:03:32 marka Exp $ */ /*! \file */ @@ -820,17 +820,15 @@ query_getcachedb(ns_client_t *client, dn return (DNS_R_REFUSED); dns_db_attach(client->view->cachedb, &db); - if ((client->query.attributes & - NS_QUERYATTR_QUERYOKVALID) != 0) { + if ((client->query.attributes & NS_QUERYATTR_CACHEACLOKVALID) != 0) { /* - * We've evaluated the view's queryacl already. If - * NS_QUERYATTR_QUERYOK is set, then the client is + * We've evaluated the view's cacheacl already. If + * NS_QUERYATTR_CACHEACLOK is set, then the client is * allowed to make queries, otherwise the query should * be refused. */ check_acl = ISC_FALSE; - if ((client->query.attributes & - NS_QUERYATTR_QUERYOK) == 0) + if ((client->query.attributes & NS_QUERYATTR_CACHEACLOK) == 0) goto refuse; } else { /* @@ -844,16 +842,15 @@ query_getcachedb(ns_client_t *client, dn char msg[NS_CLIENT_ACLMSGSIZE("query (cache)")]; result = ns_client_checkaclsilent(client, NULL, - client->view->queryacl, + client->view->cacheacl, ISC_TRUE); if (result == ISC_R_SUCCESS) { /* - * We were allowed by the default - * "allow-query" ACL. Remember this so we - * don't have to check again. + * We were allowed by the "allow-query-cache" ACL. + * Remember this so we don't have to check again. */ client->query.attributes |= - NS_QUERYATTR_QUERYOK; + NS_QUERYATTR_CACHEACLOK; if (log && isc_log_wouldlog(ns_g_lctx, ISC_LOG_DEBUG(3))) { @@ -876,9 +873,9 @@ query_getcachedb(ns_client_t *client, dn } /* * We've now evaluated the view's query ACL, and - * the NS_QUERYATTR_QUERYOK attribute is now valid. + * the NS_QUERYATTR_CACHEACLOKVALID attribute is now valid. */ - client->query.attributes |= NS_QUERYATTR_QUERYOKVALID; + client->query.attributes |= NS_QUERYATTR_CACHEACLOKVALID; if (result != ISC_R_SUCCESS) goto refuse; Modified: head/contrib/bind9/bin/named/server.c ============================================================================== --- head/contrib/bind9/bin/named/server.c Sat Dec 4 02:42:52 2010 (r216174) +++ head/contrib/bind9/bin/named/server.c Sat Dec 4 05:58:56 2010 (r216175) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.520.12.11.10.1 2010/03/03 22:06:36 marka Exp $ */ +/* $Id: server.c,v 1.520.12.11.10.4 2010/11/16 22:42:03 marka Exp $ */ /*! \file */ @@ -1132,6 +1132,14 @@ configure_view(dns_view_t *view, const c dns_acache_setcachesize(view->acache, max_acache_size); } + CHECK(configure_view_acl(vconfig, config, "allow-query", actx, + ns_g_mctx, &view->queryacl)); + + if (view->queryacl == NULL) { + CHECK(configure_view_acl(NULL, ns_g_config, "allow-query", actx, + ns_g_mctx, &view->queryacl)); + } + /* * Configure the zones. */ @@ -1606,13 +1614,13 @@ configure_view(dns_view_t *view, const c * configured in named.conf. */ CHECK(configure_view_acl(vconfig, config, "allow-query-cache", - actx, ns_g_mctx, &view->queryacl)); + actx, ns_g_mctx, &view->cacheacl)); CHECK(configure_view_acl(vconfig, config, "allow-query-cache-on", - actx, ns_g_mctx, &view->queryonacl)); - if (view->queryonacl == NULL) + actx, ns_g_mctx, &view->cacheonacl)); + if (view->cacheonacl == NULL) CHECK(configure_view_acl(NULL, ns_g_config, "allow-query-cache-on", actx, - ns_g_mctx, &view->queryonacl)); + ns_g_mctx, &view->cacheonacl)); if (strcmp(view->name, "_bind") != 0) { CHECK(configure_view_acl(vconfig, config, "allow-recursion", actx, ns_g_mctx, @@ -1628,14 +1636,14 @@ configure_view(dns_view_t *view, const c * "allow-recursion" inherits from "allow-query-cache" if set, * otherwise from "allow-query" if set. */ - if (view->queryacl == NULL && view->recursionacl != NULL) - dns_acl_attach(view->recursionacl, &view->queryacl); - if (view->queryacl == NULL && view->recursion) + if (view->cacheacl == NULL && view->recursionacl != NULL) + dns_acl_attach(view->recursionacl, &view->cacheacl); + if (view->cacheacl == NULL && view->recursion) CHECK(configure_view_acl(vconfig, config, "allow-query", - actx, ns_g_mctx, &view->queryacl)); + actx, ns_g_mctx, &view->cacheacl)); if (view->recursion && - view->recursionacl == NULL && view->queryacl != NULL) - dns_acl_attach(view->queryacl, &view->recursionacl); + view->recursionacl == NULL && view->cacheacl != NULL) + dns_acl_attach(view->cacheacl, &view->recursionacl); /* * Set default "allow-recursion", "allow-recursion-on" and @@ -1651,16 +1659,13 @@ configure_view(dns_view_t *view, const c "allow-recursion-on", actx, ns_g_mctx, &view->recursiononacl)); - if (view->queryacl == NULL) { + if (view->cacheacl == NULL) { if (view->recursion) CHECK(configure_view_acl(NULL, ns_g_config, "allow-query-cache", actx, - ns_g_mctx, &view->queryacl)); - else { - if (view->queryacl != NULL) - dns_acl_detach(&view->queryacl); - CHECK(dns_acl_none(ns_g_mctx, &view->queryacl)); - } + ns_g_mctx, &view->cacheacl)); + else + CHECK(dns_acl_none(ns_g_mctx, &view->cacheacl)); } /* Modified: head/contrib/bind9/lib/dns/api ============================================================================== --- head/contrib/bind9/lib/dns/api Sat Dec 4 02:42:52 2010 (r216174) +++ head/contrib/bind9/lib/dns/api Sat Dec 4 05:58:56 2010 (r216175) @@ -1,3 +1,3 @@ -LIBINTERFACE = 57 +LIBINTERFACE = 58 LIBREVISION = 0 -LIBAGE = 2 +LIBAGE = 0 Modified: head/contrib/bind9/lib/dns/include/dns/view.h ============================================================================== --- head/contrib/bind9/lib/dns/include/dns/view.h Sat Dec 4 02:42:52 2010 (r216174) +++ head/contrib/bind9/lib/dns/include/dns/view.h Sat Dec 4 05:58:56 2010 (r216175) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: view.h,v 1.111.88.4 2009/01/29 22:40:35 jinmei Exp $ */ +/* $Id: view.h,v 1.111.88.4.24.2 2010/09/29 23:46:31 tbox Exp $ */ #ifndef DNS_VIEW_H #define DNS_VIEW_H 1 @@ -118,6 +118,8 @@ struct dns_view { isc_boolean_t enablevalidation; isc_boolean_t acceptexpired; dns_transfer_format_t transfer_format; + dns_acl_t * cacheacl; + dns_acl_t * cacheonacl; dns_acl_t * queryacl; dns_acl_t * queryonacl; dns_acl_t * recursionacl; Modified: head/contrib/bind9/lib/dns/journal.c ============================================================================== --- head/contrib/bind9/lib/dns/journal.c Sat Dec 4 02:42:52 2010 (r216174) +++ head/contrib/bind9/lib/dns/journal.c Sat Dec 4 05:58:56 2010 (r216175) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007-2010 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: journal.c,v 1.103.48.6 2009/11/04 23:47:25 tbox Exp $ */ +/* $Id: journal.c,v 1.103.48.6.10.2 2010/11/17 23:46:16 tbox Exp $ */ #include @@ -2173,6 +2173,12 @@ dns_journal_compact(isc_mem_t *mctx, cha indexend = new->header.end.offset; } + + /* + * Close both journals before trying to rename files (this is + * necessary on WIN32). + */ + dns_journal_destroy(&j); dns_journal_destroy(&new); /* @@ -2180,12 +2186,14 @@ dns_journal_compact(isc_mem_t *mctx, cha * Any IXFR outs will just continue and the old journal will be * removed on final close. * - * With MSDOS / NTFS we need to do a two stage rename triggered - * bu EEXISTS. Hopefully all IXFR's that were active at the last - * rename are now complete. + * With MSDOS / NTFS we need to do a two stage rename, triggered + * by EEXIST. (If any IXFR's are running in other threads, however, + * this will fail, and the journal will not be compacted. But + * if so, hopefully they'll be finished by the next time we + * compact.) */ if (rename(newname, filename) == -1) { - if (errno == EACCES && !is_backup) { + if (errno == EEXIST && !is_backup) { result = isc_file_remove(backup); if (result != ISC_R_SUCCESS && result != ISC_R_FILENOTFOUND) @@ -2202,7 +2210,6 @@ dns_journal_compact(isc_mem_t *mctx, cha } } - dns_journal_destroy(&j); result = ISC_R_SUCCESS; failure: Modified: head/contrib/bind9/lib/dns/rbtdb.c ============================================================================== --- head/contrib/bind9/lib/dns/rbtdb.c Sat Dec 4 02:42:52 2010 (r216174) +++ head/contrib/bind9/lib/dns/rbtdb.c Sat Dec 4 05:58:56 2010 (r216175) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.270.12.16.10.3 2010/08/13 07:25:21 marka Exp $ */ +/* $Id: rbtdb.c,v 1.270.12.16.10.6 2010/11/16 07:46:23 marka Exp $ */ /*! \file */ @@ -5421,14 +5421,14 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *r dns_rdataset_t *addedrdataset, isc_stdtime_t now) { rbtdb_changed_t *changed = NULL; - rdatasetheader_t *topheader, *topheader_prev, *header; + rdatasetheader_t *topheader, *topheader_prev, *header, *sigheader; unsigned char *merged; isc_result_t result; isc_boolean_t header_nx; isc_boolean_t newheader_nx; isc_boolean_t merge; dns_rdatatype_t rdtype, covers; - rbtdb_rdatatype_t negtype; + rbtdb_rdatatype_t negtype, sigtype; dns_trust_t trust; int idx; @@ -5466,7 +5466,7 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *r newheader_nx = NONEXISTENT(newheader) ? ISC_TRUE : ISC_FALSE; topheader_prev = NULL; - + sigheader = NULL; negtype = 0; if (rbtversion == NULL && !newheader_nx) { rdtype = RBTDB_RDATATYPE_BASE(newheader->type); @@ -5475,26 +5475,34 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *r * We're adding a negative cache entry. */ covers = RBTDB_RDATATYPE_EXT(newheader->type); - if (covers == dns_rdatatype_any) { + sigtype = RBTDB_RDATATYPE_VALUE(dns_rdatatype_rrsig, + covers); + for (topheader = rbtnode->data; + topheader != NULL; + topheader = topheader->next) { /* - * We're adding an negative cache entry + * If we're adding an negative cache entry * which covers all types (NXDOMAIN, * NODATA(QTYPE=ANY)). * * We make all other data stale so that the * only rdataset that can be found at this * node is the negative cache entry. + * + * Otherwise look for any RRSIGs of the + * given type so they can be marked stale + * later. */ - for (topheader = rbtnode->data; - topheader != NULL; - topheader = topheader->next) { + if (covers == dns_rdatatype_any) { set_ttl(rbtdb, topheader, 0); topheader->attributes |= RDATASET_ATTR_STALE; - } - rbtnode->dirty = 1; - goto find_header; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 06:38:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A79C106564A; Sat, 4 Dec 2010 06:38:22 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2C7C8FC1D; Sat, 4 Dec 2010 06:38:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB46cL73090997; Sat, 4 Dec 2010 06:38:21 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB46cLiB090995; Sat, 4 Dec 2010 06:38:21 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201012040638.oB46cLiB090995@svn.freebsd.org> From: Jack F Vogel Date: Sat, 4 Dec 2010 06:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216176 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 06:38:22 -0000 Author: jfv Date: Sat Dec 4 06:38:21 2010 New Revision: 216176 URL: http://svn.freebsd.org/changeset/base/216176 Log: Correct build error. Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sat Dec 4 05:58:56 2010 (r216175) +++ head/sys/dev/e1000/if_em.c Sat Dec 4 06:38:21 2010 (r216176) @@ -4303,7 +4303,6 @@ next_desc: static __inline void em_rx_discard(struct rx_ring *rxr, int i) { - struct adapter *adapter = rxr->adapter; struct em_buffer *rbuf; rbuf = &rxr->rx_buffers[i]; From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 08:44:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F2521065675; Sat, 4 Dec 2010 08:44:57 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D3FD8FC1F; Sat, 4 Dec 2010 08:44:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB48ivZG001214; Sat, 4 Dec 2010 08:44:57 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB48iv4D001212; Sat, 4 Dec 2010 08:44:57 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201012040844.oB48iv4D001212@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 4 Dec 2010 08:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216177 - head/lib/libgeom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 08:44:57 -0000 Author: jh Date: Sat Dec 4 08:44:56 2010 New Revision: 216177 URL: http://svn.freebsd.org/changeset/base/216177 Log: Remove stale link. PR: 151252 Modified: head/lib/libgeom/libgeom.3 Modified: head/lib/libgeom/libgeom.3 ============================================================================== --- head/lib/libgeom/libgeom.3 Sat Dec 4 06:38:21 2010 (r216176) +++ head/lib/libgeom/libgeom.3 Sat Dec 4 08:44:56 2010 (r216177) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2010 +.Dd December 4, 2010 .Dt LIBGEOM 3 .Os .Sh NAME @@ -382,8 +382,6 @@ if (errstr != NULL) err(1, "could not destroy ccd: %s", errstr); gctl_free(H); .Ed -.Sh SEE ALSO -.Pa http://ezine.daemonnews.org/200308/blueprints.html .Sh HISTORY The .Nm geom From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 09:44:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B56D0106564A; Sat, 4 Dec 2010 09:44:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id D2F8B8FC12; Sat, 4 Dec 2010 09:44:58 +0000 (UTC) Received: from c211-30-187-94.carlnfd1.nsw.optusnet.com.au (c211-30-187-94.carlnfd1.nsw.optusnet.com.au [211.30.187.94]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB49itMg013791 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 Dec 2010 20:44:56 +1100 Date: Sat, 4 Dec 2010 20:44:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim In-Reply-To: <201012031802.40083.jkim@FreeBSD.org> Message-ID: <20101204194458.C1665@besplex.bde.org> References: <201012032154.oB3LsADC035461@svn.freebsd.org> <201012031708.30232.jhb@freebsd.org> <201012031744.01956.jkim@FreeBSD.org> <201012031802.40083.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r216161 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 09:44:59 -0000 On Fri, 3 Dec 2010, Jung-uk Kim wrote: > On Friday 03 December 2010 05:43 pm, Jung-uk Kim wrote: >> On Friday 03 December 2010 05:08 pm, John Baldwin wrote: >>> On Friday, December 03, 2010 4:54:10 pm Jung-uk Kim wrote: >>>> Author: jkim >>>> Date: Fri Dec 3 21:54:10 2010 >>>> New Revision: 216161 >>>> URL: http://svn.freebsd.org/changeset/base/216161 >>>> >>>> Log: >>>> Explicitly initialize TSC frequency. To calibrate TSC >>>> frequency, we use DELAY(9) and it may use TSC in turn if TSC >>>> frequency is non-zero. >>> >>> We zero the BSS, so these were already zero. This just makes the >>> actual kernel file on disk larger by wasting space in .data >>> instead of .bss. >> >> Please note that I didn't touch other variables, e.g., >> tsc_is_broken, because I knew that. However, I just wanted to do >> that *explicitly*. Anyway, it is reverted now and SVN will remember >> what I wanted to do. ;-) >> >> BTW, if my memory serves, GCC (and all modern C compilers) put(s) >> zero-initialized variables back in .bss. Yes, this is just a style bug, since it doesn't even waste space :-). It still gives control over the layout, at least with gcc-3.3.3 on i386, but most places don't care about the layout. Why are you doing style bugs explicitly? :-) > I just tried it. GCC generates identical binaries as I thought. > However, Clang doesn't do the optimization. :-/ I get large differences even with gcc for assembler files (.zero and .p2align directives for explicit initialization -- this gives control over the layout) and small differences in .o files). BTW, at least i386 has some nonsense initialization related to this: from i386/initcpu.c: % /* Must *NOT* be BSS or locore will bzero these after setting them */ % int cpu = 0; /* Are we 386, 386sx, 486, etc? */ % u_int cpu_feature = 0; /* Feature flags */ % u_int cpu_feature2 = 0; /* Feature flags */ % u_int amd_feature = 0; /* AMD feature flags */ % u_int amd_feature2 = 0; /* AMD feature flags */ % u_int amd_pminfo = 0; /* AMD advanced power management info */ % u_int via_feature_rng = 0; /* VIA RNG features */ % u_int via_feature_xcrypt = 0; /* VIA ACE features */ % u_int cpu_high = 0; /* Highest arg to CPUID */ % u_int cpu_id = 0; /* Stepping ID */ % u_int cpu_procinfo = 0; /* HyperThreading Info / Brand Index / CLFUSH */ % u_int cpu_procinfo2 = 0; /* Multicore info */ % char cpu_vendor[20] = ""; /* CPU Origin code */ % u_int cpu_vendor_id = 0; /* CPU vendor ID */ % u_int cpu_clflush_line_size = 32; But all of these except the ones initialized to nonzero ARE in the BSS. The comment is wrong because locore does the bzeroing as early as possible so as to avoid this problem. It has done the bss bzeroing early enough since at least RELENG_3, and probably always in FreeBSD. Perhaps there was a problem with bzeroing NOT related to the bss (for page tables?), but it doesn't seem to be a problem now. The comment was added in 2001 not long before gcc invalidated it. BSS. These declarations also have many comments that do less than echo the variable names. ISTR than there are a few variables in locore that should be declared here but aren't, since they were put in locore for some bad reason. bootinfo may be one. Now, only the PC98 pc98_system_parameter variable seems to be written to by locore before the bzero. After fixing this, only easier control over the layout justifies locore allocating any non-static variable. I fixed the comment and removed the explicit initializations long ago. and haven't noticed any problems: % Index: initcpu.c % =================================================================== % RCS file: /home/ncvs/src/sys/i386/i386/initcpu.c,v % retrieving revision 1.49 % diff -u -2 -r1.49 initcpu.c % --- initcpu.c 10 Nov 2003 15:48:30 -0000 1.49 % +++ initcpu.c 11 Nov 2003 08:07:01 -0000 % @@ -77,15 +77,13 @@ % &hw_instruction_sse, 0, "SIMD/MMX2 instructions available in CPU"); % % -/* Must *NOT* be BSS or locore will bzero these after setting them */ % -int cpu = 0; /* Are we 386, 386sx, 486, etc? */ % -u_int cpu_feature = 0; /* Feature flags */ % -u_int cpu_high = 0; /* Highest arg to CPUID */ % -u_int cpu_id = 0; /* Stepping ID */ % -u_int cpu_procinfo = 0; /* HyperThreading Info / Brand Index / CLFUSH */ % -char cpu_vendor[20] = ""; /* CPU Origin code */ % - % +int cpu; /* Are we 386, 386sx, 486, etc? */ % +u_int cpu_feature; /* Feature flags */ % #ifdef CPU_ENABLE_SSE % u_int cpu_fxsr; /* SSE enabled */ % #endif % +u_int cpu_high; /* Highest arg to CPUID */ % +u_int cpu_id; /* Stepping ID */ % +u_int cpu_procinfo; /* HyperThreading Info / Brand Index / CLFUSH */ % +char cpu_vendor[20]; /* CPU Origin code */ % % #ifdef I486_CPU This fixes some style bugs (unsorted declarations) but not the comments. There many more variables now, with O(number of new variables) sorting errors. The largest sorting error is attaching a nonzero-initialized variable at the end of this list variables that is misclaimed to need special handling because they are zero. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 10:06:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3123106566B; Sat, 4 Dec 2010 10:06:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 3967D8FC1D; Sat, 4 Dec 2010 10:06:36 +0000 (UTC) Received: from c211-30-187-94.carlnfd1.nsw.optusnet.com.au (c211-30-187-94.carlnfd1.nsw.optusnet.com.au [211.30.187.94]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB4A6WQn030986 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 Dec 2010 21:06:34 +1100 Date: Sat, 4 Dec 2010 21:06:32 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eygene Ryabinkin In-Reply-To: Message-ID: <20101204204755.C1958@besplex.bde.org> References: <201012030709.oB379NOH058721@svn.freebsd.org> <20101204045754.T4046@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans , Bruce Cran Subject: Re: svn commit: r216143 - in head: share/man/man9 sys/amd64/include sys/arm/include sys/i386/include sys/ia64/include sys/mips/include sys/pc98/include sys/powerpc/include sys/sparc64/include sys/sun4v... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 10:06:37 -0000 On Fri, 3 Dec 2010, Eygene Ryabinkin wrote: > Sat, Dec 04, 2010 at 05:01:55AM +1100, Bruce Evans wrote: >> On Fri, 3 Dec 2010, Bruce Cran wrote: >>> Log: >>> Revert r216134. This checkin broke platforms where bus_space are macros: >>> they need to be a single statement, and do { } while (0) doesn't >>> work in this situation so revert until a solution can be devised. >> >> Surprising that do-while doesn't work. > > Prior to the revert, something like "a = bus_space_read_multi_1(...)" > will generate improper code like "a = KASSERT(); __bs_nonsigle(XXX);" > and making "do { KASSERT(); __bs_nonsingle(XXX); } while(0)" won't > help either, since we can't generally assign the compound statement > to the lvalue. Ah, the functions actually return something :-). >> I just noticed the following possibly more serious problems for the macro >> versions: >> >> - the `c' arg is missing parentheses in the KASSERT() >> - the `c' arg is now evaluated twice. This turns safe macros into unsafe >> ones. > > Perhaps we can define the macros as > {{{ > #define bus_space_read_multi_1(t, h, o, a, c) ({\ > size_t count = (c); \ > KASSERT(count != 0, ("bus_space_read_multi_1: count == 0")); \ > __bs_nonsingle(rm,1,(t),(h),(o),(a),count); \ > }) > }}} > > This will both allow to avoid unsafety and will make this statement > to be the correct assignment for any compiler that supports the > "braced-groups within expressions" GNU extension. GNU C, Clang > and Intel C both support it (but not with -pedantic -ansi -Werror > flag combo). This is why amd64 and i386 use __extension when they use statement-expressions. grep in -current shows 32 .h files under /sys matching "({", and only 7 of these files use __extension. It is mostly headers visible in userland that are careful. sparc64 and sun4v atomic.h seem to be the only headers that both use ({ and are used in userland. For .c files, statement-expressions are remarkably little-used -- there are more line 32 lines total matching "({", and 0 lines matching "__extension". > But, probably, the inline function will be better here from the > portability point of view, since it is supported by the C standard > and braced-groups -- aren't. > > So, the question is "why these statements were made to be > macros at some platforms?". I guess it is just because they seemed to be simple enough to be macros. Macros and inline have different technical advantages but I don't see any important ones here. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 10:11:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C1F8106564A; Sat, 4 Dec 2010 10:11:20 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6445A8FC24; Sat, 4 Dec 2010 10:11:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB4ABKEO009149; Sat, 4 Dec 2010 10:11:20 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB4ABKXj009144; Sat, 4 Dec 2010 10:11:20 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201012041011.oB4ABKXj009144@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 4 Dec 2010 10:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216178 - in head: bin/csh/USD.doc lib/libc/rpc/PSD.doc sbin/fsck_ffs/SMM.doc share/doc/psd/12.make share/doc/psd/18.gprof share/doc/psd/22.rpcgen share/doc/psd/23.rpc share/doc/psd/24.... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 10:11:20 -0000 Author: uqs Date: Sat Dec 4 10:11:20 2010 New Revision: 216178 URL: http://svn.freebsd.org/changeset/base/216178 Log: Move most of the remaining USD/PSD/SMM papers into share/doc Added: head/share/doc/psd/12.make/stubs - copied unchanged from r216131, head/usr.bin/make/PSD.doc/stubs head/share/doc/psd/12.make/tutorial.ms - copied unchanged from r216131, head/usr.bin/make/PSD.doc/tutorial.ms head/share/doc/psd/18.gprof/abstract.me - copied unchanged from r216131, head/usr.bin/gprof/PSD.doc/abstract.me head/share/doc/psd/18.gprof/gathering.me - copied unchanged from r216131, head/usr.bin/gprof/PSD.doc/gathering.me head/share/doc/psd/18.gprof/header.me - copied unchanged from r216131, head/usr.bin/gprof/PSD.doc/header.me head/share/doc/psd/18.gprof/intro.me - copied unchanged from r216131, head/usr.bin/gprof/PSD.doc/intro.me head/share/doc/psd/18.gprof/postp.me - copied unchanged from r216131, head/usr.bin/gprof/PSD.doc/postp.me head/share/doc/psd/18.gprof/postp1.pic - copied unchanged from r216131, head/usr.bin/gprof/PSD.doc/postp1.pic head/share/doc/psd/18.gprof/postp2.pic - copied unchanged from r216131, head/usr.bin/gprof/PSD.doc/postp2.pic head/share/doc/psd/18.gprof/postp3.pic - copied unchanged from r216131, head/usr.bin/gprof/PSD.doc/postp3.pic head/share/doc/psd/18.gprof/pres1.pic - copied unchanged from r216131, head/usr.bin/gprof/PSD.doc/pres1.pic head/share/doc/psd/18.gprof/pres2.pic - copied unchanged from r216131, head/usr.bin/gprof/PSD.doc/pres2.pic head/share/doc/psd/18.gprof/present.me - copied unchanged from r216131, head/usr.bin/gprof/PSD.doc/present.me head/share/doc/psd/18.gprof/profiling.me - copied unchanged from r216131, head/usr.bin/gprof/PSD.doc/profiling.me head/share/doc/psd/18.gprof/refs.me - copied unchanged from r216131, head/usr.bin/gprof/PSD.doc/refs.me head/share/doc/psd/22.rpcgen/rpcgen.ms - copied unchanged from r216131, head/lib/libc/rpc/PSD.doc/rpcgen.ms head/share/doc/psd/22.rpcgen/stubs - copied unchanged from r216131, head/lib/libc/rpc/PSD.doc/stubs head/share/doc/psd/23.rpc/rpc.prog.ms - copied unchanged from r216131, head/lib/libc/rpc/PSD.doc/rpc.prog.ms head/share/doc/psd/23.rpc/stubs - copied unchanged from r216131, head/lib/libc/rpc/PSD.doc/stubs head/share/doc/psd/24.xdr/stubs - copied unchanged from r216131, head/lib/libc/rpc/PSD.doc/stubs head/share/doc/psd/24.xdr/xdr.nts.ms - copied unchanged from r216131, head/lib/libc/rpc/PSD.doc/xdr.nts.ms head/share/doc/psd/25.xdrrfc/stubs - copied unchanged from r216131, head/lib/libc/rpc/PSD.doc/stubs head/share/doc/psd/25.xdrrfc/xdr.rfc.ms - copied unchanged from r216131, head/lib/libc/rpc/PSD.doc/xdr.rfc.ms head/share/doc/psd/26.rpcrfc/rpc.rfc.ms - copied unchanged from r216131, head/lib/libc/rpc/PSD.doc/rpc.rfc.ms head/share/doc/psd/26.rpcrfc/stubs - copied unchanged from r216131, head/lib/libc/rpc/PSD.doc/stubs head/share/doc/psd/27.nfsrpc/nfs.rfc.ms - copied unchanged from r216131, head/lib/libc/rpc/PSD.doc/nfs.rfc.ms head/share/doc/psd/27.nfsrpc/stubs - copied unchanged from r216131, head/lib/libc/rpc/PSD.doc/stubs head/share/doc/smm/02.config/0.t - copied unchanged from r216131, head/usr.sbin/config/SMM.doc/0.t head/share/doc/smm/02.config/1.t - copied unchanged from r216131, head/usr.sbin/config/SMM.doc/1.t head/share/doc/smm/02.config/2.t - copied unchanged from r216131, head/usr.sbin/config/SMM.doc/2.t head/share/doc/smm/02.config/3.t - copied unchanged from r216131, head/usr.sbin/config/SMM.doc/3.t head/share/doc/smm/02.config/4.t - copied unchanged from r216131, head/usr.sbin/config/SMM.doc/4.t head/share/doc/smm/02.config/5.t - copied unchanged from r216131, head/usr.sbin/config/SMM.doc/5.t head/share/doc/smm/02.config/6.t - copied unchanged from r216131, head/usr.sbin/config/SMM.doc/6.t head/share/doc/smm/02.config/a.t - copied unchanged from r216131, head/usr.sbin/config/SMM.doc/a.t head/share/doc/smm/02.config/b.t - copied unchanged from r216131, head/usr.sbin/config/SMM.doc/b.t head/share/doc/smm/02.config/c.t - copied unchanged from r216131, head/usr.sbin/config/SMM.doc/c.t head/share/doc/smm/02.config/d.t - copied unchanged from r216131, head/usr.sbin/config/SMM.doc/d.t head/share/doc/smm/02.config/e.t - copied unchanged from r216131, head/usr.sbin/config/SMM.doc/e.t head/share/doc/smm/02.config/spell.ok - copied unchanged from r216131, head/usr.sbin/config/SMM.doc/spell.ok head/share/doc/smm/03.fsck/0.t - copied unchanged from r216131, head/sbin/fsck_ffs/SMM.doc/0.t head/share/doc/smm/03.fsck/1.t - copied unchanged from r216131, head/sbin/fsck_ffs/SMM.doc/1.t head/share/doc/smm/03.fsck/2.t - copied unchanged from r216131, head/sbin/fsck_ffs/SMM.doc/2.t head/share/doc/smm/03.fsck/3.t - copied unchanged from r216131, head/sbin/fsck_ffs/SMM.doc/3.t head/share/doc/smm/03.fsck/4.t - copied unchanged from r216131, head/sbin/fsck_ffs/SMM.doc/4.t head/share/doc/smm/07.lpr/ - copied from r216131, head/usr.sbin/lpr/SMM.doc/ head/share/doc/smm/11.timedop/timed.ms - copied unchanged from r216131, head/usr.sbin/timed/SMM.doc/timedop/timed.ms head/share/doc/smm/12.timed/date - copied unchanged from r216131, head/usr.sbin/timed/SMM.doc/timed/date head/share/doc/smm/12.timed/loop - copied unchanged from r216131, head/usr.sbin/timed/SMM.doc/timed/loop head/share/doc/smm/12.timed/spell.ok - copied unchanged from r216131, head/usr.sbin/timed/SMM.doc/timed/spell.ok head/share/doc/smm/12.timed/time - copied unchanged from r216131, head/usr.sbin/timed/SMM.doc/timed/time head/share/doc/smm/12.timed/timed.ms - copied unchanged from r216131, head/usr.sbin/timed/SMM.doc/timed/timed.ms head/share/doc/smm/12.timed/unused - copied unchanged from r216131, head/usr.sbin/timed/SMM.doc/timed/unused head/share/doc/usd/04.csh/csh.1 - copied unchanged from r216131, head/bin/csh/USD.doc/csh.1 head/share/doc/usd/04.csh/csh.2 - copied unchanged from r216131, head/bin/csh/USD.doc/csh.2 head/share/doc/usd/04.csh/csh.3 - copied unchanged from r216131, head/bin/csh/USD.doc/csh.3 head/share/doc/usd/04.csh/csh.4 - copied unchanged from r216131, head/bin/csh/USD.doc/csh.4 head/share/doc/usd/04.csh/csh.a - copied unchanged from r216131, head/bin/csh/USD.doc/csh.a head/share/doc/usd/04.csh/csh.g - copied unchanged from r216131, head/bin/csh/USD.doc/csh.g head/share/doc/usd/04.csh/tabs - copied unchanged from r216131, head/bin/csh/USD.doc/tabs head/share/doc/usd/05.dc/dc - copied unchanged from r216131, head/usr.bin/dc/USD.doc/dc head/share/doc/usd/06.bc/bc - copied unchanged from r216131, head/usr.bin/bc/USD.doc/bc head/share/doc/usd/07.mail/mail0.nr - copied unchanged from r216131, head/usr.bin/mail/USD.doc/mail0.nr head/share/doc/usd/07.mail/mail1.nr - copied unchanged from r216131, head/usr.bin/mail/USD.doc/mail1.nr head/share/doc/usd/07.mail/mail2.nr - copied unchanged from r216131, head/usr.bin/mail/USD.doc/mail2.nr head/share/doc/usd/07.mail/mail3.nr - copied unchanged from r216131, head/usr.bin/mail/USD.doc/mail3.nr head/share/doc/usd/07.mail/mail4.nr - copied unchanged from r216131, head/usr.bin/mail/USD.doc/mail4.nr head/share/doc/usd/07.mail/mail5.nr - copied unchanged from r216131, head/usr.bin/mail/USD.doc/mail5.nr head/share/doc/usd/07.mail/mail6.nr - copied unchanged from r216131, head/usr.bin/mail/USD.doc/mail6.nr head/share/doc/usd/07.mail/mail7.nr - copied unchanged from r216131, head/usr.bin/mail/USD.doc/mail7.nr head/share/doc/usd/07.mail/mail8.nr - copied unchanged from r216131, head/usr.bin/mail/USD.doc/mail8.nr head/share/doc/usd/07.mail/mail9.nr - copied unchanged from r216131, head/usr.bin/mail/USD.doc/mail9.nr head/share/doc/usd/07.mail/maila.nr - copied unchanged from r216131, head/usr.bin/mail/USD.doc/maila.nr Deleted: head/bin/csh/USD.doc/ head/lib/libc/rpc/PSD.doc/ head/sbin/fsck_ffs/SMM.doc/ head/usr.bin/bc/USD.doc/ head/usr.bin/dc/USD.doc/ head/usr.bin/gprof/PSD.doc/ head/usr.bin/mail/USD.doc/ head/usr.bin/make/PSD.doc/ head/usr.sbin/config/SMM.doc/ head/usr.sbin/lpr/SMM.doc/ head/usr.sbin/timed/SMM.doc/ Modified: head/share/doc/psd/12.make/Makefile head/share/doc/psd/18.gprof/Makefile head/share/doc/psd/22.rpcgen/Makefile head/share/doc/psd/23.rpc/Makefile head/share/doc/psd/24.xdr/Makefile head/share/doc/psd/25.xdrrfc/Makefile head/share/doc/psd/26.rpcrfc/Makefile head/share/doc/psd/27.nfsrpc/Makefile head/share/doc/smm/02.config/Makefile head/share/doc/smm/03.fsck/Makefile head/share/doc/smm/07.lpr/Makefile head/share/doc/smm/11.timedop/Makefile head/share/doc/smm/12.timed/Makefile head/share/doc/usd/04.csh/Makefile head/share/doc/usd/05.dc/Makefile head/share/doc/usd/06.bc/Makefile head/share/doc/usd/07.mail/Makefile head/usr.sbin/lpr/Makefile Modified: head/share/doc/psd/12.make/Makefile ============================================================================== --- head/share/doc/psd/12.make/Makefile Sat Dec 4 08:44:56 2010 (r216177) +++ head/share/doc/psd/12.make/Makefile Sat Dec 4 10:11:20 2010 (r216178) @@ -4,6 +4,5 @@ VOLUME= psd/12.make SRCS= stubs tutorial.ms MACROS= -ms -SRCDIR= ${.CURDIR}/../../../../usr.bin/make/PSD.doc .include Copied: head/share/doc/psd/12.make/stubs (from r216131, head/usr.bin/make/PSD.doc/stubs) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/doc/psd/12.make/stubs Sat Dec 4 10:11:20 2010 (r216178, copy of r216131, head/usr.bin/make/PSD.doc/stubs) @@ -0,0 +1,9 @@ +.\" $FreeBSD$ +.\" +.de Ix +.. +.de Rd +.. +.de Rm +.. +.if n .ftr CR R Copied: head/share/doc/psd/12.make/tutorial.ms (from r216131, head/usr.bin/make/PSD.doc/tutorial.ms) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/doc/psd/12.make/tutorial.ms Sat Dec 4 10:11:20 2010 (r216178, copy of r216131, head/usr.bin/make/PSD.doc/tutorial.ms) @@ -0,0 +1,3747 @@ +.\" Copyright (c) 1988, 1989 by Adam de Boor +.\" Copyright (c) 1989 by Berkeley Softworks +.\" Copyright (c) 1988, 1989, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" Adam de Boor. +.\" +.\" 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 the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)tutorial.ms 8.1 (Berkeley) 8/18/93 +.\" $FreeBSD$ +.\" +.EH 'PSD:12-%''PMake \*- A Tutorial' +.OH 'PMake \*- A Tutorial''PSD:12-%' +.\" xH is a macro to provide numbered headers that are automatically stuffed +.\" into a table-of-contents, properly indented, etc. If the first argument +.\" is numeric, it is taken as the depth for numbering (as for .NH), else +.\" the default (1) is assumed. +.\" +.\" @P The initial paragraph distance. +.\" @Q The piece of section number to increment (or 0 if none given) +.\" @R Section header. +.\" @S Indent for toc entry +.\" @T Argument to NH (can't use @Q b/c giving 0 to NH resets the counter) +.de xH +.NH \\$1 +\\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 +.nr PD .1v +.XS \\n% +.ta 0.6i +\\*(SN \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 +.XE +.nr PD .3v +.. +.ig +.\" CW is used to place a string in fixed-width or switch to a +.\" fixed-width font. +.\" C is a typewriter font for a laserwriter. Use something else if +.\" you don't have one... +.de CW +.ie !\\n(.$ .ft S +.el \&\\$3\fS\\$1\fP\\$2 +.. +.\" Anything I put in a display I want to be in fixed-width +.am DS +.CW +.. +.\" The stuff in .No produces a little stop sign in the left margin +.\" that says NOTE in it. Unfortunately, it does cause a break, but +.\" hey. Can't have everything. In case you're wondering how I came +.\" up with such weird commands, they came from running grn on a +.\" gremlin file... +.de No +.br +.ne 0.5i +.po -0.5i +.br +.mk +.nr g3 \\n(.f +.nr g4 \\n(.s +.ig ft +.sp -1 +.\" .st cf +\D's -1u'\D't 5u' +.sp -1 +\h'50u'\D'l 71u 0u'\D'l 50u 50u'\D'l 0u 71u'\D'l -50u 50u'\D'l -71u 0u'\D'l -50u -50u'\D'l 0u -71u'\D'l 50u -50u' +.sp -1 +\D't 3u' +.sp -1 +.sp 7u +\h'53u'\D'p 14 68u 0u 46u 46u 0u 68u -46u 46u -68u 0u -47u -46u 0u -68u 47u -46u' +.sp -1 +.ft R +.ps 6 +.nr g8 \\n(.d +.ds g9 "NOTE +.sp 74u +\h'85u'\v'0.85n'\h-\w\\*(g9u/2u\&\\*(g9 +.sp |\\n(g8u +.sp 166u +.ig br +\D't 3u'\D's -1u' +.br +.po +.rt +.ft \\n(g3 +.ps \\n(g4 +.. +.de Bp +.ie !\\n(.$ .IP \(bu 2 +.el .IP "\&" 2 +.. +.po +.3i +.TL +PMake \*- A Tutorial +.AU +Adam de Boor +.AI +Berkeley Softworks +2150 Shattuck Ave, Penthouse +Berkeley, CA 94704 +adam@bsw.uu.net +\&...!uunet!bsw!adam +.FS +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies. +The University of California, Berkeley Softworks, and Adam de Boor make no +representations about the suitability of this software for any +purpose. It is provided "as is" without express or implied warranty. +.FE +.PP +.xH 1 Introduction +.LP +PMake is a program for creating other programs, or anything else you +can think of for it to do. The basic idea behind PMake is that, for +any given system, be it a program or a document or whatever, there +will be some files that depend on the state of other files (on when +they were last modified). PMake takes these dependencies, which you +must specify, and uses them to build whatever it is you want it to +build. +.LP +PMake is almost fully-compatible with Make, with which you may already +be familiar. PMake's most important feature is its ability to run +several different jobs at once, making the creation of systems +considerably faster. It also has a great deal more functionality than +Make. Throughout the text, whenever something is mentioned that is an +important difference between PMake and Make (i.e. something that will +cause a makefile to fail if you don't do something about it), or is +simply important, it will be flagged with a little sign in the left +margin, like this: +.No +.LP +This tutorial is divided into three main sections corresponding to basic, +intermediate and advanced PMake usage. If you already know Make well, +you will only need to skim chapter 2 (there are some aspects of +PMake that I consider basic to its use that didn't exist in Make). +Things in chapter 3 make life much easier, while those in chapter 4 +are strictly for those who know what they are doing. Chapter 5 has +definitions for the jargon I use and chapter 6 contains possible +solutions to the problems presented throughout the tutorial. +.xH 1 The Basics of PMake +.LP +PMake takes as input a file that tells a) which files depend on which +other files to be complete and b) what to do about files that are +``out-of-date.'' This file is known as a ``makefile'' and is usually +.Ix 0 def makefile +kept in the top-most directory of the system to be built. While you +can call the makefile anything you want, PMake will look for +.CW Makefile +and +.CW makefile +(in that order) in the current directory if you don't tell it +otherwise. +.Ix 0 def makefile default +To specify a different makefile, use the +.B \-f +flag (e.g. +.CW "pmake -f program.mk" ''). `` +.Ix 0 ref flags -f +.Ix 0 ref makefile other +.LP +A makefile has four different types of lines in it: +.RS +.IP \(bu 2 +File dependency specifications +.IP \(bu 2 +Creation commands +.IP \(bu 2 +Variable assignments +.IP \(bu 2 +Comments, include statements and conditional directives +.RE +.LP +Any line may be continued over multiple lines by ending it with a +backslash. +.Ix 0 def "continuation line" +The backslash, following newline and any initial whitespace +on the following line are compressed into a single space before the +input line is examined by PMake. +.xH 2 Dependency Lines +.LP +As mentioned in the introduction, in any system, there are +dependencies between the files that make up the system. For instance, +in a program made up of several C source files and one header file, +the C files will need to be re-compiled should the header file be +changed. For a document of several chapters and one macro file, the +chapters will need to be reprocessed if any of the macros changes. +.Ix 0 def "dependency" +These are dependencies and are specified by means of dependency lines in +the makefile. +.LP +.Ix 0 def "dependency line" +On a dependency line, there are targets and sources, separated by a +one- or two-character operator. +The targets ``depend'' on the sources and are usually created from +them. +.Ix 0 def target +.Ix 0 def source +.Ix 0 ref operator +Any number of targets and sources may be specified on a dependency line. +All the targets in the line are made to depend on all the sources. +Targets and sources need not be actual files, but every source must be +either an actual file or another target in the makefile. +If you run out of room, use a backslash at the end of the line to continue onto +the next one. +.LP +Any file may be a target and any file may be a source, but the +relationship between the two (or however many) is determined by the +``operator'' that separates them. +.Ix 0 def operator +Three types of operators exist: one specifies that the datedness of a +target is determined by the state of its sources, while another +specifies other files (the sources) that need to be dealt with before +the target can be re-created. The third operator is very similar to +the first, with the additional condition that the target is +out-of-date if it has no sources. These operations are represented by +the colon, the exclamation point and the double-colon, respectively, and are +mutually exclusive. Their exact semantics are as follows: +.IP ":" +.Ix 0 def operator colon +.Ix 0 def : +If a colon is used, a target on the line is considered to be +``out-of-date'' (and in need of creation) if +.RS +.IP \(bu 2 +any of the sources has been modified more recently than the target, or +.IP \(bu 2 +the target doesn't exist. +.RE +.Ix 0 def out-of-date +.IP "\&" +Under this operation, steps will be taken to re-create the target only +if it is found to be out-of-date by using these two rules. +.IP "!" +.Ix 0 def operator force +.Ix 0 def ! +If an exclamation point is used, the target will always be re-created, +but this will not happen until all of its sources have been examined +and re-created, if necessary. +.IP "::" +.Ix 0 def operator double-colon +.Ix 0 def :: +If a double-colon is used, a target is out-of-date if: +.RS +.IP \(bu 2 +any of the sources has been modified more recently than the target, or +.IP \(bu 2 +the target doesn't exist, or +.IP \(bu 2 +the target has no sources. +.RE +.IP "\&" +If the target is out-of-date according to these rules, it will be re-created. +This operator also does something else to the targets, but I'll go +into that in the next section (``Shell Commands''). +.LP +Enough words, now for an example. Take that C program I mentioned +earlier. Say there are three C files +.CW a.c , ( +.CW b.c +and +.CW c.c ) +each of which +includes the file +.CW defs.h . +The dependencies between the files could then be expressed as follows: +.DS +program : a.o b.o c.o +a.o b.o c.o : defs.h +a.o : a.c +b.o : b.c +c.o : c.c +.DE +.LP +You may be wondering at this point, where +.CW a.o , +.CW b.o +and +.CW c.o +came in and why +.I they +depend on +.CW defs.h +and the C files don't. The reason is quite simple: +.CW program +cannot be made by linking together .c files \*- it must be +made from .o files. Likewise, if you change +.CW defs.h , +it isn't the .c files that need to be re-created, it's the .o files. +If you think of dependencies in these terms \*- which files (targets) +need to be created from which files (sources) \*- you should have no problems. +.LP +An important thing to notice about the above example, is that all the +\&.o files appear as targets on more than one line. This is perfectly +all right: the target is made to depend on all the sources mentioned +on all the dependency lines. E.g. +.CW a.o +depends on both +.CW defs.h +and +.CW a.c . +.Ix 0 ref dependency +.No +.LP +The order of the dependency lines in the makefile is +important: the first target on the first dependency line in the +makefile will be the one that gets made if you don't say otherwise. +That's why +.CW program +comes first in the example makefile, above. +.LP +Both targets and sources may contain the standard C-Shell wildcard +characters +.CW { , ( +.CW } , +.CW * , +.CW ? , +.CW [ , +and +.CW ] ), +but the non-curly-brace ones may only appear in the final component +(the file portion) of the target or source. The characters mean the +following things: +.IP \fB{}\fP +These enclose a comma-separated list of options and cause the pattern +to be expanded once for each element of the list. Each expansion +contains a different element. For example, +.CW src/{whiffle,beep,fish}.c +expands to the three words +.CW src/whiffle.c , +.CW src/beep.c , +and +.CW src/fish.c . +These braces may be nested and, unlike the other wildcard characters, +the resulting words need not be actual files. All other wildcard +characters are expanded using the files that exist when PMake is +started. +.IP \fB*\fP +This matches zero or more characters of any sort. +.CW src/*.c +will expand to the same three words as above as long as +.CW src +contains those three files (and no other files that end in +.CW .c ). +.IP \fB?\fP +Matches any single character. +.IP \fB[]\fP +This is known as a character class and contains either a list of +single characters, or a series of character ranges +.CW a-z , ( +for example means all characters between a and z), or both. It matches +any single character contained in the list. E.g. +.CW [A-Za-z] +will match all letters, while +.CW [0123456789] +will match all numbers. +.xH 2 Shell Commands +.LP +``Isn't that nice,'' you say to yourself, ``but how are files +actually `re-created,' as he likes to spell it?'' +The re-creation is accomplished by commands you place in the makefile. +These commands are passed to the Bourne shell (better known as +``/bin/sh'') to be executed and are +.Ix 0 ref shell +.Ix 0 ref re-creation +.Ix 0 ref update +expected to do what's necessary to update the target file (PMake +doesn't actually check to see if the target was created. It just +assumes it's there). +.Ix 0 ref target +.LP +Shell commands in a makefile look a lot like shell commands you would +type at a terminal, with one important exception: each command in a +makefile +.I must +be preceded by at least one tab. +.LP +Each target has associated with it a shell script made up of +one or more of these shell commands. The creation script for a target +should immediately follow the dependency line for that target. While +any given target may appear on more than one dependency line, only one +of these dependency lines may be followed by a creation script, unless +the `::' operator was used on the dependency line. +.Ix 0 ref operator double-colon +.Ix 0 ref :: +.No +.LP +If the double-colon was used, each dependency line for the target +may be followed by a shell script. That script will only be executed +if the target on the associated dependency line is out-of-date with +respect to the sources on that line, according to the rules I gave +earlier. +I'll give you a good example of this later on. +.LP +To expand on the earlier makefile, you might add commands as follows: +.DS +program : a.o b.o c.o + cc a.o b.o c.o \-o program +a.o b.o c.o : defs.h +a.o : a.c + cc \-c a.c +b.o : b.c + cc \-c b.c +c.o : c.c + cc \-c c.c +.DE +.LP +Something you should remember when writing a makefile is, the +commands will be executed if the +.I target +on the dependency line is out-of-date, not the sources. +.Ix 0 ref target +.Ix 0 ref source +.Ix 0 ref out-of-date +In this example, the command +.CW "cc \-c a.c" '' `` +will be executed if +.CW a.o +is out-of-date. Because of the `:' operator, +.Ix 0 ref : +.Ix 0 ref operator colon +this means that should +.CW a.c +.I or +.CW defs.h +have been modified more recently than +.CW a.o , +the command will be executed +.CW a.o "\&" ( +will be considered out-of-date). +.Ix 0 ref out-of-date +.LP +Remember how I said the only difference between a makefile shell +command and a regular shell command was the leading tab? I lied. There +is another way in which makefile commands differ from regular ones. +The first two characters after the initial whitespace are treated +specially. +If they are any combination of `@' and `\-', they cause PMake to do +different things. +.LP +In most cases, shell commands are printed before they're +actually executed. This is to keep you informed of what's going on. If +an `@' appears, however, this echoing is suppressed. In the case of an +.CW echo +command, say +.CW "echo Linking index" ,'' `` +it would be +rather silly to see +.DS +echo Linking index +Linking index +.DE +.LP +so PMake allows you to place an `@' before the command +.CW "@echo Linking index" '') (`` +to prevent the command from being printed. +.LP +The other special character is the `\-'. In case you didn't know, +shell commands finish with a certain ``exit status.'' This status is +made available by the operating system to whatever program invoked the +command. Normally this status will be 0 if everything went ok and +non-zero if something went wrong. For this reason, PMake will consider +an error to have occurred if one of the shells it invokes returns a non-zero +status. When it detects an error, PMake's usual action is to abort +whatever it's doing and exit with a non-zero status itself (any other +targets that were being created will continue being made, but nothing +new will be started. PMake will exit after the last job finishes). +This behavior can be altered, however, by placing a `\-' at the front +of a command +.CW "\-mv index index.old" ''), (`` +certain command-line arguments, +or doing other things, to be detailed later. In such +a case, the non-zero status is simply ignored and PMake keeps chugging +along. +.No +.LP +Because all the commands are given to a single shell to execute, such +things as setting shell variables, changing directories, etc., last +beyond the command in which they are found. This also allows shell +compound commands (like +.CW for +loops) to be entered in a natural manner. +Since this could cause problems for some makefiles that depend on +each command being executed by a single shell, PMake has a +.B \-B +.Ix 0 ref compatibility +.Ix 0 ref flags -B +flag (it stands for backwards-compatible) that forces each command to +be given to a separate shell. It also does several other things, all +of which I discourage since they are now old-fashioned.\|.\|.\|. +.No +.LP +A target's shell script is fed to the shell on its (the shell's) input stream. +This means that any commands, such as +.CW ci +that need to get input from the terminal won't work right \*- they'll +get the shell's input, something they probably won't find to their +liking. A simple way around this is to give a command like this: +.DS +ci $(SRCS) < /dev/tty +.DE +This would force the program's input to come from the terminal. If you +can't do this for some reason, your only other alternative is to use +PMake in its fullest compatibility mode. See +.B Compatibility +in chapter 4. +.Ix 0 ref compatibility +.LP +.xH 2 Variables +.LP +PMake, like Make before it, has the ability to save text in variables +to be recalled later at your convenience. Variables in PMake are used +much like variables in the shell and, by tradition, consist of +all upper-case letters (you don't +.I have +to use all upper-case letters. +In fact there's nothing to stop you from calling a variable +.CW @^&$%$ . +Just tradition). Variables are assigned-to using lines of the form +.Ix 0 def variable assignment +.DS +VARIABLE = value +.DE +.Ix 0 def variable assignment +appended-to by +.DS +VARIABLE += value +.DE +.Ix 0 def variable appending +.Ix 0 def variable assignment appended +.Ix 0 def += +conditionally assigned-to (if the variable isn't already defined) by +.DS +VARIABLE ?= value +.DE +.Ix 0 def variable assignment conditional +.Ix 0 def ?= +and assigned-to with expansion (i.e. the value is expanded (see below) +before being assigned to the variable\*-useful for placing a value at +the beginning of a variable, or other things) by +.DS +VARIABLE := value +.DE +.Ix 0 def variable assignment expanded +.Ix 0 def := +.LP +Any whitespace before +.I value +is stripped off. When appending, a space is placed between the old +value and the stuff being appended. +.LP +The final way a variable may be assigned to is using +.DS +VARIABLE != shell-command +.DE +.Ix 0 def variable assignment shell-output +.Ix 0 def != +In this case, +.I shell-command +has all its variables expanded (see below) and is passed off to a +shell to execute. The output of the shell is then placed in the +variable. Any newlines (other than the final one) are replaced by +spaces before the assignment is made. This is typically used to find +the current directory via a line like: +.DS +CWD != pwd +.DE +.LP +.B Note: +this is intended to be used to execute commands that produce small amounts +of output (e.g. ``pwd''). The implementation is less than intelligent and will +likely freeze if you execute something that produces thousands of +bytes of output (8 Kb is the limit on many UNIX systems). +.LP +The value of a variable may be retrieved by enclosing the variable +name in parentheses or curly braces and preceding the whole thing +with a dollar sign. +.LP +For example, to set the variable CFLAGS to the string +.CW "\-I/sprite/src/lib/libc \-O" ,'' `` +you would place a line +.DS +CFLAGS = \-I/sprite/src/lib/libc \-O +.DE +in the makefile and use the word +.CW "$(CFLAGS)" +wherever you would like the string +.CW "\-I/sprite/src/lib/libc \-O" +to appear. This is called variable expansion. +.Ix 0 def variable expansion +.No +.LP +Unlike Make, PMake will not expand a variable unless it knows +the variable exists. E.g. if you have a +.CW "${i}" +in a shell command and you have not assigned a value to the variable +.CW i +(the empty string is considered a value, by the way), where Make would have +substituted the empty string, PMake will leave the +.CW "${i}" +alone. +To keep PMake from substituting for a variable it knows, precede the +dollar sign with another dollar sign. +(e.g. to pass +.CW "${HOME}" +to the shell, use +.CW "$${HOME}" ). +This causes PMake, in effect, to expand the +.CW $ +macro, which expands to a single +.CW $ . +For compatibility, Make's style of variable expansion will be used +if you invoke PMake with any of the compatibility flags (\c +.B \-V , +.B \-B +or +.B \-M . +The +.B \-V +flag alters just the variable expansion). +.Ix 0 ref flags -V +.Ix 0 ref flags -B +.Ix 0 ref flags -M +.Ix 0 ref compatibility +.LP +.Ix 0 ref variable expansion +There are two different times at which variable expansion occurs: +When parsing a dependency line, the expansion occurs immediately +upon reading the line. If any variable used on a dependency line is +undefined, PMake will print a message and exit. +Variables in shell commands are expanded when the command is +executed. +Variables used inside another variable are expanded whenever the outer +variable is expanded (the expansion of an inner variable has no effect +on the outer variable. I.e. if the outer variable is used on a dependency +line and in a shell command, and the inner variable changes value +between when the dependency line is read and the shell command is +executed, two different values will be substituted for the outer +variable). +.Ix 0 def variable types +.LP +Variables come in four flavors, though they are all expanded the same +and all look about the same. They are (in order of expanding scope): +.RS +.IP \(bu 2 +Local variables. +.Ix 0 ref variable local +.IP \(bu 2 +Command-line variables. +.Ix 0 ref variable command-line +.IP \(bu 2 +Global variables. +.Ix 0 ref variable global +.IP \(bu 2 +Environment variables. +.Ix 0 ref variable environment +.RE +.LP +The classification of variables doesn't matter much, except that the +classes are searched from the top (local) to the bottom (environment) +when looking up a variable. The first one found wins. +.xH 3 Local Variables +.LP +.Ix 0 def variable local +Each target can have as many as seven local variables. These are +variables that are only ``visible'' within that target's shell script +and contain such things as the target's name, all of its sources (from +all its dependency lines), those sources that were out-of-date, etc. +Four local variables are defined for all targets. They are: +.RS +.IP ".TARGET" +.Ix 0 def variable local .TARGET +.Ix 0 def .TARGET +The name of the target. +.IP ".OODATE" +.Ix 0 def variable local .OODATE +.Ix 0 def .OODATE +The list of the sources for the target that were considered out-of-date. +The order in the list is not guaranteed to be the same as the order in +which the dependencies were given. +.IP ".ALLSRC" +.Ix 0 def variable local .ALLSRC +.Ix 0 def .ALLSRC +The list of all sources for this target in the order in which they +were given. +.IP ".PREFIX" +.Ix 0 def variable local .PREFIX +.Ix 0 def .PREFIX +The target without its suffix and without any leading path. E.g. for +the target +.CW ../../lib/compat/fsRead.c , +this variable would contain +.CW fsRead . +.RE +.LP +Three other local variables are set only for certain targets under +special circumstances. These are the ``.IMPSRC,'' +.Ix 0 ref variable local .IMPSRC +.Ix 0 ref .IMPSRC +``.ARCHIVE,'' +.Ix 0 ref variable local .ARCHIVE +.Ix 0 ref .ARCHIVE +and ``.MEMBER'' +.Ix 0 ref variable local .MEMBER +.Ix 0 ref .MEMBER +variables. When they are set and how they are used is described later. +.LP +Four of these variables may be used in sources as well as in shell +scripts. +.Ix 0 def "dynamic source" +.Ix 0 def source dynamic +These are ``.TARGET'', ``.PREFIX'', ``.ARCHIVE'' and ``.MEMBER''. The +variables in the sources are expanded once for each target on the +dependency line, providing what is known as a ``dynamic source,'' +.Rd 0 +allowing you to specify several dependency lines at once. For example, +.DS +$(OBJS) : $(.PREFIX).c +.DE +will create a dependency between each object file and its +corresponding C source file. +.xH 3 Command-line Variables +.LP +.Ix 0 def variable command-line +Command-line variables are set when PMake is first invoked by giving a +variable assignment as one of the arguments. For example, +.DS +pmake "CFLAGS = -I/sprite/src/lib/libc -O" +.DE +would make +.CW CFLAGS +be a command-line variable with the given value. Any assignments to +.CW CFLAGS +in the makefile will have no effect, because once it +is set, there is (almost) nothing you can do to change a command-line +variable (the search order, you see). Command-line variables may be +set using any of the four assignment operators, though only +.CW = +and +.CW ?= +behave as you would expect them to, mostly because assignments to +command-line variables are performed before the makefile is read, thus +the values set in the makefile are unavailable at the time. +.CW += +.Ix 0 ref += +.Ix 0 ref variable assignment appended +is the same as +.CW = , +because the old value of the variable is sought only in the scope in +which the assignment is taking place (for reasons of efficiency that I +won't get into here). +.CW := +and +.CW ?= +.Ix 0 ref := +.Ix 0 ref ?= +.Ix 0 ref variable assignment expanded +.Ix 0 ref variable assignment conditional +will work if the only variables used are in the environment. +.CW != +is sort of pointless to use from the command line, since the same +effect can no doubt be accomplished using the shell's own command +substitution mechanisms (backquotes and all that). +.xH 3 Global Variables +.LP +.Ix 0 def variable global +Global variables are those set or appended-to in the makefile. +There are two classes of global variables: those you set and those PMake sets. +As I said before, the ones you set can have any name you want them to have, +except they may not contain a colon or an exclamation point. +The variables PMake sets (almost) always begin with a +period and always contain upper-case letters, only. The variables are +as follows: +.RS +.IP .PMAKE +.Ix 0 def variable global .PMAKE +.Ix 0 def .PMAKE +.Ix 0 def variable global MAKE +.Ix 0 def MAKE +The name by which PMake was invoked is stored in this variable. For +compatibility, the name is also stored in the MAKE variable. +.IP .MAKEFLAGS +.Ix 0 def variable global .MAKEFLAGS +.Ix 0 def .MAKEFLAGS variable +.Ix 0 def variable global MFLAGS +.Ix 0 def MFLAGS +All the relevant flags with which PMake was invoked. This does not +include such things as +.B \-f +or variable assignments. Again for compatibility, this value is stored +in the MFLAGS variable as well. +.RE +.LP +Two other variables, ``.INCLUDES'' and ``.LIBS,'' are covered in the +section on special targets in chapter 3. +.Ix 0 ref variable global .INCLUDES +.Ix 0 ref variable global .LIBS +.LP +Global variables may be deleted using lines of the form: +.Ix 0 def #undef +.Ix 0 def variable deletion +.DS +#undef \fIvariable\fP +.DE +The +.CW # ' ` +must be the first character on the line. Note that this may only be +done on global variables. +.xH 3 Environment Variables +.LP +.Ix 0 def variable environment +Environment variables are passed by the shell that invoked PMake and +are given by PMake to each shell it invokes. They are expanded like +any other variable, but they cannot be altered in any way. +.LP +One special environment variable, +.CW PMAKE , +.Ix 0 def variable environment PMAKE +is examined by PMake for command-line flags, variable assignments, +etc., it should always use. This variable is examined before the +actual arguments to PMake are. In addition, all flags given to PMake, +either through the +.CW PMAKE +variable or on the command line, are placed in this environment +variable and exported to each shell PMake executes. Thus recursive +invocations of PMake automatically receive the same flags as the +top-most one. +.LP +Using all these variables, you can compress the sample makefile even more: +.DS +OBJS = a.o b.o c.o +program : $(OBJS) + cc $(.ALLSRC) \-o $(.TARGET) +$(OBJS) : defs.h +a.o : a.c + cc \-c a.c +b.o : b.c + cc \-c b.c +c.o : c.c + cc \-c c.c +.DE +.Ix 0 ref variable local .ALLSRC +.Ix 0 ref .ALLSRC +.Ix 0 ref variable local .TARGET +.Ix 0 ref .TARGET +.Rd 3 +.xH 2 Comments +.LP +.Ix 0 def comments +Comments in a makefile start with a `#' character and extend to the +end of the line. They may appear +anywhere you want them, except in a shell command (though the shell +will treat it as a comment, too). If, for some reason, you need to use the `#' +in a variable or on a dependency line, put a backslash in front of it. +PMake will compress the two into a single `#' (Note: this isn't true +if PMake is operating in full-compatibility mode). +.Ix 0 ref flags -M +.Ix 0 ref compatibility +.xH 2 Parallelism +.No +.LP +PMake was specifically designed to re-create several targets at once, +when possible. You do not have to do anything special to cause this to +happen (unless PMake was configured to not act in parallel, in which +case you will have to make use of the +.B \-L +and +.B \-J +flags (see below)), +.Ix 0 ref flags -L +.Ix 0 ref flags -J +but you do have to be careful at times. +.LP +There are several problems you are likely to encounter. One is +that some makefiles (and programs) are written in such a way that it is +impossible for two targets to be made at once. The program +.CW xstr , +for example, +always modifies the files +.CW strings +and +.CW x.c . +There is no way to change it. Thus you cannot run two of them at once +without something being trashed. Similarly, if you have commands +in the makefile that always send output to the same file, you will not +be able to make more than one target at once unless you change the +file you use. You can, for instance, add a +.CW $$$$ +to the end of the file name to tack on the process ID of the shell +executing the command (each +.CW $$ +expands to a single +.CW $ , +thus giving you the shell variable +.CW $$ ). +Since only one shell is used for all the +commands, you'll get the same file name for each command in the +script. +.LP +The other problem comes from improperly-specified dependencies that +worked in Make because of its sequential, depth-first way of examining +them. While I don't want to go into depth on how PMake +works (look in chapter 4 if you're interested), I will warn you that +files in two different ``levels'' of the dependency tree may be +examined in a different order in PMake than they were in Make. For +example, given the makefile +.DS +a : b c +b : d +.DE +PMake will examine the targets in the order +.CW c , +.CW d , +.CW b , +.CW a . +If the makefile's author expected PMake to abort before making +.CW c +if an error occurred while making +.CW b , +or if +.CW b +needed to exist before +.CW c +was made, +s/he will be sorely disappointed. The dependencies are +incomplete, since in both these cases, +.CW c +would depend on +.CW b . +So watch out. +.LP +Another problem you may face is that, while PMake is set up to handle the +output from multiple jobs in a graceful fashion, the same is not so for input. +It has no way to regulate input to different jobs, +so if you use the redirection from +.CW /dev/tty +I mentioned earlier, you must be careful not to run two of the jobs at once. +.xH 2 Writing and Debugging a Makefile +.LP +Now you know most of what's in a makefile, what do you do next? There +are two choices: (1) use one of the uncommonly-available makefile +generators or (2) write your own makefile (I leave out the third choice of +ignoring PMake and doing everything by hand as being beyond the bounds +of common sense). +.LP +When faced with the writing of a makefile, it is usually best to start +from first principles: just what +.I are *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 10:52:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C5931065672; Sat, 4 Dec 2010 10:52:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 9E8198FC24; Sat, 4 Dec 2010 10:52:37 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oB4AqXiY042765 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 Dec 2010 12:52:33 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oB4AqWjR081735; Sat, 4 Dec 2010 12:52:32 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oB4AqW6u081734; Sat, 4 Dec 2010 12:52:32 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 4 Dec 2010 12:52:32 +0200 From: Kostik Belousov To: Roman Divacky Message-ID: <20101204105232.GI2392@deviant.kiev.zoral.com.ua> References: <201012032154.oB3LsADC035461@svn.freebsd.org> <201012031744.01956.jkim@FreeBSD.org> <201012031802.40083.jkim@FreeBSD.org> <201012031817.23834.jkim@FreeBSD.org> <20101204103625.GA106@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PtQ9L71AUUAqcVqK" Content-Disposition: inline In-Reply-To: <20101204103625.GA106@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin , Jung-uk Kim Subject: Re: svn commit: r216161 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 10:52:38 -0000 --PtQ9L71AUUAqcVqK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 04, 2010 at 11:36:25AM +0100, Roman Divacky wrote: > On Fri, Dec 03, 2010 at 06:17:16PM -0500, Jung-uk Kim wrote: > > On Friday 03 December 2010 06:02 pm, Jung-uk Kim wrote: > > > On Friday 03 December 2010 05:43 pm, Jung-uk Kim wrote: > > > > On Friday 03 December 2010 05:08 pm, John Baldwin wrote: > > > > > On Friday, December 03, 2010 4:54:10 pm Jung-uk Kim wrote: > > > > > > Author: jkim > > > > > > Date: Fri Dec 3 21:54:10 2010 > > > > > > New Revision: 216161 > > > > > > URL: http://svn.freebsd.org/changeset/base/216161 > > > > > > > > > > > > Log: > > > > > > Explicitly initialize TSC frequency. To calibrate TSC > > > > > > frequency, we use DELAY(9) and it may use TSC in turn if TSC > > > > > > frequency is non-zero. > > > > > > > > > > We zero the BSS, so these were already zero. This just makes > > > > > the actual kernel file on disk larger by wasting space in .data > > > > > instead of .bss. > > > > > > > > Please note that I didn't touch other variables, e.g., > > > > tsc_is_broken, because I knew that. However, I just wanted to do > > > > that *explicitly*. Anyway, it is reverted now and SVN will > > > > remember what I wanted to do. ;-) > > > > > > > > BTW, if my memory serves, GCC (and all modern C compilers) put(s) > > > > zero-initialized variables back in .bss. > > > > > > I just tried it. GCC generates identical binaries as I thought. > > > However, Clang doesn't do the optimization. :-/ > >=20 > > Strangely, Clang increases .bss when a global variable is explicitly=20 > > initialized to zero. > >=20 > > - 2 .bss 00000004 0000000000000000 0000000000000000 00000540 2**2 > > + 2 .bss 00000014 0000000000000000 0000000000000000 00000540 2**3 >=20 > in my naive test gcc produces: >=20 > .globl foo > .section .bss > .align 4 > .type foo, @object > .size foo, 4 > foo: > .zero 4 >=20 >=20 > and clang produces: >=20 > .type foo,@object # @foo > .bss > .globl foo > .align 4 > foo: > .long 0 # 0x0 > .size foo, 4 >=20 > ie. both put them into BSS I have no idea how and where your gcc is configured, in particular, I find the non-documenting directive .zero somewhat puzzling. Behaviour of clang looks like a plain bug, since initialized objects must be put into the .data section, not into .bss. Both gcc 4.2.1/FreeBSD and plain 4.5.1 produce .comm foo,4,4 when compiling the file consisting of long foo; line. For amd64, substitute 4 by 8. --PtQ9L71AUUAqcVqK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAkz6HXAACgkQC3+MBN1Mb4hOSQCbBLSPdxmDzDgLFrG4NPzBA3iM 7ZEAoK420VpgIQFqLt37Tr2aCjvnL0zh =BN/r -----END PGP SIGNATURE----- --PtQ9L71AUUAqcVqK-- From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 10:54:23 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C0EA106564A; Sat, 4 Dec 2010 10:54:23 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id C70A38FC16; Sat, 4 Dec 2010 10:54:22 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 0FB889CB0DD; Sat, 4 Dec 2010 11:36:26 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id k0WBsZg79DAG; Sat, 4 Dec 2010 11:36:25 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 660949CB14A; Sat, 4 Dec 2010 11:36:25 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id oB4AaPHK002206; Sat, 4 Dec 2010 11:36:25 +0100 (CET) (envelope-from rdivacky) Date: Sat, 4 Dec 2010 11:36:25 +0100 From: Roman Divacky To: Jung-uk Kim Message-ID: <20101204103625.GA106@freebsd.org> References: <201012032154.oB3LsADC035461@svn.freebsd.org> <201012031744.01956.jkim@FreeBSD.org> <201012031802.40083.jkim@FreeBSD.org> <201012031817.23834.jkim@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012031817.23834.jkim@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r216161 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 10:54:23 -0000 On Fri, Dec 03, 2010 at 06:17:16PM -0500, Jung-uk Kim wrote: > On Friday 03 December 2010 06:02 pm, Jung-uk Kim wrote: > > On Friday 03 December 2010 05:43 pm, Jung-uk Kim wrote: > > > On Friday 03 December 2010 05:08 pm, John Baldwin wrote: > > > > On Friday, December 03, 2010 4:54:10 pm Jung-uk Kim wrote: > > > > > Author: jkim > > > > > Date: Fri Dec 3 21:54:10 2010 > > > > > New Revision: 216161 > > > > > URL: http://svn.freebsd.org/changeset/base/216161 > > > > > > > > > > Log: > > > > > Explicitly initialize TSC frequency. To calibrate TSC > > > > > frequency, we use DELAY(9) and it may use TSC in turn if TSC > > > > > frequency is non-zero. > > > > > > > > We zero the BSS, so these were already zero. This just makes > > > > the actual kernel file on disk larger by wasting space in .data > > > > instead of .bss. > > > > > > Please note that I didn't touch other variables, e.g., > > > tsc_is_broken, because I knew that. However, I just wanted to do > > > that *explicitly*. Anyway, it is reverted now and SVN will > > > remember what I wanted to do. ;-) > > > > > > BTW, if my memory serves, GCC (and all modern C compilers) put(s) > > > zero-initialized variables back in .bss. > > > > I just tried it. GCC generates identical binaries as I thought. > > However, Clang doesn't do the optimization. :-/ > > Strangely, Clang increases .bss when a global variable is explicitly > initialized to zero. > > - 2 .bss 00000004 0000000000000000 0000000000000000 00000540 2**2 > + 2 .bss 00000014 0000000000000000 0000000000000000 00000540 2**3 in my naive test gcc produces: .globl foo .section .bss .align 4 .type foo, @object .size foo, 4 foo: .zero 4 and clang produces: .type foo,@object # @foo .bss .globl foo .align 4 foo: .long 0 # 0x0 .size foo, 4 ie. both put them into BSS From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 11:40:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03A3E1065672; Sat, 4 Dec 2010 11:40:41 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB43C8FC1F; Sat, 4 Dec 2010 11:40:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB4Bee90063860; Sat, 4 Dec 2010 11:40:40 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB4Bee6Z063857; Sat, 4 Dec 2010 11:40:40 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201012041140.oB4Bee6Z063857@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 4 Dec 2010 11:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216179 - in head: . tools/build/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 11:40:41 -0000 Author: uqs Date: Sat Dec 4 11:40:40 2010 New Revision: 216179 URL: http://svn.freebsd.org/changeset/base/216179 Log: Document two more ways to find duplicates in the obsolete file list. Remove the only duplicate found by the optional files check. Fix typos, while here. Suggested by: netchild Modified: head/ObsoleteFiles.inc head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Dec 4 10:11:20 2010 (r216178) +++ head/ObsoleteFiles.inc Sat Dec 4 11:40:40 2010 (r216179) @@ -22,16 +22,31 @@ # grep '+=' /usr/src/tools/build/mk/OptionalObsoleteFiles.inc | sort -u) | \ # sort | uniq -d # +# To find regular duplicates not dependant on optional components, you can +# also use something that will not give you false positives, e.g.: +# for t in `make -V TARGETS universe`; do +# __MAKE_CONF=/dev/null make -f Makefile.inc1 TARGET=$t \ +# -V OLD_FILES -V OLD_LIBS -V OLD_DIRS check-old | \ +# xargs -n1 | sort | uniq -d; +# done +# +# For optional components, you can use the following to see if some entries +# in OptionalObsoleteFiles.inc have been obsoleted by ObsoleteFiles.inc +# for o in tools/build/options/WITH*; do +# __MAKE_CONF=/dev/null make -f Makefile.inc1 -D${o##*/} \ +# -V OLD_FILES -V OLD_LIBS -V OLD_DIRS check-old | \ +# xargs -n1 | sort | uniq -d; +# done # 20101112: vgonel(9) has gone to private API a while ago OLD_FILES+=usr/share/man/man9/vgonel.9.gz # 20101112: removed gasp.info OLD_FILES+=usr/share/info/gasp.info.gz -# 20101109: headers moved to machine/ to x86/ +# 20101109: headers moved from machine/ to x86/ .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/machine/mptable.h .endif -# 20101101: headers moved to machine/ to x86/ +# 20101101: headers moved from machine/ to x86/ .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" OLD_FILES+=usr/include/machine/apicreg.h OLD_FILES+=usr/include/machine/mca.h Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 4 10:11:20 2010 (r216178) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 4 11:40:40 2010 (r216179) @@ -1869,7 +1869,6 @@ OLD_FILES+=usr/lib/libfl_p.a OLD_FILES+=usr/lib/libform_p.a OLD_FILES+=usr/lib/libformw_p.a OLD_FILES+=usr/lib/libftpio_p.a -OLD_FILES+=usr/lib/libg2c_p.a OLD_FILES+=usr/lib/libgcc_p.a OLD_FILES+=usr/lib/libgeom_p.a OLD_FILES+=usr/lib/libgnuregex_p.a From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 11:44:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7B47106566B; Sat, 4 Dec 2010 11:44:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 3C6F88FC16; Sat, 4 Dec 2010 11:44:46 +0000 (UTC) Received: from c211-30-187-94.carlnfd1.nsw.optusnet.com.au (c211-30-187-94.carlnfd1.nsw.optusnet.com.au [211.30.187.94]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oB4BihTW028774 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 Dec 2010 22:44:44 +1100 Date: Sat, 4 Dec 2010 22:44:43 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kostik Belousov In-Reply-To: <20101204105232.GI2392@deviant.kiev.zoral.com.ua> Message-ID: <20101204223204.I2292@besplex.bde.org> References: <201012032154.oB3LsADC035461@svn.freebsd.org> <201012031744.01956.jkim@FreeBSD.org> <201012031802.40083.jkim@FreeBSD.org> <201012031817.23834.jkim@FreeBSD.org> <20101204103625.GA106@freebsd.org> <20101204105232.GI2392@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Roman Divacky , Jung-uk Kim Subject: Re: svn commit: r216161 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 11:44:47 -0000 On Sat, 4 Dec 2010, Kostik Belousov wrote: > On Sat, Dec 04, 2010 at 11:36:25AM +0100, Roman Divacky wrote: >> On Fri, Dec 03, 2010 at 06:17:16PM -0500, Jung-uk Kim wrote: > ... >>>> I just tried it. GCC generates identical binaries as I thought. >>>> However, Clang doesn't do the optimization. :-/ >>> >>> Strangely, Clang increases .bss when a global variable is explicitly >>> initialized to zero. >>> >>> - 2 .bss 00000004 0000000000000000 0000000000000000 00000540 2**2 >>> + 2 .bss 00000014 0000000000000000 0000000000000000 00000540 2**3 >> >> in my naive test gcc produces: >> >> .globl foo >> .section .bss >> .align 4 >> .type foo, @object >> .size foo, 4 >> foo: >> .zero 4 >> >> >> and clang produces: >> >> .type foo,@object # @foo >> .bss >> .globl foo >> .align 4 >> foo: >> .long 0 # 0x0 >> .size foo, 4 >> >> ie. both put them into BSS > I have no idea how and where your gcc is configured, in particular, I > find the non-documenting directive .zero somewhat puzzling. All of gcc-3.3.3 on i386 on my local system, and gcc-4.2.1 on amd64 and i386 on FreeBSD cluseter machines produce the .zero, and either the .align or the .p2align. I think '.zero 4' is just a spelling of '.long 0' if longs have size 4. Not clear why the clang asm generates a different object. > Behaviour of clang looks like a plain bug, since initialized objects must > be put into the .data section, not into .bss. Note that gcc does this too in the above. The above is for explicitly initialized (to 0) objects. Such objects can be put in the bss just as validly as implicitly initialized (to 0) ones. > Both gcc 4.2.1/FreeBSD and plain 4.5.1 produce > .comm foo,4,4 > when compiling the file consisting of > long foo; > line. For amd64, substitute 4 by 8. Now the initialization is implicit. I guess the difference is to preserve the possibility of laying out the objects using explicit initialization. Hmm, this only works if they are all explicitly initialized to 0 -- others cannot remain adjacent since they musyt be moved to put them in the data section. Of course, C doesn't require anything for the layout. ABIs might, but I don't know of any other than defacto ones. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 13:13:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AB211065670; Sat, 4 Dec 2010 13:13:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 040028FC16; Sat, 4 Dec 2010 13:13:49 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:75bb:8efc:4511:c2ad] (unknown [IPv6:2001:7b8:3a7:0:75bb:8efc:4511:c2ad]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 1B8D75C5A; Sat, 4 Dec 2010 14:13:47 +0100 (CET) Message-ID: <4CFA3E91.7090202@FreeBSD.org> Date: Sat, 04 Dec 2010 14:13:53 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.14pre) Gecko/20101201 Lanikai/3.1.8pre MIME-Version: 1.0 To: Kostik Belousov References: <201012032154.oB3LsADC035461@svn.freebsd.org> <201012031744.01956.jkim@FreeBSD.org> <201012031802.40083.jkim@FreeBSD.org> <201012031817.23834.jkim@FreeBSD.org> <20101204103625.GA106@freebsd.org> <20101204105232.GI2392@deviant.kiev.zoral.com.ua> In-Reply-To: <20101204105232.GI2392@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Roman Divacky , Jung-uk Kim Subject: Re: svn commit: r216161 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 13:13:49 -0000 On 2010-12-04 11:52, Kostik Belousov wrote: ... > I have no idea how and where your gcc is configured, in particular, I > find the non-documenting directive .zero somewhat puzzling. According to the gas sources (see contrib/binutils/gas/read.c, line 412), .zero is equivalent to .skip, which itself is equivalent to .space, except for HPPA targets. > Behaviour of clang looks like a plain bug, since initialized objects must > be put into the .data section, not into .bss. I think the only requirement is that the object is initialized at runtime with the value you specified at compile time. If you specify zero, it is simply an optimization to put it in BSS (which is really just an implementation detail). There is even a gcc flag to control this behaviour: -fno-zero-initialized-in-bss If the target supports a BSS section, GCC by default puts variables that are initialized to zero into BSS. This can save space in the resulting code. This option turns off this behavior because some programs explicitly rely on variables going to the data section. E.g., so that the resulting executable can find the beginning of that section and/or make assumptions based on that. The default is -fzero-initialized-in-bss. Clang also supports this flag, and its default setting is the same as gcc's. From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 14:19:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0129B106566B; Sat, 4 Dec 2010 14:19:28 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2AB78FC08; Sat, 4 Dec 2010 14:19:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB4EJRDd077513; Sat, 4 Dec 2010 14:19:27 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB4EJRsa077507; Sat, 4 Dec 2010 14:19:27 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201012041419.oB4EJRsa077507@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 4 Dec 2010 14:19:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216184 - in head: contrib/traceroute usr.sbin/traceroute X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 14:19:28 -0000 Author: uqs Date: Sat Dec 4 14:19:27 2010 New Revision: 216184 URL: http://svn.freebsd.org/changeset/base/216184 Log: traceroute(8): make WARNS=3 clean Also fixes an operator precedence bug for TCP tracerouting Modified: head/contrib/traceroute/as.c head/contrib/traceroute/as.h head/contrib/traceroute/ifaddrlist.c head/contrib/traceroute/traceroute.c head/usr.sbin/traceroute/Makefile Modified: head/contrib/traceroute/as.c ============================================================================== --- head/contrib/traceroute/as.c Sat Dec 4 13:06:41 2010 (r216183) +++ head/contrib/traceroute/as.c Sat Dec 4 14:19:27 2010 (r216184) @@ -56,13 +56,14 @@ struct aslookup { }; void * -as_setup(char *server) +as_setup(const char *server) { struct aslookup *asn; struct addrinfo hints, *res0, *res; FILE *f; int s, error; + s = -1; if (server == NULL) server = getenv("RA_SERVER"); if (server == NULL) Modified: head/contrib/traceroute/as.h ============================================================================== --- head/contrib/traceroute/as.h Sat Dec 4 13:06:41 2010 (r216183) +++ head/contrib/traceroute/as.h Sat Dec 4 14:19:27 2010 (r216184) @@ -30,6 +30,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -void *as_setup(char *); +void *as_setup(const char *); unsigned int as_lookup(void *, char *, sa_family_t); void as_shutdown(void *); Modified: head/contrib/traceroute/ifaddrlist.c ============================================================================== --- head/contrib/traceroute/ifaddrlist.c Sat Dec 4 13:06:41 2010 (r216183) +++ head/contrib/traceroute/ifaddrlist.c Sat Dec 4 14:19:27 2010 (r216184) @@ -71,14 +71,14 @@ ifaddrlist(register struct ifaddrlist ** { register int fd, nipaddr; #ifdef HAVE_SOCKADDR_SA_LEN - register int n; + size_t n; #endif register struct ifreq *ifrp, *ifend, *ifnext, *mp; register struct sockaddr_in *sin; register struct ifaddrlist *al; struct ifconf ifc; struct ifreq ibuf[(32 * 1024) / sizeof(struct ifreq)], ifr; -#define MAX_IPADDR (sizeof(ibuf) / sizeof(ibuf[0])) +#define MAX_IPADDR ((int)(sizeof(ibuf) / sizeof(ibuf[0]))) static struct ifaddrlist ifaddrlist[MAX_IPADDR]; char device[sizeof(ifr.ifr_name) + 1]; @@ -91,10 +91,10 @@ ifaddrlist(register struct ifaddrlist ** ifc.ifc_buf = (caddr_t)ibuf; if (ioctl(fd, SIOCGIFCONF, (char *)&ifc) < 0 || - ifc.ifc_len < sizeof(struct ifreq)) { + ifc.ifc_len < (int)sizeof(struct ifreq)) { if (errno == EINVAL) (void)sprintf(errbuf, - "SIOCGIFCONF: ifreq struct too small (%d bytes)", + "SIOCGIFCONF: ifreq struct too small (%zu bytes)", sizeof(ibuf)); else (void)sprintf(errbuf, "SIOCGIFCONF: %s", Modified: head/contrib/traceroute/traceroute.c ============================================================================== --- head/contrib/traceroute/traceroute.c Sat Dec 4 13:06:41 2010 (r216183) +++ head/contrib/traceroute/traceroute.c Sat Dec 4 14:19:27 2010 (r216184) @@ -220,7 +220,6 @@ static const char rcsid[] = #include #include #include -#include #include #include @@ -1424,7 +1423,7 @@ tcp_check(const u_char *data, int seq) return (ntohs(tcp->th_sport) == ident && ntohs(tcp->th_dport) == port + (fixedPort ? 0 : seq)) - && tcp->th_seq == (ident << 16) | (port + seq); + && tcp->th_seq == (((tcp_seq)ident << 16) | (port + seq)); } void @@ -1497,19 +1496,17 @@ u_short p_cksum(struct ip *ip, u_short *data, int len) { static struct ipovly ipo; - u_short sumh, sumd; - u_long sumt; + u_short sum[2]; ipo.ih_pr = ip->ip_p; ipo.ih_len = htons(len); ipo.ih_src = ip->ip_src; ipo.ih_dst = ip->ip_dst; - sumh = in_cksum((u_short*)&ipo, sizeof(ipo)); /* pseudo ip hdr cksum */ - sumd = in_cksum((u_short*)data, len); /* payload data cksum */ - sumt = (sumh << 16) | (sumd); + sum[1] = in_cksum((u_short*)&ipo, sizeof(ipo)); /* pseudo ip hdr cksum */ + sum[0] = in_cksum(data, len); /* payload data cksum */ - return ~in_cksum((u_short*)&sumt, sizeof(sumt)); + return ~in_cksum(sum, sizeof(sum)); } /* Modified: head/usr.sbin/traceroute/Makefile ============================================================================== --- head/usr.sbin/traceroute/Makefile Sat Dec 4 13:06:41 2010 (r216183) +++ head/usr.sbin/traceroute/Makefile Sat Dec 4 14:19:27 2010 (r216184) @@ -31,7 +31,7 @@ LDADD= -lipsec CFLAGS+= -I${TRACEROUTE_DISTDIR} -WARNS?= 0 +WARNS?= 3 version.c: ${TRACEROUTE_DISTDIR}/VERSION @rm -f ${.TARGET} From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 14:19:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D174210657C7; Sat, 4 Dec 2010 14:19:35 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF47B8FC0A; Sat, 4 Dec 2010 14:19:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB4EJZWc077578; Sat, 4 Dec 2010 14:19:35 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB4EJZ3X077575; Sat, 4 Dec 2010 14:19:35 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201012041419.oB4EJZ3X077575@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 4 Dec 2010 14:19:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216185 - head/usr.sbin/traceroute6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 14:19:36 -0000 Author: uqs Date: Sat Dec 4 14:19:35 2010 New Revision: 216185 URL: http://svn.freebsd.org/changeset/base/216185 Log: traceroute6(8): make WARNS=3 clean Modified: head/usr.sbin/traceroute6/Makefile head/usr.sbin/traceroute6/traceroute6.c Modified: head/usr.sbin/traceroute6/Makefile ============================================================================== --- head/usr.sbin/traceroute6/Makefile Sat Dec 4 14:19:27 2010 (r216184) +++ head/usr.sbin/traceroute6/Makefile Sat Dec 4 14:19:35 2010 (r216185) @@ -25,7 +25,7 @@ BINMODE= 4555 CFLAGS+= -DIPSEC -DUSE_RFC2292BIS -DHAVE_POLL CFLAGS+= -I${.CURDIR} -I${TRACEROUTE_DISTDIR} -I. -WARNS?= 1 +WARNS?= 3 DPADD= ${LIBIPSEC} LDADD= -lipsec Modified: head/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.c Sat Dec 4 14:19:27 2010 (r216184) +++ head/usr.sbin/traceroute6/traceroute6.c Sat Dec 4 14:19:35 2010 (r216185) @@ -66,7 +66,7 @@ */ #ifndef lint -static char copyright[] = +static const char copyright[] = "@(#) Copyright (c) 1990, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ @@ -322,7 +322,7 @@ void send_probe(int, u_long); void *get_uphdr(struct ip6_hdr *, u_char *); int get_hoplim(struct msghdr *); double deltaT(struct timeval *, struct timeval *); -char *pr_type(int); +const char *pr_type(int); int packet_ok(struct msghdr *, int, int); void print(struct msghdr *, int); const char *inetname(struct sockaddr *); @@ -372,12 +372,12 @@ main(argc, argv) { int mib[4] = { CTL_NET, PF_INET6, IPPROTO_IPV6, IPV6CTL_DEFHLIM }; char hbuf[NI_MAXHOST], src0[NI_MAXHOST], *ep; - int ch, i, on = 1, seq, rcvcmsglen, error, minlen; + int ch, i, on = 1, seq, rcvcmsglen, error; struct addrinfo hints, *res; static u_char *rcvcmsgbuf; u_long probe, hops, lport; struct hostent *hp; - size_t size; + size_t size, minlen; uid_t uid; /* @@ -671,11 +671,11 @@ main(argc, argv) datalen = minlen; else if (datalen >= MAXPACKET) { fprintf(stderr, - "traceroute6: packet size must be %d <= s < %ld.\n", - minlen, (long)MAXPACKET); + "traceroute6: packet size must be %zu <= s < %d.\n", + minlen, MAXPACKET); exit(1); } - outpacket = (struct opacket *)malloc((unsigned)datalen); + outpacket = malloc(datalen); if (!outpacket) { perror("malloc"); exit(1); @@ -913,7 +913,7 @@ main(argc, argv) for (hops = first_hop; hops <= max_hops; ++hops) { struct in6_addr lastaddr; int got_there = 0; - int unreachable = 0; + unsigned unreachable = 0; printf("%2lu ", hops); bzero(&lastaddr, sizeof(lastaddr)); @@ -1089,7 +1089,7 @@ send_probe(seq, hops) i = sendto(sndsock, (char *)outpacket, datalen, 0, (struct sockaddr *)&Dst, Dst.sin6_len); - if (i < 0 || i != datalen) { + if (i < 0 || (u_long)i != datalen) { if (i < 0) perror("sendto"); printf("traceroute6: wrote %s %lu chars, ret=%d\n", @@ -1129,12 +1129,11 @@ deltaT(t1p, t2p) /* * Convert an ICMP "type" field to a printable string. */ -char * -pr_type(t0) - int t0; +const char * +pr_type(int t0) { u_char t = t0 & 0xff; - char *cp; + const char *cp; switch (t) { case ICMP6_DST_UNREACH: @@ -1221,7 +1220,7 @@ packet_ok(mhdr, cc, seq) cc -= hlen; icp = (struct icmp6_hdr *)(buf + hlen); #else - if (cc < sizeof(struct icmp6_hdr)) { + if (cc < (int)sizeof(struct icmp6_hdr)) { if (verbose) { if (getnameinfo((struct sockaddr *)from, from->sin6_len, hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0) From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 17:41:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A5E4106566C; Sat, 4 Dec 2010 17:41:58 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 889C48FC0C; Sat, 4 Dec 2010 17:41:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB4HfwOf095186; Sat, 4 Dec 2010 17:41:58 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB4HfwvD095184; Sat, 4 Dec 2010 17:41:58 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201012041741.oB4HfwvD095184@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 4 Dec 2010 17:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216186 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 17:41:58 -0000 Author: trasz Date: Sat Dec 4 17:41:58 2010 New Revision: 216186 URL: http://svn.freebsd.org/changeset/base/216186 Log: Fix comment intentation. Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sat Dec 4 14:19:35 2010 (r216185) +++ head/sys/vm/vm_mmap.c Sat Dec 4 17:41:58 2010 (r216186) @@ -276,14 +276,14 @@ mmap(td, uap) if (addr + size < addr) return (EINVAL); } else { - /* - * XXX for non-fixed mappings where no hint is provided or - * the hint would fall in the potential heap space, - * place it after the end of the largest possible heap. - * - * There should really be a pmap call to determine a reasonable - * location. - */ + /* + * XXX for non-fixed mappings where no hint is provided or + * the hint would fall in the potential heap space, + * place it after the end of the largest possible heap. + * + * There should really be a pmap call to determine a reasonable + * location. + */ PROC_LOCK(td->td_proc); if (addr == 0 || (addr >= round_page((vm_offset_t)vms->vm_taddr) && From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 18:52:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E0BA1065670; Sat, 4 Dec 2010 18:52:05 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B1BA8FC0C; Sat, 4 Dec 2010 18:52:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB4Iq5eG001752; Sat, 4 Dec 2010 18:52:05 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB4Iq5Xs001749; Sat, 4 Dec 2010 18:52:05 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012041852.oB4Iq5Xs001749@svn.freebsd.org> From: Doug Barton Date: Sat, 4 Dec 2010 18:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216187 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 18:52:05 -0000 Author: dougb Date: Sat Dec 4 18:52:05 2010 New Revision: 216187 URL: http://svn.freebsd.org/changeset/base/216187 Log: Add MAKEDEV.8 Submitted by: Alex Kozlov Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Dec 4 17:41:58 2010 (r216186) +++ head/ObsoleteFiles.inc Sat Dec 4 18:52:05 2010 (r216187) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20101114: Remove long-obsolete MAKEDEV.8 +OLD_FILES+=usr/share/man/man8/MAKEDEV.8.gz # 20101112: vgonel(9) has gone to private API a while ago OLD_FILES+=usr/share/man/man9/vgonel.9.gz # 20101112: removed gasp.info From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 19:29:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18BE0106564A; Sat, 4 Dec 2010 19:29:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 067928FC08; Sat, 4 Dec 2010 19:29:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB4JTnfL005792; Sat, 4 Dec 2010 19:29:49 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB4JTn4p005788; Sat, 4 Dec 2010 19:29:49 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201012041929.oB4JTn4p005788@svn.freebsd.org> From: Michael Tuexen Date: Sat, 4 Dec 2010 19:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216188 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 19:29:50 -0000 Author: tuexen Date: Sat Dec 4 19:29:49 2010 New Revision: 216188 URL: http://svn.freebsd.org/changeset/base/216188 Log: Fix a bug where also the number of non-renegable gap reports was considered to be potentially renegable. MFC after: 1 day. Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_structs.h Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat Dec 4 18:52:05 2010 (r216187) +++ head/sys/netinet/sctp_indata.c Sat Dec 4 19:29:49 2010 (r216188) @@ -3081,14 +3081,17 @@ sctp_handle_segments(struct mbuf *m, int int num_frs = 0; int chunk_freed; int non_revocable; - uint16_t frag_strt, frag_end; - uint32_t last_frag_high; + uint16_t frag_strt, frag_end, prev_frag_end; - tp1 = NULL; - last_frag_high = 0; + tp1 = TAILQ_FIRST(&asoc->sent_queue); + prev_frag_end = 0; chunk_freed = 0; for (i = 0; i < (num_seg + num_nr_seg); i++) { + if (i == num_seg) { + prev_frag_end = 0; + tp1 = TAILQ_FIRST(&asoc->sent_queue); + } frag = (struct sctp_gap_ack_block *)sctp_m_getptr(m, *offset, sizeof(struct sctp_gap_ack_block), (uint8_t *) & block); *offset += sizeof(block); @@ -3097,58 +3100,29 @@ sctp_handle_segments(struct mbuf *m, int } frag_strt = ntohs(frag->start); frag_end = ntohs(frag->end); - /* some sanity checks on the fragment offsets */ + if (frag_strt > frag_end) { - /* this one is malformed, skip */ + /* This gap report is malformed, skip it. */ continue; } - if (compare_with_wrap((frag_end + last_tsn), *biggest_tsn_acked, - MAX_TSN)) - *biggest_tsn_acked = frag_end + last_tsn; - - /* mark acked dgs and find out the highestTSN being acked */ - if (tp1 == NULL) { + if (frag_strt <= prev_frag_end) { + /* This gap report is not in order, so restart. */ tp1 = TAILQ_FIRST(&asoc->sent_queue); - /* save the locations of the last frags */ - last_frag_high = frag_end + last_tsn; - } else { - /* - * now lets see if we need to reset the queue due to - * a out-of-order SACK fragment - */ - if (compare_with_wrap(frag_strt + last_tsn, - last_frag_high, MAX_TSN)) { - /* - * if the new frag starts after the last TSN - * frag covered, we are ok and this one is - * beyond the last one - */ - ; - } else { - /* - * ok, they have reset us, so we need to - * reset the queue this will cause extra - * hunting but hey, they chose the - * performance hit when they failed to order - * their gaps - */ - tp1 = TAILQ_FIRST(&asoc->sent_queue); - } - last_frag_high = frag_end + last_tsn; + } + if (compare_with_wrap((last_tsn + frag_end), *biggest_tsn_acked, MAX_TSN)) { + *biggest_tsn_acked = last_tsn + frag_end; } if (i < num_seg) { non_revocable = 0; } else { non_revocable = 1; } - if (i == num_seg) { - tp1 = NULL; - } if (sctp_process_segment_range(stcb, &tp1, last_tsn, frag_strt, frag_end, non_revocable, &num_frs, biggest_newly_acked_tsn, this_sack_lowest_newack, ecn_seg_sums)) { chunk_freed = 1; } + prev_frag_end = frag_end; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { if (num_frs) @@ -4817,7 +4791,7 @@ sctp_handle_sack(struct mbuf *m, int off } } /********************************************/ - /* drop the acked chunks from the sendqueue */ + /* drop the acked chunks from the sentqueue */ /********************************************/ asoc->last_acked_seq = cum_ack; @@ -4925,9 +4899,10 @@ done_with_it: * we had some before and now we have NONE. */ - if (num_seg) + if (num_seg) { sctp_check_for_revoked(stcb, asoc, cum_ack, biggest_tsn_acked); - else if (asoc->saw_sack_with_frags) { + asoc->saw_sack_with_frags = 1; + } else if (asoc->saw_sack_with_frags) { int cnt_revoked = 0; tp1 = TAILQ_FIRST(&asoc->sent_queue); @@ -4963,10 +4938,10 @@ done_with_it: } asoc->saw_sack_with_frags = 0; } - if (num_seg || num_nr_seg) - asoc->saw_sack_with_frags = 1; + if (num_nr_seg > 0) + asoc->saw_sack_with_nr_frags = 1; else - asoc->saw_sack_with_frags = 0; + asoc->saw_sack_with_nr_frags = 0; /* JRS - Use the congestion control given in the CC module */ asoc->cc_functions.sctp_cwnd_update_after_sack(stcb, asoc, accum_moved, reneged_all, will_exit_fast_recovery); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Dec 4 18:52:05 2010 (r216187) +++ head/sys/netinet/sctp_input.c Sat Dec 4 19:29:49 2010 (r216188) @@ -4644,6 +4644,7 @@ process_control_chunks: ((compare_with_wrap(cum_ack, stcb->asoc.last_acked_seq, MAX_TSN)) || (cum_ack == stcb->asoc.last_acked_seq)) && (stcb->asoc.saw_sack_with_frags == 0) && + (stcb->asoc.saw_sack_with_nr_frags == 0) && (!TAILQ_EMPTY(&stcb->asoc.sent_queue)) ) { /* @@ -4737,6 +4738,7 @@ process_control_chunks: ((compare_with_wrap(cum_ack, stcb->asoc.last_acked_seq, MAX_TSN)) || (cum_ack == stcb->asoc.last_acked_seq)) && (stcb->asoc.saw_sack_with_frags == 0) && + (stcb->asoc.saw_sack_with_nr_frags == 0) && (!TAILQ_EMPTY(&stcb->asoc.sent_queue))) { /* * We have a SIMPLE sack having no Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Sat Dec 4 18:52:05 2010 (r216187) +++ head/sys/netinet/sctp_structs.h Sat Dec 4 19:29:49 2010 (r216188) @@ -1058,6 +1058,7 @@ struct sctp_association { uint8_t delayed_connection; uint8_t ifp_had_enobuf; uint8_t saw_sack_with_frags; + uint8_t saw_sack_with_nr_frags; uint8_t in_asocid_hash; uint8_t assoc_up_sent; uint8_t adaptation_needed; From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 21:54:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 431431065673; Sat, 4 Dec 2010 21:54:24 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 175FF8FC1D; Sat, 4 Dec 2010 21:54:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB4LsN6D032367; Sat, 4 Dec 2010 21:54:23 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB4LsNio032366; Sat, 4 Dec 2010 21:54:23 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201012042154.oB4LsNio032366@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 4 Dec 2010 21:54:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216189 - head/usr.sbin/usbdevs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 21:54:24 -0000 Author: uqs Date: Sat Dec 4 21:54:23 2010 New Revision: 216189 URL: http://svn.freebsd.org/changeset/base/216189 Log: De-orbit usbdevs(8) which hasn't worked with the new USB stack for a long time now. usbconfig(8) should be an adequate replacement. Deleted: head/usr.sbin/usbdevs/ From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 23:24:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DE47106566B; Sat, 4 Dec 2010 23:24:35 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BCF08FC14; Sat, 4 Dec 2010 23:24:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB4NOZ7p045843; Sat, 4 Dec 2010 23:24:35 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB4NOZ3E045841; Sat, 4 Dec 2010 23:24:35 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012042324.oB4NOZ3E045841@svn.freebsd.org> From: Colin Percival Date: Sat, 4 Dec 2010 23:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216190 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 23:24:35 -0000 Author: cperciva Date: Sat Dec 4 23:24:35 2010 New Revision: 216190 URL: http://svn.freebsd.org/changeset/base/216190 Log: Remove unnecessary #includes which seem to have been accidentally added as part of CVS r1.76 (in January 2006). Modified: head/sys/i386/i386/busdma_machdep.c Modified: head/sys/i386/i386/busdma_machdep.c ============================================================================== --- head/sys/i386/i386/busdma_machdep.c Sat Dec 4 21:54:23 2010 (r216189) +++ head/sys/i386/i386/busdma_machdep.c Sat Dec 4 23:24:35 2010 (r216190) @@ -28,9 +28,6 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Sat Dec 4 23:36:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE89F106564A; Sat, 4 Dec 2010 23:36:40 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC4248FC22; Sat, 4 Dec 2010 23:36:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oB4Naeji046813; Sat, 4 Dec 2010 23:36:40 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB4NaeID046811; Sat, 4 Dec 2010 23:36:40 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012042336.oB4NaeID046811@svn.freebsd.org> From: Colin Percival Date: Sat, 4 Dec 2010 23:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216191 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Dec 2010 23:36:40 -0000 Author: cperciva Date: Sat Dec 4 23:36:40 2010 New Revision: 216191 URL: http://svn.freebsd.org/changeset/base/216191 Log: Remove gratuitous i386/amd64 inconsistency in favour of the less verbose version of declaring a variable initialized to zero. Modified: head/sys/i386/i386/busdma_machdep.c Modified: head/sys/i386/i386/busdma_machdep.c ============================================================================== --- head/sys/i386/i386/busdma_machdep.c Sat Dec 4 23:24:35 2010 (r216190) +++ head/sys/i386/i386/busdma_machdep.c Sat Dec 4 23:36:40 2010 (r216191) @@ -858,7 +858,7 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_callback2_t *callback, void *callback_arg, int flags) { - bus_addr_t lastaddr; + bus_addr_t lastaddr = 0; int nsegs, error, first, i; bus_size_t resid; struct iovec *iov; @@ -878,7 +878,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, nsegs = 0; error = 0; first = 1; - lastaddr = (bus_addr_t) 0; for (i = 0; i < uio->uio_iovcnt && resid != 0 && !error; i++) { /* * Now at the first iovec to load. Load each iovec