From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 00:05:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5093676; Sun, 21 Sep 2014 00:05:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6897BEF; Sun, 21 Sep 2014 00:05:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8L05iti007778; Sun, 21 Sep 2014 00:05:44 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8L05iai007777; Sun, 21 Sep 2014 00:05:44 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409210005.s8L05iai007777@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 21 Sep 2014 00:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271913 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 00:05:44 -0000 Author: bz Date: Sun Sep 21 00:05:44 2014 New Revision: 271913 URL: http://svnweb.freebsd.org/changeset/base/271913 Log: Hide LRO code under #ifdef INET/INET6 to allow NOIP kernel to compile. While the code comments indicate that LRO is currently only supported for IPv4/TCP, we'll still compile it in for IPv6. MFC after: 3 days Modified: head/sys/dev/ixl/ixl_txrx.c Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Sat Sep 20 21:46:31 2014 (r271912) +++ head/sys/dev/ixl/ixl_txrx.c Sun Sep 21 00:05:44 2014 (r271913) @@ -1085,10 +1085,12 @@ ixl_allocate_rx_data(struct ixl_queue *q int ixl_init_rx_ring(struct ixl_queue *que) { + struct rx_ring *rxr = &que->rxr; +#if defined(INET6) || defined(INET) struct ixl_vsi *vsi = que->vsi; struct ifnet *ifp = vsi->ifp; - struct rx_ring *rxr = &que->rxr; struct lro_ctrl *lro = &rxr->lro; +#endif struct ixl_rx_buf *buf; bus_dma_segment_t pseg[1], hseg[1]; int rsize, nsegs, error = 0; @@ -1187,6 +1189,7 @@ skip_head: rxr->bytes = 0; rxr->discard = FALSE; +#if defined(INET6) || defined(INET) /* ** Now set up the LRO interface: */ @@ -1200,6 +1203,7 @@ skip_head: rxr->lro_enabled = TRUE; lro->ifp = vsi->ifp; } +#endif bus_dmamap_sync(rxr->dma.tag, rxr->dma.map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); @@ -1274,6 +1278,8 @@ ixl_free_que_rx(struct ixl_queue *que) static __inline void ixl_rx_input(struct rx_ring *rxr, struct ifnet *ifp, struct mbuf *m, u8 ptype) { + +#if defined(INET6) || defined(INET) /* * ATM LRO is only for IPv4/TCP packets and TCP checksum of the packet * should be computed by hardware. Also it should not have VLAN tag in @@ -1293,6 +1299,7 @@ ixl_rx_input(struct rx_ring *rxr, struct if (tcp_lro_rx(&rxr->lro, m, 0) == 0) return; } +#endif IXL_RX_UNLOCK(rxr); (*ifp->if_input)(ifp, m); IXL_RX_LOCK(rxr); @@ -1350,8 +1357,10 @@ ixl_rxeof(struct ixl_queue *que, int cou struct ixl_vsi *vsi = que->vsi; struct rx_ring *rxr = &que->rxr; struct ifnet *ifp = vsi->ifp; +#if defined(INET6) || defined(INET) struct lro_ctrl *lro = &rxr->lro; struct lro_entry *queued; +#endif int i, nextp, processed = 0; union i40e_rx_desc *cur; struct ixl_rx_buf *rbuf, *nbuf; @@ -1559,6 +1568,7 @@ next_desc: rxr->next_check = i; +#if defined(INET6) || defined(INET) /* * Flush any outstanding LRO work */ @@ -1566,6 +1576,7 @@ next_desc: SLIST_REMOVE_HEAD(&lro->lro_active, next); tcp_lro_flush(lro, queued); } +#endif IXL_RX_UNLOCK(rxr); return (FALSE); From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 03:48:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 396A73FE; Sun, 21 Sep 2014 03:48:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C8E8FF3; Sun, 21 Sep 2014 03:48:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8L3mKRK012479; Sun, 21 Sep 2014 03:48:20 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8L3mKfS012477; Sun, 21 Sep 2014 03:48:20 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201409210348.s8L3mKfS012477@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sun, 21 Sep 2014 03:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271916 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 03:48:21 -0000 Author: hrs Date: Sun Sep 21 03:48:20 2014 New Revision: 271916 URL: http://svnweb.freebsd.org/changeset/base/271916 Log: Make net.add_addr_allfibs vnet-local. Modified: head/sys/net/route.c head/sys/net/route.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sun Sep 21 03:00:30 2014 (r271915) +++ head/sys/net/route.c Sun Sep 21 03:48:20 2014 (r271916) @@ -108,9 +108,9 @@ SYSCTL_UINT(_net, OID_AUTO, fibs, CTLFLA * always work given the fib can be overridden and prefixes can be added * from the network stack context. */ -u_int rt_add_addr_allfibs = 1; -SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN, - &rt_add_addr_allfibs, 0, ""); +VNET_DEFINE(u_int, rt_add_addr_allfibs) = 1; +SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN | CTLFLAG_VNET, + &VNET_NAME(rt_add_addr_allfibs), 0, ""); VNET_DEFINE(struct rtstat, rtstat); #define V_rtstat VNET(rtstat) @@ -1613,9 +1613,9 @@ rtinit1(struct ifaddr *ifa, int cmd, int break; } if (fibnum == RT_ALL_FIBS) { - if (rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) { + if (V_rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) startfib = endfib = ifa->ifa_ifp->if_fib; - } else { + else { startfib = 0; endfib = rt_numfibs - 1; } Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sun Sep 21 03:00:30 2014 (r271915) +++ head/sys/net/route.h Sun Sep 21 03:48:20 2014 (r271916) @@ -34,6 +34,7 @@ #define _NET_ROUTE_H_ #include +#include /* * Kernel resident routing tables. @@ -85,7 +86,8 @@ struct rt_metrics { #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ #define RT_ALL_FIBS -1 /* Announce event for every fib */ extern u_int rt_numfibs; /* number of usable routing tables */ -extern u_int rt_add_addr_allfibs; /* Announce interfaces to all fibs */ +VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all fibs */ +#define V_rt_add_addr_allfibs VNET(rt_add_addr_allfibs) /* * We distinguish between routes to hosts and routes to networks, From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 03:55:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1471656E; Sun, 21 Sep 2014 03:55:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E712E115; Sun, 21 Sep 2014 03:55:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8L3t48t016746; Sun, 21 Sep 2014 03:55:04 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8L3t40q016745; Sun, 21 Sep 2014 03:55:04 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201409210355.s8L3t40q016745@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sun, 21 Sep 2014 03:55:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271917 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 03:55:05 -0000 Author: hrs Date: Sun Sep 21 03:55:04 2014 New Revision: 271917 URL: http://svnweb.freebsd.org/changeset/base/271917 Log: Virtualize interface cloner for gif(4). This fixes a panic when destroying a vnet jail which has a gif(4) interface. Modified: head/sys/net/if_gif.c Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Sun Sep 21 03:48:20 2014 (r271916) +++ head/sys/net/if_gif.c Sun Sep 21 03:55:04 2014 (r271917) @@ -92,13 +92,20 @@ static const char gifname[] = "gif"; /* - * gif_mtx protects the global gif_softc_list. + * gif_mtx protects a per-vnet gif_softc_list. */ -static struct mtx gif_mtx; +static VNET_DEFINE(struct mtx, gif_mtx); +#define V_gif_mtx VNET(gif_mtx) static MALLOC_DEFINE(M_GIF, "gif", "Generic Tunnel Interface"); static VNET_DEFINE(LIST_HEAD(, gif_softc), gif_softc_list); #define V_gif_softc_list VNET(gif_softc_list) +#define GIF_LIST_LOCK_INIT(x) mtx_init(&V_gif_mtx, "gif_mtx", \ + NULL, MTX_DEF) +#define GIF_LIST_LOCK_DESTROY(x) mtx_destroy(&V_gif_mtx) +#define GIF_LIST_LOCK(x) mtx_lock(&V_gif_mtx) +#define GIF_LIST_UNLOCK(x) mtx_unlock(&V_gif_mtx) + void (*ng_gif_input_p)(struct ifnet *ifp, struct mbuf **mp, int af); void (*ng_gif_input_orphan_p)(struct ifnet *ifp, struct mbuf *m, int af); void (*ng_gif_attach_p)(struct ifnet *ifp); @@ -107,7 +114,8 @@ void (*ng_gif_detach_p)(struct ifnet *if static void gif_start(struct ifnet *); static int gif_clone_create(struct if_clone *, int, caddr_t); static void gif_clone_destroy(struct ifnet *); -static struct if_clone *gif_cloner; +static VNET_DEFINE(struct if_clone *, gif_cloner); +#define V_gif_cloner VNET(gif_cloner) static int gifmodevent(module_t, int, void *); @@ -189,9 +197,9 @@ gif_clone_create(struct if_clone *ifc, i if (ng_gif_attach_p != NULL) (*ng_gif_attach_p)(GIF2IFP(sc)); - mtx_lock(&gif_mtx); + GIF_LIST_LOCK(); LIST_INSERT_HEAD(&V_gif_softc_list, sc, gif_list); - mtx_unlock(&gif_mtx); + GIF_LIST_UNLOCK(); return (0); } @@ -204,9 +212,9 @@ gif_clone_destroy(struct ifnet *ifp) #endif struct gif_softc *sc = ifp->if_softc; - mtx_lock(&gif_mtx); + GIF_LIST_LOCK(); LIST_REMOVE(sc, gif_list); - mtx_unlock(&gif_mtx); + GIF_LIST_UNLOCK(); gif_delete_tunnel(ifp); #ifdef INET6 @@ -238,9 +246,22 @@ vnet_gif_init(const void *unused __unuse { LIST_INIT(&V_gif_softc_list); + GIF_LIST_LOCK_INIT(); + V_gif_cloner = if_clone_simple(gifname, gif_clone_create, + gif_clone_destroy, 0); +} +VNET_SYSINIT(vnet_gif_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, + vnet_gif_init, NULL); + +static void +vnet_gif_uninit(const void *unused __unused) +{ + + if_clone_detach(V_gif_cloner); + GIF_LIST_LOCK_DESTROY(); } -VNET_SYSINIT(vnet_gif_init, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, vnet_gif_init, - NULL); +VNET_SYSUNINIT(vnet_gif_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, + vnet_gif_uninit, NULL); static int gifmodevent(module_t mod, int type, void *data) @@ -248,19 +269,12 @@ gifmodevent(module_t mod, int type, void switch (type) { case MOD_LOAD: - mtx_init(&gif_mtx, "gif_mtx", NULL, MTX_DEF); - gif_cloner = if_clone_simple(gifname, gif_clone_create, - gif_clone_destroy, 0); - break; - case MOD_UNLOAD: - if_clone_detach(gif_cloner); - mtx_destroy(&gif_mtx); break; default: - return EOPNOTSUPP; + return (EOPNOTSUPP); } - return 0; + return (0); } static moduledata_t gif_mod = { @@ -364,7 +378,7 @@ gif_start(struct ifnet *ifp) #endif #ifdef INET6 if (sc->gif_psrc->sa_family == AF_INET6) - m->m_pkthdr.len -= GIF_HDR_LEN6; + m->m_pkthdr.len -= GIF_HDR_LEN6; #endif #endif /* @@ -373,6 +387,7 @@ gif_start(struct ifnet *ifp) */ af = m->m_pkthdr.csum_data; + /* override to IPPROTO_ETHERIP for bridged traffic */ if (ifp->if_bridge) af = AF_LINK; @@ -381,7 +396,6 @@ gif_start(struct ifnet *ifp) /* Done by IFQ_HANDOFF */ /* if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len);*/ - /* override to IPPROTO_ETHERIP for bridged traffic */ M_SETFIB(m, sc->gif_fibnum); /* inner AF-specific encapsulation */ @@ -904,7 +918,7 @@ gif_set_tunnel(struct ifnet *ifp, struct struct sockaddr *osrc, *odst, *sa; int error = 0; - mtx_lock(&gif_mtx); + GIF_LIST_LOCK(); LIST_FOREACH(sc2, &V_gif_softc_list, gif_list) { if (sc2 == sc) continue; @@ -924,13 +938,13 @@ gif_set_tunnel(struct ifnet *ifp, struct bcmp(sc2->gif_pdst, dst, dst->sa_len) == 0 && bcmp(sc2->gif_psrc, src, src->sa_len) == 0) { error = EADDRNOTAVAIL; - mtx_unlock(&gif_mtx); + GIF_LIST_UNLOCK(); goto bad; } /* XXX both end must be valid? (I mean, not 0.0.0.0) */ } - mtx_unlock(&gif_mtx); + GIF_LIST_UNLOCK(); /* XXX we can detach from both, but be polite just in case */ if (sc->gif_psrc) From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 03:56:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC32E6D6; Sun, 21 Sep 2014 03:56:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97A1011E; Sun, 21 Sep 2014 03:56:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8L3u7nQ016918; Sun, 21 Sep 2014 03:56:07 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8L3u7KL016913; Sun, 21 Sep 2014 03:56:07 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201409210356.s8L3u7KL016913@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sun, 21 Sep 2014 03:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271918 - in head/sys: net netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 03:56:07 -0000 Author: hrs Date: Sun Sep 21 03:56:06 2014 New Revision: 271918 URL: http://svnweb.freebsd.org/changeset/base/271918 Log: - Virtualize interface cloner for gre(4). This fixes a panic when destroying a vnet jail which has a gre(4) interface. - Make net.link.gre.max_nesting vnet-local. Modified: head/sys/net/if_gre.c head/sys/net/if_gre.h head/sys/netinet/ip_gre.c Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Sun Sep 21 03:55:04 2014 (r271917) +++ head/sys/net/if_gre.c Sun Sep 21 03:56:06 2014 (r271918) @@ -102,15 +102,16 @@ struct mtag_gre_nesting { * gre_mtx protects all global variables in if_gre.c. * XXX: gre_softc data not protected yet. */ -struct mtx gre_mtx; +VNET_DEFINE(struct mtx, gre_mtx); +VNET_DEFINE(struct gre_softc_head, gre_softc_list); + static const char grename[] = "gre"; static MALLOC_DEFINE(M_GRE, grename, "Generic Routing Encapsulation"); -struct gre_softc_head gre_softc_list; - static int gre_clone_create(struct if_clone *, int, caddr_t); static void gre_clone_destroy(struct ifnet *); -static struct if_clone *gre_cloner; +static VNET_DEFINE(struct if_clone *, gre_cloner); +#define V_gre_cloner VNET(gre_cloner) static int gre_ioctl(struct ifnet *, u_long, caddr_t); static int gre_output(struct ifnet *, struct mbuf *, @@ -118,8 +119,6 @@ static int gre_output(struct ifnet *, st static int gre_compute_route(struct gre_softc *sc); -static void greattach(void); - #ifdef INET extern struct domain inetdomain; static const struct protosw in_gre_protosw = { @@ -160,26 +159,34 @@ static SYSCTL_NODE(_net_link, IFT_TUNNEL */ #define MAX_GRE_NEST 1 #endif -static int max_gre_nesting = MAX_GRE_NEST; -SYSCTL_INT(_net_link_gre, OID_AUTO, max_nesting, CTLFLAG_RW, - &max_gre_nesting, 0, "Max nested tunnels"); +static VNET_DEFINE(int, max_gre_nesting) = MAX_GRE_NEST; +#define V_max_gre_nesting VNET(max_gre_nesting) +SYSCTL_INT(_net_link_gre, OID_AUTO, max_nesting, CTLFLAG_RW | CTLFLAG_VNET, + &VNET_NAME(max_gre_nesting), 0, "Max nested tunnels"); -/* ARGSUSED */ static void -greattach(void) +vnet_gre_init(const void *unused __unused) { - - mtx_init(&gre_mtx, "gre_mtx", NULL, MTX_DEF); - LIST_INIT(&gre_softc_list); - gre_cloner = if_clone_simple(grename, gre_clone_create, + LIST_INIT(&V_gre_softc_list); + GRE_LIST_LOCK_INIT(); + V_gre_cloner = if_clone_simple(grename, gre_clone_create, gre_clone_destroy, 0); } +VNET_SYSINIT(vnet_gre_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, + vnet_gre_init, NULL); + +static void +vnet_gre_uninit(const void *unused __unused) +{ + + if_clone_detach(V_gre_cloner); + GRE_LIST_LOCK_DESTROY(); +} +VNET_SYSUNINIT(vnet_gre_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, + vnet_gre_uninit, NULL); static int -gre_clone_create(ifc, unit, params) - struct if_clone *ifc; - int unit; - caddr_t params; +gre_clone_create(struct if_clone *ifc, int unit, caddr_t params) { struct gre_softc *sc; @@ -210,21 +217,20 @@ gre_clone_create(ifc, unit, params) sc->key = 0; if_attach(GRE2IFP(sc)); bpfattach(GRE2IFP(sc), DLT_NULL, sizeof(u_int32_t)); - mtx_lock(&gre_mtx); - LIST_INSERT_HEAD(&gre_softc_list, sc, sc_list); - mtx_unlock(&gre_mtx); + GRE_LIST_LOCK(); + LIST_INSERT_HEAD(&V_gre_softc_list, sc, sc_list); + GRE_LIST_UNLOCK(); return (0); } static void -gre_clone_destroy(ifp) - struct ifnet *ifp; +gre_clone_destroy(struct ifnet *ifp) { struct gre_softc *sc = ifp->if_softc; - mtx_lock(&gre_mtx); + GRE_LIST_LOCK(); LIST_REMOVE(sc, sc_list); - mtx_unlock(&gre_mtx); + GRE_LIST_UNLOCK(); #ifdef INET if (sc->encap != NULL) @@ -269,7 +275,7 @@ gre_output(struct ifnet *ifp, struct mbu gt = (struct mtag_gre_nesting *)(mtag + 1); gt->count++; - if (gt->count > min(gt->max,max_gre_nesting)) { + if (gt->count > min(gt->max, V_max_gre_nesting)) { printf("%s: hit maximum recursion limit %u on %s\n", __func__, gt->count - 1, ifp->if_xname); m_freem(m); @@ -301,7 +307,7 @@ gre_output(struct ifnet *ifp, struct mbu * Note: the sysctl does not actually check for saneness, so we * limit the maximum numbers of possible recursions here. */ - max = imin(max_gre_nesting, 256); + max = imin(V_max_gre_nesting, 256); /* If someone sets the sysctl <= 0, we want at least 1. */ max = imax(max, 1); len = sizeof(struct mtag_gre_nesting) + @@ -909,16 +915,12 @@ gremodevent(module_t mod, int type, void switch (type) { case MOD_LOAD: - greattach(); - break; case MOD_UNLOAD: - if_clone_detach(gre_cloner); - mtx_destroy(&gre_mtx); break; default: - return EOPNOTSUPP; + return (EOPNOTSUPP); } - return 0; + return (0); } static moduledata_t gre_mod = { Modified: head/sys/net/if_gre.h ============================================================================== --- head/sys/net/if_gre.h Sun Sep 21 03:55:04 2014 (r271917) +++ head/sys/net/if_gre.h Sun Sep 21 03:56:06 2014 (r271918) @@ -176,8 +176,16 @@ struct mobip_h { #ifdef _KERNEL LIST_HEAD(gre_softc_head, gre_softc); -extern struct mtx gre_mtx; -extern struct gre_softc_head gre_softc_list; +VNET_DECLARE(struct gre_softc_head, gre_softc_list); +#define V_gre_softc_list VNET(gre_softc_list) + +VNET_DECLARE(struct mtx, gre_mtx); +#define V_gre_mtx VNET(gre_mtx) +#define GRE_LIST_LOCK_INIT(x) mtx_init(&V_gre_mtx, "gre_mtx", NULL, \ + MTX_DEF) +#define GRE_LIST_LOCK_DESTROY(x) mtx_destroy(&V_gre_mtx) +#define GRE_LIST_LOCK(x) mtx_lock(&V_gre_mtx) +#define GRE_LIST_UNLOCK(x) mtx_unlock(&V_gre_mtx) u_int16_t gre_in_cksum(u_int16_t *, u_int); #endif /* _KERNEL */ Modified: head/sys/netinet/ip_gre.c ============================================================================== --- head/sys/netinet/ip_gre.c Sun Sep 21 03:55:04 2014 (r271917) +++ head/sys/netinet/ip_gre.c Sun Sep 21 03:56:06 2014 (r271918) @@ -315,18 +315,18 @@ gre_lookup(struct mbuf *m, u_int8_t prot struct ip *ip = mtod(m, struct ip *); struct gre_softc *sc; - mtx_lock(&gre_mtx); - for (sc = LIST_FIRST(&gre_softc_list); sc != NULL; + GRE_LIST_LOCK(); + for (sc = LIST_FIRST(&V_gre_softc_list); sc != NULL; sc = LIST_NEXT(sc, sc_list)) { if ((sc->g_dst.s_addr == ip->ip_src.s_addr) && (sc->g_src.s_addr == ip->ip_dst.s_addr) && (sc->g_proto == proto) && ((GRE2IFP(sc)->if_flags & IFF_UP) != 0)) { - mtx_unlock(&gre_mtx); + GRE_LIST_UNLOCK(); return (sc); } } - mtx_unlock(&gre_mtx); + GRE_LIST_UNLOCK(); return (NULL); } From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 04:00:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15395847; Sun, 21 Sep 2014 04:00:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00D6D1BD; Sun, 21 Sep 2014 04:00:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8L40TKa017650; Sun, 21 Sep 2014 04:00:29 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8L40Tu8017645; Sun, 21 Sep 2014 04:00:29 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201409210400.s8L40Tu8017645@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sun, 21 Sep 2014 04:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271919 - head/sbin/routed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 04:00:30 -0000 Author: hrs Date: Sun Sep 21 04:00:28 2014 New Revision: 271919 URL: http://svnweb.freebsd.org/changeset/base/271919 Log: Fix a bug which could make routed(8) daemon exit by sending a special RIP query from a remote machine, and disable accepting it by default. This requests a routed(8) daemon to dump routing information base for debugging purpose. An -i flag to enable it has been added. Modified: head/sbin/routed/defs.h head/sbin/routed/input.c head/sbin/routed/main.c head/sbin/routed/output.c head/sbin/routed/routed.8 Modified: head/sbin/routed/defs.h ============================================================================== --- head/sbin/routed/defs.h Sun Sep 21 03:56:06 2014 (r271918) +++ head/sbin/routed/defs.h Sun Sep 21 04:00:28 2014 (r271919) @@ -462,6 +462,7 @@ extern int ridhosts; /* 1=reduce host r extern int mhome; /* 1=want multi-homed host route */ extern int advertise_mhome; /* 1=must continue advertising it */ extern int auth_ok; /* 1=ignore auth if we do not care */ +extern int insecure; /* Reply to special queries or not */ extern struct timeval clk; /* system clock's idea of time */ extern struct timeval epoch; /* system clock when started */ Modified: head/sbin/routed/input.c ============================================================================== --- head/sbin/routed/input.c Sun Sep 21 03:56:06 2014 (r271918) +++ head/sbin/routed/input.c Sun Sep 21 04:00:28 2014 (r271919) @@ -289,8 +289,19 @@ input(struct sockaddr_in *from, /* rece * with all we know. */ if (from->sin_port != htons(RIP_PORT)) { - supply(from, aifp, OUT_QUERY, 0, - rip->rip_vers, ap != 0); + /* + * insecure: query from non-router node + * > 1: allow from distant node + * > 0: allow from neighbor node + * == 0: deny + */ + if ((aifp != NULL && insecure > 0) || + (aifp == NULL && insecure > 1)) + supply(from, aifp, OUT_QUERY, 0, + rip->rip_vers, ap != 0); + else + trace_pkt("Warning: " + "possible attack detected"); return; } Modified: head/sbin/routed/main.c ============================================================================== --- head/sbin/routed/main.c Sun Sep 21 03:56:06 2014 (r271918) +++ head/sbin/routed/main.c Sun Sep 21 04:00:28 2014 (r271919) @@ -68,6 +68,7 @@ int ridhosts; /* 1=reduce host routes int mhome; /* 1=want multi-homed host route */ int advertise_mhome; /* 1=must continue advertising it */ int auth_ok = 1; /* 1=ignore auth if we do not care */ +int insecure; /* Reply to special queries or not */ struct timeval epoch; /* when started */ struct timeval clk; @@ -136,8 +137,11 @@ main(int argc, (void)gethostname(myname, sizeof(myname)-1); (void)gethost(myname, &myaddr); - while ((n = getopt(argc, argv, "sqdghmAtvT:F:P:")) != -1) { + while ((n = getopt(argc, argv, "isqdghmAtvT:F:P:")) != -1) { switch (n) { + case 'i': + insecure++; + break; case 's': supplier = 1; supplier_set = 1; Modified: head/sbin/routed/output.c ============================================================================== --- head/sbin/routed/output.c Sun Sep 21 03:56:06 2014 (r271918) +++ head/sbin/routed/output.c Sun Sep 21 04:00:28 2014 (r271919) @@ -673,8 +673,6 @@ supply(struct sockaddr_in *dst, struct rt_entry *rt; int def_metric; - assert(ifp != NULL); - ws.state = 0; ws.gen_limit = 1024; Modified: head/sbin/routed/routed.8 ============================================================================== --- head/sbin/routed/routed.8 Sun Sep 21 03:56:06 2014 (r271918) +++ head/sbin/routed/routed.8 Sun Sep 21 04:00:28 2014 (r271919) @@ -30,7 +30,7 @@ .\" @(#)routed.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd June 1, 1996 +.Dd August 26, 2014 .Dt ROUTED 8 .Os .Sh NAME @@ -39,7 +39,7 @@ .Nd network RIP and router discovery routing daemon .Sh SYNOPSIS .Nm -.Op Fl sqdghmpAtv +.Op Fl isqdghmpAtv .Op Fl T Ar tracefile .Oo .Fl F @@ -250,6 +250,20 @@ to infer the netmask used by the remote .Pp The following options are available: .Bl -tag -width indent +.It Fl i +allow +.Nm +to accept a RIP request from non-router node. +When specified once, +.Nm +replies to a route information query from neighbor nodes. +When specified twice, +it replies to a query from remote nodes in addition. +.Xr rtquery 8 +utility can be used to send a request. +.Pp +This feature is disabled by default because of a risk of reflection attack +though it useful for debugging purpose, .It Fl s force .Nm From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 04:38:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2E601A6; Sun, 21 Sep 2014 04:38:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE809650; Sun, 21 Sep 2014 04:38:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8L4coLY036649; Sun, 21 Sep 2014 04:38:50 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8L4coS8036648; Sun, 21 Sep 2014 04:38:50 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201409210438.s8L4coS8036648@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sun, 21 Sep 2014 04:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271920 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 04:38:50 -0000 Author: hrs Date: Sun Sep 21 04:38:50 2014 New Revision: 271920 URL: http://svnweb.freebsd.org/changeset/base/271920 Log: Add a change missing in r271916. Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sun Sep 21 04:00:28 2014 (r271919) +++ head/sys/netinet/in.c Sun Sep 21 04:38:50 2014 (r271920) @@ -674,7 +674,7 @@ in_addprefix(struct in_ifaddr *target, i } else { int fibnum; - fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : + fibnum = V_rt_add_addr_allfibs ? RT_ALL_FIBS : target->ia_ifp->if_fib; rt_addrmsg(RTM_ADD, &target->ia_ifa, fibnum); IN_IFADDR_RUNLOCK(); @@ -745,7 +745,7 @@ in_scrubprefix(struct in_ifaddr *target, if ((target->ia_flags & IFA_ROUTE) == 0) { int fibnum; - fibnum = rt_add_addr_allfibs ? RT_ALL_FIBS : + fibnum = V_rt_add_addr_allfibs ? RT_ALL_FIBS : target->ia_ifp->if_fib; rt_addrmsg(RTM_DELETE, &target->ia_ifa, fibnum); return (0); From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 05:03:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B61A4A13; Sun, 21 Sep 2014 05:03:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1D4B9F3; Sun, 21 Sep 2014 05:03:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8L534Dw050085; Sun, 21 Sep 2014 05:03:04 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8L534mg050084; Sun, 21 Sep 2014 05:03:04 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201409210503.s8L534mg050084@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sun, 21 Sep 2014 05:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271921 - head/sbin/routed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 05:03:04 -0000 Author: hrs Date: Sun Sep 21 05:03:04 2014 New Revision: 271921 URL: http://svnweb.freebsd.org/changeset/base/271921 Log: Fix a typo. Modified: head/sbin/routed/routed.8 Modified: head/sbin/routed/routed.8 ============================================================================== --- head/sbin/routed/routed.8 Sun Sep 21 04:38:50 2014 (r271920) +++ head/sbin/routed/routed.8 Sun Sep 21 05:03:04 2014 (r271921) @@ -263,7 +263,7 @@ it replies to a query from remote nodes utility can be used to send a request. .Pp This feature is disabled by default because of a risk of reflection attack -though it useful for debugging purpose, +though it is useful for debugging purpose. .It Fl s force .Nm From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 06:45:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0168B2CB; Sun, 21 Sep 2014 06:45:02 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FE0D1BB; Sun, 21 Sep 2014 06:45:01 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id E93EE25D3A93; Sun, 21 Sep 2014 06:44:57 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id E18FBC76FD3; Sun, 21 Sep 2014 06:44:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id JYdQL0Mt7kbX; Sun, 21 Sep 2014 06:44:54 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:f54b:3ba0:feb1:eb3f] (unknown [IPv6:fde9:577b:c1a9:4410:f54b:3ba0:feb1:eb3f]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id F2BE7BE8522; Sun, 21 Sep 2014 06:44:52 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r271916 - head/sys/net From: "Bjoern A. Zeeb" In-Reply-To: <201409210348.s8L3mKfS012477@svn.freebsd.org> Date: Sun, 21 Sep 2014 06:44:34 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <40476321-398C-4971-91AD-B835CF15581A@lists.zabbadoz.net> References: <201409210348.s8L3mKfS012477@svn.freebsd.org> To: Hiroki Sato X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 06:45:02 -0000 On 21 Sep 2014, at 03:48 , Hiroki Sato wrote: > Author: hrs > Date: Sun Sep 21 03:48:20 2014 > New Revision: 271916 > URL: http://svnweb.freebsd.org/changeset/base/271916 >=20 > Log: > Make net.add_addr_allfibs vnet-local. I guess it was this one: In file included from = /scratch/tmp/bz/head.svn/lib/libc/net/getifaddrs.c:42: = /storage/head/obj//i386.i386/scratch/tmp/bz/head.svn/tmp/usr/include/net/r= oute.h:89:21: error: type specifier missing, defaults to 'int' = [-Werror,-Wimplicit-int] VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all = fibs */ ^~~~~~~~~~~~~~~~~~~ = /storage/head/obj//i386.i386/scratch/tmp/bz/head.svn/tmp/usr/include/net/r= oute.h:89:1: error: type specifier missing, defaults to 'int' = [-Werror,-Wimplicit-int] VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all = fibs */ ^~~~~~~~~~~~ 2 errors generated. --- getifaddrs.So --- *** [getifaddrs.So] Error code 1 bmake: stopped in /scratch/tmp/bz/head.svn/lib/libc In file included from = /scratch/tmp/bz/head.svn/lib/libc/net/getifmaddrs.c:37: = /storage/head/obj//i386.i386/scratch/tmp/bz/head.svn/tmp/usr/include/net/r= oute.h:89:21: error: type specifier missing, defaults to 'int' = [-Werror,-Wimplicit-int] VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all = fibs */ ^~~~~~~~~~~~~~~~~~~ = /storage/head/obj//i386.i386/scratch/tmp/bz/head.svn/tmp/usr/include/net/r= oute.h:89:1: error: type specifier missing, defaults to 'int' = [-Werror,-Wimplicit-int] VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all = fibs */ ^~~~~~~~~~~~ >=20 > Modified: > head/sys/net/route.c > head/sys/net/route.h >=20 > Modified: head/sys/net/route.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/net/route.c Sun Sep 21 03:00:30 2014 = (r271915) > +++ head/sys/net/route.c Sun Sep 21 03:48:20 2014 = (r271916) > @@ -108,9 +108,9 @@ SYSCTL_UINT(_net, OID_AUTO, fibs, CTLFLA > * always work given the fib can be overridden and prefixes can be = added > * from the network stack context. > */ > -u_int rt_add_addr_allfibs =3D 1; > -SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN, > - &rt_add_addr_allfibs, 0, ""); > +VNET_DEFINE(u_int, rt_add_addr_allfibs) =3D 1; > +SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN | = CTLFLAG_VNET, > + &VNET_NAME(rt_add_addr_allfibs), 0, ""); >=20 > VNET_DEFINE(struct rtstat, rtstat); > #define V_rtstat VNET(rtstat) > @@ -1613,9 +1613,9 @@ rtinit1(struct ifaddr *ifa, int cmd, int > break; > } > if (fibnum =3D=3D RT_ALL_FIBS) { > - if (rt_add_addr_allfibs =3D=3D 0 && cmd =3D=3D = (int)RTM_ADD) { > + if (V_rt_add_addr_allfibs =3D=3D 0 && cmd =3D=3D = (int)RTM_ADD) > startfib =3D endfib =3D ifa->ifa_ifp->if_fib; > - } else { > + else { > startfib =3D 0; > endfib =3D rt_numfibs - 1; > } >=20 > Modified: head/sys/net/route.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/net/route.h Sun Sep 21 03:00:30 2014 = (r271915) > +++ head/sys/net/route.h Sun Sep 21 03:48:20 2014 = (r271916) > @@ -34,6 +34,7 @@ > #define _NET_ROUTE_H_ >=20 > #include > +#include >=20 > /* > * Kernel resident routing tables. > @@ -85,7 +86,8 @@ struct rt_metrics { > #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=3D0 = restricted cases */ > #define RT_ALL_FIBS -1 /* Announce event for every fib = */ > extern u_int rt_numfibs; /* number of usable routing tables */ > -extern u_int rt_add_addr_allfibs; /* Announce interfaces to all = fibs */ > +VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to = all fibs */ > +#define V_rt_add_addr_allfibs VNET(rt_add_addr_allfibs) >=20 > /* > * We distinguish between routes to hosts and routes to networks, >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 07:16:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57F1D7A8; Sun, 21 Sep 2014 07:16:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43D5461E; Sun, 21 Sep 2014 07:16:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8L7GqwM010715; Sun, 21 Sep 2014 07:16:52 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8L7GqIY010714; Sun, 21 Sep 2014 07:16:52 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201409210716.s8L7GqIY010714@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sun, 21 Sep 2014 07:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271923 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 07:16:52 -0000 Author: hrs Date: Sun Sep 21 07:16:51 2014 New Revision: 271923 URL: http://svnweb.freebsd.org/changeset/base/271923 Log: Fix build. Modified: head/sys/net/route.h Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sun Sep 21 06:36:17 2014 (r271922) +++ head/sys/net/route.h Sun Sep 21 07:16:51 2014 (r271923) @@ -85,9 +85,11 @@ struct rt_metrics { #define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ #define RT_ALL_FIBS -1 /* Announce event for every fib */ +#ifdef _KERNEL extern u_int rt_numfibs; /* number of usable routing tables */ VNET_DECLARE(u_int, rt_add_addr_allfibs); /* Announce interfaces to all fibs */ #define V_rt_add_addr_allfibs VNET(rt_add_addr_allfibs) +#endif /* * We distinguish between routes to hosts and routes to networks, From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 07:18:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B493A931; Sun, 21 Sep 2014 07:18:08 +0000 (UTC) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.allbsd.org", Issuer "RapidSSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FFC2644; Sun, 21 Sep 2014 07:18:08 +0000 (UTC) Received: from alph.d.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=56) by mail.allbsd.org (8.14.9/8.14.8) with ESMTP id s8L7Hjvd047179 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 21 Sep 2014 16:17:55 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.8/8.14.8) with ESMTP id s8L7He6j012236; Sun, 21 Sep 2014 16:17:45 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Sun, 21 Sep 2014 16:17:34 +0900 (JST) Message-Id: <20140921.161734.1063508106088599552.hrs@allbsd.org> To: bzeeb-lists@lists.zabbadoz.net Subject: Re: svn commit: r271916 - head/sys/net From: Hiroki Sato In-Reply-To: <40476321-398C-4971-91AD-B835CF15581A@lists.zabbadoz.net> References: <201409210348.s8L3mKfS012477@svn.freebsd.org> <40476321-398C-4971-91AD-B835CF15581A@lists.zabbadoz.net> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.6 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Sun_Sep_21_16_17_34_2014_086)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Sun, 21 Sep 2014 16:18:01 +0900 (JST) X-Spam-Status: No, score=-97.9 required=13.0 tests=CONTENT_TYPE_PRESENT, RDNS_NONE,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 07:18:08 -0000 ----Security_Multipart(Sun_Sep_21_16_17_34_2014_086)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Bjoern A. Zeeb" wrote in <40476321-398C-4971-91AD-B835CF15581A@lists.zabbadoz.net>: bz> bz> On 21 Sep 2014, at 03:48 , Hiroki Sato wrote: bz> bz> > Author: hrs bz> > Date: Sun Sep 21 03:48:20 2014 bz> > New Revision: 271916 bz> > URL: http://svnweb.freebsd.org/changeset/base/271916 bz> > bz> > Log: bz> > Make net.add_addr_allfibs vnet-local. bz> bz> I guess it was this one: Gr, sorry, should be fixed in r271923. -- Hiroki ----Security_Multipart(Sun_Sep_21_16_17_34_2014_086)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEABECAAYFAlQee44ACgkQTyzT2CeTzy2+XACghdhOCcJzbY3nem+FoALjX64E RT8AoLHMGQ4qkro5shiR75xUmxKwnDcN =jMD7 -----END PGP SIGNATURE----- ----Security_Multipart(Sun_Sep_21_16_17_34_2014_086)---- From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 09:06:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C23AD4; Sun, 21 Sep 2014 09:06:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1EC6F62; Sun, 21 Sep 2014 09:06:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8L96obW063434; Sun, 21 Sep 2014 09:06:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8L96ocK063432; Sun, 21 Sep 2014 09:06:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409210906.s8L96ocK063432@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 21 Sep 2014 09:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271924 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 09:06:51 -0000 Author: kib Date: Sun Sep 21 09:06:50 2014 New Revision: 271924 URL: http://svnweb.freebsd.org/changeset/base/271924 Log: Update and clarify comments. Remove the useless counter for impossible, but seen in wild situation (on buggy hypervisors). In collaboration with: bde MFC after: 1 week Modified: head/sys/amd64/amd64/fpu.c head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Sun Sep 21 07:16:51 2014 (r271923) +++ head/sys/amd64/amd64/fpu.c Sun Sep 21 09:06:50 2014 (r271924) @@ -602,29 +602,30 @@ fputrap_sse(void) return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]); } -static int err_count = 0; - /* * Device Not Available (DNA, #NM) exception handler. * * It would be better to switch FP context here (if curthread != * fpcurthread) and not necessarily for every context switch, but it * is too hard to access foreign pcb's. - * - * The handler is entered with interrupts enabled, which allows the - * context switch to happen before critical enter() is executed, and - * causes restoration of FPU context on CPU other than that caused - * DNA. It is fine, since context switch started emulation on the - * current CPU as well. */ void fpudna(void) { + /* + * This handler is entered with interrupts enabled, so context + * switches may occur before critical_enter() is executed. If + * a context switch occurs, then when we regain control, our + * state will have been completely restored. The CPU may + * change underneath us, but the only part of our context that + * lives in the CPU is CR0.TS and that will be "restored" by + * setting it on the new CPU. + */ critical_enter(); + if (PCPU_GET(fpcurthread) == curthread) { - printf("fpudna: fpcurthread == curthread %d times\n", - ++err_count); + printf("fpudna: fpcurthread == curthread\n"); stop_emulating(); critical_exit(); return; Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sun Sep 21 07:16:51 2014 (r271923) +++ head/sys/amd64/amd64/trap.c Sun Sep 21 09:06:50 2014 (r271924) @@ -436,8 +436,8 @@ trap(struct trapframe *frame) case T_XMMFLT: /* SIMD floating-point exception */ case T_FPOPFLT: /* FPU operand fetch fault */ /* - * XXXKIB for now disable any FPU traps in kernel - * handler registration seems to be overkill + * For now, supporting kernel handler + * registration for FPU traps is overkill. */ trap_fatal(frame, 0); goto out; From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 09:09:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5A87230; Sun, 21 Sep 2014 09:09:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85BADF74; Sun, 21 Sep 2014 09:09:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8L99bCc063942; Sun, 21 Sep 2014 09:09:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8L99b0k063941; Sun, 21 Sep 2014 09:09:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409210909.s8L99b0k063941@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 21 Sep 2014 09:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271925 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 09:09:37 -0000 Author: kib Date: Sun Sep 21 09:09:37 2014 New Revision: 271925 URL: http://svnweb.freebsd.org/changeset/base/271925 Log: MFC r271586: Fix mis-spelling of bits and types names in the vnode_pager_putpages(). Approved by: re (delphij) Modified: stable/10/sys/vm/vnode_pager.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vnode_pager.c ============================================================================== --- stable/10/sys/vm/vnode_pager.c Sun Sep 21 09:06:50 2014 (r271924) +++ stable/10/sys/vm/vnode_pager.c Sun Sep 21 09:09:37 2014 (r271925) @@ -83,7 +83,7 @@ static int vnode_pager_input_smlfs(vm_ob static int vnode_pager_input_old(vm_object_t object, vm_page_t m); static void vnode_pager_dealloc(vm_object_t); static int vnode_pager_getpages(vm_object_t, vm_page_t *, int, int); -static void vnode_pager_putpages(vm_object_t, vm_page_t *, int, boolean_t, int *); +static void vnode_pager_putpages(vm_object_t, vm_page_t *, int, int, int *); static boolean_t vnode_pager_haspage(vm_object_t, vm_pindex_t, int *, int *); static vm_object_t vnode_pager_alloc(void *, vm_ooffset_t, vm_prot_t, vm_ooffset_t, struct ucred *cred); @@ -1024,12 +1024,8 @@ vnode_pager_generic_getpages(vp, m, byte * backing vp's VOP_PUTPAGES. */ static void -vnode_pager_putpages(object, m, count, sync, rtvals) - vm_object_t object; - vm_page_t *m; - int count; - boolean_t sync; - int *rtvals; +vnode_pager_putpages(vm_object_t object, vm_page_t *m, int count, + int flags, int *rtvals) { int rtval; struct vnode *vp; @@ -1047,15 +1043,15 @@ vnode_pager_putpages(object, m, count, s * daemon up. This should be probably be addressed XXX. */ - if ((cnt.v_free_count + cnt.v_cache_count) < cnt.v_pageout_free_min) - sync |= OBJPC_SYNC; + if (cnt.v_free_count + cnt.v_cache_count < cnt.v_pageout_free_min) + flags |= VM_PAGER_PUT_SYNC; /* * Call device-specific putpages function */ vp = object->handle; VM_OBJECT_WUNLOCK(object); - rtval = VOP_PUTPAGES(vp, m, bytes, sync, rtvals, 0); + rtval = VOP_PUTPAGES(vp, m, bytes, flags, rtvals, 0); KASSERT(rtval != EOPNOTSUPP, ("vnode_pager: stale FS putpages\n")); VM_OBJECT_WLOCK(object); From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 10:05:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1627F56; Sun, 21 Sep 2014 10:05:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CC566A2; Sun, 21 Sep 2014 10:05:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LA5R9g092000; Sun, 21 Sep 2014 10:05:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8LA5RRe091999; Sun, 21 Sep 2014 10:05:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409211005.s8LA5RRe091999@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 21 Sep 2014 10:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271926 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 10:05:27 -0000 Author: mav Date: Sun Sep 21 10:05:27 2014 New Revision: 271926 URL: http://svnweb.freebsd.org/changeset/base/271926 Log: Mention read_ahead tunables/sysctls. MFC after: 1 month Modified: head/share/man/man4/ada.4 Modified: head/share/man/man4/ada.4 ============================================================================== --- head/share/man/man4/ada.4 Sun Sep 21 09:09:37 2014 (r271925) +++ head/share/man/man4/ada.4 Sun Sep 21 10:05:27 2014 (r271926) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 21, 2014 +.Dd September 21, 2014 .Dt ADA 4 .Os .Sh NAME @@ -123,11 +123,13 @@ seconds. This variable determines whether to spin-down disks when shutting down. Set to 1 to enable spin-down, 0 to disable. The default is currently enabled. +.It Va kern.cam.ada.read_ahead +.It Va kern.cam.ada. Ns Ar X Ns Va .read_ahead .It Va kern.cam.ada.write_cache .It Va kern.cam.ada. Ns Ar X Ns Va .write_cache .Pp -These variables determine whether device write cache should be enabled -globally or per-device or disabled. +These variables determine whether device read-ahead and write caches +should be enabled globally or per-device or disabled. Set to 1 to enable write cache, 0 to disable, -1 to leave it as-is. Values modified at runtime take effect only after device reset .Pq using the reset subcommand of Xr camcontrol 8 . From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 10:34:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75C655B4; Sun, 21 Sep 2014 10:34:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6136896D; Sun, 21 Sep 2014 10:34:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LAYG2q006092; Sun, 21 Sep 2014 10:34:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8LAYGb6006091; Sun, 21 Sep 2014 10:34:16 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409211034.s8LAYGb6006091@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 21 Sep 2014 10:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271927 - head/sys/fs/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 10:34:16 -0000 Author: trasz Date: Sun Sep 21 10:34:15 2014 New Revision: 271927 URL: http://svnweb.freebsd.org/changeset/base/271927 Log: Turns out -1 is a perfectly valid error number, ERESTART. Remove useless code written under assumption that it wasn't. Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/autofs/autofs.c Modified: head/sys/fs/autofs/autofs.c ============================================================================== --- head/sys/fs/autofs/autofs.c Sun Sep 21 10:05:27 2014 (r271926) +++ head/sys/fs/autofs/autofs.c Sun Sep 21 10:34:15 2014 (r271927) @@ -429,11 +429,6 @@ autofs_trigger_one(struct autofs_node *a &autofs_softc->sc_lock); autofs_restore_sigmask(&oldset); if (error != 0) { - /* - * XXX: For some reason this returns -1 - * instead of EINTR, wtf?! - */ - error = EINTR; AUTOFS_WARN("cv_wait_sig for %s failed " "with error %d", ar->ar_path, error); break; @@ -495,7 +490,7 @@ autofs_trigger(struct autofs_node *anp, anp->an_retries = 0; return (0); } - if (error == EINTR) { + if (error == EINTR || error == ERESTART) { AUTOFS_DEBUG("trigger interrupted by signal, " "not retrying"); anp->an_retries = 0; @@ -541,11 +536,6 @@ autofs_ioctl_request(struct autofs_daemo error = cv_wait_sig(&autofs_softc->sc_cv, &autofs_softc->sc_lock); if (error != 0) { - /* - * XXX: For some reason this returns -1 instead - * of EINTR, wtf?! - */ - error = EINTR; sx_xunlock(&autofs_softc->sc_lock); AUTOFS_DEBUG("failed with error %d", error); return (error); From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 12:07:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D918985; Sun, 21 Sep 2014 12:07:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 184C5183; Sun, 21 Sep 2014 12:07:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LC7Mkl048964; Sun, 21 Sep 2014 12:07:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8LC7McE048963; Sun, 21 Sep 2014 12:07:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409211207.s8LC7McE048963@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 21 Sep 2014 12:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271928 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 12:07:23 -0000 Author: mav Date: Sun Sep 21 12:07:22 2014 New Revision: 271928 URL: http://svnweb.freebsd.org/changeset/base/271928 Log: MFC r271794: When updating device media size use cached cdevsw pointer. Using pointer from the cdev directly is dangerous since we have no reference on it, and it may change any time. That caused panic if device has gone. While there, report capacity change only if it really changed. Approved by: re (dephij) Modified: stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Sun Sep 21 10:34:15 2014 (r271927) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Sun Sep 21 12:07:22 2014 (r271928) @@ -2310,7 +2310,9 @@ ctl_be_block_modify_file(struct ctl_be_b if (params->lun_size_bytes != 0) { be_lun->size_bytes = params->lun_size_bytes; } else { + vn_lock(be_lun->vn, LK_SHARED | LK_RETRY); error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); + VOP_UNLOCK(be_lun->vn, 0); if (error != 0) { snprintf(req->error_str, sizeof(req->error_str), "error calling VOP_GETATTR() for file %s", @@ -2328,24 +2330,22 @@ static int ctl_be_block_modify_dev(struct ctl_be_block_lun *be_lun, struct ctl_lun_req *req) { - struct cdev *dev; - struct cdevsw *devsw; + struct ctl_be_block_devdata *dev_data; int error; struct ctl_lun_modify_params *params; uint64_t size_bytes; params = &req->reqdata.modify; - dev = be_lun->vn->v_rdev; - devsw = dev->si_devsw; - if (!devsw->d_ioctl) { + dev_data = &be_lun->backend.dev; + if (!dev_data->csw->d_ioctl) { snprintf(req->error_str, sizeof(req->error_str), "%s: no d_ioctl for device %s!", __func__, be_lun->dev_path); return (ENODEV); } - error = devsw->d_ioctl(dev, DIOCGMEDIASIZE, + error = dev_data->csw->d_ioctl(dev_data->cdev, DIOCGMEDIASIZE, (caddr_t)&size_bytes, FREAD, curthread); if (error) { @@ -2378,6 +2378,7 @@ ctl_be_block_modify(struct ctl_be_block_ { struct ctl_lun_modify_params *params; struct ctl_be_block_lun *be_lun; + uint64_t oldsize; int error; params = &req->reqdata.modify; @@ -2408,28 +2409,27 @@ ctl_be_block_modify(struct ctl_be_block_ } } - vn_lock(be_lun->vn, LK_SHARED | LK_RETRY); - + oldsize = be_lun->size_bytes; if (be_lun->vn->v_type == VREG) error = ctl_be_block_modify_file(be_lun, req); else error = ctl_be_block_modify_dev(be_lun, req); - - VOP_UNLOCK(be_lun->vn, 0); - if (error != 0) goto bailout_error; - be_lun->size_blocks = be_lun->size_bytes >> be_lun->blocksize_shift; + if (be_lun->size_bytes != oldsize) { + be_lun->size_blocks = be_lun->size_bytes >> + be_lun->blocksize_shift; - /* - * The maximum LBA is the size - 1. - * - * XXX: Note that this field is being updated without locking, - * which might cause problems on 32-bit architectures. - */ - be_lun->ctl_be_lun.maxlba = be_lun->size_blocks - 1; - ctl_lun_capacity_changed(&be_lun->ctl_be_lun); + /* + * The maximum LBA is the size - 1. + * + * XXX: Note that this field is being updated without locking, + * which might cause problems on 32-bit architectures. + */ + be_lun->ctl_be_lun.maxlba = be_lun->size_blocks - 1; + ctl_lun_capacity_changed(&be_lun->ctl_be_lun); + } /* Tell the user the exact size we ended up using */ params->lun_size_bytes = be_lun->size_bytes; From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 13:09:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E165385; Sun, 21 Sep 2014 13:09:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 392FC894; Sun, 21 Sep 2014 13:09:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LD96UL077804; Sun, 21 Sep 2014 13:09:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8LD96r8077803; Sun, 21 Sep 2014 13:09:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409211309.s8LD96r8077803@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 21 Sep 2014 13:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271929 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 13:09:06 -0000 Author: mav Date: Sun Sep 21 13:09:05 2014 New Revision: 271929 URL: http://svnweb.freebsd.org/changeset/base/271929 Log: MFC r271797: Make kernel to update LUN size from the backing storage on configuration reload also if that size was not specified in the new configuration. Previously it happened only if size was explicitly changed in config. Approved by: re (delphij) Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Sun Sep 21 12:07:22 2014 (r271928) +++ stable/10/usr.sbin/ctld/ctld.c Sun Sep 21 13:09:05 2014 (r271929) @@ -1413,7 +1413,8 @@ conf_apply(struct conf *oldconf, struct if (oldtarg != NULL) { oldlun = lun_find(oldtarg, newlun->l_lun); if (oldlun != NULL) { - if (newlun->l_size != oldlun->l_size) { + if (newlun->l_size != oldlun->l_size || + newlun->l_size == 0) { log_debugx("resizing lun %d, " "target %s, CTL lun %d", newlun->l_lun, From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 14:39:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2028C59; Sun, 21 Sep 2014 14:39:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADEE1FDA; Sun, 21 Sep 2014 14:39:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LEdVoD021280; Sun, 21 Sep 2014 14:39:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8LEdVPr021279; Sun, 21 Sep 2014 14:39:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409211439.s8LEdVPr021279@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 21 Sep 2014 14:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271930 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 14:39:31 -0000 Author: mav Date: Sun Sep 21 14:39:31 2014 New Revision: 271930 URL: http://svnweb.freebsd.org/changeset/base/271930 Log: Allow SUBPAGE CODE field in MODE SENSE commands. Modified: head/sys/cam/ctl/ctl_cmd_table.c Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Sun Sep 21 13:09:05 2014 (r271929) +++ head/sys/cam/ctl/ctl_cmd_table.c Sun Sep 21 14:39:31 2014 (r271930) @@ -636,7 +636,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_SECONDARY | CTL_FLAG_DATA_IN | CTL_CMD_FLAG_ALLOW_ON_PR_RESV, - CTL_LUN_PAT_NONE, 6, {0x08, 0xff, 0, 0xff, 0x07}}, + CTL_LUN_PAT_NONE, 6, {0x08, 0xff, 0xff, 0xff, 0x07}}, /* 1B START STOP UNIT */ {ctl_start_stop, CTL_SERIDX_START, CTL_CMD_FLAG_OK_ON_SLUN | @@ -890,7 +890,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_SECONDARY | CTL_FLAG_DATA_IN | CTL_CMD_FLAG_ALLOW_ON_PR_RESV, - CTL_LUN_PAT_NONE, 10, {0x18, 0xff, 0, 0, 0, 0, 0xff, 0xff, 0x07} }, + CTL_LUN_PAT_NONE, 10, {0x18, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0x07} }, /* 5B CLOSE TRACK/SESSION */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 15:37:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4724EC9; Sun, 21 Sep 2014 15:37:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEE73819; Sun, 21 Sep 2014 15:37:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LFbev6050865; Sun, 21 Sep 2014 15:37:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8LFbdE4050849; Sun, 21 Sep 2014 15:37:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201409211537.s8LFbdE4050849@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 21 Sep 2014 15:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271931 - head/contrib/llvm/patches X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 15:37:40 -0000 Author: dim Date: Sun Sep 21 15:37:39 2014 New Revision: 271931 URL: http://svnweb.freebsd.org/changeset/base/271931 Log: Add a few missing llvm/clang patches, update the other ones to be able to apply with the same patch options onto a fresh upstream llvm/clang 3.4.1 checkout, and use approximately the same header tempate for them. MFC after: 3 days Added: head/contrib/llvm/patches/patch-r269387-clang-arm-target-cpu.diff head/contrib/llvm/patches/patch-r271024-llvm-r216989-r216990-fix-movw-armv6.diff - copied, changed from r271928, head/contrib/llvm/patches/patch-r271024-llvm-r216989-fix-movm-armv6.diff head/contrib/llvm/patches/patch-r271597-clang-r217410-i386-garbage-float.diff Deleted: head/contrib/llvm/patches/patch-r271024-llvm-r216989-fix-movm-armv6.diff Modified: head/contrib/llvm/patches/patch-r270147-llvm-r197824-r213427-r213960.diff head/contrib/llvm/patches/patch-r271282-clang-r200797-r200798-r200805-debug-info-crash.diff head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff Added: head/contrib/llvm/patches/patch-r269387-clang-arm-target-cpu.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r269387-clang-arm-target-cpu.diff Sun Sep 21 15:37:39 2014 (r271931) @@ -0,0 +1,34 @@ +Update the ARMv6 core clang targets to be an arm1176jzf-s. This brings us +in line with gcc in base as this makes llvm generate code for the armv6k +variant of the instruction set. + +Introduced here: http://svnweb.freebsd.org/changeset/base/269387 + +Index: tools/clang/lib/Driver/ToolChain.cpp +=================================================================== +--- tools/clang/lib/Driver/ToolChain.cpp (revision 269386) ++++ tools/clang/lib/Driver/ToolChain.cpp (revision 269387) +@@ -183,7 +183,8 @@ static const char *getARMTargetCPU(const ArgList & + MArch = Triple.getArchName(); + } + +- if (Triple.getOS() == llvm::Triple::NetBSD) { ++ if (Triple.getOS() == llvm::Triple::NetBSD || ++ Triple.getOS() == llvm::Triple::FreeBSD) { + if (MArch == "armv6") + return "arm1176jzf-s"; + } +Index: tools/clang/lib/Driver/Tools.cpp +=================================================================== +--- tools/clang/lib/Driver/Tools.cpp (revision 269386) ++++ tools/clang/lib/Driver/Tools.cpp (revision 269387) +@@ -499,7 +499,8 @@ static std::string getARMTargetCPU(const ArgList & + MArch = Triple.getArchName(); + } + +- if (Triple.getOS() == llvm::Triple::NetBSD) { ++ if (Triple.getOS() == llvm::Triple::NetBSD || ++ Triple.getOS() == llvm::Triple::FreeBSD) { + if (MArch == "armv6") + return "arm1176jzf-s"; + } Modified: head/contrib/llvm/patches/patch-r270147-llvm-r197824-r213427-r213960.diff ============================================================================== --- head/contrib/llvm/patches/patch-r270147-llvm-r197824-r213427-r213960.diff Sun Sep 21 14:39:31 2014 (r271930) +++ head/contrib/llvm/patches/patch-r270147-llvm-r197824-r213427-r213960.diff Sun Sep 21 15:37:39 2014 (r271931) @@ -1,3 +1,27 @@ +Backport r197824, r213427 and r213960 from LLVM trunk: + + r197824 | rdivacky | 2013-12-20 19:08:54 +0100 (Fri, 20 Dec 2013) | 2 lines + + Implement initial-exec TLS for PPC32. + + r213427 | hfinkel | 2014-07-19 01:29:49 +0200 (Sat, 19 Jul 2014) | 7 lines + + [PowerPC] 32-bit ELF PIC support + + This adds initial support for PPC32 ELF PIC (Position Independent Code; the + -fPIC variety), thus rectifying a long-standing deficiency in the PowerPC + backend. + + Patch by Justin Hibbits! + + r213960 | hfinkel | 2014-07-25 19:47:22 +0200 (Fri, 25 Jul 2014) | 3 lines + + [PowerPC] Support TLS on PPC32/ELF + + Patch by Justin Hibbits! + +Introduced here: http://svnweb.freebsd.org/changeset/base/270147 + Index: include/llvm/Support/ELF.h =================================================================== --- include/llvm/Support/ELF.h (revision 270019) Copied and modified: head/contrib/llvm/patches/patch-r271024-llvm-r216989-r216990-fix-movw-armv6.diff (from r271928, head/contrib/llvm/patches/patch-r271024-llvm-r216989-fix-movm-armv6.diff) ============================================================================== --- head/contrib/llvm/patches/patch-r271024-llvm-r216989-fix-movm-armv6.diff Sun Sep 21 12:07:22 2014 (r271928, copy source) +++ head/contrib/llvm/patches/patch-r271024-llvm-r216989-r216990-fix-movw-armv6.diff Sun Sep 21 15:37:39 2014 (r271931) @@ -1,7 +1,22 @@ +Pull in r216989 from upstream llvm trunk (by Renato Golin): + + MFV: Only emit movw on ARMv6T2+ + +Pull in r216990 from upstream llvm trunk (by Renato Golin): + + Missing test from r216989 + +Building for the FreeBSD default target ARMv6 was emitting movw ASM on certain +test cases (found building qmake4/5 for ARM). Don't do that, moreover, the AS +in base doesn't understand this instruction for this target. One would need +to use --integrated-as to get this to build if desired. + +Introduced here: http://svnweb.freebsd.org/changeset/base/271025 + Index: lib/Target/ARM/ARMInstrInfo.td =================================================================== ---- lib/Target/ARM/ARMInstrInfo.td (revision 271024) -+++ lib/Target/ARM/ARMInstrInfo.td (revision 271026) +--- lib/Target/ARM/ARMInstrInfo.td ++++ lib/Target/ARM/ARMInstrInfo.td @@ -3248,7 +3248,8 @@ def : ARMPat<(ARMadde GPR:$src, so_imm_not:$imm, CPSR), (SBCri GPR:$src, so_imm_not:$imm)>; @@ -12,3 +27,52 @@ Index: lib/Target/ARM/ARMInstrInfo.td // Note: These are implemented in C++ code, because they have to generate // ADD/SUBrs instructions, which use a complex pattern that a xform function +Index: test/CodeGen/ARM/carry.ll +=================================================================== +--- test/CodeGen/ARM/carry.ll ++++ test/CodeGen/ARM/carry.ll +@@ -1,4 +1,4 @@ +-; RUN: llc < %s -march=arm | FileCheck %s ++; RUN: llc < %s -mtriple=armv6t2-eabi | FileCheck %s + + define i64 @f1(i64 %a, i64 %b) { + ; CHECK-LABEL: f1: +Index: test/CodeGen/ARM/pr18364-movw.ll +=================================================================== +--- test/CodeGen/ARM/pr18364-movw.ll ++++ test/CodeGen/ARM/pr18364-movw.ll +@@ -0,0 +1,34 @@ ++; RUN: llc < %s -mtriple=armv5te | FileCheck %s --check-prefix=V5 ++; RUN: llc < %s -mtriple=armv6 | FileCheck %s --check-prefix=V6 ++; RUN: llc < %s -mtriple=armv6t2 | FileCheck %s --check-prefix=V6T2 ++; RUN: llc < %s -mtriple=armv7 | FileCheck %s --check-prefix=V7 ++; PR18364 ++ ++define i64 @f() #0 { ++entry: ++; V5-NOT: movw ++; V6-NOT: movw ++; V6T2: movw ++; V7: movw ++ %y = alloca i64, align 8 ++ %z = alloca i64, align 8 ++ store i64 1, i64* %y, align 8 ++ store i64 11579764786944, i64* %z, align 8 ++ %0 = load i64* %y, align 8 ++ %1 = load i64* %z, align 8 ++ %sub = sub i64 %0, %1 ++ ret i64 %sub ++} ++ ++define i64 @g(i64 %a, i32 %b) #0 { ++entry: ++; V5-NOT: movw ++; V6-NOT: movw ++; V6T2: movw ++; V7: movw ++ %0 = mul i64 %a, 86400000 ++ %mul = add i64 %0, -210866803200000 ++ %conv = sext i32 %b to i64 ++ %add = add nsw i64 %mul, %conv ++ ret i64 %add ++} Modified: head/contrib/llvm/patches/patch-r271282-clang-r200797-r200798-r200805-debug-info-crash.diff ============================================================================== --- head/contrib/llvm/patches/patch-r271282-clang-r200797-r200798-r200805-debug-info-crash.diff Sun Sep 21 14:39:31 2014 (r271930) +++ head/contrib/llvm/patches/patch-r271282-clang-r200797-r200798-r200805-debug-info-crash.diff Sun Sep 21 15:37:39 2014 (r271931) @@ -1,8 +1,17 @@ -diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp -index 59ba47c..dddc7e7 100644 ---- a/lib/CodeGen/CGDebugInfo.cpp -+++ b/lib/CodeGen/CGDebugInfo.cpp -@@ -2251,9 +2251,10 @@ llvm::DICompositeType CGDebugInfo::CreateLimitedType(const RecordType *Ty) { +Pull in r200797 from upstream clang trunk (by Adrian Prantl): + + Debug info: fix a crasher when when emitting debug info for + not-yet-completed templated types. getTypeSize() needs a complete type. + + rdar://problem/15931354 + +Introduced here: http://svnweb.freebsd.org/changeset/base/271282 + +Index: tools/clang/lib/CodeGen/CGDebugInfo.cpp +=================================================================== +--- tools/clang/lib/CodeGen/CGDebugInfo.cpp ++++ tools/clang/lib/CodeGen/CGDebugInfo.cpp +@@ -2251,9 +2251,10 @@ llvm::DICompositeType CGDebugInfo::CreateLimitedTy if (T && (!T.isForwardDecl() || !RD->getDefinition())) return T; @@ -16,36 +25,44 @@ index 59ba47c..dddc7e7 100644 return getOrCreateRecordFwdDecl(Ty, RDContext); uint64_t Size = CGM.getContext().getTypeSize(Ty); -diff --git a/test/CodeGenCXX/debug-info-template-fwd.cpp b/test/CodeGenCXX/debug-info-template-fwd.cpp -new file mode 100644 -index 0000000..b2b7073 ---- /dev/null -+++ b/test/CodeGenCXX/debug-info-template-fwd.cpp -@@ -0,0 +1,27 @@ +Index: tools/clang/test/CodeGenCXX/debug-info-template-fwd.cpp +=================================================================== +--- tools/clang/test/CodeGenCXX/debug-info-template-fwd.cpp ++++ tools/clang/test/CodeGenCXX/debug-info-template-fwd.cpp +@@ -0,0 +1,36 @@ +// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -g -emit-llvm -o - | FileCheck %s -+// This test is for a crash when emitting debug info for not-yet-completed -+// types. ++// This test is for a crash when emitting debug info for not-yet-completed types. +// Test that we don't actually emit a forward decl for the offending class: -+// CHECK: [ DW_TAG_structure_type ] [Derived] {{.*}} [def] ++// CHECK: [ DW_TAG_class_type ] [Derived] {{.*}} [def] +// rdar://problem/15931354 -+template class Derived; ++typedef const struct __CFString * CFStringRef; ++template class Returner {}; ++typedef const __CFString String; + -+template class Base { -+ static Derived *create(); ++template class Derived; ++ ++template ++class Base ++{ ++ static Derived* create(); ++}; ++ ++template ++class Derived : public Base { ++public: ++ static void foo(); +}; + -+template struct Derived : Base { ++class Foo ++{ ++ Foo(); ++ static Returner > all(); +}; + -+Base *f; ++Foo::Foo(){} + -+// During the instantiation of Derived, Base becomes required to be -+// complete - since the declaration has already been emitted (due to 'f', -+// above), we immediately try to build debug info for Base which then -+// requires the (incomplete definition) of Derived which is problematic. -+// -+// (if 'f' is not present, the point at which Base becomes required to be -+// complete during the instantiation of Derived is a no-op because -+// Base was never emitted so we ignore it and carry on until we -+// wire up the base class of Derived in the debug info later on) -+Derived d; ++Returner > Foo::all() ++{ ++ Derived::foo(); ++ return Foo::all(); ++} Modified: head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff ============================================================================== --- head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff Sun Sep 21 14:39:31 2014 (r271930) +++ head/contrib/llvm/patches/patch-r271432-clang-r205331-debug-info-crash.diff Sun Sep 21 15:37:39 2014 (r271931) @@ -1,18 +1,16 @@ -commit 96365aef99ec463375dfdaf6eb260823e0477b6a -Author: Adrian Prantl -Date: Tue Apr 1 17:52:06 2014 +0000 +Pull in r205331 from upstream clang trunk (by Adrian Prantl): - Debug info: fix a crash when emitting IndirectFieldDecls, which were - previously not handled at all. - rdar://problem/16348575 - - git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205331 91177308-0d34-0410-b5e6-96231b3b80d8 + Debug info: fix a crash when emitting IndirectFieldDecls, which were + previously not handled at all. + rdar://problem/16348575 -diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp -index 82db942..2556cf9 100644 ---- tools/clang/lib/CodeGen/CGDebugInfo.cpp -+++ tools/clangb/lib/CodeGen/CGDebugInfo.cpp -@@ -1252,7 +1252,7 @@ CollectTemplateParams(const TemplateParameterList *TPList, +Introduced here: http://svnweb.freebsd.org/changeset/base/271432 + +Index: tools/clang/lib/CodeGen/CGDebugInfo.cpp +=================================================================== +--- tools/clang/lib/CodeGen/CGDebugInfo.cpp (revision 205330) ++++ tools/clang/lib/CodeGen/CGDebugInfo.cpp (revision 205331) +@@ -1252,7 +1252,7 @@ CollectTemplateParams(const TemplateParameterList V = CGM.GetAddrOfFunction(FD); // Member data pointers have special handling too to compute the fixed // offset within the object. @@ -21,11 +19,10 @@ index 82db942..2556cf9 100644 // These five lines (& possibly the above member function pointer // handling) might be able to be refactored to use similar code in // CodeGenModule::getMemberPointerConstant -diff --git a/test/CodeGenCXX/debug-info-indirect-field-decl.cpp b/test/CodeGenCXX/debug-info-indirect-field-decl.cpp -new file mode 100644 -index 0000000..131ceba ---- /dev/null -+++ tools/clang/test/CodeGenCXX/debug-info-indirect-field-decl.cpp +Index: tools/clang/test/CodeGenCXX/debug-info-indirect-field-decl.cpp +=================================================================== +--- tools/clang/test/CodeGenCXX/debug-info-indirect-field-decl.cpp (revision 0) ++++ tools/clang/test/CodeGenCXX/debug-info-indirect-field-decl.cpp (revision 205331) @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o - | FileCheck %s +// Added: head/contrib/llvm/patches/patch-r271597-clang-r217410-i386-garbage-float.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r271597-clang-r217410-i386-garbage-float.diff Sun Sep 21 15:37:39 2014 (r271931) @@ -0,0 +1,64 @@ +Pull in r217410 from upstream llvm trunk (by Bob Wilson): + + Set trunc store action to Expand for all X86 targets. + + When compiling without SSE2, isTruncStoreLegal(F64, F32) would return + Legal, whereas with SSE2 it would return Expand. And since the Target + doesn't seem to actually handle a truncstore for double -> float, it + would just output a store of a full double in the space for a float + hence overwriting other bits on the stack. + + Patch by Luqman Aden! + +This should fix clang -O0 on i386 assigning garbage to floats, in +certain scenarios. + +Introduced here: http://svnweb.freebsd.org/changeset/base/271597 + +Index: lib/Target/X86/X86ISelLowering.cpp +=================================================================== +--- lib/Target/X86/X86ISelLowering.cpp (revision 208032) ++++ lib/Target/X86/X86ISelLowering.cpp (working copy) +@@ -300,6 +300,8 @@ void X86TargetLowering::resetOperationActions() { + setTruncStoreAction(MVT::i32, MVT::i8 , Expand); + setTruncStoreAction(MVT::i16, MVT::i8, Expand); + ++ setTruncStoreAction(MVT::f64, MVT::f32, Expand); ++ + // SETOEQ and SETUNE require checking two conditions. + setCondCodeAction(ISD::SETOEQ, MVT::f32, Expand); + setCondCodeAction(ISD::SETOEQ, MVT::f64, Expand); +@@ -1011,8 +1013,6 @@ void X86TargetLowering::resetOperationActions() { + AddPromotedToType (ISD::SELECT, VT, MVT::v2i64); + } + +- setTruncStoreAction(MVT::f64, MVT::f32, Expand); +- + // Custom lower v2i64 and v2f64 selects. + setOperationAction(ISD::LOAD, MVT::v2f64, Legal); + setOperationAction(ISD::LOAD, MVT::v2i64, Legal); +Index: test/CodeGen/X86/dont-trunc-store-double-to-float.ll +=================================================================== +--- test/CodeGen/X86/dont-trunc-store-double-to-float.ll (revision 0) ++++ test/CodeGen/X86/dont-trunc-store-double-to-float.ll (working copy) +@@ -0,0 +1,20 @@ ++; RUN: llc -march=x86 < %s | FileCheck %s ++ ++; CHECK-LABEL: @bar ++; CHECK: movl $1074339512, ++; CHECK: movl $1374389535, ++; CHECK: movl $1078523331, ++define void @bar() unnamed_addr { ++entry-block: ++ %a = alloca double ++ %b = alloca float ++ ++ store double 3.140000e+00, double* %a ++ %0 = load double* %a ++ ++ %1 = fptrunc double %0 to float ++ ++ store float %1, float* %b ++ ++ ret void ++} From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 17:29:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B701216D; Sun, 21 Sep 2014 17:29:43 +0000 (UTC) Received: from zibbi.meraka.csir.co.za (zibbi.meraka.csir.co.za [IPv6:2001:4200:7000:2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 539C415C; Sun, 21 Sep 2014 17:29:43 +0000 (UTC) Received: by zibbi.meraka.csir.co.za (Postfix, from userid 143891) id AD5064A14; Sun, 21 Sep 2014 19:29:29 +0200 (SAST) Date: Sun, 21 Sep 2014 19:29:29 +0200 From: John Hay To: Hiroki Sato Subject: Re: svn commit: r271909 - head/sbin/ping6 Message-ID: <20140921172929.GA12637@zibbi.meraka.csir.co.za> References: <201409201848.s8KImpDb053310@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409201848.s8KImpDb053310@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 17:29:43 -0000 On Sat, Sep 20, 2014 at 06:48:51PM +0000, Hiroki Sato wrote: > Author: hrs > Date: Sat Sep 20 18:48:50 2014 > New Revision: 271909 > URL: http://svnweb.freebsd.org/changeset/base/271909 > > Log: > Revert changes in r269180. It could cause -c N option to enter an > infinite loop if no reply packet is received. r269180 was merged to 10-, 9- and 8-. Maybe it should also be reverted? Regards John > > PR: 151023 > > Modified: > head/sbin/ping6/ping6.c > > Modified: head/sbin/ping6/ping6.c > ============================================================================== > --- head/sbin/ping6/ping6.c Sat Sep 20 16:43:14 2014 (r271908) > +++ head/sbin/ping6/ping6.c Sat Sep 20 18:48:50 2014 (r271909) > @@ -1090,14 +1090,8 @@ main(int argc, char *argv[]) > /* signal handling */ > if (seenalrm) { > /* last packet sent, timeout reached? */ > - if (npackets && ntransmitted >= npackets) { > - struct timeval zerotime = {0, 0}; > - itimer.it_value = zerotime; > - itimer.it_interval = zerotime; > - (void)setitimer(ITIMER_REAL, &itimer, NULL); > - seenalrm = 0; /* clear flag */ > - continue; > - } > + if (npackets && ntransmitted >= npackets) > + break; > retransmit(); > seenalrm = 0; > continue; From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 19:31:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00834652; Sun, 21 Sep 2014 19:31:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C575FE26; Sun, 21 Sep 2014 19:31:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LJVJqX063355; Sun, 21 Sep 2014 19:31:19 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8LJVJlG063354; Sun, 21 Sep 2014 19:31:19 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409211931.s8LJVJlG063354@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Sun, 21 Sep 2014 19:31:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271934 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 19:31:20 -0000 Author: smh Date: Sun Sep 21 19:31:19 2014 New Revision: 271934 URL: http://svnweb.freebsd.org/changeset/base/271934 Log: Output boot code warning when zpool upgrade -a is used to add features. In the case where new features where enabled by a zpool upgrade -a the boot code warning wasn't output. Submitted by: Jan Kokemueller MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Sep 21 18:52:56 2014 (r271933) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sun Sep 21 19:31:19 2014 (r271934) @@ -4524,7 +4524,8 @@ is_root_pool(zpool_handle_t *zhp) } static void -root_pool_upgrade_check(zpool_handle_t *zhp, char *poolname, int size) { +root_pool_upgrade_check(zpool_handle_t *zhp, char *poolname, int size) +{ if (poolname[0] == '\0' && is_root_pool(zhp)) (void) strlcpy(poolname, zpool_get_name(zhp), size); @@ -4623,7 +4624,7 @@ upgrade_cb(zpool_handle_t *zhp, void *ar #ifdef __FreeBSD__ root_pool_upgrade_check(zhp, cbp->cb_poolname, sizeof(cbp->cb_poolname)); -#endif /* ___FreeBSD__ */ +#endif /* __FreeBSD__ */ printnl = B_TRUE; #ifdef illumos @@ -4647,6 +4648,10 @@ upgrade_cb(zpool_handle_t *zhp, void *ar if (count > 0) { cbp->cb_first = B_FALSE; printnl = B_TRUE; +#ifdef __FreeBSD__ + root_pool_upgrade_check(zhp, cbp->cb_poolname, + sizeof(cbp->cb_poolname)); +#endif /* __FreeBSD__ */ /* * If they did "zpool upgrade -a", then we could * be doing ioctls to different pools. We need @@ -4788,7 +4793,7 @@ upgrade_one(zpool_handle_t *zhp, void *d #ifdef __FreeBSD__ root_pool_upgrade_check(zhp, cbp->cb_poolname, sizeof(cbp->cb_poolname)); -#endif /* ___FreeBSD__ */ +#endif /* __FreeBSD__ */ } if (cbp->cb_version >= SPA_VERSION_FEATURES) { From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 20:34:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE1393C2; Sun, 21 Sep 2014 20:34:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D98EB612; Sun, 21 Sep 2014 20:34:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LKYsST092245; Sun, 21 Sep 2014 20:34:54 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8LKYs8k092244; Sun, 21 Sep 2014 20:34:54 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201409212034.s8LKYs8k092244@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 21 Sep 2014 20:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271936 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 20:34:55 -0000 Author: jilles Date: Sun Sep 21 20:34:54 2014 New Revision: 271936 URL: http://svnweb.freebsd.org/changeset/base/271936 Log: sh(1): Clarify that assignments before commands do not affect expansions. PR: 193759 MFC after: 1 week Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun Sep 21 19:34:28 2014 (r271935) +++ head/bin/sh/sh.1 Sun Sep 21 20:34:54 2014 (r271936) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd September 4, 2014 +.Dd September 21, 2014 .Dt SH 1 .Os .Sh NAME @@ -590,7 +590,8 @@ the following actions: Leading words of the form .Dq Li name=value are stripped off and assigned to the environment of -the simple command. +the simple command +(they do not affect expansions). Redirection operators and their arguments (as described below) are stripped off and saved for processing. From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 21:25:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA8783F8; Sun, 21 Sep 2014 21:25:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAA49B4E; Sun, 21 Sep 2014 21:25:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LLPgdh016994; Sun, 21 Sep 2014 21:25:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8LLPf07016990; Sun, 21 Sep 2014 21:25:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201409212125.s8LLPf07016990@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 21 Sep 2014 21:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271937 - in head/lib/libproc: . test tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 21:25:43 -0000 Author: markj Date: Sun Sep 21 21:25:41 2014 New Revision: 271937 URL: http://svnweb.freebsd.org/changeset/base/271937 Log: Add some ATF tests for libproc. Differential Revision: D710 Reviewed by: jmmv, ngie, rpaulo Added: head/lib/libproc/tests/ head/lib/libproc/tests/Makefile (contents, props changed) head/lib/libproc/tests/proc_test.c (contents, props changed) head/lib/libproc/tests/target_prog.c (contents, props changed) Deleted: head/lib/libproc/test/ Modified: head/lib/libproc/Makefile Modified: head/lib/libproc/Makefile ============================================================================== --- head/lib/libproc/Makefile Sun Sep 21 20:34:54 2014 (r271936) +++ head/lib/libproc/Makefile Sun Sep 21 21:25:41 2014 (r271937) @@ -29,4 +29,8 @@ SHLIB_MAJOR= 2 MAN= +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/lib/libproc/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libproc/tests/Makefile Sun Sep 21 21:25:41 2014 (r271937) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/lib/libproc + +ATF_TESTS_C+= proc_test + +PROGS= target_prog +SRCS_target_prog= target_prog.c +BINDIR_target_prog= ${TESTSDIR} + +LDADD+= -lelf -lproc -lrtld_db -lutil +DPADD+= ${LIBELF} ${LIBPROC} ${LIBRTLD_DB} ${LIBUTIL} + +# Ensure that symbols aren't stripped from the test program, as they're needed +# for testing symbol lookup. +STRIP= + +MAN= +WARNS?= 6 + +.include Added: head/lib/libproc/tests/proc_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libproc/tests/proc_test.c Sun Sep 21 21:25:41 2014 (r271937) @@ -0,0 +1,347 @@ +/*- + * Copyright (c) 2014 Mark Johnston + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +static const char *aout_object = "a.out"; +static const char *ldelf_object = "ld-elf.so.1"; +static const char *target_prog_file = "target_prog"; + +/* + * Run the test program. If the sig parameter is set to true, the test program + * will deliver SIGUSR1 to itself during execution. + */ +static struct proc_handle * +start_prog(const struct atf_tc *tc, bool sig) +{ + char *argv[3]; + struct proc_handle *phdl; + int error; + + asprintf(&argv[0], "%s/%s", atf_tc_get_config_var(tc, "srcdir"), + target_prog_file); + ATF_REQUIRE(argv[0] != NULL); + + if (sig) { + argv[1] = strdup("-s"); + argv[2] = NULL; + } else { + argv[1] = NULL; + } + + error = proc_create(argv[0], argv, NULL, NULL, &phdl); + ATF_REQUIRE_EQ_MSG(error, 0, "failed to run '%s'", target_prog_file); + ATF_REQUIRE(phdl != NULL); + + free(argv[0]); + free(argv[1]); + + return (phdl); +} + +static void +set_bkpt(struct proc_handle *phdl, uintptr_t addr, u_long *saved) +{ + int error; + + error = proc_bkptset(phdl, addr, saved); + ATF_REQUIRE_EQ_MSG(error, 0, "failed to set breakpoint at 0x%jx", + (uintmax_t)addr); +} + +static void +remove_bkpt(struct proc_handle *phdl, uintptr_t addr, u_long val) +{ + int error; + + error = proc_bkptdel(phdl, addr, val); + ATF_REQUIRE_EQ_MSG(error, 0, + "failed to delete breakpoint at 0x%jx", (uintmax_t)addr); + + error = proc_regset(phdl, REG_PC, addr); + ATF_REQUIRE_EQ_MSG(error, 0, "failed to reset program counter"); +} + +/* + * Wait for the specified process to hit a breakpoint at the specified symbol. + */ +static void +verify_bkpt(struct proc_handle *phdl, GElf_Sym *sym, const char *symname, + const char *mapname) +{ + char mapbname[MAXPATHLEN], *name; + GElf_Sym tsym; + prmap_t *map; + size_t namesz; + u_long addr; + int error, state; + + state = proc_wstatus(phdl); + ATF_REQUIRE_EQ_MSG(state, PS_STOP, "process has state %d", state); + + /* Get the program counter and decrement it. */ + error = proc_regget(phdl, REG_PC, &addr); + ATF_REQUIRE_EQ_MSG(error, 0, "failed to obtain PC for '%s'", + target_prog_file); + proc_bkptregadj(&addr); + + /* + * Make sure the PC matches the expected value obtained from the symbol + * definition we looked up earlier. + */ + ATF_CHECK_EQ_MSG(addr, sym->st_value, + "program counter 0x%lx doesn't match expected value 0x%jx", + addr, (uintmax_t)sym->st_value); + + /* + * Ensure we can look up the r_debug_state symbol using its starting + * address and that the resulting symbol matches the one we found using + * a name lookup. + */ + namesz = strlen(symname) + 1; + name = malloc(namesz); + ATF_REQUIRE(name != NULL); + + error = proc_addr2sym(phdl, addr, name, namesz, &tsym); + ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up symbol at 0x%lx", addr); + ATF_REQUIRE_EQ(memcmp(sym, &tsym, sizeof(*sym)), 0); + ATF_REQUIRE_EQ(strcmp(symname, name), 0); + free(name); + + map = proc_addr2map(phdl, addr); + ATF_REQUIRE_MSG(map != NULL, "failed to look up map for address 0x%lx", + addr); + basename_r(map->pr_mapname, mapbname); + ATF_REQUIRE_EQ_MSG(strcmp(mapname, mapbname), 0, + "expected map name '%s' doesn't match '%s'", mapname, mapbname); +} + +ATF_TC(map_alias_obj2map); +ATF_TC_HEAD(map_alias_obj2map, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Callers are supposed to be able to use \"a.out\" as an alias for " + "the program executable. Make sure that proc_obj2map() handles " + "this properly."); +} +ATF_TC_BODY(map_alias_obj2map, tc) +{ + struct proc_handle *phdl; + prmap_t *map1, *map2; + + phdl = start_prog(tc, false); + + /* Initialize the rtld_db handle. */ + (void)proc_rdagent(phdl); + + /* Ensure that "target_prog" and "a.out" return the same map. */ + map1 = proc_obj2map(phdl, target_prog_file); + ATF_REQUIRE_MSG(map1 != NULL, "failed to look up map for '%s'", + target_prog_file); + map2 = proc_obj2map(phdl, aout_object); + ATF_REQUIRE_MSG(map2 != NULL, "failed to look up map for '%s'", + aout_object); + ATF_CHECK_EQ(strcmp(map1->pr_mapname, map2->pr_mapname), 0); + + ATF_CHECK_EQ_MSG(proc_continue(phdl), 0, "failed to resume execution"); + + proc_free(phdl); +} + +ATF_TC(map_alias_name2map); +ATF_TC_HEAD(map_alias_name2map, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Callers are supposed to be able to use \"a.out\" as an alias for " + "the program executable. Make sure that proc_name2map() handles " + "this properly."); +} +ATF_TC_BODY(map_alias_name2map, tc) +{ + struct proc_handle *phdl; + prmap_t *map1, *map2; + + phdl = start_prog(tc, false); + + /* Initialize the rtld_db handle. */ + (void)proc_rdagent(phdl); + + /* Ensure that "target_prog" and "a.out" return the same map. */ + map1 = proc_name2map(phdl, target_prog_file); + ATF_REQUIRE_MSG(map1 != NULL, "failed to look up map for '%s'", + target_prog_file); + map2 = proc_name2map(phdl, aout_object); + ATF_REQUIRE_MSG(map2 != NULL, "failed to look up map for '%s'", + aout_object); + ATF_CHECK_EQ(strcmp(map1->pr_mapname, map2->pr_mapname), 0); + + ATF_CHECK_EQ_MSG(proc_continue(phdl), 0, "failed to resume execution"); + + proc_free(phdl); +} + +ATF_TC(map_alias_name2sym); +ATF_TC_HEAD(map_alias_name2sym, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Callers are supposed to be able to use \"a.out\" as an alias for " + "the program executable. Make sure that proc_name2sym() handles " + "this properly."); +} +ATF_TC_BODY(map_alias_name2sym, tc) +{ + GElf_Sym sym1, sym2; + struct proc_handle *phdl; + int error; + + phdl = start_prog(tc, false); + + /* Initialize the rtld_db handle. */ + (void)proc_rdagent(phdl); + + /* + * Make sure that "target_prog:main" and "a.out:main" return the same + * symbol. + */ + error = proc_name2sym(phdl, target_prog_file, "main", &sym1); + ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'main' via %s", + target_prog_file); + error = proc_name2sym(phdl, aout_object, "main", &sym2); + ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'main' via %s", + aout_object); + + ATF_CHECK_EQ(memcmp(&sym1, &sym2, sizeof(sym1)), 0); + + ATF_CHECK_EQ_MSG(proc_continue(phdl), 0, "failed to resume execution"); + + proc_free(phdl); +} + +ATF_TC(symbol_lookup); +ATF_TC_HEAD(symbol_lookup, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Look up a couple of well-known symbols in the test program, place " + "breakpoints on them, and verify that we hit the breakpoints. Also " + "make sure that we can use the breakpoint address to look up the " + "corresponding symbol."); +} +ATF_TC_BODY(symbol_lookup, tc) +{ + GElf_Sym main_sym, r_debug_state_sym; + struct proc_handle *phdl; + u_long saved; + int error; + + phdl = start_prog(tc, false); + + error = proc_name2sym(phdl, target_prog_file, "main", &main_sym); + ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'main'"); + + error = proc_name2sym(phdl, ldelf_object, "r_debug_state", + &r_debug_state_sym); + ATF_REQUIRE_EQ_MSG(error, 0, "failed to look up 'r_debug_state'"); + + set_bkpt(phdl, r_debug_state_sym.st_value, &saved); + ATF_CHECK_EQ_MSG(proc_continue(phdl), 0, "failed to resume execution"); + verify_bkpt(phdl, &r_debug_state_sym, "r_debug_state", ldelf_object); + remove_bkpt(phdl, r_debug_state_sym.st_value, saved); + + set_bkpt(phdl, main_sym.st_value, &saved); + ATF_CHECK_EQ_MSG(proc_continue(phdl), 0, "failed to resume execution"); + verify_bkpt(phdl, &main_sym, "main", target_prog_file); + remove_bkpt(phdl, main_sym.st_value, saved); + + ATF_CHECK_EQ_MSG(proc_continue(phdl), 0, "failed to resume execution"); + + proc_free(phdl); +} + +ATF_TC(signal_forward); +ATF_TC_HEAD(signal_forward, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Run the test program in a mode which causes it to send a signal " + "to itself. Make sure that we intercept the signal and that " + "proc_continue() forwards it to the process."); +} +ATF_TC_BODY(signal_forward, tc) +{ + struct proc_handle *phdl; + int state, status; + + phdl = start_prog(tc, true); + ATF_CHECK_EQ_MSG(proc_continue(phdl), 0, "failed to resume execution"); + + /* The process should have been interrupted by a signal. */ + state = proc_wstatus(phdl); + ATF_REQUIRE_EQ_MSG(state, PS_STOP, "process has unexpected state %d", + state); + + /* Continue execution and allow the signal to be delivered. */ + ATF_CHECK_EQ_MSG(proc_continue(phdl), 0, "failed to resume execution"); + + /* + * Make sure the process exited with status 0. If it didn't receive the + * SIGUSR1 that it sent to itself, it'll exit with a non-zero exit + * status, causing the test to fail. + */ + state = proc_wstatus(phdl); + ATF_REQUIRE_EQ_MSG(state, PS_UNDEAD, "process has unexpected state %d", + state); + + status = proc_getwstat(phdl); + ATF_REQUIRE(status >= 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE_EQ(WEXITSTATUS(status), 0); + + proc_free(phdl); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, map_alias_obj2map); + ATF_TP_ADD_TC(tp, map_alias_name2map); + ATF_TP_ADD_TC(tp, map_alias_name2sym); + ATF_TP_ADD_TC(tp, symbol_lookup); + ATF_TP_ADD_TC(tp, signal_forward); + + return (atf_no_error()); +} Added: head/lib/libproc/tests/target_prog.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libproc/tests/target_prog.c Sun Sep 21 21:25:41 2014 (r271937) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2014 Mark Johnston + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +static volatile sig_atomic_t saw; + +static void +usr1(int sig __unused) +{ + + saw = 1; +} + +int +main(int argc, char **argv) +{ + + if (argc == 1) + return (EXIT_SUCCESS); + if (argc == 2 && strcmp(argv[1], "-s") == 0) { + if (signal(SIGUSR1, usr1) == SIG_ERR) + err(1, "signal"); + if (kill(getpid(), SIGUSR1) != 0) + err(1, "kill"); + return (saw == 1 ? EXIT_SUCCESS : EXIT_FAILURE); + } + return (EXIT_FAILURE); +} From owner-svn-src-all@FreeBSD.ORG Sun Sep 21 21:31:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C2C85C3; Sun, 21 Sep 2014 21:31:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77F33B76; Sun, 21 Sep 2014 21:31:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8LLVHRo020102; Sun, 21 Sep 2014 21:31:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8LLVHpg020101; Sun, 21 Sep 2014 21:31:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201409212131.s8LLVHpg020101@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 21 Sep 2014 21:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271938 - head/tools/test/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Sep 2014 21:31:17 -0000 Author: markj Date: Sun Sep 21 21:31:16 2014 New Revision: 271938 URL: http://svnweb.freebsd.org/changeset/base/271938 Log: Ignore a test program which doesn't compile at the moment. It will be addresed properly when integrating the DTrace tests with Kyua. Modified: head/tools/test/dtrace/Makefile Modified: head/tools/test/dtrace/Makefile ============================================================================== --- head/tools/test/dtrace/Makefile Sun Sep 21 21:25:41 2014 (r271937) +++ head/tools/test/dtrace/Makefile Sun Sep 21 21:31:16 2014 (r271938) @@ -85,7 +85,8 @@ IGNORE= \ ${TESTSRCDIR}/tst/common/ip/tst.localtcpstate.ksh \ ${TESTSRCDIR}/tst/common/ip/tst.remotetcpstate.ksh \ ${TESTSRCDIR}/tst/common/scripting/tst.projid.ksh \ - ${TESTSRCDIR}/tst/common/scripting/tst.taskid.ksh + ${TESTSRCDIR}/tst/common/scripting/tst.taskid.ksh \ + ${TESTSRCDIR}/tst/common/json/tst.usdt.c From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 00:40:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D8F53AA; Mon, 22 Sep 2014 00:40:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D333AEE0; Mon, 22 Sep 2014 00:40:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8M0eK76009070; Mon, 22 Sep 2014 00:40:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8M0eKil009069; Mon, 22 Sep 2014 00:40:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409220040.s8M0eKil009069@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 22 Sep 2014 00:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271940 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 00:40:21 -0000 Author: mav Date: Mon Sep 22 00:40:20 2014 New Revision: 271940 URL: http://svnweb.freebsd.org/changeset/base/271940 Log: Polish INQUIRY command fields validation. Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sun Sep 21 23:42:54 2014 (r271939) +++ head/sys/cam/ctl/ctl.c Mon Sep 22 00:40:20 2014 (r271940) @@ -10723,45 +10723,23 @@ ctl_inquiry(struct ctl_scsiio *ctsio) struct scsi_inquiry *cdb; int retval; - cdb = (struct scsi_inquiry *)ctsio->cdb; - - retval = 0; - CTL_DEBUG_PRINT(("ctl_inquiry\n")); - /* - * Right now, we don't support the CmdDt inquiry information. - * This would be nice to support in the future. When we do - * support it, we should change this test so that it checks to make - * sure SI_EVPD and SI_CMDDT aren't both set at the same time. - */ -#ifdef notyet - if (((cdb->byte2 & SI_EVPD) - && (cdb->byte2 & SI_CMDDT))) -#endif - if (cdb->byte2 & SI_CMDDT) { - /* - * Point to the SI_CMDDT bit. We might change this - * when we support SI_CMDDT, but since both bits would be - * "wrong", this should probably just stay as-is then. - */ + cdb = (struct scsi_inquiry *)ctsio->cdb; + if (cdb->byte2 & SI_EVPD) + retval = ctl_inquiry_evpd(ctsio); + else if (cdb->page_code == 0) + retval = ctl_inquiry_std(ctsio); + else { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, - /*field*/ 1, - /*bit_valid*/ 1, - /*bit*/ 1); + /*field*/ 2, + /*bit_valid*/ 0, + /*bit*/ 0); ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } - if (cdb->byte2 & SI_EVPD) - retval = ctl_inquiry_evpd(ctsio); -#ifdef notyet - else if (cdb->byte2 & SI_CMDDT) - retval = ctl_inquiry_cmddt(ctsio); -#endif - else - retval = ctl_inquiry_std(ctsio); return (retval); } From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 01:04:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0198F840; Mon, 22 Sep 2014 01:04:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1B1C10B; Mon, 22 Sep 2014 01:04:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8M14R2p022333; Mon, 22 Sep 2014 01:04:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8M14RfV022332; Mon, 22 Sep 2014 01:04:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409220104.s8M14RfV022332@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 22 Sep 2014 01:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271941 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 01:04:28 -0000 Author: mav Date: Mon Sep 22 01:04:27 2014 New Revision: 271941 URL: http://svnweb.freebsd.org/changeset/base/271941 Log: Report proper errors codes for unsupported SERVICE ACTION values. Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Sep 22 00:40:20 2014 (r271940) +++ head/sys/cam/ctl/ctl.c Mon Sep 22 01:04:27 2014 (r271941) @@ -440,7 +440,7 @@ static void ctl_enqueue_rtr(union ctl_io static void ctl_enqueue_done(union ctl_io *io); static void ctl_enqueue_isc(union ctl_io *io); static const struct ctl_cmd_entry * - ctl_get_cmd_entry(struct ctl_scsiio *ctsio); + ctl_get_cmd_entry(struct ctl_scsiio *ctsio, int *sa); static const struct ctl_cmd_entry * ctl_validate_command(struct ctl_scsiio *ctsio); static int ctl_cmd_applicable(uint8_t lun_type, @@ -644,7 +644,7 @@ ctl_isc_event_handler(ctl_ha_channel cha if (ctl_softc->ha_mode == CTL_HA_MODE_XFER) { const struct ctl_cmd_entry *entry; - entry = ctl_get_cmd_entry(&io->scsiio); + entry = ctl_get_cmd_entry(&io->scsiio, NULL); io->io_hdr.flags &= ~CTL_FLAG_DATA_MASK; io->io_hdr.flags |= entry->flags & CTL_FLAG_DATA_MASK; @@ -11035,8 +11035,8 @@ ctl_check_for_blockage(struct ctl_lun *l || (ooa_io->scsiio.tag_type == CTL_TAG_ORDERED))) return (CTL_ACTION_BLOCK); - pending_entry = ctl_get_cmd_entry(&pending_io->scsiio); - ooa_entry = ctl_get_cmd_entry(&ooa_io->scsiio); + pending_entry = ctl_get_cmd_entry(&pending_io->scsiio, NULL); + ooa_entry = ctl_get_cmd_entry(&ooa_io->scsiio, NULL); serialize_row = ctl_serialize_table[ooa_entry->seridx]; @@ -11209,7 +11209,7 @@ ctl_check_blocked(struct ctl_lun *lun) } break; } - entry = ctl_get_cmd_entry(&cur_blocked->scsiio); + entry = ctl_get_cmd_entry(&cur_blocked->scsiio, NULL); softc = control_softc; initidx = ctl_get_initindex(&cur_blocked->io_hdr.nexus); @@ -11860,12 +11860,14 @@ ctl_scsiio_precheck(struct ctl_softc *ct } const struct ctl_cmd_entry * -ctl_get_cmd_entry(struct ctl_scsiio *ctsio) +ctl_get_cmd_entry(struct ctl_scsiio *ctsio, int *sa) { const struct ctl_cmd_entry *entry; int service_action; entry = &ctl_cmd_table[ctsio->cdb[0]]; + if (sa) + *sa = ((entry->flags & CTL_CMD_FLAG_SA5) != 0); if (entry->flags & CTL_CMD_FLAG_SA5) { service_action = ctsio->cdb[1] & SERVICE_ACTION_MASK; entry = &((const struct ctl_cmd_entry *) @@ -11878,12 +11880,20 @@ const struct ctl_cmd_entry * ctl_validate_command(struct ctl_scsiio *ctsio) { const struct ctl_cmd_entry *entry; - int i; + int i, sa; uint8_t diff; - entry = ctl_get_cmd_entry(ctsio); + entry = ctl_get_cmd_entry(ctsio, &sa); if (entry->execute == NULL) { - ctl_set_invalid_opcode(ctsio); + if (sa) + ctl_set_invalid_field(ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 1, + /*bit_valid*/ 1, + /*bit*/ 4); + else + ctl_set_invalid_opcode(ctsio); ctl_done((union ctl_io *)ctsio); return (NULL); } @@ -11937,7 +11947,7 @@ ctl_scsiio(struct ctl_scsiio *ctsio) CTL_DEBUG_PRINT(("ctl_scsiio cdb[0]=%02X\n", ctsio->cdb[0])); - entry = ctl_get_cmd_entry(ctsio); + entry = ctl_get_cmd_entry(ctsio, NULL); /* * If this I/O has been aborted, just send it straight to @@ -12467,7 +12477,7 @@ ctl_handle_isc(union ctl_io *io) * This is only used in SER_ONLY mode. */ free_io = 0; - entry = ctl_get_cmd_entry(&io->scsiio); + entry = ctl_get_cmd_entry(&io->scsiio, NULL); mtx_lock(&lun->lun_lock); if (ctl_scsiio_lun_check(ctl_softc, lun, entry, (struct ctl_scsiio *)io) != 0) { @@ -12547,7 +12557,7 @@ ctl_cmd_pattern_match(struct ctl_scsiio if ((pattern & CTL_LUN_PAT_MASK) == CTL_LUN_PAT_ANY) return (CTL_LUN_PAT_ANY); - entry = ctl_get_cmd_entry(ctsio); + entry = ctl_get_cmd_entry(ctsio, NULL); filtered_pattern = entry->pattern & pattern; From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 01:17:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CCB6A09; Mon, 22 Sep 2014 01:17:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CFB01D5; Mon, 22 Sep 2014 01:17:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8M1Hn00027524; Mon, 22 Sep 2014 01:17:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8M1HnCM027523; Mon, 22 Sep 2014 01:17:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409220117.s8M1HnCM027523@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 22 Sep 2014 01:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271942 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 01:17:49 -0000 Author: mav Date: Mon Sep 22 01:17:48 2014 New Revision: 271942 URL: http://svnweb.freebsd.org/changeset/base/271942 Log: Don't report unsupported FUA_NV bit set in READ/WRITE commands as error. While this bit is obsolete in SBC-3, SBC-2 allowed to silently ignore it. Modified: head/sys/cam/ctl/ctl_cmd_table.c Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Mon Sep 22 01:04:27 2014 (r271941) +++ head/sys/cam/ctl/ctl_cmd_table.c Mon Sep 22 01:17:48 2014 (r271942) @@ -694,7 +694,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_FLAG_DATA_IN | CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, - 10, {0x18, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, + 10, {0x1a, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, /* 29 READ GENERATION */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, @@ -702,7 +702,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 2A WRITE(10) */ {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT, CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE, - 10, {0x18, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, + 10, {0x1a, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, /* 2B SEEK(10) */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, @@ -1035,7 +1035,7 @@ const struct ctl_cmd_entry ctl_cmd_table {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, - 16, {0x18, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 16, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* 89 COMPARE AND WRITE */ @@ -1047,7 +1047,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 8A WRITE(16) */ {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT, CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE, - 16, {0x18, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 16, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* 8B */ @@ -1169,7 +1169,7 @@ const struct ctl_cmd_entry ctl_cmd_table {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, - 12, {0x18, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, + 12, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* A9 PLAY TRACK RELATIVE(12) */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, @@ -1177,7 +1177,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* AA WRITE(12) */ {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT, CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE, - 12, {0x18, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, + 12, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* AB SERVICE ACTION IN(12) */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 05:00:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9B09495; Mon, 22 Sep 2014 05:00:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5041950; Mon, 22 Sep 2014 05:00:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8M50tbG032789; Mon, 22 Sep 2014 05:00:55 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8M50tjp032788; Mon, 22 Sep 2014 05:00:55 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409220500.s8M50tjp032788@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 22 Sep 2014 05:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271943 - stable/10/release/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 05:00:56 -0000 Author: gjb Date: Mon Sep 22 05:00:55 2014 New Revision: 271943 URL: http://svnweb.freebsd.org/changeset/base/271943 Log: MFC r271876: When populating the dvd/packages/ directory, create a symlink to All/pkg-*.txz in the Latest/ directory. This allows 'pkg bootstrap' to work out-of-box if the REPOS_DIR environment is properly set. Approved by: re (delphij) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/scripts/pkg-stage.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/scripts/pkg-stage.sh ============================================================================== --- stable/10/release/scripts/pkg-stage.sh Mon Sep 22 01:17:48 2014 (r271942) +++ stable/10/release/scripts/pkg-stage.sh Mon Sep 22 05:00:55 2014 (r271943) @@ -50,6 +50,12 @@ ${PKGCMD} -vv ${PKGCMD} update -f ${PKGCMD} fetch -o ${PKG_REPODIR} -d ${DVD_PACKAGES} +# Create the 'Latest/pkg.txz' symlink so 'pkg bootstrap' works +# using the on-disc packages. +mkdir -p ${PKG_REPODIR}/Latest +(cd ${PKG_REPODIR}/Latest && \ + ln -s ../All/$(${PKGCMD} rquery %n-%v pkg).txz pkg.txz) + ${PKGCMD} repo ${PKG_REPODIR} # Always exit '0', even if pkg(8) complains about conflicts. From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 05:07:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D8AA632; Mon, 22 Sep 2014 05:07:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 096BEA0D; Mon, 22 Sep 2014 05:07:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8M57MjI035185; Mon, 22 Sep 2014 05:07:22 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8M57Mcn035184; Mon, 22 Sep 2014 05:07:22 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201409220507.s8M57Mcn035184@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 22 Sep 2014 05:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271944 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 05:07:23 -0000 Author: sbruno Date: Mon Sep 22 05:07:22 2014 New Revision: 271944 URL: http://svnweb.freebsd.org/changeset/base/271944 Log: svn revisions r269964 and r269963 seemed to have impaired small memory footprint systems(32M/64M) and didn't leave enough free memory to load modules when it was setting up page tables that for sizes that are never used on these smallish boards. Set kmem_zmax to PAGE_SIZE on these smaller systems (< 128M) to keep this from happening. Verified on mips32 h/w. PR: 193465 Submitted by: delphij Reviewed by: adrian Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Mon Sep 22 05:00:55 2014 (r271943) +++ head/sys/kern/kern_malloc.c Mon Sep 22 05:07:22 2014 (r271944) @@ -717,6 +717,8 @@ kmeminit(void) * a given architecture. */ mem_size = vm_cnt.v_page_count; + if (mem_size <= 32768) /* delphij XXX 128MB */ + kmem_zmax = PAGE_SIZE; if (vm_kmem_size_scale < 1) vm_kmem_size_scale = VM_KMEM_SIZE_SCALE; From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 07:59:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5B7A3C8; Mon, 22 Sep 2014 07:59:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95317C9B; Mon, 22 Sep 2014 07:59:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8M7xQxG017320; Mon, 22 Sep 2014 07:59:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8M7xQZl017317; Mon, 22 Sep 2014 07:59:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409220759.s8M7xQZl017317@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 22 Sep 2014 07:59:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271945 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 07:59:26 -0000 Author: mav Date: Mon Sep 22 07:59:25 2014 New Revision: 271945 URL: http://svnweb.freebsd.org/changeset/base/271945 Log: Simplify legacy reservation handling. Drop it on I_T nexus loss. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_private.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Sep 22 05:07:22 2014 (r271944) +++ head/sys/cam/ctl/ctl.c Mon Sep 22 07:59:25 2014 (r271945) @@ -5308,12 +5308,14 @@ ctl_scsi_release(struct ctl_scsiio *ctsi int length, longid, thirdparty_id, resv_id; struct ctl_softc *ctl_softc; struct ctl_lun *lun; + uint32_t residx; length = 0; resv_id = 0; CTL_DEBUG_PRINT(("ctl_scsi_release\n")); + residx = ctl_get_resindex(&ctsio->io_hdr.nexus); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; ctl_softc = control_softc; @@ -5371,14 +5373,8 @@ ctl_scsi_release(struct ctl_scsiio *ctsi * released, though, by the initiator who made it or by one of * several reset type events. */ - if (lun->flags & CTL_LUN_RESERVED) { - if ((ctsio->io_hdr.nexus.initid.id == lun->rsv_nexus.initid.id) - && (ctsio->io_hdr.nexus.targ_port == lun->rsv_nexus.targ_port) - && (ctsio->io_hdr.nexus.targ_target.id == - lun->rsv_nexus.targ_target.id)) { + if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx == residx)) lun->flags &= ~CTL_LUN_RESERVED; - } - } mtx_unlock(&lun->lun_lock); @@ -5402,6 +5398,7 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi uint64_t thirdparty_id; struct ctl_softc *ctl_softc; struct ctl_lun *lun; + uint32_t residx; extent = 0; thirdparty = 0; @@ -5412,6 +5409,7 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi CTL_DEBUG_PRINT(("ctl_reserve\n")); + residx = ctl_get_resindex(&ctsio->io_hdr.nexus); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; ctl_softc = control_softc; @@ -5460,19 +5458,14 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi thirdparty_id = scsi_8btou64(ctsio->kern_data_ptr); mtx_lock(&lun->lun_lock); - if (lun->flags & CTL_LUN_RESERVED) { - if ((ctsio->io_hdr.nexus.initid.id != lun->rsv_nexus.initid.id) - || (ctsio->io_hdr.nexus.targ_port != lun->rsv_nexus.targ_port) - || (ctsio->io_hdr.nexus.targ_target.id != - lun->rsv_nexus.targ_target.id)) { - ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT; - ctsio->io_hdr.status = CTL_SCSI_ERROR; - goto bailout; - } + if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx != residx)) { + ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT; + ctsio->io_hdr.status = CTL_SCSI_ERROR; + goto bailout; } lun->flags |= CTL_LUN_RESERVED; - lun->rsv_nexus = ctsio->io_hdr.nexus; + lun->res_idx = residx; ctsio->scsi_status = SCSI_STATUS_OK; ctsio->io_hdr.status = CTL_SUCCESS; @@ -11260,6 +11253,7 @@ ctl_scsiio_lun_check(struct ctl_softc *c const struct ctl_cmd_entry *entry, struct ctl_scsiio *ctsio) { int retval; + uint32_t residx; retval = 0; @@ -11284,12 +11278,10 @@ ctl_scsiio_lun_check(struct ctl_softc *c * even on reserved LUNs, and if this initiator isn't the one who * reserved us, reject the command with a reservation conflict. */ + residx = ctl_get_resindex(&ctsio->io_hdr.nexus); if ((lun->flags & CTL_LUN_RESERVED) && ((entry->flags & CTL_CMD_FLAG_ALLOW_ON_RESV) == 0)) { - if ((ctsio->io_hdr.nexus.initid.id != lun->rsv_nexus.initid.id) - || (ctsio->io_hdr.nexus.targ_port != lun->rsv_nexus.targ_port) - || (ctsio->io_hdr.nexus.targ_target.id != - lun->rsv_nexus.targ_target.id)) { + if (lun->res_idx != residx) { ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT; ctsio->io_hdr.status = CTL_SCSI_ERROR; retval = 1; @@ -11297,11 +11289,8 @@ ctl_scsiio_lun_check(struct ctl_softc *c } } - if ( (lun->flags & CTL_LUN_PR_RESERVED) + if ((lun->flags & CTL_LUN_PR_RESERVED) && ((entry->flags & CTL_CMD_FLAG_ALLOW_ON_PR_RESV) == 0)) { - uint32_t residx; - - residx = ctl_get_resindex(&ctsio->io_hdr.nexus); /* * if we aren't registered or it's a res holder type * reservation and this isn't the res holder then set a @@ -12167,9 +12156,10 @@ ctl_i_t_nexus_reset(union ctl_io *io) { struct ctl_softc *softc = control_softc; struct ctl_lun *lun; - uint32_t initindex; + uint32_t initindex, residx; initindex = ctl_get_initindex(&io->io_hdr.nexus); + residx = ctl_get_resindex(&io->io_hdr.nexus); mtx_lock(&softc->ctl_lock); STAILQ_FOREACH(lun, &softc->lun_list, links) { mtx_lock(&lun->lun_lock); @@ -12179,6 +12169,8 @@ ctl_i_t_nexus_reset(union ctl_io *io) #ifdef CTL_WITH_CA ctl_clear_mask(lun->have_ca, initindex); #endif + if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx == residx)) + lun->flags &= ~CTL_LUN_RESERVED; lun->pending_ua[initindex] |= CTL_UA_I_T_NEXUS_LOSS; mtx_unlock(&lun->lun_lock); } Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Mon Sep 22 05:07:22 2014 (r271944) +++ head/sys/cam/ctl/ctl_private.h Mon Sep 22 07:59:25 2014 (r271945) @@ -389,7 +389,6 @@ struct ctl_lun { TAILQ_HEAD(ctl_blockq,ctl_io_hdr) blocked_queue; STAILQ_ENTRY(ctl_lun) links; STAILQ_ENTRY(ctl_lun) run_links; - struct ctl_nexus rsv_nexus; #ifdef CTL_WITH_CA uint32_t have_ca[CTL_MAX_INITIATORS >> 5]; struct scsi_sense_data pending_sense[CTL_MAX_INITIATORS]; @@ -397,6 +396,7 @@ struct ctl_lun { ctl_ua_type pending_ua[CTL_MAX_INITIATORS]; struct ctl_mode_pages mode_pages; struct ctl_lun_io_stats stats; + uint32_t res_idx; struct ctl_per_res_info per_res[2*CTL_MAX_INITIATORS]; unsigned int PRGeneration; int pr_key_count; From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 08:27:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D2F0BE1; Mon, 22 Sep 2014 08:27:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA077FC6; Mon, 22 Sep 2014 08:27:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8M8RVtF031544; Mon, 22 Sep 2014 08:27:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8M8RRHB031526; Mon, 22 Sep 2014 08:27:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409220827.s8M8RRHB031526@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 22 Sep 2014 08:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271946 - in head/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront kern net netinet ofed/drivers/net/mlx4 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 08:27:32 -0000 Author: hselasky Date: Mon Sep 22 08:27:27 2014 New Revision: 271946 URL: http://svnweb.freebsd.org/changeset/base/271946 Log: Improve transmit sending offload, TSO, algorithm in general. The current TSO limitation feature only takes the total number of bytes in an mbuf chain into account and does not limit by the number of mbufs in a chain. Some kinds of hardware is limited by two factors. One is the fragment length and the second is the fragment count. Both of these limits need to be taken into account when doing TSO. Else some kinds of hardware might have to drop completely valid mbuf chains because they cannot loaded into the given hardware's DMA engine. The new way of doing TSO limitation has been made backwards compatible as input from other FreeBSD developers and will use defaults for values not set. Reviewed by: adrian, rmacklem Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/oce/oce_if.c head/sys/dev/oce/oce_if.h head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/dev/vmware/vmxnet3/if_vmxvar.h head/sys/dev/xen/netfront/netfront.c head/sys/kern/uipc_sockbuf.c head/sys/net/if.c head/sys/net/if_lagg.c head/sys/net/if_var.h head/sys/net/if_vlan.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h head/sys/ofed/drivers/net/mlx4/en_netdev.c head/sys/sys/sockbuf.h Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/dev/oce/oce_if.c Mon Sep 22 08:27:27 2014 (r271946) @@ -1731,7 +1731,9 @@ oce_attach_ifp(POCE_SOFTC sc) sc->ifp->if_baudrate = IF_Gbps(10); #if __FreeBSD_version >= 1000000 - sc->ifp->if_hw_tsomax = OCE_MAX_TSO_SIZE; + sc->ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + sc->ifp->if_hw_tsomaxsegcount = OCE_MAX_TX_ELEMENTS; + sc->ifp->if_hw_tsomaxsegsize = 4096; #endif ether_ifattach(sc->ifp, sc->macaddr.mac_addr); Modified: head/sys/dev/oce/oce_if.h ============================================================================== --- head/sys/dev/oce/oce_if.h Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/dev/oce/oce_if.h Mon Sep 22 08:27:27 2014 (r271946) @@ -152,7 +152,6 @@ extern int mp_ncpus; /* system's total #define OCE_MAX_TX_ELEMENTS 29 #define OCE_MAX_TX_DESC 1024 #define OCE_MAX_TX_SIZE 65535 -#define OCE_MAX_TSO_SIZE (65535 - ETHER_HDR_LEN) #define OCE_MAX_RX_SIZE 4096 #define OCE_MAX_RQ_POSTS 255 #define OCE_DEFAULT_PROMISCUOUS 0 Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Sep 22 08:27:27 2014 (r271946) @@ -1722,7 +1722,9 @@ vmxnet3_setup_interface(struct vmxnet3_s ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_init = vmxnet3_init; ifp->if_ioctl = vmxnet3_ioctl; - ifp->if_hw_tsomax = VMXNET3_TSO_MAXSIZE; + ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + ifp->if_hw_tsomaxsegcount = VMXNET3_TX_MAXSEGS; + ifp->if_hw_tsomaxsegsize = VMXNET3_TX_MAXSEGSIZE; #ifdef VMXNET3_LEGACY_TX ifp->if_start = vmxnet3_start; Modified: head/sys/dev/vmware/vmxnet3/if_vmxvar.h ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmxvar.h Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/dev/vmware/vmxnet3/if_vmxvar.h Mon Sep 22 08:27:27 2014 (r271946) @@ -277,8 +277,6 @@ struct vmxnet3_softc { */ #define VMXNET3_TX_MAXSEGS 32 #define VMXNET3_TX_MAXSIZE (VMXNET3_TX_MAXSEGS * MCLBYTES) -#define VMXNET3_TSO_MAXSIZE \ - (VMXNET3_TX_MAXSIZE - sizeof(struct ether_vlan_header)) /* * Maximum support Tx segments size. The length field in the Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/dev/xen/netfront/netfront.c Mon Sep 22 08:27:27 2014 (r271946) @@ -134,7 +134,6 @@ static const int MODPARM_rx_flip = 0; * to mirror the Linux MAX_SKB_FRAGS constant. */ #define MAX_TX_REQ_FRAGS (65536 / PAGE_SIZE + 2) -#define NF_TSO_MAXBURST ((IP_MAXPACKET / PAGE_SIZE) * MCLBYTES) #define RX_COPY_THRESHOLD 256 @@ -2102,7 +2101,9 @@ create_netdev(device_t dev) ifp->if_hwassist = XN_CSUM_FEATURES; ifp->if_capabilities = IFCAP_HWCSUM; - ifp->if_hw_tsomax = NF_TSO_MAXBURST; + ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + ifp->if_hw_tsomaxsegcount = MAX_TX_REQ_FRAGS; + ifp->if_hw_tsomaxsegsize = PAGE_SIZE; ether_ifattach(ifp, np->mac); callout_init(&np->xn_stat_ch, CALLOUT_MPSAFE); Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/kern/uipc_sockbuf.c Mon Sep 22 08:27:27 2014 (r271946) @@ -1015,6 +1015,37 @@ sbsndptr(struct sockbuf *sb, u_int off, } /* + * Return the first mbuf and the mbuf data offset for the provided + * send offset without changing the "sb_sndptroff" field. + */ +struct mbuf * +sbsndmbuf(struct sockbuf *sb, u_int off, u_int *moff) +{ + struct mbuf *m; + + KASSERT(sb->sb_mb != NULL, ("%s: sb_mb is NULL", __func__)); + + /* + * If the "off" is below the stored offset, which happens on + * retransmits, just use "sb_mb": + */ + if (sb->sb_sndptr == NULL || sb->sb_sndptroff > off) { + m = sb->sb_mb; + } else { + m = sb->sb_sndptr; + off -= sb->sb_sndptroff; + } + while (off > 0 && m != NULL) { + if (off < m->m_len) + break; + off -= m->m_len; + m = m->m_next; + } + *moff = off; + return (m); +} + +/* * Drop a record off the front of a sockbuf and move the next record to the * front. */ Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/net/if.c Mon Sep 22 08:27:27 2014 (r271946) @@ -584,6 +584,57 @@ if_attach(struct ifnet *ifp) if_attach_internal(ifp, 0); } +/* + * Compute the least common TSO limit. + */ +void +if_hw_tsomax_common(if_t ifp, struct ifnet_hw_tsomax *pmax) +{ + /* + * 1) If there is no limit currently, take the limit from + * the network adapter. + * + * 2) If the network adapter has a limit below the current + * limit, apply it. + */ + if (pmax->tsomaxbytes == 0 || (ifp->if_hw_tsomax != 0 && + ifp->if_hw_tsomax < pmax->tsomaxbytes)) { + pmax->tsomaxbytes = ifp->if_hw_tsomax; + } + if (pmax->tsomaxsegcount == 0 || (ifp->if_hw_tsomaxsegcount != 0 && + ifp->if_hw_tsomaxsegcount < pmax->tsomaxsegcount)) { + pmax->tsomaxsegcount = ifp->if_hw_tsomaxsegcount; + } + if (pmax->tsomaxsegsize == 0 || (ifp->if_hw_tsomaxsegsize != 0 && + ifp->if_hw_tsomaxsegsize < pmax->tsomaxsegsize)) { + pmax->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; + } +} + +/* + * Update TSO limit of a network adapter. + * + * Returns zero if no change. Else non-zero. + */ +int +if_hw_tsomax_update(if_t ifp, struct ifnet_hw_tsomax *pmax) +{ + int retval = 0; + if (ifp->if_hw_tsomax != pmax->tsomaxbytes) { + ifp->if_hw_tsomax = pmax->tsomaxbytes; + retval++; + } + if (ifp->if_hw_tsomaxsegsize != pmax->tsomaxsegsize) { + ifp->if_hw_tsomaxsegsize = pmax->tsomaxsegsize; + retval++; + } + if (ifp->if_hw_tsomaxsegcount != pmax->tsomaxsegcount) { + ifp->if_hw_tsomaxsegcount = pmax->tsomaxsegcount; + retval++; + } + return (retval); +} + static void if_attach_internal(struct ifnet *ifp, int vmove) { @@ -659,13 +710,36 @@ if_attach_internal(struct ifnet *ifp, in ifp->if_broadcastaddr = NULL; #if defined(INET) || defined(INET6) - /* Initialize to max value. */ - if (ifp->if_hw_tsomax == 0) - ifp->if_hw_tsomax = min(IP_MAXPACKET, 32 * MCLBYTES - + /* Use defaults for TSO, if nothing is set */ + if (ifp->if_hw_tsomax == 0 && + ifp->if_hw_tsomaxsegcount == 0 && + ifp->if_hw_tsomaxsegsize == 0) { + /* + * The TSO defaults needs to be such that an + * NFS mbuf list of 35 mbufs totalling just + * below 64K works and that a chain of mbufs + * can be defragged into at most 32 segments: + */ + ifp->if_hw_tsomax = min(IP_MAXPACKET, (32 * MCLBYTES) - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)); - KASSERT(ifp->if_hw_tsomax <= IP_MAXPACKET && - ifp->if_hw_tsomax >= IP_MAXPACKET / 8, - ("%s: tsomax outside of range", __func__)); + ifp->if_hw_tsomaxsegcount = 35; + ifp->if_hw_tsomaxsegsize = 2048; /* 2K */ + + /* XXX some drivers set IFCAP_TSO after ethernet attach */ + if (ifp->if_capabilities & IFCAP_TSO) { + if_printf(ifp, "Using defaults for TSO: %u/%u/%u\n", + ifp->if_hw_tsomax, + ifp->if_hw_tsomaxsegcount, + ifp->if_hw_tsomaxsegsize); + } + } + /* + * If the "if_hw_tsomax" limit is set, check if it is + * too small: + */ + KASSERT(ifp->if_hw_tsomax == 0 || + ifp->if_hw_tsomax >= (IP_MAXPACKET / 8), + ("%s: if_hw_tsomax is outside of range", __func__)); #endif } #ifdef VIMAGE Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/net/if_lagg.c Mon Sep 22 08:27:27 2014 (r271946) @@ -454,23 +454,18 @@ lagg_capabilities(struct lagg_softc *sc) struct lagg_port *lp; int cap = ~0, ena = ~0; u_long hwa = ~0UL; -#if defined(INET) || defined(INET6) - u_int hw_tsomax = IP_MAXPACKET; /* Initialize to the maximum value. */ -#else - u_int hw_tsomax = ~0; /* if_hw_tsomax is only for INET/INET6, but.. */ -#endif + struct ifnet_hw_tsomax hw_tsomax; LAGG_WLOCK_ASSERT(sc); + memset(&hw_tsomax, 0, sizeof(hw_tsomax)); + /* Get capabilities from the lagg ports */ SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { cap &= lp->lp_ifp->if_capabilities; ena &= lp->lp_ifp->if_capenable; hwa &= lp->lp_ifp->if_hwassist; - /* Set to the minimum value of the lagg ports. */ - if (lp->lp_ifp->if_hw_tsomax < hw_tsomax && - lp->lp_ifp->if_hw_tsomax > 0) - hw_tsomax = lp->lp_ifp->if_hw_tsomax; + if_hw_tsomax_common(lp->lp_ifp, &hw_tsomax); } cap = (cap == ~0 ? 0 : cap); ena = (ena == ~0 ? 0 : ena); @@ -479,11 +474,10 @@ lagg_capabilities(struct lagg_softc *sc) if (sc->sc_ifp->if_capabilities != cap || sc->sc_ifp->if_capenable != ena || sc->sc_ifp->if_hwassist != hwa || - sc->sc_ifp->if_hw_tsomax != hw_tsomax) { + if_hw_tsomax_update(sc->sc_ifp, &hw_tsomax) != 0) { sc->sc_ifp->if_capabilities = cap; sc->sc_ifp->if_capenable = ena; sc->sc_ifp->if_hwassist = hwa; - sc->sc_ifp->if_hw_tsomax = hw_tsomax; getmicrotime(&sc->sc_ifp->if_lastchange); if (sc->sc_ifflags & IFF_DEBUG) Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/net/if_var.h Mon Sep 22 08:27:27 2014 (r271946) @@ -119,6 +119,12 @@ typedef void (*if_qflush_fn_t)(if_t); typedef int (*if_transmit_fn_t)(if_t, struct mbuf *); typedef uint64_t (*if_get_counter_t)(if_t, ift_counter); +struct ifnet_hw_tsomax { + u_int tsomaxbytes; /* TSO total burst length limit in bytes */ + u_int tsomaxsegcount; /* TSO maximum segment count */ + u_int tsomaxsegsize; /* TSO maximum segment size in bytes */ +}; + /* * Structure defining a network interface. * @@ -222,10 +228,11 @@ struct ifnet { if_get_counter_t if_get_counter; /* get counter values */ /* Stuff that's only temporary and doesn't belong here. */ - u_int if_hw_tsomax; /* tso burst length limit, the minimum - * is (IP_MAXPACKET / 8). - * XXXAO: Have to find a better place - * for it eventually. */ + u_int if_hw_tsomax; /* TSO total burst length + * limit in bytes. A value of + * zero means no limit. Have + * to find a better place for + * it eventually. */ /* * Old, racy and expensive statistics, should not be used in * new drivers. @@ -243,6 +250,10 @@ struct ifnet { uint64_t if_oqdrops; /* dropped on output */ uint64_t if_noproto; /* destined for unsupported protocol */ + /* TSO fields for segment limits. If a field is zero below, there is no limit. */ + u_int if_hw_tsomaxsegcount; /* TSO maximum segment count */ + u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */ + /* * Spare fields to be added before branching a stable branch, so * that structure can be enhanced without changing the kernel @@ -596,5 +607,9 @@ struct mbuf* drbr_dequeue_drv(if_t ifp, int drbr_needs_enqueue_drv(if_t ifp, struct buf_ring *br); int drbr_enqueue_drv(if_t ifp, struct buf_ring *br, struct mbuf *m); +/* TSO */ +void if_hw_tsomax_common(if_t ifp, struct ifnet_hw_tsomax *); +int if_hw_tsomax_update(if_t ifp, struct ifnet_hw_tsomax *); + #endif /* _KERNEL */ #endif /* !_NET_IF_VAR_H_ */ Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/net/if_vlan.c Mon Sep 22 08:27:27 2014 (r271946) @@ -1536,6 +1536,7 @@ vlan_capabilities(struct ifvlan *ifv) { struct ifnet *p = PARENT(ifv); struct ifnet *ifp = ifv->ifv_ifp; + struct ifnet_hw_tsomax hw_tsomax; TRUNK_LOCK_ASSERT(TRUNK(ifv)); @@ -1562,8 +1563,9 @@ vlan_capabilities(struct ifvlan *ifv) * propagate the hardware-assisted flag. TSO on VLANs * does not necessarily require hardware VLAN tagging. */ - if (p->if_hw_tsomax > 0) - ifp->if_hw_tsomax = p->if_hw_tsomax; + memset(&hw_tsomax, 0, sizeof(hw_tsomax)); + if_hw_tsomax_common(p, &hw_tsomax); + if_hw_tsomax_update(ifp, &hw_tsomax); if (p->if_capabilities & IFCAP_VLAN_HWTSO) ifp->if_capabilities |= p->if_capabilities & IFCAP_TSO; if (p->if_capenable & IFCAP_VLAN_HWTSO) { Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/netinet/tcp_input.c Mon Sep 22 08:27:27 2014 (r271946) @@ -3591,6 +3591,8 @@ tcp_mss(struct tcpcb *tp, int offer) if (cap.ifcap & CSUM_TSO) { tp->t_flags |= TF_TSO; tp->t_tsomax = cap.tsomax; + tp->t_tsomaxsegcount = cap.tsomaxsegcount; + tp->t_tsomaxsegsize = cap.tsomaxsegsize; } } Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/netinet/tcp_output.c Mon Sep 22 08:27:27 2014 (r271946) @@ -767,28 +767,113 @@ send: flags &= ~TH_FIN; if (tso) { + u_int if_hw_tsomax; + u_int if_hw_tsomaxsegcount; + u_int if_hw_tsomaxsegsize; + struct mbuf *mb; + u_int moff; + int max_len; + + /* extract TSO information */ + if_hw_tsomax = tp->t_tsomax; + if_hw_tsomaxsegcount = tp->t_tsomaxsegcount; + if_hw_tsomaxsegsize = tp->t_tsomaxsegsize; + + /* + * Limit a TSO burst to prevent it from + * overflowing or exceeding the maximum length + * allowed by the network interface: + */ KASSERT(ipoptlen == 0, ("%s: TSO can't do IP options", __func__)); /* - * Limit a burst to t_tsomax minus IP, - * TCP and options length to keep ip->ip_len - * from overflowing or exceeding the maximum - * length allowed by the network interface. + * Check if we should limit by maximum payload + * length: */ - if (len > tp->t_tsomax - hdrlen) { - len = tp->t_tsomax - hdrlen; - sendalot = 1; + if (if_hw_tsomax != 0) { + /* compute maximum TSO length */ + max_len = (if_hw_tsomax - hdrlen); + if (max_len <= 0) { + len = 0; + } else if (len > (u_int)max_len) { + sendalot = 1; + len = (u_int)max_len; + } + } + + /* + * Check if we should limit by maximum segment + * size and count: + */ + if (if_hw_tsomaxsegcount != 0 && if_hw_tsomaxsegsize != 0) { + max_len = 0; + mb = sbsndmbuf(&so->so_snd, off, &moff); + + while (mb != NULL && (u_int)max_len < len) { + u_int cur_length; + u_int cur_frags; + + /* + * Get length of mbuf fragment + * and how many hardware + * frags, rounded up, it would + * use: + */ + cur_length = (mb->m_len - moff); + cur_frags = (cur_length + if_hw_tsomaxsegsize - + 1) / if_hw_tsomaxsegsize; + + /* Handle special case: Zero Length Mbuf */ + if (cur_frags == 0) + cur_frags = 1; + + /* + * Check if the fragment limit + * will be reached or + * exceeded: + */ + if (cur_frags >= if_hw_tsomaxsegcount) { + max_len += min(cur_length, + if_hw_tsomaxsegcount * + if_hw_tsomaxsegsize); + break; + } + max_len += cur_length; + if_hw_tsomaxsegcount -= cur_frags; + moff = 0; + mb = mb->m_next; + } + if (max_len <= 0) { + len = 0; + } else if (len > (u_int)max_len) { + sendalot = 1; + len = (u_int)max_len; + } } /* * Prevent the last segment from being - * fractional unless the send sockbuf can - * be emptied. + * fractional unless the send sockbuf can be + * emptied: + */ + max_len = (tp->t_maxopd - optlen); + if ((off + len) < so->so_snd.sb_cc) { + moff = len % (u_int)max_len; + if (moff != 0) { + len -= moff; + sendalot = 1; + } + } + + /* + * In case there are too many small fragments + * don't use TSO: */ - if (sendalot && off + len < so->so_snd.sb_cc) { - len -= len % (tp->t_maxopd - optlen); + if (len <= (u_int)max_len) { + len = (u_int)max_len; sendalot = 1; + tso = 0; } /* Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/netinet/tcp_subr.c Mon Sep 22 08:27:27 2014 (r271946) @@ -1819,6 +1819,8 @@ tcp_maxmtu(struct in_conninfo *inc, stru ifp->if_hwassist & CSUM_TSO) { cap->ifcap |= CSUM_TSO; cap->tsomax = ifp->if_hw_tsomax; + cap->tsomaxsegcount = ifp->if_hw_tsomaxsegcount; + cap->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; } } RTFREE(sro.ro_rt); @@ -1858,6 +1860,8 @@ tcp_maxmtu6(struct in_conninfo *inc, str ifp->if_hwassist & CSUM_TSO) { cap->ifcap |= CSUM_TSO; cap->tsomax = ifp->if_hw_tsomax; + cap->tsomaxsegcount = ifp->if_hw_tsomaxsegcount; + cap->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; } } RTFREE(sro6.ro_rt); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/netinet/tcp_var.h Mon Sep 22 08:27:27 2014 (r271946) @@ -199,9 +199,12 @@ struct tcpcb { u_int t_keepintvl; /* interval between keepalives */ u_int t_keepcnt; /* number of keepalives before close */ - u_int t_tsomax; /* tso burst length limit */ + u_int t_tsomax; /* TSO total burst length limit in bytes */ + + uint32_t t_ispare[6]; /* 5 UTO, 1 TBD */ + uint32_t t_tsomaxsegcount; /* TSO maximum segment count */ + uint32_t t_tsomaxsegsize; /* TSO maximum segment size in bytes */ - uint32_t t_ispare[8]; /* 5 UTO, 3 TBD */ void *t_pspare2[4]; /* 1 TCP_SIGNATURE, 3 TBD */ uint64_t _pad[6]; /* 6 TBD (1-2 CC/RTT?) */ }; @@ -324,6 +327,8 @@ struct hc_metrics_lite { /* must stay in struct tcp_ifcap { int ifcap; u_int tsomax; + u_int tsomaxsegcount; + u_int tsomaxsegsize; }; #ifndef _NETINET_IN_PCB_H_ Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Sep 22 08:27:27 2014 (r271946) @@ -673,6 +673,11 @@ int mlx4_en_do_start_port(struct net_dev else priv->rx_csum = 0; + /* set TSO limits so that we don't have to drop TX packets */ + dev->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + dev->if_hw_tsomaxsegcount = 16; + dev->if_hw_tsomaxsegsize = 65536; /* XXX can do up to 4GByte */ + err = mlx4_wol_read(priv->mdev->dev, &config, priv->port); if (err) { en_err(priv, "Failed to get WoL info, unable to modify\n"); Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Mon Sep 22 07:59:25 2014 (r271945) +++ head/sys/sys/sockbuf.h Mon Sep 22 08:27:27 2014 (r271946) @@ -158,6 +158,8 @@ int sbreserve_locked(struct sockbuf *sb, struct thread *td); struct mbuf * sbsndptr(struct sockbuf *sb, u_int off, u_int len, u_int *moff); +struct mbuf * + sbsndmbuf(struct sockbuf *sb, u_int off, u_int *moff); void sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb); int sbwait(struct sockbuf *sb); int sblock(struct sockbuf *sb, int flags); From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 08:29:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FB70F1F; Mon, 22 Sep 2014 08:29:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06995FDA; Mon, 22 Sep 2014 08:29:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8M8TpdX032079; Mon, 22 Sep 2014 08:29:51 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8M8Tnc2032058; Mon, 22 Sep 2014 08:29:49 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409220829.s8M8Tnc2032058@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Mon, 22 Sep 2014 08:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271947 - in stable/10: contrib/openpam contrib/openpam/bin contrib/openpam/bin/openpam_dump_policy contrib/openpam/bin/pamtest contrib/openpam/bin/su contrib/openpam/doc contrib/openpa... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 08:29:52 -0000 Author: des Date: Mon Sep 22 08:29:48 2014 New Revision: 271947 URL: http://svnweb.freebsd.org/changeset/base/271947 Log: MFH (r271624): Upgrade to OpenPAM Ourouparia. Approved by: re (gjb) Added: stable/10/contrib/openpam/lib/libpam/openpam_strlset.c - copied unchanged from r271624, head/contrib/openpam/lib/libpam/openpam_strlset.c stable/10/contrib/openpam/lib/libpam/openpam_strlset.h - copied unchanged from r271624, head/contrib/openpam/lib/libpam/openpam_strlset.h Deleted: stable/10/contrib/openpam/m4/ Modified: stable/10/contrib/openpam/CREDITS stable/10/contrib/openpam/HISTORY stable/10/contrib/openpam/INSTALL stable/10/contrib/openpam/LICENSE stable/10/contrib/openpam/Makefile.am stable/10/contrib/openpam/Makefile.in stable/10/contrib/openpam/README stable/10/contrib/openpam/RELNOTES stable/10/contrib/openpam/TODO stable/10/contrib/openpam/aclocal.m4 stable/10/contrib/openpam/autogen.sh stable/10/contrib/openpam/bin/Makefile.in stable/10/contrib/openpam/bin/openpam_dump_policy/Makefile.in stable/10/contrib/openpam/bin/openpam_dump_policy/openpam_dump_policy.c stable/10/contrib/openpam/bin/pamtest/Makefile.in stable/10/contrib/openpam/bin/pamtest/pamtest.1 stable/10/contrib/openpam/bin/su/Makefile.in stable/10/contrib/openpam/bin/su/su.1 stable/10/contrib/openpam/config.h.in stable/10/contrib/openpam/configure stable/10/contrib/openpam/configure.ac stable/10/contrib/openpam/doc/Makefile.in stable/10/contrib/openpam/doc/man/Makefile.in stable/10/contrib/openpam/doc/man/openpam.3 stable/10/contrib/openpam/doc/man/openpam_borrow_cred.3 stable/10/contrib/openpam/doc/man/openpam_free_data.3 stable/10/contrib/openpam/doc/man/openpam_free_envlist.3 stable/10/contrib/openpam/doc/man/openpam_get_feature.3 stable/10/contrib/openpam/doc/man/openpam_get_option.3 stable/10/contrib/openpam/doc/man/openpam_log.3 stable/10/contrib/openpam/doc/man/openpam_nullconv.3 stable/10/contrib/openpam/doc/man/openpam_readline.3 stable/10/contrib/openpam/doc/man/openpam_readlinev.3 stable/10/contrib/openpam/doc/man/openpam_readword.3 stable/10/contrib/openpam/doc/man/openpam_restore_cred.3 stable/10/contrib/openpam/doc/man/openpam_set_feature.3 stable/10/contrib/openpam/doc/man/openpam_set_option.3 stable/10/contrib/openpam/doc/man/openpam_straddch.3 stable/10/contrib/openpam/doc/man/openpam_subst.3 stable/10/contrib/openpam/doc/man/openpam_ttyconv.3 stable/10/contrib/openpam/doc/man/pam.3 stable/10/contrib/openpam/doc/man/pam.conf.5 stable/10/contrib/openpam/doc/man/pam_acct_mgmt.3 stable/10/contrib/openpam/doc/man/pam_authenticate.3 stable/10/contrib/openpam/doc/man/pam_chauthtok.3 stable/10/contrib/openpam/doc/man/pam_close_session.3 stable/10/contrib/openpam/doc/man/pam_conv.3 stable/10/contrib/openpam/doc/man/pam_end.3 stable/10/contrib/openpam/doc/man/pam_error.3 stable/10/contrib/openpam/doc/man/pam_get_authtok.3 stable/10/contrib/openpam/doc/man/pam_get_data.3 stable/10/contrib/openpam/doc/man/pam_get_item.3 stable/10/contrib/openpam/doc/man/pam_get_user.3 stable/10/contrib/openpam/doc/man/pam_getenv.3 stable/10/contrib/openpam/doc/man/pam_getenvlist.3 stable/10/contrib/openpam/doc/man/pam_info.3 stable/10/contrib/openpam/doc/man/pam_open_session.3 stable/10/contrib/openpam/doc/man/pam_prompt.3 stable/10/contrib/openpam/doc/man/pam_putenv.3 stable/10/contrib/openpam/doc/man/pam_set_data.3 stable/10/contrib/openpam/doc/man/pam_set_item.3 stable/10/contrib/openpam/doc/man/pam_setcred.3 stable/10/contrib/openpam/doc/man/pam_setenv.3 stable/10/contrib/openpam/doc/man/pam_sm_acct_mgmt.3 stable/10/contrib/openpam/doc/man/pam_sm_authenticate.3 stable/10/contrib/openpam/doc/man/pam_sm_chauthtok.3 stable/10/contrib/openpam/doc/man/pam_sm_close_session.3 stable/10/contrib/openpam/doc/man/pam_sm_open_session.3 stable/10/contrib/openpam/doc/man/pam_sm_setcred.3 stable/10/contrib/openpam/doc/man/pam_start.3 stable/10/contrib/openpam/doc/man/pam_strerror.3 stable/10/contrib/openpam/doc/man/pam_verror.3 stable/10/contrib/openpam/doc/man/pam_vinfo.3 stable/10/contrib/openpam/doc/man/pam_vprompt.3 stable/10/contrib/openpam/include/Makefile.in stable/10/contrib/openpam/include/security/Makefile.in stable/10/contrib/openpam/include/security/openpam_version.h stable/10/contrib/openpam/lib/Makefile.am stable/10/contrib/openpam/lib/Makefile.in stable/10/contrib/openpam/lib/libpam/Makefile.am stable/10/contrib/openpam/lib/libpam/Makefile.in stable/10/contrib/openpam/lib/libpam/openpam_configure.c stable/10/contrib/openpam/lib/libpam/openpam_ctype.h stable/10/contrib/openpam/lib/libpam/openpam_dispatch.c stable/10/contrib/openpam/lib/libpam/openpam_ttyconv.c stable/10/contrib/openpam/lib/libpam/pam_get_authtok.c stable/10/contrib/openpam/ltmain.sh stable/10/contrib/openpam/mkpkgng.in stable/10/contrib/openpam/modules/Makefile.in stable/10/contrib/openpam/modules/pam_deny/Makefile.in stable/10/contrib/openpam/modules/pam_permit/Makefile.in stable/10/contrib/openpam/modules/pam_unix/Makefile.in stable/10/contrib/openpam/pamgdb.in stable/10/contrib/openpam/t/Makefile.am stable/10/contrib/openpam/t/Makefile.in stable/10/lib/libpam/libpam/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/openpam/CREDITS ============================================================================== --- stable/10/contrib/openpam/CREDITS Mon Sep 22 08:27:27 2014 (r271946) +++ stable/10/contrib/openpam/CREDITS Mon Sep 22 08:29:48 2014 (r271947) @@ -15,6 +15,8 @@ directly or indirectly, with patches, cr ideas: Andrew Morgan + Ankita Pal + Baptiste Daroussin Brian Fundakowski Feldman Christos Zoulas Daniel Richard G. @@ -25,6 +27,7 @@ ideas: Eric Melville Espen Grøndahl Gary Winiger + Gavin Atkinson Gleb Smirnoff Hubert Feyrer Jason Evans @@ -46,5 +49,3 @@ ideas: Takanori Saneto Wojciech A. Koszek Yar Tikhiy - -$Id: CREDITS 648 2013-03-05 17:54:27Z des $ Modified: stable/10/contrib/openpam/HISTORY ============================================================================== --- stable/10/contrib/openpam/HISTORY Mon Sep 22 08:27:27 2014 (r271946) +++ stable/10/contrib/openpam/HISTORY Mon Sep 22 08:29:48 2014 (r271947) @@ -1,3 +1,24 @@ +OpenPAM Ourouparia 2014-09-12 + + - ENHANCE: When executing a chain, require at least one service + function to succeed. This mitigates fail-open scenarios caused by + misconfigurations or missing modules. + + - ENHANCE: Make sure to overwrite buffers which may have contained an + authentication token when they're no longer needed. + + - BUGFIX: Under certain circumstances, specifying a non-existent + module (or misspelling the name of a module) in a policy could + result in a fail-open scenario. (CVE-2014-3879) + + - FEATURE: Add a search path for modules. This was implemented in + Nummularia but inadvertently left out of the release notes. + + - BUGFIX: The is_upper() predicate only accepted the letter A as an + upper-case character instead of the entire A-Z range. As a result, + service and module names containing upper-case letters other than A + would be rejected. +============================================================================ OpenPAM Nummularia 2013-09-07 - ENHANCE: Rewrite the dynamic loader to improve readability and @@ -97,7 +118,7 @@ OpenPAM Lycopsida 2011-12-18 module before loading it. - ENHANCE: added / improved input validation in many cases, including - the policy file and some function arguments. + the policy file and some function arguments. (CVE-2011-4122) ============================================================================ OpenPAM Hydrangea 2007-12-21 @@ -427,5 +448,3 @@ Fixed a number of bugs in the previous r OpenPAM Calamite 2002-02-09 First (beta) release. -============================================================================ -$Id: HISTORY 737 2013-09-07 12:53:55Z des $ Modified: stable/10/contrib/openpam/INSTALL ============================================================================== --- stable/10/contrib/openpam/INSTALL Mon Sep 22 08:27:27 2014 (r271946) +++ stable/10/contrib/openpam/INSTALL Mon Sep 22 08:29:48 2014 (r271947) @@ -54,5 +54,3 @@ directory: # make install - -$Id: INSTALL 648 2013-03-05 17:54:27Z des $ Modified: stable/10/contrib/openpam/LICENSE ============================================================================== --- stable/10/contrib/openpam/LICENSE Mon Sep 22 08:27:27 2014 (r271946) +++ stable/10/contrib/openpam/LICENSE Mon Sep 22 08:29:48 2014 (r271947) @@ -31,5 +31,3 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIAB 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. - -$Id: LICENSE 648 2013-03-05 17:54:27Z des $ Modified: stable/10/contrib/openpam/Makefile.am ============================================================================== --- stable/10/contrib/openpam/Makefile.am Mon Sep 22 08:27:27 2014 (r271946) +++ stable/10/contrib/openpam/Makefile.am Mon Sep 22 08:29:48 2014 (r271947) @@ -1,4 +1,4 @@ -# $Id: Makefile.am 623 2013-02-25 07:24:51Z des $ +# $Id: Makefile.am 816 2014-09-12 07:50:22Z des $ ACLOCAL_AMFLAGS = -I m4 Modified: stable/10/contrib/openpam/Makefile.in ============================================================================== --- stable/10/contrib/openpam/Makefile.in Mon Sep 22 08:27:27 2014 (r271946) +++ stable/10/contrib/openpam/Makefile.in Mon Sep 22 08:29:48 2014 (r271947) @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.am 623 2013-02-25 07:24:51Z des $ +# $Id: Makefile.am 816 2014-09-12 07:50:22Z des $ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ @@ -84,13 +84,10 @@ subdir = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config.h.in $(srcdir)/pamgdb.in $(srcdir)/mkpkgng.in \ - INSTALL README TODO compile config.guess config.sub depcomp \ - install-sh missing ltmain.sh + INSTALL README TODO compile config.guess config.sub install-sh \ + missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ Modified: stable/10/contrib/openpam/README ============================================================================== --- stable/10/contrib/openpam/README Mon Sep 22 08:27:27 2014 (r271946) +++ stable/10/contrib/openpam/README Mon Sep 22 08:29:48 2014 (r271947) @@ -23,5 +23,3 @@ These are some of OpenPAM's features: this will be made configurable in a future release. Please direct bug reports and inquiries to . - -$Id: README 648 2013-03-05 17:54:27Z des $ Modified: stable/10/contrib/openpam/RELNOTES ============================================================================== --- stable/10/contrib/openpam/RELNOTES Mon Sep 22 08:27:27 2014 (r271946) +++ stable/10/contrib/openpam/RELNOTES Mon Sep 22 08:29:48 2014 (r271947) @@ -1,6 +1,6 @@ - Release notes for OpenPAM Nummularia - ==================================== + Release notes for OpenPAM Ourouparia + ==================================== This release corresponds to the code used in FreeBSD HEAD as of the release date, and is also expected to work on almost any POSIX-like @@ -20,5 +20,3 @@ The distribution consists of the followi - Unit tests for limited portions of the libraries. Please direct bug reports and inquiries to . - -$Id: RELNOTES 741 2013-09-07 13:34:02Z des $ Modified: stable/10/contrib/openpam/TODO ============================================================================== --- stable/10/contrib/openpam/TODO Mon Sep 22 08:27:27 2014 (r271946) +++ stable/10/contrib/openpam/TODO Mon Sep 22 08:29:48 2014 (r271947) @@ -13,5 +13,3 @@ Before the next release: wrapper for) openpam_log() which respects the PAM_SILENT flag and the no_warn module option. This would eliminate the need for FreeBSD's _pam_verbose_error(). - -$Id: TODO 736 2013-09-07 12:52:42Z des $ Modified: stable/10/contrib/openpam/aclocal.m4 ============================================================================== --- stable/10/contrib/openpam/aclocal.m4 Mon Sep 22 08:27:27 2014 (r271946) +++ stable/10/contrib/openpam/aclocal.m4 Mon Sep 22 08:29:48 2014 (r271947) @@ -20,6 +20,8593 @@ You have another version of autoconf. I If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_REPLACE_SHELLFNS + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 09:22:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10755DE9; Mon, 22 Sep 2014 09:22:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFED2892; Mon, 22 Sep 2014 09:22:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8M9MwTp061427; Mon, 22 Sep 2014 09:22:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8M9MwkS061425; Mon, 22 Sep 2014 09:22:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409220922.s8M9MwkS061425@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 22 Sep 2014 09:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271949 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 09:22:59 -0000 Author: mav Date: Mon Sep 22 09:22:58 2014 New Revision: 271949 URL: http://svnweb.freebsd.org/changeset/base/271949 Log: Fix UNMAP stuck if the last block descriptor in the list is empty. MFC after: 3 days Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Sep 22 08:41:50 2014 (r271948) +++ head/sys/cam/ctl/ctl.c Mon Sep 22 09:22:58 2014 (r271949) @@ -6059,7 +6059,7 @@ ctl_unmap(struct ctl_scsiio *ctsio) struct scsi_unmap *cdb; struct ctl_ptr_len_flags *ptrlen; struct scsi_unmap_header *hdr; - struct scsi_unmap_desc *buf, *end, *range; + struct scsi_unmap_desc *buf, *end, *endnz, *range; uint64_t lba; uint32_t num_blocks; int len, retval; @@ -6112,6 +6112,7 @@ ctl_unmap(struct ctl_scsiio *ctsio) buf = (struct scsi_unmap_desc *)(hdr + 1); end = buf + len / sizeof(*buf); + endnz = buf; for (range = buf; range < end; range++) { lba = scsi_8btou64(range->lba); num_blocks = scsi_4btoul(range->length); @@ -6121,6 +6122,19 @@ ctl_unmap(struct ctl_scsiio *ctsio) ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } + if (num_blocks != 0) + endnz = range + 1; + } + + /* + * Block backend can not handle zero last range. + * Filter it out and return if there is nothing left. + */ + len = (uint8_t *)endnz - (uint8_t *)buf; + if (len == 0) { + ctl_set_success(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); } mtx_lock(&lun->lun_lock); From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 09:54:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BCCA997; Mon, 22 Sep 2014 09:54:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 473C8BA0; Mon, 22 Sep 2014 09:54:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8M9snos076197; Mon, 22 Sep 2014 09:54:49 GMT (envelope-from jmmv@FreeBSD.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8M9sngA076196; Mon, 22 Sep 2014 09:54:49 GMT (envelope-from jmmv@FreeBSD.org) Message-Id: <201409220954.s8M9sngA076196@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmmv set sender to jmmv@FreeBSD.org using -f From: Julio Merino Date: Mon, 22 Sep 2014 09:54:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271950 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 09:54:49 -0000 Author: jmmv Date: Mon Sep 22 09:54:48 2014 New Revision: 271950 URL: http://svnweb.freebsd.org/changeset/base/271950 Log: Register /usr/tests/lib/libproc to fix build. Missed in r271937, reviewed in D710. Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Sep 22 09:22:58 2014 (r271949) +++ head/etc/mtree/BSD.tests.dist Mon Sep 22 09:54:48 2014 (r271950) @@ -89,6 +89,8 @@ .. libnv .. + libproc + .. libutil .. .. From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 10:05:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5F04D6; Mon, 22 Sep 2014 10:05:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9181ACB5; Mon, 22 Sep 2014 10:05:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MA5bA2081467; Mon, 22 Sep 2014 10:05:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MA5baB081466; Mon, 22 Sep 2014 10:05:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409221005.s8MA5baB081466@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 22 Sep 2014 10:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271951 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 10:05:37 -0000 Author: mav Date: Mon Sep 22 10:05:36 2014 New Revision: 271951 URL: http://svnweb.freebsd.org/changeset/base/271951 Log: Don't try to continue aborted commands if status was not set. Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Sep 22 09:54:48 2014 (r271950) +++ head/sys/cam/ctl/ctl.c Mon Sep 22 10:05:36 2014 (r271951) @@ -5279,9 +5279,10 @@ ctl_config_write_done(union ctl_io *io) * If there is an error, though, we don't want to keep processing. * Instead, just send status back to the initiator. */ - if ((io->io_hdr.flags & CTL_FLAG_IO_CONT) - && (((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE) - || ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS))) { + if ((io->io_hdr.flags & CTL_FLAG_IO_CONT) && + (io->io_hdr.flags & CTL_FLAG_ABORT) == 0 && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || + (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { io->scsiio.io_cont(io); return; } From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 10:21:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6416874E; Mon, 22 Sep 2014 10:21:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43F02DDD; Mon, 22 Sep 2014 10:21:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MALA1I090021; Mon, 22 Sep 2014 10:21:10 GMT (envelope-from ray@FreeBSD.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MAL8bS089623; Mon, 22 Sep 2014 10:21:08 GMT (envelope-from ray@FreeBSD.org) Message-Id: <201409221021.s8MAL8bS089623@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ray set sender to ray@FreeBSD.org using -f From: Aleksandr Rybalko Date: Mon, 22 Sep 2014 10:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271952 - in stable/10/sys/dev/vt: . hw/ofwfb logo X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 10:21:10 -0000 Author: ray Date: Mon Sep 22 10:21:08 2014 New Revision: 271952 URL: http://svnweb.freebsd.org/changeset/base/271952 Log: MFC 271381-271382,271385,271463-271466,271485,271506 o Add sysctls to enable/disable potentially dengerous key combinations, like reboot/halt/debug. o Add support for most key combinations supported by syscons(4). o Some spelling fixes o Remove stray whitespaces. o Switch vt(4) to traditional behaviour with copy-paste same as syscons(4) do. o Fix stray char on paste. o Fix 'function declaration isn't a prototype' warning. o vt(4): Enclose vt_mouse_paste() prototype inside #ifndef SC_NO_CUTPASTE/#endif Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/vt/hw/ofwfb/ofwfb.c stable/10/sys/dev/vt/logo/logo_freebsd.c stable/10/sys/dev/vt/vt.h stable/10/sys/dev/vt/vt_buf.c stable/10/sys/dev/vt/vt_consolectl.c stable/10/sys/dev/vt/vt_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- stable/10/sys/dev/vt/hw/ofwfb/ofwfb.c Mon Sep 22 10:05:36 2014 (r271951) +++ stable/10/sys/dev/vt/hw/ofwfb/ofwfb.c Mon Sep 22 10:21:08 2014 (r271952) @@ -53,7 +53,7 @@ struct ofwfb_softc { phandle_t sc_node; ihandle_t sc_handle; - bus_space_tag_t sc_memt; + bus_space_tag_t sc_memt; }; static vd_probe_t ofwfb_probe; Modified: stable/10/sys/dev/vt/logo/logo_freebsd.c ============================================================================== --- stable/10/sys/dev/vt/logo/logo_freebsd.c Mon Sep 22 10:05:36 2014 (r271951) +++ stable/10/sys/dev/vt/logo/logo_freebsd.c Mon Sep 22 10:21:08 2014 (r271952) @@ -637,5 +637,5 @@ unsigned char vt_logo_image[] = { 0x1f, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x3f, 0xe0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, }; Modified: stable/10/sys/dev/vt/vt.h ============================================================================== --- stable/10/sys/dev/vt/vt.h Mon Sep 22 10:05:36 2014 (r271951) +++ stable/10/sys/dev/vt/vt.h Mon Sep 22 10:21:08 2014 (r271952) @@ -114,11 +114,17 @@ typedef unsigned int vt_axis_t; struct vt_mouse_cursor; #endif +struct vt_pastebuf { + term_char_t *vpb_buf; /* Copy-paste buffer. */ + unsigned int vpb_bufsz; /* Buffer size. */ + unsigned int vpb_len; /* Length of a last selection. */ +}; + struct vt_device { struct vt_window *vd_windows[VT_MAXWINDOWS]; /* (c) Windows. */ struct vt_window *vd_curwindow; /* (d) Current window. */ struct vt_window *vd_savedwindow;/* (?) Saved for suspend. */ - struct vt_window *vd_markedwin; /* (?) Copy/paste buf owner. */ + struct vt_pastebuf vd_pastebuf; /* (?) Copy/paste buf. */ const struct vt_driver *vd_driver; /* (c) Graphics driver. */ void *vd_softc; /* (u) Driver data. */ #ifndef SC_NO_CUTPASTE @@ -152,6 +158,10 @@ struct vt_device { unsigned int vd_unit; /* (c) Device unit. */ }; +#define VD_PASTEBUF(vd) ((vd)->vd_pastebuf.vpb_buf) +#define VD_PASTEBUFSZ(vd) ((vd)->vd_pastebuf.vpb_bufsz) +#define VD_PASTEBUFLEN(vd) ((vd)->vd_pastebuf.vpb_len) + /* * Per-window terminal screen buffer. * Modified: stable/10/sys/dev/vt/vt_buf.c ============================================================================== --- stable/10/sys/dev/vt/vt_buf.c Mon Sep 22 10:05:36 2014 (r271951) +++ stable/10/sys/dev/vt/vt_buf.c Mon Sep 22 10:21:08 2014 (r271952) @@ -321,7 +321,7 @@ vtbuf_copy(struct vt_buf *vb, const term if (r->tr_begin.tp_row > p2->tp_row && r->tr_begin.tp_col == 0 && r->tr_end.tp_col == vb->vb_scr_size.tp_col && /* Full row. */ (rows + rdiff) == vb->vb_scr_size.tp_row && /* Whole screen. */ - rdiff > 0) { /* Only forward dirrection. Do not eat history. */ + rdiff > 0) { /* Only forward direction. Do not eat history. */ vthistory_addlines(vb, rdiff); } else if (p2->tp_row < p1->tp_row) { /* Handle overlapping copies of line segments. */ @@ -603,7 +603,7 @@ vtbuf_get_marked_len(struct vt_buf *vb) ei = e.tp_row * vb->vb_scr_size.tp_col + e.tp_col; /* Number symbols and number of rows to inject \n */ - sz = ei - si + ((e.tp_row - s.tp_row) * 2) + 1; + sz = ei - si + ((e.tp_row - s.tp_row) * 2); return (sz * sizeof(term_char_t)); } Modified: stable/10/sys/dev/vt/vt_consolectl.c ============================================================================== --- stable/10/sys/dev/vt/vt_consolectl.c Mon Sep 22 10:05:36 2014 (r271951) +++ stable/10/sys/dev/vt/vt_consolectl.c Mon Sep 22 10:21:08 2014 (r271952) @@ -51,7 +51,7 @@ consolectl_ioctl(struct cdev *dev, u_lon { switch (cmd) { - case CONS_GETVERS: + case CONS_GETVERS: *(int*)data = 0x200; return 0; case CONS_MOUSECTL: { Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Mon Sep 22 10:05:36 2014 (r271951) +++ stable/10/sys/dev/vt/vt_core.c Mon Sep 22 10:21:08 2014 (r271952) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -123,6 +124,18 @@ VT_SYSCTL_INT(debug, 0, "vt(9) debug lev VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); +/* Allow to disable some keyboard combinations. */ +VT_SYSCTL_INT(kbd_halt, 1, "Enable halt keyboard combination. " + "See kbdmap(5) to configure."); +VT_SYSCTL_INT(kbd_poweroff, 1, "Enable Power Off keyboard combination. " + "See kbdmap(5) to configure."); +VT_SYSCTL_INT(kbd_reboot, 1, "Enable reboot keyboard combination. " + "See kbdmap(5) to configure (typically Ctrl-Alt-Delete)."); +VT_SYSCTL_INT(kbd_debug, 1, "Enable key combination to enter debugger. " + "See kbdmap(5) to configure (typically Ctrl-Alt-Esc)."); +VT_SYSCTL_INT(kbd_panic, 0, "Enable request to panic. " + "See kbdmap(5) to configure."); + static struct vt_device vt_consdev; static unsigned int vt_unit = 0; static MALLOC_DEFINE(M_VT, "vt", "vt device"); @@ -149,6 +162,9 @@ static int vt_late_window_switch(struct static int vt_proc_alive(struct vt_window *); static void vt_resize(struct vt_device *); static void vt_update_static(void *); +#ifndef SC_NO_CUTPASTE +static void vt_mouse_paste(void); +#endif SET_DECLARE(vt_drv_set, struct vt_driver); @@ -163,10 +179,14 @@ static struct vt_device vt_consdev = { .vd_flags = VDF_INVALID, .vd_windows = { [VT_CONSWINDOW] = &vt_conswindow, }, .vd_curwindow = &vt_conswindow, - .vd_markedwin = NULL, .vd_kbstate = 0, #ifndef SC_NO_CUTPASTE + .vd_pastebuf = { + .vpb_buf = NULL, + .vpb_bufsz = 0, + .vpb_len = 0 + }, .vd_mcursor = &vt_default_mouse_pointer, .vd_mcursor_fg = TC_WHITE, .vd_mcursor_bg = TC_BLACK, @@ -334,7 +354,7 @@ vt_proc_window_switch(struct vt_window * if (curvw->vw_flags & VWF_VTYLOCK) return (EBUSY); - /* Ask current process permitions to switch away. */ + /* Ask current process permission to switch away. */ if (curvw->vw_smode.mode == VT_PROCESS) { DPRINTF(30, "%s: VT_PROCESS ", __func__); if (vt_proc_alive(curvw) == FALSE) { @@ -484,18 +504,47 @@ vt_machine_kbdevent(int c) { switch (c) { - case SPCLKEY | DBG: - kdb_enter(KDB_WHY_BREAK, "manual escape to debugger"); + case SPCLKEY | DBG: /* kbdmap(5) keyword `debug`. */ + if (vt_kbd_debug) + kdb_enter(KDB_WHY_BREAK, "manual escape to debugger"); return (1); - case SPCLKEY | RBT: - /* XXX: Make this configurable! */ - shutdown_nice(0); + case SPCLKEY | HALT: /* kbdmap(5) keyword `halt`. */ + if (vt_kbd_halt) + shutdown_nice(RB_HALT); return (1); - case SPCLKEY | HALT: - shutdown_nice(RB_HALT); + case SPCLKEY | PASTE: /* kbdmap(5) keyword `paste`. */ +#ifndef SC_NO_CUTPASTE + /* Insert text from cut-paste buffer. */ + vt_mouse_paste(); +#endif + break; + case SPCLKEY | PDWN: /* kbdmap(5) keyword `pdwn`. */ + if (vt_kbd_poweroff) + shutdown_nice(RB_HALT|RB_POWEROFF); return (1); - case SPCLKEY | PDWN: - shutdown_nice(RB_HALT|RB_POWEROFF); + case SPCLKEY | PNC: /* kbdmap(5) keyword `panic`. */ + /* + * Request to immediate panic if sysctl + * kern.vt.enable_panic_key allow it. + */ + if (vt_kbd_panic) + panic("Forced by the panic key"); + return (1); + case SPCLKEY | RBT: /* kbdmap(5) keyword `boot`. */ + if (vt_kbd_reboot) + shutdown_nice(RB_AUTOBOOT); + return (1); + case SPCLKEY | SPSC: /* kbdmap(5) keyword `spsc`. */ + /* Force activatation/deactivation of the screen saver. */ + /* TODO */ + return (1); + case SPCLKEY | STBY: /* XXX Not present in kbdcontrol parser. */ + /* Put machine into Stand-By mode. */ + power_pm_suspend(POWER_SLEEP_STATE_STANDBY); + return (1); + case SPCLKEY | SUSP: /* kbdmap(5) keyword `susp`. */ + /* Suspend machine. */ + power_pm_suspend(POWER_SLEEP_STATE_SUSPEND); return (1); }; @@ -611,6 +660,20 @@ vt_processkey(keyboard_t *kbd, struct vt } switch (c) { + case NEXT: + /* Switch to next VT. */ + c = (vw->vw_number + 1) % VT_MAXWINDOWS; + vw = vd->vd_windows[c]; + if (vw != NULL) + vt_proc_window_switch(vw); + return (0); + case PREV: + /* Switch to previous VT. */ + c = (vw->vw_number - 1) % VT_MAXWINDOWS; + vw = vd->vd_windows[c]; + if (vw != NULL) + vt_proc_window_switch(vw); + return (0); case SLK: { kbdd_ioctl(kbd, KDGKBSTATE, (caddr_t)&state); @@ -1520,7 +1583,7 @@ vt_mouse_terminput_button(struct vt_devi mouseb[4] = '!' + x; mouseb[5] = '!' + y; - for (i = 0; i < sizeof(mouseb); i++ ) + for (i = 0; i < sizeof(mouseb); i++) terminal_input_char(vw->vw_terminal, mouseb[i]); } @@ -1558,6 +1621,23 @@ vt_mouse_terminput(struct vt_device *vd, } } +static void +vt_mouse_paste() +{ + term_char_t *buf; + int i, len; + + len = VD_PASTEBUFLEN(main_vd); + buf = VD_PASTEBUF(main_vd); + len /= sizeof(term_char_t); + for (i = 0; i < len; i++) { + if (buf[i] == '\0') + continue; + terminal_input_char(main_vd->vd_curwindow->vw_terminal, + buf[i]); + } +} + void vt_mouse_event(int type, int x, int y, int event, int cnt, int mlevel) { @@ -1565,8 +1645,7 @@ vt_mouse_event(int type, int x, int y, i struct vt_window *vw; struct vt_font *vf; term_pos_t size; - term_char_t *buf; - int i, len, mark; + int len, mark; vd = main_vd; vw = vd->vd_curwindow; @@ -1609,17 +1688,10 @@ vt_mouse_event(int type, int x, int y, i vd->vd_mx = x; vd->vd_my = y; - if ((vd->vd_mstate & MOUSE_BUTTON1DOWN) && - (vtbuf_set_mark(&vw->vw_buf, VTB_MARK_MOVE, - vd->vd_mx / vf->vf_width, - vd->vd_my / vf->vf_height) == 1)) { - - /* - * We have something marked to copy, so update pointer - * to window with selection. - */ - vd->vd_markedwin = vw; - } + if (vd->vd_mstate & MOUSE_BUTTON1DOWN) + vtbuf_set_mark(&vw->vw_buf, VTB_MARK_MOVE, + vd->vd_mx / vf->vf_width, + vd->vd_my / vf->vf_height); vt_resume_flush_timer(vw->vw_device, 0); return; /* Done */ @@ -1652,27 +1724,7 @@ vt_mouse_event(int type, int x, int y, i case 0: /* up */ break; default: - if (vd->vd_markedwin == NULL) - return; - /* Get current selecton size in bytes. */ - len = vtbuf_get_marked_len(&vd->vd_markedwin->vw_buf); - if (len <= 0) - return; - - buf = malloc(len, M_VT, M_WAITOK | M_ZERO); - /* Request cupy/paste buffer data, no more than `len' */ - vtbuf_extract_marked(&vd->vd_markedwin->vw_buf, buf, - len); - - len /= sizeof(term_char_t); - for (i = 0; i < len; i++ ) { - if (buf[i] == '\0') - continue; - terminal_input_char(vw->vw_terminal, buf[i]); - } - - /* Done, so cleanup. */ - free(buf, M_VT); + vt_mouse_paste(); break; } return; /* Done */ @@ -1705,8 +1757,38 @@ vt_mouse_event(int type, int x, int y, i * We have something marked to copy, so update pointer to * window with selection. */ - vd->vd_markedwin = vw; vt_resume_flush_timer(vw->vw_device, 0); + + switch (mark) { + case VTB_MARK_END: + case VTB_MARK_WORD: + case VTB_MARK_ROW: + case VTB_MARK_EXTEND: + break; + default: + /* Other types of mark do not require to copy data. */ + return; + } + + /* Get current selection size in bytes. */ + len = vtbuf_get_marked_len(&vw->vw_buf); + if (len <= 0) + return; + + /* Reallocate buffer only if old one is too small. */ + if (len > VD_PASTEBUFSZ(vd)) { + VD_PASTEBUF(vd) = realloc(VD_PASTEBUF(vd), len, M_VT, + M_WAITOK | M_ZERO); + /* Update buffer size. */ + VD_PASTEBUFSZ(vd) = len; + } + /* Request copy/paste buffer data, no more than `len' */ + vtbuf_extract_marked(&vw->vw_buf, VD_PASTEBUF(vd), + VD_PASTEBUFSZ(vd)); + + VD_PASTEBUFLEN(vd) = len; + + /* XXX VD_PASTEBUF(vd) have to be freed on shutdown/unload. */ } } From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 10:21:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51334885; Mon, 22 Sep 2014 10:21:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C44EE6B; Mon, 22 Sep 2014 10:21:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MALhqo091040; Mon, 22 Sep 2014 10:21:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MALhRC091039; Mon, 22 Sep 2014 10:21:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409221021.s8MALhRC091039@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 22 Sep 2014 10:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271953 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 10:21:43 -0000 Author: hselasky Date: Mon Sep 22 10:21:42 2014 New Revision: 271953 URL: http://svnweb.freebsd.org/changeset/base/271953 Log: Some XHCI hardware requires dropping the endpoint context before adding it again. MFC after: 3 days Submitted by: Kohji Okuno Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Mon Sep 22 10:21:08 2014 (r271952) +++ head/sys/dev/usb/controller/xhci.c Mon Sep 22 10:21:42 2014 (r271953) @@ -2248,7 +2248,14 @@ xhci_configure_mask(struct usb_device *u xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, mask); xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, 0); } else { - xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, 0); + /* + * Some hardware requires that we drop the endpoint + * context before adding it again: + */ + xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, + mask & XHCI_INCTX_NON_CTRL_MASK); + + /* Add new endpoint context */ xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, mask); /* find most significant set bit */ From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 10:46:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 589DD18A; Mon, 22 Sep 2014 10:46:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44665109; Mon, 22 Sep 2014 10:46:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MAk7JM006268; Mon, 22 Sep 2014 10:46:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MAk7qQ006267; Mon, 22 Sep 2014 10:46:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409221046.s8MAk7qQ006267@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 22 Sep 2014 10:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271954 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 10:46:07 -0000 Author: mav Date: Mon Sep 22 10:46:06 2014 New Revision: 271954 URL: http://svnweb.freebsd.org/changeset/base/271954 Log: Deny ANCHOR flag set without UNMAP flag set in WRITE SAME commands. Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Sep 22 10:21:42 2014 (r271953) +++ head/sys/cam/ctl/ctl.c Mon Sep 22 10:46:06 2014 (r271954) @@ -5987,8 +5987,9 @@ ctl_write_same(struct ctl_scsiio *ctsio) break; /* NOTREACHED */ } - /* NDOB flag can be used only together with UNMAP */ - if ((byte2 & (SWS_NDOB | SWS_UNMAP)) == SWS_NDOB) { + /* NDOB and ANCHOR flags can be used only together with UNMAP */ + if ((byte2 & SWS_UNMAP) == 0 && + (byte2 & (SWS_NDOB | SWS_ANCHOR)) != 0) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, /*field*/ 1, /*bit_valid*/ 1, /*bit*/ 0); ctl_done((union ctl_io *)ctsio); From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 11:35:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F5D6BD1; Mon, 22 Sep 2014 11:35:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B2EB827; Mon, 22 Sep 2014 11:35:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MBZ7TY029559; Mon, 22 Sep 2014 11:35:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MBZ7CH029558; Mon, 22 Sep 2014 11:35:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409221135.s8MBZ7CH029558@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 22 Sep 2014 11:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271957 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 11:35:07 -0000 Author: mav Date: Mon Sep 22 11:35:06 2014 New Revision: 271957 URL: http://svnweb.freebsd.org/changeset/base/271957 Log: Fix read overrun handling, broken by using wrong variable. MFC after: 3 days Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Mon Sep 22 11:08:22 2014 (r271956) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Mon Sep 22 11:35:06 2014 (r271957) @@ -2505,10 +2505,10 @@ cfiscsi_datamove_in(union ctl_io *io) sg_addr += len; sg_len -= len; - KASSERT(buffer_offset + request->ip_data_len <= expected_len, + KASSERT(buffer_offset + response->ip_data_len <= expected_len, ("buffer_offset %zd + ip_data_len %zd > expected_len %zd", - buffer_offset, request->ip_data_len, expected_len)); - if (buffer_offset + request->ip_data_len == expected_len) { + buffer_offset, response->ip_data_len, expected_len)); + if (buffer_offset + response->ip_data_len == expected_len) { /* * Already have the amount of data the initiator wanted. */ From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 11:54:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 407934FD; Mon, 22 Sep 2014 11:54:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BF37A3E; Mon, 22 Sep 2014 11:54:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MBsEw9039173; Mon, 22 Sep 2014 11:54:14 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MBsEhO039172; Mon, 22 Sep 2014 11:54:14 GMT (envelope-from se@FreeBSD.org) Message-Id: <201409221154.s8MBsEhO039172@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Mon, 22 Sep 2014 11:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271958 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 11:54:14 -0000 Author: se Date: Mon Sep 22 11:54:13 2014 New Revision: 271958 URL: http://svnweb.freebsd.org/changeset/base/271958 Log: The new naming scheme for keymap files for use with vt(4) introduced a collision for "no" as a country code with "NO" meaning "do not load any keymap" (which also has been the default value in etc/defaults/rc.conf for a long time). The result of this collision is, that "kbdcontrol -l no" will load the Norwegian keymap, while "keymap=no" in rc.conf was interpreted as the lower case spelling of "NO" meaning "no keyboard" (and "no.kbd" was not loaded). Fix this by matching only the upper-case spelling "NO" in rc.d/syscons when deciding whether to load a keymap file. This will lead to "no.kbd" being loaded, if the until now valid (but non-default) spelling "no" was used in an individual rc.conf file to mean "no keyboard". But all alternatives I could think of introduce a larger violation of POLA ... Reported by: Gyrd Thane Lange (gyrd-se at thanelange.no) MFC after: 3 days Modified: head/etc/rc.d/syscons Modified: head/etc/rc.d/syscons ============================================================================== --- head/etc/rc.d/syscons Mon Sep 22 11:35:06 2014 (r271957) +++ head/etc/rc.d/syscons Mon Sep 22 11:54:13 2014 (r271958) @@ -167,7 +167,7 @@ syscons_configure_keyboard() # keymap # case ${keymap} in - [Nn][Oo] | '') + NO | '') ;; *) sc_init From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 12:40:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C6CEB76; Mon, 22 Sep 2014 12:40:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57B9510C; Mon, 22 Sep 2014 12:40:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MCeiJg067045; Mon, 22 Sep 2014 12:40:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MCei3m067044; Mon, 22 Sep 2014 12:40:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409221240.s8MCei3m067044@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 22 Sep 2014 12:40:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271959 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 12:40:44 -0000 Author: mav Date: Mon Sep 22 12:40:43 2014 New Revision: 271959 URL: http://svnweb.freebsd.org/changeset/base/271959 Log: Pretend that we support BYTCHK=1 in WRITE AND VERIFY command. Technically that is not true, but since we don't implement VERIFY there at all, doing only WRITE part, this is a minor sin. Modified: head/sys/cam/ctl/ctl_cmd_table.c Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Mon Sep 22 11:54:13 2014 (r271958) +++ head/sys/cam/ctl/ctl_cmd_table.c Mon Sep 22 12:40:43 2014 (r271959) @@ -716,7 +716,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 2E WRITE AND VERIFY(10) */ {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT, CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE, - 10, {0x10, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, + 10, {0x12, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, /* 2F VERIFY(10) */ {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | @@ -1062,7 +1062,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 8E WRITE AND VERIFY(16) */ {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT, CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE, - 16, {0x10, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 16, {0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* 8F VERIFY(16) */ @@ -1191,7 +1191,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* AE WRITE AND VERIFY(12) */ {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT, CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE, - 12, {0x10, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, + 12, {0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* AF VERIFY(12) */ {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 13:04:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A7CDD2E; Mon, 22 Sep 2014 13:04:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09FF73D1; Mon, 22 Sep 2014 13:04:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MD4nws079313; Mon, 22 Sep 2014 13:04:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MD4nLI079312; Mon, 22 Sep 2014 13:04:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409221304.s8MD4nLI079312@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 22 Sep 2014 13:04:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271960 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 13:04:50 -0000 Author: trasz Date: Mon Sep 22 13:04:49 2014 New Revision: 271960 URL: http://svnweb.freebsd.org/changeset/base/271960 Log: Add missing mlinks for section 9. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Sep 22 12:40:43 2014 (r271959) +++ head/share/man/man9/Makefile Mon Sep 22 13:04:49 2014 (r271960) @@ -391,13 +391,21 @@ MLINKS= unr.9 alloc_unr.9 \ unr.9 delete_unrhdr.9 \ unr.9 free_unr.9 \ unr.9 new_unrhdr.9 +MLINKS+=accept_filter.9 accept_filt_add.9 \ + accept_filter.9 accept_filt_del.9 \ + accept_filter.9 accept_filt_generic_mod_event.9 \ + accept_filter.9 accept_filt_get.9 MLINKS+=alq.9 ALQ.9 \ alq.9 alq_close.9 \ alq.9 alq_flush.9 \ alq.9 alq_get.9 \ + alq.9 alq_getn.9 \ alq.9 alq_open.9 \ + alq.9 alq_open_flags.9 \ alq.9 alq_post.9 \ - alq.9 alq_write.9 + alq.9 alq_post_flags.9 \ + alq.9 alq_write.9 \ + alq.9 alq_writen.9 MLINKS+=altq.9 ALTQ.9 MLINKS+=atomic.9 atomic_add.9 \ atomic.9 atomic_clear.9 \ @@ -407,7 +415,9 @@ MLINKS+=atomic.9 atomic_add.9 \ atomic.9 atomic_readandclear.9 \ atomic.9 atomic_set.9 \ atomic.9 atomic_store.9 \ - atomic.9 atomic_subtract.9 + atomic.9 atomic_subtract.9 \ + atomic.9 atomic_swap.9 \ + atomic.9 atomic_testandset.9 MLINKS+=bpf.9 bpfattach.9 \ bpf.9 bpfattach2.9 \ bpf.9 bpfdetach.9 \ @@ -435,6 +445,8 @@ MLINKS+=bus_dma.9 busdma.9 \ bus_dma.9 bus_dmamap_create.9 \ bus_dma.9 bus_dmamap_destroy.9 \ bus_dma.9 bus_dmamap_load.9 \ + bus_dma.9 bus_dmamap_load_bio.9 \ + bus_dma.9 bus_dmamap_load_ccb.9 \ bus_dma.9 bus_dmamap_load_mbuf.9 \ bus_dma.9 bus_dmamap_load_mbuf_sg.9 \ bus_dma.9 bus_dmamap_load_uio.9 \ @@ -449,7 +461,8 @@ MLINKS+=BUS_READ_IVAR.9 BUS_WRITE_IVAR.9 MLINKS+=BUS_SETUP_INTR.9 bus_setup_intr.9 \ BUS_SETUP_INTR.9 BUS_TEARDOWN_INTR.9 \ BUS_SETUP_INTR.9 bus_teardown_intr.9 -MLINKS+=bus_space.9 bus_space_barrier.9 \ +MLINKS+=bus_space.9 bus_space_alloc.9 \ + bus_space.9 bus_space_barrier.9 \ bus_space.9 bus_space_copy_region_1.9 \ bus_space.9 bus_space_copy_region_2.9 \ bus_space.9 bus_space_copy_region_4.9 \ @@ -560,6 +573,7 @@ MLINKS+=condvar.9 cv_broadcast.9 \ condvar.9 cv_signal.9 \ condvar.9 cv_timedwait.9 \ condvar.9 cv_timedwait_sig.9 \ + condvar.9 cv_timedwait_sig_sbt.9 \ condvar.9 cv_wait.9 \ condvar.9 cv_wait_sig.9 \ condvar.9 cv_wait_unlock.9 \ @@ -664,12 +678,21 @@ MLINKS+=eventtimers.9 et_register.9 \ eventtimers.9 ET_UNLOCK.9 \ eventtimers.9 et_start.9 \ eventtimers.9 et_stop.9 +MLINKS+=fail.9 KFAIL_POINT_CODE.9 \ + fail.9 KFAIL_POINT_ERROR.9 \ + fail.9 KFAIL_POINT_GOTO.9 \ + fail.9 KFAIL_POINT_RETURN.9 \ + fail.9 KFAIL_POINT_RETURN_VOID.9 MLINKS+=fetch.9 fubyte.9 \ fetch.9 fuswintr.9 \ fetch.9 fuword.9 \ fetch.9 fuword16.9 \ fetch.9 fuword32.9 \ fetch.9 fuword64.9 +MLINKS+=firmware.9 firmware_get.9 \ + firmware.9 firmware_put.9 \ + firmware.9 firmware_register.9 \ + firmware.9 firmware_unregister.9 MLINKS+=fpu_kern.9 fpu_kern_alloc_ctx.9 \ fpu_kern.9 fpu_kern_free_ctx.9 \ fpu_kern.9 fpu_kern_enter.9 \ @@ -677,8 +700,10 @@ MLINKS+=fpu_kern.9 fpu_kern_alloc_ctx.9 fpu_kern.9 fpu_kern_thread.9 \ fpu_kern.9 is_fpu_kern_thread.9 MLINKS+=g_attach.9 g_detach.9 -MLINKS+=g_bio.9 g_clone_bio.9 \ +MLINKS+=g_bio.9 g_alloc_bio.9 \ + g_bio.9 g_clone_bio.9 \ g_bio.9 g_destroy_bio.9 \ + g_bio.9 g_duplicate_bio.9 \ g_bio.9 g_new_bio.9 \ g_bio.9 g_print_bio.9 MLINKS+=g_consumer.9 g_destroy_consumer.9 \ @@ -692,7 +717,9 @@ MLINKS+=getenv.9 freeenv.9 \ getenv.9 getenv_quad.9 \ getenv.9 getenv_uint.9 \ getenv.9 getenv_ulong.9 \ - getenv.9 testenv.9 + getenv.9 setenv.9 \ + getenv.9 testenv.9 \ + getenv.9 unsetenv.9 MLINKS+=g_event.9 g_cancel_event.9 \ g_event.9 g_post_event.9 \ g_event.9 g_waitfor_event.9 @@ -706,13 +733,22 @@ MLINKS+=hash.9 hash32.9 \ hash.9 hash32_str.9 \ hash.9 hash32_stre.9 \ hash.9 hash32_strn.9 \ - hash.9 hash32_strne.9 + hash.9 hash32_strne.9 \ + hash.9 jenkins_hash.9 \ + hash.9 jenkins_hash32.9 MLINKS+=hashinit.9 hashdestroy.9 \ hashinit.9 hashinit_flags.9 \ hashinit.9 phashinit.9 +MLINKS+=hhook.9 hhook_head_register.9 \ + hhook.9 hhook_head_deregister.9 \ + hhook.9 hhook_head_deregister_lookup.9 \ + hhook.9 hhook_run_hooks.9 \ + hhook.9 HHOOKS_RUN_IF.9 \ + hhook.9 HHOOKS_RUN_LOOKUP_IF.9 MLINKS+=ieee80211.9 ieee80211_ifattach.9 \ ieee80211.9 ieee80211_ifdetach.9 -MLINKS+=ieee80211_amrr.9 ieee80211_amrr_cleanup.9 \ +MLINKS+=ieee80211_amrr.9 ieee80211_amrr_choose.9 \ + ieee80211_amrr.9 ieee80211_amrr_cleanup.9 \ ieee80211_amrr.9 ieee80211_amrr_init.9 \ ieee80211_amrr.9 ieee80211_amrr_node_init.9 \ ieee80211_amrr.9 ieee80211_amrr_setinterval.9 \ @@ -725,6 +761,7 @@ MLINKS+=ieee80211_bmiss.9 ieee80211_beac MLINKS+=ieee80211_crypto.9 ieee80211_crypto_available.9 \ ieee80211_crypto.9 ieee80211_crypto_decap.9 \ ieee80211_crypto.9 ieee80211_crypto_delglobalkeys.9 \ + ieee80211_crypto.9 ieee80211_crypto_delkey.9 \ ieee80211_crypto.9 ieee80211_crypto_demic.9 \ ieee80211_crypto.9 ieee80211_crypto_encap.9 \ ieee80211_crypto.9 ieee80211_crypto_enmic.9 \ @@ -763,12 +800,55 @@ MLINKS+=ieee80211_radiotap.9 ieee80211_r MLINKS+=ieee80211_regdomain.9 ieee80211_alloc_countryie.9 \ ieee80211_regdomain.9 ieee80211_init_channels.9 \ ieee80211_regdomain.9 ieee80211_sort_channels.9 +MLINKS+=ieee80211_scan.9 ieee80211_add_scan.9 \ + ieee80211_scan.9 ieee80211_bg_scan.9 \ + ieee80211_scan.9 ieee80211_cancel_scan.9 \ + ieee80211_scan.9 ieee80211_cancel_scan_any.9 \ + ieee80211_scan.9 ieee80211_check_scan.9 \ + ieee80211_scan.9 ieee80211_check_scan_current.9 \ + ieee80211_scan.9 ieee80211_flush.9 \ + ieee80211_scan.9 ieee80211_probe_curchan.9 \ + ieee80211_scan.9 ieee80211_scan_assoc_fail.9 \ + ieee80211_scan.9 ieee80211_scan_done.9 \ + ieee80211_scan.9 ieee80211_scan_dump_channels.9 \ + ieee80211_scan.9 ieee80211_scan_flush.9 \ + ieee80211_scan.9 ieee80211_scan_iterate.9 \ + ieee80211_scan.9 ieee80211_scan_next.9 \ + ieee80211_scan.9 ieee80211_scan_timeout.9 \ + ieee80211_scan.9 ieee80211_scanner_get.9 \ + ieee80211_scan.9 ieee80211_scanner_register.9 \ + ieee80211_scan.9 ieee80211_scanner_unregister.9 \ + ieee80211_scan.9 ieee80211_scanner_unregister_all.9 \ + ieee80211_scan.9 ieee80211_start_scan.9 MLINKS+=ieee80211_vap.9 ieee80211_vap_attach.9 \ ieee80211_vap.9 ieee80211_vap_detach.9 \ ieee80211_vap.9 ieee80211_vap_setup.9 -MLINKS+=ifnet.9 ifaddr.9 \ +MLINKS+=ifnet.9 if_addmulti.9 \ + ifnet.9 if_alloc.9 \ + ifnet.9 if_allmulti.9 \ + ifnet.9 if_attach.9 \ ifnet.9 if_data.9 \ - ifnet.9 ifqueue.9 + ifnet.9 IF_DEQUEUE.9 \ + ifnet.9 if_delmulti.9 \ + ifnet.9 if_detach.9 \ + ifnet.9 if_down.9 \ + ifnet.9 if_findmulti.9 \ + ifnet.9 if_free.9 \ + ifnet.9 if_free_type.9 \ + ifnet.9 if_up.9 \ + ifnet.9 ifa_free.9 \ + ifnet.9 ifa_ifwithaddr.9 \ + ifnet.9 ifa_ifwithdstaddr.9 \ + ifnet.9 ifa_ifwithnet.9 \ + ifnet.9 ifa_ref.9 \ + ifnet.9 ifaddr.9 \ + ifnet.9 ifaddr_byindex.9 \ + ifnet.9 ifaof_ifpforaddr.9 \ + ifnet.9 ifioctl.9 \ + ifnet.9 ifpromisc.9 \ + ifnet.9 ifqueue.9 \ + ifnet.9 ifunit.9 \ + ifnet.9 ifunit_ref.9 MLINKS+=insmntque.9 insmntque1.9 MLINKS+=ithread.9 ithread_add_handler.9 \ ithread.9 ithread_create.9 \ @@ -783,6 +863,14 @@ MLINKS+=kernel_mount.9 free_mntarg.9 \ kernel_mount.9 mount_argb.9 \ kernel_mount.9 mount_argf.9 \ kernel_mount.9 mount_argsu.9 +MLINKS+=khelp.9 khelp_add_hhook.9 \ + khelp.9 KHELP_DECLARE_MOD.9 \ + khelp.9 KHELP_DECLARE_MOD_UMA.9 \ + khelp.9 khelp_destroy_osd.9 \ + khelp.9 khelp_get_id.9 \ + khelp.9 khelp_get_osd.9 \ + khelp.9 khelp_init_osd.9 \ + khelp.9 khelp_remove_hhook.9 MLINKS+=kobj.9 DEFINE_CLASS.9 \ kobj.9 kobj_class_compile.9 \ kobj.9 kobj_class_compile_static.9 \ @@ -793,6 +881,7 @@ MLINKS+=kobj.9 DEFINE_CLASS.9 \ kobj.9 kobj_init_static.9 MLINKS+=kproc.9 kproc_create.9 \ kproc.9 kproc_exit.9 \ + kproc.9 kproc_kthread_add.9 \ kproc.9 kproc_resume.9 \ kproc.9 kproc_shutdown.9 \ kproc.9 kproc_start.9 \ @@ -827,7 +916,8 @@ MLINKS+=ktr.9 CTR0.9 \ ktr.9 CTR2.9 \ ktr.9 CTR3.9 \ ktr.9 CTR4.9 \ - ktr.9 CTR5.9 + ktr.9 CTR5.9 \ + ktr.9 CTR6.9 MLINKS+=lock.9 lockdestroy.9 \ lock.9 lockinit.9 \ lock.9 lockmgr.9 \ @@ -884,6 +974,7 @@ MLINKS+=mbpool.9 mbp_alloc.9 \ mbpool.9 mbp_sync.9 MLINKS+=\ mbuf.9 m_adj.9 \ + mbuf.9 m_align.9 \ mbuf.9 M_ALIGN.9 \ mbuf.9 m_append.9 \ mbuf.9 m_apply.9 \ @@ -894,6 +985,7 @@ MLINKS+=\ mbuf.9 m_copydata.9 \ mbuf.9 m_copym.9 \ mbuf.9 m_copypacket.9 \ + mbuf.9 m_copyup.9 \ mbuf.9 m_defrag.9 \ mbuf.9 m_devget.9 \ mbuf.9 m_dup.9 \ @@ -1009,9 +1101,38 @@ MLINKS+=mutex.9 mtx_assert.9 \ MLINKS+=namei.9 NDFREE.9 \ namei.9 NDHASGIANT.9 \ namei.9 NDINIT.9 +MLINKS+=netisr.9 netisr_clearqdrops.9 \ + netisr.9 netisr_default_flow2cpu.9 \ + netisr.9 netisr_dispatch.9 \ + netisr.9 netisr_dispatch_src.9 \ + netisr.9 netisr_get_cpucount.9 \ + netisr.9 netisr_get_cpuid.9 \ + netisr.9 netisr_getqdrops.9 \ + netisr.9 netisr_getqlimit.9 \ + netisr.9 netisr_queue.9 \ + netisr.9 netisr_queue_src.9 \ + netisr.9 netisr_register.9 \ + netisr.9 netisr_setqlimit.9 \ + netisr.9 netisr_unregister.9 +MLINKS+=osd.9 osd_call.9 \ + osd.9 osd_del.9 \ + osd.9 osd_deregister.9 \ + osd.9 osd_exit.9 \ + osd.9 osd_get.9 \ + osd.9 osd_register.9 \ + osd.9 osd_set.9 MLINKS+=pbuf.9 getpbuf.9 \ pbuf.9 relpbuf.9 \ pbuf.9 trypbuf.9 +MLINKS+=PCBGROUP.9 in_pcbgroup_byhash.9 \ + PCBGROUP.9 in_pcbgroup_byinpcb.9 \ + PCBGROUP.9 in_pcbgroup_destroy.9 \ + PCBGROUP.9 in_pcbgroup_enabled.9 \ + PCBGROUP.9 in_pcbgroup_init.9 \ + PCBGROUP.9 in_pcbgroup_remove.9 \ + PCBGROUP.9 in_pcbgroup_update.9 \ + PCBGROUP.9 in_pcbgroup_update_mbuf.9 \ + PCBGROUP.9 in6_pcbgroup_byhash.9 MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_alloc_msix.9 \ pci.9 pci_disable_busmaster.9 \ @@ -1040,8 +1161,15 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_set_max_read_req.9 \ pci.9 pci_write_config.9 MLINKS+=pfil.9 pfil_add_hook.9 \ + pfil.9 pfil_head_register.9 \ + pfil.9 pfil_head_unregister.9 \ pfil.9 pfil_hook_get.9 \ - pfil.9 pfil_remove_hook.9 + pfil.9 pfil_remove_hook.9 \ + pfil.9 pfil_rlock.9 \ + pfil.9 pfil_run_hooks.9 \ + pfil.9 pfil_runlock.9 \ + pfil.9 pfil_wlock.9 \ + pfil.9 pfil_wunlock.9 MLINKS+=pfind.9 zpfind.9 MLINKS+=pmap_copy.9 pmap_copy_page.9 MLINKS+=pmap_extract.9 pmap_extract_and_hold.9 @@ -1114,6 +1242,11 @@ MLINKS+=rmlock.9 rm_assert.9 \ rmlock.9 rm_wunlock.9 MLINKS+=rtalloc.9 rtalloc1.9 \ rtalloc.9 rtalloc_ign.9 \ + rtalloc.9 RT_ADDREF.9 \ + rtalloc.9 RT_LOCK.9 \ + rtalloc.9 RT_REMREF.9 \ + rtalloc.9 RT_RTFREE.9 \ + rtalloc.9 RT_UNLOCK.9 \ rtalloc.9 RTFREE_LOCKED.9 \ rtalloc.9 RTFREE.9 \ rtalloc.9 rtfree.9 \ @@ -1128,6 +1261,7 @@ MLINKS+=rwlock.9 rw_assert.9 \ rwlock.9 rw_destroy.9 \ rwlock.9 rw_downgrade.9 \ rwlock.9 rw_init.9 \ + rwlock.9 rw_init_flags.9 \ rwlock.9 rw_initialized.9 \ rwlock.9 rw_rlock.9 \ rwlock.9 rw_runlock.9 \ @@ -1165,6 +1299,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_vprintf.9 MLINKS+=scheduler.9 curpriority_cmp.9 \ scheduler.9 maybe_resched.9 \ + scheduler.9 propagate_priority.9 \ scheduler.9 resetpriority.9 \ scheduler.9 roundrobin.9 \ scheduler.9 roundrobin_interval.9 \ @@ -1257,13 +1392,16 @@ MLINKS+=sleepqueue.9 init_sleepqueues.9 sleepqueue.9 sleepq_catch_signals.9 \ sleepqueue.9 sleepq_free.9 \ sleepqueue.9 sleepq_lookup.9 \ + sleepqueue.9 sleepq_lock.9 \ sleepqueue.9 sleepq_release.9 \ sleepqueue.9 sleepq_remove.9 \ sleepqueue.9 sleepq_set_timeout.9 \ sleepqueue.9 sleepq_set_timeout_sbt.9 \ sleepqueue.9 sleepq_signal.9 \ + sleepqueue.9 sleepq_sleepcnt.9 \ sleepqueue.9 sleepq_timedwait.9 \ sleepqueue.9 sleepq_timedwait_sig.9 \ + sleepqueue.9 sleepq_type.9 \ sleepqueue.9 sleepq_wait.9 \ sleepqueue.9 sleepq_wait_sig.9 MLINKS+=socket.9 soabort.9 \ @@ -1318,6 +1456,8 @@ MLINKS+=stack.9 stack_copy.9 \ stack.9 stack_destroy.9 \ stack.9 stack_print.9 \ stack.9 stack_print_ddb.9 \ + stack.9 stack_print_short.9 \ + stack.9 stack_print_short_ddb.9 \ stack.9 stack_put.9 \ stack.9 stack_save.9 \ stack.9 stack_sbuf_print.9 \ @@ -1339,6 +1479,7 @@ MLINKS+=sx.9 sx_assert.9 \ sx.9 sx_init_flags.9 \ sx.9 sx_sleep.9 \ sx.9 sx_slock.9 \ + sx.9 sx_slock_sig.9 \ sx.9 sx_sunlock.9 \ sx.9 SX_SYSINIT.9 \ sx.9 sx_try_slock.9 \ @@ -1347,6 +1488,7 @@ MLINKS+=sx.9 sx_assert.9 \ sx.9 sx_unlock.9 \ sx.9 sx_xholder.9 \ sx.9 sx_xlock.9 \ + sx.9 sx_xlock_sig.9 \ sx.9 sx_xlocked.9 \ sx.9 sx_xunlock.9 MLINKS+=sysctl.9 SYSCTL_DECL.9 \ @@ -1422,20 +1564,27 @@ MLINKS+=timeout.9 callout.9 \ timeout.9 callout_handle_init.9 \ timeout.9 callout_init.9 \ timeout.9 callout_init_mtx.9 \ + timeout.9 callout_init_rm.9 \ timeout.9 callout_init_rw.9 \ timeout.9 callout_pending.9 \ timeout.9 callout_reset.9 \ + timeout.9 callout_reset_curcpu.9 \ timeout.9 callout_reset_sbt.9 \ timeout.9 callout_reset_on.9 \ timeout.9 callout_reset_sbt_on.9 \ timeout.9 callout_schedule.9 \ + timeout.9 callout_schedule_curcpu.9 \ + timeout.9 callout_schedule_on.9 \ timeout.9 callout_stop.9 \ timeout.9 untimeout.9 -MLINKS+=ucred.9 crcopy.9 \ +MLINKS+=ucred.9 cred_update_thread.9 \ + ucred.9 crcopy.9 \ + ucred.9 crcopysafe.9 \ ucred.9 crdup.9 \ ucred.9 crfree.9 \ ucred.9 crget.9 \ ucred.9 crhold.9 \ + ucred.9 crsetgroups.9 \ ucred.9 crshared.9 \ ucred.9 cru2x.9 MLINKS+=uidinfo.9 uifind.9 \ @@ -1582,6 +1731,7 @@ MLINKS+=vrele.9 vput.9 \ vrele.9 vunref.9 MLINKS+=vslock.9 vsunlock.9 MLINKS+=zone.9 uma.9 \ + zone.9 uma_find_refcnt.9 \ zone.9 uma_zalloc.9 \ zone.9 uma_zalloc_arg.9 \ zone.9 uma_zcreate.9 \ @@ -1590,6 +1740,7 @@ MLINKS+=zone.9 uma.9 \ zone.9 uma_zfree_arg.9 \ zone.9 uma_zone_get_cur.9 \ zone.9 uma_zone_get_max.9 \ - zone.9 uma_zone_set_max.9 + zone.9 uma_zone_set_max.9 \ + zone.9 uma_zone_set_warning.9 .include From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 13:07:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0358CEBA; Mon, 22 Sep 2014 13:07:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7C703F4; Mon, 22 Sep 2014 13:07:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MD74EM079796; Mon, 22 Sep 2014 13:07:04 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MD74jS079794; Mon, 22 Sep 2014 13:07:04 GMT (envelope-from np@FreeBSD.org) Message-Id: <201409221307.s8MD74jS079794@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 22 Sep 2014 13:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271961 - in stable/10: share/man/man4 sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 13:07:05 -0000 Author: np Date: Mon Sep 22 13:07:03 2014 New Revision: 271961 URL: http://svnweb.freebsd.org/changeset/base/271961 Log: MFC r271450: cxgbe(4): knobs to enable/disable PAUSE frame based flow control. Approved by: re (glebius) Modified: stable/10/share/man/man4/cxgbe.4 stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/cxgbe.4 ============================================================================== --- stable/10/share/man/man4/cxgbe.4 Mon Sep 22 13:04:49 2014 (r271960) +++ stable/10/share/man/man4/cxgbe.4 Mon Sep 22 13:07:03 2014 (r271961) @@ -241,8 +241,19 @@ The default is -1 which lets the driver Controls the hardware response to congestion. -1 disables congestion feedback and is not recommended. 0 instructs the hardware to backpressure its pipeline on congestion. -This usually results in the port emitting pause frames. +This usually results in the port emitting PAUSE frames. 1 instructs the hardware to drop frames destined for congested queues. +.It Va hw.cxgbe.pause_settings +PAUSE frame settings. +Bit 0 is rx_pause, bit 1 is tx_pause. +rx_pause = 1 instructs the hardware to heed incoming PAUSE frames, 0 instructs +it to ignore them. +tx_pause = 1 allows the hardware to emit PAUSE frames when its receive FIFO +reaches a high threshold, 0 prohibits the hardware from emitting PAUSE frames. +The default is 3 (both rx_pause and tx_pause = 1). +This tunable establishes the default PAUSE settings for all ports. +Settings can be displayed and controlled on a per-port basis via the +dev.cxgbe.X.pause_settings (dev.cxl.X.pause_settings for T5 cards) sysctl. .It Va hw.cxgbe.buffer_packing Allow the hardware to deliver multiple frames in the same receive buffer opportunistically. Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Mon Sep 22 13:04:49 2014 (r271960) +++ stable/10/sys/dev/cxgbe/t4_main.c Mon Sep 22 13:07:03 2014 (r271961) @@ -281,6 +281,15 @@ static char t4_cfg_file[32] = DEFAULT_CF TUNABLE_STR("hw.cxgbe.config_file", t4_cfg_file, sizeof(t4_cfg_file)); /* + * PAUSE settings (bit 0, 1 = rx_pause, tx_pause respectively). + * rx_pause = 1 to heed incoming PAUSE frames, 0 to ignore them. + * tx_pause = 1 to emit PAUSE frames when the rx FIFO reaches its high water + * mark or when signalled to do so, 0 to never emit PAUSE. + */ +static int t4_pause_settings = PAUSE_TX | PAUSE_RX; +TUNABLE_INT("hw.cxgbe.pause_settings", &t4_pause_settings); + +/* * Firmware auto-install by driver during attach (0, 1, 2 = prohibited, allowed, * encouraged respectively). */ @@ -393,6 +402,7 @@ static int sysctl_holdoff_tmr_idx(SYSCTL static int sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_txq(SYSCTL_HANDLER_ARGS); +static int sysctl_pause_settings(SYSCTL_HANDLER_ARGS); static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS); static int sysctl_temperature(SYSCTL_HANDLER_ARGS); #ifdef SBUF_DRAIN @@ -696,6 +706,12 @@ t4_attach(device_t dev) sc->port[i] = NULL; goto done; } + + pi->link_cfg.requested_fc &= ~(PAUSE_TX | PAUSE_RX); + pi->link_cfg.requested_fc |= t4_pause_settings; + pi->link_cfg.fc &= ~(PAUSE_TX | PAUSE_RX); + pi->link_cfg.fc |= t4_pause_settings; + rc = -t4_link_start(sc, sc->mbox, pi->tx_chan, &pi->link_cfg); if (rc != 0) { device_printf(dev, "port %d l1cfg failed: %d\n", i, rc); @@ -4755,6 +4771,10 @@ cxgbe_sysctls(struct port_info *pi) CTLTYPE_INT | CTLFLAG_RW, pi, 0, sysctl_qsize_txq, "I", "tx queue size"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "pause_settings", + CTLTYPE_STRING | CTLFLAG_RW, pi, PAUSE_TX, sysctl_pause_settings, + "A", "PAUSE settings (bit 0 = rx_pause, bit 1 = tx_pause)"); + /* * dev.cxgbe.X.stats. */ @@ -5136,6 +5156,65 @@ sysctl_qsize_txq(SYSCTL_HANDLER_ARGS) } static int +sysctl_pause_settings(SYSCTL_HANDLER_ARGS) +{ + struct port_info *pi = arg1; + struct adapter *sc = pi->adapter; + struct link_config *lc = &pi->link_cfg; + int rc; + + if (req->newptr == NULL) { + struct sbuf *sb; + static char *bits = "\20\1PAUSE_RX\2PAUSE_TX"; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return(rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (sb == NULL) + return (ENOMEM); + + sbuf_printf(sb, "%b", lc->fc & (PAUSE_TX | PAUSE_RX), bits); + rc = sbuf_finish(sb); + sbuf_delete(sb); + } else { + char s[2]; + int n; + + s[0] = '0' + (lc->requested_fc & (PAUSE_TX | PAUSE_RX)); + s[1] = 0; + + rc = sysctl_handle_string(oidp, s, sizeof(s), req); + if (rc != 0) + return(rc); + + if (s[1] != 0) + return (EINVAL); + if (s[0] < '0' || s[0] > '9') + return (EINVAL); /* not a number */ + n = s[0] - '0'; + if (n & ~(PAUSE_TX | PAUSE_RX)) + return (EINVAL); /* some other bit is set too */ + + rc = begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4PAUSE"); + if (rc) + return (rc); + if ((lc->requested_fc & (PAUSE_TX | PAUSE_RX)) != n) { + int link_ok = lc->link_ok; + + lc->requested_fc &= ~(PAUSE_TX | PAUSE_RX); + lc->requested_fc |= n; + rc = -t4_link_start(sc, sc->mbox, pi->tx_chan, lc); + lc->link_ok = link_ok; /* restore */ + } + end_synchronized_op(sc, 0); + } + + return (rc); +} + +static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS) { struct adapter *sc = arg1; From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 13:07:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9436F136; Mon, 22 Sep 2014 13:07:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 650B15E2; Mon, 22 Sep 2014 13:07:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MD7ul0079956; Mon, 22 Sep 2014 13:07:56 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MD7trh079949; Mon, 22 Sep 2014 13:07:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409221307.s8MD7trh079949@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 22 Sep 2014 13:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271962 - stable/10/tools/regression/acltools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 13:07:56 -0000 Author: trasz Date: Mon Sep 22 13:07:55 2014 New Revision: 271962 URL: http://svnweb.freebsd.org/changeset/base/271962 Log: MFC r271459: Fix ACL tests to correctly work with ZFS; previous version used wrong paths. PR: 191545 Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: stable/10/tools/regression/acltools/01.t stable/10/tools/regression/acltools/03.t stable/10/tools/regression/acltools/04.t Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/acltools/01.t ============================================================================== --- stable/10/tools/regression/acltools/01.t Mon Sep 22 13:07:03 2014 (r271961) +++ stable/10/tools/regression/acltools/01.t Mon Sep 22 13:07:55 2014 (r271962) @@ -51,7 +51,7 @@ TESTDIR=$(dirname $(realpath $0)) # Set up the test filesystem. MD=`mdconfig -at swap -s 64m` MNT=`mktemp -dt acltools` -zpool create -R $MNT acltools /dev/$MD +zpool create -m $MNT acltools /dev/$MD if [ $? -ne 0 ]; then echo "not ok 1 - 'zpool create' failed." exit 1 Modified: stable/10/tools/regression/acltools/03.t ============================================================================== --- stable/10/tools/regression/acltools/03.t Mon Sep 22 13:07:03 2014 (r271961) +++ stable/10/tools/regression/acltools/03.t Mon Sep 22 13:07:55 2014 (r271962) @@ -48,7 +48,7 @@ MNTROOT=`mktemp -dt acltools` MD1=`mdconfig -at swap -s 64m` MNT1=$MNTROOT/nfs4 mkdir $MNT1 -zpool create -R $MNT1 acltools /dev/$MD1 +zpool create -m $MNT1 acltools /dev/$MD1 if [ $? -ne 0 ]; then echo "not ok 1 - 'zpool create' failed." exit 1 Modified: stable/10/tools/regression/acltools/04.t ============================================================================== --- stable/10/tools/regression/acltools/04.t Mon Sep 22 13:07:03 2014 (r271961) +++ stable/10/tools/regression/acltools/04.t Mon Sep 22 13:07:55 2014 (r271962) @@ -43,7 +43,7 @@ TESTDIR=$(dirname $(realpath $0)) # Set up the test filesystem. MD=`mdconfig -at swap -s 64m` MNT=`mktemp -dt acltools` -zpool create -R $MNT acltools /dev/$MD +zpool create -m $MNT acltools /dev/$MD if [ $? -ne 0 ]; then echo "not ok 1 - 'zpool create' failed." exit 1 From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 14:27:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CCD02976; Mon, 22 Sep 2014 14:27:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC15FEE8; Mon, 22 Sep 2014 14:27:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MERREF021366; Mon, 22 Sep 2014 14:27:27 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MERQms021363; Mon, 22 Sep 2014 14:27:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409221427.s8MERQms021363@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 22 Sep 2014 14:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271963 - in head/sys: dev/acpica dev/atkbdc kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 14:27:28 -0000 Author: jhb Date: Mon Sep 22 14:27:26 2014 New Revision: 271963 URL: http://svnweb.freebsd.org/changeset/base/271963 Log: Convert from timeout(9) to callout(9). Modified: head/sys/dev/acpica/acpi.c head/sys/dev/atkbdc/atkbd.c head/sys/kern/kern_cons.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon Sep 22 13:07:55 2014 (r271962) +++ head/sys/dev/acpica/acpi.c Mon Sep 22 14:27:26 2014 (r271963) @@ -93,6 +93,7 @@ struct acpi_interface { /* Global mutex for locking access to the ACPI subsystem. */ struct mtx acpi_mutex; +struct callout acpi_sleep_timer; /* Bitmap of device quirks. */ int acpi_quirks; @@ -683,7 +684,9 @@ acpi_attach(device_t dev) AcpiFormatException(status)); /* Allow sleep request after a while. */ - timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME); + callout_init_mtx(&acpi_sleep_timer, &acpi_mutex, 0); + callout_reset(&acpi_sleep_timer, hz * ACPI_MINIMUM_AWAKETIME, + acpi_sleep_enable, sc); error = 0; @@ -2490,8 +2493,8 @@ acpi_sleep_force(void *arg) device_printf(sc->acpi_dev, "suspend request timed out, forcing sleep now\n"); /* - * XXX Suspending from callout cause the freeze in DEVICE_SUSPEND(). - * Suspend from acpi_task thread in stead. + * XXX Suspending from callout causes freezes in DEVICE_SUSPEND(). + * Suspend from acpi_task thread instead. */ if (ACPI_FAILURE(AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_sleep_force_task, sc))) @@ -2643,15 +2646,15 @@ acpi_sleep_enable(void *arg) { struct acpi_softc *sc = (struct acpi_softc *)arg; + ACPI_LOCK_ASSERT(acpi); + /* Reschedule if the system is not fully up and running. */ if (!AcpiGbl_SystemAwakeAndRunning) { - timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME); + callout_schedule(&acpi_sleep_timer, hz * ACPI_MINIMUM_AWAKETIME); return; } - ACPI_LOCK(acpi); sc->acpi_sleep_disabled = FALSE; - ACPI_UNLOCK(acpi); } static ACPI_STATUS @@ -2866,7 +2869,7 @@ backout: EVENTHANDLER_INVOKE(power_resume); /* Allow another sleep request after a while. */ - timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME); + callout_schedule(&acpi_sleep_timer, hz * ACPI_MINIMUM_AWAKETIME); /* Run /etc/rc.resume after we are back. */ if (devctl_process_running()) Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Mon Sep 22 13:07:55 2014 (r271962) +++ head/sys/dev/atkbdc/atkbd.c Mon Sep 22 14:27:26 2014 (r271963) @@ -62,7 +62,20 @@ __FBSDID("$FreeBSD$"); #include #include -static timeout_t atkbd_timeout; +typedef struct atkbd_state { + KBDC kbdc; /* keyboard controller */ + int ks_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ + int ks_flags; /* flags */ +#define COMPOSE (1 << 0) + int ks_polling; + int ks_state; /* shift/lock key state */ + int ks_accents; /* accent key index (> 0) */ + u_int ks_composed_char; /* composed char code (> 0) */ + u_char ks_prefix; /* AT scan code prefix */ + struct callout ks_timer; +} atkbd_state_t; + +static void atkbd_timeout(void *arg); static void atkbd_shutdown_final(void *v); int @@ -88,6 +101,7 @@ int atkbd_attach_unit(device_t dev, keyboard_t **kbd, int irq, int flags) { keyboard_switch_t *sw; + atkbd_state_t *state; int args[2]; int error; int unit; @@ -120,6 +134,8 @@ atkbd_attach_unit(device_t dev, keyboard * This is a kludge to compensate for lost keyboard interrupts. * A similar code used to be in syscons. See below. XXX */ + state = (atkbd_state_t *)(*kbd)->kb_data; + callout_init(&state->ks_timer, 0); atkbd_timeout(*kbd); if (bootverbose) @@ -134,6 +150,7 @@ atkbd_attach_unit(device_t dev, keyboard static void atkbd_timeout(void *arg) { + atkbd_state_t *state; keyboard_t *kbd; int s; @@ -175,25 +192,14 @@ atkbd_timeout(void *arg) kbdd_intr(kbd, NULL); } splx(s); - timeout(atkbd_timeout, arg, hz/10); + state = (atkbd_state_t *)kbd->kb_data; + callout_reset(&state->ks_timer, hz / 10, atkbd_timeout, arg); } /* LOW-LEVEL */ #define ATKBD_DEFAULT 0 -typedef struct atkbd_state { - KBDC kbdc; /* keyboard controller */ - int ks_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ - int ks_flags; /* flags */ -#define COMPOSE (1 << 0) - int ks_polling; - int ks_state; /* shift/lock key state */ - int ks_accents; /* accent key index (> 0) */ - u_int ks_composed_char; /* composed char code (> 0) */ - u_char ks_prefix; /* AT scan code prefix */ -} atkbd_state_t; - /* keyboard driver declaration */ static int atkbd_configure(int flags); static kbd_probe_t atkbd_probe; @@ -470,7 +476,10 @@ bad: static int atkbd_term(keyboard_t *kbd) { + atkbd_state_t *state = (atkbd_state_t *)kbd->kb_data; + kbd_unregister(kbd); + callout_drain(&state->ks_timer); return 0; } Modified: head/sys/kern/kern_cons.c ============================================================================== --- head/sys/kern/kern_cons.c Mon Sep 22 13:07:55 2014 (r271962) +++ head/sys/kern/kern_cons.c Mon Sep 22 14:27:26 2014 (r271963) @@ -607,6 +607,7 @@ SYSINIT(cndev, SI_SUB_DRIVERS, SI_ORDER_ #ifdef HAS_TIMER_SPKR static int beeping; +static struct callout beeping_timer; static void sysbeepstop(void *chan) @@ -629,11 +630,18 @@ sysbeep(int pitch, int period) timer_spkr_setfreq(pitch); if (!beeping) { beeping = period; - timeout(sysbeepstop, (void *)NULL, period); + callout_reset(&beeping_timer, period, sysbeepstop, NULL); } return (0); } +static void +sysbeep_init(void *unused) +{ + + callout_init(&beeping_timer, CALLOUT_MPSAFE); +} +SYSINIT(sysbeep, SI_SUB_SOFTINTR, SI_ORDER_ANY, sysbeep_init, NULL); #else /* From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 14:54:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10AF27DC; Mon, 22 Sep 2014 14:54:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EED8A33B; Mon, 22 Sep 2014 14:54:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MEsCAr035744; Mon, 22 Sep 2014 14:54:12 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MEsCeo035743; Mon, 22 Sep 2014 14:54:12 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409221454.s8MEsCeo035743@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 22 Sep 2014 14:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271964 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 14:54:13 -0000 Author: gjb Date: Mon Sep 22 14:54:12 2014 New Revision: 271964 URL: http://svnweb.freebsd.org/changeset/base/271964 Log: MFC r271711: Update the bhyve(8) manual to reflect that it is no longer considered 'experimental.' Approved by: re (delphij) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/bhyve/bhyve.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/10/usr.sbin/bhyve/bhyve.8 Mon Sep 22 14:27:26 2014 (r271963) +++ stable/10/usr.sbin/bhyve/bhyve.8 Mon Sep 22 14:54:12 2014 (r271964) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 26, 2014 +.Dd September 17, 2014 .Dt BHYVE 8 .Os .Sh NAME @@ -43,7 +43,7 @@ .Ar vmname .Sh DESCRIPTION .Nm -is an experimental hypervisor that runs guest operating systems inside a +is a hypervisor that runs guest operating systems inside a virtual machine. .Pp Parameters such as the number of virtual CPUs, amount of guest memory, and From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 15:05:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8A41DF9; Mon, 22 Sep 2014 15:05:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B30CD69B; Mon, 22 Sep 2014 15:05:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MF5T6k041027; Mon, 22 Sep 2014 15:05:29 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MF5T7c041025; Mon, 22 Sep 2014 15:05:29 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409221505.s8MF5T7c041025@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Mon, 22 Sep 2014 15:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271965 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 15:05:30 -0000 Author: marcel Date: Mon Sep 22 15:05:28 2014 New Revision: 271965 URL: http://svnweb.freebsd.org/changeset/base/271965 Log: Add support for QCOW version 1. Version 2 is partially implemented. And because of that, it's entirely disabled for now. Both versions are similar enough that a single header definition works for both of them. The only "diverting" side-effect is that the union of the two is larger than the official V1 header. What this means for our V1 support is that we can't put the L1 table adjacent to the V1 header (i.e. at offset 0x30 in the file), unless we revert to hackery and klugery. Let's not. Instead, we align the L1 table at the cluster boundary. This is in line with the V2 layout and perfectly ok for V1 anyway (ok -- as far as I've seen so far). Due to the alignment, our V1 image seems to be 1 cluster larger than the V1 image created by qemu-img (on average). Compression of the clusters is not supported at this time. MFC after: 2 months Added: head/usr.bin/mkimg/qcow.c (contents, props changed) Modified: head/usr.bin/mkimg/Makefile Modified: head/usr.bin/mkimg/Makefile ============================================================================== --- head/usr.bin/mkimg/Makefile Mon Sep 22 14:54:12 2014 (r271964) +++ head/usr.bin/mkimg/Makefile Mon Sep 22 15:05:28 2014 (r271965) @@ -10,6 +10,7 @@ CFLAGS+=-DSPARSE_WRITE # List of formats to support SRCS+= \ + qcow.c \ raw.c \ vhd.c \ vmdk.c Added: head/usr.bin/mkimg/qcow.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/qcow.c Mon Sep 22 15:05:28 2014 (r271965) @@ -0,0 +1,314 @@ +/*- + * Copyright (c) 2014 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "image.h" +#include "format.h" +#include "mkimg.h" + +#undef QCOW_SUPPORT_QCOW2 + +/* Default cluster sizes. */ +#define QCOW1_CLSTR_LOG2SZ 12 /* 4KB */ +#define QCOW2_CLSTR_LOG2SZ 16 /* 64KB */ + +struct qcow_header { + uint32_t magic; +#define QCOW_MAGIC 0x514649fb + uint32_t version; +#define QCOW_VERSION_1 1 +#define QCOW_VERSION_2 2 + uint64_t path_offset; + uint32_t path_length; + uint32_t clstr_log2sz; /* v2 only */ + uint64_t disk_size; + union { + struct { + uint8_t clstr_log2sz; + uint8_t l2_log2sz; + uint16_t _pad; + uint32_t encryption; + uint64_t l1_offset; + } v1; + struct { + uint32_t encryption; + uint32_t l1_entries; + uint64_t l1_offset; + uint64_t refcnt_offset; + uint32_t refcnt_entries; + uint32_t snapshot_count; + uint64_t snapshot_offset; + } v2; + } u; +}; + +static u_int clstr_log2sz; + +static uint64_t +round_clstr(uint64_t ofs) +{ + uint64_t clstrsz; + + clstrsz = 1UL << clstr_log2sz; + return ((ofs + clstrsz - 1) & ~(clstrsz - 1)); +} + +static int +qcow_resize(lba_t imgsz, u_int version) +{ + uint64_t clstrsz, imagesz; + + switch (version) { + case QCOW_VERSION_1: + clstr_log2sz = QCOW1_CLSTR_LOG2SZ; + break; + case QCOW_VERSION_2: + clstr_log2sz = QCOW2_CLSTR_LOG2SZ; + break; + default: + return (EDOOFUS); + } + + clstrsz = 1UL << clstr_log2sz; + imagesz = round_clstr(imgsz * secsz); + + if (verbose) + fprintf(stderr, "QCOW: image size = %ju, cluster size = %ju\n", + (uintmax_t)imagesz, (uintmax_t)clstrsz); + + return (image_set_size(imagesz / secsz)); +} + +static int +qcow1_resize(lba_t imgsz) +{ + + return (qcow_resize(imgsz, QCOW_VERSION_1)); +} + +#ifdef QCOW_SUPPORT_QCOW2 +static int +qcow2_resize(lba_t imgsz) +{ + + return (qcow_resize(imgsz, QCOW_VERSION_2)); +} +#endif + +static int +qcow_write(int fd, u_int version) +{ + struct qcow_header *hdr; + uint64_t *l1tbl, *l2tbl; + uint16_t *rctbl; + uint64_t n, clstrsz, imagesz, nclstrs; + uint64_t l1ofs, l2ofs, ofs, rcofs; + lba_t blk, blkofs, blkcnt, imgsz; + u_int l1idx, l2idx, l2clstrs; + int error; + + if (clstr_log2sz == 0) + return (EDOOFUS); + + clstrsz = 1UL << clstr_log2sz; + blkcnt = clstrsz / secsz; + imgsz = image_get_size(); + imagesz = imgsz * secsz; + nclstrs = imagesz >> clstr_log2sz; + l2clstrs = (nclstrs * 8 + clstrsz - 1) > clstr_log2sz; + + l1ofs = clstrsz; + rcofs = round_clstr(l1ofs + l2clstrs * 8); + + hdr = calloc(1, clstrsz); + if (hdr == NULL) + return (errno); + + be32enc(&hdr->magic, QCOW_MAGIC); + be32enc(&hdr->version, version); + be64enc(&hdr->disk_size, imagesz); + switch (version) { + case QCOW_VERSION_1: + l2ofs = rcofs; /* No reference counting. */ + hdr->u.v1.clstr_log2sz = clstr_log2sz; + hdr->u.v1.l2_log2sz = clstr_log2sz - 3; + be64enc(&hdr->u.v1.l1_offset, l1ofs); + break; + case QCOW_VERSION_2: + l2ofs = round_clstr(rcofs + (nclstrs + l2clstrs) * 2); + be32enc(&hdr->clstr_log2sz, clstr_log2sz); + be32enc(&hdr->u.v2.l1_entries, l2clstrs); + be64enc(&hdr->u.v2.l1_offset, l1ofs); + be64enc(&hdr->u.v2.refcnt_offset, rcofs); + be32enc(&hdr->u.v2.refcnt_entries, l2clstrs); + break; + default: + return (EDOOFUS); + } + + l2tbl = l1tbl = NULL; + rctbl = NULL; + + l1tbl = calloc(1, (size_t)(rcofs - l1ofs)); + if (l1tbl == NULL) { + error = ENOMEM; + goto out; + } + if (l2ofs != rcofs) { + rctbl = calloc(1, (size_t)(l2ofs - rcofs)); + if (rctbl == NULL) { + error = ENOMEM; + goto out; + } + } + + ofs = l2ofs; + for (n = 0; n < nclstrs; n++) { + l1idx = n >> (clstr_log2sz - 3); + if (l1tbl[l1idx] != 0UL) + continue; + blk = n * blkcnt; + if (image_data(blk, blkcnt)) { + be64enc(l1tbl + l1idx, ofs); + ofs += clstrsz; + } + } + + error = 0; + if (!error && sparse_write(fd, hdr, clstrsz) < 0) + error = errno; + if (!error && sparse_write(fd, l1tbl, (size_t)(rcofs - l1ofs)) < 0) + error = errno; + /* XXX refcnt table. */ + if (error) + goto out; + + free(hdr); + hdr = NULL; + if (rctbl != NULL) { + free(rctbl); + rctbl = NULL; + } + + l2tbl = malloc(clstrsz); + if (l2tbl == NULL) { + error = ENOMEM; + goto out; + } + + for (l1idx = 0; l1idx < l2clstrs; l1idx++) { + if (l1tbl[l1idx] == 0) + continue; + memset(l2tbl, 0, clstrsz); + blkofs = (lba_t)l1idx * (clstrsz * (clstrsz >> 3)); + for (l2idx = 0; l2idx < (clstrsz >> 3); l2idx++) { + blk = blkofs + (lba_t)l2idx * blkcnt; + if (blk >= imgsz) + break; + if (image_data(blk, blkcnt)) { + be64enc(l2tbl + l2idx, ofs); + ofs += clstrsz; + } + } + if (sparse_write(fd, l2tbl, clstrsz) < 0) { + error = errno; + goto out; + } + } + + free(l2tbl); + l2tbl = NULL; + free(l1tbl); + l1tbl = NULL; + + error = 0; + for (n = 0; n < nclstrs; n++) { + blk = n * blkcnt; + if (image_data(blk, blkcnt)) { + error = image_copyout_region(fd, blk, blkcnt); + if (error) + break; + } + } + if (!error) + error = image_copyout_done(fd); + + out: + if (l2tbl != NULL) + free(l2tbl); + if (rctbl != NULL) + free(rctbl); + if (l1tbl != NULL) + free(l1tbl); + if (hdr != NULL) + free(hdr); + return (error); +} + +static int +qcow1_write(int fd) +{ + + return (qcow_write(fd, QCOW_VERSION_1)); +} + +#ifdef QCOW_SUPPORT_QCOW2 +static int +qcow2_write(int fd) +{ + + return (qcow_write(fd, QCOW_VERSION_2)); +} +#endif + +static struct mkimg_format qcow1_format = { + .name = "qcow", + .description = "QEMU Copy-On-Write, version 1", + .resize = qcow1_resize, + .write = qcow1_write, +}; +FORMAT_DEFINE(qcow1_format); + +#ifdef QCOW_SUPPORT_QCOW2 +static struct mkimg_format qcow2_format = { + .name = "qcow2", + .description = "QEMU Copy-On-Write, version 2", + .resize = qcow2_resize, + .write = qcow2_write, +}; +FORMAT_DEFINE(qcow2_format); +#endif From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 15:09:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D44CD409; Mon, 22 Sep 2014 15:09:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCD4A6E6; Mon, 22 Sep 2014 15:09:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MF92KS042161; Mon, 22 Sep 2014 15:09:02 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MF8wBf041954; Mon, 22 Sep 2014 15:08:58 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409221508.s8MF8wBf041954@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Mon, 22 Sep 2014 15:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271966 - head/usr.bin/mkimg/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 15:09:02 -0000 Author: marcel Date: Mon Sep 22 15:08:58 2014 New Revision: 271966 URL: http://svnweb.freebsd.org/changeset/base/271966 Log: Update the unit tests to include the QCOW (version 1) format. This is a good safety net for when V2 is added. Added: head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-pc98.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-apm.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-bsd.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-ebr.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-mbr.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-pc98.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-vtoc8.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-apm.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-bsd.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-ebr.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-mbr.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-apm.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-bsd.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-ebr.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-mbr.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-pc98.qcow.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-vtoc8.qcow.gz.uu (contents, props changed) Modified: head/usr.bin/mkimg/tests/mkimg.sh Added: head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow.gz.uu Mon Sep 22 15:08:58 2014 (r271966) @@ -0,0 +1,60 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-apm.qcow.gz +M'XL("+-D'U0``VEM9RTQ>#$M-#`Y-BUA<&TN<6-O=RYO=70`K9Q+CQO'&47W +M^A6=K8$(O%75C]K%ABT@"P-*C*R=>C5@P(^!8R`;_7B30S)#SMRK.XHT(@8: +M$-^'[N;A@3`Z[,/A_#5-,Z:T3"E/>YV./U\>F&Y^N'],'_[Q[N]O;[\^O#DO +MP^$C4\]^3F'"9=W=KF^>UH735)L.^17KC@^Z[N;HXB<V_.ZA4Y! +MK0MTW?2_=2N=BFI=NEMW>'L%^KINHU.".UCN,IT2W,%R5^B4X`Z6NTJG!'>P +MW#4Z);B#Y:[3*<%=L-P-.B6X"Y:[G4X)[H+C#GQ*8[Y+B+CGN`O-=4MPEQUU@ +MODN*N]EQ%YCO9L7=[+@+S'>SXFZVW#'?S8J[V7+'?#9[Q;%W>JXB\QWJ^)N==Q% +MYKM5<;=:[ICO5L7=:KECOEL5=ZOECOEN5=RMECOFNU5QMUKNF.]6Q=UJN6.^ +M6Q5WF^6.^6Y3W&V6.^:[37&W.>X2GQ+<;8Z[Q'RW*>XVQUUBOML4=YOC+C'? +M;8J[S7&7F.\VQ=WFN$O,=YOB[OKK;[V.^2XK[K+C+C'?9<5=MMPQWV7%7;;< +M,=]EQ5VVW#'?9<5=MMPQWV7%7;;<,=]EQ5VVW#'?9<5=L=PQWQ7%7;'<,=\5 +MQ5UQW,U\2G!7''^JXJY:[ICOJN*N6NZ8[ZKBKEKNF.^JXJY:[ICO +MJN*N6NZ8[ZKBKEKNF.^JXJY9[ICOFN*N6>Z8[YKBKCGN%CXEN&N.NX7YKBGN +MFN-N8;YKBKOFN%N8[YKBKCGN%N:[IKAKCKN%^:XI[KKC;F&^ZXJ[[KA;F.^Z +MXJY;[ICONN*N6^Z8[[KBKEONF.^ZXJY;[ICONN*N6^Z8[[KBKEONF.^ZXFY8 +M[ICOAN)N6.Z8[X;B;CCN5CXEN!N.NY7Y;BCNAN-N9;X;BKOAN%N9[X;B;CCN +M5N:[H;@;CKN5^6XH[G;'W[XFZW +MW#'?[8J[W7+'?+_Z'7$=S@([G"PW!'?X2"X +MP\%QM_$ISAUL?[<1WT'U=[#]W49\!]7?P?9W&_$=5'\'V]]MQ'=0_1UL?[<1 +MWT'U=[#]W49\!]7?P?9W&_$=5'\'V]]MQ'=0_1UL?[<1WT'U=[#]W49\!]7? +MP?9W&_$=5'\'V]]MQ'=0_1UL?[<1WT'U=[#]W<9\I_H[V/YN8[Y3_1UL?Y?Y +ME.#.]G>9^4[U=[#]76:^4_T=;'^7F>]4?P?;WV7F.]7?P?9WF?E.]7>P_5UF +MOE/]'6Q_EYGO5'\'V]]EYCO5W\'V=YGY3O5WL/U=9KY3_1UL?Y>9[U1_!]O? +M9>8[U=_!]G>9^4[U=[#]76:^4_T=;'^7F>]4?P?;WQ4^);BS_5UAOE/]'6Q_ +M5YCO5'\'V]\5YCO5W\'V=X7Y3O5WL/U=8;Y3_1UL?U>8[U1_!]O?%>8[U=_! +M]G>%^4[U=[#]76&^4_T=;']7F.]4?P?;WQ7F.]7?P?9WA?E.]7>P_5UAOE/] +M'6Q_5YCO5'\'V]\5YCO5W\'V=Y5/">YL?U>9[U1_!]O?5>8[U=_!]G>5^4[U +M=[#]766^4_T=;']7F>]4?P?;WU7F.]7?P?9WE?E.]7>P_5UEOE/]'6Q_5YGO +M5'\'V]]5YCO5W\'V=Y7Y3O5WL/U=9;Y3_1UL?U>9[U1_!]O?5>8[U=_!]G>5 +M^4[U=[#]7>-3@CO;WS7F.]7?P?9WC?E.]7>P_5UCOE/]'6Q_UYCO5'\'V]\U +MYCO5W\'V=XWY3O5WL/U=8[Y3_1UL?]>8[U1_!]O?->8[U=_!]G>-^4[U=[#] +M76.^4_T=;'_7F.]4?P?;WS7F.]7?P?9WC?E.]7>P_5UCOE/]'6Q_U_F4X,[V +M=YWY3O5WL/U=9[Y3_1UL?]>9[U1_!]O?=>8[U=_!]G>=^4[U=[#]76>^4_T= +M;'_7F>]4?P?;WW7F.]7?P?9WG?E.]7>P_5UGOE/]'6Q_UYGO5'\'V]]UYCO5 +MW\'V=YWY3O5WL/U=9[Y3_1UL?]>9[U1_!]O?#3XEN+/]W6"^4_T=;'\WF.]4 +M?P?;WPWF.]7?P?9W@_E.]7>P_=U@OE/]'6Q_-YCO5'\'V]\-YCO5W\'V=X/Y +M3O5WL/W=8+Y3_1UL?S>8[U1_!]O?#>8[U=_!]G>#^4[U=[#]W6"^4_T=;'\W +MF.]4?P?;WPWF.]7?P?9W.Y\2W-G^;F>^4_T=;'^W,]^I_@ZVO]N9[U1_!]O? +M[]VYCO5W\'V=SOSG>KO8/N[G?E.]7>P_=W.?*?Z.]C^;F>^4_T= +M;'^W,]^I_@ZVO]N9[U1_!]O?[]VYCO5WX7K7YZMFY[6$=\=ISAW +MX5E_=[V?WO3$'?%=4/U=>-;?31?NIBMW\7!Z,LW3')YN;74:Q.FCF\_7'9Y. +M]KM_GO;\Y=FUBY]TL\2;=2]?BO/]^>+C_5N.[X+47\S%VX6X?^+#^^_9:QL? +M[]^2'L.LXV,Y_GMU?M7Q??WP\/,@Z[[8[0C/Z^++HYL?W[4+IFD-TYJF)5^^ +M+T<)C-/3EZ/[\:'\_L=/?_STVZ\_7M>=?+STT_#Z*4?W2WF@1\?OS_?_O[;I +ME:_M]5?DUW?&_6M[?6=$^MGMSSJ^QY=C.5WXXPMQ?*0PS7%*:0K]>.#SZ;DY +MOESX[O/?MSZ<7U"S?7[_PFN;U^T^WQT<]&?=;Q +M??3ZK7%:5\+FT_7[SW_/(%Z/[PM?OW2X7+_+YV?OO^LG/KQ_>__GO#`]+GSS +))\E=0RR#5@`` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow.gz.uu Mon Sep 22 15:08:58 2014 (r271966) @@ -0,0 +1,58 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-bsd.qcow.gz +M'XL("+1D'U0``VEM9RTQ>#$M-#`Y-BUB?SMYU\>WKX]?CDOP^F#J;OOU["$ +MR[J;7=^6EW7A::HMI_R)==\_P-:].;KX#X[NSER?!#/WOJYX_OQ[G1Q?O;^O],-XG0WM7"_6?CK9=V?E^,+XG0/M2[=K/OK +M[G2#.-VLUI4/80D"EJK6-;-NI5-=K1MFW4:G)E^'#Z[M>=U.IZ#6T=?MP_*R +M[J!34:U;;]:='JY`7]33@GN@N,.?$IP%QQW8+X+BKO@N`/S75#:[37&W6>Z8[S;%W6:Y8[[;%'>;Y8[Y;E/<;98[YKM- +M<;=9[ICO-L7=9KECOML4=[OECOEN5]SMECOFNUUQMSON(I\2W.V.N\A\MRON +M=L==9+[;%7>[XRXRW^V*N]UQ%YGO=L7=[KB+S'>[XNYPW$7FNT-Q=SCN(O/= +MH;@[+'?,=X?B[K#<,=\=BKO#^2XBXY[E;FNZ2XN_[SMU['?)<5=]EQMS+?9<5=MMPQWV7%7;;<,=]E +MQ5VVW#'?9<5=MMPQWV7%7;;<,=]EQ5VVW#'?9<5=L=PQWQ7%7;'<,=\5Q5UQ +MW&U\2G!7''<;\UU1W!7'W<9\5Q1WQ7&W,=\5Q5UQW&W,=T5Q5QQW&_-=4=Q= +M_QM2KV.^JXJ[ZKC;F.^JXJY:[ICOJN*N6NZ8[ZKBKEKNF.^JXJY:[ICOJN*N +M6NZ8[ZKBKEKNF.^JXJY9[ICOFN*N6>Z8[YKBKCGN=CXEN&N.NYWYKBGNFN-N +M9[YKBKOFN-N9[YKBKCGN=N:[IKAKCKN=^:XI[KKC;F>^ZXJ[[KC;F>^ZXJY; +M[ICONN*N6^Z8[[KBKEONF.^ZXJY;[ICONN*N6^Z8[[KBKEONF.^ZXFY8[ICO +MAN)N6.Z8[X;B;CCN#CXEN!N.NX/Y;BCNAN/N8+X;BKOAN#N8[X;B;CCN#N:[ +MH;@;CKN#^6XH[J;C[F"^FXJ[Z;@[F.^FXFY:[ICOIN)N6NZ8[Z;B;EKNF.^F +MXFY:[ICOIN)N6NZ8[Z;B;EKNF.^FX`[7+_0ZXCNZ([W`2W.'DN$M\ +MBG,'V]\EXCNH_@ZVOTO$=U#]'6Q_EXCOH/H[V/XN$=]!]7>P_5TBOH/J[V#[ +MNT1\!]7?P?9WB?@.JK^#[>\2\1U4?P?;WR7B.ZC^#K:_2\1W4/T=;'^7B.^@ +M^CO8_BX1WT'U=[#]72*^@^KO8/N[Q'RG^CO8_BXQWZG^#K:_RWQ*<&?[N\Q\ +MI_H[V/XN,]^I_@ZVO\O,=ZJ_@^WO,O.=ZN]@^[O,?*?Z.]C^+C/?J?X.MK_+ +MS'>JOX/M[S+SG>KO8/N[S'RG^CO8_BXSWZG^#K:_R\QWJK^#[>\R\YWJ[V#[ +MN\Q\I_H[V/XN,]^I_@ZVO\O,=ZJ_@^WO"I\2W-G^KC#?J?X.MK\KS'>JOX/M +M[PKSG>KO8/N[PGRG^CO8_JXPWZG^#K:_*\QWJK^#[>\*\YWJ[V#[N\)\I_H[ +MV/ZN,-^I_@ZVORO,=ZJ_@^WO"O.=ZN]@^[O"?*?Z.]C^KC#?J?X.MK\KS'>J +MOX/M[PKSG>KO8/N[RJ<$=[:_J\QWJK^#[>\J\YWJ[V#[N\I\I_H[V/ZN,M^I +M_@ZVOZO,=ZJ_@^WO*O.=ZN]@^[O*?*?Z.]C^KC+?J?X.MK^KS'>JOX/M[RKS +MG>KO8/N[RGRG^CO8_JXRWZG^#K:_J\QWJK^#[>\J\YWJ[V#[N\I\I_H[V/ZN +M\2G!G>WO&O.=ZN]@^[O&?*?Z.]C^KC'?J?X.MK]KS'>JOX/M[QKSG>KO8/N[ +MQGRG^CO8_JXQWZG^#K:_:\QWJK^#[>\:\YWJ[V#[N\9\I_H[V/ZN,=^I_@ZV +MOVO,=ZJ_@^WO&O.=ZN]@^[O&?*?Z.]C^KC'?J?X.MK_K?$IP9_N[SGRG^CO8 +M_JXSWZG^#K:_Z\QWJK^#[>\Z\YWJ[V#[N\Y\I_H[V/ZN,]^I_@ZVO^O,=ZJ_ +M@^WO.O.=ZN]@^[O.?*?Z.]C^KC/?J?X.MK_KS'>JOX/M[SKSG>KO8/N[SGRG +M^CO8_JXSWZG^#K:_Z\QWJK^#[>\&GQ+JOX/M[P;SG>KO8/N[P7RG^CO8_FXP +MWZG^#K:_&\QWJK^#[>\&\YWJ[V#[N\%\I_H[V/YN,-^I_@ZVOQO,=ZJ_@^WO +M!O.=ZN]@^[O)IP1WMK^;S'>JOX/M[R;SG>KO8/N[R7RG^CO8_FXRWZG^#K:_ +MF\QWJK^#[>\F\YWJ[V#[N\E\I_H[V/YN,M^I_@ZVOYO,=ZJ_@^WO)O.=ZN]@ +M^[O)?*?Z.]C^;C+?J?X.MK^;S'>JOPO7+^[6+:_KB.^^3W'NPEU_=[V?WO+* +M'?%=4/U=N.OOE@MWRY6[>'IZ<`W/?WGV[K-^X/';P^W[]89Z\?F&*]NQK-NR +M[4L*-\=S?WRO#SS^\=/OY&)$>L.53ZSCUS;2&Z[3T^(JEP<[H?'-_R_G2?)77<_CS>K`OF=)?;=?7#:_OQT7U]?W0L +M$OXO%^/=K3D^^'V_?SPO5YX9>_ +)`=FR!>?A50`` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow.gz.uu Mon Sep 22 15:08:58 2014 (r271966) @@ -0,0 +1,59 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-ebr.qcow.gz +M'XL("+9D'U0``VEM9RTQ>#$M-#`Y-BUE8G(N<6-O=RYO=70`K9R];AM'&$5[ +M/\6F36'PSN[LSG1!@`1(EQ1)VLQOG0?0PT<628F4[M55;$N$+('Z/NR21T>& +M?;BGT_EM62*6;5^VO,RZ/'Y]N6&Y^>+^MCS\\>MOGV_?'CZ=E^'TSM2KK[>P +MK)=U=[M^/CVO"U^FVG+*'UCW>`-;=W-TZ_\XNIN3?;ONQT_GD^5S02V\/]WE +MLNYZNA"/WO:QX_OIU>GB_.A]O],-XG2C6KC?+?S]LNZ?R_$%<;J'6I?NUOW[ +MZG2#.-VLUI5W80D"EJK6-;-NHU-=K1MF7:13DZ_#.\_M>=U.IZ#6!;IN>5YW +MT*E5K=ONUIT^7X&^KDMT2G`'RUVF4X([6.X*G1+XV +MQUW@4X*[S7$7F.\VQ=WFN`O,=YOB;G/:[37&W.>X"\]VFN-L<=X'Y;E/< +M1<==8+Z+BKOHN`O,=U%Q%RUWS'=1<1Z2XVYCODN*N^L_?^MUS'=9<9<==QOS75;<93X`XGRQWQ'4Z".YP<=XE/<>Y@ +M^[M$?`?5W\'V=XGX#JJ_@^WO$O$=5'\'V]\EXCNH_@ZVOTO$=U#]'6Q_EXCO +MH/H[V/XN$=]!]7>P_5TBOH/J[V#[NT1\!]7?P?9WB?@.JK^#[>\2\1U4?P?; +MWR7B.ZC^#K:_2\1W4/T=;'^7F.]4?P?;WR7F.]7?P?9WF4\)[FQ_EYGO5'\' +MV]]EYCO5W\'V=YGY3O5WL/U=9KY3_1UL?Y>9[U1_!]O?9>8[U=_!]G>9^4[U +M=[#]76:^4_T=;'^7F>]4?P?;WV7F.]7?P?9WF?E.]7>P_5UFOE/]'6Q_EYGO +M5'\'V]]EYCO5W\'V=YGY3O5WL/U=X5.".]O?%>8[U=_!]G>%^4[U=[#]76&^ +M4_T=;']7F.]4?P?;WQ7F.]7?P?9WA?E.]7>P_5UAOE/]'6Q_5YCO5'\'V]\5 +MYCO5W\'V=X7Y3O5WL/U=8;Y3_1UL?U>8[U1_!]O?%>8[U=_!]G>%^4[U=[#] +M76&^4_T=;']7^93@SO9WE?E.]7>P_5UEOE/]'6Q_5YGO5'\'V]]5YCO5W\'V +M=Y7Y3O5WL/U=9;Y3_1UL?U>9[U1_!]O?5>8[U=_!]G>5^4[U=[#]766^4_T= +M;']7F>]4?P?;WU7F.]7?P?9WE?E.]7>P_5UEOE/]'6Q_5YGO5'\'V]\U/B6X +ML_U=8[Y3_1UL?]>8[U1_!]O?->8[U=_!]G>-^4[U=[#]76.^4_T=;'_7F.]4 +M?P?;WS7F.]7?P?9WC?E.]7>P_5UCOE/]'6Q_UYCO5'\'V]\UYCO5W\'V=XWY +M3O5WL/U=8[Y3_1UL?]>8[U1_!]O?->8[U=_!]G>=3PGN;'_7F>]4?P?;WW7F +M.]7?P?9WG?E.]7>P_5UGOE/]'6Q_UYGO5'\'V]]UYCO5W\'V=YWY3O5WL/U= +M9[Y3_1UL?]>9[U1_!]O?=>8[U=_!]G>=^4[U=[#]76>^4_T=;'_7F>]4?P?; +MWW7F.]7?P?9WG?E.]7>P_=W@4X([V]\-YCO5W\'V=X/Y3O5WL/W=8+Y3_1UL +M?S>8[U1_!]O?#>8[U=_!]G>#^4[U=[#]W6"^4_T=;'\WF.]4?P?;WPWF.]7? +MP?9W@_E.]7>P_=U@OE/]'6Q_-YCO5'\'V]\-YCO5W\'V=X/Y3O5WL/W=8+Y3 +M_1UL?S?YE.#.]G>3^4[U=[#]W62^4_T=;'\WF>]4?P?;WTWF.]7?P?9WD_E. +M]7>P_=UDOE/]'6Q_-YGO5'\'V]]-YCO5W\'V=Y/Y3O5WL/W=9+Y3_1UL?S>9 +M[U1_!]O?3>8[U=_!]G>3^4[U=^'ZR:MUR\LZXKO'*-7?7:^GM[QP1WP7 +M5'\77O5WRX6[YB)3SS=]!WGLSA?46^FU;]Y?.*=\,M:G:]\\?L/CK<3+ +M)X^W\^7?KD_.XXE"']\/M^M86_E-I\OR[W<6QKB4\F;AG]?C>[I7@CX +MYJ.^X^'GS_?OS\?W]/KH>"Q;7.*^I/#1$_[[E[_8TT%?'_U5C]]YG;VIK[\``]VASPZ?GW#KV?OS6N0;Y_G +MIR*]O;R^_Y6HGI_?Y>7XR.^,<'>Z[QS?\O9TGWYG'/??CYMUP9SN:5M!_\R?VRY/XG][PN?%\1Q">S?/GK1"$?]1T/OW^^ +9?S\OW"X+O]LCN)WVQZ/\]!_U&W#4P5<````` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu Mon Sep 22 15:08:58 2014 (r271966) @@ -0,0 +1,64 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-gpt.qcow.gz +M'XL("+AD'U0``VEM9RTQ>#$M-#`Y-BUG<'0N<6-O=RYO=70`K9Q+;QO)&47W +M_A7M;8((O%7]J-X$R0`98':>(-DE0.JY'"1[_?CP*8OTO;HVAA8A2"#J0W?S +M]&E9.NS#X?)OFA9,\SK-^S3*=/S^^L#T[IO[Q_3ZZ\^_O+S_]_KI,@R'#U8] +M?#^'*5S'W#=PNHX[7+ANWT551C9OOQAU>;D#?QB6Z2G`'R]U.5PGN8+G+=)7@#I:[0E<)[F"Y +MJW25X`Z6NT97">Z"Y:[358([<;UXQ]V@JP1WP7$'ODIP%QQW8+X+BKO@N`/S +M75#8[Q;%W>*X"\QWB^)NL=PQWRV*N\5RQWRW*.X6RQWSW:*X +M6RQWS'>+XFZQW#'?+8J[Q7+'?+9[S;% +MW>:XB\QWF^)NL]PQWVV*N\URQWRW*>XVRQWSW::XVRQWS'>;XFZSW#'?;8J[ +MS7+'?+Z2Y8[Y+BGNDN-NYJL$=\EQ-S/?)<5=W7WWH<\]VNN-L==S/SW:ZXVRUWS'>[ +MXFZWW#'?[8J[W7+'?+QWQ7%'?%<;^JXJXZ[E;FNZJX:XZ[E?FN*>Z: +MXVYEOFN*NV:Y8[YKBKMFN6.^:XJ[9KECOFN*NV:Y8[YKBKMFN6.^:XJ[9KEC +MOFN*NVZY8[[KBKMNN6.^ZXJ[[KC;^"K!77?<;*K.'>P_5TBOH/J[V#[NT1\!]7?P?9WB?@.JK^#[>\2\1U4?P?; +MWR7B.ZC^#K:_2\1W4/T=;'^7B.^@^CO8_BX1WT'U=[#]72*^@^KO8/N[1'P' +MU=_!]G>)^`ZJOX/M[Q+Q'51_!]O?)>([J/X.MK]+S'>JOX/M[Q+SG>KO8/N[ +MG:\2W-G^;F>^4_T=;'^W,]^I_@ZVO]N9[U1_!]O?[]VYCO5W\'V +M=SOSG>KO8/N[G?E.]7>P_=W.?*?Z.]C^;F>^4_T=;'^W,]^I_@ZVO]N9[U1_ +M!]O?[]VYCO5W\'V=SOSG>KO8/N[G?E.]7>P_5WFJP1WMK_+S'>J +MOX/M[S+SG>KO8/N[S'RG^CO8_BXSWZG^#K:_R\QWJK^#[>\R\YWJ[V#[N\Q\ +MI_H[V/XN,]^I_@ZVO\O,=ZJ_@^WO,O.=ZN]@^[O,?*?Z.]C^+C/?J?X.MK_+ +MS'>JOX/M[S+SG>KO8/N[S'RG^CO8_J[P58([V]\5YCO5W\'V=X7Y3O5WL/U= +M8;Y3_1UL?U>8[U1_!]O?%>8[U=_!]G>%^4[U=[#]76&^4_T=;']7F.]4?P?; +MWQ7F.]7?P?9WA?E.]7>P_5UAOE/]'6Q_5YCO5'\'V]\5YCO5W\'V=X7Y3O5W +ML/U=8;Y3_1UL?U?Y*L&=[>\J\YWJ[V#[N\I\I_H[V/ZN,M^I_@ZVOZO,=ZJ_ +M@^WO*O.=ZN]@^[O*?*?Z.]C^KC+?J?X.MK^KS'>JOX/M[RKSG>KO8/N[RGRG +M^CO8_JXRWZG^#K:_J\QWJK^#[>\J\YWJ[V#[N\I\I_H[V/ZN,M^I_@ZVOVM\ +ME>#.]G>-^4[U=[#]76.^4_T=;'_7F.]4?P?;WS7F.]7?P?9WC?E.]7>P_5UC +MOE/]'6Q_UYCO5'\'V]\UYCO5W\'V=XWY3O5WL/U=8[Y3_1UL?]>8[U1_!]O? +M->8[U=_!]G>-^4[U=[#]76.^4_T=;'_7F.]4?P?;WW6^2G!G^[O.?*?Z.]C^ +MKC/?J?X.MK_KS'>JOX/M[SKSG>KO8/N[SGRG^CO8_JXSWZG^#K:_Z\QWJK^# +M[>\Z\YWJ[V#[N\Y\I_H[V/ZN,]^I_@ZVO^O,=ZJ_@^WO.O.=ZN]@^[O.?*?Z +M.]C^KC/?J?X.MK_KS'>JOX/M[P9?);BS_=U@OE/]'6Q_-YCO5'\'V]\-YCO5 +MW\'V=X/Y3O5WL/W=8+Y3_1UL?S>8[U1_!]O?#>8[U=_!]G>#^4[U=[#]W6"^ +M4_T=;'\WF.]4?P?;WPWF.]7?P?9W@_E.]7>P_=U@OE/]7;A]\3!N^CJ.^.ZX +MBG,7'OJ[V_WTIJ_<$=\%U=^%A_YNNG(WW;B+A].3[C]N +M-]2+YWO?_,#`V]&['W<[>O%R[YMS]-./Y_ZX/BZW?[N].,<=Q=U^W[T8GU_> +MC6-MY=LJ^01!Y;:[+/_^8."R3#E_,_"?M^T[WZYF7J[WK@SG$'+&M(1IF=_& +MG?=UJ>^W[V\__S)]^>O?_W$:]J^ONWN^74TYKC_^"!*G_G"0#I"[^V]V9L3+ +M[6K&X]&^C8MRW&<^[GSY:1^,8P\];OYHU=N-V[[CM;V,6P[WJ]+[5?%XF8S3 +MR%-N8MR?'\:Q_/OWD'=^YWM9I^WXGZY^NM]I':OXA2[.]V/ +M>_)M3N/Y_=ME>=K1VZ^PL(=^0AZ]?#EZ_""=CAX]95[?KA>?[\>QWOUW'+WY +M?-4X_6R2R6?]Q.N7E_N/R\#Y.O!I6W@<6)]X=IS&/?'L.(U[XMEQ&O?4L^,T +M\(EGQVG<$\^.T[@GGAVG<4\].XX#S[\S>])%_#0.E\OD:%,*4X\/VZ#$M-#`Y-BUM8G(N<6-O=RYO=70`K9R];B/)&47S +M>8K>U('`6]W57949"]B`LW5@.W7]QOL`>GA3(BF1TKVZVO7,$#,2J.]#%WET +MM-@YY.ET^;4L$9EW.GU]O6.X^>;PMS__\^S^>[G\]_[@LP^F+J0^? +M;V%9K^L>=OUZ>EL77J;:^@:V[N[KU#US=W6$_K_O+C\MA^5Q0"Q^/ +MNUS7W8X+\>AMW[N^OWXX+BZ/WL\[;A#'C6KA_K#PM^NZ_UZO+XCC'FI=>ECW +M^X?C!G'@U@6Z;GE; +M=]"I5:W;'M:=GFY`W]8E.B6X@^4NTRG!'2QWA4X)[F"YJW1*<`?+7:-3@CM8 +M[CJ=$MP%R]V@4X*[8+F;=$IP%QQWX%."N^"X`_-=4-P%QQV8[X+B+CCNP'P7 +M%'?!<0?FNZ"X"XX[,-\%Q=WJN`/SW:JX6QUW8+Y;%7>KY8[Y;E7:X"\QWF^)N<]P%YKM-<;ZX +M6YGO=L7=[KA;F>]VQ=WNN%N9[W;%W>ZX6YGO=L7=X;A;F>\.Q=WAN%N9[P[% +MW6&Y8[X[%'>'Y8[Y[E#<'98[YKM#<7=8[ICO#L7=8;ECOCL4=X?ECOGN4-PE +MRQWS75+<)1^:XH[HKC+C+?%<5=<=Q%YKNBN"N.N\A\5Q1WMW^& +MU.N8[ZKBKCKN(O-=5=Q5RQWS757<51WR'D^`.)\L=\1U.@CN<''>)3W'N +M8/N[1'P'U=_!]G>)^`ZJOX/M[Q+Q'51_!]O?)>([J/X.MK]+Q'=0_1UL?Y>( +M[Z#Z.]C^+A'?0?5WL/U=(KZ#ZN]@^[M$?`?5W\'V=XGX#JJ_@^WO$O$=5'\' +MV]\EXCNH_@ZVOTO$=U#]'6Q_EYCO5'\'V]\EYCO5W\'V=YE/">YL?Y>9[U1_ +M!]O?9>8[U=_!]G>9^4[U=[#]76:^4_T=;'^7F>]4?P?;WV7F.]7?P?9WF?E. +M]7>P_5UFOE/]'6Q_EYGO5'\'V]]EYCO5W\'V=YGY3O5WL/U=9KY3_1UL?Y>9 +M[U1_!]O?9>8[U=_!]G>9^4[U=[#]7>%3@CO;WQ7F.]7?P?9WA?E.]7>P_5UA +MOE/]'6Q_5YCO5'\'V]\5YCO5W\'V=X7Y3O5WL/U=8;Y3_1UL?U>8[U1_!]O? +M%>8[U=_!]G>%^4[U=[#]76&^4_T=;']7F.]4?P?;WQ7F.]7?P?9WA?E.]7>P +M_5UAOE/]'6Q_5_F4X,[V=Y7Y3O5WL/U=9;Y3_1UL?U>9[U1_!]O?5>8[U=_! +M]G>5^4[U=[#]766^4_T=;']7F>]4?P?;WU7F.]7?P?9WE?E.]7>P_5UEOE/] +M'6Q_5YGO5'\'V]]5YCO5W\'V=Y7Y3O5WL/U=9;Y3_1UL?U>9[U1_!]O?-3XE +MN+/]76.^4_T=;'_7F.]4?P?;WS7F.]7?P?9WC?E.]7>P_5UCOE/]'6Q_UYCO +M5'\'V]\UYCO5W\'V=XWY3O5WL/U=8[Y3_1UL?]>8[U1_!]O?->8[U=_!]G>- +M^4[U=[#]76.^4_T=;'_7F.]4?P?;WS7F.]7?P?9WG4\)[FQ_UYGO5'\'V]]U +MYCO5W\'V=YWY3O5WL/U=9[Y3_1UL?]>9[U1_!]O?=>8[U=_!]G>=^4[U=[#] +M76>^4_T=;'_7F>]4?P?;WW7F.]7?P?9WG?E.]7>P_5UGOE/]'6Q_UYGO5'\' +MV]]UYCO5W\'V=YWY3O5WL/W=X%.".]O?#>8[U=_!]G>#^4[U=[#]W6"^4_T= +M;'\WF.]4?P?;WPWF.]7?P?9W@_E.]7>P_=U@OE/]'6Q_-YCO5'\'V]\-YCO5 +MW\'V=X/Y3O5WL/W=8+Y3_1UL?S>8[U1_!]O?#>8[U=_!]G>#^4[U=[#]W6"^ +M4_T=;'\W^93@SO9WD_E.]7>P_=UDOE/]'6Q_-YGO5'\'V]]-YCO5W\'V=Y/Y +M3O5WL/W=9+Y3_1UL?S>9[U1_!]O?3>8[U=_!]G>3^4[U=[#]W62^4_T=;'\W +MF>]4?P?;WTWF.]7?P?9WD_E.]7?A]L&'=\^;\Q><;R5>/SC?+F__=GMRS@?%P[D?GHQ?GN[6L;;R;4K>05"Y +M'9?EWU\LC'$IY=/"?]VN+_SLI^/U]='Q6+:XQ'U)X;L'_L_?_DV^-U;Z^N@_ +M]?A=UMFWO/L[NOO"=#W_'\CLGE[]LZ_OZ&UZF7;^#![I!7Q]_? +M\,^S]^DUR/?/\VN1WMY?W_]!5&_/[_)^?>1G1G@X[A?7MWP^[NO/C./QZW&W +M+ICC+H_KZI?/[==7]\OGJV/-]O_S9'QZ)>TWOW-?ECQ^YU[6A9\K@OAJEI?_ +CG"CD3WW'\V]/C[\O"[?KPI_V"&ZG_7R5/_X'_3?=L<%7```` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-pc98.qcow.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-pc98.qcow.gz.uu Mon Sep 22 15:08:58 2014 (r271966) @@ -0,0 +1,59 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-pc98.qcow.gz +M'XL("+MD'U0``VEM9RTQ>#$M-#`Y-BUP8SDX+G%C;W64/[#NYQO8NE=7M_Z-JWMUV+?K?OMT.2R?"VKA +M>K=PN:X[7:\/XKNW?>SZOCX<%Y?OWJ\[;A#'C6KA?K?P^W7=G]?K"^*XAUJ7 +M[M;]]7#<((Z;U;KR+BQ!P%+5NF;6;72JJW7#K(MT:O)U>.>YO:S;Z134ND#7 +M+<_K#CJUJG7W&CA]N0%]6Y?HE.`.EKM,IP1WL-P5.B6X@^6NTBG!'2QWC4X) +M[F"YZW1*Z"Y6[2*<'=XZ^?-]R!3PGN@N,.S'=!<1<<=V"^"XJ[ +MX+@#\UU0W`7''9CO@N(N..[`?!<4=ZOC#LQWJ^)N==R!^6Y5W*V6.^:[57&W +M6NZ8[U;%W6JY8[Y;%7>KY8[Y;E78[S;%W>:X"\QWF^)N<]P%YKM-<;8[Z+B+EKNF.^BXBY:[ICOHN(N6NZ8[Z+B+EKN +MF.^BXBY:[ICOHN(N6NZ8[Z+B;K?<,=_MBKO=[XVYEOML5=[OC;F6^VQ5WN^-N9;[;%7>'XVYEOCL4=X?C +M;F6^.Q1WA^6.^>Y0W!V6.^:[0W%W6.Z8[P[%W6&Y8[X[%'>'Y8[Y[E#<'98[ +MYKM#<9^*XJXX[B+S75'<%<==9+XKBKOBN(O,=T5Q5QQWD?FN +M*.YN_PVIUS'?5<5===Q%YKNJN*N6.^:[JKBKECOFNZJXJY8[YKNJN*N6.^:[ +MJKBKECOFNZJXJY8[YKNJN&N6.^:[IKAKECOFNZ:X:XZ[G4\)[IKC;F>^:XJ[ +MYKC;F>^:XJXY[G;FNZ:X:XZ[G?FN*>Z:XVYGOFN*N^ZXVYGONN*N.^YVYKNN +MN.N6.^:[KKCKECOFNZZXZY8[YKNNN.N6.^:[KKCKECOFNZZXZY8[YKNNN!N6 +M.^:[H;@;ECOFNZ&X&XZ[@T\)[H;C[F"^&XJ[X;@[F.^&XFXX[@[FNZ&X&XZ[ +M@_EN*.Z&X^Y@OAN*N^FX.YCOIN)N.NX.YKNIN)N6.^:[J;B;ECOFNZFXFY8[ +MYKNIN)N6.^:[J;B;ECOFNZFXFY8[YKLIN,/M`[V.^`XGP1U.ECOB.YP$=S@Y +M[A*?XMS!]G>)^`ZJOX/M[Q+Q'51_!]O?)>([J/X.MK]+Q'=0_1UL?Y>([Z#Z +M.]C^+A'?0?5WL/U=(KZ#ZN]@^[M$?`?5W\'V=XGX#JJ_@^WO$O$=5'\'V]\E +MXCNH_@ZVOTO$=U#]'6Q_EXCOH/H[V/XN,=^I_@ZVOTO,=ZJ_@^WO,I\2W-G^ +M+C/?J?X.MK_+S'>JOX/M[S+SG>KO8/N[S'RG^CO8_BXSWZG^#K:_R\QWJK^# +M[>\R\YWJ[V#[N\Q\I_H[V/XN,]^I_@ZVO\O,=ZJ_@^WO,O.=ZN]@^[O,?*?Z +M.]C^+C/?J?X.MK_+S'>JOX/M[S+SG>KO8/N[PJ<$=[:_*\QWJK^#[>\*\YWJ +M[V#[N\)\I_H[V/ZN,-^I_@ZVORO,=ZJ_@^WO"O.=ZN]@^[O"?*?Z.]C^KC#? +MJ?X.MK\KS'>JOX/M[PKSG>KO8/N[PGRG^CO8_JXPWZG^#K:_*\QWJK^#[>\* +M\YWJ[V#[N\)\I_H[V/ZN\BG!G>WO*O.=ZN]@^[O*?*?Z.]C^KC+?J?X.MK^K +MS'>JOX/M[RKSG>KO8/N[RGRG^CO8_JXRWZG^#K:_J\QWJK^#[>\J\YWJ[V#[ +MN\I\I_H[V/ZN,M^I_@ZVOZO,=ZJ_@^WO*O.=ZN]@^[O*?*?Z.]C^KC+?J?X. +MMK]K?$IP9_N[QGRG^CO8_JXQWZG^#K:_:\QWJK^#[>\:\YWJ[V#[N\9\I_H[ +MV/ZN,=^I_@ZVOVO,=ZJ_@^WO&O.=ZN]@^[O&?*?Z.]C^KC'?J?X.MK]KS'>J +MOX/M[QKSG>KO8/N[QGRG^CO8_JXQWZG^#K:_:\QWJK^#[>\ZGQ+JOX/M[SKS +MG>KO8/N[SGRG^CO8_JXSWZG^#K:_Z\QWJK^#[>\Z\YWJ[V#[N\Y\I_H[V/ZN +M,]^I_@ZVO^O,=ZJ_@^WO.O.=ZN]@^[O!IP1WMK\;S'>JOX/M[P;SG>KO8/N[ +MP7RG^CO8_FXPWZG^#K:_&\QWJK^#[>\&\YWJ[V#[N\%\I_H[V/YN,-^I_@ZV +MOQO,=ZJ_@^WO!O.=ZN]@^[O!?*?Z.]C^;C#?J?X.MK\;S'>JOX/M[P;SG>KO +M8/N[P7RG^CO8_F[R*<&=[>\F\YWJ[V#[N\E\I_H[V/YN,M^I_@ZVOYO,=ZJ_ +M@^WO)O.=ZN]@^[O)?*?Z.]C^;C+?J?X.MK^;S'>JOX/M[R;SG>KO8/N[R7RG +M^CO8_FXRWZG^#K:_F\QWJK^#[>\F\YWJ[\+M@X=UR\LZXKN?4YR[\-#?W>ZG +MM[QP1WP75'\7'OJ[Y:\?^/'MR_WK[89ZZ_G^+7]C +M88Q+>;OPW[?K.]^_)6]+VQ[/]O3`G"]O=P^(YW:E]V]YGI(/D'77XVZ_^/L7 +MSP>.Q[+%)>Y+"A^]PC_^\1]RX/CK#GQ99^^_^'S!^,BZ\R^@5U_YU)\^EX7R +M@>?N(&>T!>';\AX?\,2WQS4YC7S_,Y(6\O?Y#_8);G +MYW=YN3XB^7!WW'>N;WE[W+/DC_NOQZMUP1QWN5]7WWUNW[^ZSV^OCD76_\^3 +M\>;6)A_\R7U:UD7?JT(CK.9GW[_%_)>/_#C^Y?[U\O"[;SPTW\!]AVL +%?"%7```` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.qcow.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.qcow.gz.uu Mon Sep 22 15:08:58 2014 (r271966) @@ -0,0 +1,58 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-vtoc8.qcow.gz +M'XL("+QD'U0``VEM9RTQ>#$M-#`Y-BUV=&]C."YQ8V]W+F]U=`"MG,V.&T48 +M1?=YB@Y+%I%O=75WU0J$$!(+)!`O0/VN$>L\/)[89FS/O7/YF[&BL:SO4[=] +M?!PE9_ITNGPMRX8E[DO,RZS+^?[UAN7NSN-M^?S+#S]^NO_Z_.&R#*=WII[N +MQ[#@NNYAUW>OZ\++5%M.^6^L.]_HNKNC6__!T=V=[-MU7W^XG"R?"VKA^K!P +MN:X[78\/XMF+?^_XOGTZ75R>O?_O=(,XW4TMW!\6_GQ=]]OU^((XW4.M2P_K +M?G\ZW2!.-ZMUY5U8@H"EJG7-K(MTJJMUPZS;Z-3DZ_#.:WM9M],IJ'6!KEO^ +M6G?0J56MBP_K3I]N0-_6)3HEN(/E+M,IP1TL=X5.">Y@N:MT2G`'RUVC4X([ +M6.XZG1+KY8[Y;E7XVQUU@OML4=YOECOEN4]QMECOFNTUQMUGNF.\VQ=UFN6.^VQ1W +MF^6.^6Y3W&V6.^:[37&W6^Z8[W;%W6ZY8[[;%7>[XV[E4X*[W7&W,M_MBKO= +M<;^2XBXY[B+S75+<)<==9+Y+BKOD +MN(O,=TEQEQQWD?DN*>YN__RMUS'?9<5==MQ%YKNLN,N6.^:[K+C+ECOFNZRX +MRY8[YKNLN,N6.^:[K+C+ECOFNZRXRY8[YKNLN"N6.^:[HK@KECOFNZ*X*XZ[ +MC4\)[HKC;F.^*XJ[XKC;F.^*XJXX[C;FNZ*X*XZ[C?FN*.Z*XVYCOBN*N]M_ +M0^IUS'=5<5<==QOS757<5\2\1U4?P?;WR7B.ZC^#K:_2\1W4/T=;'^7 +MB.^@^CO8_BX1WT'U=[#]72*^@^KO8/N[1'P'U=_!]G>)^`ZJOX/M[Q+Q'51_ +M!]O?)>([J/X.MK]+Q'=0_1UL?Y>8[U1_!]O?)>8[U=_!]G>93PGN;'^7F>]4 +M?P?;WV7F.]7?P?9WF?E.]7>P_5UFOE/]'6Q_EYGO5'\'V]]EYCO5W\'V=YGY +M3O5WL/U=9KY3_1UL?Y>9[U1_!]O?9>8[U=_!]G>9^4[U=[#]76:^4_T=;'^7 +MF>]4?P?;WV7F.]7?P?9WF?E.]7>P_5WA4X([V]\5YCO5W\'V=X7Y3O5WL/U= +M8;Y3_1UL?U>8[U1_!]O?%>8[U=_!]G>%^4[U=[#]76&^4_T=;']7F.]4?P?; +MWQ7F.]7?P?9WA?E.]7>P_5UAOE/]'6Q_5YCO5'\'V]\5YCO5W\'V=X7Y3O5W +ML/U=8;Y3_1UL?U?YE.#.]G>5^4[U=[#]766^4_T=;']7F>]4?P?;WU7F.]7? +MP?9WE?E.]7>P_5UEOE/]'6Q_5YGO5'\'V]]5YCO5W\'V=Y7Y3O5WL/U=9;Y3 +M_1UL?U>9[U1_!]O?5>8[U=_!]G>5^4[U=[#]766^4_T=;']7F>]4?P?;WS4^ +M);BS_5UCOE/]'6Q_UYCO5'\'V]\UYCO5W\'V=XWY3O5WL/U=8[Y3_1UL?]>8 +M[U1_!]O?->8[U=_!]G>-^4[U=[#]76.^4_T=;'_7F.]4?P?;WS7F.]7?P?9W +MC?E.]7>P_5UCOE/]'6Q_UYCO5'\'V]\UYCO5W\'V=YU/">YL?]>9[U1_!]O? +M=>8[U=_!]G>=^4[U=[#]76>^4_T=;'_7F>]4?P?;WW7F.]7?P?9WG?E.]7>P +M_5UGOE/]'6Q_UYGO5'\'V]]UYCO5W\'V=YWY3O5WL/U=9[Y3_1UL?]>9[U1_ +M!]O?=>8[U=_!]G>=^4[U=[#]W>!3@CO;WPWF.]7?P?9W@_E.]7>P_=U@OE/] +M'6Q_-YCO5'\'V]\-YCO5W\'V=X/Y3O5WL/W=8+Y3_1UL?S>8[U1_!]O?#>8[ +MU=_!]G>#^4[U=[#]W6"^4_T=;'\WF.]4?P?;WPWF.]7?P?9W@_E.]7>P_=U@ +MOE/]'6Q_-_F4X,[V=Y/Y3O5WL/W=9+Y3_1UL?S>9[U1_!]O?3>8[U=_!]G>3 +M^4[U=[#]W62^4_T=;'\WF>]4?P?;WTWF.]7?P?9WD_E.]7>P_=UDOE/]'6Q_ +M-YGO5'\'V]]-YCO5W\'V=Y/Y3O5WX?;#T[KE=1WQW7F*>^KO;]?265^Z( +M[X+J[\)3?[=76PS+MBXQ+FL\/]"?-]Y.]H<_QOCN +MU^_C3P_/W?J/+I9XM^[M2_'U=>'C^P+O+TQ??J\TR-=VO;].6K;KWCN^RSK6 +MI?Z'=:Q+I>M>WO[G3_2S0\?3NM_NUK$N];^\&&\OD_3E/'^?3A_^!-JMQ5W?50`` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-512-apm.qcow.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-512-apm.qcow.gz.uu Mon Sep 22 15:08:58 2014 (r271966) @@ -0,0 +1,60 @@ +# $FreeBSD$ +begin 644 img-1x1-512-apm.qcow.gz +M'XL("*AD'U0``VEM9RTQ>#$M-3$R+6%P;2YQ8V]W+F]U=`"MG$N/&\<91??Z +M%9VM@0B\5=6/VL6&+2`+`TJ,K)UZ-6#`CX%C(!O]>)-#,D/.W*L[BB01@@;$ +M]Z&Z>7@@V(<\',Z_IFG&E)8IY6FOT_'GRP/3S0_WC^G#/][]_>WMKP]OSLMP +M^,C4LY]3F'!9=[?KFZ=UX335ID-^Q;KC@ZZ[.5W\A-/=7.S+=5^].5\LGPMJ +M8;Q;.%W6'2[G@[A[Z77G^]NSR\7Y[GVYRPWBU<+E;^/ZR[M^7\P5QN:M: +MM]VM>WAVN4%<;E;KRD=A"0*6JM8ULR[1J:[6#;-NIE,[7X>/O+;G=0N=@EH7 +MZ+KI?^M6.A75NG2W[O#V"O1UW4:G!'>PW&4Z);B#Y:[0*<$=+'>53@GN8+EK +M=$IP!\M=IU."NV"Y&W1*SXRXPW\V*N]EQ%YCO9L7=;+ECOIL5=[/ECOEN5MS-ECOFNUEQ-UONF.]F +MQ=ULN6.^FQ5WL^6.^6Y6W"V6.^:[17&W6.Z8[Q;%W>*XBWQ*<+9[U;%W>JXB\QW +MJ^)NM=PQWZV*N]5RQWRW*NY6RQWSW:JX6RUWS'>KXFZUW#'?K8J[U7+'?+XVQUUBOML4 +M=YOC+C'?;8J[S7&7F.\VQ=WU/W_K=)^2XK[K+ECODN*^ZRY8[Y +M+BONLN6.^2XK[K+ECODN*^ZRY8[Y+BONLN6.^2XK[HKECOFN*.Z*Y8[YKBCN +MBN-NYE."N^*XFYGOBN*N..YFYKNBN"N.NYGYKBCNBN-N9KXKBKOBN)N9[XKB +M[OJ_(?4ZYKNJN*N.NYGYKBKNJN6.^:XJ[JKECOFN*NZJY8[YKBKNJN6.^:XJ +M[JKECOFN*NZJY8[YKBKNFN6.^:XI[IKECOFN*>Z:XV[A4X*[YKA;F.^:XJXY +M[A;FNZ:X:XZ[A?FN*>Z:XVYAOFN*N^:X6YCOFN*N.^X6YKNNN.N.NX7YKBON +MNN6.^:XK[KKECOFN*^ZZY8[YKBONNN6.^:XK[KKECOFN*^ZZY8[YKBONAN6. +M^6XH[H;ECOEN*.Z&XV[E4X*[X;A;F>^&XFXX[E;FNZ&X&XZ[E?EN*.Z&XVYE +MOAN*N^&X6YGOAN)N=]RMS'>[XFYWW*W,=[OB;K?<,=_MBKO=1WR'@^`.!\L=\1T.@CL< +M''<;G^+JOX/M[S;F.]7?P?9WF4\) +M[FQ_EYGO5'\'V]]EYCO5W\'V=YGY3O5WL/U=9KY3_1UL?Y>9[U1_!]O?9>8[ +MU=_!]G>9^4[U=[#]76:^4_T=;'^7F>]4?P?;WV7F.]7?P?9WF?E.]7>P_5UF +MOE/]'6Q_EYGO5'\'V]]EYCO5W\'V=YGY3O5WL/U=X5.".]O?%>8[U=_!]G>% +M^4[U=[#]76&^4_T=;']7F.]4?P?;WQ7F.]7?P?9WA?E.]7>P_5UAOE/]'6Q_ +M5YCO5'\'V]\5YCO5W\'V=X7Y3O5WL/U=8;Y3_1UL?U>8[U1_!]O?%>8[U=_! +M]G>%^4[U=[#]76&^4_T=;']7^93@SO9WE?E.]7>P_5UEOE/]'6Q_5YGO5'\' +MV]]5YCO5W\'V=Y7Y3O5WL/U=9;Y3_1UL?U>9[U1_!]O?5>8[U=_!]G>5^4[U +M=[#]766^4_T=;']7F>]4?P?;WU7F.]7?P?9WE?E.]7>P_5UEOE/]'6Q_5YGO +M5'\'V]\U/B6XL_U=8[Y3_1UL?]>8[U1_!]O?->8[U=_!]G>-^4[U=[#]76.^ +M4_T=;'_7F.]4?P?;WS7F.]7?P?9WC?E.]7>P_5UCOE/]'6Q_UYCO5'\'V]\U +MYCO5W\'V=XWY3O5WL/U=8[Y3_1UL?]>8[U1_!]O?->8[U=_!]G>=3PGN;'_7 +MF>]4?P?;WW7F.]7?P?9WG?E.]7>P_5UGOE/]'6Q_UYGO5'\'V]]UYCO5W\'V +M=YWY3O5WL/U=9[Y3_1UL?]>9[U1_!]O?=>8[U=_!]G>=^4[U=[#]76>^4_T= +M;'_7F>]4?P?;WW7F.]7?P?9WG?E.]7>P_=W@4X([V]\-YCO5W\'V=X/Y3O5W +ML/W=8+Y3_1UL?S>8[U1_!]O?#>8[U=_!]G>#^4[U=[#]W6"^4_T=;'\WF.]4 +M?P?;WPWF.]7?P?9W@_E.]7>P_=U@OE/]'6Q_-YCO5'\'V]\-YCO5W\'V=X/Y +M3O5WL/W=8+Y3_1UL?[?S*<&=[>]VYCO5W\'V=SOSG>KO8/N[G?E.]7>P_=W. +M?*?Z.]C^;F>^4_T=;'^W,]^I_@ZVO]N9[U1_!]O?[]VYCO5W\'V +M=SOSG>KO8/N[G?E.]7>P_=W.?*?Z.]C^;F>^4_U=N/[EV;KI:1WQW7&*> +M]7?7[].;GK@CO@NJOPO/^KOIPMUTY2X>3D^F>9K#TU=;G09Q^NCF\W6'IXO] +M[I^G/7]Y=N_B)WU9XLVZER_%^?OYXN/WMQS?!:F_F(NW"W'_Q(?WW[/7-CY^ +M?TMZ#+..C^7X[]7Y5>?[^N'AYT'6?;&O(SROBR]/-S^^:Q=,TQJF-4U+OORY +M'"4P3D]?3O?C0_G]CY_^^.FW7W^\KCOY>.FGX?533O=+>:"GX]_/]_^_MNF5 +MK^TU@;B^,^Y?V^L[(]+/;G_6^1Y?CN5TXX\OQ/&1PC3'*:4I]./!Y]-S['V[O'_VX]>><;WG%_0LW]^_\)KF]?]/M^>AGHS[K?!^] +M?VN__[O#!=%GZQ$Z;C +-[\/AS9_V\:RVU%8````` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-512-bsd.qcow.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-512-bsd.qcow.gz.uu Mon Sep 22 15:08:58 2014 (r271966) @@ -0,0 +1,58 @@ +# $FreeBSD$ +begin 644 img-1x1-512-bsd.qcow.gz +M'XL("*ED'U0``VEM9RTQ>#$M-3$R+6)S9"YQ8V]W+F]U=`"MG,M.)$<41/?S +M%35;+U!'9CTR=]9(MN2=O;&WSN?:'\#'>Z"[@6XB"/P`A$#-O:KJ.GV09@YU +M.IW?EF7#LN[+FI=9E^_?7SZPO/GF]F-Y_.WG7Q[>OCU^.2_#Z8.IN^_7L(3+ +MNIM=WY:7=>%IJBVG_(EUWS_`UKTYNO@/CN[-R;Y?]\.7\\GRN:`6QIN%RV7= +MZ7)\$,_>^KGC^_'N='%^]OZ_TPWB=#>U<+]9^.MEW9^7XPOB=`^U+MVL^^ON +M=(,XW:S6E0]A"0*6JM8ULVZE4UVM&V;=1JKD!?UR4Z);B#Y2[3*<$=+'>%3@GN8+FK=$IP!\M=HU.".UCN +M.IT2W`7+W:!3@COQ^^(-=Y-.">Z"XPY\2G`7''=@O@N*N^"X`_-=4-P%QQV8 +M[X+B+CCNP'P7%'?!<0?FNZ"XBXX[,-]%Q5UTW('Y+BKNHN6.^2XJ[J+ECODN +M*NZBY8[Y+BKNHN6.^2XJ[J+ECODN*NZBY8[Y+BKN5LL=\]VJN%LM=\QWJ^)N +M==P%/B6X6QUW@?EN5=RMCKO`?+8[U;% +MW>:X"\QWF^)N<]P%YKM-<;=9[ICO-L7=9KECOML4=YOECOEN4]QMECOFNTUQ +MMUGNF.\VQ=UFN6.^VQ1WN^6.^6Y7W.V6.^:[77&W.^XBGQ+<[8Z[R'RW*^YV +MQUUDOML5=[OC+C+?[8J[W7$7F>]VQ=WNN(O,=[OB[G#<1>:[0W%W..XB\]VA +MN#LL=\QWA^+NL-PQWQV*N\-RQWQW*.X.RQWSW:&X.RQWS'>'XNZPW#'?'8J[ +M9+ECODN*NV2Y8[Y+BKODN%OYE.`N.>Y6YKNDN$N.NY7Y+BGNDN-N9;Y+BKOD +MN%N9[Y+B+CGN5N:[I+B[_O.W7L=\EQ5WV7&W,M]EQ5VVW#'?9<5=MMPQWV7% +M7;;<,=]EQ5VVW#'?9<5=MMPQWV7%7;;<,=]EQ5VQW#'?%<5=L=PQWQ7%77'< +M;7Q*<%<<=QOS75'<%YV/B6X:XZ[G?FN*>Z:XVYG +MOFN*N^:XVYGOFN*N.>YVYKNFN&N.NYWYKBGNNN-N9[[KBKONN-N9[[KBKEON +MF.^ZXJY;[ICONN*N6^Z8[[KBKEONF.^ZXJY;[ICONN*N6^Z8[[KB;ECNF.^& +MXFY8[ICOAN)N..X./B6X&XZ[@_EN*.Z&X^Y@OAN*N^&X.YCOAN)N..X.YKNA +MN!N.NX/Y;BCNIN/N8+Z;BKOIN#N8[Z;B;EKNF.^FXFY:[ICOIN)N6NZ8[Z;B +M;EKNF.^FXFY:[ICOIN)N6NZ8[Z;@#M2X2WR* +M)^`ZJOX/M[Q+Q'51_!]O?)>([J/X.MK]+Q'=0_1UL?Y>([Z#Z +M.]C^+A'?0?5WL/U=(KZ#ZN]@^[O$?*?Z.]C^+C'?J?X.MK_+?$IP9_N[S'RG +M^CO8_BXSWZG^#K:_R\QWJK^#[>\R\YWJ[V#[N\Q\I_H[V/XN,]^I_@ZVO\O, +M=ZJ_@^WO,O.=ZN]@^[O,?*?Z.]C^+C/?J?X.MK_+S'>JOX/M[S+SG>KO8/N[ +MS'RG^CO8_BXSWZG^#K:_R\QWJK^#[>\*GQ+JOX/M[PKSG>KO8/N[PGRG^CO8 +M_JXPWZG^#K:_*\QWJK^#[>\*\YWJ[V#[N\)\I_H[V/ZN,-^I_@ZVORO,=ZJ_ +M@^WO"O.=ZN]@^[O*IP1WMK^KS'>JOX/M[RKSG>KO8/N[RGRG^CO8_JXRWZG^ +M#K:_J\QWJK^#[>\J\YWJ[V#[N\I\I_H[V/ZN,M^I_@ZVOZO,=ZJ_@^WO*O.= +MZN]@^[O*?*?Z.]C^KC+?J?X.MK^KS'>JOX/M[RKSG>KO8/N[RGRG^CO8_J[Q +M*<&=[>\:\YWJ[V#[N\9\I_H[V/ZN,=^I_@ZVOVO,=ZJ_@^WO&O.=ZN]@^[O& +M?*?Z.]C^KC'?J?X.MK]KS'>JOX/M[QKSG>KO8/N[QGRG^CO8_JXQWZG^#K:_ +M:\QWJK^#[>\:\YWJ[V#[N\9\I_H[V/ZN,=^I_@ZVO^M\2G!G^[O.?*?Z.]C^ +MKC/?J?X.MK_KS'>JOX/M[SKSG>KO8/N[SGRG^CO8_JXSWZG^#K:_Z\QWJK^# +M[>\Z\YWJ[V#[N\Y\I_H[V/ZN,]^I_@ZVO^O,=ZJ_@^WO.O.=ZN]@^[O.?*?Z +M.]C^KC/?J?X.MK_KS'>JOX/M[P:?$MS9_FXPWZG^#K:_&\QWJK^#[>\&\YWJ +M[V#[N\%\I_H[V/YN,-^I_@ZVOQO,=ZJ_@^WO!O.=ZN]@^[O!?*?Z.]C^;C#? +MJ?X.MK\;S'>JOX/M[P;SG>KO8/N[P7RG^CO8_FXPWZG^#K:_&\QWJK^#[>\& +M\YWJ[V#[N\FG!'>VOYO,=ZJ_@^WO)O.=ZN]@^[O)?*?Z.]C^;C+?J?X.MK^; +MS'>JOX/M[R;SG>KO8/N[R7RG^CO8_FXRWZG^#K:_F\QWJK^#[>\F\YWJ[V#[ +MN\E\I_H[V/YN,M^I_@ZVOYO,=ZJ_"]["77]WO9_>\LH= +M\5U0_5VXZ^^6"W?+E;MX>GIP#<]_>?;NLW[@\=O#[?OUAGKQ^88KV[&LV[+M +M2PHWQW-_?*\///[QT^_D8D1ZPY5/K./7-M(;KMRL>SE@?&;=LT#?_.13/_E2 +MQLD'SNN^7G9]?5W';ZAWF7HB9K`'Y-'Q&^K]B^?N>FWO)?7V.C\GT.WU#\KO +M7ADOUW=Y/3XBJ7!SNA\#$M-3$R+65B/IV7X?3.U*NOM["L +MEW5WNWX^/:\+7Z;:3Y7-!+;P_W>6R +M[GJZ$(_>]K'C^^G5Z>+\Z'V_TPWB=*-:N-\M_/VR[I_+\05QNH=:E^[6_?OJ +M=(,XW:S6E7=A"0*6JM8ULVZC4UVM&V9=I%.3K\,[S^UYW4ZGH-8%NFYY7G?0 +MJ56MV^[6G3Y?@;ZN2W1*<`?+7:93@CM8[@J=$MS!KXFZSW#'?;8J[S7+'?+!3@KO-<1>8[S;%W>:X"\QWF^)N<]P%YKM-<;[XV[E4X*[W7&W,M_MBKO=<;13 +M@KOBN(O,=T5Q5QQWD?FN*.Z*XRXRWQ7%77'<1>:[HK@KCKO(?%<4=]?_AM3K +MF.^JXJXZ[B+S757<5\2\1U4?P?;WR7B.ZC^#K:_2\1W4/T=;'^7B.^@ +M^CO8_BX1WT'U=[#]72*^@^KO8/N[1'P'U=_!]G>)^`ZJOX/M[Q+Q'51_!]O? +M)>([J/X.MK]+Q'=0_1UL?Y>8[U1_!]O?)>8[U=_!]G>93PGN;'^7F>]4?P?; +MWV7F.]7?P?9WF?E.]7>P_5UFOE/]'6Q_EYGO5'\'V]]EYCO5W\'V=YGY3O5W +ML/U=9KY3_1UL?Y>9[U1_!]O?9>8[U=_!]G>9^4[U=[#]76:^4_T=;'^7F>]4 +M?P?;WV7F.]7?P?9WF?E.]7>P_5WA4X([V]\5YCO5W\'V=X7Y3O5WL/U=8;Y3 +M_1UL?U>8[U1_!]O?%>8[U=_!]G>%^4[U=[#]76&^4_T=;']7F.]4?P?;WQ7F +M.]7?P?9WA?E.]7>P_5UAOE/]'6Q_5YCO5'\'V]\5YCO5W\'V=X7Y3O5WL/U= +M8;Y3_1UL?U?YE.#.]G>5^4[U=[#]766^4_T=;']7F>]4?P?;WU7F.]7?P?9W +ME?E.]7>P_5UEOE/]'6Q_5YGO5'\'V]]5YCO5W\'V=Y7Y3O5WL/U=9;Y3_1UL +M?U>9[U1_!]O?5>8[U=_!]G>5^4[U=[#]766^4_T=;']7F>]4?P?;WS4^);BS +M_5UCOE/]'6Q_UYCO5'\'V]\UYCO5W\'V=XWY3O5WL/U=8[Y3_1UL?]>8[U1_ +M!]O?->8[U=_!]G>-^4[U=[#]76.^4_T=;'_7F.]4?P?;WS7F.]7?P?9WC?E. +M]7>P_5UCOE/]'6Q_UYCO5'\'V]\UYCO5W\'V=YU/">YL?]>9[U1_!]O?=>8[ +MU=_!]G>=^4[U=[#]76>^4_T=;'_7F>]4?P?;WW7F.]7?P?9WG?E.]7>P_5UG +MOE/]'6Q_UYGO5'\'V]]UYCO5W\'V=YWY3O5WL/U=9[Y3_1UL?]>9[U1_!]O? +M=>8[U=_!]G>=^4[U=[#]W>!3@CO;WPWF.]7?P?9W@_E.]7>P_=U@OE/]'6Q_ +M-YCO5'\'V]\-YCO5W\'V=X/Y3O5WL/W=8+Y3_1UL?S>8[U1_!]O?#>8[U=_! +M]G>#^4[U=[#]W6"^4_T=;'\WF.]4?P?;WPWF.]7?P?9W@_E.]7>P_=U@OE/] +M'6Q_-_F4X,[V=Y/Y3O5WL/W=9+Y3_1UL?S>9[U1_!]O?3>8[U=_!]G>3^4[U +M=[#]W62^4_T=;'\WF>]4?P?;WTWF.]7?P?9WD_E.]7>P_=UDOE/]'6Q_-YGO +M5'\'V]]-YCO5W\'V=Y/Y3O5WX?K)JW7+RSKBN\WO'!'?!=4 +M?Q=>]7?+A;OERMUZ(E//-WT'>>S.%]1;Z;5OWE\XIWPRUJ=KWSQ^P^.MQ,LG +MC[?SY=^N3\[CB4(?WP^WZUA;^4VGR_+O=Q;&N)3R9N&?U^-[NES-%IY>"/CF +MH[[CX>?/]^_/Q_?T^NAX+%M?I_=?.U_'K&UZFOOP`#W:'/#I^?<.O9^_-:Y!OG^>G +M(KV]O+[_E:B>G]_EY?C([XQP=[KO'-_R]G2??F<<]]^/FW7!G.YROZZ^^]R^ +M?W0_O#TZUFQ_RY/QYI6T'_S)_;+D_B?WO"Y\7Q'$)[-\^>M$(1_U'0^_?[Y_ +8/R_<+@N_VR.XG?;'H_ST'_4;<-3!5P`` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu Mon Sep 22 15:08:58 2014 (r271966) @@ -0,0 +1,64 @@ +# $FreeBSD$ +begin 644 img-1x1-512-gpt.qcow.gz +M'XL("*QD'U0``VEM9RTQ>#$M-3$R+6=P="YQ8V]W+F]U=`"MG$MOX\@91??] +M*]C;!!%TBU5D<3>9(`/,KB=(=EFD7EPE@V3O'Q_KY;;4]_KV8&0+A@VA/I#4 +MX:%A'_%XO'Q,4\(4ERENTUZGUY^O#TSO?KA_3"^__/3SX?W'RZ?+,!P_6/7P +MO>[>RWX_[PZ;*S?%U0`^>[ +M@=-UW/&Z?1!'+W[?]OWPL+NX'+WG[6X0NYO4P.5NX)?KN']=MR^(W5W5N'PW +M[K\/NQO$[FYJ7/D0EB!@J6I<,^,B7=75N&'&);IJY^/PP6M[&;?055#C`ATW +MO8U;Z:I9C8MWXXZ'&]"W<9FN$MS!`N6.YVNDIP%QQWX*L$=\%Q!^:[H+@+CCLPWP7%77#< +M@?DN*.Z"XP[,=T%Q%QQW8+X+BKO9<0?FNUEQ-SONP'PW*^YFRQWSW:RXFRUW +MS'>SXFZVW#'?S8J[V7+'?#8[Z+B+CKN`O-=5-Q%QUU@OHN*N^BX"\QW +M47&7''>!^2XI[I+C+C#?)<5=LMPQWR7%7;+<,=\EQ5VRW#'?)<5=LMPQWR7% +M7;+<,=\EQ5VRW#'?)<7=8KECOEL4=XOECOEN4=PMCKN9KQ+<+8Z[F?EN4=PM +MCKN9^6Y1W"V.NYGY;E'<+8Z[F?EN4=PMCKN9^6Y1W*V.NYGY;E7:[K+C+ +MCKO(?)<5=]EQ%YGOLN+N]N=O/8[Y;E/<;8Z[R'RW*>XVRQWSW::XVRQWS'>; +MXFZSW#'?;8J[S7+'?+8[XKBKCCN$O-=4=P5QUUBOBN*N^*X2\QW17%W +M^S>D'L=\5Q5WU7&7F.^JXJY:[ICOJN*N6NZ8[ZKBKEKNF.^JXJY:[ICOJN*N +M6NZ8[ZKBKEKNF.^JXJY9[ICOFN*N6>Z8[YKBKCGN%KY*<-<<=POS75/<-.([W`4W.%HN2.^PU%PAZ/C +M+O-5G#O8_BX3WT'U=[#]72:^@^KO8/N[3'P'U=_!]G>9^`ZJOX/M[S+Q'51_ +M!]O?9>([J/X.MK_+Q'=0_1UL?Y>)[Z#Z.]C^+A/?0?5WL/U=)KZ#ZN]@^[M, +M?`?5W\'V=YGX#JJ_@^WO,O$=5'\'V]]EYCO5W\'V=YGY3O5WL/W=QE<)[FQ_ +MMS'?J?X.MK_;F.]4?P?;WVW,=ZJ_@^WO-N8[U=_!]G<;\YWJ[V#[NXWY3O5W +ML/W=QGRG^CO8_FYCOE/]'6Q_MS'?J?X.MK_;F.]4?P?;WVW,=ZJ_@^WO-N8[ +MU=_!]G<;\YWJ[V#[NXWY3O5WL/W=QGRG^CO8_J[P58([V]\5YCO5W\'V=X7Y +M3O5WL/U=8;Y3_1UL?U>8[U1_!]O?%>8[U=_!]G>%^4[U=[#]76&^4_T=;']7 +MF.]4?P?;WQ7F.]7?P?9WA?E.]7>P_5UAOE/]'6Q_5YCO5'\'V]\5YCO5W\'V +M=X7Y3O5WL/U=8;Y3_1UL?U?Y*L&=[>\J\YWJ[V#[N\I\I_H[V/ZN,M^I_@ZV +MOZO,=ZJ_@^WO*O.=ZN]@^[O*?*?Z.]C^KC+?J?X.MK^KS'>JOX/M[RKSG>KO +M8/N[RGRG^CO8_JXRWZG^#K:_J\QWJK^#[>\J\YWJ[V#[N\I\I_H[V/ZN,M^I +M_@ZVOVM\E>#.]G>-^4[U=[#]76.^4_T=;'_7F.]4?P?;WS7F.]7?P?9WC?E. +M]7>P_5UCOE/]'6Q_UYCO5'\'V]\UYCO5W\'V=XWY3O5WL/U=8[Y3_1UL?]>8 +M[U1_!]O?->8[U=_!]G>-^4[U=[#]76.^4_T=;'_7F.]4?P?;WW6^2G!G^[O. +M?*?Z.]C^KC/?J?X.MK_KS'>JOX/M[SKSG>KO8/N[SGRG^CO8_JXSWZG^#K:_ +MZ\QWJK^#[>\Z\YWJ[V#[N\Y\I_H[V/ZN,]^I_@ZVO^O,=ZJ_@^WO.O.=ZN]@ +M^[O.?*?Z.]C^KC/?J?X.MK_KS'>JOX/M[P9?);BS_=U@OE/]'6Q_-YCO5'\' +MV]\-YCO5W\'V=X/Y3O5WL/W=8+Y3_1UL?S>8[U1_!]O?#>8[U=_!]G>#^4[U +M=[#]W6"^4_T=;'\WF.]4?P?;WPWF.]7?P?9W@_E.]7>P_=U@OE/]'6Q_-YCO +M5'\'V]\-YCO5W\'V=SM?);BS_=W.?*?Z.]C^;F>^4_T=;'^W,]^I_@ZVO]N9 +M[U1_!]O?[]VYCO5W\'V=SOSG>KO8/N[G?E.]7>P_=W.?*?Z.]C^ +M;F>^4_T=;'^W,]^I_@ZVO]N9[U1_!]O?[QDU?QQ'?O:[BW(6' +M_NYV/[WI*W?$=T'U=^&AOYNNW$TW[N;CZO/Y +MWC>_8>#MZ-V/NQV]^7+OFW/T,U[/_?WZN-S^[;:C>0JXV^^[%^/SX=TXUE:^ +MK9)/$%1NN\OR[P\&IC25\LW`?]RV[WR[FIBN]ZX,YQ`R8DIA2O%MW'E?4WN_ +M?7_]Z>?IRY__]O?3L']^W=WS[6I&F-9V_N-!?]@ZR-U]>=S=R[CSY6=]/-JW +M<;,<]YF/.U]^T@?CV$./BQ^M>KMQVW>\MI=QZ7B_*K]?E=.4P[2\_C9?Y+A_ +MWXUC^??O(>_\SO>ZG%[;99SN=]KVTS=].<5S4WX]32[_6@A3Z.?W$F,*]?S: +M_OK+X=?+L#\=_O?'Z_9=WOD._M!/J*-W>>>[(N+MMG=Z=Z?[<4^^S>E\?O]V +M34\[>ML5%O;03\BC5RY'CQ^DTT;14^;E[7KQ^7X?EX'Q.O!I6QB/L3WQ[#B->^+9<1KWQ+/C-.ZI9\=IX!//CM.X)YX= +MIW%//#M.XYYZ=KP.//_-[$D7\=.X$WMQGDJ;VCHMCQ=Q=3E^^_ +MF:E+_P<7Q$_C/KZ(+_*UO7T\[.P3+^*G<4^]B,=C>I7II_\#SLH] +%"+5<```` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-512-mbr.qcow.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-512-mbr.qcow.gz.uu Mon Sep 22 15:08:58 2014 (r271966) @@ -0,0 +1,59 @@ +# $FreeBSD$ +begin 644 img-1x1-512-mbr.qcow.gz +M'XL("*YD'U0``VEM9RTQ>#$M-3$R+6UB%,B*9'2O;K:]72T +MV#GDZ73YM2P1R[8O6UYF7IMIRRM]8=[Z!K;N[NO4/7-W=83^O^\N/RV'Y7%`+'X^[ +M7-?=C@OQZ&W?N[Z_?C@N+H_>SSMN$,>-:N'^L/"WZ[K_7J\OB.,>:EUZ6/?[ +MA^,&<=RLUI4O80D"EJK6-;-NHU-=K1MF7:13DZ_#%\_M9=U.IZ#6!;IN>5MW +MT*E5K=L>UIV>;D#?UB4Z);B#Y2[3*<$=+'>%3@GN8+FK=$IP!\M=HU.".UCN +M.IT2W`7+W:!3@KM@N9MT2G`7''?@4X*[X+@#\UU0W`7''9CO@N(N..[`?!<4 +M=\%Q!^:[H+@+CCLPWP7%W>JX`_/=JKA;'7=@OEL5=ZOECOEN5=RMECOFNU5Q +MMUKNF.]6Q=UJN6.^6Q5WJ^6.^6Y5W*V6.^:[57&W6>Z8[S;%W6:Y8[[;%'>; +MXR[P*<'=YK@+S'>;XFYSW`7FNTUQMSGN`O/=IKC;''>!^6Y3W&V.N\!\MRGN +MHN,N,-]%Q5UTW`7FNZBXBY8[YKNHN(N6.^:[J+B+ECOFNZBXBY8[YKNHN(N6 +M.^:[J+B+ECOFNZBXVRUWS'>[XFZWW#'?[8J[W7&W\BG!W>ZX6YGO=L7=[KA; +MF>]VQ=WNN%N9[W;%W>ZX6YGO=L7=[KA;F>]VQ=WAN%N9[P[%W>&X6YGO#L7= +M8;ECOCL4=X?ECOGN4-P=ECOFNT-Q=UCNF.\.Q=UAN6.^.Q1WA^6.^>Y0W"7+ +M'?-=4MPERQWS75+<)U_?^MUS'=9<9<==QOS75;<9W?X;4 +MZYCOJN*N.NXB\UU5W%7+'?-=5=Q5RQWS757<53X`XGRQWQ'4Z".YP<=XE/<>Y@ +M^[M$?`?5W\'V=XGX#JJ_@^WO$O$=5'\'V]\EXCNH_@ZVOTO$=U#]'6Q_EXCO +MH/H[V/XN$=]!]7>P_5TBOH/J[V#[NT1\!]7?P?9WB?@.JK^#[>\2\1U4?P?; +MWR7B.ZC^#K:_2\1W4/T=;'^7F.]4?P?;WR7F.]7?P?9WF4\)[FQ_EYGO5'\' +MV]]EYCO5W\'V=YGY3O5WL/U=9KY3_1UL?Y>9[U1_!]O?9>8[U=_!]G>9^4[U +M=[#]76:^4_T=;'^7F>]4?P?;WV7F.]7?P?9WF?E.]7>P_5UFOE/]'6Q_EYGO +M5'\'V]]EYCO5W\'V=YGY3O5WL/U=X5.".]O?%>8[U=_!]G>%^4[U=[#]76&^ +M4_T=;']7F.]4?P?;WQ7F.]7?P?9WA?E.]7>P_5UAOE/]'6Q_5YCO5'\'V]\5 +MYCO5W\'V=X7Y3O5WL/U=8;Y3_1UL?U>8[U1_!]O?%>8[U=_!]G>%^4[U=[#] +M76&^4_T=;']7^93@SO9WE?E.]7>P_5UEOE/]'6Q_5YGO5'\'V]]5YCO5W\'V +M=Y7Y3O5WL/U=9;Y3_1UL?U>9[U1_!]O?5>8[U=_!]G>5^4[U=[#]766^4_T= +M;']7F>]4?P?;WU7F.]7?P?9WE?E.]7>P_5UEOE/]'6Q_5YGO5'\'V]\U/B6X +ML_U=8[Y3_1UL?]>8[U1_!]O?->8[U=_!]G>-^4[U=[#]76.^4_T=;'_7F.]4 +M?P?;WS7F.]7?P?9WC?E.]7>P_5UCOE/]'6Q_UYCO5'\'V]\UYCO5W\'V=XWY +M3O5WL/U=8[Y3_1UL?]>8[U1_!]O?->8[U=_!]G>=3PGN;'_7F>]4?P?;WW7F +M.]7?P?9WG?E.]7>P_5UGOE/]'6Q_UYGO5'\'V]]UYCO5W\'V=YWY3O5WL/U= +M9[Y3_1UL?]>9[U1_!]O?=>8[U=_!]G>=^4[U=[#]76>^4_T=;'_7F>]4?P?; +MWW7F.]7?P?9WG?E.]7>P_=W@4X([V]\-YCO5W\'V=X/Y3O5WL/W=8+Y3_1UL +M?S>8[U1_!]O?#>8[U=_!]G>#^4[U=[#]W6"^4_T=;'\WF.]4?P?;WPWF.]7? +MP?9W@_E.]7>P_=U@OE/]'6Q_-YCO5'\'V]\-YCO5W\'V=X/Y3O5WL/W=8+Y3 +M_1UL?S?YE.#.]G>3^4[U=[#]W62^4_T=;'\WF>]4?P?;WTWF.]7?P?9WD_E. +M]7>P_=UDOE/]'6Q_-YGO5'\'V]]-YCO5W\'V=Y/Y3O5WL/W=9+Y3_1UL?S>9 +M[U1_!]O?3>8[U=_!]G>3^4[U=^'VP8=UR_LZXKOS%.GJY^X_G7I\??MS?46U_?^^8/+#R3-^>G +MA;=';WU][YOS%YQO)5X_.-\N;_]V>W+.!\7#N1^>C%^>[M:QMO)M2MY!4+D= +ME^7?7RR,<2GET\)_W:XO_.RGX_7UT?%8MKC$?4GANP?^S]_^3;XW5OKZZ#_U +M^%W6V;=S?+M@?&?=Z\^SNZ^\)T/?\?R.R>7OVSK^_H;7J9=OX,'ND%?'W]_P +MS[/WZ37(]\_S:Y'>WE_?_T%4;\_O\GY]Y&=&>#CN%]>W?#[NZ\^,X_'K<;K8\WV__-D?'HE[3>_#$M-3$R+7!C.3@N<6-O=RYO=70`K9S-3AQ)&D7W +M?HKTMA=6WW_HVK>W78M^M^^W0Y+)\+:N%Z +MMW"YKCM=KP_BN[=][/J^/AP7E^_>KSMN$,>-:N%^M_#[==V?U^L+XKB'6I?N +MUOWU<-P@CIO5NO(N+$'`4M6Z9M9M=*JK=<.LBW1J\G5XY[F]K-OI%-2Z0-PW!4Z);B#Y:[2*<$=+'>-3@GN +M8+GK=$IP%RQW@TX)[H+E;M(IP=WCKY\WW(%/">Z"XP[,=T%Q%QQW8+X+BKO@ +MN`/S75#KXFYUW('Y;E7;XRXPWVV*N\UQ%YCO-L7=YK@+S'>;XFYSW`7FNTUQMSGN +M`O/=IKB+CKO`?!<5=]%Q%YCOHN(N6NZ8[Z+B+EKNF.^BXBY:[ICOHN(N6NZ8 +M[Z+B+EKNF.^BXBY:[ICOHN)NM]PQW^V*N]URQWRW*^YVQ]W*IP1WN^-N9;[; +M%7>[XVYEOML5=[OC;F6^VQ5WN^-N9;[;%7>[XVYEOML5=X?C;F6^.Q1WA^-N +M9;X[%'>'Y8[Y[E#<'98[YKM#<7=8[ICO#L7=8;ECOCL4=X?ECOGN4-P=ECOF +MNT-QERQWS'=)<99[XKBKCCN(O-=4=P5QUUDOBN*N^*XB\QW17%7''>1^:XH +M[F[_#:G7,=]5Q5UUW$7FNZJXJY8[YKNJN*N6.^:[JKBKECOFNZJXJY8[YKNJ +MN*N6.^:[JKBKECOFNZJX:Y8[YKNFN&N6.^:[IKAKCKN=3PGNFN-N9[YKBKOF +MN-N9[YKBKCGN=N:[IKAKCKN=^:XI[IKC;F>^:XJ[[KC;F>^ZXJX[[G;FNZZX +MZY8[YKNNN.N6.^:[KKCKECOFNZZXZY8[YKNNN.N6.^:[KKCKECOFNZZX&Y8[ +MYKNAN!N6.^:[H;@;CKN#3PGNAN/N8+X;BKOAN#N8[X;B;CCN#N:[H;@;CKN# +M^6XH[H;C[F"^&XJ[Z;@[F.^FXFXZ[@[FNZFXFY8[YKNIN)N6.^:[J;B;ECOF +MNZFXFY8[YKNIN)N6.^:[J;B;ECOFNRFXP^T#O8[X#B?!'4Z6.^([G`1W.#GN +M$I_BW,'V=XGX#JJ_@^WO$O$=5'\'V]\EXCNH_@ZVOTO$=U#]'6Q_EXCOH/H[ +MV/XN$=]!]7>P_5TBOH/J[V#[NT1\!]7?P?9WB?@.JK^#[>\2\1U4?P?;WR7B +M.ZC^#K:_2\1W4/T=;'^7B.^@^CO8_BXQWZG^#K:_2\QWJK^#[>\RGQ+JOX/M +M[S+SG>KO8/N[S'RG^CO8_BXSWZG^#K:_R\QWJK^#[>\R\YWJ[V#[N\Q\I_H[ +MV/XN,]^I_@ZVO\O,=ZJ_@^WO,O.=ZN]@^[O"IP1WMK\KS'>JOX/M[PKSG>KO +M8/N[PGRG^CO8_JXPWZG^#K:_*\QWJK^#[>\*\YWJ[V#[N\)\I_H[V/ZN,-^I +M_@ZVORO,=ZJ_@^WO"O.=ZN]@^[O"?*?Z.]C^KC#?J?X.MK\KS'>JOX/M[PKS +MG>KO8/N[PGRG^CO8_J[R*<&=[>\J\YWJ[V#[N\I\I_H[V/ZN,M^I_@ZVOZO, +M=ZJ_@^WO*O.=ZN]@^[O*?*?Z.]C^KC+?J?X.MK^KS'>JOX/M[RKSG>KO8/N[ +MRGRG^CO8_JXRWZG^#K:_J\QWJK^#[>\J\YWJ[V#[N\I\I_H[V/ZN,M^I_@ZV +MOVM\2G!G^[O&?*?Z.]C^KC'?J?X.MK]KS'>JOX/M[QKSG>KO8/N[QGRG^CO8 +M_JXQWZG^#K:_:\QWJK^#[>\:\YWJ[V#[N\9\I_H[V/ZN,=^I_@ZVOVO,=ZJ_ +M@^WO&O.=ZN]@^[O&?*?Z.]C^KC'?J?X.MK]KS'>JOX/M[SJ?$MS9_JXSWZG^ +M#K:_Z\QWJK^#[>\Z\YWJ[V#[N\Y\I_H[V/ZN,]^I_@ZVO^O,=ZJ_@^WO.O.= +MZN]@^[O.?*?Z.]C^KC/?J?X.MK_KS'>JOX/M[SKSG>KO8/N[SGRG^CO8_JXS +MWZG^#K:_Z\QWJK^#[>\Z\YWJ[V#[N\&G!'>VOQO,=ZJ_@^WO!O.=ZN]@^[O! +M?*?Z.]C^;C#?J?X.MK\;S'>JOX/M[P;SG>KO8/N[P7RG^CO8_FXPWZG^#K:_ +M&\QWJK^#[>\&\YWJ[V#[N\%\I_H[V/YN,-^I_@ZVOQO,=ZJ_@^WO!O.=ZN]@ +M^[O!?*?Z.]C^;O(IP9WM[R;SG>KO8/N[R7RG^CO8_FXRWZG^#K:_F\QWJK^# +M[>\F\YWJ[V#[N\E\I_H[V/YN,M^I_@ZVOYO,=ZJ_@^WO)O.=ZN]@^[O)?*?Z +M.]C^;C+?J?X.MK^;S'>JOX/M[R;SG>KOPNV#AW7+RSKBNY]3G+OPT-_=[J>W +MO'!'?!=4?Q<>^KOERMURXVX]/3VXA?-?GKUYKQ_X\>W+_>OMAGKK^?XM?V-A +MC$MYN_#?M^L[W[\E;TO;'L_V],"<+V]W#XCG=J7W;WF>D@^0==?C;K_X^Q?/ +M!X['LL4E[DL*'[W"/_[Q'W+@^.L.?%EG[[_X?,'XR+KS+Z!77_G4GSZ7A?*! +MR[K/UUV?7];Q&Q)>IYY^X@9[0%X=OR'A_PQ+?'-3F-?/\SDA;R]_D/]@EN?G +M=WFY/B+Y<'?<=ZYO>7OY7U???6[?O[K/;Z^.1=;_SY/Q +MYM8F'_S)?5IR_Y-[61=^K0B.LYF??O\7\EX_\./[E_O7R\+MO/#3?P'V':Q\ +$(5<````` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-512-vtoc8.qcow.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-512-vtoc8.qcow.gz.uu Mon Sep 22 15:08:58 2014 (r271966) @@ -0,0 +1,58 @@ +# $FreeBSD$ +begin 644 img-1x1-512-vtoc8.qcow.gz +M'XL("+%D'U0``VEM9RTQ>#$M-3$R+79T;V,X+G%C;W[.XVWY_,L//WZZ__K\X;(,IW>FGN[' +ML."Z[F'7=Z_KPLM46T[Y;ZP[W^BZNZ-;_\'1W9WLVW5??[B<+)\+:N'ZL'"Y +MKCM=CP_BV8M_[_B^?3I=7)Z]_^]T@SC=32W<'Q;^?%WWV_7X@CC=0ZU+#^M^ +M?SK=($XWJW7E75B"@*6J=UFWTRFH=8&N6_Y: +M=]"I5:V+#^M.GVY`W]8E.B6X@^4NTRG!'2QWA4X)[F"YJW1*<`?+7:-3@CM8 +M[CJ=$MP%R]V@4X*[8+F;=$IP%QQWX%."N^"X`_-=4-P%QQV8[X+B+CCNP'P7 +M%'?!<0?FNZ"X"XX[,-\%Q=WJN`/SW:JX6QUW8+Y;%7>KY8[Y;E7!3PGNHN,N,-]%Q5UTW`7FNZBXBXZ[P'P7%7?1<1>8[Z+B+CKN`O-=5-QM +MCKO`?+Z8[S;%W6:Y8[[;%'>; +MY8[Y;E/<;98[YKM-<;=;[ICO=L7=;KECOML5=[OC;N53@KO=<;'XNZPW#'?'8J[PW+'?'9[Y+B+CGN(O-=4MPEQUUDODN*N^2X +MB\QW27&7''>1^2XI[F[__*W7,=]EQ5UVW$7FNZRXRY8[YKNLN,N6.^:[K+C+ +MECOFNZRXRY8[YKNLN,N6.^:[K+C+ECOFNZRX*Y8[YKNBN"N6.^:[HK@KCKN- +M3PGNBN-N8[XKBKOBN-N8[XKBKCCN-N:[HK@KCKN-^:XH[HKC;F.^*XJ[VW]# +MZG7,=U5Q5QUW&_-=5=Q5RQWS757<51WR'D^`.)\L=\1U.@CN<''>)3W'N +M8/N[1'P'U=_!]G>)^`ZJOX/M[Q+Q'51_!]O?)>([J/X.MK]+Q'=0_1UL?Y>( +M[Z#Z.]C^+A'?0?5WL/U=(KZ#ZN]@^[M$?`?5W\'V=XGX#JJ_@^WO$O$=5'\' +MV]\EXCNH_@ZVOTO$=U#]'6Q_EYCO5'\'V]\EYCO5W\'V=YE/">YL?Y>9[U1_ +M!]O?9>8[U=_!]G>9^4[U=[#]76:^4_T=;'^7F>]4?P?;WV7F.]7?P?9WF?E. +M]7>P_5UFOE/]'6Q_EYGO5'\'V]]EYCO5W\'V=YGY3O5WL/U=9KY3_1UL?Y>9 +M[U1_!]O?9>8[U=_!]G>9^4[U=[#]7>%3@CO;WQ7F.]7?P?9WA?E.]7>P_5UA +MOE/]'6Q_5YCO5'\'V]\5YCO5W\'V=X7Y3O5WL/U=8;Y3_1UL?U>8[U1_!]O? +M%>8[U=_!]G>%^4[U=[#]76&^4_T=;']7F.]4?P?;WQ7F.]7?P?9WA?E.]7>P +M_5UAOE/]'6Q_5_F4X,[V=Y7Y3O5WL/U=9;Y3_1UL?U>9[U1_!]O?5>8[U=_! +M]G>5^4[U=[#]766^4_T=;']7F>]4?P?;WU7F.]7?P?9WE?E.]7>P_5UEOE/] +M'6Q_5YGO5'\'V]]5YCO5W\'V=Y7Y3O5WL/U=9;Y3_1UL?U>9[U1_!]O?-3XE +MN+/]76.^4_T=;'_7F.]4?P?;WS7F.]7?P?9WC?E.]7>P_5UCOE/]'6Q_UYCO +M5'\'V]\UYCO5W\'V=XWY3O5WL/U=8[Y3_1UL?]>8[U1_!]O?->8[U=_!]G>- +M^4[U=[#]76.^4_T=;'_7F.]4?P?;WS7F.]7?P?9WG4\)[FQ_UYGO5'\'V]]U +MYCO5W\'V=YWY3O5WL/U=9[Y3_1UL?]>9[U1_!]O?=>8[U=_!]G>=^4[U=[#] +M76>^4_T=;'_7F>]4?P?;WW7F.]7?P?9WG?E.]7>P_5UGOE/]'6Q_UYGO5'\' +MV]]UYCO5W\'V=YWY3O5WL/W=X%.".]O?#>8[U=_!]G>#^4[U=[#]W6"^4_T= +M;'\WF.]4?P?;WPWF.]7?P?9W@_E.]7>P_=U@OE/]'6Q_-YCO5'\'V]\-YCO5 +MW\'V=X/Y3O5WL/W=8+Y3_1UL?S>8[U1_!]O?#>8[U=_!]G>#^4[U=[#]W6"^ +M4_T=;'\W^93@SO9WD_E.]7>P_=UDOE/]'6Q_-YGO5'\'V]]-YCO5W\'V=Y/Y +M3O5WL/W=9+Y3_1UL?S>9[U1_!]O?3>8[U=_!]G>3^4[U=[#]W62^4_T=;'\W +MF>]4?P?;WTWF.]7?P?9WD_E.]7?A]L/3NN5U'?'=>8IS%Y[ZN]OU])97[HCO +M@NKOPE-_MURY6V[7!^.^'&'9MY=;#,NV+C$N:SP_T)\WWD[VAS_&^.[7 +M[^-/#\_=^H\NEGBW[NU+\?5UX>/[`N\O3%]^KS3(UW:]OTY:MNO>.[[+.M:E +M_H=UK$NEZU[>_N=/]+-#Q].ZW^[6L2[UO[P8;R^3].5S.^#EF;<+/SZ?[I?+ +M)%V&GU]A>:'.\P.?/[XYOLNZU],-=R/A81W8T2UW[[37=:\:>#Y&\^Q]I$?' +M?NW@WZ-"+Y-$U_6RU//?HL*RSC?KOOKFNN[+99)>/FP*^5,_\/GG3X_?%U3B +4=>'_QEX\?Y].'_X$VJW%7=]5```` +` +end Added: head/usr.bin/mkimg/tests/img-63x255-4096-apm.qcow.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-63x255-4096-apm.qcow.gz.uu Mon Sep 22 15:08:58 2014 (r271966) @@ -0,0 +1,60 @@ +# $FreeBSD$ +begin 644 img-63x255-4096-apm.qcow.gz +M'XL(",ID'U0``VEM9RTV,W@R-34M-#`Y-BUA<&TN<6-O=RYO=70`K9Q+CQO' +M&47W^A6=K8$(O%75C]K%ABT@"P-*C*R=>C5@P(^!8R`;_7B30S)#SMRK.XHT +M(@8:$-^'[N;A@3`Z[,/A_#5-,Z:T3"E/>YV./U\>F&Y^N'],'_[Q[N]O;[\^ +MO#DOP^$C4\]^3F'"9=W=KF^>UH735)L.^17KC@^Z[N;HXB<V_.Z +MA4Y!K0MTW?2_=2N=BFI=NEMW>'L%^KINHU.".UCN,IT2W,%R5^B4X`Z6NTJG +M!'>PW#4Z);B#Y:[3*<%=L-P-.B6X"Y:[G4X)[H+C#GQ*8[Y+B+CGN`O-=4MPE +MQUU@ODN*N]EQ%YCO9L7=[+@+S'>SXFZVW#'?S8J[V7+'?#9[Q;%W>JXB\QWJ^)N +M==Q%YKM5<;=:[ICO5L7=:KECOEL5=ZOECOEN5=RMECOFNU5QMUKNF.]6Q=UJ +MN6.^6Q5WF^6.^6Y3W&V6.^:[37&W.>X2GQ+<;8Z[Q'RW*>XVQUUBOML4=YOC +M+C'?;8J[S7&7F.\VQ=WFN$O,=YOB[OKK;[V.^2XK[K+C+C'?9<5=MMPQWV7% +M7;;<,=]EQ5VVW#'?9<5=MMPQWV7%7;;<,=]EQ5VVW#'?9<5=L=PQWQ7%7;'< +M,=\5Q5UQW,U\2G!7''^JXJY:[ICOJN*N6NZ8[ZKBKEKNF.^JXJY: +M[ICOJN*N6NZ8[ZKBKEKNF.^JXJY9[ICOFN*N6>Z8[YKBKCGN%CXEN&N.NX7Y +MKBGNFN-N8;YKBKOFN%N8[YKBKCGN%N:[IKAKCKN%^:XI[KKC;F&^ZXJ[[KA; +MF.^ZXJY;[ICONN*N6^Z8[[KBKEONF.^ZXJY;[ICONN*N6^Z8[[KBKEONF.^Z +MXFY8[ICOAN)N6.Z8[X;B;CCN5CXEN!N.NY7Y;BCNAN-N9;X;BKOAN%N9[X;B +M;CCN5N:[H;@;CKN5^6XH[G;'W[ +MXFZWW#'?[8J[W7+'?+_Z'7$=S@([G"PW!'? +MX2"XP\%QM_$ISAUL?[<1WT'U=[#]W49\!]7?P?9W&_$=5'\'V]]MQ'=0_1UL +M?[<1WT'U=[#]W49\!]7?P?9W&_$=5'\'V]]MQ'=0_1UL?[<1WT'U=[#]W49\ +M!]7?P?9W&_$=5'\'V]]MQ'=0_1UL?[<1WT'U=[#]W<9\I_H[V/YN8[Y3_1UL +M?Y?YE.#.]G>9^4[U=[#]76:^4_T=;'^7F>]4?P?;WV7F.]7?P?9WF?E.]7>P +M_5UFOE/]'6Q_EYGO5'\'V]]EYCO5W\'V=YGY3O5WL/U=9KY3_1UL?Y>9[U1_ +M!]O?9>8[U=_!]G>9^4[U=[#]76:^4_T=;'^7F>]4?P?;WQ4^);BS_5UAOE/] +M'6Q_5YCO5'\'V]\5YCO5W\'V=X7Y3O5WL/U=8;Y3_1UL?U>8[U1_!]O?%>8[ +MU=_!]G>%^4[U=[#]76&^4_T=;']7F.]4?P?;WQ7F.]7?P?9WA?E.]7>P_5UA +MOE/]'6Q_5YCO5'\'V]\5YCO5W\'V=Y5/">YL?U>9[U1_!]O?5>8[U=_!]G>5 +M^4[U=[#]766^4_T=;']7F>]4?P?;WU7F.]7?P?9WE?E.]7>P_5UEOE/]'6Q_ +M5YGO5'\'V]]5YCO5W\'V=Y7Y3O5WL/U=9;Y3_1UL?U>9[U1_!]O?5>8[U=_! +M]G>5^4[U=[#]7>-3@CO;WS7F.]7?P?9WC?E.]7>P_5UCOE/]'6Q_UYCO5'\' +MV]\UYCO5W\'V=XWY3O5WL/U=8[Y3_1UL?]>8[U1_!]O?->8[U=_!]G>-^4[U +M=[#]76.^4_T=;'_7F.]4?P?;WS7F.]7?P?9WC?E.]7>P_5UCOE/]'6Q_U_F4 +MX,[V=YWY3O5WL/U=9[Y3_1UL?]>9[U1_!]O?=>8[U=_!]G>=^4[U=[#]76>^ +M4_T=;'_7F>]4?P?;WW7F.]7?P?9WG?E.]7>P_5UGOE/]'6Q_UYGO5'\'V]]U +MYCO5W\'V=YWY3O5WL/U=9[Y3_1UL?]>9[U1_!]O?#3XEN+/]W6"^4_T=;'\W +MF.]4?P?;WPWF.]7?P?9W@_E.]7>P_=U@OE/]'6Q_-YCO5'\'V]\-YCO5W\'V +M=X/Y3O5WL/W=8+Y3_1UL?S>8[U1_!]O?#>8[U=_!]G>#^4[U=[#]W6"^4_T= +M;'\WF.]4?P?;WPWF.]7?P?9W.Y\2W-G^;F>^4_T=;'^W,]^I_@ZVO]N9[U1_ +M!]O?[]VYCO5W\'V=SOSG>KO8/N[G?E.]7>P_=W.?*?Z.]C^;F>^ +M4_T=;'^W,]^I_@ZVO]N9[U1_!]O?[]VYCO5WX7K7YZMFY[6$=\= +MISAWX5E_=[V?WO3$'?%=4/U=>-;?31?NIBMW\7!Z,LW3')YN;74:Q.FCF\_7 +M'9Y.]KM_GO;\Y=FUBY]TL\2;=2]?BO/]^>+C_5N.[X+47\S%VX6X?^+#^^_9 +M:QL?[]^2'L.LXV,Y_GMU?M7Q??WP\/,@Z[[8[0C/Z^++HYL?W[4+IFD-TYJF +M)5^^+T<)C-/3EZ/[\:'\_L=/?_STVZ\_7M>=?+STT_#Z*4?W2WF@1\?OS_?_ +MO[;IE:_M]5?DUW?&_6M[?6=$^MGMSSJ^QY=C.5WXXPMQ?*0PS7%*:0K]>.#S +MZ;DYOESX[O/?MSZ<7U"S?7[_PFN;U^T^WQT<]& +M?=;Q??3ZK7%:5\+FT_7[SW_/(%Z/[PM?OW2X7+_+YV?OO^LG/KQ_>__GO#`] +,+GSS)\E=0RR#5@`` +` +end Added: head/usr.bin/mkimg/tests/img-63x255-4096-bsd.qcow.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-63x255-4096-bsd.qcow.gz.uu Mon Sep 22 15:08:58 2014 (r271966) @@ -0,0 +1,58 @@ +# $FreeBSD$ +begin 644 img-63x255-4096-bsd.qcow.gz +M'XL(",QD'U0``VEM9RTV,W@R-34M-#`Y-BUB]55=?Q +ML31S7*?3^659-BSKOJQYF77Y\O7+&Y:K+V[?EL???OGUX?KE\=-Y&4[O3-U] +M??0EOZR[V?7WZ[KP--664_[`NB]O8.NNCB[^BZ.[.MFWZ[[[=#Y9/A?4PGBS +M<'E9=WHY/HAG;_W8\?UX=[HX/WO?[G2#.-U-+=QO%GY^6??GR_$%<;J'6I=N +MUOUU=[I!G&Y6Z\J[L`0!2U7KFEFWTJFNU@VS;J-3DZ_#.]?VO&ZG4U#K`EVW +M?%UWT*FHUJTWZTX/%Z`OZQ*=$MS!KXFZUW#'?K8J[ +MU7$7^)3@;G7:[57&W.NX"\]VJN%L==X'Y;E7Z8[S;% +MW6:Y8[[;%'>;Y8[Y;E/<[98[YKM=<;=;[ICO=L7=[KB+?$IPMSON(O/=KKC; +M'7>1^6Y7W.V.N\A\MRON=L==9+[;%7>[XRXRW^V*N\-Q%YGO#L7=X;B+S'>' +MXNZPW#'?'8J[PW+'?'Z2XV[E4X*[Y+A;F>^2XBXY[E;FNZ2X2XZ[E?DN*>Z2 +MXVYEODN*N^2X6YGODN+N\L_?>AWS75;<9^:XJ[YKC;F>^:XJXY[G;FNZ:XZXZ[G?FN*^ZZXVYGONN*NVZY +M8[[KBKMNN6.^ZXJ[;KECONN*NVZY8[[KBKMNN6.^ZXJ[;KECONN*NV&Y8[X; +MBKMAN6.^&XJ[X;@[^)3@;CCN#N:[H;@;CKN#^6XH[H;C[F"^&XJ[X;@[F.^& +MXFXX[@[FNZ&XFXZ[@_EN*NZFX^Y@OIN*NVFY8[Z;BKMIN6.^FXJ[:;ECOIN* +MNVFY8[Z;BKMIN6.^FXJ[:;ECOIN".UP^T>N([W`2W.%DN2.^PTEPAY/C+O$I +MSAUL?Y>([Z#Z.]C^+A'?0?5WL/U=(KZ#ZN]@^[M$?`?5W\'V=XGX#JJ_@^WO +M$O$=5'\'V]\EXCNH_@ZVOTO$=U#]'6Q_EXCOH/H[V/XN$=]!]7>P_5TBOH/J +M[V#[NT1\!]7?P?9WB?@.JK^#[>\2\YWJ[V#[N\1\I_H[V/XN\RG!G>WO,O.= +MZN]@^[O,?*?Z.]C^+C/?J?X.MK_+S'>JOX/M[S+SG>KO8/N[S'RG^CO8_BXS +MWZG^#K:_R\QWJK^#[>\R\YWJ[V#[N\Q\I_H[V/XN,]^I_@ZVO\O,=ZJ_@^WO +M,O.=ZN]@^[O,?*?Z.]C^+C/?J?X.MK\K?$IP9_N[PGRG^CO8_JXPWZG^#K:_ +M*\QWJK^#[>\*\YWJ[V#[N\)\I_H[V/ZN,-^I_@ZVORO,=ZJ_@^WO"O.=ZN]@ +M^[O"?*?Z.]C^KC#?J?X.MK\KS'>JOX/M[PKSG>KO8/N[PGRG^CO8_JXPWZG^ +M#K:_*\QWJK^#[>\JGQ+JOX/M[RKSG>KO8/N[RGRG^CO8_JXRWZG^#K:_J\QW +MJK^#[>\J\YWJ[V#[N\I\I_H[V/ZN,M^I_@ZVOZO,=ZJ_@^WO*O.=ZN]@^[O& +MIP1WMK]KS'>JOX/M[QKSG>KO8/N[QGRG^CO8_JXQWZG^#K:_:\QWJK^#[>\: +M\YWJ[V#[N\9\I_H[V/ZN,=^I_@ZVOVO,=ZJ_@^WO&O.=ZN]@^[O&?*?Z.]C^ +MKC'?J?X.MK]KS'>JOX/M[QKSG>KO8/N[QGRG^CO8_J[S*<&=[>\Z\YWJ[V#[ +MN\Y\I_H[V/ZN,]^I_@ZVO^O,=ZJ_@^WO.O.=ZN]@^[O.?*?Z.]C^KC/?J?X. +MMK_KS'>JOX/M[SKSG>KO8/N[SGRG^CO8_JXSWZG^#K:_Z\QWJK^#[>\Z\YWJ +M[V#[N\Y\I_H[V/ZN,]^I_@ZVOQM\2G!G^[O!?*?Z.]C^;C#?J?X.MK\;S'>J +MOX/M[P;SG>KO8/N[P7RG^CO8_FXPWZG^#K:_&\QWJK^#[>\&\YWJ[V#[N\%\ +MI_H[V/YN,-^I_@ZVOQO,=ZJ_@^WO!O.=ZN]@^[O!?*?Z.]C^;C#?J?X.MK\; +MS'>JOX/M[R:?$MS9_FXRWZG^#K:_F\QWJK^#[>\F\YWJ[V#[N\E\I_H[V/YN +M,M^I_@ZVOYO,=ZJ_@^WO)O.=ZN]@^[O)?*?Z.]C^;C+?J?X.MK^;S'>JOX/M +M[R;SG>KO8/N[R7RG^CO8_FXRWZG^+EP^N5NWO*XCOOLRQ;D+=_W=Y7YZRRMW +MQ'=!]7?AKK];7KA;+MS%T].#:WC^R[,W'_4#CS\]W+Y>;J@7GV^XLAW+NBW; +MOJ1P[[\_ME';^AWLO4$S&#/2!/EM]0[S\\=Y=K>R^I +MZ^O\_$L\OOY!^=U/QM?KN[P>'Y%4N#G==XYO>7NZSY(Z;K\?5^N".=WE=MVS +MI*ZNY\TE-,_>]V^/CD7"_^=BO+DUQP=_%;RN"[=DL3[^_"OFH +6'WC\_'#[>EZX/B_\]`^Z#/C0X54````` +` +end *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 15:22:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84FABD24; Mon, 22 Sep 2014 15:22:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65ED9943; Mon, 22 Sep 2014 15:22:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MFMwc8051332; Mon, 22 Sep 2014 15:22:58 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MFMvLX051287; Mon, 22 Sep 2014 15:22:58 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409221522.s8MFMvLX051287@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Mon, 22 Sep 2014 15:22:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271967 - stable/10/usr.bin/mkimg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 15:22:58 -0000 Author: marcel Date: Mon Sep 22 15:22:57 2014 New Revision: 271967 URL: http://svnweb.freebsd.org/changeset/base/271967 Log: MFC 271482: Add support for adding empty partition entries. Relnotes: yes Approved by: re@ (gjb) Modified: stable/10/usr.bin/mkimg/mkimg.1 stable/10/usr.bin/mkimg/mkimg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/mkimg.1 ============================================================================== --- stable/10/usr.bin/mkimg/mkimg.1 Mon Sep 22 15:08:58 2014 (r271966) +++ stable/10/usr.bin/mkimg/mkimg.1 Mon Sep 22 15:22:57 2014 (r271967) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 4, 2014 +.Dd September 12, 2014 .Dt MKIMG 1 .Os .Sh NAME @@ -171,6 +171,25 @@ utility as follows: .Dl % mkimg -s mbr -b /boot/mbr -p freebsd:-'mkimg -s bsd -b /boot/boot \ -p freebsd-ufs:=root-file-system.ufs -p freebsd-swap::1G' -o mbr-bsd.img .Pp +To accomodate the need to have partitions named or numbered in a certain +way, the +.Nm +utility allows for the specification of empty partitions. +For example, to create an image that is compatible with partition layouts +found in +.Pa /etc/disktab , +the 'd' partition often needs to be skipped. +This is accomplished by inserting an unused partition after the first 2 +partition specifications. +It is worth noting at this time that the BSD scheme will automatically +skip the 'c' partition by virtue of it referring to the entire disk. +To create an image that is compatible with the qp120at disk, use the +.Nm +utility as follows: +.Dl % mkimg -s bsd -b /boot/boot -p freebsd-ufs:=root-file-system.ufs \ +-p freebsd-swap::20M -p- -p- -p- -p- -p freebsd-ufs:=usr-file-system.ufs \ +-o bsd.img +.Pp For partitioning schemes that feature partition labels, the .Nm utility supports assigning labels to the partitions specified. Modified: stable/10/usr.bin/mkimg/mkimg.c ============================================================================== --- stable/10/usr.bin/mkimg/mkimg.c Mon Sep 22 15:08:58 2014 (r271966) +++ stable/10/usr.bin/mkimg/mkimg.c Mon Sep 22 15:22:57 2014 (r271967) @@ -101,6 +101,7 @@ usage(const char *why) "are determined\n\t\t\t\t by the named file\n"); fprintf(stderr, "\t[/]:-\t- partition content and size " "are taken from\n\t\t\t\t the output of the command to run\n"); + fprintf(stderr, "\t-\t\t\t- unused partition entry\n"); fprintf(stderr, "\t where:\n"); fprintf(stderr, "\t\t\t- scheme neutral partition type\n"); fprintf(stderr, "\t\t\t- optional scheme-dependent partition " @@ -140,6 +141,9 @@ pwr_of_two(u_int nr) * '-' contents holds a command to run; the output of * which is the contents of the partition. * contents the specification of a partition's contents + * + * A specification that is a single dash indicates an unused partition + * entry. */ static int parse_part(const char *spec) @@ -149,6 +153,11 @@ parse_part(const char *spec) size_t len; int error; + if (strcmp(spec, "-") == 0) { + nparts++; + return (0); + } + part = calloc(1, sizeof(struct part)); if (part == NULL) return (ENOMEM); From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 15:27:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 947E8109; Mon, 22 Sep 2014 15:27:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EE3E982; Mon, 22 Sep 2014 15:27:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MFROHA052079; Mon, 22 Sep 2014 15:27:24 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MFRO6r052078; Mon, 22 Sep 2014 15:27:24 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409221527.s8MFRO6r052078@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Mon, 22 Sep 2014 15:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271968 - head/usr.bin/mkimg/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 15:27:24 -0000 Author: marcel Date: Mon Sep 22 15:27:23 2014 New Revision: 271968 URL: http://svnweb.freebsd.org/changeset/base/271968 Log: Don't echo '# $FreeBSD$' as the first line into the .uu file. Keyword substitution applies to this file, including the echo command. Avoid the match (and substitution) by breaking the string up into 3 parts. Modified: head/usr.bin/mkimg/tests/mkimg.sh Modified: head/usr.bin/mkimg/tests/mkimg.sh ============================================================================== --- head/usr.bin/mkimg/tests/mkimg.sh Mon Sep 22 15:22:57 2014 (r271967) +++ head/usr.bin/mkimg/tests/mkimg.sh Mon Sep 22 15:27:23 2014 (r271968) @@ -91,7 +91,8 @@ mkimg_test() hexdump -C $image > $result baseline=`atf_get_srcdir`/$image if test "x$mkimg_update_baseline" = "xyes"; then - echo '# $FreeBSD$' > $image.gz.uu + # Prevent keyword expansion when writing the keyword. + (echo -n '# $'; echo -n FreeBSD; echo '$') > $image.gz.uu gzip -c $result | uuencode $image.gz >> $image.gz.uu rm $image $result _tmp-* else From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 15:32:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5CC0493; Mon, 22 Sep 2014 15:32:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B59F3A48; Mon, 22 Sep 2014 15:32:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MFWWT4056411; Mon, 22 Sep 2014 15:32:32 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MFWWLi056409; Mon, 22 Sep 2014 15:32:32 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409221532.s8MFWWLi056409@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 22 Sep 2014 15:32:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271969 - stable/10/sys/dev/altera/atse X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 15:32:33 -0000 Author: bz Date: Mon Sep 22 15:32:31 2014 New Revision: 271969 URL: http://svnweb.freebsd.org/changeset/base/271969 Log: MFC r271679: Merge atse(4) interrupt handling and race condition fixes from cheribsd. Obtained from: cheribsd Submitted by: rwatson, emaste Sponsored by: DARPA/AFRL Approved by: re (delphij) Modified: stable/10/sys/dev/altera/atse/a_api.h stable/10/sys/dev/altera/atse/if_atse.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/altera/atse/a_api.h ============================================================================== --- stable/10/sys/dev/altera/atse/a_api.h Mon Sep 22 15:27:23 2014 (r271968) +++ stable/10/sys/dev/altera/atse/a_api.h Mon Sep 22 15:32:31 2014 (r271969) @@ -69,20 +69,20 @@ #define A_ONCHIP_FIFO_MEM_CORE_STATUS_UNDERFLOW (1<<5) /* Table 16-6. Event Bit Field Descriptions. */ -/* XXX Datasheet has weird bit fields. Validate. */ -#define A_ONCHIP_FIFO_MEM_CORE_EVENT_EMPTY (1<<0) -#define A_ONCHIP_FIFO_MEM_CORE_EVENT_FULL (1<<1) -#define A_ONCHIP_FIFO_MEM_CORE_EVENT_ALMOSTEMPTY (1<<2) -#define A_ONCHIP_FIFO_MEM_CORE_EVENT_ALMOSTFULL (1<<3) +/* XXX Datasheet has incorrect bit fields. Validate. */ +#define A_ONCHIP_FIFO_MEM_CORE_EVENT_FULL (1<<0) +#define A_ONCHIP_FIFO_MEM_CORE_EVENT_EMPTY (1<<1) +#define A_ONCHIP_FIFO_MEM_CORE_EVENT_ALMOSTFULL (1<<2) +#define A_ONCHIP_FIFO_MEM_CORE_EVENT_ALMOSTEMPTY (1<<3) #define A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW (1<<4) #define A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW (1<<5) /* Table 16-7. InterruptEnable Bit Field Descriptions. */ -/* XXX Datasheet has weird bit fields. Validate. */ -#define A_ONCHIP_FIFO_MEM_CORE_INTR_EMPTY (1<<0) -#define A_ONCHIP_FIFO_MEM_CORE_INTR_FULL (1<<1) -#define A_ONCHIP_FIFO_MEM_CORE_INTR_ALMOSTEMPTY (1<<2) -#define A_ONCHIP_FIFO_MEM_CORE_INTR_ALMOSTFULL (1<<3) +/* XXX Datasheet has incorrect bit fields. Validate. */ +#define A_ONCHIP_FIFO_MEM_CORE_INTR_FULL (1<<0) +#define A_ONCHIP_FIFO_MEM_CORE_INTR_EMPTY (1<<1) +#define A_ONCHIP_FIFO_MEM_CORE_INTR_ALMOSTFULL (1<<2) +#define A_ONCHIP_FIFO_MEM_CORE_INTR_ALMOSTEMPTY (1<<3) #define A_ONCHIP_FIFO_MEM_CORE_INTR_OVERFLOW (1<<4) #define A_ONCHIP_FIFO_MEM_CORE_INTR_UNDERFLOW (1<<5) #define A_ONCHIP_FIFO_MEM_CORE_INTR_ALL \ Modified: stable/10/sys/dev/altera/atse/if_atse.c ============================================================================== --- stable/10/sys/dev/altera/atse/if_atse.c Mon Sep 22 15:27:23 2014 (r271968) +++ stable/10/sys/dev/altera/atse/if_atse.c Mon Sep 22 15:32:31 2014 (r271969) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2012,2013 Bjoern A. Zeeb + * Copyright (c) 2014 Robert N. M. Watson * All rights reserved. * * This software was developed by SRI International and the University of @@ -103,6 +104,11 @@ static poll_handler_t atse_poll; static int atse_ethernet_option_bits_flag = ATSE_ETHERNET_OPTION_BITS_UNDEF; static uint8_t atse_ethernet_option_bits[ALTERA_ETHERNET_OPTION_BITS_LEN]; +static int atse_intr_debug_enable = 0; +SYSCTL_INT(_debug, OID_AUTO, atse_intr_debug_enable, CTLFLAG_RW, + &atse_intr_debug_enable, 0, + "Extra debugging output for atse interrupts"); + /* * Softc and critical resource locking. */ @@ -110,6 +116,9 @@ static uint8_t atse_ethernet_option_bits #define ATSE_UNLOCK(_sc) mtx_unlock(&(_sc)->atse_mtx) #define ATSE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->atse_mtx, MA_OWNED) +#define ATSE_TX_PENDING(sc) (sc->atse_tx_m != NULL || \ + !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + #ifdef DEBUG #define DPRINTF(format, ...) printf(format, __VA_ARGS__) #else @@ -169,6 +178,16 @@ a_onchip_fifo_mem_core_read(struct resou A_ONCHIP_FIFO_MEM_CORE_METADATA, \ "RXM", __func__, __LINE__) +#define ATSE_RX_STATUS_READ(sc) \ + a_onchip_fifo_mem_core_read((sc)->atse_rxc_mem_res, \ + A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_I_STATUS, \ + "RX_EVENT", __func__, __LINE__) + +#define ATSE_TX_STATUS_READ(sc) \ + a_onchip_fifo_mem_core_read((sc)->atse_txc_mem_res, \ + A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_I_STATUS, \ + "TX_EVENT", __func__, __LINE__) + #define ATSE_RX_EVENT_READ(sc) \ a_onchip_fifo_mem_core_read((sc)->atse_rxc_mem_res, \ A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_EVENT, \ @@ -208,24 +227,41 @@ a_onchip_fifo_mem_core_read(struct resou val4, "TX_EVENT", __func__, __LINE__); \ } while(0) +#define ATSE_RX_EVENTS (A_ONCHIP_FIFO_MEM_CORE_INTR_FULL | \ + A_ONCHIP_FIFO_MEM_CORE_INTR_OVERFLOW | \ + A_ONCHIP_FIFO_MEM_CORE_INTR_UNDERFLOW) #define ATSE_RX_INTR_ENABLE(sc) \ a_onchip_fifo_mem_core_write((sc)->atse_rxc_mem_res, \ A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, \ - A_ONCHIP_FIFO_MEM_CORE_INTR_ALL, \ + ATSE_RX_EVENTS, \ "RX_INTR", __func__, __LINE__) /* XXX-BZ review later. */ #define ATSE_RX_INTR_DISABLE(sc) \ a_onchip_fifo_mem_core_write((sc)->atse_rxc_mem_res, \ A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, 0, \ "RX_INTR", __func__, __LINE__) +#define ATSE_RX_INTR_READ(sc) \ + a_onchip_fifo_mem_core_read((sc)->atse_rxc_mem_res, \ + A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, \ + "RX_INTR", __func__, __LINE__) + +#define ATSE_TX_EVENTS (A_ONCHIP_FIFO_MEM_CORE_INTR_EMPTY | \ + A_ONCHIP_FIFO_MEM_CORE_INTR_OVERFLOW | \ + A_ONCHIP_FIFO_MEM_CORE_INTR_UNDERFLOW) #define ATSE_TX_INTR_ENABLE(sc) \ a_onchip_fifo_mem_core_write((sc)->atse_txc_mem_res, \ A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, \ - A_ONCHIP_FIFO_MEM_CORE_INTR_ALL, \ + ATSE_TX_EVENTS, \ "TX_INTR", __func__, __LINE__) /* XXX-BZ review later. */ #define ATSE_TX_INTR_DISABLE(sc) \ a_onchip_fifo_mem_core_write((sc)->atse_txc_mem_res, \ A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, 0, \ "TX_INTR", __func__, __LINE__) +#define ATSE_TX_INTR_READ(sc) \ + a_onchip_fifo_mem_core_read((sc)->atse_txc_mem_res, \ + A_ONCHIP_FIFO_MEM_CORE_STATUS_REG_INT_ENABLE, \ + "TX_INTR", __func__, __LINE__) + +static int atse_rx_locked(struct atse_softc *sc); /* * Register space access macros. @@ -985,6 +1021,11 @@ atse_init(void *xsc) { struct atse_softc *sc; + /* + * XXXRW: There is some argument that we should immediately do RX + * processing after enabling interrupts, or one may not fire if there + * are buffered packets. + */ sc = (struct atse_softc *)xsc; ATSE_LOCK(sc); atse_init_locked(sc); @@ -1082,6 +1123,33 @@ atse_ioctl(struct ifnet *ifp, u_long com } static void +atse_intr_debug(struct atse_softc *sc, const char *intrname) +{ + uint32_t rxs, rxe, rxi, rxf, txs, txe, txi, txf; + + if (!atse_intr_debug_enable) + return; + + rxs = ATSE_RX_STATUS_READ(sc); + rxe = ATSE_RX_EVENT_READ(sc); + rxi = ATSE_RX_INTR_READ(sc); + rxf = ATSE_RX_READ_FILL_LEVEL(sc); + + txs = ATSE_TX_STATUS_READ(sc); + txe = ATSE_TX_EVENT_READ(sc); + txi = ATSE_TX_INTR_READ(sc); + txf = ATSE_TX_READ_FILL_LEVEL(sc); + + printf( + "%s - %s: " + "rxs 0x%x rxe 0x%x rxi 0x%x rxf 0x%x " + "txs 0x%x txe 0x%x txi 0x%x txf 0x%x\n", + __func__, intrname, + rxs, rxe, rxi, rxf, + txs, txe, txi, txf); +} + +static void atse_watchdog(struct atse_softc *sc) { @@ -1093,9 +1161,12 @@ atse_watchdog(struct atse_softc *sc) device_printf(sc->atse_dev, "watchdog timeout\n"); sc->atse_ifp->if_oerrors++; + atse_intr_debug(sc, "poll"); + sc->atse_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; atse_init_locked(sc); + atse_rx_locked(sc); if (!IFQ_DRV_IS_EMPTY(&sc->atse_ifp->if_snd)) atse_start_locked(sc->atse_ifp); } @@ -1169,10 +1240,6 @@ atse_rx_locked(struct atse_softc *sc) meta = 0; do { outer: - if (sc->atse_rx_cycles <= 0) - return (rx_npkts); - sc->atse_rx_cycles--; - if (sc->atse_rx_m == NULL) { m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (m == NULL) @@ -1238,7 +1305,8 @@ outer: data = ATSE_RX_DATA_READ(sc); #endif /* Make sure to not overflow the mbuf data size. */ - if (sc->atse_rx_buf_len >= sc->atse_rx_m->m_len - 4) { + if (sc->atse_rx_buf_len >= sc->atse_rx_m->m_len - + sizeof(data)) { /* * XXX-BZ Error. We need more mbufs and are * not setup for this yet. @@ -1275,15 +1343,19 @@ outer: if (sc->atse_flags & ATSE_FLAGS_ERROR) { sc->atse_flags &= ~ATSE_FLAGS_ERROR; m_freem(m); - /* Need to start with a new packet. */ - goto outer; + } else { + m->m_pkthdr.rcvif = ifp; + ATSE_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + ATSE_LOCK(sc); } - - m->m_pkthdr.rcvif = ifp; - - ATSE_UNLOCK(sc); - (*ifp->if_input)(ifp, m); - ATSE_LOCK(sc); +#ifdef DEVICE_POLLING + if (ifp->if_capenable & IFCAP_POLLING) { + if (sc->atse_rx_cycles <= 0) + return (rx_npkts); + sc->atse_rx_cycles--; + } +#endif goto outer; /* Need a new mbuf. */ } else { sc->atse_rx_buf_len += sizeof(data); @@ -1291,7 +1363,7 @@ outer: } /* for */ /* XXX-BZ could optimize in case of another packet waiting. */ - } while ((meta & A_ONCHIP_FIFO_MEM_CORE_EOP) == 0 || fill > 0); + } while (fill > 0); return (rx_npkts); } @@ -1317,11 +1389,11 @@ atse_ifmedia_sts(struct ifnet *ifp, stru } static void -atse_intr(void *arg) +atse_rx_intr(void *arg) { struct atse_softc *sc; struct ifnet *ifp; - uint32_t rx, tx; + uint32_t rxe; sc = (struct atse_softc *)arg; ifp = sc->atse_ifp; @@ -1334,54 +1406,94 @@ atse_intr(void *arg) } #endif - ATSE_RX_INTR_DISABLE(sc); - ATSE_TX_INTR_DISABLE(sc); - - rx = ATSE_RX_EVENT_READ(sc); - tx = ATSE_TX_EVENT_READ(sc); - if (rx != 0) { - if (rx & (A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW| - A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW)) { - /* XXX-BZ ERROR HANDLING. */ - atse_update_rx_err(sc, ((rx & - A_ONCHIP_FIFO_MEM_CORE_ERROR_MASK) >> - A_ONCHIP_FIFO_MEM_CORE_ERROR_SHIFT) & 0xff); - ifp->if_ierrors++; - } - if ((rx & A_ONCHIP_FIFO_MEM_CORE_EVENT_EMPTY) != 0) { - sc->atse_rx_cycles = RX_CYCLES_IN_INTR; - atse_rx_locked(sc); - } + atse_intr_debug(sc, "rx"); + rxe = ATSE_RX_EVENT_READ(sc); + if (rxe & (A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW| + A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW)) { + /* XXX-BZ ERROR HANDLING. */ + atse_update_rx_err(sc, ((rxe & + A_ONCHIP_FIFO_MEM_CORE_ERROR_MASK) >> + A_ONCHIP_FIFO_MEM_CORE_ERROR_SHIFT) & 0xff); + ifp->if_ierrors++; } - if (tx != 0) { - /* XXX-BZ build histogram. */ - if (tx & (A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW| - A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW)) { - /* XXX-BZ ERROR HANDLING. */ - ifp->if_oerrors++; - } - if (tx & A_ONCHIP_FIFO_MEM_CORE_EVENT_EMPTY) - sc->atse_watchdog_timer = 0; + + /* + * There is considerable subtlety in the race-free handling of rx + * interrupts: we must disable interrupts whenever we manipulate the + * FIFO to prevent further interrupts from firing before we are done; + * we must clear the event after processing to prevent the event from + * being immediately reposted due to data remaining; we must clear the + * event mask before reenabling interrupts or risk missing a positive + * edge; and we must recheck everything after completing in case the + * event posted between clearing events and reenabling interrupts. If + * a race is experienced, we must restart the whole mechanism. + */ + do { + ATSE_RX_INTR_DISABLE(sc); #if 0 - if (tx & (A_ONCHIP_FIFO_MEM_CORE_EVENT_EMPTY| - A_ONCHIP_FIFO_MEM_CORE_EVENT_ALMOSTEMPTY)) - atse_start_locked(ifp); + sc->atse_rx_cycles = RX_CYCLES_IN_INTR; #endif - } + atse_rx_locked(sc); + ATSE_RX_EVENT_CLEAR(sc); - /* Clear events before re-enabling intrs. */ - ATSE_TX_EVENT_CLEAR(sc); - ATSE_RX_EVENT_CLEAR(sc); + /* Disable interrupts if interface is down. */ + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + ATSE_RX_INTR_ENABLE(sc); + } while (!(ATSE_RX_STATUS_READ(sc) & + A_ONCHIP_FIFO_MEM_CORE_STATUS_EMPTY)); + ATSE_UNLOCK(sc); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - /* Re-enable interrupts. */ - ATSE_RX_INTR_ENABLE(sc); - ATSE_TX_INTR_ENABLE(sc); +} - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - atse_start_locked(ifp); +static void +atse_tx_intr(void *arg) +{ + struct atse_softc *sc; + struct ifnet *ifp; + uint32_t txe; + + sc = (struct atse_softc *)arg; + ifp = sc->atse_ifp; + + ATSE_LOCK(sc); +#ifdef DEVICE_POLLING + if (ifp->if_capenable & IFCAP_POLLING) { + ATSE_UNLOCK(sc); + return; + } +#endif + + /* XXX-BZ build histogram. */ + atse_intr_debug(sc, "tx"); + txe = ATSE_TX_EVENT_READ(sc); + if (txe & (A_ONCHIP_FIFO_MEM_CORE_EVENT_OVERFLOW| + A_ONCHIP_FIFO_MEM_CORE_EVENT_UNDERFLOW)) { + /* XXX-BZ ERROR HANDLING. */ + ifp->if_oerrors++; } + /* + * There is also considerable subtlety in the race-free handling of + * tx interrupts: all processing occurs with interrupts disabled to + * prevent spurious refiring while transmit is in progress (which + * could occur if the FIFO drains while sending -- quite likely); we + * must not clear the event mask until after we've sent, also to + * prevent spurious refiring; once we've cleared the event mask we can + * reenable interrupts, but there is a possible race between clear and + * enable, so we must recheck and potentially repeat the whole process + * if it is detected. + */ + do { + ATSE_TX_INTR_DISABLE(sc); + sc->atse_watchdog_timer = 0; + atse_start_locked(ifp); + ATSE_TX_EVENT_CLEAR(sc); + + /* Disable interrupts if interface is down. */ + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + ATSE_TX_INTR_ENABLE(sc); + } while (ATSE_TX_PENDING(sc) && + !(ATSE_TX_STATUS_READ(sc) & A_ONCHIP_FIFO_MEM_CORE_STATUS_FULL)); ATSE_UNLOCK(sc); } @@ -1422,7 +1534,7 @@ atse_poll(struct ifnet *ifp, enum poll_c /* XXX-BZ ERROR HANDLING. */ ifp->if_oerrors++; } - if (tx & A_ONCHIP_FIFO_MEM_CORE_EVENT_EMPTY) + if (ATSE_TX_READ_FILL_LEVEL(sc) == 0) sc->atse_watchdog_timer = 0; #if 0 @@ -1719,7 +1831,7 @@ atse_attach(device_t dev) /* Hook up interrupts. */ if (sc->atse_rx_irq_res != NULL) { error = bus_setup_intr(dev, sc->atse_rx_irq_res, INTR_TYPE_NET | - INTR_MPSAFE, NULL, atse_intr, sc, &sc->atse_rx_intrhand); + INTR_MPSAFE, NULL, atse_rx_intr, sc, &sc->atse_rx_intrhand); if (error != 0) { device_printf(dev, "enabling RX IRQ failed\n"); ether_ifdetach(ifp); @@ -1729,7 +1841,7 @@ atse_attach(device_t dev) if (sc->atse_tx_irq_res != NULL) { error = bus_setup_intr(dev, sc->atse_tx_irq_res, INTR_TYPE_NET | - INTR_MPSAFE, NULL, atse_intr, sc, &sc->atse_tx_intrhand); + INTR_MPSAFE, NULL, atse_tx_intr, sc, &sc->atse_tx_intrhand); if (error != 0) { bus_teardown_intr(dev, sc->atse_rx_irq_res, sc->atse_rx_intrhand); From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 16:03:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51DABD8A; Mon, 22 Sep 2014 16:03:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D30FDBE; Mon, 22 Sep 2014 16:03:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MG3UZn070727; Mon, 22 Sep 2014 16:03:30 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MG3UYk070726; Mon, 22 Sep 2014 16:03:30 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201409221603.s8MG3UYk070726@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 22 Sep 2014 16:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271970 - head/contrib/ipfilter/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:03:30 -0000 Author: cy Date: Mon Sep 22 16:03:29 2014 New Revision: 271970 URL: http://svnweb.freebsd.org/changeset/base/271970 Log: ipv6 address for test.hosts.dots in wrong byte order. Approved by: glebius (mentor) Obtained from: ipfilter CVS repo (r1.11), netbsd CVS repo (r1.5) Modified: head/contrib/ipfilter/lib/gethost.c Modified: head/contrib/ipfilter/lib/gethost.c ============================================================================== --- head/contrib/ipfilter/lib/gethost.c Mon Sep 22 15:32:31 2014 (r271969) +++ head/contrib/ipfilter/lib/gethost.c Mon Sep 22 16:03:29 2014 (r271970) @@ -25,10 +25,10 @@ int gethost(family, name, hostp) } #ifdef USE_INET6 if (family == AF_INET6) { - hostp->i6[0] = 0xfe80aa55; - hostp->i6[1] = 0x12345678; - hostp->i6[2] = 0x5a5aa5a5; - hostp->i6[3] = 0xfedcba98; + hostp->i6[0] = htonl(0xfe80aa55); + hostp->i6[1] = htonl(0x12345678); + hostp->i6[2] = htonl(0x5a5aa5a5); + hostp->i6[3] = htonl(0xfedcba98); } #endif return 0; From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 16:04:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DFA0EF4 for ; Mon, 22 Sep 2014 16:04:21 +0000 (UTC) Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0619DD2 for ; Mon, 22 Sep 2014 16:04:20 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id i13so322275qae.6 for ; Mon, 22 Sep 2014 09:04:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=61c778LbHIlRD+9K/PgNZqwbJviN625IIlEo0JtisQc=; b=epxp+AcGgCXYkicXZS0ddIxYNd4oDFyuy57fFc9+QGcT7cpuzJPBSwxs8rUtXWvUBf af+yXvuwd5InKuzXpvu7+wPEDFIqMzIWx2+PSFr3O4q9tr03AYpDppNfhbDeZooX+NSS xq6eqHoPMKkjGjqbdV3vxt3GydFR1akqBJDKoPnAMjCO143ec5ECkEbpfpLLtlJInCKy HRY3Rn6GnzF0OzBwkGgMHYWZ2HSn/5UOu1/Xyzl8aDEV9Qtsj8ewWXVas5o7YhWN+B6t ATMFRJpvwhVr0T5qgPQE2IMNTYMTwyNNz4Oba9SbzLryWHkFJP4mxR7kxeejefIp/YBv 6zDQ== X-Gm-Message-State: ALoCoQkN3mTCBgI1t37rh4ayHarhf+AK0dLfDP7Ctr5ZL6C6oowtz2+sZFtPLtRwQOB9eGaPtcsU MIME-Version: 1.0 X-Received: by 10.140.23.17 with SMTP id 17mr23495361qgo.30.1411398574391; Mon, 22 Sep 2014 08:09:34 -0700 (PDT) Received: by 10.140.16.183 with HTTP; Mon, 22 Sep 2014 08:09:34 -0700 (PDT) In-Reply-To: <20140920172111.Q4941@besplex.bde.org> References: <201409181441.s8IEfvR1075223@svn.freebsd.org> <541D2356.8040403@freebsd.org> <20140920172111.Q4941@besplex.bde.org> Date: Mon, 22 Sep 2014 09:09:34 -0600 Message-ID: Subject: Re: svn commit: r271771 - in head: bin/csh etc/mail lib/libc usr.bin/grep usr.sbin/mtree From: Will Andrews To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "src-committers@FreeBSD.org" , Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:04:21 -0000 On Sat, Sep 20, 2014 at 1:38 AM, Bruce Evans wrote: > The log message is confused. Source files are not being overwritten. > They are being copied to object directories using cp. Then if they > are read-only in the source directory, they are read-only in the object > directory, even if they are copied without -p so as to clobber their > timestamps (their mode is still preserved). Then if the source file's > mtime is changed, either by actually changing the file or just by > clobbering its mtime, the copy in the object directory becomes out of > date. Then the cp to make it up to date fails because it is read-only. Yes, this is the more correct way of explaining the issue. Thanks. > Many makefiles avoid this problem by using cat instead of cp to copy > the files. I prefer using cp -p. The above fixes the problem for > a makefile that uses cp (without -p) by adding -f. This causes the file > to be unlinked before a new copy is made. If the object directory is > in the source tree (most likely since it is the source directory) and > the source files are read-only, then this would often fail because the > source directory is also read-only, but then it can't reasonably be > an object directory. The problem with 'cp -p' is that it doesn't work either. Try it (twice) with a read-only file -- I get EPERM when I try the second time. cp -p also doesn't work with NFS targets if the file happens to have flags. In the case of .CURDIR == .OBJDIR, the file would satisfy the dependency and thus not be overwritten with itself. In any case, this is about read-only *files* anyway, not read-only directories, since as you point out, the latter are unusable as object directories. --Will. From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 16:06:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02545F76; Mon, 22 Sep 2014 16:06:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1B0BDF5; Mon, 22 Sep 2014 16:06:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MG6b0K071213; Mon, 22 Sep 2014 16:06:37 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MG6bbu071212; Mon, 22 Sep 2014 16:06:37 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201409221606.s8MG6bbu071212@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 22 Sep 2014 16:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271971 - head/contrib/ipfilter/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:06:38 -0000 Author: cy Date: Mon Sep 22 16:06:37 2014 New Revision: 271971 URL: http://svnweb.freebsd.org/changeset/base/271971 Log: #553 gethost needs to zero entire IP address structure Approved by: glebius (mentor) Obtained from: ipfilter CVS repo (r1.11) Modified: head/contrib/ipfilter/lib/gethost.c Modified: head/contrib/ipfilter/lib/gethost.c ============================================================================== --- head/contrib/ipfilter/lib/gethost.c Mon Sep 22 16:03:29 2014 (r271970) +++ head/contrib/ipfilter/lib/gethost.c Mon Sep 22 16:06:37 2014 (r271971) @@ -19,6 +19,7 @@ int gethost(family, name, hostp) struct netent *n; u_32_t addr; + bzero(hostp, sizeof(*hostp)); if (!strcmp(name, "test.host.dots")) { if (family == AF_INET) { hostp->in4.s_addr = htonl(0xfedcba98); From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 16:09:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56994244; Mon, 22 Sep 2014 16:09:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41D88E12; Mon, 22 Sep 2014 16:09:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MG9JnW071878; Mon, 22 Sep 2014 16:09:19 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MG9JL9071877; Mon, 22 Sep 2014 16:09:19 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201409221609.s8MG9JL9071877@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 22 Sep 2014 16:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271972 - head/contrib/ipfilter/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:09:19 -0000 Author: cy Date: Mon Sep 22 16:09:18 2014 New Revision: 271972 URL: http://svnweb.freebsd.org/changeset/base/271972 Log: #536 ipnat can try to print rule as dstlist incorrectly Approved by: glebius (mentor) Obtained from: ipfilter CVS repo (r1.14), netbsd CVS repo (r1.3) Modified: head/contrib/ipfilter/lib/printnat.c Modified: head/contrib/ipfilter/lib/printnat.c ============================================================================== --- head/contrib/ipfilter/lib/printnat.c Mon Sep 22 16:06:37 2014 (r271971) +++ head/contrib/ipfilter/lib/printnat.c Mon Sep 22 16:09:18 2014 (r271972) @@ -153,7 +153,8 @@ printnat(np, opts) } else if (np->in_redir & NAT_REWRITE) { PRINTF(" -> src "); - if (np->in_nsrc.na_type == IPLT_DSTLIST) { + if (np->in_nsrc.na_atype == FRI_LOOKUP && + np->in_nsrc.na_type == IPLT_DSTLIST) { PRINTF("dstlist/"); if (np->in_nsrc.na_subtype == 0) PRINTF("%d", np->in_nsrc.na_num); @@ -174,7 +175,8 @@ printnat(np, opts) } } PRINTF(" dst "); - if (np->in_ndst.na_type == IPLT_DSTLIST) { + if (np->in_ndst.na_atype == FRI_LOOKUP && + np->in_ndst.na_type == IPLT_DSTLIST) { PRINTF("dstlist/"); if (np->in_ndst.na_subtype == 0) PRINTF("%d", np->in_nsrc.na_num); From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 16:13:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6237383A; Mon, 22 Sep 2014 16:13:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB80EF5; Mon, 22 Sep 2014 16:13:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MGDYN9076131; Mon, 22 Sep 2014 16:13:34 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MGDXWs076126; Mon, 22 Sep 2014 16:13:33 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201409221613.s8MGDXWs076126@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Mon, 22 Sep 2014 16:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271973 - stable/10/sys/dev/vt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:13:34 -0000 Author: dumbbell Date: Mon Sep 22 16:13:33 2014 New Revision: 271973 URL: http://svnweb.freebsd.org/changeset/base/271973 Log: vt(4): Merge several bug fixes and improvements SVN revisions in this MFC: 271756 271758 271868 271871 271872 271899 Detailed commit list: r271756: vt(4): Fix out-of-bounds array access in VT_ACTIVATE ioctl handling CID: 1229964 r271758 vt(4): Use strncpy() to copy into a fixed-size buffer CID: 1230007 r271868: vt(4): Remove vt_buf->vb_dirtymask This structure and the associated functions were unused since the implementation of vd_bitblt_text_t callbacks. r271871: vt(4): Rewrite history scrolling It's now possible to scroll up the 500 hard-coded lines of history, not just a fraction of them. For instance, one can reach the top of the boot process. Sometimes, when scrolling or when changing the screen size (by changing the font or loading a KMS driver for instance), one could see the history cycling (old content appeared below latest lines). This is fixed. Now, when the resolution changes are more lines can be shown, the displayed area is adjusted so that, if the screen was filled with content before, it's filled with content after as well: more history is visible, instead of having blank lines below the previously visible content. r271872: vt(4): Remove superfluous word in comment Submitted by: brueffer@ r271899: Make gcc happy by initialising the variable only set in a couple of case statements without a default. Approved by: re (marius) Modified: stable/10/sys/dev/vt/vt.h stable/10/sys/dev/vt/vt_buf.c stable/10/sys/dev/vt/vt_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/vt.h ============================================================================== --- stable/10/sys/dev/vt/vt.h Mon Sep 22 16:09:18 2014 (r271972) +++ stable/10/sys/dev/vt/vt.h Mon Sep 22 16:13:33 2014 (r271973) @@ -173,11 +173,6 @@ struct vt_device { * been modified. */ -struct vt_bufmask { - uint64_t vbm_row, vbm_col; -#define VBM_DIRTY UINT64_MAX -}; - struct vt_buf { struct mtx vb_lock; /* Buffer lock. */ term_pos_t vb_scr_size; /* (b) Screen dimensions. */ @@ -196,7 +191,6 @@ struct vt_buf { term_pos_t vb_mark_end; /* (b) Copy region end. */ int vb_mark_last; /* Last mouse event. */ term_rect_t vb_dirtyrect; /* (b) Dirty rectangle. */ - struct vt_bufmask vb_dirtymask; /* (b) Dirty bitmasks. */ term_char_t *vb_buffer; /* (u) Data buffer. */ term_char_t **vb_rows; /* (u) Array of rows */ }; @@ -210,7 +204,7 @@ void vtbuf_putchar(struct vt_buf *, cons void vtbuf_cursor_position(struct vt_buf *, const term_pos_t *); void vtbuf_scroll_mode(struct vt_buf *vb, int yes); void vtbuf_dirty(struct vt_buf *vb, const term_rect_t *area); -void vtbuf_undirty(struct vt_buf *, term_rect_t *, struct vt_bufmask *); +void vtbuf_undirty(struct vt_buf *, term_rect_t *); void vtbuf_sethistory_size(struct vt_buf *, int); int vtbuf_iscursor(const struct vt_buf *vb, int row, int col); void vtbuf_cursor_visibility(struct vt_buf *, int); Modified: stable/10/sys/dev/vt/vt_buf.c ============================================================================== --- stable/10/sys/dev/vt/vt_buf.c Mon Sep 22 16:09:18 2014 (r271972) +++ stable/10/sys/dev/vt/vt_buf.c Mon Sep 22 16:13:33 2014 (r271973) @@ -76,44 +76,47 @@ vthistory_seek(struct vt_buf *vb, int of } return (0); /* No changes */ } - top = (vb->vb_flags & VBF_HISTORY_FULL)? - (vb->vb_curroffset + vb->vb_scr_size.tp_row):vb->vb_history_size; - bottom = vb->vb_curroffset + vb->vb_history_size; - /* - * Operate on copy of offset value, since it temporary can be bigger - * than amount of rows in buffer. - */ - roffset = vb->vb_roffset + vb->vb_history_size; + /* "top" may be a negative integer. */ + bottom = vb->vb_curroffset; + top = (vb->vb_flags & VBF_HISTORY_FULL) ? + bottom + vb->vb_scr_size.tp_row - vb->vb_history_size : + 0; + + roffset = 0; /* Make gcc happy. */ switch (whence) { case VHS_SET: - roffset = offset + vb->vb_history_size; + if (offset < 0) + offset = 0; + roffset = top + offset; break; case VHS_CUR: + /* + * Operate on copy of offset value, since it temporary + * can be bigger than amount of rows in buffer. + */ + roffset = vb->vb_roffset; + if (roffset >= bottom + vb->vb_scr_size.tp_row) + roffset -= vb->vb_history_size; + roffset += offset; + roffset = MAX(roffset, top); + roffset = MIN(roffset, bottom); + + if (roffset < 0) + roffset = vb->vb_history_size + roffset; + break; case VHS_END: /* Go to current offset. */ - roffset = vb->vb_curroffset + vb->vb_history_size; + roffset = vb->vb_curroffset; break; } - roffset = (roffset < top)?top:roffset; - roffset = (roffset > bottom)?bottom:roffset; + diff = vb->vb_roffset != roffset; + vb->vb_roffset = roffset; - roffset %= vb->vb_history_size; - - if (vb->vb_roffset != roffset) { - diff = vb->vb_roffset - roffset; - vb->vb_roffset = roffset; - /* - * Offset changed, please update Nth lines on sceen. - * +N - Nth lines at top; - * -N - Nth lines at bottom. - */ - return (diff); - } - return (0); /* No changes */ + return (diff); } void @@ -123,6 +126,8 @@ vthistory_addlines(struct vt_buf *vb, in vb->vb_curroffset += offset; if (vb->vb_curroffset < 0) vb->vb_curroffset = 0; + if (vb->vb_curroffset + vb->vb_scr_size.tp_row >= vb->vb_history_size) + vb->vb_flags |= VBF_HISTORY_FULL; vb->vb_curroffset %= vb->vb_history_size; if ((vb->vb_flags & VBF_SCROLL) == 0) { vb->vb_roffset = vb->vb_curroffset; @@ -195,39 +200,6 @@ vtbuf_iscursor(const struct vt_buf *vb, return (0); } -static inline uint64_t -vtbuf_dirty_axis(unsigned int begin, unsigned int end) -{ - uint64_t left, right, mask; - - /* - * Mark all bits between begin % 64 and end % 64 dirty. - * This code is functionally equivalent to: - * - * for (i = begin; i < end; i++) - * mask |= (uint64_t)1 << (i % 64); - */ - - /* Obvious case. Mark everything dirty. */ - if (end - begin >= 64) - return (VBM_DIRTY); - - /* 1....0; used bits on the left. */ - left = VBM_DIRTY << begin % 64; - /* 0....1; used bits on the right. */ - right = VBM_DIRTY >> -end % 64; - - /* - * Only take the intersection. If the result of that is 0, it - * means that the selection crossed a 64 bit boundary along the - * way, which means we have to take the complement. - */ - mask = left & right; - if (mask == 0) - mask = left | right; - return (mask); -} - static inline void vtbuf_dirty_locked(struct vt_buf *vb, const term_rect_t *area) { @@ -240,10 +212,6 @@ vtbuf_dirty_locked(struct vt_buf *vb, co vb->vb_dirtyrect.tr_end.tp_row = area->tr_end.tp_row; if (vb->vb_dirtyrect.tr_end.tp_col < area->tr_end.tp_col) vb->vb_dirtyrect.tr_end.tp_col = area->tr_end.tp_col; - vb->vb_dirtymask.vbm_row |= - vtbuf_dirty_axis(area->tr_begin.tp_row, area->tr_end.tp_row); - vb->vb_dirtymask.vbm_col |= - vtbuf_dirty_axis(area->tr_begin.tp_col, area->tr_end.tp_col); } void @@ -272,16 +240,14 @@ vtbuf_make_undirty(struct vt_buf *vb) vb->vb_dirtyrect.tr_begin = vb->vb_scr_size; vb->vb_dirtyrect.tr_end.tp_row = vb->vb_dirtyrect.tr_end.tp_col = 0; - vb->vb_dirtymask.vbm_row = vb->vb_dirtymask.vbm_col = 0; } void -vtbuf_undirty(struct vt_buf *vb, term_rect_t *r, struct vt_bufmask *m) +vtbuf_undirty(struct vt_buf *vb, term_rect_t *r) { VTBUF_LOCK(vb); *r = vb->vb_dirtyrect; - *m = vb->vb_dirtymask; vtbuf_make_undirty(vb); VTBUF_UNLOCK(vb); } @@ -453,71 +419,155 @@ vtbuf_sethistory_size(struct vt_buf *vb, void vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, unsigned int history_size) { - term_char_t *old, *new, **rows, **oldrows, **copyrows, *row; - int bufsize, rowssize, w, h, c, r; + term_char_t *old, *new, **rows, **oldrows, **copyrows, *row, *oldrow; + int bufsize, rowssize, w, h, c, r, history_was_full; + unsigned int old_history_size; term_rect_t rect; history_size = MAX(history_size, p->tp_row); - /* If new screen/history size bigger or buffer is VBF_STATIC. */ - if ((history_size > vb->vb_history_size) || (p->tp_col > - vb->vb_scr_size.tp_col) || (vb->vb_flags & VBF_STATIC)) { - /* Allocate new buffer. */ - bufsize = history_size * p->tp_col * sizeof(term_char_t); - new = malloc(bufsize, M_VTBUF, M_WAITOK | M_ZERO); - rowssize = history_size * sizeof(term_pos_t *); - rows = malloc(rowssize, M_VTBUF, M_WAITOK | M_ZERO); + /* Allocate new buffer. */ + bufsize = history_size * p->tp_col * sizeof(term_char_t); + new = malloc(bufsize, M_VTBUF, M_WAITOK | M_ZERO); + rowssize = history_size * sizeof(term_pos_t *); + rows = malloc(rowssize, M_VTBUF, M_WAITOK | M_ZERO); - /* Toggle it. */ - VTBUF_LOCK(vb); - old = vb->vb_flags & VBF_STATIC ? NULL : vb->vb_buffer; - oldrows = vb->vb_flags & VBF_STATIC ? NULL : vb->vb_rows; - copyrows = vb->vb_rows; - w = vb->vb_scr_size.tp_col; - h = vb->vb_history_size; - - vb->vb_history_size = history_size; - vb->vb_buffer = new; - vb->vb_rows = rows; - vb->vb_flags &= ~VBF_STATIC; - vb->vb_scr_size = *p; - vtbuf_init_rows(vb); + /* Toggle it. */ + VTBUF_LOCK(vb); + old = vb->vb_flags & VBF_STATIC ? NULL : vb->vb_buffer; + oldrows = vb->vb_flags & VBF_STATIC ? NULL : vb->vb_rows; + copyrows = vb->vb_rows; + + w = vb->vb_scr_size.tp_col; + h = vb->vb_scr_size.tp_row; + old_history_size = vb->vb_history_size; + history_was_full = vb->vb_flags & VBF_HISTORY_FULL; + + vb->vb_history_size = history_size; + vb->vb_buffer = new; + vb->vb_rows = rows; + vb->vb_flags &= ~VBF_STATIC; + vb->vb_scr_size = *p; + vtbuf_init_rows(vb); + + /* Copy history and fill extra space if needed. */ + if (history_size > old_history_size) { + /* + * Copy rows to the new buffer. The first row in the history + * is back to index 0, ie. the new buffer doesn't cycle. + * + * The rest of the new buffer is initialized with blank + * content. + */ + for (r = 0; r < old_history_size; r ++) { + row = rows[r]; + + /* Compute the corresponding row in the old buffer. */ + if (history_was_full) + /* + * The buffer is full, the "top" row is + * the one just after the viewable area + * (curroffset + viewable height) in the + * cycling buffer. The corresponding row + * is computed from this top row. + */ + oldrow = copyrows[ + (vb->vb_curroffset + h + r) % + old_history_size]; + else + /* + * The buffer is not full, therefore, + * we didn't cycle already. The + * corresponding rows are the same in + * both buffers. + */ + oldrow = copyrows[r]; + + memmove(row, oldrow, + MIN(p->tp_col, w) * sizeof(term_char_t)); - /* Copy history and fill extra space. */ - for (r = 0; r < history_size; r ++) { /* * XXX VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR) will * extended lines of kernel text using the wrong * background color. */ - row = rows[r]; - if (r < h) { /* Copy. */ - memmove(rows[r], copyrows[r], - MIN(p->tp_col, w) * sizeof(term_char_t)); - for (c = MIN(p->tp_col, w); c < p->tp_col; - c++) { - row[c] = VTBUF_SPACE_CHAR( - TERMINAL_NORM_ATTR); - } - } else { /* Just fill. */ - rect.tr_begin.tp_col = 0; - rect.tr_begin.tp_row = r; - rect.tr_end.tp_col = p->tp_col; - rect.tr_end.tp_row = p->tp_row; - vtbuf_fill(vb, &rect, - VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR)); - break; + for (c = MIN(p->tp_col, w); c < p->tp_col; c++) { + row[c] = VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR); } } - vtbuf_make_undirty(vb); - VTBUF_UNLOCK(vb); - /* Deallocate old buffer. */ - free(old, M_VTBUF); - free(oldrows, M_VTBUF); + + /* Fill remaining rows. */ + rect.tr_begin.tp_col = 0; + rect.tr_begin.tp_row = old_history_size; + rect.tr_end.tp_col = p->tp_col; + rect.tr_end.tp_row = p->tp_row; + vtbuf_fill(vb, &rect, VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR)); + + vb->vb_flags &= ~VBF_HISTORY_FULL; } else { - /* Just update the size. */ - vb->vb_scr_size = *p; + /* + * Copy rows to the new buffer. The first row in the history + * is back to index 0, ie. the new buffer doesn't cycle. + * + * (old_history_size - history_size) lines of history are + * dropped. + */ + for (r = 0; r < history_size; r ++) { + row = rows[r]; + + /* + * Compute the corresponding row in the old buffer. + * + * See the equivalent if{} block above for an + * explanation. + */ + if (history_was_full) + oldrow = copyrows[ + (vb->vb_curroffset + h + r + + (old_history_size - history_size)) % + old_history_size]; + else + oldrow = copyrows[ + (r + (old_history_size - history_size)) % + old_history_size]; + + memmove(row, oldrow, + MIN(p->tp_col, w) * sizeof(term_char_t)); + + /* + * XXX VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR) will + * extended lines of kernel text using the wrong + * background color. + */ + for (c = MIN(p->tp_col, w); c < p->tp_col; c++) { + row[c] = VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR); + } + } + + if (!history_was_full && + (vb->vb_curroffset + h) >= history_size) + vb->vb_flags |= VBF_HISTORY_FULL; + } + + /* + * If the screen is already filled (there are non-visible lines + * above the current viewable area), adjust curroffset to the + * new viewable area. + */ + if (!history_was_full && vb->vb_curroffset > 0) { + vb->vb_curroffset = vb->vb_curroffset + h - p->tp_row; + if (vb->vb_curroffset < 0) + vb->vb_curroffset += vb->vb_history_size; + vb->vb_curroffset %= vb->vb_history_size; + vb->vb_roffset = vb->vb_curroffset; } + + vtbuf_make_undirty(vb); + VTBUF_UNLOCK(vb); + + /* Deallocate old buffer. */ + free(old, M_VTBUF); + free(oldrows, M_VTBUF); } void Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Mon Sep 22 16:09:18 2014 (r271972) +++ stable/10/sys/dev/vt/vt_core.c Mon Sep 22 16:13:33 2014 (r271973) @@ -484,18 +484,8 @@ vt_scroll(struct vt_window *vw, int offs vt_termsize(vw->vw_device, vw->vw_font, &size); diff = vthistory_seek(&vw->vw_buf, offset, whence); - /* - * Offset changed, please update Nth lines on screen. - * +N - Nth lines at top; - * -N - Nth lines at bottom. - */ - - if (diff < -size.tp_row || diff > size.tp_row) { + if (diff) vw->vw_device->vd_flags |= VDF_INVALID; - vt_resume_flush_timer(vw->vw_device, 0); - return; - } - vw->vw_device->vd_flags |= VDF_INVALID; /*XXX*/ vt_resume_flush_timer(vw->vw_device, 0); } @@ -796,7 +786,8 @@ vt_allocate_keyboard(struct vt_device *v continue; bzero(&ki, sizeof(ki)); - strcpy(ki.kb_name, k->kb_name); + strncpy(ki.kb_name, k->kb_name, sizeof(ki.kb_name)); + ki.kb_name[sizeof(ki.kb_name) - 1] = '\0'; ki.kb_unit = k->kb_unit; kbdd_ioctl(k0, KBADDKBD, (caddr_t) &ki); @@ -991,7 +982,6 @@ vt_flush(struct vt_device *vd) { struct vt_window *vw; struct vt_font *vf; - struct vt_bufmask tmask; term_rect_t tarea; term_pos_t size; #ifndef SC_NO_CUTPASTE @@ -1047,14 +1037,13 @@ vt_flush(struct vt_device *vd) vt_mark_mouse_position_as_dirty(vd); #endif - vtbuf_undirty(&vw->vw_buf, &tarea, &tmask); + vtbuf_undirty(&vw->vw_buf, &tarea); vt_termsize(vd, vf, &size); /* Force a full redraw when the screen contents are invalid. */ if (vd->vd_flags & VDF_INVALID) { tarea.tr_begin.tp_row = tarea.tr_begin.tp_col = 0; tarea.tr_end = size; - tmask.vbm_row = tmask.vbm_col = VBM_DIRTY; vd->vd_flags &= ~VDF_INVALID; } @@ -1182,6 +1171,13 @@ vtterm_cnprobe(struct terminal *tm, stru vt_compute_drawable_area(vw); } + /* + * The original screen size was faked (_VTDEFW x _VTDEFH). Now + * that we have the real viewable size, fix it in the static + * buffer. + */ + vt_termsize(vd, vw->vw_font, &vw->vw_buf.vb_scr_size); + vtbuf_init_early(&vw->vw_buf); vt_winsize(vd, vw->vw_font, &wsz); c = (boothowto & RB_MUTE) == 0 ? TERMINAL_KERN_ATTR : @@ -2131,7 +2127,7 @@ skip_thunk: win = *(int *)data - 1; DPRINTF(5, "%s%d: VT_ACTIVATE ttyv%d ", SC_DRIVER_NAME, VT_UNIT(vw), win); - if ((win > VT_MAXWINDOWS) || (win < 0)) + if ((win >= VT_MAXWINDOWS) || (win < 0)) return (EINVAL); return (vt_proc_window_switch(vd->vd_windows[win])); } From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 16:13:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D928922; Mon, 22 Sep 2014 16:13:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E0A3EF6; Mon, 22 Sep 2014 16:13:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MGDcIL076184; Mon, 22 Sep 2014 16:13:38 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MGDcFo076183; Mon, 22 Sep 2014 16:13:38 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201409221613.s8MGDcFo076183@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 22 Sep 2014 16:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271974 - head/contrib/ipfilter/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:13:39 -0000 Author: cy Date: Mon Sep 22 16:13:38 2014 New Revision: 271974 URL: http://svnweb.freebsd.org/changeset/base/271974 Log: #551 ipf.conf address structure not properly zero filled Approved by: glebius (mentor) Obtained from: ipfilter CVS repo (r1.37), netbsd CVS repo (r1.3) Modified: head/contrib/ipfilter/tools/ipf_y.y Modified: head/contrib/ipfilter/tools/ipf_y.y ============================================================================== --- head/contrib/ipfilter/tools/ipf_y.y Mon Sep 22 16:13:33 2014 (r271973) +++ head/contrib/ipfilter/tools/ipf_y.y Mon Sep 22 16:13:38 2014 (r271974) @@ -1020,12 +1020,13 @@ addr: pool '/' YY_NUMBER { pooled = 1; yyexpectaddr = 0; } ; -ipaddr: IPFY_ANY { bzero(&($$), sizeof($$)); +ipaddr: IPFY_ANY { memset(&($$), 0, sizeof($$)); $$.type = FRI_NORMAL; $$.ifpos = -1; yyexpectaddr = 0; } - | hostname { $$.a = $1.adr; + | hostname { memset(&($$), 0, sizeof($$)); + $$.a = $1.adr; $$.f = $1.f; if ($1.f == AF_INET6) fill6bits(128, $$.m.i6); @@ -1038,7 +1039,8 @@ ipaddr: IPFY_ANY { bzero(&($$), sizeof | hostname { yyresetdict(); } maskspace { yysetdict(maskwords); yyexpectaddr = 2; } - ipmask { ntomask($1.f, $5, $$.m.i6); + ipmask { memset(&($$), 0, sizeof($$)); + ntomask($1.f, $5, $$.m.i6); $$.a = $1.adr; $$.a.i6[0] &= $$.m.i6[0]; $$.a.i6[1] &= $$.m.i6[1]; @@ -1060,7 +1062,8 @@ ipaddr: IPFY_ANY { bzero(&($$), sizeof yyresetdict(); yyexpectaddr = 0; } - | '(' YY_STR ')' { $$.type = FRI_DYNAMIC; + | '(' YY_STR ')' { memset(&($$), 0, sizeof($$)); + $$.type = FRI_DYNAMIC; ifpflag = FRI_DYNAMIC; $$.ifpos = addname(&fr, $2); $$.lif = 0; @@ -1068,7 +1071,8 @@ ipaddr: IPFY_ANY { bzero(&($$), sizeof | '(' YY_STR ')' '/' { ifpflag = FRI_DYNAMIC; yysetdict(maskwords); } maskopts - { $$.type = ifpflag; + { memset(&($$), 0, sizeof($$)); + $$.type = ifpflag; $$.ifpos = addname(&fr, $2); $$.lif = 0; if (frc->fr_family == AF_UNSPEC) @@ -1083,7 +1087,8 @@ ipaddr: IPFY_ANY { bzero(&($$), sizeof | '(' YY_STR ':' YY_NUMBER ')' '/' { ifpflag = FRI_DYNAMIC; yysetdict(maskwords); } maskopts - { $$.type = ifpflag; + { memset(&($$), 0, sizeof($$)); + $$.type = ifpflag; $$.ifpos = addname(&fr, $2); $$.lif = $4; if (frc->fr_family == AF_UNSPEC) @@ -1142,30 +1147,35 @@ maskopts: ; hostname: - ipv4 { $$.adr.in4 = $1; + ipv4 { memset(&($$), 0, sizeof($$)); + $$.adr.in4 = $1; if (frc->fr_family == AF_INET6) YYERROR; $$.f = AF_INET; yyexpectaddr = 2; } - | YY_NUMBER { if (frc->fr_family == AF_INET6) + | YY_NUMBER { memset(&($$), 0, sizeof($$)); + if (frc->fr_family == AF_INET6) YYERROR; $$.adr.in4_addr = $1; $$.f = AF_INET; yyexpectaddr = 2; } - | YY_HEX { if (frc->fr_family == AF_INET6) + | YY_HEX { memset(&($$), 0, sizeof($$)); + if (frc->fr_family == AF_INET6) YYERROR; $$.adr.in4_addr = $1; $$.f = AF_INET; yyexpectaddr = 2; } - | YY_STR { if (lookuphost($1, &$$.adr) == 0) + | YY_STR { memset(&($$), 0, sizeof($$)); + if (lookuphost($1, &$$.adr) == 0) $$.f = AF_INET; free($1); yyexpectaddr = 2; } - | YY_IPV6 { if (frc->fr_family == AF_INET) + | YY_IPV6 { memset(&($$), 0, sizeof($$)); + if (frc->fr_family == AF_INET) YYERROR; $$.adr = $1; $$.f = AF_INET6; From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 16:20:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 780F6D00; Mon, 22 Sep 2014 16:20:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6248AFFD; Mon, 22 Sep 2014 16:20:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MGKdP7077913; Mon, 22 Sep 2014 16:20:39 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MGKdmx077911; Mon, 22 Sep 2014 16:20:39 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201409221620.s8MGKdmx077911@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Mon, 22 Sep 2014 16:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271975 - head/sys/dev/asmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:20:39 -0000 Author: rpaulo Date: Mon Sep 22 16:20:38 2014 New Revision: 271975 URL: http://svnweb.freebsd.org/changeset/base/271975 Log: Improvements to asmc(4): 1. changed the code so that 2**16 keys are supported 2. changed the number of possible fans in a system from 2 to 6 3. added write support for some fan sysctls 4. added a new sysctl which shows the ID of the fan 5. added four more apple models with their temperature keys 6. changed the maxnumber of temperature keys from 36 to 80 7. replaced several fixed buf sizes to sizeof buf Obtained from: Denis Ahrens denis at h3q.com MFC after: 4 weeks Modified: head/sys/dev/asmc/asmc.c head/sys/dev/asmc/asmcvar.h Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Mon Sep 22 16:13:38 2014 (r271974) +++ head/sys/dev/asmc/asmc.c Mon Sep 22 16:20:38 2014 (r271975) @@ -77,6 +77,7 @@ static int asmc_key_read(device_t dev, uint8_t); static int asmc_fan_count(device_t dev); static int asmc_fan_getvalue(device_t dev, const char *key, int fan); +static int asmc_fan_setvalue(device_t dev, const char *key, int fan, int speed); static int asmc_temp_getvalue(device_t dev, const char *key); static int asmc_sms_read(device_t, const char *key, int16_t *val); static void asmc_sms_calibrate(device_t dev); @@ -94,6 +95,7 @@ static int asmc_key_dump(device_t, int); /* * Model functions. */ +static int asmc_mb_sysctl_fanid(SYSCTL_HANDLER_ARGS); static int asmc_mb_sysctl_fanspeed(SYSCTL_HANDLER_ARGS); static int asmc_mb_sysctl_fansafespeed(SYSCTL_HANDLER_ARGS); static int asmc_mb_sysctl_fanminspeed(SYSCTL_HANDLER_ARGS); @@ -115,6 +117,7 @@ struct asmc_model { int (*smc_sms_x)(SYSCTL_HANDLER_ARGS); int (*smc_sms_y)(SYSCTL_HANDLER_ARGS); int (*smc_sms_z)(SYSCTL_HANDLER_ARGS); + int (*smc_fan_id)(SYSCTL_HANDLER_ARGS); int (*smc_fan_speed)(SYSCTL_HANDLER_ARGS); int (*smc_fan_safespeed)(SYSCTL_HANDLER_ARGS); int (*smc_fan_minspeed)(SYSCTL_HANDLER_ARGS); @@ -134,7 +137,7 @@ static struct asmc_model *asmc_match(dev #define ASMC_SMS_FUNCS asmc_mb_sysctl_sms_x, asmc_mb_sysctl_sms_y, \ asmc_mb_sysctl_sms_z -#define ASMC_FAN_FUNCS asmc_mb_sysctl_fanspeed, asmc_mb_sysctl_fansafespeed, \ +#define ASMC_FAN_FUNCS asmc_mb_sysctl_fanid, asmc_mb_sysctl_fanspeed, asmc_mb_sysctl_fansafespeed, \ asmc_mb_sysctl_fanminspeed, \ asmc_mb_sysctl_fanmaxspeed, \ asmc_mb_sysctl_fantargetspeed @@ -196,6 +199,18 @@ struct asmc_model asmc_models[] = { ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, ASMC_MBP4_TEMPS, ASMC_MBP4_TEMPNAMES, ASMC_MBP4_TEMPDESCS }, + + { + "MacBookPro8,2", "Apple SMC MacBook Pro (early 2011)", + ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, + ASMC_MBP8_TEMPS, ASMC_MBP8_TEMPNAMES, ASMC_MBP8_TEMPDESCS + }, + + { + "MacBookPro11,3", "Apple SMC MacBook Pro Retina Core i7 (2013/2014)", + ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, + ASMC_MBP11_TEMPS, ASMC_MBP11_TEMPNAMES, ASMC_MBP11_TEMPDESCS + }, /* The Mac Mini has no SMS */ { @@ -224,12 +239,27 @@ struct asmc_model asmc_models[] = { ASMC_MP_TEMPS, ASMC_MP_TEMPNAMES, ASMC_MP_TEMPDESCS }, + /* Idem for the MacPro 2010*/ + { + "MacPro5,1", "Apple SMC MacPro (2010)", + NULL, NULL, NULL, + ASMC_FAN_FUNCS, + NULL, NULL, NULL, + ASMC_MP5_TEMPS, ASMC_MP5_TEMPNAMES, ASMC_MP5_TEMPDESCS + }, + { "MacBookAir1,1", "Apple SMC MacBook Air", ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, NULL, NULL, NULL, ASMC_MBA_TEMPS, ASMC_MBA_TEMPNAMES, ASMC_MBA_TEMPDESCS }, + { + "MacBookAir3,1", "Apple SMC MacBook Air Core 2 Duo (Late 2010)", + ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, NULL, NULL, NULL, + ASMC_MBA3_TEMPS, ASMC_MBA3_TEMPNAMES, ASMC_MBA3_TEMPDESCS + }, + { NULL, NULL } }; @@ -361,6 +391,12 @@ asmc_attach(device_t dev) SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_fan_tree[i]), + OID_AUTO, "id", CTLTYPE_STRING | CTLFLAG_RD, + dev, j, model->smc_fan_id, "I", + "Fan ID"); + + SYSCTL_ADD_PROC(sysctlctx, + SYSCTL_CHILDREN(sc->sc_fan_tree[i]), OID_AUTO, "speed", CTLTYPE_INT | CTLFLAG_RD, dev, j, model->smc_fan_speed, "I", "Fan speed in RPM"); @@ -375,21 +411,21 @@ asmc_attach(device_t dev) SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_fan_tree[i]), OID_AUTO, "minspeed", - CTLTYPE_INT | CTLFLAG_RD, + CTLTYPE_INT | CTLFLAG_RW, dev, j, model->smc_fan_minspeed, "I", "Fan minimum speed in RPM"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_fan_tree[i]), OID_AUTO, "maxspeed", - CTLTYPE_INT | CTLFLAG_RD, + CTLTYPE_INT | CTLFLAG_RW, dev, j, model->smc_fan_maxspeed, "I", "Fan maximum speed in RPM"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_fan_tree[i]), OID_AUTO, "targetspeed", - CTLTYPE_INT | CTLFLAG_RD, + CTLTYPE_INT | CTLFLAG_RW, dev, j, model->smc_fan_targetspeed, "I", "Fan target speed in RPM"); } @@ -641,11 +677,10 @@ nosms: if (bootverbose) { /* - * XXX: The number of keys is a 32 bit buffer, but - * right now Apple only uses the last 8 bit. + * The number of keys is a 32 bit buffer */ asmc_key_read(dev, ASMC_NKEYS, buf, 4); - device_printf(dev, "number of keys: %d\n", buf[3]); + device_printf(dev, "number of keys: %d\n", ntohl(*(uint32_t*)buf)); } #ifdef DEBUG @@ -906,7 +941,7 @@ asmc_fan_count(device_t dev) { uint8_t buf[1]; - if (asmc_key_read(dev, ASMC_KEY_FANCOUNT, buf, 1) < 0) + if (asmc_key_read(dev, ASMC_KEY_FANCOUNT, buf, sizeof buf) < 0) return (-1); return (buf[0]); @@ -920,13 +955,46 @@ asmc_fan_getvalue(device_t dev, const ch char fankey[5]; snprintf(fankey, sizeof(fankey), key, fan); - if (asmc_key_read(dev, fankey, buf, 2) < 0) + if (asmc_key_read(dev, fankey, buf, sizeof buf) < 0) return (-1); speed = (buf[0] << 6) | (buf[1] >> 2); return (speed); } +static char* +asmc_fan_getstring(device_t dev, const char *key, int fan) +{ + uint8_t buf[16]; + char fankey[5]; + char* desc; + + snprintf(fankey, sizeof(fankey), key, fan); + if (asmc_key_read(dev, fankey, buf, sizeof buf) < 0) + return (NULL); + desc = buf+4; + + return (desc); +} + +static int +asmc_fan_setvalue(device_t dev, const char *key, int fan, int speed) +{ + uint8_t buf[2]; + char fankey[5]; + + speed *= 4; + + buf[0] = speed>>8; + buf[1] = speed; + + snprintf(fankey, sizeof(fankey), key, fan); + if (asmc_key_write(dev, fankey, buf, sizeof buf) < 0) + return (-1); + + return (0); +} + static int asmc_mb_sysctl_fanspeed(SYSCTL_HANDLER_ARGS) { @@ -942,6 +1010,22 @@ asmc_mb_sysctl_fanspeed(SYSCTL_HANDLER_A } static int +asmc_mb_sysctl_fanid(SYSCTL_HANDLER_ARGS) +{ + device_t dev = (device_t) arg1; + int fan = arg2; + int error = true; + char* desc; + + desc = asmc_fan_getstring(dev, ASMC_KEY_FANID, fan); + + if (desc != NULL) + error = sysctl_handle_string(oidp, desc, 0, req); + + return (error); +} + +static int asmc_mb_sysctl_fansafespeed(SYSCTL_HANDLER_ARGS) { device_t dev = (device_t) arg1; @@ -967,6 +1051,11 @@ asmc_mb_sysctl_fanminspeed(SYSCTL_HANDLE v = asmc_fan_getvalue(dev, ASMC_KEY_FANMINSPEED, fan); error = sysctl_handle_int(oidp, &v, 0, req); + if (error == 0 && req->newptr != NULL) { + unsigned int newspeed = *(unsigned int *)req->newptr; + asmc_fan_setvalue(dev, ASMC_KEY_FANMINSPEED, fan, newspeed); + } + return (error); } @@ -981,6 +1070,11 @@ asmc_mb_sysctl_fanmaxspeed(SYSCTL_HANDLE v = asmc_fan_getvalue(dev, ASMC_KEY_FANMAXSPEED, fan); error = sysctl_handle_int(oidp, &v, 0, req); + if (error == 0 && req->newptr != NULL) { + unsigned int newspeed = *(unsigned int *)req->newptr; + asmc_fan_setvalue(dev, ASMC_KEY_FANMAXSPEED, fan, newspeed); + } + return (error); } @@ -995,6 +1089,11 @@ asmc_mb_sysctl_fantargetspeed(SYSCTL_HAN v = asmc_fan_getvalue(dev, ASMC_KEY_FANTARGETSPEED, fan); error = sysctl_handle_int(oidp, &v, 0, req); + if (error == 0 && req->newptr != NULL) { + unsigned int newspeed = *(unsigned int *)req->newptr; + asmc_fan_setvalue(dev, ASMC_KEY_FANTARGETSPEED, fan, newspeed); + } + return (error); } @@ -1009,7 +1108,7 @@ asmc_temp_getvalue(device_t dev, const c /* * Check for invalid temperatures. */ - if (asmc_key_read(dev, key, buf, 2) < 0) + if (asmc_key_read(dev, key, buf, sizeof buf) < 0) return (-1); return (buf[0]); @@ -1042,7 +1141,7 @@ asmc_sms_read(device_t dev, const char * case 'X': case 'Y': case 'Z': - error = asmc_key_read(dev, key, buf, 2); + error = asmc_key_read(dev, key, buf, sizeof buf); break; default: device_printf(dev, "%s called with invalid argument %s\n", @@ -1197,7 +1296,7 @@ asmc_mbp_sysctl_light_left(SYSCTL_HANDLE int error; int32_t v; - asmc_key_read(dev, ASMC_KEY_LIGHTLEFT, buf, 6); + asmc_key_read(dev, ASMC_KEY_LIGHTLEFT, buf, sizeof buf); v = buf[2]; error = sysctl_handle_int(oidp, &v, sizeof(v), req); @@ -1212,7 +1311,7 @@ asmc_mbp_sysctl_light_right(SYSCTL_HANDL int error; int32_t v; - asmc_key_read(dev, ASMC_KEY_LIGHTRIGHT, buf, 6); + asmc_key_read(dev, ASMC_KEY_LIGHTRIGHT, buf, sizeof buf); v = buf[2]; error = sysctl_handle_int(oidp, &v, sizeof(v), req); @@ -1236,7 +1335,7 @@ asmc_mbp_sysctl_light_control(SYSCTL_HAN v = level; buf[0] = level; buf[1] = 0x00; - asmc_key_write(dev, ASMC_KEY_LIGHTVALUE, buf, 2); + asmc_key_write(dev, ASMC_KEY_LIGHTVALUE, buf, sizeof buf); } return (error); Modified: head/sys/dev/asmc/asmcvar.h ============================================================================== --- head/sys/dev/asmc/asmcvar.h Mon Sep 22 16:13:38 2014 (r271974) +++ head/sys/dev/asmc/asmcvar.h Mon Sep 22 16:20:38 2014 (r271975) @@ -27,7 +27,7 @@ * */ -#define ASMC_MAXFANS 2 +#define ASMC_MAXFANS 6 struct asmc_softc { device_t sc_dev; @@ -83,6 +83,7 @@ struct asmc_softc { */ #define ASMC_KEY_FANCOUNT "FNum" /* RO; 1 byte */ #define ASMC_KEY_FANMANUAL "FS! " /* RW; 2 bytes */ +#define ASMC_KEY_FANID "F%dID" /* RO; 16 bytes */ #define ASMC_KEY_FANSPEED "F%dAc" /* RO; 2 bytes */ #define ASMC_KEY_FANMINSPEED "F%dMn" /* RO; 2 bytes */ #define ASMC_KEY_FANMAXSPEED "F%dMx" /* RO; 2 bytes */ @@ -132,7 +133,7 @@ struct asmc_softc { * */ /* maximum array size for temperatures including the last NULL */ -#define ASMC_TEMP_MAX 36 +#define ASMC_TEMP_MAX 80 #define ASMC_MB_TEMPS { "TB0T", "TN0P", "TN1P", "Th0H", "Th1H", \ "TM0P", NULL } #define ASMC_MB_TEMPNAMES { "enclosure", "northbridge1", \ @@ -175,6 +176,57 @@ struct asmc_softc { "Unknown", "Unknown", \ "Wireless Module", } +#define ASMC_MBP8_TEMPS { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \ + "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ + "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \ + "TCTD", "TG0D", "TG0P", "THSP", "TM0S", \ + "TMBS", "TP0P", "TPCD", "TW0P", "Th1H", \ + "Th2H", "Tm0P", "Ts0P", "Ts0S", NULL } + +#define ASMC_MBP8_TEMPNAMES { "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \ + "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ + "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \ + "TCTD", "graphics", "TG0P", "THSP", "TM0S", \ + "TMBS", "TP0P", "TPCD", "wireless", "Th1H", \ + "Th2H", "memory", "Ts0P", "Ts0S" } + +#define ASMC_MBP8_TEMPDESCS { "Enclosure Bottomside", "TB1T", "TB2T", "TC0C", "TC0D", \ + "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ + "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \ + "TCTD", "TG0D", "TG0P", "THSP", "TM0S", \ + "TMBS", "TP0P", "TPCD", "TW0P", "Th1H", \ + "Th2H", "Tm0P", "Ts0P", "Ts0S" } + +#define ASMC_MBP11_TEMPS { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ + "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \ + "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \ + "TCXC", "TG0D", "TG0P", "TG1D", "TG1F", \ + "TG1d", "TH0A", "TH0B", "TH0F", "TH0R", \ + "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \ + "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \ + "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \ + "Ts1S", NULL } + +#define ASMC_MBP11_TEMPNAMES { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ + "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \ + "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \ + "TCXC", "TG0D", "TG0P", "TG1D", "TG1F", \ + "TG1d", "TH0A", "TH0B", "TH0F", "TH0R", \ + "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \ + "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \ + "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \ + "Ts1S" } + +#define ASMC_MBP11_TEMPDESCS { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ + "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \ + "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \ + "TCXC", "TG0D", "TG0P", "TG1D", "TG1F", \ + "TG1d", "TH0A", "TH0B", "TH0F", "TH0R", \ + "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \ + "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \ + "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \ + "Ts1S" } + #define ASMC_MM_TEMPS { "TN0P", "TN1P", NULL } #define ASMC_MM_TEMPNAMES { "northbridge1", "northbridge2" } #define ASMC_MM_TEMPDESCS { "Northbridge Point 1", \ @@ -214,8 +266,7 @@ struct asmc_softc { "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ "TMAS", "TMBS", "TM0P", "TM0S", "TM1P", \ "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", \ - "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", \ - NULL } + "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", } #define ASMC_MP_TEMPDESCS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ @@ -223,9 +274,66 @@ struct asmc_softc { "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", \ "TMAS", "TMBS", "TM0P", "TM0S", "TM1P", \ "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", \ - "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", \ + "TM8S", "TM9P", "TM9S", "TN0H", "TS0C", } + +#define ASMC_MP5_TEMPS { "TA0P", "TCAC", "TCAD", "TCAG", "TCAH", \ + "TCAS", "TCBC", "TCBD", "TCBG", "TCBH", \ + "TCBS", "TH1F", "TH1P", "TH1V", "TH2F", \ + "TH2P", "TH2V", "TH3F", "TH3P", "TH3V", \ + "TH4F", "TH4P", "TH4V", "THPS", "THTG", \ + "TM1P", "TM2P", "TM2V", "TM3P", "TM3V", \ + "TM4P", "TM5P", "TM6P", "TM6V", "TM7P", \ + "TM7V", "TM8P", "TM8V", "TM9V", "TMA1", \ + "TMA2", "TMA3", "TMA4", "TMB1", "TMB2", \ + "TMB3", "TMB4", "TMHS", "TMLS", "TMPS", \ + "TMPV", "TMTG", "TN0D", "TN0H", "TNTG", \ + "Te1F", "Te1P", "Te1S", "Te2F", "Te2S", \ + "Te3F", "Te3S", "Te4F", "Te4S", "Te5F", \ + "Te5S", "TeGG", "TeGP", "TeRG", "TeRP", \ + "TeRV", "Tp0C", "Tp1C", "TpPS", "TpTG", \ NULL } +#define ASMC_MP5_TEMPNAMES { "ambient", "TCAC", "TCAD", "TCAG", "TCAH", \ + "TCAS", "TCBC", "TCBD", "TCBG", "TCBH", \ + "TCBS", "TH1F", "TH1P", "TH1V", "TH2F", \ + "TH2P", "TH2V", "TH3F", "TH3P", "TH3V", \ + "TH4F", "TH4P", "TH4V", "THPS", "THTG", \ + "TM1P", "TM2P", "TM2V", "TM3P", "TM3V", \ + "TM4P", "TM5P", "TM6P", "TM6V", "TM7P", \ + "TM7V", "TM8P", "TM8V", "TM9V", "ram_a1", \ + "ram_a2", "ram_a3", "ram_a4", "ram_b1", "ram_b2", \ + "ram_b3", "ram_b4", "TMHS", "TMLS", "TMPS", \ + "TMPV", "TMTG", "TN0D", "TN0H", "TNTG", \ + "Te1F", "Te1P", "Te1S", "Te2F", "Te2S", \ + "Te3F", "Te3S", "Te4F", "Te4S", "Te5F", \ + "Te5S", "TeGG", "TeGP", "TeRG", "TeRP", \ + "TeRV", "Tp0C", "Tp1C", "TpPS", "TpTG", } + +#define ASMC_MP5_TEMPDESCS { "TA0P", "TCAC", "TCAD", "TCAG", "TCAH", \ + "TCAS", "TCBC", "TCBD", "TCBG", "TCBH", \ + "TCBS", "TH1F", "TH1P", "TH1V", "TH2F", \ + "TH2P", "TH2V", "TH3F", "TH3P", "TH3V", \ + "TH4F", "TH4P", "TH4V", "THPS", "THTG", \ + "TM1P", "TM2P", "TM2V", "TM3P", "TM3V", \ + "TM4P", "TM5P", "TM6P", "TM6V", "TM7P", \ + "TM7V", "TM8P", "TM8V", "TM9V", "TMA1", \ + "TMA2", "TMA3", "TMA4", "TMB1", "TMB2", \ + "TMB3", "TMB4", "TMHS", "TMLS", "TMPS", \ + "TMPV", "TMTG", "TN0D", "TN0H", "TNTG", \ + "Te1F", "Te1P", "Te1S", "Te2F", "Te2S", \ + "Te3F", "Te3S", "Te4F", "Te4S", "Te5F", \ + "Te5S", "TeGG", "TeGP", "TeRG", "TeRP", \ + "TeRV", "Tp0C", "Tp1C", "TpPS", "TpTG", } + #define ASMC_MBA_TEMPS { "TB0T", NULL } #define ASMC_MBA_TEMPNAMES { "enclosure" } #define ASMC_MBA_TEMPDESCS { "Enclosure Bottom" } + +#define ASMC_MBA3_TEMPS { "TB0T", "TB1T", "TB2T", \ + "TC0D", "TC0E", "TC0P", NULL } + +#define ASMC_MBA3_TEMPNAMES { "enclosure", "TB1T", "TB2T", \ + "TC0D", "TC0E", "TC0P" } + +#define ASMC_MBA3_TEMPDESCS { "Enclosure Bottom", "TB1T", "TB2T", \ + "TC0D", "TC0E", "TC0P" } From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 16:20:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FAADE44; Mon, 22 Sep 2014 16:20:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 196BA67; Mon, 22 Sep 2014 16:20:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MGKmXR079809; Mon, 22 Sep 2014 16:20:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MGKl08079806; Mon, 22 Sep 2014 16:20:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409221620.s8MGKl08079806@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 22 Sep 2014 16:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271976 - in head/sys: fs/devfs kern ofed/include/linux opencrypto sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:20:48 -0000 Author: jhb Date: Mon Sep 22 16:20:47 2014 New Revision: 271976 URL: http://svnweb.freebsd.org/changeset/base/271976 Log: Add a new fo_fill_kinfo fileops method to add type-specific information to struct kinfo_file. - Move the various fill_*_info() methods out of kern_descrip.c and into the various file type implementations. - Rework the support for kinfo_ofile to generate a suitable kinfo_file object for each file and then convert that to a kinfo_ofile structure rather than keeping a second, different set of code that directly manipulates type-specific file information. - Remove the shm_path() and ksem_info() layering violations. Differential Revision: https://reviews.freebsd.org/D775 Reviewed by: kib, glebius (earlier version) Modified: head/sys/fs/devfs/devfs_vnops.c head/sys/kern/kern_descrip.c head/sys/kern/kern_event.c head/sys/kern/sys_pipe.c head/sys/kern/sys_procdesc.c head/sys/kern/sys_socket.c head/sys/kern/tty_pts.c head/sys/kern/uipc_mqueue.c head/sys/kern/uipc_sem.c head/sys/kern/uipc_shm.c head/sys/kern/vfs_vnops.c head/sys/ofed/include/linux/linux_compat.c head/sys/opencrypto/cryptodev.c head/sys/sys/file.h head/sys/sys/ksem.h head/sys/sys/mman.h Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Mon Sep 22 16:20:38 2014 (r271975) +++ head/sys/fs/devfs/devfs_vnops.c Mon Sep 22 16:20:47 2014 (r271976) @@ -1700,6 +1700,7 @@ static struct fileops devfs_ops_f = { .fo_chown = vn_chown, .fo_sendfile = vn_sendfile, .fo_seek = vn_seek, + .fo_fill_kinfo = vn_fill_kinfo, .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Sep 22 16:20:38 2014 (r271975) +++ head/sys/kern/kern_descrip.c Mon Sep 22 16:20:47 2014 (r271976) @@ -47,27 +47,21 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include #include #include -#include #include #include #include -#include #include -#include #include #include #include -#include #include #include -#include #include #include #include @@ -79,10 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include -#include #include #include #ifdef KTRACE @@ -91,9 +82,6 @@ __FBSDID("$FreeBSD$"); #include -#include -#include - #include #include @@ -111,8 +99,6 @@ MALLOC_DECLARE(M_FADVISE); static uma_zone_t file_zone; -void (*ksem_info)(struct ksem *ks, char *path, size_t size, uint32_t *value); - static int closefp(struct filedesc *fdp, int fd, struct file *fp, struct thread *td, int holdleaders); static int fd_first_free(struct filedesc *fdp, int low, int size); @@ -121,14 +107,6 @@ static void fdgrowtable(struct filedesc static void fdgrowtable_exp(struct filedesc *fdp, int nfd); static void fdunused(struct filedesc *fdp, int fd); static void fdused(struct filedesc *fdp, int fd); -static int fill_pipe_info(struct pipe *pi, struct kinfo_file *kif); -static int fill_procdesc_info(struct procdesc *pdp, - struct kinfo_file *kif); -static int fill_pts_info(struct tty *tp, struct kinfo_file *kif); -static int fill_sem_info(struct file *fp, struct kinfo_file *kif); -static int fill_shm_info(struct file *fp, struct kinfo_file *kif); -static int fill_socket_info(struct socket *so, struct kinfo_file *kif); -static int fill_vnode_info(struct vnode *vp, struct kinfo_file *kif); static int getmaxfd(struct proc *p); /* @@ -2945,280 +2923,14 @@ sysctl_kern_file(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_kern, KERN_FILE, file, CTLTYPE_OPAQUE|CTLFLAG_RD|CTLFLAG_MPSAFE, 0, 0, sysctl_kern_file, "S,xfile", "Entire file table"); -#ifdef KINFO_OFILE_SIZE -CTASSERT(sizeof(struct kinfo_ofile) == KINFO_OFILE_SIZE); -#endif - -#ifdef COMPAT_FREEBSD7 -static int -export_vnode_for_osysctl(struct vnode *vp, int type, - struct kinfo_ofile *kif, struct filedesc *fdp, struct sysctl_req *req) -{ - int error; - char *fullpath, *freepath; - - bzero(kif, sizeof(*kif)); - kif->kf_structsize = sizeof(*kif); - - vref(vp); - kif->kf_fd = type; - kif->kf_type = KF_TYPE_VNODE; - /* This function only handles directories. */ - if (vp->v_type != VDIR) { - vrele(vp); - return (ENOTDIR); - } - kif->kf_vnode_type = KF_VTYPE_VDIR; - - /* - * This is not a true file descriptor, so we set a bogus refcount - * and offset to indicate these fields should be ignored. - */ - kif->kf_ref_count = -1; - kif->kf_offset = -1; - - freepath = NULL; - fullpath = "-"; - FILEDESC_SUNLOCK(fdp); - vn_fullpath(curthread, vp, &fullpath, &freepath); - vrele(vp); - strlcpy(kif->kf_path, fullpath, sizeof(kif->kf_path)); - if (freepath != NULL) - free(freepath, M_TEMP); - error = SYSCTL_OUT(req, kif, sizeof(*kif)); - FILEDESC_SLOCK(fdp); - return (error); -} - -/* - * Get per-process file descriptors for use by procstat(1), et al. - */ -static int -sysctl_kern_proc_ofiledesc(SYSCTL_HANDLER_ARGS) -{ - char *fullpath, *freepath; - struct kinfo_ofile *kif; - struct filedesc *fdp; - int error, i, *name; - struct shmfd *shmfd; - struct socket *so; - struct vnode *vp; - struct ksem *ks; - struct file *fp; - struct proc *p; - struct tty *tp; - - name = (int *)arg1; - error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); - if (error != 0) - return (error); - fdp = fdhold(p); - PROC_UNLOCK(p); - if (fdp == NULL) - return (ENOENT); - kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK); - FILEDESC_SLOCK(fdp); - if (fdp->fd_cdir != NULL) - export_vnode_for_osysctl(fdp->fd_cdir, KF_FD_TYPE_CWD, kif, - fdp, req); - if (fdp->fd_rdir != NULL) - export_vnode_for_osysctl(fdp->fd_rdir, KF_FD_TYPE_ROOT, kif, - fdp, req); - if (fdp->fd_jdir != NULL) - export_vnode_for_osysctl(fdp->fd_jdir, KF_FD_TYPE_JAIL, kif, - fdp, req); - for (i = 0; fdp->fd_refcnt > 0 && i <= fdp->fd_lastfile; i++) { - if ((fp = fdp->fd_ofiles[i].fde_file) == NULL) - continue; - bzero(kif, sizeof(*kif)); - kif->kf_structsize = sizeof(*kif); - ks = NULL; - vp = NULL; - so = NULL; - tp = NULL; - shmfd = NULL; - kif->kf_fd = i; - - switch (fp->f_type) { - case DTYPE_VNODE: - kif->kf_type = KF_TYPE_VNODE; - vp = fp->f_vnode; - break; - - case DTYPE_SOCKET: - kif->kf_type = KF_TYPE_SOCKET; - so = fp->f_data; - break; - - case DTYPE_PIPE: - kif->kf_type = KF_TYPE_PIPE; - break; - - case DTYPE_FIFO: - kif->kf_type = KF_TYPE_FIFO; - vp = fp->f_vnode; - break; - - case DTYPE_KQUEUE: - kif->kf_type = KF_TYPE_KQUEUE; - break; - - case DTYPE_CRYPTO: - kif->kf_type = KF_TYPE_CRYPTO; - break; - - case DTYPE_MQUEUE: - kif->kf_type = KF_TYPE_MQUEUE; - break; - - case DTYPE_SHM: - kif->kf_type = KF_TYPE_SHM; - shmfd = fp->f_data; - break; - - case DTYPE_SEM: - kif->kf_type = KF_TYPE_SEM; - ks = fp->f_data; - break; - - case DTYPE_PTS: - kif->kf_type = KF_TYPE_PTS; - tp = fp->f_data; - break; - - case DTYPE_PROCDESC: - kif->kf_type = KF_TYPE_PROCDESC; - break; - - default: - kif->kf_type = KF_TYPE_UNKNOWN; - break; - } - kif->kf_ref_count = fp->f_count; - if (fp->f_flag & FREAD) - kif->kf_flags |= KF_FLAG_READ; - if (fp->f_flag & FWRITE) - kif->kf_flags |= KF_FLAG_WRITE; - if (fp->f_flag & FAPPEND) - kif->kf_flags |= KF_FLAG_APPEND; - if (fp->f_flag & FASYNC) - kif->kf_flags |= KF_FLAG_ASYNC; - if (fp->f_flag & FFSYNC) - kif->kf_flags |= KF_FLAG_FSYNC; - if (fp->f_flag & FNONBLOCK) - kif->kf_flags |= KF_FLAG_NONBLOCK; - if (fp->f_flag & O_DIRECT) - kif->kf_flags |= KF_FLAG_DIRECT; - if (fp->f_flag & FHASLOCK) - kif->kf_flags |= KF_FLAG_HASLOCK; - kif->kf_offset = foffset_get(fp); - if (vp != NULL) { - vref(vp); - switch (vp->v_type) { - case VNON: - kif->kf_vnode_type = KF_VTYPE_VNON; - break; - case VREG: - kif->kf_vnode_type = KF_VTYPE_VREG; - break; - case VDIR: - kif->kf_vnode_type = KF_VTYPE_VDIR; - break; - case VBLK: - kif->kf_vnode_type = KF_VTYPE_VBLK; - break; - case VCHR: - kif->kf_vnode_type = KF_VTYPE_VCHR; - break; - case VLNK: - kif->kf_vnode_type = KF_VTYPE_VLNK; - break; - case VSOCK: - kif->kf_vnode_type = KF_VTYPE_VSOCK; - break; - case VFIFO: - kif->kf_vnode_type = KF_VTYPE_VFIFO; - break; - case VBAD: - kif->kf_vnode_type = KF_VTYPE_VBAD; - break; - default: - kif->kf_vnode_type = KF_VTYPE_UNKNOWN; - break; - } - /* - * It is OK to drop the filedesc lock here as we will - * re-validate and re-evaluate its properties when - * the loop continues. - */ - freepath = NULL; - fullpath = "-"; - FILEDESC_SUNLOCK(fdp); - vn_fullpath(curthread, vp, &fullpath, &freepath); - vrele(vp); - strlcpy(kif->kf_path, fullpath, - sizeof(kif->kf_path)); - if (freepath != NULL) - free(freepath, M_TEMP); - FILEDESC_SLOCK(fdp); - } - if (so != NULL) { - struct sockaddr *sa; - - if (so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa) - == 0 && sa->sa_len <= sizeof(kif->kf_sa_local)) { - bcopy(sa, &kif->kf_sa_local, sa->sa_len); - free(sa, M_SONAME); - } - if (so->so_proto->pr_usrreqs->pru_peeraddr(so, &sa) - == 0 && sa->sa_len <= sizeof(kif->kf_sa_peer)) { - bcopy(sa, &kif->kf_sa_peer, sa->sa_len); - free(sa, M_SONAME); - } - kif->kf_sock_domain = - so->so_proto->pr_domain->dom_family; - kif->kf_sock_type = so->so_type; - kif->kf_sock_protocol = so->so_proto->pr_protocol; - } - if (tp != NULL) { - strlcpy(kif->kf_path, tty_devname(tp), - sizeof(kif->kf_path)); - } - if (shmfd != NULL) - shm_path(shmfd, kif->kf_path, sizeof(kif->kf_path)); - if (ks != NULL && ksem_info != NULL) - ksem_info(ks, kif->kf_path, sizeof(kif->kf_path), NULL); - error = SYSCTL_OUT(req, kif, sizeof(*kif)); - if (error) - break; - } - FILEDESC_SUNLOCK(fdp); - fddrop(fdp); - free(kif, M_TEMP); - return (0); -} - -static SYSCTL_NODE(_kern_proc, KERN_PROC_OFILEDESC, ofiledesc, - CTLFLAG_RD||CTLFLAG_MPSAFE, sysctl_kern_proc_ofiledesc, - "Process ofiledesc entries"); -#endif /* COMPAT_FREEBSD7 */ - #ifdef KINFO_FILE_SIZE CTASSERT(sizeof(struct kinfo_file) == KINFO_FILE_SIZE); #endif -struct export_fd_buf { - struct filedesc *fdp; - struct sbuf *sb; - ssize_t remainder; - struct kinfo_file kif; -}; - static int -export_fd_to_sb(void *data, int type, int fd, int fflags, int refcnt, - int64_t offset, cap_rights_t *rightsp, struct export_fd_buf *efbuf) +xlate_fflags(int fflags) { - struct { + static const struct { int fflag; int kf_fflag; } fflags_table[] = { @@ -3238,83 +2950,126 @@ export_fd_to_sb(void *data, int type, in { O_SHLOCK, KF_FLAG_SHLOCK }, { O_TRUNC, KF_FLAG_TRUNC } }; -#define NFFLAGS (sizeof(fflags_table) / sizeof(*fflags_table)) - struct kinfo_file *kif; - struct vnode *vp; - int error, locked; unsigned int i; + int kflags; + + kflags = 0; + for (i = 0; i < nitems(fflags_table); i++) + if (fflags & fflags_table[i].fflag) + kflags |= fflags_table[i].kf_fflag; + return (kflags); +} + +/* Trim unused data from kf_path by truncating the structure size. */ +static void +pack_kinfo(struct kinfo_file *kif) +{ + + kif->kf_structsize = offsetof(struct kinfo_file, kf_path) + + strlen(kif->kf_path) + 1; + kif->kf_structsize = roundup(kif->kf_structsize, sizeof(uint64_t)); +} + +static void +export_file_to_kinfo(struct file *fp, int fd, cap_rights_t *rightsp, + struct kinfo_file *kif, struct filedesc *fdp) +{ + int error; - if (efbuf->remainder == 0) - return (0); - kif = &efbuf->kif; bzero(kif, sizeof(*kif)); - locked = efbuf->fdp != NULL; - switch (type) { - case KF_TYPE_FIFO: - case KF_TYPE_VNODE: - if (locked) { - FILEDESC_SUNLOCK(efbuf->fdp); - locked = 0; - } - vp = (struct vnode *)data; - error = fill_vnode_info(vp, kif); - vrele(vp); - break; - case KF_TYPE_SOCKET: - error = fill_socket_info((struct socket *)data, kif); - break; - case KF_TYPE_PIPE: - error = fill_pipe_info((struct pipe *)data, kif); - break; - case KF_TYPE_PTS: - error = fill_pts_info((struct tty *)data, kif); - break; - case KF_TYPE_PROCDESC: - error = fill_procdesc_info((struct procdesc *)data, kif); - break; - case KF_TYPE_SEM: - error = fill_sem_info((struct file *)data, kif); - break; - case KF_TYPE_SHM: - error = fill_shm_info((struct file *)data, kif); - break; - default: - error = 0; - } - if (error == 0) - kif->kf_status |= KF_ATTR_VALID; - /* - * Translate file access flags. - */ - for (i = 0; i < NFFLAGS; i++) - if (fflags & fflags_table[i].fflag) - kif->kf_flags |= fflags_table[i].kf_fflag; + /* Set a default type to allow for empty fill_kinfo() methods. */ + kif->kf_type = KF_TYPE_UNKNOWN; + kif->kf_flags = xlate_fflags(fp->f_flag); if (rightsp != NULL) kif->kf_cap_rights = *rightsp; else cap_rights_init(&kif->kf_cap_rights); kif->kf_fd = fd; - kif->kf_type = type; - kif->kf_ref_count = refcnt; - kif->kf_offset = offset; - /* Pack record size down */ - kif->kf_structsize = offsetof(struct kinfo_file, kf_path) + - strlen(kif->kf_path) + 1; - kif->kf_structsize = roundup(kif->kf_structsize, sizeof(uint64_t)); + kif->kf_ref_count = fp->f_count; + kif->kf_offset = foffset_get(fp); + + /* + * This may drop the filedesc lock, so the 'fp' cannot be + * accessed after this call. + */ + error = fo_fill_kinfo(fp, kif, fdp); + if (error == 0) + kif->kf_status |= KF_ATTR_VALID; + pack_kinfo(kif); +} + +static void +export_vnode_to_kinfo(struct vnode *vp, int fd, int fflags, + struct kinfo_file *kif) +{ + int error; + + bzero(kif, sizeof(*kif)); + + kif->kf_type = KF_TYPE_VNODE; + error = vn_fill_kinfo_vnode(vp, kif); + if (error == 0) + kif->kf_status |= KF_ATTR_VALID; + kif->kf_flags = xlate_fflags(fflags); + kif->kf_fd = fd; + kif->kf_ref_count = -1; + kif->kf_offset = -1; + pack_kinfo(kif); + vrele(vp); +} + +struct export_fd_buf { + struct filedesc *fdp; + struct sbuf *sb; + ssize_t remainder; + struct kinfo_file kif; +}; + +static int +export_kinfo_to_sb(struct export_fd_buf *efbuf) +{ + struct kinfo_file *kif; + + kif = &efbuf->kif; if (efbuf->remainder != -1) { if (efbuf->remainder < kif->kf_structsize) { /* Terminate export. */ efbuf->remainder = 0; - if (efbuf->fdp != NULL && !locked) - FILEDESC_SLOCK(efbuf->fdp); return (0); } efbuf->remainder -= kif->kf_structsize; } - if (locked) + return (sbuf_bcat(efbuf->sb, kif, kif->kf_structsize)); +} + +static int +export_file_to_sb(struct file *fp, int fd, cap_rights_t *rightsp, + struct export_fd_buf *efbuf) +{ + int error; + + if (efbuf->remainder == 0) + return (0); + export_file_to_kinfo(fp, fd, rightsp, &efbuf->kif, efbuf->fdp); + FILEDESC_SUNLOCK(efbuf->fdp); + error = export_kinfo_to_sb(efbuf); + FILEDESC_SLOCK(efbuf->fdp); + return (error); +} + +static int +export_vnode_to_sb(struct vnode *vp, int fd, int fflags, + struct export_fd_buf *efbuf) +{ + int error; + + if (efbuf->remainder == 0) + return (0); + if (efbuf->fdp != NULL) FILEDESC_SUNLOCK(efbuf->fdp); - error = sbuf_bcat(efbuf->sb, kif, kif->kf_structsize); + export_vnode_to_kinfo(vp, fd, fflags, &efbuf->kif); + error = export_kinfo_to_sb(efbuf); if (efbuf->fdp != NULL) FILEDESC_SLOCK(efbuf->fdp); return (error); @@ -3328,16 +3083,15 @@ export_fd_to_sb(void *data, int type, in int kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen) { + struct thread *td; struct file *fp; struct filedesc *fdp; struct export_fd_buf *efbuf; struct vnode *cttyvp, *textvp, *tracevp; - int64_t offset; - void *data; int error, i; - int type, refcnt, fflags; cap_rights_t rights; + td = curthread; PROC_LOCK_ASSERT(p, MA_OWNED); /* ktrace vnode */ @@ -3362,14 +3116,13 @@ kern_proc_filedesc_out(struct proc *p, efbuf->sb = sb; efbuf->remainder = maxlen; if (tracevp != NULL) - export_fd_to_sb(tracevp, KF_TYPE_VNODE, KF_FD_TYPE_TRACE, - FREAD | FWRITE, -1, -1, NULL, efbuf); + export_vnode_to_sb(tracevp, KF_FD_TYPE_TRACE, FREAD | FWRITE, + efbuf); if (textvp != NULL) - export_fd_to_sb(textvp, KF_TYPE_VNODE, KF_FD_TYPE_TEXT, - FREAD, -1, -1, NULL, efbuf); + export_vnode_to_sb(textvp, KF_FD_TYPE_TEXT, FREAD, efbuf); if (cttyvp != NULL) - export_fd_to_sb(cttyvp, KF_TYPE_VNODE, KF_FD_TYPE_CTTY, - FREAD | FWRITE, -1, -1, NULL, efbuf); + export_vnode_to_sb(cttyvp, KF_FD_TYPE_CTTY, FREAD | FWRITE, + efbuf); error = 0; if (fdp == NULL) goto fail; @@ -3378,105 +3131,34 @@ kern_proc_filedesc_out(struct proc *p, /* working directory */ if (fdp->fd_cdir != NULL) { vref(fdp->fd_cdir); - data = fdp->fd_cdir; - export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_CWD, - FREAD, -1, -1, NULL, efbuf); + export_vnode_to_sb(fdp->fd_cdir, KF_FD_TYPE_CWD, FREAD, efbuf); } /* root directory */ if (fdp->fd_rdir != NULL) { vref(fdp->fd_rdir); - data = fdp->fd_rdir; - export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_ROOT, - FREAD, -1, -1, NULL, efbuf); + export_vnode_to_sb(fdp->fd_rdir, KF_FD_TYPE_ROOT, FREAD, efbuf); } /* jail directory */ if (fdp->fd_jdir != NULL) { vref(fdp->fd_jdir); - data = fdp->fd_jdir; - export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_JAIL, - FREAD, -1, -1, NULL, efbuf); + export_vnode_to_sb(fdp->fd_jdir, KF_FD_TYPE_JAIL, FREAD, efbuf); } for (i = 0; fdp->fd_refcnt > 0 && i <= fdp->fd_lastfile; i++) { if ((fp = fdp->fd_ofiles[i].fde_file) == NULL) continue; - data = NULL; #ifdef CAPABILITIES rights = *cap_rights(fdp, i); #else /* !CAPABILITIES */ cap_rights_init(&rights); #endif - switch (fp->f_type) { - case DTYPE_VNODE: - type = KF_TYPE_VNODE; - vref(fp->f_vnode); - data = fp->f_vnode; - break; - - case DTYPE_SOCKET: - type = KF_TYPE_SOCKET; - data = fp->f_data; - break; - - case DTYPE_PIPE: - type = KF_TYPE_PIPE; - data = fp->f_data; - break; - - case DTYPE_FIFO: - type = KF_TYPE_FIFO; - vref(fp->f_vnode); - data = fp->f_vnode; - break; - - case DTYPE_KQUEUE: - type = KF_TYPE_KQUEUE; - break; - - case DTYPE_CRYPTO: - type = KF_TYPE_CRYPTO; - break; - - case DTYPE_MQUEUE: - type = KF_TYPE_MQUEUE; - break; - - case DTYPE_SHM: - type = KF_TYPE_SHM; - data = fp; - break; - - case DTYPE_SEM: - type = KF_TYPE_SEM; - data = fp; - break; - - case DTYPE_PTS: - type = KF_TYPE_PTS; - data = fp->f_data; - break; - - case DTYPE_PROCDESC: - type = KF_TYPE_PROCDESC; - data = fp->f_data; - break; - - default: - type = KF_TYPE_UNKNOWN; - break; - } - refcnt = fp->f_count; - fflags = fp->f_flag; - offset = foffset_get(fp); - /* - * Create sysctl entry. - * It is OK to drop the filedesc lock here as we will - * re-validate and re-evaluate its properties when - * the loop continues. + * Create sysctl entry. It is OK to drop the filedesc + * lock inside of export_file_to_sb() as we will + * re-validate and re-evaluate its properties when the + * loop continues. */ - error = export_fd_to_sb(data, type, i, fflags, refcnt, - offset, &rights, efbuf); - if (error != 0) + error = export_file_to_sb(fp, i, &rights, efbuf); + if (error != 0 || efbuf->remainder == 0) break; } FILEDESC_SUNLOCK(fdp); @@ -3514,6 +3196,105 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER return (error != 0 ? error : error2); } +#ifdef KINFO_OFILE_SIZE +CTASSERT(sizeof(struct kinfo_ofile) == KINFO_OFILE_SIZE); +#endif + +#ifdef COMPAT_FREEBSD7 +static void +kinfo_to_okinfo(struct kinfo_file *kif, struct kinfo_ofile *okif) +{ + + okif->kf_structsize = sizeof(*okif); + okif->kf_type = kif->kf_type; + okif->kf_fd = kif->kf_fd; + okif->kf_ref_count = kif->kf_ref_count; + okif->kf_flags = kif->kf_flags & (KF_FLAG_READ | KF_FLAG_WRITE | + KF_FLAG_APPEND | KF_FLAG_ASYNC | KF_FLAG_FSYNC | KF_FLAG_NONBLOCK | + KF_FLAG_DIRECT | KF_FLAG_HASLOCK); + okif->kf_offset = kif->kf_offset; + okif->kf_vnode_type = kif->kf_vnode_type; + okif->kf_sock_domain = kif->kf_sock_domain; + okif->kf_sock_type = kif->kf_sock_type; + okif->kf_sock_protocol = kif->kf_sock_protocol; + strlcpy(okif->kf_path, kif->kf_path, sizeof(okif->kf_path)); + okif->kf_sa_local = kif->kf_sa_local; + okif->kf_sa_peer = kif->kf_sa_peer; +} + +static int +export_vnode_for_osysctl(struct vnode *vp, int type, struct kinfo_file *kif, + struct kinfo_ofile *okif, struct filedesc *fdp, struct sysctl_req *req) +{ + int error; + + vref(vp); + FILEDESC_SUNLOCK(fdp); + export_vnode_to_kinfo(vp, type, 0, kif); + kinfo_to_okinfo(kif, okif); + error = SYSCTL_OUT(req, okif, sizeof(*okif)); + FILEDESC_SLOCK(fdp); + return (error); +} + +/* + * Get per-process file descriptors for use by procstat(1), et al. + */ +static int +sysctl_kern_proc_ofiledesc(SYSCTL_HANDLER_ARGS) +{ + struct kinfo_ofile *okif; + struct kinfo_file *kif; + struct filedesc *fdp; + struct thread *td; + int error, i, *name; + struct file *fp; + struct proc *p; + + td = curthread; + name = (int *)arg1; + error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); + if (error != 0) + return (error); + fdp = fdhold(p); + PROC_UNLOCK(p); + if (fdp == NULL) + return (ENOENT); + kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK); + okif = malloc(sizeof(*okif), M_TEMP, M_WAITOK); + FILEDESC_SLOCK(fdp); + if (fdp->fd_cdir != NULL) + export_vnode_for_osysctl(fdp->fd_cdir, KF_FD_TYPE_CWD, kif, + okif, fdp, req); + if (fdp->fd_rdir != NULL) + export_vnode_for_osysctl(fdp->fd_rdir, KF_FD_TYPE_ROOT, kif, + okif, fdp, req); + if (fdp->fd_jdir != NULL) + export_vnode_for_osysctl(fdp->fd_jdir, KF_FD_TYPE_JAIL, kif, + okif, fdp, req); + for (i = 0; fdp->fd_refcnt > 0 && i <= fdp->fd_lastfile; i++) { + if ((fp = fdp->fd_ofiles[i].fde_file) == NULL) + continue; + export_file_to_kinfo(fp, i, NULL, kif, fdp); + FILEDESC_SUNLOCK(fdp); + kinfo_to_okinfo(kif, okif); + error = SYSCTL_OUT(req, okif, sizeof(*okif)); + FILEDESC_SLOCK(fdp); + if (error) + break; + } + FILEDESC_SUNLOCK(fdp); + fddrop(fdp); + free(kif, M_TEMP); + free(okif, M_TEMP); + return (0); +} + +static SYSCTL_NODE(_kern_proc, KERN_PROC_OFILEDESC, ofiledesc, + CTLFLAG_RD||CTLFLAG_MPSAFE, sysctl_kern_proc_ofiledesc, + "Process ofiledesc entries"); +#endif /* COMPAT_FREEBSD7 */ + int vntype_to_kinfo(int vtype) { @@ -3543,170 +3324,6 @@ vntype_to_kinfo(int vtype) return (KF_VTYPE_UNKNOWN); } -static int -fill_vnode_info(struct vnode *vp, struct kinfo_file *kif) -{ - struct vattr va; - char *fullpath, *freepath; - int error; - - if (vp == NULL) - return (1); - kif->kf_vnode_type = vntype_to_kinfo(vp->v_type); - freepath = NULL; - fullpath = "-"; - error = vn_fullpath(curthread, vp, &fullpath, &freepath); - if (error == 0) { - strlcpy(kif->kf_path, fullpath, sizeof(kif->kf_path)); - } - if (freepath != NULL) - free(freepath, M_TEMP); - - /* - * Retrieve vnode attributes. - */ - va.va_fsid = VNOVAL; - va.va_rdev = NODEV; - vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_GETATTR(vp, &va, curthread->td_ucred); - VOP_UNLOCK(vp, 0); - if (error != 0) - return (error); - if (va.va_fsid != VNOVAL) - kif->kf_un.kf_file.kf_file_fsid = va.va_fsid; - else - kif->kf_un.kf_file.kf_file_fsid = - vp->v_mount->mnt_stat.f_fsid.val[0]; - kif->kf_un.kf_file.kf_file_fileid = va.va_fileid; - kif->kf_un.kf_file.kf_file_mode = MAKEIMODE(va.va_type, va.va_mode); - kif->kf_un.kf_file.kf_file_size = va.va_size; - kif->kf_un.kf_file.kf_file_rdev = va.va_rdev; - return (0); -} - -static int -fill_socket_info(struct socket *so, struct kinfo_file *kif) -{ - struct sockaddr *sa; - struct inpcb *inpcb; - struct unpcb *unpcb; - int error; - - if (so == NULL) - return (1); - kif->kf_sock_domain = so->so_proto->pr_domain->dom_family; - kif->kf_sock_type = so->so_type; - kif->kf_sock_protocol = so->so_proto->pr_protocol; - kif->kf_un.kf_sock.kf_sock_pcb = (uintptr_t)so->so_pcb; - switch(kif->kf_sock_domain) { - case AF_INET: - case AF_INET6: - if (kif->kf_sock_protocol == IPPROTO_TCP) { - if (so->so_pcb != NULL) { - inpcb = (struct inpcb *)(so->so_pcb); - kif->kf_un.kf_sock.kf_sock_inpcb = - (uintptr_t)inpcb->inp_ppcb; - } - } - break; - case AF_UNIX: - if (so->so_pcb != NULL) { - unpcb = (struct unpcb *)(so->so_pcb); - if (unpcb->unp_conn) { - kif->kf_un.kf_sock.kf_sock_unpconn = - (uintptr_t)unpcb->unp_conn; - kif->kf_un.kf_sock.kf_sock_rcv_sb_state = - so->so_rcv.sb_state; - kif->kf_un.kf_sock.kf_sock_snd_sb_state = - so->so_snd.sb_state; - } - } - break; - } - error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); - if (error == 0 && sa->sa_len <= sizeof(kif->kf_sa_local)) { - bcopy(sa, &kif->kf_sa_local, sa->sa_len); - free(sa, M_SONAME); - } - error = so->so_proto->pr_usrreqs->pru_peeraddr(so, &sa); - if (error == 0 && sa->sa_len <= sizeof(kif->kf_sa_peer)) { - bcopy(sa, &kif->kf_sa_peer, sa->sa_len); - free(sa, M_SONAME); - } - strncpy(kif->kf_path, so->so_proto->pr_domain->dom_name, - sizeof(kif->kf_path)); - return (0); -} - -static int -fill_pts_info(struct tty *tp, struct kinfo_file *kif) -{ - - if (tp == NULL) - return (1); - kif->kf_un.kf_pts.kf_pts_dev = tty_udev(tp); - strlcpy(kif->kf_path, tty_devname(tp), sizeof(kif->kf_path)); - return (0); -} - -static int -fill_pipe_info(struct pipe *pi, struct kinfo_file *kif) -{ - - if (pi == NULL) - return (1); - kif->kf_un.kf_pipe.kf_pipe_addr = (uintptr_t)pi; - kif->kf_un.kf_pipe.kf_pipe_peer = (uintptr_t)pi->pipe_peer; - kif->kf_un.kf_pipe.kf_pipe_buffer_cnt = pi->pipe_buffer.cnt; - return (0); -} - -static int -fill_procdesc_info(struct procdesc *pdp, struct kinfo_file *kif) -{ - - if (pdp == NULL) - return (1); - kif->kf_un.kf_proc.kf_pid = pdp->pd_pid; - return (0); -} - -static int -fill_sem_info(struct file *fp, struct kinfo_file *kif) -{ - struct thread *td; - struct stat sb; - - td = curthread; - if (fp->f_data == NULL) - return (1); - if (fo_stat(fp, &sb, td->td_ucred, td) != 0) - return (1); - if (ksem_info == NULL) - return (1); - ksem_info(fp->f_data, kif->kf_path, sizeof(kif->kf_path), - &kif->kf_un.kf_sem.kf_sem_value); - kif->kf_un.kf_sem.kf_sem_mode = sb.st_mode; - return (0); -} - -static int -fill_shm_info(struct file *fp, struct kinfo_file *kif) -{ - struct thread *td; - struct stat sb; - - td = curthread; - if (fp->f_data == NULL) - return (1); - if (fo_stat(fp, &sb, td->td_ucred, td) != 0) - return (1); - shm_path(fp->f_data, kif->kf_path, sizeof(kif->kf_path)); - kif->kf_un.kf_file.kf_file_mode = sb.st_mode; - kif->kf_un.kf_file.kf_file_size = sb.st_size; - return (0); -} - static SYSCTL_NODE(_kern_proc, KERN_PROC_FILEDESC, filedesc, CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_filedesc, "Process filedesc entries"); @@ -3926,6 +3543,13 @@ badfo_sendfile(struct file *fp, int sock return (EBADF); } +static int +badfo_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) +{ + + return (0); +} + struct fileops badfileops = { .fo_read = badfo_readwrite, .fo_write = badfo_readwrite, @@ -3938,6 +3562,7 @@ struct fileops badfileops = { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 16:21:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00FF4FC9; Mon, 22 Sep 2014 16:21:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E04799B; Mon, 22 Sep 2014 16:21:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MGLPwL080456; Mon, 22 Sep 2014 16:21:25 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MGLPMx080451; Mon, 22 Sep 2014 16:21:25 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201409221621.s8MGLPMx080451@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 22 Sep 2014 16:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271977 - head/contrib/ipfilter/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:21:26 -0000 Author: cy Date: Mon Sep 22 16:21:25 2014 New Revision: 271977 URL: http://svnweb.freebsd.org/changeset/base/271977 Log: 3561691 gethost never returns an ipv6 address Approved by: glebius (mentor) Obtained from: ipfilter CVS repo (r1.34), netbsd CVS repo (r1.4) Modified: head/contrib/ipfilter/tools/ipnat_y.y Modified: head/contrib/ipfilter/tools/ipnat_y.y ============================================================================== --- head/contrib/ipfilter/tools/ipnat_y.y Mon Sep 22 16:20:47 2014 (r271976) +++ head/contrib/ipfilter/tools/ipnat_y.y Mon Sep 22 16:21:25 2014 (r271977) @@ -1164,17 +1164,19 @@ hexnumber: hostname: YY_STR { i6addr_t addr; + int family; +#ifdef USE_INET6 + if (nat->in_v[0] == 6) + family = AF_INET6; + else +#endif + family = AF_INET; bzero(&$$, sizeof($$)); - if (gethost(AF_INET, $1, - &addr) == 0) { - $$.a = addr; - $$.f = AF_INET; - } else - if (gethost(AF_INET6, $1, + $$.f = family; + if (gethost(family, $1, &addr) == 0) { $$.a = addr; - $$.f = AF_INET6; } else { FPRINTF(stderr, "Unknown host '%s'\n", From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 16:35:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C012669B; Mon, 22 Sep 2014 16:35:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FAA21EA; Mon, 22 Sep 2014 16:35:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MGZmWo086526; Mon, 22 Sep 2014 16:35:48 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MGZmS9086525; Mon, 22 Sep 2014 16:35:48 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201409221635.s8MGZmS9086525@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 22 Sep 2014 16:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271978 - head/contrib/ipfilter/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:35:49 -0000 Author: cy Date: Mon Sep 22 16:35:48 2014 New Revision: 271978 URL: http://svnweb.freebsd.org/changeset/base/271978 Log: #552 destination port not zero after parsing nat rule Approved by: glebius (mentor) Obtained from: netbsd CVS repo (r1.4), ipfilter CVS repo (r1.38) Modified: head/contrib/ipfilter/tools/ipnat_y.y Modified: head/contrib/ipfilter/tools/ipnat_y.y ============================================================================== --- head/contrib/ipfilter/tools/ipnat_y.y Mon Sep 22 16:21:25 2014 (r271977) +++ head/contrib/ipfilter/tools/ipnat_y.y Mon Sep 22 16:35:48 2014 (r271978) @@ -871,9 +871,9 @@ mapport: } free($2); if ($3.p1 < 0 || $3.p1 > 65535) - yyerror("invalid ICMP Id number"); + yyerror("invalid 1st ICMP Id number"); if ($3.p2 < 0 || $3.p2 > 65535) - yyerror("invalid ICMP Id number"); + yyerror("invalid 2nd ICMP Id number"); if (strcmp($2, "ipv6-icmp") == 0) { nat->in_pr[0] = IPPROTO_ICMPV6; nat->in_pr[1] = IPPROTO_ICMPV6; @@ -1058,7 +1058,7 @@ hash: IPNY_HASH { if (!(nat->in_flags ; portstuff: - compare portspec { $$.pc = $1; $$.p1 = $2; } + compare portspec { $$.pc = $1; $$.p1 = $2; $$.p2 = 0; } | portspec range portspec { $$.pc = $2; $$.p1 = $1; $$.p2 = $3; } ; @@ -1151,7 +1151,7 @@ proto: YY_NUMBER { $$ = $1; | YY_STR { $$ = getproto($1); free($1); if ($$ == -1) - yyerror("unknwon protocol"); + yyerror("unknown protocol"); if ($$ != IPPROTO_TCP && $$ != IPPROTO_UDP) suggest_port = 0; @@ -1172,7 +1172,8 @@ hostname: else #endif family = AF_INET; - bzero(&$$, sizeof($$)); + memset(&($$), 0, sizeof($$)); + memset(&addr, 0, sizeof(addr)); $$.f = family; if (gethost(family, $1, &addr) == 0) { @@ -1184,17 +1185,17 @@ hostname: } free($1); } - | YY_NUMBER { bzero(&$$, sizeof($$)); + | YY_NUMBER { memset(&($$), 0, sizeof($$)); $$.a.in4.s_addr = htonl($1); if ($$.a.in4.s_addr != 0) $$.f = AF_INET; } | ipv4 { $$ = $1; } - | YY_IPV6 { bzero(&$$, sizeof($$)); + | YY_IPV6 { memset(&($$), 0, sizeof($$)); $$.a = $1; $$.f = AF_INET6; } - | YY_NUMBER YY_IPV6 { bzero(&$$, sizeof($$)); + | YY_NUMBER YY_IPV6 { memset(&($$), 0, sizeof($$)); $$.a = $2; $$.f = AF_INET6; } @@ -1429,6 +1430,9 @@ setnatproto(p) nat->in_flags |= IPN_UDP; nat->in_flags &= ~IPN_TCP; break; +#ifdef USE_INET6 + case IPPROTO_ICMPV6 : +#endif case IPPROTO_ICMP : nat->in_flags &= ~IPN_TCPUDP; if (!(nat->in_flags & IPN_ICMPQUERY) && @@ -1508,7 +1512,7 @@ ipnat_addrule(fd, ioctlfunc, ptr) printnat(ipn, opts); if (opts & OPT_DEBUG) - binprint(ipn, sizeof(*ipn)); + binprint(ipn, ipn->in_size); if ((opts & OPT_ZERORULEST) != 0) { if ((*ioctlfunc)(fd, add, (void *)&obj) == -1) { From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 16:37:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7348D8F9; Mon, 22 Sep 2014 16:37:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44D3C210; Mon, 22 Sep 2014 16:37:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MGbcN0086920; Mon, 22 Sep 2014 16:37:38 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MGbcWT086919; Mon, 22 Sep 2014 16:37:38 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409221637.s8MGbcWT086919@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Mon, 22 Sep 2014 16:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271979 - head/usr.bin/mkimg/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:37:38 -0000 Author: marcel Date: Mon Sep 22 16:37:37 2014 New Revision: 271979 URL: http://svnweb.freebsd.org/changeset/base/271979 Log: Don't update the baseline file when the result of the test is identical to the baseline. Since we don't run gzip with the -n option, the output of gzip varies for identical result files if and when they are created at different time. Ouch... Rather than add -n and commit a 600K+ diff for the changes to all the .uu files, it's less of a churn to uudecode and gunzip the baseline file and compare that to the new result file to determine if the baseline file needs to be updated. This way, "atf-sh mkimg.sh rebase" can be run as many times as people like and a subsequent "svn status" will not show unnecessary diffs. Modified: head/usr.bin/mkimg/tests/mkimg.sh Modified: head/usr.bin/mkimg/tests/mkimg.sh ============================================================================== --- head/usr.bin/mkimg/tests/mkimg.sh Mon Sep 22 16:35:48 2014 (r271978) +++ head/usr.bin/mkimg/tests/mkimg.sh Mon Sep 22 16:37:37 2014 (r271979) @@ -68,6 +68,34 @@ makeimage() return 0 } +mkimg_rebase() +{ + local baseline image result tmpfile update + + image=$1 + result=$2 + + baseline=$image.gz.uu + update=yes + + if test -f $baseline; then + tmpfile=_tmp-baseline + uudecode -p $baseline | gunzip -c > $tmpfile + if cmp -s $tmpfile $result; then + update=no + fi + fi + + if test $update = yes; then + # Prevent keyword expansion when writing the keyword. + (echo -n '# $'; echo -n FreeBSD; echo '$') > $baseline + gzip -c $result | uuencode $image.gz >> $baseline + fi + + rm $image $result _tmp-* + return 0 +} + mkimg_test() { local blksz format geom scheme @@ -89,13 +117,10 @@ mkimg_test() image=`makeimage $format $scheme $blksz $geom img $partinfo` result=$image.out hexdump -C $image > $result - baseline=`atf_get_srcdir`/$image if test "x$mkimg_update_baseline" = "xyes"; then - # Prevent keyword expansion when writing the keyword. - (echo -n '# $'; echo -n FreeBSD; echo '$') > $image.gz.uu - gzip -c $result | uuencode $image.gz >> $image.gz.uu - rm $image $result _tmp-* + mkimg_rebase $image $result else + baseline=`atf_get_srcdir`/$image atf_check -s exit:0 cmp -s $baseline $result fi return 0 From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 16:45:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0945EB00; Mon, 22 Sep 2014 16:45:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8E4F330; Mon, 22 Sep 2014 16:45:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MGjS1p091404; Mon, 22 Sep 2014 16:45:28 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MGjSgp091403; Mon, 22 Sep 2014 16:45:28 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201409221645.s8MGjSgp091403@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 22 Sep 2014 16:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271980 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:45:29 -0000 Author: cy Date: Mon Sep 22 16:45:28 2014 New Revision: 271980 URL: http://svnweb.freebsd.org/changeset/base/271980 Log: Check for NULL before de-refencing; in particular sel is assigned to NULL, in the default case, and then couple of lines down we do sel-> Approved by: glebius (mentor) Obtained from: NetBSD CVS repo (r1.5) Modified: head/sys/contrib/ipfilter/netinet/ip_dstlist.c Modified: head/sys/contrib/ipfilter/netinet/ip_dstlist.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_dstlist.c Mon Sep 22 16:37:37 2014 (r271979) +++ head/sys/contrib/ipfilter/netinet/ip_dstlist.c Mon Sep 22 16:45:28 2014 (r271980) @@ -1134,7 +1134,7 @@ ipf_dstlist_select(fin, d) int family; int x; - if (d->ipld_dests == NULL || *d->ipld_dests == NULL) + if (d == NULL || d->ipld_dests == NULL || *d->ipld_dests == NULL) return NULL; family = fin->fin_family; @@ -1222,7 +1222,7 @@ ipf_dstlist_select(fin, d) break; } - if (sel->ipfd_dest.fd_addr.adf_family != family) + if (sel && sel->ipfd_dest.fd_addr.adf_family != family) sel = NULL; d->ipld_selected = sel; From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 16:52:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD10FE3A; Mon, 22 Sep 2014 16:52:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B81185F4; Mon, 22 Sep 2014 16:52:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MGqA6w095923; Mon, 22 Sep 2014 16:52:10 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MGqA3i095922; Mon, 22 Sep 2014 16:52:10 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409221652.s8MGqA3i095922@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Mon, 22 Sep 2014 16:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271981 - head/usr.bin/mkimg/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:52:10 -0000 Author: marcel Date: Mon Sep 22 16:52:09 2014 New Revision: 271981 URL: http://svnweb.freebsd.org/changeset/base/271981 Log: Rename the tests to something more meaningful. I spent way too long trying to get the test name right, failed, gave up and used a sequence number instead. When I realized it wasn't because of the number of underscores in the name that I really started to think. I didn't have braces around the variable names ... Thus: test_1 is now called apm_1x1_512_qcow, which gives you all you need to run mkimg by hand. Dumb-ass: marcel Modified: head/usr.bin/mkimg/tests/mkimg.sh Modified: head/usr.bin/mkimg/tests/mkimg.sh ============================================================================== --- head/usr.bin/mkimg/tests/mkimg.sh Mon Sep 22 16:45:28 2014 (r271980) +++ head/usr.bin/mkimg/tests/mkimg.sh Mon Sep 22 16:52:09 2014 (r271981) @@ -140,20 +140,17 @@ rebase_body() atf_init_test_cases() { - local B F G S nm nr + local B F G S nm - nr=1 for G in $mkimg_geom_list; do for B in $mkimg_blksz_list; do for S in $mkimg_scheme_list; do for F in $mkimg_format_list; do - nm="test_$nr" - # nm="$G_$B_$S_$F" + nm="${S}_${G}_${B}_${F}" atf_test_case $nm eval "${nm}_body() { mkimg_test $G $B $S $F; }" mkimg_tests="${mkimg_tests} ${nm}" atf_add_test_case $nm - nr=$((nr+1)) done done done From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 17:26:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A0AA6D4; Mon, 22 Sep 2014 17:26:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E96959EA; Mon, 22 Sep 2014 17:26:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MHQ7aP011696; Mon, 22 Sep 2014 17:26:07 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MHQ7RT011695; Mon, 22 Sep 2014 17:26:07 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201409221726.s8MHQ7RT011695@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 22 Sep 2014 17:26:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271982 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 17:26:08 -0000 Author: sbruno Date: Mon Sep 22 17:26:07 2014 New Revision: 271982 URL: http://svnweb.freebsd.org/changeset/base/271982 Log: Bump minimum linux compat version to support Centos6 ports updates for linux. Update linux compat minimum revision to match linux-c6 now in ports. This is a candidate for 10.1 R as it matches the current state of supported linux compat packages in the ports tree. PR: 187786 Reviewed by: xmj MFC after: 2 days Relnotes: yes Modified: head/sys/compat/linux/linux_mib.c Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Mon Sep 22 16:52:09 2014 (r271981) +++ head/sys/compat/linux/linux_mib.c Mon Sep 22 17:26:07 2014 (r271982) @@ -129,9 +129,9 @@ struct linux_prison { static struct linux_prison lprison0 = { .pr_osname = "Linux", - .pr_osrelease = "2.6.16", + .pr_osrelease = "2.6.18", .pr_oss_version = 0x030600, - .pr_osrel = 2006016 + .pr_osrel = 2006018 }; static unsigned linux_osd_jail_slot; From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 17:32:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19C0EB32; Mon, 22 Sep 2014 17:32:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05668B12; Mon, 22 Sep 2014 17:32:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MHWRwS015957; Mon, 22 Sep 2014 17:32:27 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MHWRS1015956; Mon, 22 Sep 2014 17:32:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409221732.s8MHWRS1015956@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 22 Sep 2014 17:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271983 - head/sys/opencrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 17:32:28 -0000 Author: jhb Date: Mon Sep 22 17:32:27 2014 New Revision: 271983 URL: http://svnweb.freebsd.org/changeset/base/271983 Log: Fix build for kernels without COMPAT_FREEBSD32. Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Mon Sep 22 17:26:07 2014 (r271982) +++ head/sys/opencrypto/cryptodev.c Mon Sep 22 17:32:27 2014 (r271983) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 18:29:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2886CD1; Mon, 22 Sep 2014 18:29:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD23A15F; Mon, 22 Sep 2014 18:29:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MITFf2041276; Mon, 22 Sep 2014 18:29:15 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MITFb8041275; Mon, 22 Sep 2014 18:29:15 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409221829.s8MITFb8041275@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 22 Sep 2014 18:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r271984 - stable/7/sys/modules/bxe X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 18:29:15 -0000 Author: davidcs Date: Mon Sep 22 18:29:14 2014 New Revision: 271984 URL: http://svnweb.freebsd.org/changeset/base/271984 Log: MFC r271726 Remove clean option in Makefile Modified: stable/7/sys/modules/bxe/Makefile Directory Properties: stable/7/ (props changed) stable/7/sys/ (props changed) Modified: stable/7/sys/modules/bxe/Makefile ============================================================================== --- stable/7/sys/modules/bxe/Makefile Mon Sep 22 17:32:27 2014 (r271983) +++ stable/7/sys/modules/bxe/Makefile Mon Sep 22 18:29:14 2014 (r271984) @@ -15,9 +15,4 @@ SRCS += bxe.c \ CFLAGS += -I${BXE} -clean: - rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms - rm -f *.o *.kld *.ko - rm -f @ machine x86 - .include From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 18:31:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48EAAF5D; Mon, 22 Sep 2014 18:31:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3366C21E; Mon, 22 Sep 2014 18:31:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MIVfbG044627; Mon, 22 Sep 2014 18:31:41 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MIVfoD044626; Mon, 22 Sep 2014 18:31:41 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409221831.s8MIVfoD044626@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 22 Sep 2014 18:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r271985 - stable/7/sys/modules/bce X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 18:31:41 -0000 Author: davidcs Date: Mon Sep 22 18:31:40 2014 New Revision: 271985 URL: http://svnweb.freebsd.org/changeset/base/271985 Log: MFC r271727 Remove clean option form Makefile Modified: stable/7/sys/modules/bce/Makefile Directory Properties: stable/7/ (props changed) stable/7/sys/ (props changed) Modified: stable/7/sys/modules/bce/Makefile ============================================================================== --- stable/7/sys/modules/bce/Makefile Mon Sep 22 18:29:14 2014 (r271984) +++ stable/7/sys/modules/bce/Makefile Mon Sep 22 18:31:40 2014 (r271985) @@ -5,9 +5,4 @@ SRCS= opt_bce.h if_bce.c miibus_if.h mii #CFLAGS += -DBCE_DEBUG=0 -clean: - rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms - rm -f *.o *.kld *.ko - rm -f @ machine x86 miibus_if.h miidevs.h opt_bce.h - .include From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 18:36:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DFD8223; Mon, 22 Sep 2014 18:36:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 194032FB; Mon, 22 Sep 2014 18:36:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MIabdW045775; Mon, 22 Sep 2014 18:36:37 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MIabAX045774; Mon, 22 Sep 2014 18:36:37 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409221836.s8MIabAX045774@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 22 Sep 2014 18:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r271986 - stable/7/sys/dev/bxe X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 18:36:38 -0000 Author: davidcs Date: Mon Sep 22 18:36:37 2014 New Revision: 271986 URL: http://svnweb.freebsd.org/changeset/base/271986 Log: MFC r271728 For ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() check bxe_debug flag before printing error message. Modified: stable/7/sys/dev/bxe/ecore_sp.h Directory Properties: stable/7/ (props changed) stable/7/sys/ (props changed) Modified: stable/7/sys/dev/bxe/ecore_sp.h ============================================================================== --- stable/7/sys/dev/bxe/ecore_sp.h Mon Sep 22 18:31:40 2014 (r271985) +++ stable/7/sys/dev/bxe/ecore_sp.h Mon Sep 22 18:36:37 2014 (r271986) @@ -246,14 +246,23 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m #else +extern unsigned long bxe_debug; + +#define BXE_DEBUG_ECORE_DBG_BREAK_IF 0x01 +#define BXE_DEBUG_ECORE_BUG 0x02 +#define BXE_DEBUG_ECORE_BUG_ON 0x04 + #define ECORE_DBG_BREAK_IF(exp) \ - printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + if (bxe_debug & BXE_DEBUG_ECORE_DBG_BREAK_IF) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); #define ECORE_BUG(exp) \ - printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + if (bxe_debug & BXE_DEBUG_ECORE_BUG) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); #define ECORE_BUG_ON(exp) \ - printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + if (bxe_debug & BXE_DEBUG_ECORE_BUG_ON) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); #endif /* #ifdef ECORE_STOP_ON_ERROR */ From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 18:57:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 278969A1; Mon, 22 Sep 2014 18:57:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11FA86E0; Mon, 22 Sep 2014 18:57:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MIvbhf055675; Mon, 22 Sep 2014 18:57:37 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MIvb7l055674; Mon, 22 Sep 2014 18:57:37 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409221857.s8MIvb7l055674@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 22 Sep 2014 18:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271987 - stable/8/sys/modules/bxe X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 18:57:38 -0000 Author: davidcs Date: Mon Sep 22 18:57:37 2014 New Revision: 271987 URL: http://svnweb.freebsd.org/changeset/base/271987 Log: MFC r271726 Remove clean option from Makefile Modified: stable/8/sys/modules/bxe/Makefile Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/modules/ (props changed) Modified: stable/8/sys/modules/bxe/Makefile ============================================================================== --- stable/8/sys/modules/bxe/Makefile Mon Sep 22 18:36:37 2014 (r271986) +++ stable/8/sys/modules/bxe/Makefile Mon Sep 22 18:57:37 2014 (r271987) @@ -15,9 +15,4 @@ SRCS += bxe.c \ CFLAGS += -I${BXE} -clean: - rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms - rm -f *.o *.kld *.ko - rm -f @ machine x86 - .include From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 19:00:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48146C27; Mon, 22 Sep 2014 19:00:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3280D762; Mon, 22 Sep 2014 19:00:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MJ0Vhs056959; Mon, 22 Sep 2014 19:00:31 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MJ0V0q056958; Mon, 22 Sep 2014 19:00:31 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409221900.s8MJ0V0q056958@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 22 Sep 2014 19:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271988 - stable/10/sys/modules/bxe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 19:00:31 -0000 Author: davidcs Date: Mon Sep 22 19:00:30 2014 New Revision: 271988 URL: http://svnweb.freebsd.org/changeset/base/271988 Log: MFC r271726 remove clean option from Makefile Approved by: re(gjb) Modified: stable/10/sys/modules/bxe/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/modules/bxe/Makefile ============================================================================== --- stable/10/sys/modules/bxe/Makefile Mon Sep 22 18:57:37 2014 (r271987) +++ stable/10/sys/modules/bxe/Makefile Mon Sep 22 19:00:30 2014 (r271988) @@ -15,9 +15,4 @@ SRCS += bxe.c \ CFLAGS += -I${BXE} -clean: - rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms - rm -f *.o *.kld *.ko - rm -f @ machine x86 - .include From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 19:03:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA141E54; Mon, 22 Sep 2014 19:03:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4A4582D; Mon, 22 Sep 2014 19:03:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MJ3Njn060311; Mon, 22 Sep 2014 19:03:23 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MJ3NWC060310; Mon, 22 Sep 2014 19:03:23 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409221903.s8MJ3NWC060310@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 22 Sep 2014 19:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271989 - stable/8/sys/modules/bce X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 19:03:23 -0000 Author: davidcs Date: Mon Sep 22 19:03:23 2014 New Revision: 271989 URL: http://svnweb.freebsd.org/changeset/base/271989 Log: MFC r271727 remove clean option from Makefile Modified: stable/8/sys/modules/bce/Makefile Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/modules/ (props changed) Modified: stable/8/sys/modules/bce/Makefile ============================================================================== --- stable/8/sys/modules/bce/Makefile Mon Sep 22 19:00:30 2014 (r271988) +++ stable/8/sys/modules/bce/Makefile Mon Sep 22 19:03:23 2014 (r271989) @@ -5,9 +5,4 @@ SRCS= opt_bce.h if_bce.c miibus_if.h mii #CFLAGS += -DBCE_DEBUG=0 -clean: - rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms - rm -f *.o *.kld *.ko - rm -f @ machine x86 miibus_if.h miidevs.h opt_bce.h - .include From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 19:07:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 656BB192; Mon, 22 Sep 2014 19:07:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51B42870; Mon, 22 Sep 2014 19:07:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MJ7SML060914; Mon, 22 Sep 2014 19:07:28 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MJ7SbN060913; Mon, 22 Sep 2014 19:07:28 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201409221907.s8MJ7SbN060913@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 22 Sep 2014 19:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271990 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 19:07:28 -0000 Author: sbruno Date: Mon Sep 22 19:07:27 2014 New Revision: 271990 URL: http://svnweb.freebsd.org/changeset/base/271990 Log: UPDATING: linux-c6 support notes, and how to fall back to linux-f10. PR: 187786 MFC after: 2 days Relnotes: yes Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Sep 22 19:03:23 2014 (r271989) +++ head/UPDATING Mon Sep 22 19:07:27 2014 (r271990) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140922: + At svn r271982, The default linux compat kernel ABI has been adjusted + to 2.6.18 in support of the linux-c6 compat ports infrastructure + update. If you wish to continue using the linux-f10 compat ports, + add compat.linux.osrelease=2.6.16 to your local sysctl.conf. Users are + encouraged to update their linux-compat packages to linux-c6 during + their next update cycle. + 20140729: The ofwfb driver, used to provide a graphics console on PowerPC when using vt(4), no longer allows mmap() of all of physical memory. This From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 19:09:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A090146F; Mon, 22 Sep 2014 19:09:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81A6F8A0; Mon, 22 Sep 2014 19:09:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MJ95VD061449; Mon, 22 Sep 2014 19:09:05 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MJ956f061448; Mon, 22 Sep 2014 19:09:05 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409221909.s8MJ956f061448@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 22 Sep 2014 19:09:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r271991 - stable/8/sys/dev/bxe X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 19:09:05 -0000 Author: davidcs Date: Mon Sep 22 19:09:04 2014 New Revision: 271991 URL: http://svnweb.freebsd.org/changeset/base/271991 Log: MFC r271728 For ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() check bxe_debug flag before printing error message. Modified: stable/8/sys/dev/bxe/ecore_sp.h Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/bxe/ecore_sp.h ============================================================================== --- stable/8/sys/dev/bxe/ecore_sp.h Mon Sep 22 19:07:27 2014 (r271990) +++ stable/8/sys/dev/bxe/ecore_sp.h Mon Sep 22 19:09:04 2014 (r271991) @@ -246,14 +246,23 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m #else +extern unsigned long bxe_debug; + +#define BXE_DEBUG_ECORE_DBG_BREAK_IF 0x01 +#define BXE_DEBUG_ECORE_BUG 0x02 +#define BXE_DEBUG_ECORE_BUG_ON 0x04 + #define ECORE_DBG_BREAK_IF(exp) \ - printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + if (bxe_debug & BXE_DEBUG_ECORE_DBG_BREAK_IF) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); #define ECORE_BUG(exp) \ - printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + if (bxe_debug & BXE_DEBUG_ECORE_BUG) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); #define ECORE_BUG_ON(exp) \ - printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + if (bxe_debug & BXE_DEBUG_ECORE_BUG_ON) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); #endif /* #ifdef ECORE_STOP_ON_ERROR */ From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 19:14:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DC227ED; Mon, 22 Sep 2014 19:14:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E144E99D; Mon, 22 Sep 2014 19:14:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MJESOE065745; Mon, 22 Sep 2014 19:14:28 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MJER1L065733; Mon, 22 Sep 2014 19:14:27 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201409221914.s8MJER1L065733@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 22 Sep 2014 19:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271992 - in head: . share/man/man9 sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 19:14:29 -0000 Author: lwhsu (ports committer) Date: Mon Sep 22 19:14:27 2014 New Revision: 271992 URL: http://svnweb.freebsd.org/changeset/base/271992 Log: Reflect the chanages in sleepqueue.h and subr_sleepqueue.c - Priority argument is introduced to sleepq_*wait* in r177085 - sleepq_calc_signal_retval is removed from implementation - sleepq_catch_signals is internal now Differential Revision: https://reviews.freebsd.org/D794 Reviewed by: jhb Approved by: jhb Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/sleepqueue.9 head/sys/sys/sleepqueue.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Sep 22 19:09:04 2014 (r271991) +++ head/ObsoleteFiles.inc Mon Sep 22 19:14:27 2014 (r271992) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20140922: sleepq_calc_signal_retval.9 and sleepq_catch_signals.9 removed +OLD_FILES+=usr/share/man/man9/sleepq_calc_signal_retval.9.gz +OLD_FILES+=usr/share/man/man9/sleepq_catch_signals.9.gz # 20140917: hv_kvpd rc.d script removed in favor of devd configuration OLD_FILES+=etc/rc.d/hv_kvpd # 20140814: libopie version bump Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Sep 22 19:09:04 2014 (r271991) +++ head/share/man/man9/Makefile Mon Sep 22 19:14:27 2014 (r271992) @@ -1388,8 +1388,6 @@ MLINKS+=sleepqueue.9 init_sleepqueues.9 sleepqueue.9 sleepq_add.9 \ sleepqueue.9 sleepq_alloc.9 \ sleepqueue.9 sleepq_broadcast.9 \ - sleepqueue.9 sleepq_calc_signal_retval.9 \ - sleepqueue.9 sleepq_catch_signals.9 \ sleepqueue.9 sleepq_free.9 \ sleepqueue.9 sleepq_lookup.9 \ sleepqueue.9 sleepq_lock.9 \ Modified: head/share/man/man9/sleepqueue.9 ============================================================================== --- head/share/man/man9/sleepqueue.9 Mon Sep 22 19:09:04 2014 (r271991) +++ head/share/man/man9/sleepqueue.9 Mon Sep 22 19:14:27 2014 (r271992) @@ -32,8 +32,6 @@ .Nm sleepq_add , .Nm sleepq_alloc , .Nm sleepq_broadcast , -.Nm sleepq_calc_signal_retval , -.Nm sleepq_catch_signals , .Nm sleepq_free , .Nm sleepq_lock , .Nm sleepq_lookup , @@ -62,10 +60,6 @@ .Fn sleepq_alloc "void" .Ft int .Fn sleepq_broadcast "void *wchan" "int flags" "int pri" "int queue" -.Ft int -.Fn sleepq_calc_signal_retval "int sig" -.Ft int -.Fn sleepq_catch_signals "void *wchan" .Ft void .Fn sleepq_free "struct sleepqueue *sq" .Ft struct sleepqueue * @@ -86,15 +80,15 @@ .Ft u_int .Fn sleepq_sleepcnt "void *wchan" "int queue" .Ft int -.Fn sleepq_timedwait "void *wchan" +.Fn sleepq_timedwait "void *wchan" "int pri" .Ft int -.Fn sleepq_timedwait_sig "void *wchan" "int signal_caught" +.Fn sleepq_timedwait_sig "void *wchan" "int pri" .Ft int .Fn sleepq_type "void *wchan" .Ft void -.Fn sleepq_wait "void *wchan" +.Fn sleepq_wait "void *wchan" "int pri" .Ft int -.Fn sleepq_wait_sig "void *wchan" +.Fn sleepq_wait_sig "void *wchan" "int pri" .Sh DESCRIPTION Sleep queues provide a mechanism for suspending execution of a thread until some condition is met. @@ -252,17 +246,6 @@ allows to pass additional .Fn callout_reset_sbt flags. .Pp -The current thread may be marked interruptible by calling -.Fn sleepq_catch_signals -with -.Fa wchan -set to the wait channel. -This function returns a signal number if there are any pending signals for -the current thread and 0 if there is not a pending signal. -The sleep queue chain associated with argument -.Fa wchan -should have been locked by a prior call to -.Fn sleepq_lock . .Pp Once the thread is ready to suspend, one of the wait functions is called to put the current thread to sleep @@ -289,12 +272,9 @@ The sleep queue chain associated with ar needs to have been locked with a prior call to .Fn sleepq_lock . The -.Fa signal_caught -parameter to -.Fn sleepq_timedwait_sig -specifies if a previous call to -.Fn sleepq_catch_signals -found a pending signal. +.Fa pri +argument is used to set the priority of the thread when it is awakened. +If it is set to zero, the thread's priority is left alone. .Pp When the thread is resumed, the wait functions return a non-zero value if the thread was awakened due to @@ -304,20 +284,6 @@ If the sleep timed out, then is returned. If the sleep was interrupted by something other than a signal, then some other return value will be returned. -If zero is returned after resuming from an interruptible sleep, -then -.Fn sleepq_calc_signal_retval -should be called to determine if the sleep was interrupted by a signal. -If so, -.Fn sleepq_calc_signal_retval -returns -.Er ERESTART -if the interrupting signal is restartable and -.Er EINTR -otherwise. -If the sleep was not interrupted by a signal, -.Fn sleepq_calc_signal_retval -will return 0. .Pp A sleeping thread is normally resumed by the .Fn sleepq_broadcast Modified: head/sys/sys/sleepqueue.h ============================================================================== --- head/sys/sys/sleepqueue.h Mon Sep 22 19:09:04 2014 (r271991) +++ head/sys/sys/sleepqueue.h Mon Sep 22 19:14:27 2014 (r271992) @@ -46,13 +46,6 @@ * call sleepq_set_timeout() after sleepq_add() to setup a timeout. It * should then use one of the sleepq_timedwait() functions to block. * - * If the thread wants the sleep to be interruptible by signals, it can - * call sleepq_catch_signals() after sleepq_add(). It should then use - * one of the sleepq_wait_sig() functions to block. After the thread has - * been resumed, it should call sleepq_calc_signal_retval() to determine - * if it should return EINTR or ERESTART passing in the value returned from - * the earlier call to sleepq_catch_signals(). - * * A thread is normally resumed from a sleep queue by either the * sleepq_signal() or sleepq_broadcast() functions. Sleepq_signal() wakes * the thread with the highest priority that is sleeping on the specified From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 19:28:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05ABC235; Mon, 22 Sep 2014 19:28:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E44BCB25; Mon, 22 Sep 2014 19:28:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MJSL8Z071235; Mon, 22 Sep 2014 19:28:21 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MJSLs8071234; Mon, 22 Sep 2014 19:28:21 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409221928.s8MJSLs8071234@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 22 Sep 2014 19:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271993 - stable/9/sys/modules/bxe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 19:28:22 -0000 Author: davidcs Date: Mon Sep 22 19:28:21 2014 New Revision: 271993 URL: http://svnweb.freebsd.org/changeset/base/271993 Log: MFC r271726 remove clean option from Makefile Modified: stable/9/sys/modules/bxe/Makefile Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/modules/bxe/Makefile ============================================================================== --- stable/9/sys/modules/bxe/Makefile Mon Sep 22 19:14:27 2014 (r271992) +++ stable/9/sys/modules/bxe/Makefile Mon Sep 22 19:28:21 2014 (r271993) @@ -15,9 +15,4 @@ SRCS += bxe.c \ CFLAGS += -I${BXE} -clean: - rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms - rm -f *.o *.kld *.ko - rm -f @ machine x86 - .include From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 19:37:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1FD552C; Mon, 22 Sep 2014 19:37:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCDA6C0F; Mon, 22 Sep 2014 19:37:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MJb35W076074; Mon, 22 Sep 2014 19:37:03 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MJb3ls076073; Mon, 22 Sep 2014 19:37:03 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409221937.s8MJb3ls076073@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 22 Sep 2014 19:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271994 - stable/9/sys/modules/bce X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 19:37:04 -0000 Author: davidcs Date: Mon Sep 22 19:37:03 2014 New Revision: 271994 URL: http://svnweb.freebsd.org/changeset/base/271994 Log: MFC r271727 remove clean option from Makefile Modified: stable/9/sys/modules/bce/Makefile Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/modules/bce/Makefile ============================================================================== --- stable/9/sys/modules/bce/Makefile Mon Sep 22 19:28:21 2014 (r271993) +++ stable/9/sys/modules/bce/Makefile Mon Sep 22 19:37:03 2014 (r271994) @@ -5,9 +5,4 @@ SRCS= opt_bce.h if_bce.c miibus_if.h mii #CFLAGS += -DBCE_DEBUG=0 -clean: - rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms - rm -f *.o *.kld *.ko - rm -f @ machine x86 miibus_if.h miidevs.h opt_bce.h - .include From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 19:42:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FD0CA23; Mon, 22 Sep 2014 19:42:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE44BCF9; Mon, 22 Sep 2014 19:42:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MJgIj1080380; Mon, 22 Sep 2014 19:42:18 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MJgIYE080379; Mon, 22 Sep 2014 19:42:18 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409221942.s8MJgIYE080379@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 22 Sep 2014 19:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r271995 - stable/9/sys/dev/bxe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 19:42:19 -0000 Author: davidcs Date: Mon Sep 22 19:42:18 2014 New Revision: 271995 URL: http://svnweb.freebsd.org/changeset/base/271995 Log: MFC r271728 For ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() check bxe_debug flag before printing error message. Modified: stable/9/sys/dev/bxe/ecore_sp.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/ecore_sp.h ============================================================================== --- stable/9/sys/dev/bxe/ecore_sp.h Mon Sep 22 19:37:03 2014 (r271994) +++ stable/9/sys/dev/bxe/ecore_sp.h Mon Sep 22 19:42:18 2014 (r271995) @@ -246,14 +246,23 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m #else +extern unsigned long bxe_debug; + +#define BXE_DEBUG_ECORE_DBG_BREAK_IF 0x01 +#define BXE_DEBUG_ECORE_BUG 0x02 +#define BXE_DEBUG_ECORE_BUG_ON 0x04 + #define ECORE_DBG_BREAK_IF(exp) \ - printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + if (bxe_debug & BXE_DEBUG_ECORE_DBG_BREAK_IF) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); #define ECORE_BUG(exp) \ - printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + if (bxe_debug & BXE_DEBUG_ECORE_BUG) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); #define ECORE_BUG_ON(exp) \ - printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + if (bxe_debug & BXE_DEBUG_ECORE_BUG_ON) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); #endif /* #ifdef ECORE_STOP_ON_ERROR */ From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 19:56:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A93A7FBE; Mon, 22 Sep 2014 19:56:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A21FE37; Mon, 22 Sep 2014 19:56:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MJuMEl085916; Mon, 22 Sep 2014 19:56:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MJuLaK085913; Mon, 22 Sep 2014 19:56:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409221956.s8MJuLaK085913@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 22 Sep 2014 19:56:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271996 - in stable/10/sys/boot: amd64/boot1.efi efi/include efi/libefi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 19:56:22 -0000 Author: emaste Date: Mon Sep 22 19:56:21 2014 New Revision: 271996 URL: http://svnweb.freebsd.org/changeset/base/271996 Log: MFC r271762: Switch to text mode in UEFI boot The loader previously failed to display on MacBooks and other systems where the UEFI firmware remained in graphics mode. Submitted by: Rafael Espindola Approved by: re Added: stable/10/sys/boot/efi/include/eficonsctl.h - copied unchanged from r271762, head/sys/boot/efi/include/eficonsctl.h Modified: stable/10/sys/boot/amd64/boot1.efi/boot1.c stable/10/sys/boot/efi/libefi/libefi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/amd64/boot1.efi/boot1.c ============================================================================== --- stable/10/sys/boot/amd64/boot1.efi/boot1.c Mon Sep 22 19:42:18 2014 (r271995) +++ stable/10/sys/boot/amd64/boot1.efi/boot1.c Mon Sep 22 19:56:21 2014 (r271996) @@ -26,6 +26,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #define _PATH_LOADER "/boot/loader.efi" #define _PATH_KERNEL "/boot/kernel/kernel" @@ -97,6 +98,7 @@ strcmp(const char *s1, const char *s2) static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; +static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; static EFI_BLOCK_IO *bootdev; static EFI_DEVICE_PATH *bootdevpath; @@ -109,11 +111,20 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, E UINTN i, nparts = sizeof(handles); EFI_STATUS status; EFI_DEVICE_PATH *devpath; + EFI_BOOT_SERVICES *BS; + EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; char *path = _PATH_LOADER; systab = Xsystab; image = Ximage; + BS = systab->BootServices; + status = BS->LocateProtocol(&ConsoleControlGUID, NULL, + (VOID **)&ConsoleControl); + if (status == EFI_SUCCESS) + (void)ConsoleControl->SetMode(ConsoleControl, + EfiConsoleControlScreenText); + printf(" \n>> FreeBSD EFI boot block\n"); printf(" Loader path: %s\n", path); Copied: stable/10/sys/boot/efi/include/eficonsctl.h (from r271762, head/sys/boot/efi/include/eficonsctl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/efi/include/eficonsctl.h Mon Sep 22 19:56:21 2014 (r271996, copy of r271762, head/sys/boot/efi/include/eficonsctl.h) @@ -0,0 +1,253 @@ +/*- + * Copyright (c) 2004 - 2010, Intel Corporation. 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + */ + +/* + * Original Module Name: ConsoleControl.h + * Abstract: Abstraction of a Text mode or GOP/UGA screen + */ + +/* $FreeBSD$ */ + +#ifndef _EFI_CONS_CTL_H +#define _EFI_CONS_CTL_H + +#define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \ + { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} } + +typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL EFI_CONSOLE_CONTROL_PROTOCOL; + + +typedef enum { + EfiConsoleControlScreenText, + EfiConsoleControlScreenGraphics, + EfiConsoleControlScreenMaxValue +} EFI_CONSOLE_CONTROL_SCREEN_MODE; + + +typedef +EFI_STATUS +(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE) ( + IN EFI_CONSOLE_CONTROL_PROTOCOL *This, + OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode, + OUT BOOLEAN *GopUgaExists, OPTIONAL + OUT BOOLEAN *StdInLocked OPTIONAL + ) +/*++ + + Routine Description: + Return the current video mode information. Also returns info about existence + of Graphics Output devices or UGA Draw devices in system, and if the Std In + device is locked. All the arguments are optional and only returned if a non + NULL pointer is passed in. + + Arguments: + This - Protocol instance pointer. + Mode - Are we in text of grahics mode. + GopUgaExists - TRUE if Console Spliter has found a GOP or UGA device + StdInLocked - TRUE if StdIn device is keyboard locked + + Returns: + EFI_SUCCESS - Mode information returned. + +--*/ +; + + +typedef +EFI_STATUS +(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE) ( + IN EFI_CONSOLE_CONTROL_PROTOCOL *This, + IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode + ) +/*++ + + Routine Description: + Set the current mode to either text or graphics. Graphics is + for Quiet Boot. + + Arguments: + This - Protocol instance pointer. + Mode - Mode to set the + + Returns: + EFI_SUCCESS - Mode information returned. + +--*/ +; + + +typedef +EFI_STATUS +(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN) ( + IN EFI_CONSOLE_CONTROL_PROTOCOL *This, + IN CHAR16 *Password + ) +/*++ + + Routine Description: + Lock Std In devices until Password is typed. + + Arguments: + This - Protocol instance pointer. + Password - Password needed to unlock screen. NULL means unlock keyboard + + Returns: + EFI_SUCCESS - Mode information returned. + EFI_DEVICE_ERROR - Std In not locked + +--*/ +; + + + +struct _EFI_CONSOLE_CONTROL_PROTOCOL { + EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE GetMode; + EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE SetMode; + EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN LockStdIn; +}; + +extern EFI_GUID gEfiConsoleControlProtocolGuid; + +#endif +/*- + * Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved. + * + * This program and the accompanying materials are licensed and made available + * under the terms and conditions of the BSD License which accompanies this + * distribution. The full text of the license may be found at + * http://opensource.org/licenses/bsd-license.php + * + * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR + * IMPLIED. + * + * Original Module Name: ConsoleControl.h + * Abstract: Abstraction of a Text mode or GOP/UGA screen + */ + +/* $FreeBSD */ + +#ifndef _EFI_CONS_CTL_H +#define _EFI_CONS_CTL_H + +#define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \ + { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} } + +typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL EFI_CONSOLE_CONTROL_PROTOCOL; + + +typedef enum { + EfiConsoleControlScreenText, + EfiConsoleControlScreenGraphics, + EfiConsoleControlScreenMaxValue +} EFI_CONSOLE_CONTROL_SCREEN_MODE; + + +typedef +EFI_STATUS +(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE) ( + IN EFI_CONSOLE_CONTROL_PROTOCOL *This, + OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode, + OUT BOOLEAN *GopUgaExists, OPTIONAL + OUT BOOLEAN *StdInLocked OPTIONAL + ) +/*++ + + Routine Description: + Return the current video mode information. Also returns info about existence + of Graphics Output devices or UGA Draw devices in system, and if the Std In + device is locked. All the arguments are optional and only returned if a non + NULL pointer is passed in. + + Arguments: + This - Protocol instance pointer. + Mode - Are we in text of grahics mode. + GopUgaExists - TRUE if Console Spliter has found a GOP or UGA device + StdInLocked - TRUE if StdIn device is keyboard locked + + Returns: + EFI_SUCCESS - Mode information returned. + +--*/ +; + + +typedef +EFI_STATUS +(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE) ( + IN EFI_CONSOLE_CONTROL_PROTOCOL *This, + IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode + ) +/*++ + + Routine Description: + Set the current mode to either text or graphics. Graphics is + for Quiet Boot. + + Arguments: + This - Protocol instance pointer. + Mode - Mode to set the + + Returns: + EFI_SUCCESS - Mode information returned. + +--*/ +; + + +typedef +EFI_STATUS +(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN) ( + IN EFI_CONSOLE_CONTROL_PROTOCOL *This, + IN CHAR16 *Password + ) +/*++ + + Routine Description: + Lock Std In devices until Password is typed. + + Arguments: + This - Protocol instance pointer. + Password - Password needed to unlock screen. NULL means unlock keyboard + + Returns: + EFI_SUCCESS - Mode information returned. + EFI_DEVICE_ERROR - Std In not locked + +--*/ +; + + + +struct _EFI_CONSOLE_CONTROL_PROTOCOL { + EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE GetMode; + EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE SetMode; + EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN LockStdIn; +}; + +extern EFI_GUID gEfiConsoleControlProtocolGuid; + +#endif Modified: stable/10/sys/boot/efi/libefi/libefi.c ============================================================================== --- stable/10/sys/boot/efi/libefi/libefi.c Mon Sep 22 19:42:18 2014 (r271995) +++ stable/10/sys/boot/efi/libefi/libefi.c Mon Sep 22 19:56:21 2014 (r271996) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -82,6 +83,9 @@ void efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table) { static EFI_GUID image_protocol = LOADED_IMAGE_PROTOCOL; + static EFI_GUID console_control_protocol = + EFI_CONSOLE_CONTROL_PROTOCOL_GUID; + EFI_CONSOLE_CONTROL_PROTOCOL *console_control = NULL; EFI_LOADED_IMAGE *img; CHAR16 *argp, *args, **argv; EFI_STATUS status; @@ -92,6 +96,12 @@ efi_main(EFI_HANDLE image_handle, EFI_SY BS = ST->BootServices; RS = ST->RuntimeServices; + status = BS->LocateProtocol(&console_control_protocol, NULL, + (VOID **)&console_control); + if (status == EFI_SUCCESS) + (void)console_control->SetMode(console_control, + EfiConsoleControlScreenText); + heapsize = 2 * 1024 * 1024; status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, EFI_SIZE_TO_PAGES(heapsize), &heap); From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 20:05:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 425D12AF; Mon, 22 Sep 2014 20:05:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 127DBF3C; Mon, 22 Sep 2014 20:05:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MK4xlb090650; Mon, 22 Sep 2014 20:04:59 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MK4x3j090649; Mon, 22 Sep 2014 20:04:59 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201409222004.s8MK4x3j090649@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 22 Sep 2014 20:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271997 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 20:05:00 -0000 Author: brueffer Date: Mon Sep 22 20:04:59 2014 New Revision: 271997 URL: http://svnweb.freebsd.org/changeset/base/271997 Log: Spelling, grammar and punctuation fixes. Approved by: re (gjb) Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Sep 22 19:56:21 2014 (r271996) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon Sep 22 20:04:59 2014 (r271997) @@ -624,7 +624,7 @@ Kernel RPC code, which is a base of NFS server took multiple optimizations, that significantly improved its performance and - SMP scapability. + SMP scalability. The iSCSI initiator has been updated to @@ -840,7 +840,7 @@ The maximum number of SCSI ports increased from 32 to - 128 + 128. Improved zvol @@ -867,7 +867,7 @@ this can easily double &man.zfs.8; performance or reduce CPU usage in half. It was originally disabled due to memory and KVA exhaustion problem reports, which - should be resolved due to several change in the VM + should be resolved due to several changes in the VM subsystem. The Blowfish password format - implementation updated. Support for $2b$ has + implementation has been updated. Support for $2b$ has been added, allowing use of passwords greater than 256 characters long. From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 20:10:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 451CA6D0; Mon, 22 Sep 2014 20:10:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F870C0; Mon, 22 Sep 2014 20:10:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MKAkGc094750; Mon, 22 Sep 2014 20:10:46 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MKAkpT094749; Mon, 22 Sep 2014 20:10:46 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409222010.s8MKAkpT094749@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Mon, 22 Sep 2014 20:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271998 - stable/10/sys/ia64/ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 20:10:46 -0000 Author: marcel Date: Mon Sep 22 20:10:45 2014 New Revision: 271998 URL: http://svnweb.freebsd.org/changeset/base/271998 Log: Make sure all memory updates are made visible before we let go of the thread in cpu_switch(). It's otherwise possible that on another CPU the thread continues from stale context data. Note that this is prominent on newer CPUs, like the Montecito, that really take advantage of the weak memory ordering. First generation Itanium 2 is not that aggressive and does not need this. This is a direct commit to stable/10. Approved by: re@ (gjb) Modified: stable/10/sys/ia64/ia64/machdep.c Modified: stable/10/sys/ia64/ia64/machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/machdep.c Mon Sep 22 20:04:59 2014 (r271997) +++ stable/10/sys/ia64/ia64/machdep.c Mon Sep 22 20:10:45 2014 (r271998) @@ -465,6 +465,8 @@ cpu_switch(struct thread *old, struct th oldpcb->pcb_current_pmap = pmap_switch(newpcb->pcb_current_pmap); + ia64_mf(); + atomic_store_rel_ptr(&old->td_lock, mtx); #if defined(SCHED_ULE) && defined(SMP) From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 20:34:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34B99DD6; Mon, 22 Sep 2014 20:34:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03725371; Mon, 22 Sep 2014 20:34:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MKYdbN005718; Mon, 22 Sep 2014 20:34:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MKYasg005704; Mon, 22 Sep 2014 20:34:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409222034.s8MKYasg005704@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 22 Sep 2014 20:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271999 - in stable/10/sys: amd64/amd64 amd64/include i386/i386 i386/include i386/isa x86/acpica X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 20:34:40 -0000 Author: jhb Date: Mon Sep 22 20:34:36 2014 New Revision: 271999 URL: http://svnweb.freebsd.org/changeset/base/271999 Log: MFC 270850,271053,271192,271717: Save and restore FPU state across suspend and resume on i386. - Create a separate structure for per-CPU state saved across suspend and resume that is a superset of a pcb. - Store the FPU state for suspend and resume in the new structure (for amd64, this moves it out of the PCB) - On both i386 and amd64, all of the FPU suspend/resume handling is now done in C. Approved by: re (hrs) Modified: stable/10/sys/amd64/amd64/cpu_switch.S stable/10/sys/amd64/amd64/fpu.c stable/10/sys/amd64/amd64/genassym.c stable/10/sys/amd64/amd64/mp_machdep.c stable/10/sys/amd64/include/fpu.h stable/10/sys/amd64/include/pcb.h stable/10/sys/i386/i386/mp_machdep.c stable/10/sys/i386/i386/swtch.s stable/10/sys/i386/include/npx.h stable/10/sys/i386/include/pcb.h stable/10/sys/i386/isa/npx.c stable/10/sys/x86/acpica/acpi_wakeup.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/cpu_switch.S ============================================================================== --- stable/10/sys/amd64/amd64/cpu_switch.S Mon Sep 22 20:10:45 2014 (r271998) +++ stable/10/sys/amd64/amd64/cpu_switch.S Mon Sep 22 20:34:36 2014 (r271999) @@ -399,10 +399,6 @@ ENTRY(savectx) rdmsr movl %eax,PCB_SFMASK(%rdi) movl %edx,PCB_SFMASK+4(%rdi) - movl xsave_mask,%eax - movl %eax,PCB_XSMASK(%rdi) - movl xsave_mask+4,%eax - movl %eax,PCB_XSMASK+4(%rdi) sgdt PCB_GDT(%rdi) sidt PCB_IDT(%rdi) @@ -467,12 +463,9 @@ ENTRY(resumectx) movl PCB_SFMASK(%rdi),%eax wrmsr - /* Restore CR0 except for FPU mode. */ + /* Restore CR0, CR2, CR4 and CR3. */ movq PCB_CR0(%rdi),%rax - andq $~(CR0_EM | CR0_TS),%rax movq %rax,%cr0 - - /* Restore CR2, CR4 and CR3. */ movq PCB_CR2(%rdi),%rax movq %rax,%cr2 movq PCB_CR4(%rdi),%rax @@ -510,26 +503,6 @@ ENTRY(resumectx) movq PCB_DR7(%rdi),%rax movq %rax,%dr7 - /* Restore FPU state. */ - fninit - movq PCB_FPUSUSPEND(%rdi),%rbx - movq PCB_XSMASK(%rdi),%rax - testq %rax,%rax - jz 1f - movq %rax,%rdx - shrq $32,%rdx - movl $XCR0,%ecx - xsetbv - xrstor (%rbx) - jmp 2f -1: - fxrstor (%rbx) -2: - - /* Reload CR0. */ - movq PCB_CR0(%rdi),%rax - movq %rax,%cr0 - /* Restore other callee saved registers. */ movq PCB_R15(%rdi),%r15 movq PCB_R14(%rdi),%r14 Modified: stable/10/sys/amd64/amd64/fpu.c ============================================================================== --- stable/10/sys/amd64/amd64/fpu.c Mon Sep 22 20:10:45 2014 (r271998) +++ stable/10/sys/amd64/amd64/fpu.c Mon Sep 22 20:34:36 2014 (r271999) @@ -173,6 +173,20 @@ fpususpend(void *addr) load_cr0(cr0); } +void +fpuresume(void *addr) +{ + u_long cr0; + + cr0 = rcr0(); + stop_emulating(); + fninit(); + if (use_xsave) + load_xcr(XCR0, xsave_mask); + fpurestore(addr); + load_cr0(cr0); +} + /* * Enable XSAVE if supported and allowed by user. * Calculate the xsave_mask. Modified: stable/10/sys/amd64/amd64/genassym.c ============================================================================== --- stable/10/sys/amd64/amd64/genassym.c Mon Sep 22 20:10:45 2014 (r271998) +++ stable/10/sys/amd64/amd64/genassym.c Mon Sep 22 20:34:36 2014 (r271999) @@ -163,8 +163,6 @@ ASSYM(PCB_STAR, offsetof(struct pcb, pcb ASSYM(PCB_LSTAR, offsetof(struct pcb, pcb_lstar)); ASSYM(PCB_CSTAR, offsetof(struct pcb, pcb_cstar)); ASSYM(PCB_SFMASK, offsetof(struct pcb, pcb_sfmask)); -ASSYM(PCB_XSMASK, offsetof(struct pcb, pcb_xsmask)); -ASSYM(PCB_FPUSUSPEND, offsetof(struct pcb, pcb_fpususpend)); ASSYM(PCB_SIZE, sizeof(struct pcb)); ASSYM(PCB_FULL_IRET, PCB_FULL_IRET); ASSYM(PCB_DBREGS, PCB_DBREGS); Modified: stable/10/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/mp_machdep.c Mon Sep 22 20:10:45 2014 (r271998) +++ stable/10/sys/amd64/amd64/mp_machdep.c Mon Sep 22 20:34:36 2014 (r271999) @@ -101,7 +101,7 @@ char *nmi_stack; void *dpcpu; struct pcb stoppcbs[MAXCPU]; -struct pcb **susppcbs; +struct susppcb **susppcbs; /* Variables needed for SMP tlb shootdown. */ vm_offset_t smp_tlb_addr2; @@ -1463,11 +1463,12 @@ cpususpend_handler(void) mtx_assert(&smp_ipi_mtx, MA_NOTOWNED); cpu = PCPU_GET(cpuid); - if (savectx(susppcbs[cpu])) { - fpususpend(susppcbs[cpu]->pcb_fpususpend); + if (savectx(&susppcbs[cpu]->sp_pcb)) { + fpususpend(susppcbs[cpu]->sp_fpususpend); wbinvd(); CPU_SET_ATOMIC(cpu, &suspended_cpus); } else { + fpuresume(susppcbs[cpu]->sp_fpususpend); pmap_init_pat(); initializecpu(); PCPU_SET(switchtime, 0); Modified: stable/10/sys/amd64/include/fpu.h ============================================================================== --- stable/10/sys/amd64/include/fpu.h Mon Sep 22 20:10:45 2014 (r271998) +++ stable/10/sys/amd64/include/fpu.h Mon Sep 22 20:34:36 2014 (r271999) @@ -58,6 +58,7 @@ int fpuformat(void); int fpugetregs(struct thread *td); void fpuinit(void); void fpurestore(void *addr); +void fpuresume(void *addr); void fpusave(void *addr); int fpusetregs(struct thread *td, struct savefpu *addr, char *xfpustate, size_t xfpustate_size); Modified: stable/10/sys/amd64/include/pcb.h ============================================================================== --- stable/10/sys/amd64/include/pcb.h Mon Sep 22 20:10:45 2014 (r271998) +++ stable/10/sys/amd64/include/pcb.h Mon Sep 22 20:34:36 2014 (r271999) @@ -97,14 +97,18 @@ struct pcb { register_t pcb_lstar; register_t pcb_cstar; register_t pcb_sfmask; - register_t pcb_xsmask; - - /* fpu context for suspend/resume */ - void *pcb_fpususpend; struct savefpu *pcb_save; - uint64_t pcb_pad[3]; + uint64_t pcb_pad[5]; +}; + +/* Per-CPU state saved during suspend and resume. */ +struct susppcb { + struct pcb sp_pcb; + + /* fpu context for suspend/resume */ + void *sp_fpususpend; }; #endif Modified: stable/10/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/10/sys/i386/i386/mp_machdep.c Mon Sep 22 20:10:45 2014 (r271998) +++ stable/10/sys/i386/i386/mp_machdep.c Mon Sep 22 20:34:36 2014 (r271999) @@ -147,7 +147,7 @@ void *bootstacks[MAXCPU]; static void *dpcpu; struct pcb stoppcbs[MAXCPU]; -struct pcb **susppcbs = NULL; +struct susppcb **susppcbs; /* Variables needed for SMP tlb shootdown. */ vm_offset_t smp_tlb_addr1; @@ -1523,10 +1523,12 @@ cpususpend_handler(void) mtx_assert(&smp_ipi_mtx, MA_NOTOWNED); cpu = PCPU_GET(cpuid); - if (savectx(susppcbs[cpu])) { + if (savectx(&susppcbs[cpu]->sp_pcb)) { + npxsuspend(&susppcbs[cpu]->sp_fpususpend); wbinvd(); CPU_SET_ATOMIC(cpu, &suspended_cpus); } else { + npxresume(&susppcbs[cpu]->sp_fpususpend); pmap_init_pat(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); Modified: stable/10/sys/i386/i386/swtch.s ============================================================================== --- stable/10/sys/i386/i386/swtch.s Mon Sep 22 20:10:45 2014 (r271998) +++ stable/10/sys/i386/i386/swtch.s Mon Sep 22 20:34:36 2014 (r271999) @@ -416,45 +416,6 @@ ENTRY(savectx) sldt PCB_LDT(%ecx) str PCB_TR(%ecx) -#ifdef DEV_NPX - /* - * If fpcurthread == NULL, then the npx h/w state is irrelevant and the - * state had better already be in the pcb. This is true for forks - * but not for dumps (the old book-keeping with FP flags in the pcb - * always lost for dumps because the dump pcb has 0 flags). - * - * If fpcurthread != NULL, then we have to save the npx h/w state to - * fpcurthread's pcb and copy it to the requested pcb, or save to the - * requested pcb and reload. Copying is easier because we would - * have to handle h/w bugs for reloading. We used to lose the - * parent's npx state for forks by forgetting to reload. - */ - pushfl - CLI - movl PCPU(FPCURTHREAD),%eax - testl %eax,%eax - je 1f - - pushl %ecx - movl TD_PCB(%eax),%eax - movl PCB_SAVEFPU(%eax),%eax - pushl %eax - pushl %eax - call npxsave - addl $4,%esp - popl %eax - popl %ecx - - pushl $PCB_SAVEFPU_SIZE - leal PCB_USERFPU(%ecx),%ecx - pushl %ecx - pushl %eax - call bcopy - addl $12,%esp -1: - popfl -#endif /* DEV_NPX */ - movl $1,%eax ret END(savectx) @@ -519,10 +480,6 @@ ENTRY(resumectx) movl PCB_DR7(%ecx),%eax movl %eax,%dr7 -#ifdef DEV_NPX - /* XXX FIX ME */ -#endif - /* Restore other registers */ movl PCB_EDI(%ecx),%edi movl PCB_ESI(%ecx),%esi Modified: stable/10/sys/i386/include/npx.h ============================================================================== --- stable/10/sys/i386/include/npx.h Mon Sep 22 20:10:45 2014 (r271998) +++ stable/10/sys/i386/include/npx.h Mon Sep 22 20:34:36 2014 (r271999) @@ -53,8 +53,10 @@ void npxexit(struct thread *td); int npxformat(void); int npxgetregs(struct thread *td); void npxinit(void); +void npxresume(union savefpu *addr); void npxsave(union savefpu *addr); void npxsetregs(struct thread *td, union savefpu *addr); +void npxsuspend(union savefpu *addr); int npxtrap_x87(void); int npxtrap_sse(void); void npxuserinited(struct thread *); Modified: stable/10/sys/i386/include/pcb.h ============================================================================== --- stable/10/sys/i386/include/pcb.h Mon Sep 22 20:10:45 2014 (r271998) +++ stable/10/sys/i386/include/pcb.h Mon Sep 22 20:34:36 2014 (r271999) @@ -92,6 +92,11 @@ struct pcb { uint16_t pcb_tr; }; +struct susppcb { + struct pcb sp_pcb; + union savefpu sp_fpususpend; +}; + #ifdef _KERNEL struct trapframe; Modified: stable/10/sys/i386/isa/npx.c ============================================================================== --- stable/10/sys/i386/isa/npx.c Mon Sep 22 20:10:45 2014 (r271998) +++ stable/10/sys/i386/isa/npx.c Mon Sep 22 20:34:36 2014 (r271999) @@ -761,6 +761,43 @@ npxsave(addr) PCPU_SET(fpcurthread, NULL); } +/* + * Unconditionally save the current co-processor state across suspend and + * resume. + */ +void +npxsuspend(union savefpu *addr) +{ + register_t cr0; + + if (!hw_float) + return; + if (PCPU_GET(fpcurthread) == NULL) { + *addr = npx_initialstate; + return; + } + cr0 = rcr0(); + clts(); + fpusave(addr); + load_cr0(cr0); +} + +void +npxresume(union savefpu *addr) +{ + register_t cr0; + + if (!hw_float) + return; + + cr0 = rcr0(); + clts(); + npxinit(); + stop_emulating(); + fpurstor(addr); + load_cr0(cr0); +} + void npxdrop() { Modified: stable/10/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- stable/10/sys/x86/acpica/acpi_wakeup.c Mon Sep 22 20:10:45 2014 (r271998) +++ stable/10/sys/x86/acpica/acpi_wakeup.c Mon Sep 22 20:34:36 2014 (r271999) @@ -30,6 +30,10 @@ #include __FBSDID("$FreeBSD$"); +#ifdef __i386__ +#include "opt_npx.h" +#endif + #include #include #include @@ -71,10 +75,10 @@ extern int acpi_resume_beep; extern int acpi_reset_video; #ifdef SMP -extern struct pcb **susppcbs; +extern struct susppcb **susppcbs; static cpuset_t suspcpus; #else -static struct pcb **susppcbs; +static struct susppcb **susppcbs; #endif static void *acpi_alloc_wakeup_handler(void); @@ -113,14 +117,15 @@ acpi_stop_beep(void *arg) static int acpi_wakeup_ap(struct acpi_softc *sc, int cpu) { + struct pcb *pcb; int vector = (WAKECODE_PADDR(sc) >> 12) & 0xff; int apic_id = cpu_apic_ids[cpu]; int ms; - WAKECODE_FIXUP(wakeup_pcb, struct pcb *, susppcbs[cpu]); - WAKECODE_FIXUP(wakeup_gdt, uint16_t, susppcbs[cpu]->pcb_gdt.rd_limit); - WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, - susppcbs[cpu]->pcb_gdt.rd_base); + pcb = &susppcbs[cpu]->sp_pcb; + WAKECODE_FIXUP(wakeup_pcb, struct pcb *, pcb); + WAKECODE_FIXUP(wakeup_gdt, uint16_t, pcb->pcb_gdt.rd_limit); + WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, pcb->pcb_gdt.rd_base); ipi_startup(apic_id, vector); @@ -184,6 +189,7 @@ int acpi_sleep_machdep(struct acpi_softc *sc, int state) { ACPI_STATUS status; + struct pcb *pcb; if (sc->acpi_wakeaddr == 0ul) return (-1); /* couldn't alloc wake memory */ @@ -200,9 +206,12 @@ acpi_sleep_machdep(struct acpi_softc *sc intr_suspend(); - if (savectx(susppcbs[0])) { + pcb = &susppcbs[0]->sp_pcb; + if (savectx(pcb)) { #ifdef __amd64__ - fpususpend(susppcbs[0]->pcb_fpususpend); + fpususpend(susppcbs[0]->sp_fpususpend); +#elif defined(DEV_NPX) + npxsuspend(&susppcbs[0]->sp_fpususpend); #endif #ifdef SMP if (!CPU_EMPTY(&suspcpus) && suspend_cpus(suspcpus) == 0) { @@ -215,13 +224,11 @@ acpi_sleep_machdep(struct acpi_softc *sc WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); #ifndef __amd64__ - WAKECODE_FIXUP(wakeup_cr4, register_t, susppcbs[0]->pcb_cr4); + WAKECODE_FIXUP(wakeup_cr4, register_t, pcb->pcb_cr4); #endif - WAKECODE_FIXUP(wakeup_pcb, struct pcb *, susppcbs[0]); - WAKECODE_FIXUP(wakeup_gdt, uint16_t, - susppcbs[0]->pcb_gdt.rd_limit); - WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, - susppcbs[0]->pcb_gdt.rd_base); + WAKECODE_FIXUP(wakeup_pcb, struct pcb *, pcb); + WAKECODE_FIXUP(wakeup_gdt, uint16_t, pcb->pcb_gdt.rd_limit); + WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, pcb->pcb_gdt.rd_base); /* Call ACPICA to enter the desired sleep state */ if (state == ACPI_STATE_S4 && sc->acpi_s4bios) @@ -237,6 +244,12 @@ acpi_sleep_machdep(struct acpi_softc *sc for (;;) ia32_pause(); + } else { +#ifdef __amd64__ + fpuresume(susppcbs[0]->sp_fpususpend); +#elif defined(DEV_NPX) + npxresume(&susppcbs[0]->sp_fpususpend); +#endif } return (1); /* wakeup successfully */ @@ -315,7 +328,7 @@ acpi_alloc_wakeup_handler(void) for (i = 0; i < mp_ncpus; i++) { susppcbs[i] = malloc(sizeof(**susppcbs), M_DEVBUF, M_WAITOK); #ifdef __amd64__ - susppcbs[i]->pcb_fpususpend = alloc_fpusave(M_WAITOK); + susppcbs[i]->sp_fpususpend = alloc_fpusave(M_WAITOK); #endif } From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 20:38:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5E0D21F; Mon, 22 Sep 2014 20:38:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A00513CE; Mon, 22 Sep 2014 20:38:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MKc3WT006254; Mon, 22 Sep 2014 20:38:03 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MKc2If006244; Mon, 22 Sep 2014 20:38:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409222038.s8MKc2If006244@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 22 Sep 2014 20:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272000 - head/sys/dev/tws X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 20:38:03 -0000 Author: jhb Date: Mon Sep 22 20:38:01 2014 New Revision: 272000 URL: http://svnweb.freebsd.org/changeset/base/272000 Log: Switch from timeout(9) to callout(9). In addition, do not teardown the IRQ handler while resetting the controller and add some missing teardown actions in detach. Reviewed by: delphij Modified: head/sys/dev/tws/tws.c head/sys/dev/tws/tws.h head/sys/dev/tws/tws_cam.c head/sys/dev/tws/tws_hdm.c head/sys/dev/tws/tws_hdm.h head/sys/dev/tws/tws_services.c Modified: head/sys/dev/tws/tws.c ============================================================================== --- head/sys/dev/tws/tws.c Mon Sep 22 20:34:36 2014 (r271999) +++ head/sys/dev/tws/tws.c Mon Sep 22 20:38:01 2014 (r272000) @@ -198,6 +198,7 @@ tws_attach(device_t dev) mtx_init( &sc->sim_lock, "tws_sim_lock", NULL, MTX_DEF); mtx_init( &sc->gen_lock, "tws_gen_lock", NULL, MTX_DEF); mtx_init( &sc->io_lock, "tws_io_lock", NULL, MTX_DEF | MTX_RECURSE); + callout_init(&sc->stats_timer, CALLOUT_MPSAFE); if ( tws_init_trace_q(sc) == FAILURE ) printf("trace init failure\n"); @@ -408,11 +409,20 @@ tws_detach(device_t dev) TWS_TRACE(sc, "bus release mem resource", 0, sc->reg_res_id); } + for ( i=0; i< tws_queue_depth; i++) { + if (sc->reqs[i].dma_map) + bus_dmamap_destroy(sc->data_tag, sc->reqs[i].dma_map); + callout_drain(&sc->reqs[i].timeout); + } + + callout_drain(&sc->stats_timer); free(sc->reqs, M_TWS); free(sc->sense_bufs, M_TWS); free(sc->scan_ccb, M_TWS); if (sc->ioctl_data_mem) bus_dmamem_free(sc->data_tag, sc->ioctl_data_mem, sc->ioctl_data_map); + if (sc->data_tag) + bus_dma_tag_destroy(sc->data_tag); free(sc->aen_q.q, M_TWS); free(sc->trace_q.q, M_TWS); mtx_destroy(&sc->q_lock); @@ -709,7 +719,7 @@ tws_init_reqs(struct tws_softc *sc, u_in sc->reqs[i].cmd_pkt->hdr.header_desc.size_header = 128; - callout_handle_init(&sc->reqs[i].thandle); + callout_init(&sc->reqs[i].timeout, CALLOUT_MPSAFE); sc->reqs[i].state = TWS_REQ_STATE_FREE; if ( i >= TWS_RESERVED_REQS ) tws_q_insert_tail(sc, &sc->reqs[i], TWS_FREE_Q); @@ -859,7 +869,7 @@ tws_get_request(struct tws_softc *sc, u_ r->error_code = TWS_REQ_RET_INVALID; r->cb = NULL; r->ccb_ptr = NULL; - r->thandle.callout = NULL; + callout_stop(&r->timeout); r->next = r->prev = NULL; r->state = ((type == TWS_REQ_TYPE_SCSI_IO) ? TWS_REQ_STATE_TRAN : TWS_REQ_STATE_BUSY); Modified: head/sys/dev/tws/tws.h ============================================================================== --- head/sys/dev/tws/tws.h Mon Sep 22 20:34:36 2014 (r271999) +++ head/sys/dev/tws/tws.h Mon Sep 22 20:38:01 2014 (r272000) @@ -268,4 +268,5 @@ struct tws_softc { union ccb *scan_ccb; /* pointer to a ccb */ struct tws_request *q_head[TWS_MAX_QS]; /* head pointers to q's */ struct tws_request *q_tail[TWS_MAX_QS]; /* tail pointers to q's */ + struct callout stats_timer; }; Modified: head/sys/dev/tws/tws_cam.c ============================================================================== --- head/sys/dev/tws/tws_cam.c Mon Sep 22 20:34:36 2014 (r271999) +++ head/sys/dev/tws/tws_cam.c Mon Sep 22 20:38:01 2014 (r272000) @@ -341,7 +341,7 @@ tws_scsi_complete(struct tws_request *re tws_q_remove_request(sc, req, TWS_BUSY_Q); mtx_unlock(&sc->q_lock); - untimeout(tws_timeout, req, req->thandle); + callout_stop(&req->timeout); tws_unmap_request(req->sc, req); @@ -362,7 +362,7 @@ tws_getset_param_complete(struct tws_req TWS_TRACE_DEBUG(sc, "getset complete", req, req->request_id); - untimeout(tws_timeout, req, req->thandle); + callout_stop(&req->timeout); tws_unmap_request(sc, req); free(req->data, M_TWS); @@ -380,7 +380,7 @@ tws_aen_complete(struct tws_request *req TWS_TRACE_DEBUG(sc, "aen complete", 0, req->request_id); - untimeout(tws_timeout, req, req->thandle); + callout_stop(&req->timeout); tws_unmap_request(sc, req); sense = (struct tws_command_header *)req->data; @@ -454,7 +454,7 @@ tws_cmd_complete(struct tws_request *req { struct tws_softc *sc = req->sc; - untimeout(tws_timeout, req, req->thandle); + callout_stop(&req->timeout); tws_unmap_request(sc, req); } @@ -561,7 +561,7 @@ tws_scsi_err_complete(struct tws_request xpt_done(ccb); mtx_unlock(&sc->sim_lock); - untimeout(tws_timeout, req, req->thandle); + callout_stop(&req->timeout); tws_unmap_request(req->sc, req); mtx_lock(&sc->q_lock); tws_q_remove_request(sc, req, TWS_BUSY_Q); @@ -591,7 +591,7 @@ tws_drain_busy_queue(struct tws_softc *s mtx_unlock(&sc->q_lock); while ( req ) { TWS_TRACE_DEBUG(sc, "moved to TWS_COMPLETE_Q", 0, req->request_id); - untimeout(tws_timeout, req, req->thandle); + callout_stop(&req->timeout); req->error_code = TWS_REQ_RET_RESET; ccb = (union ccb *)(req->ccb_ptr); @@ -622,7 +622,7 @@ tws_drain_reserved_reqs(struct tws_softc r = &sc->reqs[TWS_REQ_TYPE_AEN_FETCH]; if ( r->state != TWS_REQ_STATE_FREE ) { TWS_TRACE_DEBUG(sc, "reset aen req", 0, 0); - untimeout(tws_timeout, r, r->thandle); + callout_stop(&r->timeout); tws_unmap_request(sc, r); free(r->data, M_TWS); r->state = TWS_REQ_STATE_FREE; @@ -638,7 +638,7 @@ tws_drain_reserved_reqs(struct tws_softc r = &sc->reqs[TWS_REQ_TYPE_GETSET_PARAM]; if ( r->state != TWS_REQ_STATE_FREE ) { TWS_TRACE_DEBUG(sc, "reset setparam req", 0, 0); - untimeout(tws_timeout, r, r->thandle); + callout_stop(&r->timeout); tws_unmap_request(sc, r); free(r->data, M_TWS); r->state = TWS_REQ_STATE_FREE; @@ -747,7 +747,7 @@ tws_execute_scsi(struct tws_softc *sc, u * and submit the I/O. */ sc->stats.scsi_ios++; - req->thandle = timeout(tws_timeout, req, (ccb_h->timeout * hz)/1000); + callout_reset(&req->timeout, (ccb_h->timeout * hz) / 1000, tws_timeout, req); error = tws_map_request(sc, req); return(error); } @@ -785,7 +785,7 @@ tws_send_scsi_cmd(struct tws_softc *sc, bzero(req->data, TWS_SECTOR_SIZE); req->flags = TWS_DIR_IN; - req->thandle = timeout(tws_timeout, req, (TWS_IO_TIMEOUT * hz)); + callout_reset(&req->timeout, (TWS_IO_TIMEOUT * hz), tws_timeout, req); error = tws_map_request(sc, req); return(error); @@ -832,7 +832,7 @@ tws_set_param(struct tws_softc *sc, u_in param->parameter_size_bytes = (u_int16_t)param_size; memcpy(param->data, data, param_size); - req->thandle = timeout(tws_timeout, req, (TWS_IOCTL_TIMEOUT * hz)); + callout_reset(&req->timeout, (TWS_IOCTL_TIMEOUT * hz), tws_timeout, req); error = tws_map_request(sc, req); return(error); @@ -1168,7 +1168,6 @@ tws_timeout(void *arg) return; } - tws_teardown_intr(sc); xpt_freeze_simq(sc->sim, 1); tws_send_event(sc, TWS_RESET_START); @@ -1191,7 +1190,6 @@ tws_timeout(void *arg) mtx_unlock(&sc->gen_lock); xpt_release_simq(sc->sim, 1); - tws_setup_intr(sc, sc->irqs); } void @@ -1205,7 +1203,6 @@ tws_reset(void *arg) return; } - tws_teardown_intr(sc); xpt_freeze_simq(sc->sim, 1); tws_send_event(sc, TWS_RESET_START); @@ -1222,7 +1219,6 @@ tws_reset(void *arg) mtx_unlock(&sc->gen_lock); xpt_release_simq(sc->sim, 1); - tws_setup_intr(sc, sc->irqs); } static void Modified: head/sys/dev/tws/tws_hdm.c ============================================================================== --- head/sys/dev/tws/tws_hdm.c Mon Sep 22 20:34:36 2014 (r271999) +++ head/sys/dev/tws/tws_hdm.c Mon Sep 22 20:38:01 2014 (r272000) @@ -161,7 +161,7 @@ tws_init_connect(struct tws_softc *sc, u req->error_code = TWS_REQ_RET_INVALID; req->cb = NULL; req->ccb_ptr = NULL; - req->thandle.callout = NULL; + callout_stop(&req->timeout); req->next = req->prev = NULL; req->state = TWS_REQ_STATE_BUSY; #endif // 0 Modified: head/sys/dev/tws/tws_hdm.h ============================================================================== --- head/sys/dev/tws/tws_hdm.h Mon Sep 22 20:34:36 2014 (r271999) +++ head/sys/dev/tws/tws_hdm.h Mon Sep 22 20:38:01 2014 (r272000) @@ -410,7 +410,7 @@ struct tws_request { void (*cb)(struct tws_request *); /* callback func */ bus_dmamap_t dma_map; /* dma map */ union ccb *ccb_ptr; /* pointer to ccb */ - struct callout_handle thandle; /* handle to req timeout */ + struct callout timeout; /* request timeout timer */ struct tws_softc *sc; /* pointer back to ctlr softc */ struct tws_request *next; /* pointer to next request */ Modified: head/sys/dev/tws/tws_services.c ============================================================================== --- head/sys/dev/tws/tws_services.c Mon Sep 22 20:34:36 2014 (r271999) +++ head/sys/dev/tws/tws_services.c Mon Sep 22 20:38:01 2014 (r272000) @@ -395,7 +395,6 @@ tws_print_stats(void *arg) , sc->stats.num_intrs); TWS_TRACE(sc, "reqs(ioctls, scsi)", sc->stats.ioctls , sc->stats.scsi_ios); - timeout(tws_print_stats, sc, 300*hz); - + callout_reset(&sc->stats_timer, 300 * hz, tws_print_stats, sc); } /* --------------------- misc service end --------------------- */ From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 20:53:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F1609A7; Mon, 22 Sep 2014 20:53:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED6927E9; Mon, 22 Sep 2014 20:53:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MKrH82015085; Mon, 22 Sep 2014 20:53:17 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MKrH6h015084; Mon, 22 Sep 2014 20:53:17 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409222053.s8MKrH6h015084@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 22 Sep 2014 20:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272001 - stable/10/sys/modules/bce X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 20:53:18 -0000 Author: davidcs Date: Mon Sep 22 20:53:17 2014 New Revision: 272001 URL: http://svnweb.freebsd.org/changeset/base/272001 Log: MFC r271727 remove clean option from Makefile Approved by: re(gjb) Modified: stable/10/sys/modules/bce/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/modules/bce/Makefile ============================================================================== --- stable/10/sys/modules/bce/Makefile Mon Sep 22 20:38:01 2014 (r272000) +++ stable/10/sys/modules/bce/Makefile Mon Sep 22 20:53:17 2014 (r272001) @@ -5,9 +5,4 @@ SRCS= opt_bce.h if_bce.c miibus_if.h mii #CFLAGS += -DBCE_DEBUG=0 -clean: - rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms - rm -f *.o *.kld *.ko - rm -f @ machine x86 miibus_if.h miidevs.h opt_bce.h - .include From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 21:02:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60C23CC6; Mon, 22 Sep 2014 21:02:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3668F4; Mon, 22 Sep 2014 21:02:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ML2dgh020242; Mon, 22 Sep 2014 21:02:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ML2dXQ020240; Mon, 22 Sep 2014 21:02:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201409222102.s8ML2dXQ020240@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 22 Sep 2014 21:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272002 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 21:02:39 -0000 Author: markj Date: Mon Sep 22 21:02:38 2014 New Revision: 272002 URL: http://svnweb.freebsd.org/changeset/base/272002 Log: Remove some variables that are no longer used as of r271413. Reported by: Coverity CID: 1238924 X-MFC-With: r271413 Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Mon Sep 22 20:53:17 2014 (r272001) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c Mon Sep 22 21:02:38 2014 (r272002) @@ -121,12 +121,12 @@ dtrace_dof_init(void) #if !defined(sun) Elf *e; Elf_Scn *scn = NULL; - Elf_Data *symtabdata = NULL, *dynsymdata = NULL, *dofdata = NULL; + Elf_Data *dofdata = NULL; dof_hdr_t *dof_next = NULL; GElf_Shdr shdr; int efd; char *s; - size_t shstridx, symtabidx = 0, dynsymidx = 0; + size_t shstridx; #endif if (getenv("DTRACE_DOF_INIT_DISABLE") != NULL) @@ -166,15 +166,9 @@ dtrace_dof_init(void) dof = NULL; while ((scn = elf_nextscn(e, scn)) != NULL) { gelf_getshdr(scn, &shdr); - if (shdr.sh_type == SHT_SYMTAB) { - symtabidx = shdr.sh_link; - symtabdata = elf_getdata(scn, NULL); - } else if (shdr.sh_type == SHT_DYNSYM) { - dynsymidx = shdr.sh_link; - dynsymdata = elf_getdata(scn, NULL); - } else if (shdr.sh_type == SHT_SUNW_dof) { + if (shdr.sh_type == SHT_SUNW_dof) { s = elf_strptr(e, shstridx, shdr.sh_name); - if (s != NULL && strcmp(s, ".SUNW_dof") == 0) { + if (s != NULL && strcmp(s, ".SUNW_dof") == 0) { dofdata = elf_getdata(scn, NULL); dof = dofdata->d_buf; } From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 21:09:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1622F84; Mon, 22 Sep 2014 21:09:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBCB594D; Mon, 22 Sep 2014 21:09:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8ML9UdA021425; Mon, 22 Sep 2014 21:09:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8ML9U1U021424; Mon, 22 Sep 2014 21:09:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201409222109.s8ML9U1U021424@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 22 Sep 2014 21:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272003 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 21:09:31 -0000 Author: markj Date: Mon Sep 22 21:09:30 2014 New Revision: 272003 URL: http://svnweb.freebsd.org/changeset/base/272003 Log: Remove an incorrect close(2) call that was added in r271413. Reported by: Coverity CID: 1238923 X-MFC-With: r271413 Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Mon Sep 22 21:02:38 2014 (r272002) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Mon Sep 22 21:09:30 2014 (r272003) @@ -1819,7 +1819,6 @@ dtrace_program_link(dtrace_hdl_t *dtp, d "failed to write %s: %s", file, strerror(errno))); } #else - (void)close(fd); if (status != 0) return (dt_link_error(dtp, NULL, -1, NULL, "failed to write %s: %s", tfile, From owner-svn-src-all@FreeBSD.ORG Mon Sep 22 21:12:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82A7C179; Mon, 22 Sep 2014 21:12:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CD3E9F3; Mon, 22 Sep 2014 21:12:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MLCVGk025314; Mon, 22 Sep 2014 21:12:31 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MLCVdQ025313; Mon, 22 Sep 2014 21:12:31 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201409222112.s8MLCVdQ025313@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 22 Sep 2014 21:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272004 - stable/10/sys/dev/bxe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 21:12:31 -0000 Author: davidcs Date: Mon Sep 22 21:12:30 2014 New Revision: 272004 URL: http://svnweb.freebsd.org/changeset/base/272004 Log: MFC r271728 For ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() check bxe_debug flag before printing error message. Approved by: re(gjb) Modified: stable/10/sys/dev/bxe/ecore_sp.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/ecore_sp.h ============================================================================== --- stable/10/sys/dev/bxe/ecore_sp.h Mon Sep 22 21:09:30 2014 (r272003) +++ stable/10/sys/dev/bxe/ecore_sp.h Mon Sep 22 21:12:30 2014 (r272004) @@ -246,14 +246,23 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m #else +extern unsigned long bxe_debug; + +#define BXE_DEBUG_ECORE_DBG_BREAK_IF 0x01 +#define BXE_DEBUG_ECORE_BUG 0x02 +#define BXE_DEBUG_ECORE_BUG_ON 0x04 + #define ECORE_DBG_BREAK_IF(exp) \ - printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + if (bxe_debug & BXE_DEBUG_ECORE_DBG_BREAK_IF) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); #define ECORE_BUG(exp) \ - printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + if (bxe_debug & BXE_DEBUG_ECORE_BUG) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); #define ECORE_BUG_ON(exp) \ - printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + if (bxe_debug & BXE_DEBUG_ECORE_BUG_ON) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); #endif /* #ifdef ECORE_STOP_ON_ERROR */ From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 00:43:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C45065DE; Tue, 23 Sep 2014 00:43:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A58A1FB0; Tue, 23 Sep 2014 00:43:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N0hJe0025393; Tue, 23 Sep 2014 00:43:19 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N0hJgZ025392; Tue, 23 Sep 2014 00:43:19 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201409230043.s8N0hJgZ025392@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Tue, 23 Sep 2014 00:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272006 - stable/10/sys/geom/eli X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 00:43:20 -0000 Author: cperciva Date: Tue Sep 23 00:43:18 2014 New Revision: 272006 URL: http://svnweb.freebsd.org/changeset/base/272006 Log: MFC r271664: Cache GELI passphrases entered at the console during the boot process, in order to improve user-friendliness when a system has multiple disks encrypted using the same passphrase. Relnotes: yes Approved by: re (gjb) Modified: stable/10/sys/geom/eli/g_eli.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/eli/g_eli.c ============================================================================== --- stable/10/sys/geom/eli/g_eli.c Mon Sep 22 22:38:54 2014 (r272005) +++ stable/10/sys/geom/eli/g_eli.c Tue Sep 23 00:43:18 2014 (r272006) @@ -88,6 +88,24 @@ TUNABLE_INT("kern.geom.eli.batch", &g_el SYSCTL_UINT(_kern_geom_eli, OID_AUTO, batch, CTLFLAG_RW, &g_eli_batch, 0, "Use crypto operations batching"); +/* + * Passphrase cached during boot, in order to be more user-friendly if + * there are multiple providers using the same passphrase. + */ +static char cached_passphrase[256]; +static u_int g_eli_boot_passcache = 1; +TUNABLE_INT("kern.geom.eli.boot_passcache", &g_eli_boot_passcache); +SYSCTL_UINT(_kern_geom_eli, OID_AUTO, boot_passcache, CTLFLAG_RD, + &g_eli_boot_passcache, 0, + "Passphrases are cached during boot process for possible reuse"); +static void +zero_boot_passcache(void * dummy) +{ + + memset(cached_passphrase, 0, sizeof(cached_passphrase)); +} +EVENTHANDLER_DEFINE(mountroot, zero_boot_passcache, NULL, 0); + static eventhandler_tag g_eli_pre_sync = NULL; static int g_eli_destroy_geom(struct gctl_req *req, struct g_class *mp, @@ -1065,7 +1083,7 @@ g_eli_taste(struct g_class *mp, struct g tries = g_eli_tries; } - for (i = 0; i < tries; i++) { + for (i = 0; i <= tries; i++) { g_eli_crypto_hmac_init(&ctx, NULL, 0); /* @@ -1089,9 +1107,19 @@ g_eli_taste(struct g_class *mp, struct g /* Ask for the passphrase if defined. */ if (md.md_iterations >= 0) { - printf("Enter passphrase for %s: ", pp->name); - cngets(passphrase, sizeof(passphrase), - g_eli_visible_passphrase); + /* Try first with cached passphrase. */ + if (i == 0) { + if (!g_eli_boot_passcache) + continue; + memcpy(passphrase, cached_passphrase, + sizeof(passphrase)); + } else { + printf("Enter passphrase for %s: ", pp->name); + cngets(passphrase, sizeof(passphrase), + g_eli_visible_passphrase); + memcpy(cached_passphrase, passphrase, + sizeof(passphrase)); + } } /* @@ -1121,15 +1149,18 @@ g_eli_taste(struct g_class *mp, struct g error = g_eli_mkey_decrypt(&md, key, mkey, &nkey); bzero(key, sizeof(key)); if (error == -1) { - if (i == tries - 1) { + if (i == tries) { G_ELI_DEBUG(0, "Wrong key for %s. No tries left.", pp->name); g_eli_keyfiles_clear(pp->name); return (NULL); } - G_ELI_DEBUG(0, "Wrong key for %s. Tries left: %u.", - pp->name, tries - i - 1); + if (i > 0) { + G_ELI_DEBUG(0, + "Wrong key for %s. Tries left: %u.", + pp->name, tries - i); + } /* Try again. */ continue; } else if (error > 0) { From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 01:17:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 818CB8EE; Tue, 23 Sep 2014 01:17:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D8512E9; Tue, 23 Sep 2014 01:17:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N1HNq0039819; Tue, 23 Sep 2014 01:17:23 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N1HN6n039818; Tue, 23 Sep 2014 01:17:23 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201409230117.s8N1HN6n039818@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Tue, 23 Sep 2014 01:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272007 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 01:17:23 -0000 Author: grehan Date: Tue Sep 23 01:17:22 2014 New Revision: 272007 URL: http://svnweb.freebsd.org/changeset/base/272007 Log: Correct display of bhyve SMBIOS UUIDs with dmidecode by bumping the version. The mixed little/big-endianness of SMBIOS UUIDs was clarified in v2.6 of the SMBIOS spec. dmidecode uses the reported version of SMBIOS to determine the layout and what to byte-swap. bhyve's SMBIOS reported as 2.4 though it implemented the 2.6-style of memory layout. This resulted in dmidecode reporting a different UUID than one passed in via the -U option. Fix by exporting a version of 2.6. Reviewed by: tychon Reported by: julian MFC after: 1 day Modified: head/usr.sbin/bhyve/smbiostbl.c Modified: head/usr.sbin/bhyve/smbiostbl.c ============================================================================== --- head/usr.sbin/bhyve/smbiostbl.c Tue Sep 23 00:43:18 2014 (r272006) +++ head/usr.sbin/bhyve/smbiostbl.c Tue Sep 23 01:17:22 2014 (r272007) @@ -737,7 +737,7 @@ smbios_ep_initializer(struct smbios_entr smbios_ep->eplen = 0x1F; assert(sizeof (struct smbios_entry_point) == smbios_ep->eplen); smbios_ep->major = 2; - smbios_ep->minor = 4; + smbios_ep->minor = 6; smbios_ep->revision = 0; memcpy(smbios_ep->ianchor, SMBIOS_ENTRY_IANCHOR, SMBIOS_ENTRY_IANCHORLEN); From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 01:18:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F282A43; Tue, 23 Sep 2014 01:18:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AA932F1; Tue, 23 Sep 2014 01:18:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N1IAOZ039971; Tue, 23 Sep 2014 01:18:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N1IAE3039970; Tue, 23 Sep 2014 01:18:10 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409230118.s8N1IAE3039970@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 23 Sep 2014 01:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272008 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 01:18:10 -0000 Author: gjb Date: Tue Sep 23 01:18:09 2014 New Revision: 272008 URL: http://svnweb.freebsd.org/changeset/base/272008 Log: Document r271470, addition of BIOS- and UEFI-capable CDROM images. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Sep 23 01:17:22 2014 (r272007) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Sep 23 01:18:09 2014 (r272008) @@ -1419,6 +1419,12 @@ services.db database to be created as part of the release build, regardless of native- or cross-built releases. + + The release/ scripts have been + updated to produce UEFI-capable and + BIOS-capable CD-ROM ISOs as well as memory + stick images for the &os;/&arch.amd64; architecture. From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 01:18:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74B26B43; Tue, 23 Sep 2014 01:18:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FE032F2; Tue, 23 Sep 2014 01:18:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N1ICVP040020; Tue, 23 Sep 2014 01:18:12 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N1IC8h040019; Tue, 23 Sep 2014 01:18:12 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409230118.s8N1IC8h040019@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 23 Sep 2014 01:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272009 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 01:18:12 -0000 Author: gjb Date: Tue Sep 23 01:18:11 2014 New Revision: 272009 URL: http://svnweb.freebsd.org/changeset/base/272009 Log: Document r271816, drm/i915 HW context support. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Sep 23 01:18:09 2014 (r272008) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Sep 23 01:18:11 2014 (r272009) @@ -230,6 +230,11 @@ Radeon 9700 backlight, found in the &apple; PowerBook™ G4. + Hardware context support has been + added to the drm/i915 driver, adding + support for Mesa 9.2 and + later. + Virtualization Support From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 01:18:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF4BED7B; Tue, 23 Sep 2014 01:18:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB61B2F5; Tue, 23 Sep 2014 01:18:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N1IGtS040115; Tue, 23 Sep 2014 01:18:16 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N1IG74040114; Tue, 23 Sep 2014 01:18:16 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409230118.s8N1IG74040114@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 23 Sep 2014 01:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272011 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 01:18:17 -0000 Author: gjb Date: Tue Sep 23 01:18:16 2014 New Revision: 272011 URL: http://svnweb.freebsd.org/changeset/base/272011 Log: Document r271967, mkimg(1) empty partition support. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Sep 23 01:18:13 2014 (r272010) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Sep 23 01:18:16 2014 (r272011) @@ -1292,6 +1292,9 @@ merged from illumos™ and &apple;, providing better internationalization support and &posix; compliance. + Support for adding empty partitions has + been added to the &man.mkimg.1; utility. + <filename>/etc/rc.d</filename> Scripts From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 01:18:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FFE6C46; Tue, 23 Sep 2014 01:18:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BD6C2F3; Tue, 23 Sep 2014 01:18:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N1IEhN040067; Tue, 23 Sep 2014 01:18:14 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N1IE35040066; Tue, 23 Sep 2014 01:18:14 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409230118.s8N1IE35040066@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 23 Sep 2014 01:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272010 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 01:18:14 -0000 Author: gjb Date: Tue Sep 23 01:18:13 2014 New Revision: 272010 URL: http://svnweb.freebsd.org/changeset/base/272010 Log: Add sponsor attribution for r271470 Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Sep 23 01:18:11 2014 (r272009) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Sep 23 01:18:13 2014 (r272010) @@ -1425,9 +1425,9 @@ part of the release build, regardless of native- or cross-built releases. - The release/ scripts have been - updated to produce UEFI-capable and + The + release/ scripts have + been updated to produce UEFI-capable and BIOS-capable CD-ROM ISOs as well as memory stick images for the &os;/&arch.amd64; architecture. From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 01:18:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 386A9E8D; Tue, 23 Sep 2014 01:18:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 245AD2F7; Tue, 23 Sep 2014 01:18:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N1IJlK040166; Tue, 23 Sep 2014 01:18:19 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N1IJmD040165; Tue, 23 Sep 2014 01:18:19 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409230118.s8N1IJmD040165@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 23 Sep 2014 01:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272012 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 01:18:19 -0000 Author: gjb Date: Tue Sep 23 01:18:18 2014 New Revision: 272012 URL: http://svnweb.freebsd.org/changeset/base/272012 Log: Document r272006, GEOM_ELI passphrase caching on boot with multiple providers. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Sep 23 01:18:16 2014 (r272011) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue Sep 23 01:18:18 2014 (r272012) @@ -453,6 +453,15 @@ bootstrap file. + + Support has been added to cache + &man.geli.8; passphrases during system boot. When a system + is configured with multiple GEOM_ELI + providers all using the same passphrase, the passphrase that + is cached after the first entry is used for the subsequent + GEOM_ELI provider. If the passphrase in + the cache is incorrect, then a prompt for the passphrase for + the next provider is displayed. From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 02:56:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 228238A9; Tue, 23 Sep 2014 02:56:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CBDED26; Tue, 23 Sep 2014 02:56:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N2ufXE085558; Tue, 23 Sep 2014 02:56:41 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N2uebH085553; Tue, 23 Sep 2014 02:56:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201409230256.s8N2uebH085553@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 23 Sep 2014 02:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272013 - in head/sys: dev/pci kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 02:56:42 -0000 Author: jhibbits Date: Tue Sep 23 02:56:40 2014 New Revision: 272013 URL: http://svnweb.freebsd.org/changeset/base/272013 Log: Stage one of multipass suspend/resume Summary: Add the beginnings of multipass suspend/resume, by introducing BUS_SUSPEND_CHILD/BUS_RESUME_CHILD, and move the PCI driver to this. Reviewers: jhb Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D590 Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pci_private.h head/sys/kern/bus_if.m head/sys/kern/subr_bus.c head/sys/sys/bus.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Sep 23 01:18:18 2014 (r272012) +++ head/sys/dev/pci/pci.c Tue Sep 23 02:56:40 2014 (r272013) @@ -131,7 +131,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(device_detach, bus_generic_detach), #endif DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, pci_suspend), + DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, pci_resume), /* Bus interface */ @@ -157,6 +157,8 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_child_pnpinfo_str, pci_child_pnpinfo_str_method), DEVMETHOD(bus_child_location_str, pci_child_location_str_method), DEVMETHOD(bus_remap_intr, pci_remap_intr_method), + DEVMETHOD(bus_suspend_child, pci_suspend_child), + DEVMETHOD(bus_resume_child, pci_resume_child), /* PCI interface */ DEVMETHOD(pci_read_config, pci_read_config_method), @@ -3622,12 +3624,11 @@ pci_detach(device_t dev) #endif static void -pci_set_power_children(device_t dev, device_t *devlist, int numdevs, - int state) +pci_set_power_child(device_t dev, device_t child, int state) { - device_t child, pcib; struct pci_devinfo *dinfo; - int dstate, i; + device_t pcib; + int dstate; /* * Set the device to the given state. If the firmware suggests @@ -3637,45 +3638,54 @@ pci_set_power_children(device_t dev, dev * are handled separately. */ pcib = device_get_parent(dev); - for (i = 0; i < numdevs; i++) { - child = devlist[i]; - dinfo = device_get_ivars(child); - dstate = state; - if (device_is_attached(child) && - PCIB_POWER_FOR_SLEEP(pcib, dev, &dstate) == 0) - pci_set_powerstate(child, dstate); - } + dinfo = device_get_ivars(child); + dstate = state; + if (device_is_attached(child) && + PCIB_POWER_FOR_SLEEP(pcib, dev, &dstate) == 0) + pci_set_powerstate(child, dstate); } int -pci_suspend(device_t dev) +pci_suspend_child(device_t dev, device_t child) { - device_t child, *devlist; struct pci_devinfo *dinfo; - int error, i, numdevs; + int error; + + dinfo = device_get_ivars(child); /* - * Save the PCI configuration space for each child and set the + * Save the PCI configuration space for the child and set the * device in the appropriate power state for this sleep state. */ - if ((error = device_get_children(dev, &devlist, &numdevs)) != 0) - return (error); - for (i = 0; i < numdevs; i++) { - child = devlist[i]; - dinfo = device_get_ivars(child); - pci_cfg_save(child, dinfo, 0); - } + pci_cfg_save(child, dinfo, 0); /* Suspend devices before potentially powering them down. */ - error = bus_generic_suspend(dev); - if (error) { - free(devlist, M_TEMP); + error = bus_generic_suspend_child(dev, child); + + if (error) return (error); - } + if (pci_do_power_suspend) - pci_set_power_children(dev, devlist, numdevs, - PCI_POWERSTATE_D3); - free(devlist, M_TEMP); + pci_set_power_child(dev, child, PCI_POWERSTATE_D3); + + return (0); +} + +int +pci_resume_child(device_t dev, device_t child) +{ + struct pci_devinfo *dinfo; + + if (pci_do_power_resume) + pci_set_power_child(dev, child, PCI_POWERSTATE_D0); + + dinfo = device_get_ivars(child); + pci_cfg_restore(child, dinfo); + if (!device_is_attached(child)) + pci_cfg_save(child, dinfo, 1); + + bus_generic_resume_child(dev, child); + return (0); } @@ -3683,27 +3693,10 @@ int pci_resume(device_t dev) { device_t child, *devlist; - struct pci_devinfo *dinfo; int error, i, numdevs; - /* - * Set each child to D0 and restore its PCI configuration space. - */ if ((error = device_get_children(dev, &devlist, &numdevs)) != 0) return (error); - if (pci_do_power_resume) - pci_set_power_children(dev, devlist, numdevs, - PCI_POWERSTATE_D0); - - /* Now the device is powered up, restore its config space. */ - for (i = 0; i < numdevs; i++) { - child = devlist[i]; - dinfo = device_get_ivars(child); - - pci_cfg_restore(child, dinfo); - if (!device_is_attached(child)) - pci_cfg_save(child, dinfo, 1); - } /* * Resume critical devices first, then everything else later. @@ -3715,7 +3708,7 @@ pci_resume(device_t dev) case PCIC_MEMORY: case PCIC_BRIDGE: case PCIC_BASEPERIPH: - DEVICE_RESUME(child); + BUS_RESUME_CHILD(dev, child); break; } } @@ -3728,7 +3721,7 @@ pci_resume(device_t dev) case PCIC_BASEPERIPH: break; default: - DEVICE_RESUME(child); + BUS_RESUME_CHILD(dev, child); } } free(devlist, M_TEMP); Modified: head/sys/dev/pci/pci_private.h ============================================================================== --- head/sys/dev/pci/pci_private.h Tue Sep 23 01:18:18 2014 (r272012) +++ head/sys/dev/pci/pci_private.h Tue Sep 23 02:56:40 2014 (r272013) @@ -123,7 +123,8 @@ int pci_child_pnpinfo_str_method(device char *buf, size_t buflen); int pci_assign_interrupt_method(device_t dev, device_t child); int pci_resume(device_t dev); -int pci_suspend(device_t dev); +int pci_resume_child(device_t dev, device_t child); +int pci_suspend_child(device_t dev, device_t child); bus_dma_tag_t pci_get_dma_tag(device_t bus, device_t dev); void pci_child_added_method(device_t dev, device_t child); Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Tue Sep 23 01:18:18 2014 (r272012) +++ head/sys/kern/bus_if.m Tue Sep 23 02:56:40 2014 (r272013) @@ -670,3 +670,25 @@ METHOD int remap_intr { device_t _child; u_int _irq; } DEFAULT null_remap_intr; + +/** + * @brief Suspend a given child + * + * @param _dev the parent device of @p _child + * @param _child the device to suspend + */ +METHOD int suspend_child { + device_t _dev; + device_t _child; +} DEFAULT bus_generic_suspend_child; + +/** + * @brief Resume a given child + * + * @param _dev the parent device of @p _child + * @param _child the device to resume + */ +METHOD int resume_child { + device_t _dev; + device_t _child; +} DEFAULT bus_generic_resume_child; Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Sep 23 01:18:18 2014 (r272012) +++ head/sys/kern/subr_bus.c Tue Sep 23 02:56:40 2014 (r272013) @@ -135,6 +135,7 @@ struct device { #define DF_DONENOMATCH 0x20 /* don't execute DEVICE_NOMATCH again */ #define DF_EXTERNALSOFTC 0x40 /* softc not allocated by us */ #define DF_REBID 0x80 /* Can rebid after attach */ +#define DF_SUSPENDED 0x100 /* Device is suspended. */ u_int order; /**< order from device_add_child_ordered() */ void *ivars; /**< instance variables */ void *softc; /**< current driver's variables */ @@ -3631,6 +3632,39 @@ bus_generic_shutdown(device_t dev) } /** + * @brief Default function for suspending a child device. + * + * This function is to be used by a bus's DEVICE_SUSPEND_CHILD(). + */ +int +bus_generic_suspend_child(device_t dev, device_t child) +{ + int error; + + error = DEVICE_SUSPEND(child); + + if (error == 0) + dev->flags |= DF_SUSPENDED; + + return (error); +} + +/** + * @brief Default function for resuming a child device. + * + * This function is to be used by a bus's DEVICE_RESUME_CHILD(). + */ +int +bus_generic_resume_child(device_t dev, device_t child) +{ + + DEVICE_RESUME(child); + dev->flags &= ~DF_SUSPENDED; + + return (0); +} + +/** * @brief Helper function for implementing DEVICE_SUSPEND() * * This function can be used to help implement the DEVICE_SUSPEND() @@ -3646,12 +3680,12 @@ bus_generic_suspend(device_t dev) device_t child, child2; TAILQ_FOREACH(child, &dev->children, link) { - error = DEVICE_SUSPEND(child); + error = BUS_SUSPEND_CHILD(dev, child); if (error) { for (child2 = TAILQ_FIRST(&dev->children); child2 && child2 != child; child2 = TAILQ_NEXT(child2, link)) - DEVICE_RESUME(child2); + BUS_RESUME_CHILD(dev, child2); return (error); } } @@ -3670,7 +3704,7 @@ bus_generic_resume(device_t dev) device_t child; TAILQ_FOREACH(child, &dev->children, link) { - DEVICE_RESUME(child); + BUS_RESUME_CHILD(dev, child); /* if resume fails, there's nothing we can usefully do... */ } return (0); Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Tue Sep 23 01:18:18 2014 (r272012) +++ head/sys/sys/bus.h Tue Sep 23 02:56:40 2014 (r272013) @@ -339,6 +339,7 @@ int bus_generic_read_ivar(device_t dev, int bus_generic_release_resource(device_t bus, device_t child, int type, int rid, struct resource *r); int bus_generic_resume(device_t dev); +int bus_generic_resume_child(device_t dev, device_t child); int bus_generic_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *intr, @@ -357,6 +358,7 @@ int bus_generic_rl_release_resource (dev int bus_generic_shutdown(device_t dev); int bus_generic_suspend(device_t dev); +int bus_generic_suspend_child(device_t dev, device_t child); int bus_generic_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie); int bus_generic_write_ivar(device_t dev, device_t child, int which, From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 04:13:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8963D35A; Tue, 23 Sep 2014 04:13:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 742DF7A4; Tue, 23 Sep 2014 04:13:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N4DMYw022890; Tue, 23 Sep 2014 04:13:22 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N4DMRd022889; Tue, 23 Sep 2014 04:13:22 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201409230413.s8N4DMRd022889@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 23 Sep 2014 04:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272014 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 04:13:22 -0000 Author: nwhitehorn Date: Tue Sep 23 04:13:21 2014 New Revision: 272014 URL: http://svnweb.freebsd.org/changeset/base/272014 Log: We should have an isync after switching MSR[SF] in bootstrap. Submitted by: Mark Millard MFC after: 3 days Modified: head/sys/powerpc/aim/locore64.S Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Tue Sep 23 02:56:40 2014 (r272013) +++ head/sys/powerpc/aim/locore64.S Tue Sep 23 04:13:21 2014 (r272014) @@ -160,6 +160,7 @@ ASENTRY_NOPROF(__start) li 8,1 insrdi 9,8,1,0 mtmsrd 9 + isync bl OF_initial_setup nop From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 05:37:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFA1FD36; Tue, 23 Sep 2014 05:37:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8844E54; Tue, 23 Sep 2014 05:37:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N5bJCk060385; Tue, 23 Sep 2014 05:37:19 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N5bI0o060375; Tue, 23 Sep 2014 05:37:18 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201409230537.s8N5bI0o060375@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 23 Sep 2014 05:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272015 - in head/sys: conf dev/ncr modules modules/ncr pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 05:37:20 -0000 Author: rpaulo Date: Tue Sep 23 05:37:17 2014 New Revision: 272015 URL: http://svnweb.freebsd.org/changeset/base/272015 Log: Move pci/ncr to dev/ncr. Added: head/sys/dev/ncr/ head/sys/dev/ncr/locate.pl - copied unchanged from r272014, head/sys/pci/locate.pl head/sys/dev/ncr/ncr.c - copied, changed from r272005, head/sys/pci/ncr.c head/sys/dev/ncr/ncrreg.h - copied unchanged from r272005, head/sys/pci/ncrreg.h head/sys/modules/ncr/ head/sys/modules/ncr/Makefile (contents, props changed) Deleted: head/sys/pci/locate.pl head/sys/pci/ncr.c head/sys/pci/ncrreg.h Modified: head/sys/conf/files head/sys/conf/options head/sys/modules/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Sep 23 04:13:21 2014 (r272014) +++ head/sys/conf/files Tue Sep 23 05:37:17 2014 (r272015) @@ -1965,6 +1965,8 @@ dev/nand/nandsim_ctrl.c optional nandsi dev/nand/nandsim_log.c optional nandsim nand dev/nand/nandsim_swap.c optional nandsim nand dev/nand/nfc_if.m optional nand +dev/ncr/ncr.c optional ncr pci \ + compile-with "${NORMAL_C} -Wno-unused" dev/ncv/ncr53c500.c optional ncv dev/ncv/ncr53c500_pccard.c optional ncv pccard dev/netmap/netmap.c optional netmap @@ -3868,8 +3870,6 @@ pci/alpm.c optional alpm pci pci/amdpm.c optional amdpm pci | nfpm pci pci/amdsmb.c optional amdsmb pci pci/intpm.c optional intpm pci -pci/ncr.c optional ncr pci \ - compile-with "${NORMAL_C} -Wno-unused" pci/nfsmb.c optional nfsmb pci pci/viapm.c optional viapm pci rpc/auth_none.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Sep 23 04:13:21 2014 (r272014) +++ head/sys/conf/options Tue Sep 23 05:37:17 2014 (r272015) @@ -363,7 +363,7 @@ SYM_SETUP_PCI_PARITY opt_sym.h #-PCI par SYM_SETUP_MAX_LUN opt_sym.h #-Number of LUNs supported # default:8, range:[1..64] -# Options used only in pci/ncr.c +# Options used only in dev/ncr/* SCSI_NCR_DEBUG opt_ncr.h SCSI_NCR_MAX_SYNC opt_ncr.h SCSI_NCR_MAX_WIDE opt_ncr.h Copied: head/sys/dev/ncr/locate.pl (from r272014, head/sys/pci/locate.pl) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ncr/locate.pl Tue Sep 23 05:37:17 2014 (r272015, copy of r272014, head/sys/pci/locate.pl) @@ -0,0 +1,45 @@ +#!/usr/bin/perl -w +# $FreeBSD$ + +use strict; + +if (!defined($ARGV[0])) { + print( +" +Perl script to convert NCR script address into label+offset. +Useful to find the failed NCR instruction ... + +usage: $0
+"); + exit(1); +} + +my $errpos = hex($ARGV[0])/4; +my $ofs=0; + +open (INPUT, "cc -E ncr.c 2>/dev/null |"); + +while ($_ = ) +{ + last if /^struct script \{/; +} + +while ($_ = ) +{ + last if /^\}\;/; + my ($label, $size) = /ncrcmd\s+(\S+)\s+\[([^]]+)/; + $size = eval($size); + if (defined($label) && $label) { + if ($errpos) { + if ($ofs + $size > $errpos) { + printf ("%4x: %s\n", $ofs * 4, $label); + printf ("%4x: %s + %d\n", $errpos * 4, $label, $errpos - $ofs); + last; + } + $ofs += $size; + } else { + printf ("%4x: %s\n", $ofs * 4, $label); + } + } +} + Copied and modified: head/sys/dev/ncr/ncr.c (from r272005, head/sys/pci/ncr.c) ============================================================================== --- head/sys/pci/ncr.c Mon Sep 22 22:38:54 2014 (r272005, copy source) +++ head/sys/dev/ncr/ncr.c Tue Sep 23 05:37:17 2014 (r272015) @@ -197,7 +197,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include Copied: head/sys/dev/ncr/ncrreg.h (from r272005, head/sys/pci/ncrreg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ncr/ncrreg.h Tue Sep 23 05:37:17 2014 (r272015, copy of r272005, head/sys/pci/ncrreg.h) @@ -0,0 +1,574 @@ +/************************************************************************** +** +** $FreeBSD$ +** +** Device driver for the NCR 53C810 PCI-SCSI-Controller. +** +** 386bsd / FreeBSD / NetBSD +** +**------------------------------------------------------------------------- +** +** Written for 386bsd and FreeBSD by +** wolf@cologne.de Wolfgang Stanglmeier +** se@mi.Uni-Koeln.de Stefan Esser +** +** Ported to NetBSD by +** mycroft@gnu.ai.mit.edu +** +**------------------------------------------------------------------------- +*/ +/*- +** Copyright (c) 1994 Wolfgang Stanglmeier. All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** 1. Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in the +** documentation and/or other materials provided with the distribution. +** 3. The name of the author may not be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +*************************************************************************** +*/ + +#ifndef __NCR_REG_H__ +#define __NCR_REG_H__ + +/*----------------------------------------------------------------- +** +** The ncr 53c810 register structure. +** +**----------------------------------------------------------------- +*/ + +struct ncr_reg { +/*00*/ u_char nc_scntl0; /* full arb., ena parity, par->ATN */ + +/*01*/ u_char nc_scntl1; /* no reset */ + #define ISCON 0x10 /* connected to scsi */ + #define CRST 0x08 /* force reset */ + +/*02*/ u_char nc_scntl2; /* no disconnect expected */ + #define SDU 0x80 /* cmd: disconnect will raise error */ + #define CHM 0x40 /* sta: chained mode */ + #define WSS 0x08 /* sta: wide scsi send [W]*/ + #define WSR 0x01 /* sta: wide scsi received [W]*/ + +/*03*/ u_char nc_scntl3; /* cnf system clock dependent */ + #define EWS 0x08 /* cmd: enable wide scsi [W]*/ + +/*04*/ u_char nc_scid; /* cnf host adapter scsi address */ + #define RRE 0x40 /* r/w:e enable response to resel. */ + #define SRE 0x20 /* r/w:e enable response to select */ + +/*05*/ u_char nc_sxfer; /* ### Sync speed and count */ + +/*06*/ u_char nc_sdid; /* ### Destination-ID */ + +/*07*/ u_char nc_gpreg; /* ??? IO-Pins */ + +/*08*/ u_char nc_sfbr; /* ### First byte in phase */ + +/*09*/ u_char nc_socl; + #define CREQ 0x80 /* r/w: SCSI-REQ */ + #define CACK 0x40 /* r/w: SCSI-ACK */ + #define CBSY 0x20 /* r/w: SCSI-BSY */ + #define CSEL 0x10 /* r/w: SCSI-SEL */ + #define CATN 0x08 /* r/w: SCSI-ATN */ + #define CMSG 0x04 /* r/w: SCSI-MSG */ + #define CC_D 0x02 /* r/w: SCSI-C_D */ + #define CI_O 0x01 /* r/w: SCSI-I_O */ + +/*0a*/ u_char nc_ssid; + +/*0b*/ u_char nc_sbcl; + +/*0c*/ u_char nc_dstat; + #define DFE 0x80 /* sta: dma fifo empty */ + #define MDPE 0x40 /* int: master data parity error */ + #define BF 0x20 /* int: script: bus fault */ + #define ABRT 0x10 /* int: script: command aborted */ + #define SSI 0x08 /* int: script: single step */ + #define SIR 0x04 /* int: script: interrupt instruct. */ + #define IID 0x01 /* int: script: illegal instruct. */ + +/*0d*/ u_char nc_sstat0; + #define ILF 0x80 /* sta: data in SIDL register lsb */ + #define ORF 0x40 /* sta: data in SODR register lsb */ + #define OLF 0x20 /* sta: data in SODL register lsb */ + #define AIP 0x10 /* sta: arbitration in progress */ + #define LOA 0x08 /* sta: arbitration lost */ + #define WOA 0x04 /* sta: arbitration won */ + #define IRST 0x02 /* sta: scsi reset signal */ + #define SDP 0x01 /* sta: scsi parity signal */ + +/*0e*/ u_char nc_sstat1; + #define FF3210 0xf0 /* sta: bytes in the scsi fifo */ + +/*0f*/ u_char nc_sstat2; + #define ILF1 0x80 /* sta: data in SIDL register msb[W]*/ + #define ORF1 0x40 /* sta: data in SODR register msb[W]*/ + #define OLF1 0x20 /* sta: data in SODL register msb[W]*/ + #define LDSC 0x02 /* sta: disconnect & reconnect */ + +/*10*/ u_int32_t nc_dsa; /* --> Base page */ + +/*14*/ u_char nc_istat; /* --> Main Command and status */ + #define CABRT 0x80 /* cmd: abort current operation */ + #define SRST 0x40 /* mod: reset chip */ + #define SIGP 0x20 /* r/w: message from host to ncr */ + #define SEM 0x10 /* r/w: message between host + ncr */ + #define CON 0x08 /* sta: connected to scsi */ + #define INTF 0x04 /* sta: int on the fly (reset by wr)*/ + #define SIP 0x02 /* sta: scsi-interrupt */ + #define DIP 0x01 /* sta: host/script interrupt */ + +/*15*/ u_char nc_15_; +/*16*/ u_char nc_16_; +/*17*/ u_char nc_17_; + +/*18*/ u_char nc_ctest0; +/*19*/ u_char nc_ctest1; + +/*1a*/ u_char nc_ctest2; + #define CSIGP 0x40 + +/*1b*/ u_char nc_ctest3; + #define FLF 0x08 /* cmd: flush dma fifo */ + #define CLF 0x04 /* cmd: clear dma fifo */ + #define FM 0x02 /* mod: fetch pin mode */ + #define WRIE 0x01 /* mod: write and invalidate enable */ + +/*1c*/ u_int32_t nc_temp; /* ### Temporary stack */ + +/*20*/ u_char nc_dfifo; +/*21*/ u_char nc_ctest4; + #define BDIS 0x80 /* mod: burst disable */ + #define MPEE 0x08 /* mod: master parity error enable */ + +/*22*/ u_char nc_ctest5; + #define DFS 0x20 /* mod: dma fifo size */ +/*23*/ u_char nc_ctest6; + +/*24*/ u_int32_t nc_dbc; /* ### Byte count and command */ +/*28*/ u_int32_t nc_dnad; /* ### Next command register */ +/*2c*/ u_int32_t nc_dsp; /* --> Script Pointer */ +/*30*/ u_int32_t nc_dsps; /* --> Script pointer save/opcode#2 */ +/*34*/ u_int32_t nc_scratcha; /* ??? Temporary register a */ + +/*38*/ u_char nc_dmode; + #define BL_2 0x80 /* mod: burst length shift value +2 */ + #define BL_1 0x40 /* mod: burst length shift value +1 */ + #define ERL 0x08 /* mod: enable read line */ + #define ERMP 0x04 /* mod: enable read multiple */ + #define BOF 0x02 /* mod: burst op code fetch */ + +/*39*/ u_char nc_dien; +/*3a*/ u_char nc_dwt; + +/*3b*/ u_char nc_dcntl; /* --> Script execution control */ + #define CLSE 0x80 /* mod: cache line size enable */ + #define PFF 0x40 /* cmd: pre-fetch flush */ + #define PFEN 0x20 /* mod: pre-fetch enable */ + #define SSM 0x10 /* mod: single step mode */ + #define IRQM 0x08 /* mod: irq mode (1 = totem pole !) */ + #define STD 0x04 /* cmd: start dma mode */ + #define IRQD 0x02 /* mod: irq disable */ + #define NOCOM 0x01 /* cmd: protect sfbr while reselect */ + +/*3c*/ u_int32_t nc_adder; + +/*40*/ u_short nc_sien; /* -->: interrupt enable */ +/*42*/ u_short nc_sist; /* <--: interrupt status */ + #define STO 0x0400/* sta: timeout (select) */ + #define GEN 0x0200/* sta: timeout (general) */ + #define HTH 0x0100/* sta: timeout (handshake) */ + #define MA 0x80 /* sta: phase mismatch */ + #define CMP 0x40 /* sta: arbitration complete */ + #define SEL 0x20 /* sta: selected by another device */ + #define RSL 0x10 /* sta: reselected by another device*/ + #define SGE 0x08 /* sta: gross error (over/underflow)*/ + #define UDC 0x04 /* sta: unexpected disconnect */ + #define RST 0x02 /* sta: scsi bus reset detected */ + #define PAR 0x01 /* sta: scsi parity error */ + +/*44*/ u_char nc_slpar; +/*45*/ u_char nc_swide; +/*46*/ u_char nc_macntl; +/*47*/ u_char nc_gpcntl; +/*48*/ u_char nc_stime0; /* cmd: timeout for select&handshake*/ +/*49*/ u_char nc_stime1; /* cmd: timeout user defined */ +/*4a*/ u_short nc_respid; /* sta: Reselect-IDs */ + +/*4c*/ u_char nc_stest0; + +/*4d*/ u_char nc_stest1; + #define DBLEN 0x08 /* clock doubler running */ + #define DBLSEL 0x04 /* clock doubler selected */ + +/*4e*/ u_char nc_stest2; + #define ROF 0x40 /* reset scsi offset (after gross error!) */ + #define EXT 0x02 /* extended filtering */ + +/*4f*/ u_char nc_stest3; + #define TE 0x80 /* c: tolerAnt enable */ + #define HSC 0x20 /* c: Halt SCSI Clock */ + #define CSF 0x02 /* c: clear scsi fifo */ + +/*50*/ u_short nc_sidl; /* Lowlevel: latched from scsi data */ +/*52*/ u_char nc_stest4; + #define SMODE 0xc0 /* SCSI bus mode (895/6 only) */ + #define SMODE_HVD 0x40 /* High Voltage Differential */ + #define SMODE_SE 0x80 /* Single Ended */ + #define SMODE_LVD 0xc0 /* Low Voltage Differential */ + #define LCKFRQ 0x20 /* Frequency Lock (895/6 only) */ + +/*53*/ u_char nc_53_; +/*54*/ u_short nc_sodl; /* Lowlevel: data out to scsi data */ +/*56*/ u_short nc_56_; +/*58*/ u_short nc_sbdl; /* Lowlevel: data from scsi data */ +/*5a*/ u_short nc_5a_; +/*5c*/ u_char nc_scr0; /* Working register B */ +/*5d*/ u_char nc_scr1; /* */ +/*5e*/ u_char nc_scr2; /* */ +/*5f*/ u_char nc_scr3; /* */ +/*60*/ +}; + +/*----------------------------------------------------------- +** +** Utility macros for the script. +** +**----------------------------------------------------------- +*/ + +#define REGJ(p,r) (offsetof(struct ncr_reg, p ## r)) +#define REG(r) REGJ (nc_, r) + +#ifndef TARGET_MODE +#define TARGET_MODE 0 +#endif + +typedef u_int32_t ncrcmd; + +/*----------------------------------------------------------- +** +** SCSI phases +** +**----------------------------------------------------------- +*/ + +#define SCR_DATA_OUT 0x00000000 +#define SCR_DATA_IN 0x01000000 +#define SCR_COMMAND 0x02000000 +#define SCR_STATUS 0x03000000 +#define SCR_ILG_OUT 0x04000000 +#define SCR_ILG_IN 0x05000000 +#define SCR_MSG_OUT 0x06000000 +#define SCR_MSG_IN 0x07000000 + +/*----------------------------------------------------------- +** +** Data transfer via SCSI. +** +**----------------------------------------------------------- +** +** MOVE_ABS (LEN) +** <> +** +** MOVE_IND (LEN) +** <> +** +** MOVE_TBL +** <> +** +**----------------------------------------------------------- +*/ + +#define SCR_MOVE_ABS(l) ((0x08000000 ^ (TARGET_MODE << 1ul)) | (l)) +#define SCR_MOVE_IND(l) ((0x28000000 ^ (TARGET_MODE << 1ul)) | (l)) +#define SCR_MOVE_TBL (0x18000000 ^ (TARGET_MODE << 1ul)) + +struct scr_tblmove { + u_int32_t size; + u_int32_t addr; +}; + +/*----------------------------------------------------------- +** +** Selection +** +**----------------------------------------------------------- +** +** SEL_ABS | SCR_ID (0..7) [ | REL_JMP] +** <> +** +** SEL_TBL | << dnad_offset>> [ | REL_JMP] +** <> +** +**----------------------------------------------------------- +*/ + +#define SCR_SEL_ABS 0x40000000 +#define SCR_SEL_ABS_ATN 0x41000000 +#define SCR_SEL_TBL 0x42000000 +#define SCR_SEL_TBL_ATN 0x43000000 + +struct scr_tblsel { + u_char sel_0; + u_char sel_sxfer; + u_char sel_id; + u_char sel_scntl3; +}; + +#define SCR_JMP_REL 0x04000000 +#define SCR_ID(id) (((u_int32_t)(id)) << 16) + +/*----------------------------------------------------------- +** +** Waiting for Disconnect or Reselect +** +**----------------------------------------------------------- +** +** WAIT_DISC +** dummy: <> +** +** WAIT_RESEL +** <> +** +**----------------------------------------------------------- +*/ + +#define SCR_WAIT_DISC 0x48000000 +#define SCR_WAIT_RESEL 0x50000000 + +/*----------------------------------------------------------- +** +** Bit Set / Reset +** +**----------------------------------------------------------- +** +** SET (flags {|.. }) +** +** CLR (flags {|.. }) +** +**----------------------------------------------------------- +*/ + +#define SCR_SET(f) (0x58000000 | (f)) +#define SCR_CLR(f) (0x60000000 | (f)) + +#define SCR_CARRY 0x00000400 +#define SCR_TRG 0x00000200 +#define SCR_ACK 0x00000040 +#define SCR_ATN 0x00000008 + + +/*----------------------------------------------------------- +** +** Memory to memory move +** +**----------------------------------------------------------- +** +** COPY (bytecount) +** << source_address >> +** << destination_address >> +** +** SCR_COPY sets the NO FLUSH option by default. +** SCR_COPY_F does not set this option. +** +** For chips which do not support this option, +** ncr_copy_and_bind() will remove this bit. +**----------------------------------------------------------- +*/ + +#define SCR_NO_FLUSH 0x01000000 + +#define SCR_COPY(n) (0xc0000000 | SCR_NO_FLUSH | (n)) +#define SCR_COPY_F(n) (0xc0000000 | (n)) + + +/*----------------------------------------------------------- +** +** Register move and binary operations +** +**----------------------------------------------------------- +** +** SFBR_REG (reg, op, data) reg = SFBR op data +** << 0 >> +** +** REG_SFBR (reg, op, data) SFBR = reg op data +** << 0 >> +** +** REG_REG (reg, op, data) reg = reg op data +** << 0 >> +** +**----------------------------------------------------------- +*/ + +#define SCR_REG_OFS(ofs) ((ofs) << 16ul) + +#define SCR_SFBR_REG(reg,op,data) \ + (0x68000000 | (SCR_REG_OFS(REG(reg))) | (op) | ((data)<<8ul)) + +#define SCR_REG_SFBR(reg,op,data) \ + (0x70000000 | (SCR_REG_OFS(REG(reg))) | (op) | ((data)<<8ul)) + +#define SCR_REG_REG(reg,op,data) \ + (0x78000000 | (SCR_REG_OFS(REG(reg))) | (op) | ((data)<<8ul)) + + +#define SCR_LOAD 0x00000000 +#define SCR_SHL 0x01000000 +#define SCR_OR 0x02000000 +#define SCR_XOR 0x03000000 +#define SCR_AND 0x04000000 +#define SCR_SHR 0x05000000 +#define SCR_ADD 0x06000000 +#define SCR_ADDC 0x07000000 + +/*----------------------------------------------------------- +** +** FROM_REG (reg) reg = SFBR +** << 0 >> +** +** TO_REG (reg) SFBR = reg +** << 0 >> +** +** LOAD_REG (reg, data) reg = +** << 0 >> +** +** LOAD_SFBR(data) SFBR = +** << 0 >> +** +**----------------------------------------------------------- +*/ + +#define SCR_FROM_REG(reg) \ + SCR_REG_SFBR(reg,SCR_OR,0) + +#define SCR_TO_REG(reg) \ + SCR_SFBR_REG(reg,SCR_OR,0) + +#define SCR_LOAD_REG(reg,data) \ + SCR_REG_REG(reg,SCR_LOAD,data) + +#define SCR_LOAD_SFBR(data) \ + (SCR_REG_SFBR (gpreg, SCR_LOAD, data)) + +/*----------------------------------------------------------- +** +** Waiting for Disconnect or Reselect +** +**----------------------------------------------------------- +** +** JUMP [ | IFTRUE/IFFALSE ( ... ) ] +** <
> +** +** JUMPR [ | IFTRUE/IFFALSE ( ... ) ] +** <> +** +** CALL [ | IFTRUE/IFFALSE ( ... ) ] +** <
> +** +** CALLR [ | IFTRUE/IFFALSE ( ... ) ] +** <> +** +** RETURN [ | IFTRUE/IFFALSE ( ... ) ] +** <> +** +** INT [ | IFTRUE/IFFALSE ( ... ) ] +** <> +** +** INT_FLY [ | IFTRUE/IFFALSE ( ... ) ] +** <> +** +** Conditions: +** WHEN (phase) +** IF (phase) +** CARRY +** DATA (data, mask) +** +**----------------------------------------------------------- +*/ + +#define SCR_NO_OP 0x80000000 +#define SCR_JUMP 0x80080000 +#define SCR_JUMPR 0x80880000 +#define SCR_CALL 0x88080000 +#define SCR_CALLR 0x88880000 +#define SCR_RETURN 0x90080000 +#define SCR_INT 0x98080000 +#define SCR_INT_FLY 0x98180000 + +#define IFFALSE(arg) (0x00080000 | (arg)) +#define IFTRUE(arg) (0x00000000 | (arg)) + +#define WHEN(phase) (0x00030000 | (phase)) +#define IF(phase) (0x00020000 | (phase)) + +#define DATA(D) (0x00040000 | ((D) & 0xff)) +#define MASK(D,M) (0x00040000 | (((M ^ 0xff) & 0xff) << 8ul)|((D) & 0xff)) + +#define CARRYSET (0x00200000) + +/*----------------------------------------------------------- +** +** SCSI constants. +** +**----------------------------------------------------------- +*/ + +/* +** Messages +*/ +#define M_X_MODIFY_DP (0x00) + +/* +** Status +*/ +#define SCSI_STATUS_ILLEGAL (0xff) +#define SCSI_STATUS_SENSE (0x80) + +/* +** Bits defining chip features. +** For now only some of them are used, since we explicitely +** deal with PCI device id and revision id. +*/ +#define FE_LED0 (1<<0) +#define FE_WIDE (1<<1) +#define FE_ULTRA (1<<2) +#define FE_ULTRA2 (1<<3) +#define FE_DBLR (1<<4) +#define FE_QUAD (1<<5) +#define FE_ERL (1<<6) +#define FE_CLSE (1<<7) +#define FE_WRIE (1<<8) +#define FE_ERMP (1<<9) +#define FE_BOF (1<<10) +#define FE_DFS (1<<11) +#define FE_PFEN (1<<12) +#define FE_LDSTR (1<<13) +#define FE_RAM (1<<14) +#define FE_CLK80 (1<<15) +#define FE_DIFF (1<<16) +#define FE_BIOS (1<<17) +#define FE_CACHE_SET (FE_ERL|FE_CLSE|FE_WRIE|FE_ERMP) +#define FE_SCSI_SET (FE_WIDE|FE_ULTRA|FE_ULTRA2|FE_DBLR|FE_QUAD|F_CLK80) +#define FE_SPECIAL_SET (FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM) + +#endif /*__NCR_REG_H__*/ Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Sep 23 04:13:21 2014 (r272014) +++ head/sys/modules/Makefile Tue Sep 23 05:37:17 2014 (r272015) @@ -242,7 +242,7 @@ SUBDIR= \ my \ ${_nandfs} \ ${_nandsim} \ - ${_ncp} \ + ${_ncr} \ ${_ncv} \ ${_ndis} \ netfpga10g \ @@ -537,6 +537,7 @@ _mlx4ib= mlx4ib _mlxen= mlxen _mthca= mthca .endif +_ncr= ncr _ncv= ncv _ndis= ndis _nsp= nsp Added: head/sys/modules/ncr/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/ncr/Makefile Tue Sep 23 05:37:17 2014 (r272015) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/ncr + +KMOD= ncr +SRCS= ncr.c +SRCS+= device_if.h bus_if.h pci_if.h opt_ncr.h opt_cam.h + +.include + +CFLAGS+=-Wno-error=unused-const-variable From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 05:54:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14667F30; Tue, 23 Sep 2014 05:54:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F13DAFC1; Tue, 23 Sep 2014 05:54:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N5sJpA069141; Tue, 23 Sep 2014 05:54:19 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N5sJQe069137; Tue, 23 Sep 2014 05:54:19 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201409230554.s8N5sJQe069137@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 23 Sep 2014 05:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272016 - in head/sys: conf dev/amdsmb dev/nfsmb modules/i2c/controllers/amdsmb modules/i2c/controllers/nfsmb pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 05:54:20 -0000 Author: rpaulo Date: Tue Sep 23 05:54:18 2014 New Revision: 272016 URL: http://svnweb.freebsd.org/changeset/base/272016 Log: Move amdsmb and nfsmb from dev/pci to their own device directory. Added: head/sys/dev/amdsmb/ head/sys/dev/amdsmb/amdsmb.c - copied unchanged from r272014, head/sys/pci/amdsmb.c head/sys/dev/nfsmb/ head/sys/dev/nfsmb/nfsmb.c - copied unchanged from r272014, head/sys/pci/nfsmb.c Deleted: head/sys/pci/amdsmb.c head/sys/pci/nfsmb.c Modified: head/sys/conf/files head/sys/modules/i2c/controllers/amdsmb/Makefile head/sys/modules/i2c/controllers/nfsmb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Sep 23 05:37:17 2014 (r272015) +++ head/sys/conf/files Tue Sep 23 05:54:18 2014 (r272016) @@ -654,6 +654,7 @@ dev/altera/sdcard/altera_sdcard_disk.c o dev/altera/sdcard/altera_sdcard_io.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_fdt.c optional altera_sdcard fdt dev/altera/sdcard/altera_sdcard_nexus.c optional altera_sdcard +dev/amdsmb/amdsmb.c optional amdsmb pci dev/amr/amr.c optional amr dev/amr/amr_cam.c optional amrp amr dev/amr/amr_disk.c optional amr @@ -1979,6 +1980,7 @@ dev/netmap/netmap_offloadings.c optional dev/netmap/netmap_pipe.c optional netmap dev/netmap/netmap_vale.c optional netmap # compile-with "${NORMAL_C} -Wconversion -Wextra" +dev/nfsmb/nfsmb.c optional nfsmb pci dev/nge/if_nge.c optional nge dev/nxge/if_nxge.c optional nxge \ compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}" @@ -3868,9 +3870,7 @@ opencrypto/skipjack.c optional crypto opencrypto/xform.c optional crypto pci/alpm.c optional alpm pci pci/amdpm.c optional amdpm pci | nfpm pci -pci/amdsmb.c optional amdsmb pci pci/intpm.c optional intpm pci -pci/nfsmb.c optional nfsmb pci pci/viapm.c optional viapm pci rpc/auth_none.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd rpc/auth_unix.c optional krpc | nfslockd | nfsclient | nfscl | nfsd Copied: head/sys/dev/amdsmb/amdsmb.c (from r272014, head/sys/pci/amdsmb.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/amdsmb/amdsmb.c Tue Sep 23 05:54:18 2014 (r272016, copy of r272014, head/sys/pci/amdsmb.c) @@ -0,0 +1,585 @@ +/*- + * Copyright (c) 2005 Ruslan Ermilov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include "smbus_if.h" + +#define AMDSMB_DEBUG(x) if (amdsmb_debug) (x) + +#ifdef DEBUG +static int amdsmb_debug = 1; +#else +static int amdsmb_debug = 0; +#endif + +#define AMDSMB_VENDORID_AMD 0x1022 +#define AMDSMB_DEVICEID_AMD8111_SMB2 0x746a + +/* + * ACPI 3.0, Chapter 12, Embedded Controller Interface. + */ +#define EC_DATA 0x00 /* data register */ +#define EC_SC 0x04 /* status of controller */ +#define EC_CMD 0x04 /* command register */ + +#define EC_SC_IBF 0x02 /* data ready for embedded controller */ +#define EC_SC_OBF 0x01 /* data ready for host */ +#define EC_CMD_WR 0x81 /* write EC */ +#define EC_CMD_RD 0x80 /* read EC */ + +/* + * ACPI 3.0, Chapter 12, SMBus Host Controller Interface. + */ +#define SMB_PRTCL 0x00 /* protocol */ +#define SMB_STS 0x01 /* status */ +#define SMB_ADDR 0x02 /* address */ +#define SMB_CMD 0x03 /* command */ +#define SMB_DATA 0x04 /* 32 data registers */ +#define SMB_BCNT 0x24 /* number of data bytes */ +#define SMB_ALRM_A 0x25 /* alarm address */ +#define SMB_ALRM_D 0x26 /* 2 bytes alarm data */ + +#define SMB_STS_DONE 0x80 +#define SMB_STS_ALRM 0x40 +#define SMB_STS_RES 0x20 +#define SMB_STS_STATUS 0x1f +#define SMB_STS_OK 0x00 /* OK */ +#define SMB_STS_UF 0x07 /* Unknown Failure */ +#define SMB_STS_DANA 0x10 /* Device Address Not Acknowledged */ +#define SMB_STS_DED 0x11 /* Device Error Detected */ +#define SMB_STS_DCAD 0x12 /* Device Command Access Denied */ +#define SMB_STS_UE 0x13 /* Unknown Error */ +#define SMB_STS_DAD 0x17 /* Device Access Denied */ +#define SMB_STS_T 0x18 /* Timeout */ +#define SMB_STS_HUP 0x19 /* Host Unsupported Protocol */ +#define SMB_STS_B 0x1a /* Busy */ +#define SMB_STS_PEC 0x1f /* PEC (CRC-8) Error */ + +#define SMB_PRTCL_WRITE 0x00 +#define SMB_PRTCL_READ 0x01 +#define SMB_PRTCL_QUICK 0x02 +#define SMB_PRTCL_BYTE 0x04 +#define SMB_PRTCL_BYTE_DATA 0x06 +#define SMB_PRTCL_WORD_DATA 0x08 +#define SMB_PRTCL_BLOCK_DATA 0x0a +#define SMB_PRTCL_PROC_CALL 0x0c +#define SMB_PRTCL_BLOCK_PROC_CALL 0x0d +#define SMB_PRTCL_PEC 0x80 + +struct amdsmb_softc { + int rid; + struct resource *res; + device_t smbus; + struct mtx lock; +}; + +#define AMDSMB_LOCK(amdsmb) mtx_lock(&(amdsmb)->lock) +#define AMDSMB_UNLOCK(amdsmb) mtx_unlock(&(amdsmb)->lock) +#define AMDSMB_LOCK_ASSERT(amdsmb) mtx_assert(&(amdsmb)->lock, MA_OWNED) + +#define AMDSMB_ECINB(amdsmb, register) \ + (bus_read_1(amdsmb->res, register)) +#define AMDSMB_ECOUTB(amdsmb, register, value) \ + (bus_write_1(amdsmb->res, register, value)) + +static int amdsmb_detach(device_t dev); + +static int +amdsmb_probe(device_t dev) +{ + u_int16_t vid; + u_int16_t did; + + vid = pci_get_vendor(dev); + did = pci_get_device(dev); + + if (vid == AMDSMB_VENDORID_AMD) { + switch(did) { + case AMDSMB_DEVICEID_AMD8111_SMB2: + device_set_desc(dev, "AMD-8111 SMBus 2.0 Controller"); + return (BUS_PROBE_DEFAULT); + } + } + + return (ENXIO); +} + +static int +amdsmb_attach(device_t dev) +{ + struct amdsmb_softc *amdsmb_sc = device_get_softc(dev); + + /* Allocate I/O space */ + amdsmb_sc->rid = PCIR_BAR(0); + + amdsmb_sc->res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &amdsmb_sc->rid, RF_ACTIVE); + + if (amdsmb_sc->res == NULL) { + device_printf(dev, "could not map i/o space\n"); + return (ENXIO); + } + + mtx_init(&amdsmb_sc->lock, device_get_nameunit(dev), "amdsmb", MTX_DEF); + + /* Allocate a new smbus device */ + amdsmb_sc->smbus = device_add_child(dev, "smbus", -1); + if (!amdsmb_sc->smbus) { + amdsmb_detach(dev); + return (EINVAL); + } + + bus_generic_attach(dev); + + return (0); +} + +static int +amdsmb_detach(device_t dev) +{ + struct amdsmb_softc *amdsmb_sc = device_get_softc(dev); + + if (amdsmb_sc->smbus) { + device_delete_child(dev, amdsmb_sc->smbus); + amdsmb_sc->smbus = NULL; + } + + mtx_destroy(&amdsmb_sc->lock); + if (amdsmb_sc->res) + bus_release_resource(dev, SYS_RES_IOPORT, amdsmb_sc->rid, + amdsmb_sc->res); + + return (0); +} + +static int +amdsmb_callback(device_t dev, int index, void *data) +{ + int error = 0; + + switch (index) { + case SMB_REQUEST_BUS: + case SMB_RELEASE_BUS: + break; + default: + error = EINVAL; + } + + return (error); +} + +static int +amdsmb_ec_wait_write(struct amdsmb_softc *sc) +{ + int timeout = 500; + + while (timeout-- && AMDSMB_ECINB(sc, EC_SC) & EC_SC_IBF) + DELAY(1); + if (timeout == 0) { + device_printf(sc->smbus, "timeout waiting for IBF to clear\n"); + return (1); + } + return (0); +} + +static int +amdsmb_ec_wait_read(struct amdsmb_softc *sc) +{ + int timeout = 500; + + while (timeout-- && ~AMDSMB_ECINB(sc, EC_SC) & EC_SC_OBF) + DELAY(1); + if (timeout == 0) { + device_printf(sc->smbus, "timeout waiting for OBF to set\n"); + return (1); + } + return (0); +} + +static int +amdsmb_ec_read(struct amdsmb_softc *sc, u_char addr, u_char *data) +{ + + AMDSMB_LOCK_ASSERT(sc); + if (amdsmb_ec_wait_write(sc)) + return (1); + AMDSMB_ECOUTB(sc, EC_CMD, EC_CMD_RD); + + if (amdsmb_ec_wait_write(sc)) + return (1); + AMDSMB_ECOUTB(sc, EC_DATA, addr); + + if (amdsmb_ec_wait_read(sc)) + return (1); + *data = AMDSMB_ECINB(sc, EC_DATA); + + return (0); +} + +static int +amdsmb_ec_write(struct amdsmb_softc *sc, u_char addr, u_char data) +{ + + AMDSMB_LOCK_ASSERT(sc); + if (amdsmb_ec_wait_write(sc)) + return (1); + AMDSMB_ECOUTB(sc, EC_CMD, EC_CMD_WR); + + if (amdsmb_ec_wait_write(sc)) + return (1); + AMDSMB_ECOUTB(sc, EC_DATA, addr); + + if (amdsmb_ec_wait_write(sc)) + return (1); + AMDSMB_ECOUTB(sc, EC_DATA, data); + + return (0); +} + +static int +amdsmb_wait(struct amdsmb_softc *sc) +{ + u_char sts, temp; + int error, count; + + AMDSMB_LOCK_ASSERT(sc); + amdsmb_ec_read(sc, SMB_PRTCL, &temp); + if (temp != 0) + { + count = 10000; + do { + DELAY(500); + amdsmb_ec_read(sc, SMB_PRTCL, &temp); + } while (temp != 0 && count--); + if (count == 0) + return (SMB_ETIMEOUT); + } + + amdsmb_ec_read(sc, SMB_STS, &sts); + sts &= SMB_STS_STATUS; + AMDSMB_DEBUG(printf("amdsmb: STS=0x%x\n", sts)); + + switch (sts) { + case SMB_STS_OK: + error = SMB_ENOERR; + break; + case SMB_STS_DANA: + error = SMB_ENOACK; + break; + case SMB_STS_B: + error = SMB_EBUSY; + break; + case SMB_STS_T: + error = SMB_ETIMEOUT; + break; + case SMB_STS_DCAD: + case SMB_STS_DAD: + case SMB_STS_HUP: + error = SMB_ENOTSUPP; + break; + default: + error = SMB_EBUSERR; + break; + } + + return (error); +} + +static int +amdsmb_quick(device_t dev, u_char slave, int how) +{ + struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev); + u_char protocol; + int error; + + protocol = SMB_PRTCL_QUICK; + + switch (how) { + case SMB_QWRITE: + protocol |= SMB_PRTCL_WRITE; + AMDSMB_DEBUG(printf("amdsmb: QWRITE to 0x%x", slave)); + break; + case SMB_QREAD: + protocol |= SMB_PRTCL_READ; + AMDSMB_DEBUG(printf("amdsmb: QREAD to 0x%x", slave)); + break; + default: + panic("%s: unknown QUICK command (%x)!", __func__, how); + } + + AMDSMB_LOCK(sc); + amdsmb_ec_write(sc, SMB_ADDR, slave); + amdsmb_ec_write(sc, SMB_PRTCL, protocol); + + error = amdsmb_wait(sc); + + AMDSMB_DEBUG(printf(", error=0x%x\n", error)); + AMDSMB_UNLOCK(sc); + + return (error); +} + +static int +amdsmb_sendb(device_t dev, u_char slave, char byte) +{ + struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev); + int error; + + AMDSMB_LOCK(sc); + amdsmb_ec_write(sc, SMB_CMD, byte); + amdsmb_ec_write(sc, SMB_ADDR, slave); + amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_WRITE | SMB_PRTCL_BYTE); + + error = amdsmb_wait(sc); + + AMDSMB_DEBUG(printf("amdsmb: SENDB to 0x%x, byte=0x%x, error=0x%x\n", + slave, byte, error)); + AMDSMB_UNLOCK(sc); + + return (error); +} + +static int +amdsmb_recvb(device_t dev, u_char slave, char *byte) +{ + struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev); + int error; + + AMDSMB_LOCK(sc); + amdsmb_ec_write(sc, SMB_ADDR, slave); + amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_READ | SMB_PRTCL_BYTE); + + if ((error = amdsmb_wait(sc)) == SMB_ENOERR) + amdsmb_ec_read(sc, SMB_DATA, byte); + + AMDSMB_DEBUG(printf("amdsmb: RECVB from 0x%x, byte=0x%x, error=0x%x\n", + slave, *byte, error)); + AMDSMB_UNLOCK(sc); + + return (error); +} + +static int +amdsmb_writeb(device_t dev, u_char slave, char cmd, char byte) +{ + struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev); + int error; + + AMDSMB_LOCK(sc); + amdsmb_ec_write(sc, SMB_CMD, cmd); + amdsmb_ec_write(sc, SMB_DATA, byte); + amdsmb_ec_write(sc, SMB_ADDR, slave); + amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_WRITE | SMB_PRTCL_BYTE_DATA); + + error = amdsmb_wait(sc); + + AMDSMB_DEBUG(printf("amdsmb: WRITEB to 0x%x, cmd=0x%x, byte=0x%x, " + "error=0x%x\n", slave, cmd, byte, error)); + AMDSMB_UNLOCK(sc); + + return (error); +} + +static int +amdsmb_readb(device_t dev, u_char slave, char cmd, char *byte) +{ + struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev); + int error; + + AMDSMB_LOCK(sc); + amdsmb_ec_write(sc, SMB_CMD, cmd); + amdsmb_ec_write(sc, SMB_ADDR, slave); + amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_READ | SMB_PRTCL_BYTE_DATA); + + if ((error = amdsmb_wait(sc)) == SMB_ENOERR) + amdsmb_ec_read(sc, SMB_DATA, byte); + + AMDSMB_DEBUG(printf("amdsmb: READB from 0x%x, cmd=0x%x, byte=0x%x, " + "error=0x%x\n", slave, cmd, (unsigned char)*byte, error)); + AMDSMB_UNLOCK(sc); + + return (error); +} + +static int +amdsmb_writew(device_t dev, u_char slave, char cmd, short word) +{ + struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev); + int error; + + AMDSMB_LOCK(sc); + amdsmb_ec_write(sc, SMB_CMD, cmd); + amdsmb_ec_write(sc, SMB_DATA, word); + amdsmb_ec_write(sc, SMB_DATA + 1, word >> 8); + amdsmb_ec_write(sc, SMB_ADDR, slave); + amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_WRITE | SMB_PRTCL_WORD_DATA); + + error = amdsmb_wait(sc); + + AMDSMB_DEBUG(printf("amdsmb: WRITEW to 0x%x, cmd=0x%x, word=0x%x, " + "error=0x%x\n", slave, cmd, word, error)); + AMDSMB_UNLOCK(sc); + + return (error); +} + +static int +amdsmb_readw(device_t dev, u_char slave, char cmd, short *word) +{ + struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev); + u_char temp[2]; + int error; + + AMDSMB_LOCK(sc); + amdsmb_ec_write(sc, SMB_CMD, cmd); + amdsmb_ec_write(sc, SMB_ADDR, slave); + amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_READ | SMB_PRTCL_WORD_DATA); + + if ((error = amdsmb_wait(sc)) == SMB_ENOERR) { + amdsmb_ec_read(sc, SMB_DATA + 0, &temp[0]); + amdsmb_ec_read(sc, SMB_DATA + 1, &temp[1]); + *word = temp[0] | (temp[1] << 8); + } + + AMDSMB_DEBUG(printf("amdsmb: READW from 0x%x, cmd=0x%x, word=0x%x, " + "error=0x%x\n", slave, cmd, (unsigned short)*word, error)); + AMDSMB_UNLOCK(sc); + + return (error); +} + +static int +amdsmb_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf) +{ + struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev); + u_char i; + int error; + + if (count < 1 || count > 32) + return (SMB_EINVAL); + + AMDSMB_LOCK(sc); + amdsmb_ec_write(sc, SMB_CMD, cmd); + amdsmb_ec_write(sc, SMB_BCNT, count); + for (i = 0; i < count; i++) + amdsmb_ec_write(sc, SMB_DATA + i, buf[i]); + amdsmb_ec_write(sc, SMB_ADDR, slave); + amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_WRITE | SMB_PRTCL_BLOCK_DATA); + + error = amdsmb_wait(sc); + + AMDSMB_DEBUG(printf("amdsmb: WRITEBLK to 0x%x, count=0x%x, cmd=0x%x, " + "error=0x%x", slave, count, cmd, error)); + AMDSMB_UNLOCK(sc); + + return (error); +} + +static int +amdsmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf) +{ + struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev); + u_char data, len, i; + int error; + + if (*count < 1 || *count > 32) + return (SMB_EINVAL); + + AMDSMB_LOCK(sc); + amdsmb_ec_write(sc, SMB_CMD, cmd); + amdsmb_ec_write(sc, SMB_ADDR, slave); + amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_READ | SMB_PRTCL_BLOCK_DATA); + + if ((error = amdsmb_wait(sc)) == SMB_ENOERR) { + amdsmb_ec_read(sc, SMB_BCNT, &len); + for (i = 0; i < len; i++) { + amdsmb_ec_read(sc, SMB_DATA + i, &data); + if (i < *count) + buf[i] = data; + } + *count = len; + } + + AMDSMB_DEBUG(printf("amdsmb: READBLK to 0x%x, count=0x%x, cmd=0x%x, " + "error=0x%x", slave, *count, cmd, error)); + AMDSMB_UNLOCK(sc); + + return (error); +} + +static device_method_t amdsmb_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, amdsmb_probe), + DEVMETHOD(device_attach, amdsmb_attach), + DEVMETHOD(device_detach, amdsmb_detach), + + /* SMBus interface */ + DEVMETHOD(smbus_callback, amdsmb_callback), + DEVMETHOD(smbus_quick, amdsmb_quick), + DEVMETHOD(smbus_sendb, amdsmb_sendb), + DEVMETHOD(smbus_recvb, amdsmb_recvb), + DEVMETHOD(smbus_writeb, amdsmb_writeb), + DEVMETHOD(smbus_readb, amdsmb_readb), + DEVMETHOD(smbus_writew, amdsmb_writew), + DEVMETHOD(smbus_readw, amdsmb_readw), + DEVMETHOD(smbus_bwrite, amdsmb_bwrite), + DEVMETHOD(smbus_bread, amdsmb_bread), + + { 0, 0 } +}; + +static devclass_t amdsmb_devclass; + +static driver_t amdsmb_driver = { + "amdsmb", + amdsmb_methods, + sizeof(struct amdsmb_softc), +}; + +DRIVER_MODULE(amdsmb, pci, amdsmb_driver, amdsmb_devclass, 0, 0); +DRIVER_MODULE(smbus, amdsmb, smbus_driver, smbus_devclass, 0, 0); + +MODULE_DEPEND(amdsmb, pci, 1, 1, 1); +MODULE_DEPEND(amdsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); +MODULE_VERSION(amdsmb, 1); Copied: head/sys/dev/nfsmb/nfsmb.c (from r272014, head/sys/pci/nfsmb.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nfsmb/nfsmb.c Tue Sep 23 05:54:18 2014 (r272016, copy of r272014, head/sys/pci/nfsmb.c) @@ -0,0 +1,657 @@ +/*- + * Copyright (c) 2005 Ruslan Ermilov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include "smbus_if.h" + +#define NFSMB_DEBUG(x) if (nfsmb_debug) (x) + +#ifdef DEBUG +static int nfsmb_debug = 1; +#else +static int nfsmb_debug = 0; +#endif + +/* NVIDIA nForce2/3/4 MCP */ +#define NFSMB_VENDORID_NVIDIA 0x10de +#define NFSMB_DEVICEID_NF2_SMB 0x0064 +#define NFSMB_DEVICEID_NF2_ULTRA_SMB 0x0084 +#define NFSMB_DEVICEID_NF3_PRO150_SMB 0x00d4 +#define NFSMB_DEVICEID_NF3_250GB_SMB 0x00e4 +#define NFSMB_DEVICEID_NF4_SMB 0x0052 +#define NFSMB_DEVICEID_NF4_04_SMB 0x0034 +#define NFSMB_DEVICEID_NF4_51_SMB 0x0264 +#define NFSMB_DEVICEID_NF4_55_SMB 0x0368 +#define NFSMB_DEVICEID_NF4_61_SMB 0x03eb +#define NFSMB_DEVICEID_NF4_65_SMB 0x0446 +#define NFSMB_DEVICEID_NF4_67_SMB 0x0542 +#define NFSMB_DEVICEID_NF4_73_SMB 0x07d8 +#define NFSMB_DEVICEID_NF4_78S_SMB 0x0752 +#define NFSMB_DEVICEID_NF4_79_SMB 0x0aa2 + +/* PCI Configuration space registers */ +#define NF2PCI_SMBASE_1 PCIR_BAR(4) +#define NF2PCI_SMBASE_2 PCIR_BAR(5) + +/* + * ACPI 3.0, Chapter 12, SMBus Host Controller Interface. + */ +#define SMB_PRTCL 0x00 /* protocol */ +#define SMB_STS 0x01 /* status */ +#define SMB_ADDR 0x02 /* address */ +#define SMB_CMD 0x03 /* command */ +#define SMB_DATA 0x04 /* 32 data registers */ +#define SMB_BCNT 0x24 /* number of data bytes */ +#define SMB_ALRM_A 0x25 /* alarm address */ +#define SMB_ALRM_D 0x26 /* 2 bytes alarm data */ + +#define SMB_STS_DONE 0x80 +#define SMB_STS_ALRM 0x40 +#define SMB_STS_RES 0x20 +#define SMB_STS_STATUS 0x1f +#define SMB_STS_OK 0x00 /* OK */ +#define SMB_STS_UF 0x07 /* Unknown Failure */ +#define SMB_STS_DANA 0x10 /* Device Address Not Acknowledged */ +#define SMB_STS_DED 0x11 /* Device Error Detected */ +#define SMB_STS_DCAD 0x12 /* Device Command Access Denied */ +#define SMB_STS_UE 0x13 /* Unknown Error */ +#define SMB_STS_DAD 0x17 /* Device Access Denied */ +#define SMB_STS_T 0x18 /* Timeout */ +#define SMB_STS_HUP 0x19 /* Host Unsupported Protocol */ +#define SMB_STS_B 0x1A /* Busy */ +#define SMB_STS_PEC 0x1F /* PEC (CRC-8) Error */ + +#define SMB_PRTCL_WRITE 0x00 +#define SMB_PRTCL_READ 0x01 +#define SMB_PRTCL_QUICK 0x02 +#define SMB_PRTCL_BYTE 0x04 +#define SMB_PRTCL_BYTE_DATA 0x06 +#define SMB_PRTCL_WORD_DATA 0x08 +#define SMB_PRTCL_BLOCK_DATA 0x0a +#define SMB_PRTCL_PROC_CALL 0x0c +#define SMB_PRTCL_BLOCK_PROC_CALL 0x0d +#define SMB_PRTCL_PEC 0x80 + +struct nfsmb_softc { + int rid; + struct resource *res; + device_t smbus; + device_t subdev; + struct mtx lock; +}; + +#define NFSMB_LOCK(nfsmb) mtx_lock(&(nfsmb)->lock) +#define NFSMB_UNLOCK(nfsmb) mtx_unlock(&(nfsmb)->lock) +#define NFSMB_LOCK_ASSERT(nfsmb) mtx_assert(&(nfsmb)->lock, MA_OWNED) + +#define NFSMB_SMBINB(nfsmb, register) \ + (bus_read_1(nfsmb->res, register)) +#define NFSMB_SMBOUTB(nfsmb, register, value) \ + (bus_write_1(nfsmb->res, register, value)) + +static int nfsmb_detach(device_t dev); +static int nfsmbsub_detach(device_t dev); + +static int +nfsmbsub_probe(device_t dev) +{ + + device_set_desc(dev, "nForce2/3/4 MCP SMBus Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +nfsmb_probe(device_t dev) +{ + u_int16_t vid; + u_int16_t did; + + vid = pci_get_vendor(dev); + did = pci_get_device(dev); + + if (vid == NFSMB_VENDORID_NVIDIA) { + switch(did) { + case NFSMB_DEVICEID_NF2_SMB: + case NFSMB_DEVICEID_NF2_ULTRA_SMB: + case NFSMB_DEVICEID_NF3_PRO150_SMB: + case NFSMB_DEVICEID_NF3_250GB_SMB: + case NFSMB_DEVICEID_NF4_SMB: + case NFSMB_DEVICEID_NF4_04_SMB: + case NFSMB_DEVICEID_NF4_51_SMB: + case NFSMB_DEVICEID_NF4_55_SMB: + case NFSMB_DEVICEID_NF4_61_SMB: + case NFSMB_DEVICEID_NF4_65_SMB: + case NFSMB_DEVICEID_NF4_67_SMB: + case NFSMB_DEVICEID_NF4_73_SMB: + case NFSMB_DEVICEID_NF4_78S_SMB: + case NFSMB_DEVICEID_NF4_79_SMB: + device_set_desc(dev, "nForce2/3/4 MCP SMBus Controller"); + return (BUS_PROBE_DEFAULT); + } + } + + return (ENXIO); +} + +static int +nfsmbsub_attach(device_t dev) +{ + device_t parent; + struct nfsmb_softc *nfsmbsub_sc = device_get_softc(dev); + + parent = device_get_parent(dev); + + nfsmbsub_sc->rid = NF2PCI_SMBASE_2; + + nfsmbsub_sc->res = bus_alloc_resource_any(parent, SYS_RES_IOPORT, + &nfsmbsub_sc->rid, RF_ACTIVE); + if (nfsmbsub_sc->res == NULL) { + /* Older incarnations of the device used non-standard BARs. */ + nfsmbsub_sc->rid = 0x54; + nfsmbsub_sc->res = bus_alloc_resource_any(parent, + SYS_RES_IOPORT, &nfsmbsub_sc->rid, RF_ACTIVE); + if (nfsmbsub_sc->res == NULL) { + device_printf(dev, "could not map i/o space\n"); + return (ENXIO); + } + } + mtx_init(&nfsmbsub_sc->lock, device_get_nameunit(dev), "nfsmb", + MTX_DEF); + + nfsmbsub_sc->smbus = device_add_child(dev, "smbus", -1); + if (nfsmbsub_sc->smbus == NULL) { + nfsmbsub_detach(dev); + return (EINVAL); + } + + bus_generic_attach(dev); + + return (0); +} + +static int +nfsmb_attach(device_t dev) +{ + struct nfsmb_softc *nfsmb_sc = device_get_softc(dev); + + /* Allocate I/O space */ + nfsmb_sc->rid = NF2PCI_SMBASE_1; + + nfsmb_sc->res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &nfsmb_sc->rid, RF_ACTIVE); + + if (nfsmb_sc->res == NULL) { + /* Older incarnations of the device used non-standard BARs. */ + nfsmb_sc->rid = 0x50; + nfsmb_sc->res = bus_alloc_resource_any(dev, + SYS_RES_IOPORT, &nfsmb_sc->rid, RF_ACTIVE); + if (nfsmb_sc->res == NULL) { + device_printf(dev, "could not map i/o space\n"); + return (ENXIO); + } + } + + mtx_init(&nfsmb_sc->lock, device_get_nameunit(dev), "nfsmb", MTX_DEF); + + /* Allocate a new smbus device */ + nfsmb_sc->smbus = device_add_child(dev, "smbus", -1); + if (!nfsmb_sc->smbus) { + nfsmb_detach(dev); + return (EINVAL); + } + + nfsmb_sc->subdev = NULL; + switch (pci_get_device(dev)) { + case NFSMB_DEVICEID_NF2_SMB: + case NFSMB_DEVICEID_NF2_ULTRA_SMB: + case NFSMB_DEVICEID_NF3_PRO150_SMB: + case NFSMB_DEVICEID_NF3_250GB_SMB: + case NFSMB_DEVICEID_NF4_SMB: + case NFSMB_DEVICEID_NF4_04_SMB: + case NFSMB_DEVICEID_NF4_51_SMB: + case NFSMB_DEVICEID_NF4_55_SMB: + case NFSMB_DEVICEID_NF4_61_SMB: + case NFSMB_DEVICEID_NF4_65_SMB: + case NFSMB_DEVICEID_NF4_67_SMB: + case NFSMB_DEVICEID_NF4_73_SMB: + case NFSMB_DEVICEID_NF4_78S_SMB: + case NFSMB_DEVICEID_NF4_79_SMB: + /* Trying to add secondary device as slave */ + nfsmb_sc->subdev = device_add_child(dev, "nfsmb", -1); + if (!nfsmb_sc->subdev) { + nfsmb_detach(dev); + return (EINVAL); + } + break; + default: + break; + } + + bus_generic_attach(dev); + + return (0); +} + +static int +nfsmbsub_detach(device_t dev) +{ + device_t parent; + struct nfsmb_softc *nfsmbsub_sc = device_get_softc(dev); + + parent = device_get_parent(dev); + + if (nfsmbsub_sc->smbus) { + device_delete_child(dev, nfsmbsub_sc->smbus); + nfsmbsub_sc->smbus = NULL; + } + mtx_destroy(&nfsmbsub_sc->lock); + if (nfsmbsub_sc->res) { + bus_release_resource(parent, SYS_RES_IOPORT, nfsmbsub_sc->rid, + nfsmbsub_sc->res); + nfsmbsub_sc->res = NULL; + } + return (0); +} + +static int +nfsmb_detach(device_t dev) +{ + struct nfsmb_softc *nfsmb_sc = device_get_softc(dev); + + if (nfsmb_sc->subdev) { + device_delete_child(dev, nfsmb_sc->subdev); + nfsmb_sc->subdev = NULL; + } + + if (nfsmb_sc->smbus) { + device_delete_child(dev, nfsmb_sc->smbus); + nfsmb_sc->smbus = NULL; + } + + mtx_destroy(&nfsmb_sc->lock); + if (nfsmb_sc->res) { + bus_release_resource(dev, SYS_RES_IOPORT, nfsmb_sc->rid, + nfsmb_sc->res); + nfsmb_sc->res = NULL; + } + + return (0); +} + +static int +nfsmb_callback(device_t dev, int index, void *data) +{ + int error = 0; + + switch (index) { + case SMB_REQUEST_BUS: + case SMB_RELEASE_BUS: + break; + default: + error = EINVAL; + } + + return (error); +} + +static int +nfsmb_wait(struct nfsmb_softc *sc) +{ + u_char sts; + int error, count; + + NFSMB_LOCK_ASSERT(sc); + if (NFSMB_SMBINB(sc, SMB_PRTCL) != 0) + { + count = 10000; + do { + DELAY(500); + } while (NFSMB_SMBINB(sc, SMB_PRTCL) != 0 && count--); + if (count == 0) + return (SMB_ETIMEOUT); + } + + sts = NFSMB_SMBINB(sc, SMB_STS) & SMB_STS_STATUS; + NFSMB_DEBUG(printf("nfsmb: STS=0x%x\n", sts)); + + switch (sts) { + case SMB_STS_OK: + error = SMB_ENOERR; + break; + case SMB_STS_DANA: + error = SMB_ENOACK; + break; + case SMB_STS_B: + error = SMB_EBUSY; + break; + case SMB_STS_T: + error = SMB_ETIMEOUT; + break; + case SMB_STS_DCAD: + case SMB_STS_DAD: + case SMB_STS_HUP: + error = SMB_ENOTSUPP; + break; + default: + error = SMB_EBUSERR; + break; + } + + return (error); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 06:31:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A52CF451; Tue, 23 Sep 2014 06:31:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CDC03F6; Tue, 23 Sep 2014 06:31:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N6VGYf085114; Tue, 23 Sep 2014 06:31:16 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N6VFlM085108; Tue, 23 Sep 2014 06:31:15 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201409230631.s8N6VFlM085108@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 23 Sep 2014 06:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272017 - in head/sys: conf dev/alpm dev/amdpm dev/intpm dev/viapm modules/i2c/controllers/alpm modules/i2c/controllers/amdpm modules/i2c/controllers/intpm modules/i2c/controllers/viapm... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 06:31:16 -0000 Author: rpaulo Date: Tue Sep 23 06:31:15 2014 New Revision: 272017 URL: http://svnweb.freebsd.org/changeset/base/272017 Log: Move all the power management (SMBus) drivers to their own directory, away from sys/pci. Added: head/sys/dev/alpm/ head/sys/dev/alpm/alpm.c - copied unchanged from r272014, head/sys/pci/alpm.c head/sys/dev/amdpm/ head/sys/dev/amdpm/amdpm.c - copied unchanged from r272014, head/sys/pci/amdpm.c head/sys/dev/intpm/ head/sys/dev/intpm/intpm.c - copied, changed from r272014, head/sys/pci/intpm.c head/sys/dev/intpm/intpmreg.h - copied unchanged from r272014, head/sys/pci/intpmreg.h head/sys/dev/viapm/ head/sys/dev/viapm/viapm.c - copied unchanged from r272014, head/sys/pci/viapm.c Deleted: head/sys/pci/alpm.c head/sys/pci/amdpm.c head/sys/pci/intpm.c head/sys/pci/intpmreg.h head/sys/pci/viapm.c Modified: head/sys/conf/files head/sys/modules/i2c/controllers/alpm/Makefile head/sys/modules/i2c/controllers/amdpm/Makefile head/sys/modules/i2c/controllers/intpm/Makefile head/sys/modules/i2c/controllers/viapm/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Sep 23 05:54:18 2014 (r272016) +++ head/sys/conf/files Tue Sep 23 06:31:15 2014 (r272017) @@ -646,6 +646,7 @@ dev/aic7xxx/aic7xxx_pci.c optional ahc p dev/aic7xxx/aic7xxx_reg_print.c optional ahc ahc_reg_pretty_print dev/alc/if_alc.c optional alc pci dev/ale/if_ale.c optional ale pci +dev/alpm/alpm.c optional alpm pci dev/altera/avgen/altera_avgen.c optional altera_avgen dev/altera/avgen/altera_avgen_fdt.c optional altera_avgen fdt dev/altera/avgen/altera_avgen_nexus.c optional altera_avgen @@ -654,6 +655,7 @@ dev/altera/sdcard/altera_sdcard_disk.c o dev/altera/sdcard/altera_sdcard_io.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_fdt.c optional altera_sdcard fdt dev/altera/sdcard/altera_sdcard_nexus.c optional altera_sdcard +dev/amdpm/amdpm.c optional amdpm pci | nfpm pci dev/amdsmb/amdsmb.c optional amdsmb pci dev/amr/amr.c optional amr dev/amr/amr_cam.c optional amrp amr @@ -1484,6 +1486,7 @@ dev/iicbus/s35390a.c optional s35390a dev/iir/iir.c optional iir dev/iir/iir_ctrl.c optional iir dev/iir/iir_pci.c optional iir pci +dev/intpm/intpm.c optional intpm pci # XXX Work around clang warning, until maintainer approves fix. dev/ips/ips.c optional ips \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" @@ -2584,7 +2587,7 @@ dev/utopia/idtphy.c optional utopia dev/utopia/suni.c optional utopia dev/utopia/utopia.c optional utopia dev/vge/if_vge.c optional vge - +dev/viapm/viapm.c optional viapm pci dev/vkbd/vkbd.c optional vkbd dev/vr/if_vr.c optional vr pci dev/vt/colors/vt_termcolors.c optional vt @@ -3868,10 +3871,6 @@ opencrypto/cryptodeflate.c optional cryp opencrypto/rmd160.c optional crypto | ipsec opencrypto/skipjack.c optional crypto opencrypto/xform.c optional crypto -pci/alpm.c optional alpm pci -pci/amdpm.c optional amdpm pci | nfpm pci -pci/intpm.c optional intpm pci -pci/viapm.c optional viapm pci rpc/auth_none.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd rpc/auth_unix.c optional krpc | nfslockd | nfsclient | nfscl | nfsd rpc/authunix_prot.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd Copied: head/sys/dev/alpm/alpm.c (from r272014, head/sys/pci/alpm.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/alpm/alpm.c Tue Sep 23 06:31:15 2014 (r272017, copy of r272014, head/sys/pci/alpm.c) @@ -0,0 +1,663 @@ +/*- + * Copyright (c) 1998, 1999, 2001 Nicolas Souchu + * 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. + */ + +/* + * Power Management support for the Acer M15x3 chipsets + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include "smbus_if.h" + +#define ALPM_DEBUG(x) if (alpm_debug) (x) + +#ifdef DEBUG +static int alpm_debug = 1; +#else +static int alpm_debug = 0; +#endif + +#define ACER_M1543_PMU_ID 0x710110b9 + +/* + * I/O registers offsets - the base address is programmed via the + * SMBBA PCI configuration register + */ +#define SMBSTS 0x0 /* SMBus host/slave status register */ +#define SMBCMD 0x1 /* SMBus host/slave command register */ +#define SMBSTART 0x2 /* start to generate programmed cycle */ +#define SMBHADDR 0x3 /* host address register */ +#define SMBHDATA 0x4 /* data A register for host controller */ +#define SMBHDATB 0x5 /* data B register for host controller */ +#define SMBHBLOCK 0x6 /* block register for host controller */ +#define SMBHCMD 0x7 /* command register for host controller */ + +/* SMBHADDR mask. */ +#define LSB 0x1 /* XXX: Better name: Read/Write? */ + +/* SMBSTS masks */ +#define TERMINATE 0x80 +#define BUS_COLLI 0x40 +#define DEVICE_ERR 0x20 +#define SMI_I_STS 0x10 +#define HST_BSY 0x08 +#define IDL_STS 0x04 +#define HSTSLV_STS 0x02 +#define HSTSLV_BSY 0x01 + +/* SMBCMD masks */ +#define SMB_BLK_CLR 0x80 +#define T_OUT_CMD 0x08 +#define ABORT_HOST 0x04 + +/* SMBus commands */ +#define SMBQUICK 0x00 +#define SMBSRBYTE 0x10 /* send/receive byte */ +#define SMBWRBYTE 0x20 /* write/read byte */ +#define SMBWRWORD 0x30 /* write/read word */ +#define SMBWRBLOCK 0x40 /* write/read block */ + +/* PCI configuration registers and masks + */ +#define COM 0x4 +#define COM_ENABLE_IO 0x1 + +#define SMBBA PCIR_BAR(1) + +#define ATPC 0x5b +#define ATPC_SMBCTRL 0x04 /* XX linux has this as 0x6 */ + +#define SMBHSI 0xe0 +#define SMBHSI_SLAVE 0x2 +#define SMBHSI_HOST 0x1 + +#define SMBHCBC 0xe2 +#define SMBHCBC_CLOCK 0x70 + +#define SMBCLOCK_149K 0x0 +#define SMBCLOCK_74K 0x20 +#define SMBCLOCK_37K 0x40 +#define SMBCLOCK_223K 0x80 +#define SMBCLOCK_111K 0xa0 +#define SMBCLOCK_55K 0xc0 + +struct alpm_softc { + int base; + struct resource *res; + bus_space_tag_t smbst; + bus_space_handle_t smbsh; + device_t smbus; + struct mtx lock; +}; + +#define ALPM_LOCK(alpm) mtx_lock(&(alpm)->lock) +#define ALPM_UNLOCK(alpm) mtx_unlock(&(alpm)->lock) +#define ALPM_LOCK_ASSERT(alpm) mtx_assert(&(alpm)->lock, MA_OWNED) + +#define ALPM_SMBINB(alpm,register) \ + (bus_space_read_1(alpm->smbst, alpm->smbsh, register)) +#define ALPM_SMBOUTB(alpm,register,value) \ + (bus_space_write_1(alpm->smbst, alpm->smbsh, register, value)) + +static int alpm_detach(device_t dev); + +static int +alpm_probe(device_t dev) +{ + + if (pci_get_devid(dev) == ACER_M1543_PMU_ID) { + device_set_desc(dev, "AcerLabs M15x3 Power Management Unit"); + + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +alpm_attach(device_t dev) +{ + int rid; + u_int32_t l; + struct alpm_softc *alpm; + + alpm = device_get_softc(dev); + + /* Unlock SMBIO base register access */ + l = pci_read_config(dev, ATPC, 1); + pci_write_config(dev, ATPC, l & ~ATPC_SMBCTRL, 1); + + /* + * XX linux sets clock to 74k, should we? + l = pci_read_config(dev, SMBHCBC, 1); + l &= 0x1f; + l |= SMBCLOCK_74K; + pci_write_config(dev, SMBHCBC, l, 1); + */ + + if (bootverbose || alpm_debug) { + l = pci_read_config(dev, SMBHSI, 1); + device_printf(dev, "%s/%s", + (l & SMBHSI_HOST) ? "host":"nohost", + (l & SMBHSI_SLAVE) ? "slave":"noslave"); + + l = pci_read_config(dev, SMBHCBC, 1); + switch (l & SMBHCBC_CLOCK) { + case SMBCLOCK_149K: + printf(" 149K"); + break; + case SMBCLOCK_74K: + printf(" 74K"); + break; + case SMBCLOCK_37K: + printf(" 37K"); + break; + case SMBCLOCK_223K: + printf(" 223K"); + break; + case SMBCLOCK_111K: + printf(" 111K"); + break; + case SMBCLOCK_55K: + printf(" 55K"); + break; + default: + printf("unkown"); + break; + } + printf("\n"); + } + + rid = SMBBA; + alpm->res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE); + + if (alpm->res == NULL) { + device_printf(dev,"Could not allocate Bus space\n"); + return (ENXIO); + } + alpm->smbst = rman_get_bustag(alpm->res); + alpm->smbsh = rman_get_bushandle(alpm->res); + mtx_init(&alpm->lock, device_get_nameunit(dev), "alpm", MTX_DEF); + + /* attach the smbus */ + alpm->smbus = device_add_child(dev, "smbus", -1); + if (alpm->smbus == NULL) { + alpm_detach(dev); + return (EINVAL); + } + bus_generic_attach(dev); + + return (0); +} + +static int +alpm_detach(device_t dev) +{ + struct alpm_softc *alpm = device_get_softc(dev); + + if (alpm->smbus) { + device_delete_child(dev, alpm->smbus); + alpm->smbus = NULL; + } + mtx_destroy(&alpm->lock); + + if (alpm->res) + bus_release_resource(dev, SYS_RES_IOPORT, SMBBA, alpm->res); + + return (0); +} + +static int +alpm_callback(device_t dev, int index, void *data) +{ + int error = 0; + + switch (index) { + case SMB_REQUEST_BUS: + case SMB_RELEASE_BUS: + /* ok, bus allocation accepted */ + break; + default: + error = EINVAL; + } + + return (error); +} + +static int +alpm_clear(struct alpm_softc *sc) +{ + ALPM_SMBOUTB(sc, SMBSTS, 0xff); + DELAY(10); + + return (0); +} + +#if 0 +static int +alpm_abort(struct alpm_softc *sc) +{ + ALPM_SMBOUTB(sc, SMBCMD, T_OUT_CMD | ABORT_HOST); + + return (0); +} +#endif + +static int +alpm_idle(struct alpm_softc *sc) +{ + u_char sts; + + sts = ALPM_SMBINB(sc, SMBSTS); + + ALPM_DEBUG(printf("alpm: idle? STS=0x%x\n", sts)); + + return (sts & IDL_STS); +} + +/* + * Poll the SMBus controller + */ +static int +alpm_wait(struct alpm_softc *sc) +{ + int count = 10000; + u_char sts = 0; + int error; + + /* wait for command to complete and SMBus controller is idle */ + while (count--) { + DELAY(10); + sts = ALPM_SMBINB(sc, SMBSTS); + if (sts & SMI_I_STS) + break; + } + + ALPM_DEBUG(printf("alpm: STS=0x%x\n", sts)); + + error = SMB_ENOERR; + + if (!count) + error |= SMB_ETIMEOUT; + + if (sts & TERMINATE) + error |= SMB_EABORT; + + if (sts & BUS_COLLI) + error |= SMB_ENOACK; + + if (sts & DEVICE_ERR) + error |= SMB_EBUSERR; + + if (error != SMB_ENOERR) + alpm_clear(sc); + + return (error); +} + +static int +alpm_quick(device_t dev, u_char slave, int how) +{ + struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev); + int error; + + ALPM_LOCK(sc); + alpm_clear(sc); + if (!alpm_idle(sc)) { + ALPM_UNLOCK(sc); + return (EBUSY); + } + + switch (how) { + case SMB_QWRITE: + ALPM_DEBUG(printf("alpm: QWRITE to 0x%x", slave)); + ALPM_SMBOUTB(sc, SMBHADDR, slave & ~LSB); + break; + case SMB_QREAD: + ALPM_DEBUG(printf("alpm: QREAD to 0x%x", slave)); + ALPM_SMBOUTB(sc, SMBHADDR, slave | LSB); + break; + default: + panic("%s: unknown QUICK command (%x)!", __func__, + how); + } + ALPM_SMBOUTB(sc, SMBCMD, SMBQUICK); + ALPM_SMBOUTB(sc, SMBSTART, 0xff); + + error = alpm_wait(sc); + + ALPM_DEBUG(printf(", error=0x%x\n", error)); + ALPM_UNLOCK(sc); + + return (error); +} + +static int +alpm_sendb(device_t dev, u_char slave, char byte) +{ + struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev); + int error; + + ALPM_LOCK(sc); + alpm_clear(sc); + if (!alpm_idle(sc)) { + ALPM_UNLOCK(sc); + return (SMB_EBUSY); + } + + ALPM_SMBOUTB(sc, SMBHADDR, slave & ~LSB); + ALPM_SMBOUTB(sc, SMBCMD, SMBSRBYTE); + ALPM_SMBOUTB(sc, SMBHDATA, byte); + ALPM_SMBOUTB(sc, SMBSTART, 0xff); + + error = alpm_wait(sc); + + ALPM_DEBUG(printf("alpm: SENDB to 0x%x, byte=0x%x, error=0x%x\n", slave, byte, error)); + ALPM_UNLOCK(sc); + + return (error); +} + +static int +alpm_recvb(device_t dev, u_char slave, char *byte) +{ + struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev); + int error; + + ALPM_LOCK(sc); + alpm_clear(sc); + if (!alpm_idle(sc)) { + ALPM_UNLOCK(sc); + return (SMB_EBUSY); + } + + ALPM_SMBOUTB(sc, SMBHADDR, slave | LSB); + ALPM_SMBOUTB(sc, SMBCMD, SMBSRBYTE); + ALPM_SMBOUTB(sc, SMBSTART, 0xff); + + if ((error = alpm_wait(sc)) == SMB_ENOERR) + *byte = ALPM_SMBINB(sc, SMBHDATA); + + ALPM_DEBUG(printf("alpm: RECVB from 0x%x, byte=0x%x, error=0x%x\n", slave, *byte, error)); + ALPM_UNLOCK(sc); + + return (error); +} + +static int +alpm_writeb(device_t dev, u_char slave, char cmd, char byte) +{ + struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev); + int error; + + ALPM_LOCK(sc); + alpm_clear(sc); + if (!alpm_idle(sc)) { + ALPM_UNLOCK(sc); + return (SMB_EBUSY); + } + + ALPM_SMBOUTB(sc, SMBHADDR, slave & ~LSB); + ALPM_SMBOUTB(sc, SMBCMD, SMBWRBYTE); + ALPM_SMBOUTB(sc, SMBHDATA, byte); + ALPM_SMBOUTB(sc, SMBHCMD, cmd); + ALPM_SMBOUTB(sc, SMBSTART, 0xff); + + error = alpm_wait(sc); + + ALPM_DEBUG(printf("alpm: WRITEB to 0x%x, cmd=0x%x, byte=0x%x, error=0x%x\n", slave, cmd, byte, error)); + ALPM_UNLOCK(sc); + + return (error); +} + +static int +alpm_readb(device_t dev, u_char slave, char cmd, char *byte) +{ + struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev); + int error; + + ALPM_LOCK(sc); + alpm_clear(sc); + if (!alpm_idle(sc)) { + ALPM_UNLOCK(sc); + return (SMB_EBUSY); + } + + ALPM_SMBOUTB(sc, SMBHADDR, slave | LSB); + ALPM_SMBOUTB(sc, SMBCMD, SMBWRBYTE); + ALPM_SMBOUTB(sc, SMBHCMD, cmd); + ALPM_SMBOUTB(sc, SMBSTART, 0xff); + + if ((error = alpm_wait(sc)) == SMB_ENOERR) + *byte = ALPM_SMBINB(sc, SMBHDATA); + + ALPM_DEBUG(printf("alpm: READB from 0x%x, cmd=0x%x, byte=0x%x, error=0x%x\n", slave, cmd, *byte, error)); + ALPM_UNLOCK(sc); + + return (error); +} + +static int +alpm_writew(device_t dev, u_char slave, char cmd, short word) +{ + struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev); + int error; + + ALPM_LOCK(sc); + alpm_clear(sc); + if (!alpm_idle(sc)) { + ALPM_UNLOCK(sc); + return (SMB_EBUSY); + } + + ALPM_SMBOUTB(sc, SMBHADDR, slave & ~LSB); + ALPM_SMBOUTB(sc, SMBCMD, SMBWRWORD); + ALPM_SMBOUTB(sc, SMBHDATA, word & 0x00ff); + ALPM_SMBOUTB(sc, SMBHDATB, (word & 0xff00) >> 8); + ALPM_SMBOUTB(sc, SMBHCMD, cmd); + ALPM_SMBOUTB(sc, SMBSTART, 0xff); + + error = alpm_wait(sc); + + ALPM_DEBUG(printf("alpm: WRITEW to 0x%x, cmd=0x%x, word=0x%x, error=0x%x\n", slave, cmd, word, error)); + ALPM_UNLOCK(sc); + + return (error); +} + +static int +alpm_readw(device_t dev, u_char slave, char cmd, short *word) +{ + struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev); + int error; + u_char high, low; + + ALPM_LOCK(sc); + alpm_clear(sc); + if (!alpm_idle(sc)) { + ALPM_UNLOCK(sc); + return (SMB_EBUSY); + } + + ALPM_SMBOUTB(sc, SMBHADDR, slave | LSB); + ALPM_SMBOUTB(sc, SMBCMD, SMBWRWORD); + ALPM_SMBOUTB(sc, SMBHCMD, cmd); + ALPM_SMBOUTB(sc, SMBSTART, 0xff); + + if ((error = alpm_wait(sc)) == SMB_ENOERR) { + low = ALPM_SMBINB(sc, SMBHDATA); + high = ALPM_SMBINB(sc, SMBHDATB); + + *word = ((high & 0xff) << 8) | (low & 0xff); + } + + ALPM_DEBUG(printf("alpm: READW from 0x%x, cmd=0x%x, word=0x%x, error=0x%x\n", slave, cmd, *word, error)); + ALPM_UNLOCK(sc); + + return (error); +} + +static int +alpm_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf) +{ + struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev); + u_char i; + int error; + + if (count < 1 || count > 32) + return (SMB_EINVAL); + + ALPM_LOCK(sc); + alpm_clear(sc); + if(!alpm_idle(sc)) { + ALPM_UNLOCK(sc); + return (SMB_EBUSY); + } + + ALPM_SMBOUTB(sc, SMBHADDR, slave & ~LSB); + + /* set the cmd and reset the + * 32-byte long internal buffer */ + ALPM_SMBOUTB(sc, SMBCMD, SMBWRBLOCK | SMB_BLK_CLR); + + ALPM_SMBOUTB(sc, SMBHDATA, count); + + /* fill the 32-byte internal buffer */ + for (i = 0; i < count; i++) { + ALPM_SMBOUTB(sc, SMBHBLOCK, buf[i]); + DELAY(2); + } + ALPM_SMBOUTB(sc, SMBHCMD, cmd); + ALPM_SMBOUTB(sc, SMBSTART, 0xff); + + error = alpm_wait(sc); + + ALPM_DEBUG(printf("alpm: WRITEBLK to 0x%x, count=0x%x, cmd=0x%x, error=0x%x", slave, count, cmd, error)); + ALPM_UNLOCK(sc); + + return (error); +} + +static int +alpm_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf) +{ + struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev); + u_char data, len, i; + int error; + + if (*count < 1 || *count > 32) + return (SMB_EINVAL); + + ALPM_LOCK(sc); + alpm_clear(sc); + if (!alpm_idle(sc)) { + ALPM_UNLOCK(sc); + return (SMB_EBUSY); + } + + ALPM_SMBOUTB(sc, SMBHADDR, slave | LSB); + + /* set the cmd and reset the + * 32-byte long internal buffer */ + ALPM_SMBOUTB(sc, SMBCMD, SMBWRBLOCK | SMB_BLK_CLR); + + ALPM_SMBOUTB(sc, SMBHCMD, cmd); + ALPM_SMBOUTB(sc, SMBSTART, 0xff); + + if ((error = alpm_wait(sc)) != SMB_ENOERR) + goto error; + + len = ALPM_SMBINB(sc, SMBHDATA); + + /* read the 32-byte internal buffer */ + for (i = 0; i < len; i++) { + data = ALPM_SMBINB(sc, SMBHBLOCK); + if (i < *count) + buf[i] = data; + DELAY(2); + } + *count = len; + +error: + ALPM_DEBUG(printf("alpm: READBLK to 0x%x, count=0x%x, cmd=0x%x, error=0x%x", slave, *count, cmd, error)); + ALPM_UNLOCK(sc); + + return (error); +} + +static devclass_t alpm_devclass; + +static device_method_t alpm_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, alpm_probe), + DEVMETHOD(device_attach, alpm_attach), + DEVMETHOD(device_detach, alpm_detach), + + /* smbus interface */ + DEVMETHOD(smbus_callback, alpm_callback), + DEVMETHOD(smbus_quick, alpm_quick), + DEVMETHOD(smbus_sendb, alpm_sendb), + DEVMETHOD(smbus_recvb, alpm_recvb), + DEVMETHOD(smbus_writeb, alpm_writeb), + DEVMETHOD(smbus_readb, alpm_readb), + DEVMETHOD(smbus_writew, alpm_writew), + DEVMETHOD(smbus_readw, alpm_readw), + DEVMETHOD(smbus_bwrite, alpm_bwrite), + DEVMETHOD(smbus_bread, alpm_bread), + + { 0, 0 } +}; + +static driver_t alpm_driver = { + "alpm", + alpm_methods, + sizeof(struct alpm_softc) +}; + +DRIVER_MODULE(alpm, pci, alpm_driver, alpm_devclass, 0, 0); +DRIVER_MODULE(smbus, alpm, smbus_driver, smbus_devclass, 0, 0); +MODULE_DEPEND(alpm, pci, 1, 1, 1); +MODULE_DEPEND(alpm, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); +MODULE_VERSION(alpm, 1); Copied: head/sys/dev/amdpm/amdpm.c (from r272014, head/sys/pci/amdpm.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/amdpm/amdpm.c Tue Sep 23 06:31:15 2014 (r272017, copy of r272014, head/sys/pci/amdpm.c) @@ -0,0 +1,668 @@ +/*- + * Copyright (c) 2000 Matthew C. Forman + * + * Based (heavily) on alpm.c which is: + * + * Copyright (c) 1998, 1999 Nicolas Souchu + * 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. + */ + +/* + * Power management function/SMBus function support for the AMD 756 chip. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include "smbus_if.h" + +#define AMDPM_DEBUG(x) if (amdpm_debug) (x) + +#ifdef DEBUG +static int amdpm_debug = 1; +#else +static int amdpm_debug = 0; +#endif + +#define AMDPM_VENDORID_AMD 0x1022 +#define AMDPM_DEVICEID_AMD756PM 0x740b +#define AMDPM_DEVICEID_AMD766PM 0x7413 +#define AMDPM_DEVICEID_AMD768PM 0x7443 +#define AMDPM_DEVICEID_AMD8111PM 0x746B + +/* nVidia nForce chipset */ +#define AMDPM_VENDORID_NVIDIA 0x10de +#define AMDPM_DEVICEID_NF_SMB 0x01b4 + +/* PCI Configuration space registers */ +#define AMDPCI_PMBASE 0x58 +#define NFPCI_PMBASE 0x14 + +#define AMDPCI_GEN_CONFIG_PM 0x41 +#define AMDPCI_PMIOEN (1<<7) + +#define AMDPCI_SCIINT_CONFIG_PM 0x42 +#define AMDPCI_SCISEL_IRQ11 11 + +#define AMDPCI_REVID 0x08 + +/* + * I/O registers. + * Base address programmed via AMDPCI_PMBASE. + */ + +#define AMDSMB_GLOBAL_STATUS (0x00) +#define AMDSMB_GS_TO_STS (1<<5) +#define AMDSMB_GS_HCYC_STS (1<<4) +#define AMDSMB_GS_HST_STS (1<<3) +#define AMDSMB_GS_PRERR_STS (1<<2) +#define AMDSMB_GS_COL_STS (1<<1) +#define AMDSMB_GS_ABRT_STS (1<<0) +#define AMDSMB_GS_CLEAR_STS (AMDSMB_GS_TO_STS|AMDSMB_GS_HCYC_STS|AMDSMB_GS_PRERR_STS|AMDSMB_GS_COL_STS|AMDSMB_GS_ABRT_STS) + +#define AMDSMB_GLOBAL_ENABLE (0x02) +#define AMDSMB_GE_ABORT (1<<5) +#define AMDSMB_GE_HCYC_EN (1<<4) +#define AMDSMB_GE_HOST_STC (1<<3) +#define AMDSMB_GE_CYC_QUICK 0 +#define AMDSMB_GE_CYC_BYTE 1 +#define AMDSMB_GE_CYC_BDATA 2 +#define AMDSMB_GE_CYC_WDATA 3 +#define AMDSMB_GE_CYC_PROCCALL 4 +#define AMDSMB_GE_CYC_BLOCK 5 + +#define LSB 0x1 /* XXX: Better name: Read/Write? */ + +#define AMDSMB_HSTADDR (0x04) +#define AMDSMB_HSTDATA (0x06) +#define AMDSMB_HSTCMD (0x08) +#define AMDSMB_HSTDFIFO (0x09) +#define AMDSMB_HSLVDATA (0x0A) +#define AMDSMB_HSLVDA (0x0C) +#define AMDSMB_HSLVDDR (0x0E) +#define AMDSMB_SNPADDR (0x0F) + +struct amdpm_softc { + int base; + int rid; + struct resource *res; + device_t smbus; + struct mtx lock; +}; + +#define AMDPM_LOCK(amdpm) mtx_lock(&(amdpm)->lock) +#define AMDPM_UNLOCK(amdpm) mtx_unlock(&(amdpm)->lock) +#define AMDPM_LOCK_ASSERT(amdpm) mtx_assert(&(amdpm)->lock, MA_OWNED) + +#define AMDPM_SMBINB(amdpm,register) \ + (bus_read_1(amdpm->res, register)) +#define AMDPM_SMBOUTB(amdpm,register,value) \ + (bus_write_1(amdpm->res, register, value)) +#define AMDPM_SMBINW(amdpm,register) \ + (bus_read_2(amdpm->res, register)) +#define AMDPM_SMBOUTW(amdpm,register,value) \ + (bus_write_2(amdpm->res, register, value)) + +static int amdpm_detach(device_t dev); + +static int +amdpm_probe(device_t dev) +{ + u_long base; + u_int16_t vid; + u_int16_t did; + + vid = pci_get_vendor(dev); + did = pci_get_device(dev); + if ((vid == AMDPM_VENDORID_AMD) && + ((did == AMDPM_DEVICEID_AMD756PM) || + (did == AMDPM_DEVICEID_AMD766PM) || + (did == AMDPM_DEVICEID_AMD768PM) || + (did == AMDPM_DEVICEID_AMD8111PM))) { + device_set_desc(dev, "AMD 756/766/768/8111 Power Management Controller"); + + /* + * We have to do this, since the BIOS won't give us the + * resource info (not mine, anyway). + */ + base = pci_read_config(dev, AMDPCI_PMBASE, 4); + base &= 0xff00; + bus_set_resource(dev, SYS_RES_IOPORT, AMDPCI_PMBASE, + base+0xe0, 32); + return (BUS_PROBE_DEFAULT); + } + + if ((vid == AMDPM_VENDORID_NVIDIA) && + (did == AMDPM_DEVICEID_NF_SMB)) { + device_set_desc(dev, "nForce SMBus Controller"); + + /* + * We have to do this, since the BIOS won't give us the + * resource info (not mine, anyway). + */ + base = pci_read_config(dev, NFPCI_PMBASE, 4); + base &= 0xff00; + bus_set_resource(dev, SYS_RES_IOPORT, NFPCI_PMBASE, + base, 32); + + return (BUS_PROBE_DEFAULT); + } + + return ENXIO; +} + +static int +amdpm_attach(device_t dev) +{ + struct amdpm_softc *amdpm_sc = device_get_softc(dev); + u_char val_b; + + /* Enable I/O block access */ + val_b = pci_read_config(dev, AMDPCI_GEN_CONFIG_PM, 1); + pci_write_config(dev, AMDPCI_GEN_CONFIG_PM, val_b | AMDPCI_PMIOEN, 1); + + /* Allocate I/O space */ + if (pci_get_vendor(dev) == AMDPM_VENDORID_AMD) + amdpm_sc->rid = AMDPCI_PMBASE; + else + amdpm_sc->rid = NFPCI_PMBASE; + amdpm_sc->res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &amdpm_sc->rid, RF_ACTIVE); + + if (amdpm_sc->res == NULL) { + device_printf(dev, "could not map i/o space\n"); + return (ENXIO); + } + + mtx_init(&amdpm_sc->lock, device_get_nameunit(dev), "amdpm", MTX_DEF); + + /* Allocate a new smbus device */ + amdpm_sc->smbus = device_add_child(dev, "smbus", -1); + if (!amdpm_sc->smbus) { + amdpm_detach(dev); + return (EINVAL); + } + + bus_generic_attach(dev); + + return (0); +} + +static int +amdpm_detach(device_t dev) +{ + struct amdpm_softc *amdpm_sc = device_get_softc(dev); + + if (amdpm_sc->smbus) { + device_delete_child(dev, amdpm_sc->smbus); + amdpm_sc->smbus = NULL; + } + + mtx_destroy(&amdpm_sc->lock); + if (amdpm_sc->res) + bus_release_resource(dev, SYS_RES_IOPORT, amdpm_sc->rid, + amdpm_sc->res); + + return (0); +} + +static int +amdpm_callback(device_t dev, int index, void *data) +{ + int error = 0; + + switch (index) { + case SMB_REQUEST_BUS: + case SMB_RELEASE_BUS: + break; + default: + error = EINVAL; + } + + return (error); +} + +static int +amdpm_clear(struct amdpm_softc *sc) +{ + + AMDPM_LOCK_ASSERT(sc); + AMDPM_SMBOUTW(sc, AMDSMB_GLOBAL_STATUS, AMDSMB_GS_CLEAR_STS); + DELAY(10); + + return (0); +} + +#if 0 +static int +amdpm_abort(struct amdpm_softc *sc) +{ + u_short l; + + l = AMDPM_SMBINW(sc, AMDSMB_GLOBAL_ENABLE); + AMDPM_SMBOUTW(sc, AMDSMB_GLOBAL_ENABLE, l | AMDSMB_GE_ABORT); + + return (0); +} +#endif + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 06:31:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B123C595; Tue, 23 Sep 2014 06:31:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82950400; Tue, 23 Sep 2014 06:31:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N6VlhW087506; Tue, 23 Sep 2014 06:31:47 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N6VlX6087504; Tue, 23 Sep 2014 06:31:47 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201409230631.s8N6VlX6087504@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 23 Sep 2014 06:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272018 - head/sys/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 06:31:47 -0000 Author: rpaulo Date: Tue Sep 23 06:31:46 2014 New Revision: 272018 URL: http://svnweb.freebsd.org/changeset/base/272018 Log: Remove the empty sys/pci directory. Deleted: head/sys/pci/ From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 06:32:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B2F16D7; Tue, 23 Sep 2014 06:32:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36CED5DF; Tue, 23 Sep 2014 06:32:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N6WKEQ087656; Tue, 23 Sep 2014 06:32:20 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N6WKU7087655; Tue, 23 Sep 2014 06:32:20 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201409230632.s8N6WKU7087655@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 23 Sep 2014 06:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272019 - head/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 06:32:20 -0000 Author: rpaulo Date: Tue Sep 23 06:32:19 2014 New Revision: 272019 URL: http://svnweb.freebsd.org/changeset/base/272019 Log: Remove "pci" from CSCOPEDIRS. Modified: head/sys/Makefile Modified: head/sys/Makefile ============================================================================== --- head/sys/Makefile Tue Sep 23 06:31:46 2014 (r272018) +++ head/sys/Makefile Tue Sep 23 06:32:19 2014 (r272019) @@ -5,7 +5,7 @@ CSCOPEDIRS= boot bsm cam cddl compat con geom gnu isa kern libkern modules net net80211 \ netgraph netinet netinet6 netipsec netnatm netpfil \ netsmb nfs nfsclient nfsserver nlm ofed opencrypto \ - pci rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR} + rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR} .if !defined(CSCOPE_ARCHDIR) .if defined(ALL_ARCH) CSCOPE_ARCHDIR = amd64 arm i386 mips pc98 powerpc sparc64 x86 From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 07:33:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 617231B9; Tue, 23 Sep 2014 07:33:35 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 20BFFBAB; Tue, 23 Sep 2014 07:33:34 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 02F87ACC0; Tue, 23 Sep 2014 07:33:33 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 8405B3551; Tue, 23 Sep 2014 09:33:32 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Warren Block Subject: Re: svn commit: r271434 - head/etc References: <201409111824.s8BIOGOE078057@svn.freebsd.org> Date: Tue, 23 Sep 2014 09:33:32 +0200 In-Reply-To: <201409111824.s8BIOGOE078057@svn.freebsd.org> (Warren Block's message of "Thu, 11 Sep 2014 18:24:16 +0000 (UTC)") Message-ID: <86bnq6ssdv.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 07:33:35 -0000 Warren Block writes: > +Security advisories and errata: https://www.FreeBSD.org/releases/ > +Handbook: https://www.FreeBSD.org/handbook/ > +FAQ: https://www.FreeBSD.org/faq/ > +Mailing list: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questio= ns/ > +Forums: https://forums.FreeBSD.org/ Non-bikesheddy: the first line is wrong. The fourth line is only half true. Bikesheddy: the rest of the file should be replaced with a link to a "getting started" article. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 07:39:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0208733F; Tue, 23 Sep 2014 07:39:20 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id B7E70BCC; Tue, 23 Sep 2014 07:39:19 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id DC18EACCB; Tue, 23 Sep 2014 07:39:18 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 64EC33554; Tue, 23 Sep 2014 09:39:18 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Garrett Cooper Subject: Re: svn commit: r271893 - in head: etc/rc.d tools/build/mk References: <201409200605.s8K65Ot8093395@svn.freebsd.org> Date: Tue, 23 Sep 2014 09:39:18 +0200 In-Reply-To: <201409200605.s8K65Ot8093395@svn.freebsd.org> (Garrett Cooper's message of "Sat, 20 Sep 2014 06:05:24 +0000 (UTC)") Message-ID: <867g0uss49.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 07:39:20 -0000 Garrett Cooper writes: > Log: > Don't install /etc/rc.d/rwho unless MK_RCMDS =3D=3D yes please follow up by svn rm'ing everything that is conditional on MK_RCMDS=3D=3Dyes DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 07:50:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3588610; Tue, 23 Sep 2014 07:50:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC29DCC3; Tue, 23 Sep 2014 07:50:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N7o735021292; Tue, 23 Sep 2014 07:50:07 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N7o4wq021274; Tue, 23 Sep 2014 07:50:04 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409230750.s8N7o4wq021274@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 23 Sep 2014 07:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272020 - in stable/10/sys: amd64/linux32 compat/linux conf i386/linux modules/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 07:50:08 -0000 Author: bz Date: Tue Sep 23 07:50:04 2014 New Revision: 272020 URL: http://svnweb.freebsd.org/changeset/base/272020 Log: MFC r271743: Implement most of timer_{create,settime,gettime,getoverrun,delete} for amd64/linux32. Fix the entirely bogus (untested) version from r161310 for i386/linux using the same shared code in compat/linux. It is unclear to me if we could support more clock mappings but the current set allows me to successfully run commercial 32bit linux software under linuxolator on amd64. Reviewed by: jhb Differential Revision: D784 Sponsored by: DARPA, AFRL Approved by: re (gjb) Added: stable/10/sys/compat/linux/linux_timer.c - copied unchanged from r271743, head/sys/compat/linux/linux_timer.c stable/10/sys/compat/linux/linux_timer.h - copied unchanged from r271743, head/sys/compat/linux/linux_timer.h Modified: stable/10/sys/amd64/linux32/linux.h stable/10/sys/amd64/linux32/linux32_dummy.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/conf/files.pc98 stable/10/sys/i386/linux/linux.h stable/10/sys/i386/linux/linux_machdep.c stable/10/sys/i386/linux/syscalls.master stable/10/sys/modules/linux/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux.h ============================================================================== --- stable/10/sys/amd64/linux32/linux.h Tue Sep 23 06:32:19 2014 (r272019) +++ stable/10/sys/amd64/linux32/linux.h Tue Sep 23 07:50:04 2014 (r272020) @@ -61,6 +61,11 @@ MALLOC_DECLARE(M_LINUX); #define PTRIN(v) (void *)(uintptr_t)(v) #define PTROUT(v) (l_uintptr_t)(uintptr_t)(v) +#define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0) +#define CP2(src,dst,sfld,dfld) do { (dst).dfld = (src).sfld; } while (0) +#define PTRIN_CP(src,dst,fld) \ + do { (dst).fld = PTRIN((src).fld); } while (0) + /* * Provide a separate set of types for the Linux types. */ Modified: stable/10/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_dummy.c Tue Sep 23 06:32:19 2014 (r272019) +++ stable/10/sys/amd64/linux32/linux32_dummy.c Tue Sep 23 07:50:04 2014 (r272020) @@ -74,11 +74,6 @@ DUMMY(epoll_create); DUMMY(epoll_ctl); DUMMY(epoll_wait); DUMMY(remap_file_pages); -DUMMY(timer_create); -DUMMY(timer_settime); -DUMMY(timer_gettime); -DUMMY(timer_getoverrun); -DUMMY(timer_delete); DUMMY(fstatfs64); DUMMY(mbind); DUMMY(get_mempolicy); Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Tue Sep 23 06:32:19 2014 (r272019) +++ stable/10/sys/amd64/linux32/syscalls.master Tue Sep 23 07:50:04 2014 (r272020) @@ -435,11 +435,13 @@ 256 AUE_NULL STD { int linux_epoll_wait(void); } 257 AUE_NULL STD { int linux_remap_file_pages(void); } 258 AUE_NULL STD { int linux_set_tid_address(int *tidptr); } -259 AUE_NULL STD { int linux_timer_create(void); } -260 AUE_NULL STD { int linux_timer_settime(void); } -261 AUE_NULL STD { int linux_timer_gettime(void); } -262 AUE_NULL STD { int linux_timer_getoverrun(void); } -263 AUE_NULL STD { int linux_timer_delete(void); } +259 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \ + struct sigevent *evp, l_timer_t *timerid); } +260 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, l_int flags, \ + const struct itimerspec *new, struct itimerspec *old); } +261 AUE_NULL STD { int linux_timer_gettime(l_timer_t timerid, struct itimerspec *setting); } +262 AUE_NULL STD { int linux_timer_getoverrun(l_timer_t timerid); } +263 AUE_NULL STD { int linux_timer_delete(l_timer_t timerid); } 264 AUE_CLOCK_SETTIME STD { int linux_clock_settime(clockid_t which, struct l_timespec *tp); } 265 AUE_NULL STD { int linux_clock_gettime(clockid_t which, struct l_timespec *tp); } 266 AUE_NULL STD { int linux_clock_getres(clockid_t which, struct l_timespec *tp); } Copied: stable/10/sys/compat/linux/linux_timer.c (from r271743, head/sys/compat/linux/linux_timer.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/compat/linux/linux_timer.c Tue Sep 23 07:50:04 2014 (r272020, copy of r271743, head/sys/compat/linux/linux_timer.c) @@ -0,0 +1,182 @@ +/*- + * Copyright (c) 2014 Bjoern A. Zeeb + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-11-C-0249 + * ("MRC2"), as part of the DARPA MRC research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_compat.h" + +#include +#include +#include +#include +#include +#include +#include + +#ifdef COMPAT_LINUX32 +#include +#include +#else +#include +#include +#endif +#include + +static int +linux_convert_l_clockid(clockid_t *clock_id) +{ + + switch (*clock_id) { + case LINUX_CLOCK_REALTIME: + *clock_id = CLOCK_REALTIME; + break; + case LINUX_CLOCK_MONOTONIC: + *clock_id = CLOCK_MONOTONIC; + break; + default: + return (EINVAL); + } + + return (0); +} + +static int +linux_convert_l_sigevent(struct l_sigevent *l_sig, struct sigevent *sig) +{ + + CP(*l_sig, *sig, sigev_notify); + switch (l_sig->sigev_notify) { + case L_SIGEV_SIGNAL: + sig->sigev_notify = SIGEV_SIGNAL; + CP(*l_sig, *sig, sigev_signo); + PTRIN_CP(*l_sig, *sig, sigev_value.sival_ptr); + break; + case L_SIGEV_NONE: + sig->sigev_notify = SIGEV_NONE; + break; + case L_SIGEV_THREAD: +#if 0 + /* Seems to not be used anywhere (anymore)? */ + sig->sigev_notify = SIGEV_THREAD; + return (ENOSYS); +#else + return (EINVAL); +#endif + case L_SIGEV_THREAD_ID: + sig->sigev_notify = SIGEV_THREAD_ID; + CP2(*l_sig, *sig, _l_sigev_un._tid, sigev_notify_thread_id); + CP(*l_sig, *sig, sigev_signo); + PTRIN_CP(*l_sig, *sig, sigev_value.sival_ptr); + break; + default: + return (EINVAL); + } + return (0); +} + +int +linux_timer_create(struct thread *td, struct linux_timer_create_args *uap) +{ + struct l_sigevent l_ev; + struct sigevent ev, *evp; + int error, id; + + if (uap->evp == NULL) { + evp = NULL; + } else { + error = copyin(uap->evp, &l_ev, sizeof(l_ev)); + if (error != 0) + return (error); + error = linux_convert_l_sigevent(&l_ev, &ev); + if (error != 0) + return (error); + evp = &ev; + } + error = linux_convert_l_clockid(&uap->clock_id); + if (error != 0) + return (error); + error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1); + if (error == 0) { + error = copyout(&id, uap->timerid, sizeof(int)); + if (error != 0) + kern_ktimer_delete(td, id); + } + return (error); +} + +int +linux_timer_settime(struct thread *td, struct linux_timer_settime_args *uap) +{ + struct l_itimerspec l_val, l_oval; + struct itimerspec val, oval, *ovalp; + int error; + + error = copyin(uap->new, &l_val, sizeof(l_val)); + if (error != 0) + return (error); + ITS_CP(l_val, val); + ovalp = uap->old != NULL ? &oval : NULL; + error = kern_ktimer_settime(td, uap->timerid, uap->flags, &val, ovalp); + if (error == 0 && uap->old != NULL) { + ITS_CP(oval, l_oval); + error = copyout(&l_oval, uap->old, sizeof(l_oval)); + } + return (error); +} + +int +linux_timer_gettime(struct thread *td, struct linux_timer_gettime_args *uap) +{ + struct l_itimerspec l_val; + struct itimerspec val; + int error; + + error = kern_ktimer_gettime(td, uap->timerid, &val); + if (error == 0) { + ITS_CP(val, l_val); + error = copyout(&l_val, uap->setting, sizeof(l_val)); + } + return (error); +} + +int +linux_timer_getoverrun(struct thread *td, struct linux_timer_getoverrun_args *uap) +{ + + return (kern_ktimer_getoverrun(td, uap->timerid)); +} + +int +linux_timer_delete(struct thread *td, struct linux_timer_delete_args *uap) +{ + + return (kern_ktimer_delete(td, uap->timerid)); +} + Copied: stable/10/sys/compat/linux/linux_timer.h (from r271743, head/sys/compat/linux/linux_timer.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/compat/linux/linux_timer.h Tue Sep 23 07:50:04 2014 (r272020, copy of r271743, head/sys/compat/linux/linux_timer.h) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2014 Bjoern A. Zeeb + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-11-C-0249 + * ("MRC2"), as part of the DARPA MRC research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_TIMER_H +#define _LINUX_TIMER_H + +#ifndef __LINUX_ARCH_SIGEV_PREAMBLE_SIZE +#define __LINUX_ARCH_SIGEV_PREAMBLE_SIZE \ + (sizeof(l_int) * 2 + sizeof(l_sigval_t)) +#endif + +#define LINUX_SIGEV_MAX_SIZE 64 +#define LINUX_SIGEV_PAD_SIZE \ + ((LINUX_SIGEV_MAX_SIZE - __LINUX_ARCH_SIGEV_PREAMBLE_SIZE) / \ + sizeof(l_int)) + +#define LINUX_CLOCK_REALTIME 0 +#define LINUX_CLOCK_MONOTONIC 1 +#define LINUX_CLOCK_PROCESS_CPUTIME_ID 2 +#define LINUX_CLOCK_THREAD_CPUTIME_ID 3 +#define LINUX_CLOCK_MONOTONIC_RAW 4 +#define LINUX_CLOCK_REALTIME_COARSE 5 +#define LINUX_CLOCK_MONOTONIC_COARSE 6 +#define LINUX_CLOCK_BOOTTIME 7 +#define LINUX_CLOCK_REALTIME_ALARM 8 +#define LINUX_CLOCK_BOOTTIME_ALARM 9 +#define LINUX_CLOCK_SGI_CYCLE 10 +#define LINUX_CLOCK_TAI 11 + +#define L_SIGEV_SIGNAL 0 +#define L_SIGEV_NONE 1 +#define L_SIGEV_THREAD 2 +#define L_SIGEV_THREAD_ID 4 + +#define TS_CP(src,dst,fld) do { \ + CP((src).fld,(dst).fld,tv_sec); \ + CP((src).fld,(dst).fld,tv_nsec); \ +} while (0) + +#define ITS_CP(src, dst) do { \ + TS_CP((src), (dst), it_interval); \ + TS_CP((src), (dst), it_value); \ +} while (0) + +struct l_sigevent { + l_sigval_t sigev_value; + l_int sigev_signo; + l_int sigev_notify; + union { + l_int _pad[LINUX_SIGEV_PAD_SIZE]; + l_int _tid; + struct { + l_uintptr_t _function; + l_uintptr_t _attribute; + } _l_sigev_thread; + } _l_sigev_un; +} +#if defined(__amd64__) && defined(COMPAT_LINUX32) +__packed +#endif +; + +struct l_itimerspec { + struct l_timespec it_interval; + struct l_timespec it_value; +}; + +#endif /* _LINUX_TIMER_H */ Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Tue Sep 23 06:32:19 2014 (r272019) +++ stable/10/sys/conf/files.amd64 Tue Sep 23 07:50:04 2014 (r272020) @@ -491,6 +491,7 @@ compat/linux/linux_socket.c optional com compat/linux/linux_stats.c optional compat_linux32 compat/linux/linux_sysctl.c optional compat_linux32 compat/linux/linux_time.c optional compat_linux32 +compat/linux/linux_timer.c optional compat_linux32 compat/linux/linux_uid16.c optional compat_linux32 compat/linux/linux_util.c optional compat_linux32 dev/amr/amr_linux.c optional compat_linux32 amr Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Tue Sep 23 06:32:19 2014 (r272019) +++ stable/10/sys/conf/files.i386 Tue Sep 23 07:50:04 2014 (r272020) @@ -94,6 +94,7 @@ compat/linux/linux_socket.c optional com compat/linux/linux_stats.c optional compat_linux compat/linux/linux_sysctl.c optional compat_linux compat/linux/linux_time.c optional compat_linux +compat/linux/linux_timer.c optional compat_linux compat/linux/linux_uid16.c optional compat_linux compat/linux/linux_util.c optional compat_linux compat/ndis/kern_ndis.c optional ndisapi pci Modified: stable/10/sys/conf/files.pc98 ============================================================================== --- stable/10/sys/conf/files.pc98 Tue Sep 23 06:32:19 2014 (r272019) +++ stable/10/sys/conf/files.pc98 Tue Sep 23 07:50:04 2014 (r272020) @@ -55,6 +55,7 @@ compat/linux/linux_socket.c optional com compat/linux/linux_stats.c optional compat_linux compat/linux/linux_sysctl.c optional compat_linux compat/linux/linux_time.c optional compat_linux +compat/linux/linux_timer.c optional compat_linux compat/linux/linux_uid16.c optional compat_linux compat/linux/linux_util.c optional compat_linux compat/svr4/imgact_svr4.c optional compat_svr4 Modified: stable/10/sys/i386/linux/linux.h ============================================================================== --- stable/10/sys/i386/linux/linux.h Tue Sep 23 06:32:19 2014 (r272019) +++ stable/10/sys/i386/linux/linux.h Tue Sep 23 07:50:04 2014 (r272020) @@ -54,6 +54,11 @@ MALLOC_DECLARE(M_LINUX); #define PTRIN(v) (void *)(v) #define PTROUT(v) (l_uintptr_t)(v) +#define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0) +#define CP2(src,dst,sfld,dfld) do { (dst).dfld = (src).sfld; } while (0) +#define PTRIN_CP(src,dst,fld) \ + do { (dst).fld = PTRIN((src).fld); } while (0) + /* * Provide a separate set of types for the Linux types. */ Modified: stable/10/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/10/sys/i386/linux/linux_machdep.c Tue Sep 23 06:32:19 2014 (r272019) +++ stable/10/sys/i386/linux/linux_machdep.c Tue Sep 23 07:50:04 2014 (r272020) @@ -980,37 +980,6 @@ linux_get_thread_area(struct thread *td, return (0); } -/* copied from kern/kern_time.c */ -int -linux_timer_create(struct thread *td, struct linux_timer_create_args *args) -{ - return sys_ktimer_create(td, (struct ktimer_create_args *) args); -} - -int -linux_timer_settime(struct thread *td, struct linux_timer_settime_args *args) -{ - return sys_ktimer_settime(td, (struct ktimer_settime_args *) args); -} - -int -linux_timer_gettime(struct thread *td, struct linux_timer_gettime_args *args) -{ - return sys_ktimer_gettime(td, (struct ktimer_gettime_args *) args); -} - -int -linux_timer_getoverrun(struct thread *td, struct linux_timer_getoverrun_args *args) -{ - return sys_ktimer_getoverrun(td, (struct ktimer_getoverrun_args *) args); -} - -int -linux_timer_delete(struct thread *td, struct linux_timer_delete_args *args) -{ - return sys_ktimer_delete(td, (struct ktimer_delete_args *) args); -} - /* XXX: this wont work with module - convert it */ int linux_mq_open(struct thread *td, struct linux_mq_open_args *args) Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Tue Sep 23 06:32:19 2014 (r272019) +++ stable/10/sys/i386/linux/syscalls.master Tue Sep 23 07:50:04 2014 (r272020) @@ -439,7 +439,7 @@ 258 AUE_NULL STD { int linux_set_tid_address(int *tidptr); } 259 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \ struct sigevent *evp, l_timer_t *timerid); } -260 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, \ +260 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, l_int flags, \ const struct itimerspec *new, struct itimerspec *old); } 261 AUE_NULL STD { int linux_timer_gettime(l_timer_t timerid, struct itimerspec *setting); } 262 AUE_NULL STD { int linux_timer_getoverrun(l_timer_t timerid); } Modified: stable/10/sys/modules/linux/Makefile ============================================================================== --- stable/10/sys/modules/linux/Makefile Tue Sep 23 06:32:19 2014 (r272019) +++ stable/10/sys/modules/linux/Makefile Tue Sep 23 07:50:04 2014 (r272020) @@ -13,6 +13,7 @@ SRCS= linux_fork.c linux${SFX}_dummy.c l linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \ linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \ + linux_timer.c \ opt_inet6.h opt_compat.h opt_kdtrace.h opt_posix.h opt_usb.h \ vnode_if.h device_if.h bus_if.h assym.s From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 07:53:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61915789; Tue, 23 Sep 2014 07:53:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31738D74; Tue, 23 Sep 2014 07:53:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N7rZZj025094; Tue, 23 Sep 2014 07:53:35 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N7rW54025082; Tue, 23 Sep 2014 07:53:32 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409230753.s8N7rW54025082@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 23 Sep 2014 07:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272021 - in stable/10/sys: amd64/linux32 i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 07:53:35 -0000 Author: bz Date: Tue Sep 23 07:53:32 2014 New Revision: 272021 URL: http://svnweb.freebsd.org/changeset/base/272021 Log: This is a direct commit rather than an MFC of r271744. Re-gen after r272020 (r271743 in head) implementing most of timer_{create,settime,gettime,getoverrun,delete}. Approved by: re (gjb) Sponsored by: DARPA/AFRL Modified: stable/10/sys/amd64/linux32/linux32_proto.h stable/10/sys/amd64/linux32/linux32_syscall.h stable/10/sys/amd64/linux32/linux32_syscalls.c stable/10/sys/amd64/linux32/linux32_sysent.c stable/10/sys/amd64/linux32/linux32_systrace_args.c stable/10/sys/i386/linux/linux_proto.h stable/10/sys/i386/linux/linux_syscall.h stable/10/sys/i386/linux/linux_syscalls.c stable/10/sys/i386/linux/linux_sysent.c stable/10/sys/i386/linux/linux_systrace_args.c Modified: stable/10/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_proto.h Tue Sep 23 07:50:04 2014 (r272020) +++ stable/10/sys/amd64/linux32/linux32_proto.h Tue Sep 23 07:53:32 2014 (r272021) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 272020 2014-09-23 07:50:04Z bz */ #ifndef _LINUX_SYSPROTO_H_ @@ -781,19 +781,25 @@ struct linux_set_tid_address_args { char tidptr_l_[PADL_(int *)]; int * tidptr; char tidptr_r_[PADR_(int *)]; }; struct linux_timer_create_args { - register_t dummy; + char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; + char evp_l_[PADL_(struct sigevent *)]; struct sigevent * evp; char evp_r_[PADR_(struct sigevent *)]; + char timerid_l_[PADL_(l_timer_t *)]; l_timer_t * timerid; char timerid_r_[PADR_(l_timer_t *)]; }; struct linux_timer_settime_args { - register_t dummy; + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char new_l_[PADL_(const struct itimerspec *)]; const struct itimerspec * new; char new_r_[PADR_(const struct itimerspec *)]; + char old_l_[PADL_(struct itimerspec *)]; struct itimerspec * old; char old_r_[PADR_(struct itimerspec *)]; }; struct linux_timer_gettime_args { - register_t dummy; + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; + char setting_l_[PADL_(struct itimerspec *)]; struct itimerspec * setting; char setting_r_[PADR_(struct itimerspec *)]; }; struct linux_timer_getoverrun_args { - register_t dummy; + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; }; struct linux_timer_delete_args { - register_t dummy; + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; }; struct linux_clock_settime_args { char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; Modified: stable/10/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscall.h Tue Sep 23 07:50:04 2014 (r272020) +++ stable/10/sys/amd64/linux32/linux32_syscall.h Tue Sep 23 07:53:32 2014 (r272021) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 272020 2014-09-23 07:50:04Z bz */ #define LINUX_SYS_exit 1 Modified: stable/10/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_syscalls.c Tue Sep 23 07:50:04 2014 (r272020) +++ stable/10/sys/amd64/linux32/linux32_syscalls.c Tue Sep 23 07:53:32 2014 (r272021) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 272020 2014-09-23 07:50:04Z bz */ const char *linux_syscallnames[] = { Modified: stable/10/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysent.c Tue Sep 23 07:50:04 2014 (r272020) +++ stable/10/sys/amd64/linux32/linux32_sysent.c Tue Sep 23 07:53:32 2014 (r272021) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: stable/10/sys/amd64/linux32/syscalls.master 272020 2014-09-23 07:50:04Z bz */ #include "opt_compat.h" @@ -278,11 +278,11 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 256 = linux_epoll_wait */ { 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 257 = linux_remap_file_pages */ { AS(linux_set_tid_address_args), (sy_call_t *)linux_set_tid_address, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 258 = linux_set_tid_address */ - { 0, (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 259 = linux_timer_create */ - { 0, (sy_call_t *)linux_timer_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 260 = linux_timer_settime */ - { 0, (sy_call_t *)linux_timer_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 261 = linux_timer_gettime */ - { 0, (sy_call_t *)linux_timer_getoverrun, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 262 = linux_timer_getoverrun */ - { 0, (sy_call_t *)linux_timer_delete, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 263 = linux_timer_delete */ + { AS(linux_timer_create_args), (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 259 = linux_timer_create */ + { AS(linux_timer_settime_args), (sy_call_t *)linux_timer_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 260 = linux_timer_settime */ + { AS(linux_timer_gettime_args), (sy_call_t *)linux_timer_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 261 = linux_timer_gettime */ + { AS(linux_timer_getoverrun_args), (sy_call_t *)linux_timer_getoverrun, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 262 = linux_timer_getoverrun */ + { AS(linux_timer_delete_args), (sy_call_t *)linux_timer_delete, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 263 = linux_timer_delete */ { AS(linux_clock_settime_args), (sy_call_t *)linux_clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 264 = linux_clock_settime */ { AS(linux_clock_gettime_args), (sy_call_t *)linux_clock_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 265 = linux_clock_gettime */ { AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 266 = linux_clock_getres */ Modified: stable/10/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_systrace_args.c Tue Sep 23 07:50:04 2014 (r272020) +++ stable/10/sys/amd64/linux32/linux32_systrace_args.c Tue Sep 23 07:53:32 2014 (r272021) @@ -1720,27 +1720,43 @@ systrace_args(int sysnum, void *params, } /* linux_timer_create */ case 259: { - *n_args = 0; + struct linux_timer_create_args *p = params; + iarg[0] = p->clock_id; /* clockid_t */ + uarg[1] = (intptr_t) p->evp; /* struct sigevent * */ + uarg[2] = (intptr_t) p->timerid; /* l_timer_t * */ + *n_args = 3; break; } /* linux_timer_settime */ case 260: { - *n_args = 0; + struct linux_timer_settime_args *p = params; + iarg[0] = p->timerid; /* l_timer_t */ + iarg[1] = p->flags; /* l_int */ + uarg[2] = (intptr_t) p->new; /* const struct itimerspec * */ + uarg[3] = (intptr_t) p->old; /* struct itimerspec * */ + *n_args = 4; break; } /* linux_timer_gettime */ case 261: { - *n_args = 0; + struct linux_timer_gettime_args *p = params; + iarg[0] = p->timerid; /* l_timer_t */ + uarg[1] = (intptr_t) p->setting; /* struct itimerspec * */ + *n_args = 2; break; } /* linux_timer_getoverrun */ case 262: { - *n_args = 0; + struct linux_timer_getoverrun_args *p = params; + iarg[0] = p->timerid; /* l_timer_t */ + *n_args = 1; break; } /* linux_timer_delete */ case 263: { - *n_args = 0; + struct linux_timer_delete_args *p = params; + iarg[0] = p->timerid; /* l_timer_t */ + *n_args = 1; break; } /* linux_clock_settime */ @@ -4829,18 +4845,71 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_timer_create */ case 259: + switch(ndx) { + case 0: + p = "clockid_t"; + break; + case 1: + p = "struct sigevent *"; + break; + case 2: + p = "l_timer_t *"; + break; + default: + break; + }; break; /* linux_timer_settime */ case 260: + switch(ndx) { + case 0: + p = "l_timer_t"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "const struct itimerspec *"; + break; + case 3: + p = "struct itimerspec *"; + break; + default: + break; + }; break; /* linux_timer_gettime */ case 261: + switch(ndx) { + case 0: + p = "l_timer_t"; + break; + case 1: + p = "struct itimerspec *"; + break; + default: + break; + }; break; /* linux_timer_getoverrun */ case 262: + switch(ndx) { + case 0: + p = "l_timer_t"; + break; + default: + break; + }; break; /* linux_timer_delete */ case 263: + switch(ndx) { + case 0: + p = "l_timer_t"; + break; + default: + break; + }; break; /* linux_clock_settime */ case 264: @@ -6413,14 +6482,29 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_timer_create */ case 259: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_timer_settime */ case 260: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_timer_gettime */ case 261: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_timer_getoverrun */ case 262: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_timer_delete */ case 263: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_clock_settime */ case 264: if (ndx == 0 || ndx == 1) Modified: stable/10/sys/i386/linux/linux_proto.h ============================================================================== --- stable/10/sys/i386/linux/linux_proto.h Tue Sep 23 07:50:04 2014 (r272020) +++ stable/10/sys/i386/linux/linux_proto.h Tue Sep 23 07:53:32 2014 (r272021) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 272020 2014-09-23 07:50:04Z bz */ #ifndef _LINUX_SYSPROTO_H_ @@ -787,6 +787,7 @@ struct linux_timer_create_args { }; struct linux_timer_settime_args { char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; char new_l_[PADL_(const struct itimerspec *)]; const struct itimerspec * new; char new_r_[PADR_(const struct itimerspec *)]; char old_l_[PADL_(struct itimerspec *)]; struct itimerspec * old; char old_r_[PADR_(struct itimerspec *)]; }; Modified: stable/10/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/10/sys/i386/linux/linux_syscall.h Tue Sep 23 07:50:04 2014 (r272020) +++ stable/10/sys/i386/linux/linux_syscall.h Tue Sep 23 07:53:32 2014 (r272021) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 272020 2014-09-23 07:50:04Z bz */ #define LINUX_SYS_exit 1 Modified: stable/10/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/10/sys/i386/linux/linux_syscalls.c Tue Sep 23 07:50:04 2014 (r272020) +++ stable/10/sys/i386/linux/linux_syscalls.c Tue Sep 23 07:53:32 2014 (r272021) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 272020 2014-09-23 07:50:04Z bz */ const char *linux_syscallnames[] = { Modified: stable/10/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysent.c Tue Sep 23 07:50:04 2014 (r272020) +++ stable/10/sys/i386/linux/linux_sysent.c Tue Sep 23 07:53:32 2014 (r272021) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 255675 2013-09-18 18:48:33Z rdivacky + * created from FreeBSD: stable/10/sys/i386/linux/syscalls.master 272020 2014-09-23 07:50:04Z bz */ #include Modified: stable/10/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/10/sys/i386/linux/linux_systrace_args.c Tue Sep 23 07:50:04 2014 (r272020) +++ stable/10/sys/i386/linux/linux_systrace_args.c Tue Sep 23 07:53:32 2014 (r272021) @@ -1781,9 +1781,10 @@ systrace_args(int sysnum, void *params, case 260: { struct linux_timer_settime_args *p = params; iarg[0] = p->timerid; /* l_timer_t */ - uarg[1] = (intptr_t) p->new; /* const struct itimerspec * */ - uarg[2] = (intptr_t) p->old; /* struct itimerspec * */ - *n_args = 3; + iarg[1] = p->flags; /* l_int */ + uarg[2] = (intptr_t) p->new; /* const struct itimerspec * */ + uarg[3] = (intptr_t) p->old; /* struct itimerspec * */ + *n_args = 4; break; } /* linux_timer_gettime */ @@ -5012,9 +5013,12 @@ systrace_entry_setargdesc(int sysnum, in p = "l_timer_t"; break; case 1: - p = "const struct itimerspec *"; + p = "l_int"; break; case 2: + p = "const struct itimerspec *"; + break; + case 3: p = "struct itimerspec *"; break; default: From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 08:33:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 691A8DA8; Tue, 23 Sep 2014 08:33:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5416C18F; Tue, 23 Sep 2014 08:33:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N8X5od043637; Tue, 23 Sep 2014 08:33:05 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N8X31S043630; Tue, 23 Sep 2014 08:33:03 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409230833.s8N8X31S043630@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 23 Sep 2014 08:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272022 - in head/sys: amd64/conf conf modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 08:33:05 -0000 Author: bz Date: Tue Sep 23 08:33:03 2014 New Revision: 272022 URL: http://svnweb.freebsd.org/changeset/base/272022 Log: As per [1] Intel only supports this driver on 64bit platforms. For now restrict it to amd64. Other architectures might be re-added later once tested. Remove the drivers from the global NOTES and files files and move them to the amd64 specifics. Remove the drivers from the i386 modules build and only leave the amd64 version. Rather than depending on "inet" depend on "pci" and make sure that ixl(4) and ixlv(4) can be compiled independently [2]. This also allows the drivers to build properly on IPv4-only or IPv6-only kernels. PR: 193824 [2] Reviewed by: eric.joyner intel.com MFC after: 3 days References: [1] http://lists.freebsd.org/pipermail/svn-src-all/2014-August/090470.html Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/NOTES head/sys/conf/NOTES head/sys/conf/files head/sys/conf/files.amd64 head/sys/modules/Makefile Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue Sep 23 07:53:32 2014 (r272021) +++ head/sys/amd64/conf/GENERIC Tue Sep 23 08:33:03 2014 (r272022) @@ -216,6 +216,8 @@ device de # DEC/Intel DC21x4x (``Tuli device em # Intel PRO/1000 Gigabit Ethernet Family device igb # Intel PRO/1000 PCIE Server Gigabit Family device ixgbe # Intel PRO/10GbE PCIE Ethernet Family +device ixl # Intel XL710 40Gbe PCIE Ethernet +device ixlv # Intel XL710 40Gbe VF PCIE Ethernet device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet device txp # 3Com 3cR990 (``Typhoon'') Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Sep 23 07:53:32 2014 (r272021) +++ head/sys/amd64/conf/NOTES Tue Sep 23 08:33:03 2014 (r272022) @@ -310,6 +310,8 @@ options DRM_DEBUG # Include debug print # iwn: Intel Wireless WiFi Link 1000/105/135/2000/4965/5000/6000/6050 abgn # 802.11 network adapters # Requires the iwn firmware module +# ixl: Intel XL710 40Gbe PCIE Ethernet +# ixlv: Intel XL710 40Gbe VF PCIE Ethernet # mlx4ib: Mellanox ConnectX HCA InfiniBand # mlxen: Mellanox ConnectX HCA Ethernet # mthca: Mellanox HCA InfiniBand @@ -327,6 +329,8 @@ options ED_SIC device ipw # Intel 2100 wireless NICs. device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. device iwn # Intel 4965/1000/5000/6000 wireless NICs. +device ixl # Intel XL710 40Gbe PCIE Ethernet +device ixlv # Intel XL710 40Gbe VF PCIE Ethernet device mlx4ib # Mellanox ConnectX HCA InfiniBand device mlxen # Mellanox ConnectX HCA Ethernet device mthca # Mellanox HCA InfiniBand Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Sep 23 07:53:32 2014 (r272021) +++ head/sys/conf/NOTES Tue Sep 23 08:33:03 2014 (r272022) @@ -2095,8 +2095,6 @@ device em # Intel Pro/1000 Gigabit Eth device igb # Intel Pro/1000 PCIE Gigabit Ethernet device ixgb # Intel Pro/10Gbe PCI-X Ethernet device ixgbe # Intel Pro/10Gbe PCIE Ethernet -device ixl # Intel XL710 40Gbe PCIE Ethernet -device ixlv # Intel XL710 40Gbe VF PCIE Ethernet device le # AMD Am7900 LANCE and Am79C9xx PCnet device mxge # Myricom Myri-10G 10GbE NIC device nxge # Neterion Xframe 10GbE Server/Storage Adapter Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Sep 23 07:53:32 2014 (r272021) +++ head/sys/conf/files Tue Sep 23 08:33:03 2014 (r272022) @@ -1433,26 +1433,6 @@ dev/hptiop/hptiop.c optional hptiop scb dev/hwpmc/hwpmc_logging.c optional hwpmc dev/hwpmc/hwpmc_mod.c optional hwpmc dev/hwpmc/hwpmc_soft.c optional hwpmc -dev/ixl/if_ixl.c optional ixl inet \ - compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixl/if_ixlv.c optional ixlv inet \ - compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixl/ixlvc.c optional ixlv inet \ - compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixl/ixl_txrx.c optional ixl ixlv inet \ - compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixl/i40e_osdep.c optional ixl ixlv inet \ - compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixl/i40e_lan_hmc.c optional ixl ixlv inet \ - compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixl/i40e_hmc.c optional ixl ixlv inet \ - compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixl/i40e_common.c optional ixl ixlv inet \ - compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixl/i40e_nvm.c optional ixl ixlv inet \ - compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixl/i40e_adminq.c optional ixl ixlv inet \ - compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ichsmb/ichsmb.c optional ichsmb dev/ichsmb/ichsmb_pci.c optional ichsmb pci dev/ida/ida.c optional ida Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Sep 23 07:53:32 2014 (r272021) +++ head/sys/conf/files.amd64 Tue Sep 23 08:33:03 2014 (r272022) @@ -192,6 +192,26 @@ dev/ipmi/ipmi_smbios.c optional ipmi dev/ipmi/ipmi_ssif.c optional ipmi smbus dev/ipmi/ipmi_pci.c optional ipmi pci dev/ipmi/ipmi_linux.c optional ipmi compat_linux32 +dev/ixl/if_ixl.c optional ixl pci \ + compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixl/if_ixlv.c optional ixlv pci \ + compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixl/ixlvc.c optional ixlv pci \ + compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixl/ixl_txrx.c optional ixl pci | ixlv pci \ + compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixl/i40e_osdep.c optional ixl pci | ixlv pci \ + compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixl/i40e_lan_hmc.c optional ixl pci | ixlv pci \ + compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixl/i40e_hmc.c optional ixl pci | ixlv pci \ + compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixl/i40e_common.c optional ixl pci | ixlv pci \ + compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixl/i40e_nvm.c optional ixl pci | ixlv pci \ + compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixl/i40e_adminq.c optional ixl pci | ixlv pci \ + compile-with "${NORMAL_C} -I$S/dev/ixl" dev/fdc/fdc.c optional fdc dev/fdc/fdc_acpi.c optional fdc dev/fdc/fdc_isa.c optional fdc isa Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Sep 23 07:53:32 2014 (r272021) +++ head/sys/modules/Makefile Tue Sep 23 08:33:03 2014 (r272022) @@ -625,8 +625,6 @@ _iwnfw= iwnfw .endif _ixgb= ixgb _ixgbe= ixgbe -_ixl= ixl -_ixlv= ixlv _mly= mly _nfe= nfe _nvd= nvd From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 08:39:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA9B31FA; Tue, 23 Sep 2014 08:39:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D611E205; Tue, 23 Sep 2014 08:39:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8N8d8Xr044415; Tue, 23 Sep 2014 08:39:08 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8N8d8RX044414; Tue, 23 Sep 2014 08:39:08 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409230839.s8N8d8RX044414@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 23 Sep 2014 08:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272023 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 08:39:09 -0000 Author: bz Date: Tue Sep 23 08:39:08 2014 New Revision: 272023 URL: http://svnweb.freebsd.org/changeset/base/272023 Log: Given we are restricting ixl(4) to 64bit platforms now backout the change r270820 to common (shared) Intel code no longer needed. MFC after: 3 days Modified: head/sys/dev/ixl/i40e_common.c Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Tue Sep 23 08:33:03 2014 (r272022) +++ head/sys/dev/ixl/i40e_common.c Tue Sep 23 08:39:08 2014 (r272023) @@ -4375,8 +4375,8 @@ enum i40e_status_code i40e_aq_alternate_ cmd_resp->address = CPU_TO_LE32(addr); cmd_resp->length = CPU_TO_LE32(dw_count); - cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)(uintptr_t)buffer)); - cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)(uintptr_t)buffer)); + cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)buffer)); + cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)buffer)); status = i40e_asq_send_command(hw, &desc, buffer, I40E_LO_DWORD(4*dw_count), NULL); @@ -4458,8 +4458,8 @@ enum i40e_status_code i40e_aq_alternate_ cmd_resp->address = CPU_TO_LE32(addr); cmd_resp->length = CPU_TO_LE32(dw_count); - cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_DWORD((u64)(uintptr_t)buffer)); - cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)(uintptr_t)buffer)); + cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_DWORD((u64)buffer)); + cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)buffer)); status = i40e_asq_send_command(hw, &desc, buffer, I40E_LO_DWORD(4*dw_count), NULL); From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 11:27:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 444479EC; Tue, 23 Sep 2014 11:27:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 301EBB5B; Tue, 23 Sep 2014 11:27:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NBRi4k027328; Tue, 23 Sep 2014 11:27:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NBRijI027327; Tue, 23 Sep 2014 11:27:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409231127.s8NBRijI027327@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 23 Sep 2014 11:27:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272025 - head/sys/fs/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 11:27:44 -0000 Author: trasz Date: Tue Sep 23 11:27:43 2014 New Revision: 272025 URL: http://svnweb.freebsd.org/changeset/base/272025 Log: Fix thinko that, with two map entries like shown below, in that order, made autofs mix them up: the second one wasn't visible in ls(1) output, and trying to access it would trigger mount for the first one. foobar host:/foobar foo host:/foo MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/autofs/autofs_vnops.c Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Tue Sep 23 10:56:42 2014 (r272024) +++ head/sys/fs/autofs/autofs_vnops.c Tue Sep 23 11:27:43 2014 (r272025) @@ -544,6 +544,8 @@ autofs_node_find(struct autofs_node *par TAILQ_FOREACH(anp, &parent->an_children, an_next) { if (namelen >= 0) { + if (strlen(anp->an_name) != namelen) + continue; if (strncmp(anp->an_name, name, namelen) != 0) continue; } else { From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 11:41:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CED3ECB; Tue, 23 Sep 2014 11:41:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2FD3D0C; Tue, 23 Sep 2014 11:41:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NBf9x5033177; Tue, 23 Sep 2014 11:41:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NBf9WD033171; Tue, 23 Sep 2014 11:41:09 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201409231141.s8NBf9WD033171@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 23 Sep 2014 11:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272026 - head/usr.bin/xinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 11:41:10 -0000 Author: mjg Date: Tue Sep 23 11:41:09 2014 New Revision: 272026 URL: http://svnweb.freebsd.org/changeset/base/272026 Log: install: re-check failed mkdir for EEXIST Since the code stats and mkdirs in 2 separate steps, it is possible that the directory will be created in the meantime by something else (e.g. concurrent install).[1] While here alter the code to properly report stat failure, previously it would always claim it was mkdir which failed. Noted by: royger [1] MFC after: 1 week Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Tue Sep 23 11:27:43 2014 (r272025) +++ head/usr.bin/xinstall/xinstall.c Tue Sep 23 11:41:09 2014 (r272026) @@ -1263,13 +1263,18 @@ install_dir(char *path) if (!*p || (p != path && *p == '/')) { ch = *p; *p = '\0'; - if (stat(path, &sb)) { - if (errno != ENOENT || mkdir(path, 0755) < 0) { +again: + if (stat(path, &sb) < 0) { + if (errno != ENOENT) + err(EX_OSERR, "stat %s", path); + if (mkdir(path, 0755) < 0) { + if (errno == EEXIST) + goto again; err(EX_OSERR, "mkdir %s", path); - /* NOTREACHED */ - } else if (verbose) + } + if (verbose) (void)printf("install: mkdir %s\n", - path); + path); } else if (!S_ISDIR(sb.st_mode)) errx(EX_OSERR, "%s exists but is not a directory", path); if (!(*p = ch)) From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 12:37:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86AF9B5C; Tue, 23 Sep 2014 12:37:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E0BA6A1; Tue, 23 Sep 2014 12:37:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NCb6r7061245; Tue, 23 Sep 2014 12:37:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NCb27N061223; Tue, 23 Sep 2014 12:37:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409231237.s8NCb27N061223@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 23 Sep 2014 12:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272027 - in head: contrib/ofed/libibverbs/examples contrib/ofed/libmlx4/src sys/conf sys/modules/mlx4 sys/modules/mlxen sys/ofed/drivers/infiniband/hw/mlx4 sys/ofed/drivers/infiniband/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 12:37:06 -0000 Author: hselasky Date: Tue Sep 23 12:37:01 2014 New Revision: 272027 URL: http://svnweb.freebsd.org/changeset/base/272027 Log: Hardware driver update from Mellanox Technologies, including: - improved performance - better stability - new features - bugfixes Supported HCAs: - ConnectX-2 - ConnectX-3 - ConnectX-3 Pro Sponsored by: Mellanox Technologies MFC after: 1 week Added: head/sys/ofed/drivers/net/mlx4/mlx4_stats.h (contents, props changed) head/sys/ofed/drivers/net/mlx4/utils.c (contents, props changed) head/sys/ofed/drivers/net/mlx4/utils.h (contents, props changed) Modified: head/contrib/ofed/libibverbs/examples/asyncwatch.c head/contrib/ofed/libibverbs/examples/device_list.c head/contrib/ofed/libibverbs/examples/devinfo.c head/contrib/ofed/libmlx4/src/mlx4-abi.h head/sys/conf/files head/sys/modules/mlx4/Makefile head/sys/modules/mlxen/Makefile head/sys/ofed/drivers/infiniband/hw/mlx4/mad.c head/sys/ofed/drivers/infiniband/hw/mlx4/main.c head/sys/ofed/drivers/infiniband/hw/mlx4/qp.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c head/sys/ofed/drivers/net/mlx4/alloc.c head/sys/ofed/drivers/net/mlx4/catas.c head/sys/ofed/drivers/net/mlx4/cmd.c head/sys/ofed/drivers/net/mlx4/cq.c head/sys/ofed/drivers/net/mlx4/en_cq.c head/sys/ofed/drivers/net/mlx4/en_ethtool.c head/sys/ofed/drivers/net/mlx4/en_main.c head/sys/ofed/drivers/net/mlx4/en_netdev.c head/sys/ofed/drivers/net/mlx4/en_port.c head/sys/ofed/drivers/net/mlx4/en_port.h head/sys/ofed/drivers/net/mlx4/en_resources.c head/sys/ofed/drivers/net/mlx4/en_rx.c head/sys/ofed/drivers/net/mlx4/en_selftest.c head/sys/ofed/drivers/net/mlx4/en_tx.c head/sys/ofed/drivers/net/mlx4/eq.c head/sys/ofed/drivers/net/mlx4/fw.c head/sys/ofed/drivers/net/mlx4/fw.h head/sys/ofed/drivers/net/mlx4/icm.c head/sys/ofed/drivers/net/mlx4/icm.h head/sys/ofed/drivers/net/mlx4/intf.c head/sys/ofed/drivers/net/mlx4/main.c head/sys/ofed/drivers/net/mlx4/mcg.c head/sys/ofed/drivers/net/mlx4/mlx4.h head/sys/ofed/drivers/net/mlx4/mlx4_en.h head/sys/ofed/drivers/net/mlx4/mr.c head/sys/ofed/drivers/net/mlx4/pd.c head/sys/ofed/drivers/net/mlx4/port.c head/sys/ofed/drivers/net/mlx4/profile.c head/sys/ofed/drivers/net/mlx4/qp.c head/sys/ofed/drivers/net/mlx4/reset.c head/sys/ofed/drivers/net/mlx4/resource_tracker.c head/sys/ofed/drivers/net/mlx4/sense.c head/sys/ofed/drivers/net/mlx4/srq.c head/sys/ofed/drivers/net/mlx4/sys_tune.c head/sys/ofed/include/linux/mlx4/cmd.h head/sys/ofed/include/linux/mlx4/cq.h head/sys/ofed/include/linux/mlx4/device.h head/sys/ofed/include/linux/mlx4/driver.h head/sys/ofed/include/linux/mlx4/qp.h head/sys/ofed/include/linux/mlx4/srq.h Modified: head/contrib/ofed/libibverbs/examples/asyncwatch.c ============================================================================== --- head/contrib/ofed/libibverbs/examples/asyncwatch.c Tue Sep 23 11:41:09 2014 (r272026) +++ head/contrib/ofed/libibverbs/examples/asyncwatch.c Tue Sep 23 12:37:01 2014 (r272027) @@ -35,8 +35,6 @@ #endif /* HAVE_CONFIG_H */ #include -#include -#include #include Modified: head/contrib/ofed/libibverbs/examples/device_list.c ============================================================================== --- head/contrib/ofed/libibverbs/examples/device_list.c Tue Sep 23 11:41:09 2014 (r272026) +++ head/contrib/ofed/libibverbs/examples/device_list.c Tue Sep 23 12:37:01 2014 (r272027) @@ -36,9 +36,6 @@ #include -#include -#include - #include #include Modified: head/contrib/ofed/libibverbs/examples/devinfo.c ============================================================================== --- head/contrib/ofed/libibverbs/examples/devinfo.c Tue Sep 23 11:41:09 2014 (r272026) +++ head/contrib/ofed/libibverbs/examples/devinfo.c Tue Sep 23 12:37:01 2014 (r272027) @@ -41,8 +41,6 @@ #include #include #include -#include -#include #include #include Modified: head/contrib/ofed/libmlx4/src/mlx4-abi.h ============================================================================== --- head/contrib/ofed/libmlx4/src/mlx4-abi.h Tue Sep 23 11:41:09 2014 (r272026) +++ head/contrib/ofed/libmlx4/src/mlx4-abi.h Tue Sep 23 12:37:01 2014 (r272027) @@ -36,7 +36,7 @@ #include #define MLX4_UVERBS_MIN_ABI_VERSION 2 -#define MLX4_UVERBS_MAX_ABI_VERSION 3 +#define MLX4_UVERBS_MAX_ABI_VERSION 4 struct mlx4_alloc_ucontext_resp { struct ibv_get_context_resp ibv_resp; Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Sep 23 11:41:09 2014 (r272026) +++ head/sys/conf/files Tue Sep 23 12:37:01 2014 (r272027) @@ -3781,7 +3781,7 @@ ofed/drivers/net/mlx4/sys_tune.c option ofed/drivers/net/mlx4/en_cq.c optional mlxen \ no-depend obj-prefix "mlx4_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" -ofed/drivers/net/mlx4/en_frag.c optional mlxen \ +ofed/drivers/net/mlx4/utils.c optional mlxen \ no-depend obj-prefix "mlx4_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" ofed/drivers/net/mlx4/en_main.c optional mlxen \ Modified: head/sys/modules/mlx4/Makefile ============================================================================== --- head/sys/modules/mlx4/Makefile Tue Sep 23 11:41:09 2014 (r272026) +++ head/sys/modules/mlx4/Makefile Tue Sep 23 12:37:01 2014 (r272027) @@ -2,7 +2,7 @@ .PATH: ${.CURDIR}/../../ofed/drivers/net/mlx4 .PATH: ${.CURDIR}/../../ofed/include/linux KMOD = mlx4 -SRCS = device_if.h bus_if.h pci_if.h vnode_if.h +SRCS = device_if.h bus_if.h pci_if.h vnode_if.h opt_inet.h opt_inet6.h SRCS+= alloc.c catas.c cmd.c cq.c eq.c fw.c icm.c intf.c main.c mcg.c mr.c linux_compat.c linux_radix.c linux_idr.c SRCS+= pd.c port.c profile.c qp.c reset.c sense.c srq.c resource_tracker.c sys_tune.c Modified: head/sys/modules/mlxen/Makefile ============================================================================== --- head/sys/modules/mlxen/Makefile Tue Sep 23 11:41:09 2014 (r272026) +++ head/sys/modules/mlxen/Makefile Tue Sep 23 12:37:01 2014 (r272027) @@ -3,8 +3,8 @@ KMOD = mlxen SRCS = device_if.h bus_if.h pci_if.h vnode_if.h -SRCS += en_cq.c en_frag.c en_main.c en_netdev.c en_port.c en_resources.c -SRCS += en_rx.c en_tx.c +SRCS += en_cq.c en_main.c en_netdev.c en_port.c en_resources.c +SRCS += en_rx.c en_tx.c utils.c SRCS += opt_inet.h opt_inet6.h CFLAGS+= -I${.CURDIR}/../../ofed/drivers/net/mlx4 CFLAGS+= -I${.CURDIR}/../../ofed/include/ Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/mad.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mlx4/mad.c Tue Sep 23 11:41:09 2014 (r272026) +++ head/sys/ofed/drivers/infiniband/hw/mlx4/mad.c Tue Sep 23 12:37:01 2014 (r272027) @@ -1081,7 +1081,7 @@ static void handle_lid_change_event(stru if (mlx4_is_master(dev->dev) && !dev->sriov.is_going_down) mlx4_gen_slaves_port_mgt_ev(dev->dev, port_num, - MLX4_EQ_PORT_INFO_LID_CHANGE_MASK); + MLX4_EQ_PORT_INFO_LID_CHANGE_MASK, 0, 0); } static void handle_client_rereg_event(struct mlx4_ib_dev *dev, u8 port_num) @@ -1093,7 +1093,7 @@ static void handle_client_rereg_event(st if (!dev->sriov.is_going_down) { mlx4_ib_mcg_port_cleanup(&dev->sriov.demux[port_num - 1], 0); mlx4_gen_slaves_port_mgt_ev(dev->dev, port_num, - MLX4_EQ_PORT_INFO_CLIENT_REREG_MASK); + MLX4_EQ_PORT_INFO_CLIENT_REREG_MASK, 0, 0); } } mlx4_ib_dispatch_event(dev, port_num, IB_EVENT_CLIENT_REREGISTER); @@ -1191,7 +1191,7 @@ void handle_port_mgmt_change_event(struc /*if master, notify all slaves*/ if (mlx4_is_master(dev->dev)) mlx4_gen_slaves_port_mgt_ev(dev->dev, port, - MLX4_EQ_PORT_INFO_GID_PFX_CHANGE_MASK); + MLX4_EQ_PORT_INFO_GID_PFX_CHANGE_MASK, 0, 0); } if (changed_attr & MLX4_EQ_PORT_INFO_CLIENT_REREG_MASK) Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mlx4/main.c Tue Sep 23 11:41:09 2014 (r272026) +++ head/sys/ofed/drivers/infiniband/hw/mlx4/main.c Tue Sep 23 12:37:01 2014 (r272027) @@ -1005,7 +1005,7 @@ static int flow_spec_to_net_rule(struct case IB_FLOW_IB_UC: spec_l2->id = MLX4_NET_TRANS_RULE_ID_IB; if(flow_spec->l2_id.ib_uc.qpn) { - spec_l2->ib.r_u_qpn = cpu_to_be32(flow_spec->l2_id.ib_uc.qpn); + spec_l2->ib.l3_qpn = cpu_to_be32(flow_spec->l2_id.ib_uc.qpn); spec_l2->ib.qpn_msk = cpu_to_be32(0xffffff); } break; @@ -2013,7 +2013,7 @@ static void *mlx4_ib_add(struct mlx4_dev for (i = 0; i < ibdev->num_ports; ++i) { if (mlx4_ib_port_link_layer(&ibdev->ib_dev, i + 1) == IB_LINK_LAYER_ETHERNET) { - err = mlx4_counter_alloc(ibdev->dev, &ibdev->counters[i]); + err = mlx4_counter_alloc(ibdev->dev, i + 1, &ibdev->counters[i]); if (err) ibdev->counters[i] = -1; } else @@ -2112,7 +2112,7 @@ err_steer_qp_release: err_counter: for (; i; --i) if (ibdev->counters[i - 1] != -1) - mlx4_counter_free(ibdev->dev, ibdev->counters[i - 1]); + mlx4_counter_free(ibdev->dev, i, ibdev->counters[i - 1]); err_map: iounmap(ibdev->priv_uar.map); @@ -2200,7 +2200,7 @@ static void mlx4_ib_remove(struct mlx4_d iounmap(ibdev->priv_uar.map); for (p = 0; p < ibdev->num_ports; ++p) if (ibdev->counters[p] != -1) - mlx4_counter_free(ibdev->dev, ibdev->counters[p]); + mlx4_counter_free(ibdev->dev, p + 1, ibdev->counters[p]); mlx4_foreach_port(p, dev, MLX4_PORT_TYPE_IB) mlx4_CLOSE_PORT(dev, p); Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/qp.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mlx4/qp.c Tue Sep 23 11:41:09 2014 (r272026) +++ head/sys/ofed/drivers/infiniband/hw/mlx4/qp.c Tue Sep 23 12:37:01 2014 (r272027) @@ -2679,10 +2679,10 @@ static int mlx4_wq_overflow(struct mlx4_ static __be32 convert_access(int acc) { - return (acc & IB_ACCESS_REMOTE_ATOMIC ? cpu_to_be32(MLX4_WQE_FMR_PERM_ATOMIC) : 0) | - (acc & IB_ACCESS_REMOTE_WRITE ? cpu_to_be32(MLX4_WQE_FMR_PERM_REMOTE_WRITE) : 0) | - (acc & IB_ACCESS_REMOTE_READ ? cpu_to_be32(MLX4_WQE_FMR_PERM_REMOTE_READ) : 0) | - (acc & IB_ACCESS_LOCAL_WRITE ? cpu_to_be32(MLX4_WQE_FMR_PERM_LOCAL_WRITE) : 0) | + return (acc & IB_ACCESS_REMOTE_ATOMIC ? cpu_to_be32(MLX4_WQE_FMR_AND_BIND_PERM_ATOMIC) : 0) | + (acc & IB_ACCESS_REMOTE_WRITE ? cpu_to_be32(MLX4_WQE_FMR_AND_BIND_PERM_REMOTE_WRITE) : 0) | + (acc & IB_ACCESS_REMOTE_READ ? cpu_to_be32(MLX4_WQE_FMR_AND_BIND_PERM_REMOTE_READ) : 0) | + (acc & IB_ACCESS_LOCAL_WRITE ? cpu_to_be32(MLX4_WQE_FMR_PERM_LOCAL_WRITE) : 0) | cpu_to_be32(MLX4_WQE_FMR_PERM_LOCAL_READ); } @@ -2709,10 +2709,12 @@ static void set_fmr_seg(struct mlx4_wqe_ static void set_local_inv_seg(struct mlx4_wqe_local_inval_seg *iseg, u32 rkey) { - iseg->flags = 0; - iseg->mem_key = cpu_to_be32(rkey); - iseg->guest_id = 0; - iseg->pa = 0; + iseg->mem_key = cpu_to_be32(rkey); + + iseg->reserved1 = 0; + iseg->reserved2 = 0; + iseg->reserved3[0] = 0; + iseg->reserved3[1] = 0; } static __always_inline void set_raddr_seg(struct mlx4_wqe_raddr_seg *rseg, Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Tue Sep 23 11:41:09 2014 (r272026) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Tue Sep 23 12:37:01 2014 (r272027) @@ -240,7 +240,7 @@ ipoib_ib_handle_rx_wc(struct ipoib_dev_p */ if (unlikely(!ipoib_alloc_rx_mb(priv, wr_id))) { memcpy(&priv->rx_ring[wr_id], &saverx, sizeof(saverx)); - dev->if_iqdrops++; + if_inc_counter(dev, IFCOUNTER_IQDROPS, 1); goto repost; } Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Tue Sep 23 11:41:09 2014 (r272026) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Tue Sep 23 12:37:01 2014 (r272027) @@ -745,7 +745,7 @@ ipoib_vlan_start(struct ifnet *dev) if (mb == NULL) break; m_freem(mb); - dev->if_oerrors++; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); } } @@ -1452,7 +1452,7 @@ ipoib_input(struct ifnet *ifp, struct mb m->m_flags |= M_BCAST; else m->m_flags |= M_MCAST; - ifp->if_imcasts++; + if_inc_counter(ifp, IFCOUNTER_IMCASTS, 1); } ipoib_demux(ifp, m, ntohs(eh->proto)); Modified: head/sys/ofed/drivers/net/mlx4/alloc.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/alloc.c Tue Sep 23 11:41:09 2014 (r272026) +++ head/sys/ofed/drivers/net/mlx4/alloc.c Tue Sep 23 12:37:01 2014 (r272027) @@ -1,6 +1,6 @@ /* * Copyright (c) 2006, 2007 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2007, 2008 Mellanox Technologies. All rights reserved. + * Copyright (c) 2007, 2008, 2014 Mellanox Technologies. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include @@ -70,9 +70,9 @@ u32 mlx4_bitmap_alloc(struct mlx4_bitmap return obj; } -void mlx4_bitmap_free(struct mlx4_bitmap *bitmap, u32 obj) +void mlx4_bitmap_free(struct mlx4_bitmap *bitmap, u32 obj, int use_rr) { - mlx4_bitmap_free_range(bitmap, obj, 1); + mlx4_bitmap_free_range(bitmap, obj, 1, use_rr); } static unsigned long find_aligned_range(unsigned long *bitmap, @@ -148,11 +148,17 @@ u32 mlx4_bitmap_avail(struct mlx4_bitmap return bitmap->avail; } -void mlx4_bitmap_free_range(struct mlx4_bitmap *bitmap, u32 obj, int cnt) +void mlx4_bitmap_free_range(struct mlx4_bitmap *bitmap, u32 obj, int cnt, + int use_rr) { obj &= bitmap->max + bitmap->reserved_top - 1; spin_lock(&bitmap->lock); + if (!use_rr) { + bitmap->last = min(bitmap->last, obj); + bitmap->top = (bitmap->top + bitmap->max + bitmap->reserved_top) + & bitmap->mask; + } bitmap_clear(bitmap->table, obj, cnt); bitmap->avail += cnt; spin_unlock(&bitmap->lock); Modified: head/sys/ofed/drivers/net/mlx4/catas.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/catas.c Tue Sep 23 11:41:09 2014 (r272026) +++ head/sys/ofed/drivers/net/mlx4/catas.c Tue Sep 23 12:37:01 2014 (r272027) @@ -1,6 +1,6 @@ /* * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2007, 2008 Mellanox Technologies. All rights reserved. + * Copyright (c) 2007, 2008, 2014 Mellanox Technologies. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -34,10 +34,11 @@ #include #include -#include "mlx4.h" +#include -#define MLX4_CATAS_POLL_INTERVAL (5 * HZ) +#include "mlx4.h" +#define MLX4_CATAS_POLL_INTERVAL (5 * HZ) static DEFINE_SPINLOCK(catas_lock); @@ -156,11 +157,13 @@ void mlx4_stop_catas_poll(struct mlx4_de del_timer_sync(&priv->catas_err.timer); - if (priv->catas_err.map) + if (priv->catas_err.map) { iounmap(priv->catas_err.map); + priv->catas_err.map = NULL; + } spin_lock_irq(&catas_lock); - list_del(&priv->catas_err.list); + list_del_init(&priv->catas_err.list); spin_unlock_irq(&catas_lock); } Modified: head/sys/ofed/drivers/net/mlx4/cmd.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/cmd.c Tue Sep 23 11:41:09 2014 (r272026) +++ head/sys/ofed/drivers/net/mlx4/cmd.c Tue Sep 23 12:37:01 2014 (r272027) @@ -1,6 +1,6 @@ /* * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. - * Copyright (c) 2005, 2006, 2007, 2008 Mellanox Technologies. All rights reserved. + * Copyright (c) 2005, 2006, 2007, 2008, 2014 Mellanox Technologies. All rights reserved. * Copyright (c) 2005, 2006, 2007 Cisco Systems, Inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -34,14 +34,17 @@ #include #include +#include #include #include #include +#include #include #include #include +#include #include "mlx4.h" #include "fw.h" @@ -110,6 +113,14 @@ enum { GO_BIT_TIMEOUT_MSECS = 10000 }; +enum mlx4_vlan_transition { + MLX4_VLAN_TRANSITION_VST_VST = 0, + MLX4_VLAN_TRANSITION_VST_VGT = 1, + MLX4_VLAN_TRANSITION_VGT_VST = 2, + MLX4_VLAN_TRANSITION_VGT_VGT = 3, +}; + + struct mlx4_cmd_context { struct completion done; int result; @@ -152,6 +163,131 @@ static int mlx4_status_to_errno(u8 statu return trans_table[status]; } +static const char *cmd_to_str(u16 cmd) +{ + switch (cmd) { + case MLX4_CMD_SYS_EN: return "SYS_EN"; + case MLX4_CMD_SYS_DIS: return "SYS_DIS"; + case MLX4_CMD_MAP_FA: return "MAP_FA"; + case MLX4_CMD_UNMAP_FA: return "UNMAP_FA"; + case MLX4_CMD_RUN_FW: return "RUN_FW"; + case MLX4_CMD_MOD_STAT_CFG: return "MOD_STAT_CFG"; + case MLX4_CMD_QUERY_DEV_CAP: return "QUERY_DEV_CAP"; + case MLX4_CMD_QUERY_FW: return "QUERY_FW"; + case MLX4_CMD_ENABLE_LAM: return "ENABLE_LAM"; + case MLX4_CMD_DISABLE_LAM: return "DISABLE_LAM"; + case MLX4_CMD_QUERY_DDR: return "QUERY_DDR"; + case MLX4_CMD_QUERY_ADAPTER: return "QUERY_ADAPTER"; + case MLX4_CMD_INIT_HCA: return "INIT_HCA"; + case MLX4_CMD_CLOSE_HCA: return "CLOSE_HCA"; + case MLX4_CMD_INIT_PORT: return "INIT_PORT"; + case MLX4_CMD_CLOSE_PORT: return "CLOSE_PORT"; + case MLX4_CMD_QUERY_HCA: return "QUERY_HCA"; + case MLX4_CMD_QUERY_PORT: return "QUERY_PORT"; + case MLX4_CMD_SENSE_PORT: return "SENSE_PORT"; + case MLX4_CMD_HW_HEALTH_CHECK: return "HW_HEALTH_CHECK"; + case MLX4_CMD_SET_PORT: return "SET_PORT"; + case MLX4_CMD_SET_NODE: return "SET_NODE"; + case MLX4_CMD_QUERY_FUNC: return "QUERY_FUNC"; + case MLX4_CMD_MAP_ICM: return "MAP_ICM"; + case MLX4_CMD_UNMAP_ICM: return "UNMAP_ICM"; + case MLX4_CMD_MAP_ICM_AUX: return "MAP_ICM_AUX"; + case MLX4_CMD_UNMAP_ICM_AUX: return "UNMAP_ICM_AUX"; + case MLX4_CMD_SET_ICM_SIZE: return "SET_ICM_SIZE"; + /*master notify fw on finish for slave's flr*/ + case MLX4_CMD_INFORM_FLR_DONE: return "INFORM_FLR_DONE"; + case MLX4_CMD_GET_OP_REQ: return "GET_OP_REQ"; + + /* TPT commands */ + case MLX4_CMD_SW2HW_MPT: return "SW2HW_MPT"; + case MLX4_CMD_QUERY_MPT: return "QUERY_MPT"; + case MLX4_CMD_HW2SW_MPT: return "HW2SW_MPT"; + case MLX4_CMD_READ_MTT: return "READ_MTT"; + case MLX4_CMD_WRITE_MTT: return "WRITE_MTT"; + case MLX4_CMD_SYNC_TPT: return "SYNC_TPT"; + + /* EQ commands */ + case MLX4_CMD_MAP_EQ: return "MAP_EQ"; + case MLX4_CMD_SW2HW_EQ: return "SW2HW_EQ"; + case MLX4_CMD_HW2SW_EQ: return "HW2SW_EQ"; + case MLX4_CMD_QUERY_EQ: return "QUERY_EQ"; + + /* CQ commands */ + case MLX4_CMD_SW2HW_CQ: return "SW2HW_CQ"; + case MLX4_CMD_HW2SW_CQ: return "HW2SW_CQ"; + case MLX4_CMD_QUERY_CQ: return "QUERY_CQ:"; + case MLX4_CMD_MODIFY_CQ: return "MODIFY_CQ:"; + + /* SRQ commands */ + case MLX4_CMD_SW2HW_SRQ: return "SW2HW_SRQ"; + case MLX4_CMD_HW2SW_SRQ: return "HW2SW_SRQ"; + case MLX4_CMD_QUERY_SRQ: return "QUERY_SRQ"; + case MLX4_CMD_ARM_SRQ: return "ARM_SRQ"; + + /* QP/EE commands */ + case MLX4_CMD_RST2INIT_QP: return "RST2INIT_QP"; + case MLX4_CMD_INIT2RTR_QP: return "INIT2RTR_QP"; + case MLX4_CMD_RTR2RTS_QP: return "RTR2RTS_QP"; + case MLX4_CMD_RTS2RTS_QP: return "RTS2RTS_QP"; + case MLX4_CMD_SQERR2RTS_QP: return "SQERR2RTS_QP"; + case MLX4_CMD_2ERR_QP: return "2ERR_QP"; + case MLX4_CMD_RTS2SQD_QP: return "RTS2SQD_QP"; + case MLX4_CMD_SQD2SQD_QP: return "SQD2SQD_QP"; + case MLX4_CMD_SQD2RTS_QP: return "SQD2RTS_QP"; + case MLX4_CMD_2RST_QP: return "2RST_QP"; + case MLX4_CMD_QUERY_QP: return "QUERY_QP"; + case MLX4_CMD_INIT2INIT_QP: return "INIT2INIT_QP"; + case MLX4_CMD_SUSPEND_QP: return "SUSPEND_QP"; + case MLX4_CMD_UNSUSPEND_QP: return "UNSUSPEND_QP"; + /* special QP and management commands */ + case MLX4_CMD_CONF_SPECIAL_QP: return "CONF_SPECIAL_QP"; + case MLX4_CMD_MAD_IFC: return "MAD_IFC"; + + /* multicast commands */ + case MLX4_CMD_READ_MCG: return "READ_MCG"; + case MLX4_CMD_WRITE_MCG: return "WRITE_MCG"; + case MLX4_CMD_MGID_HASH: return "MGID_HASH"; + + /* miscellaneous commands */ + case MLX4_CMD_DIAG_RPRT: return "DIAG_RPRT"; + case MLX4_CMD_NOP: return "NOP"; + case MLX4_CMD_ACCESS_MEM: return "ACCESS_MEM"; + case MLX4_CMD_SET_VEP: return "SET_VEP"; + + /* Ethernet specific commands */ + case MLX4_CMD_SET_VLAN_FLTR: return "SET_VLAN_FLTR"; + case MLX4_CMD_SET_MCAST_FLTR: return "SET_MCAST_FLTR"; + case MLX4_CMD_DUMP_ETH_STATS: return "DUMP_ETH_STATS"; + + /* Communication channel commands */ + case MLX4_CMD_ARM_COMM_CHANNEL: return "ARM_COMM_CHANNEL"; + case MLX4_CMD_GEN_EQE: return "GEN_EQE"; + + /* virtual commands */ + case MLX4_CMD_ALLOC_RES: return "ALLOC_RES"; + case MLX4_CMD_FREE_RES: return "FREE_RES"; + case MLX4_CMD_MCAST_ATTACH: return "MCAST_ATTACH"; + case MLX4_CMD_UCAST_ATTACH: return "UCAST_ATTACH"; + case MLX4_CMD_PROMISC: return "PROMISC"; + case MLX4_CMD_QUERY_FUNC_CAP: return "QUERY_FUNC_CAP"; + case MLX4_CMD_QP_ATTACH: return "QP_ATTACH"; + + /* debug commands */ + case MLX4_CMD_QUERY_DEBUG_MSG: return "QUERY_DEBUG_MSG"; + case MLX4_CMD_SET_DEBUG_MSG: return "SET_DEBUG_MSG"; + + /* statistics commands */ + case MLX4_CMD_QUERY_IF_STAT: return "QUERY_IF_STAT"; + case MLX4_CMD_SET_IF_STAT: return "SET_IF_STAT"; + + /* register/delete flow steering network rules */ + case MLX4_QP_FLOW_STEERING_ATTACH: return "QP_FLOW_STEERING_ATTACH"; + case MLX4_QP_FLOW_STEERING_DETACH: return "QP_FLOW_STEERING_DETACH"; + case MLX4_FLOW_STEERING_IB_UC_QP_RANGE: return "FLOW_STEERING_IB_UC_QP_RANGE"; + default: return "OTHER"; + } +} + static u8 mlx4_errno_to_status(int errno) { switch (errno) { @@ -244,6 +380,17 @@ static int mlx4_comm_cmd_wait(struct mlx down(&cmd->event_sem); + end = msecs_to_jiffies(timeout) + jiffies; + while (comm_pending(dev) && time_before(jiffies, end)) + cond_resched(); + if (comm_pending(dev)) { + mlx4_warn(dev, "mlx4_comm_cmd_wait: Comm channel " + "is not idle. My toggle is %d (op: 0x%x)\n", + mlx4_priv(dev)->cmd.comm_toggle, op); + up(&cmd->event_sem); + return -EAGAIN; + } + spin_lock(&cmd->context_lock); BUG_ON(cmd->free_head < 0); context = &cmd->context[cmd->free_head]; @@ -255,12 +402,8 @@ static int mlx4_comm_cmd_wait(struct mlx mlx4_comm_cmd_post(dev, op, param); - if (!wait_for_completion_timeout(&context->done, - msecs_to_jiffies(timeout))) { - mlx4_warn(dev, "communication channel command 0x%x timed out\n", op); - err = -EBUSY; - goto out; - } + /* In slave, wait unconditionally for completion */ + wait_for_completion(&context->done); err = context->result; if (err && context->fw_status != CMD_STAT_MULTI_FUNC_REQ) { @@ -309,14 +452,29 @@ static int cmd_pending(struct mlx4_dev * !!(status & swab32(1 << HCR_T_BIT))); } -static int mlx4_cmd_post(struct mlx4_dev *dev, u64 in_param, u64 out_param, - u32 in_modifier, u8 op_modifier, u16 op, u16 token, - int event) +static int get_status(struct mlx4_dev *dev, u32 *status, int *go_bit, + int *t_bit) +{ + if (pci_channel_offline(dev->pdev)) + return -EIO; + + *status = readl(mlx4_priv(dev)->cmd.hcr + HCR_STATUS_OFFSET); + *t_bit = !!(*status & swab32(1 << HCR_T_BIT)); + *go_bit = !!(*status & swab32(1 << HCR_GO_BIT)); + + return 0; +} + +static int mlx4_cmd_post(struct mlx4_dev *dev, struct timespec *ts1, + u64 in_param, u64 out_param, u32 in_modifier, + u8 op_modifier, u16 op, u16 token, int event) { struct mlx4_cmd *cmd = &mlx4_priv(dev)->cmd; u32 __iomem *hcr = cmd->hcr; int ret = -EAGAIN; unsigned long end; + int err, go_bit = 0, t_bit = 0; + u32 status = 0; mutex_lock(&cmd->hcr_mutex); @@ -363,6 +521,9 @@ static int mlx4_cmd_post(struct mlx4_dev __raw_writel((__force u32) cpu_to_be32(out_param & 0xfffffffful), hcr + 4); __raw_writel((__force u32) cpu_to_be32(token << 16), hcr + 5); + if (ts1) + ktime_get_ts(ts1); + /* __raw_writel may not order writes. */ wmb(); @@ -383,6 +544,15 @@ static int mlx4_cmd_post(struct mlx4_dev ret = 0; out: + if (ret) { + err = get_status(dev, &status, &go_bit, &t_bit); + mlx4_warn(dev, "Could not post command %s (0x%x): ret=%d, " + "in_param=0x%llx, in_mod=0x%x, op_mod=0x%x, " + "get_status err=%d, status_reg=0x%x, go_bit=%d, " + "t_bit=%d, toggle=0x%x\n", cmd_to_str(op), op, ret, + (unsigned long long) in_param, in_modifier, op_modifier, err, status, + go_bit, t_bit, cmd->toggle); + } mutex_unlock(&cmd->hcr_mutex); return ret; } @@ -439,7 +609,7 @@ static int mlx4_slave_cmd(struct mlx4_de ret = mlx4_status_to_errno(vhcr->status); } else mlx4_err(dev, "failed execution of VHCR_POST command" - "opcode 0x%x\n", op); + "opcode %s (0x%x)\n", cmd_to_str(op), op); } mutex_unlock(&priv->cmd.slave_cmd_mutex); @@ -467,7 +637,7 @@ static int mlx4_cmd_poll(struct mlx4_dev goto out; } - err = mlx4_cmd_post(dev, in_param, out_param ? *out_param : 0, + err = mlx4_cmd_post(dev, NULL, in_param, out_param ? *out_param : 0, in_modifier, op_modifier, op, CMD_POLL_TOKEN, 0); if (err) goto out; @@ -487,7 +657,8 @@ static int mlx4_cmd_poll(struct mlx4_dev } if (cmd_pending(dev)) { - mlx4_warn(dev, "command 0x%x timed out (go bit not cleared)\n", op); + mlx4_warn(dev, "command %s (0x%x) timed out (go bit not cleared)\n", + cmd_to_str(op), op); err = -ETIMEDOUT; goto out; } @@ -502,8 +673,8 @@ static int mlx4_cmd_poll(struct mlx4_dev __raw_readl(hcr + HCR_STATUS_OFFSET)) >> 24; err = mlx4_status_to_errno(stat); if (err) - mlx4_err(dev, "command 0x%x failed: fw status = 0x%x\n", - op, stat); + mlx4_err(dev, "command %s (0x%x) failed: fw status = 0x%x\n", + cmd_to_str(op), op, stat); out: up(&priv->cmd.poll_sem); @@ -527,19 +698,6 @@ void mlx4_cmd_event(struct mlx4_dev *dev complete(&context->done); } -static int get_status(struct mlx4_dev *dev, u32 *status, int *go_bit, - int *t_bit) -{ - if (pci_channel_offline(dev->pdev)) - return -EIO; - - *status = readl(mlx4_priv(dev)->cmd.hcr + HCR_STATUS_OFFSET); - *t_bit = !!(*status & swab32(1 << HCR_T_BIT)); - *go_bit = !!(*status & swab32(1 << HCR_GO_BIT)); - - return 0; -} - static int mlx4_cmd_wait(struct mlx4_dev *dev, u64 in_param, u64 *out_param, int out_is_imm, u32 in_modifier, u8 op_modifier, u16 op, unsigned long timeout) @@ -549,6 +707,12 @@ static int mlx4_cmd_wait(struct mlx4_dev int err = 0; int go_bit = 0, t_bit = 0, stat_err; u32 status = 0; + struct timespec ts1, ts2; + ktime_t t1, t2, delta; + s64 ds; + + if (out_is_imm && !out_param) + return -EINVAL; down(&cmd->event_sem); @@ -561,29 +725,38 @@ static int mlx4_cmd_wait(struct mlx4_dev init_completion(&context->done); - err = mlx4_cmd_post(dev, in_param, out_param ? *out_param : 0, + err = mlx4_cmd_post(dev, &ts1, in_param, out_param ? *out_param : 0, in_modifier, op_modifier, op, context->token, 1); - if (err) { - mlx4_warn(dev, "command 0x%x could not be posted (%d)\n", - op, err); + if (err) goto out; - } if (!wait_for_completion_timeout(&context->done, msecs_to_jiffies(timeout))) { stat_err = get_status(dev, &status, &go_bit, &t_bit); - mlx4_warn(dev, "command 0x%x timed out: " - "get_status err=%d, status=0x%x, go_bit=%d, " - "t_bit=%d, toggle=0x%x\n", op, stat_err, status, - go_bit, t_bit, mlx4_priv(dev)->cmd.toggle); + mlx4_warn(dev, "command %s (0x%x) timed out: in_param=0x%llx, " + "in_mod=0x%x, op_mod=0x%x, get_status err=%d, " + "status_reg=0x%x, go_bit=%d, t_bit=%d, toggle=0x%x\n" + , cmd_to_str(op), op, (unsigned long long) in_param, in_modifier, + op_modifier, stat_err, status, go_bit, t_bit, + mlx4_priv(dev)->cmd.toggle); err = -EBUSY; goto out; } + if (mlx4_debug_level & MLX4_DEBUG_MASK_CMD_TIME) { + ktime_get_ts(&ts2); + t1 = timespec_to_ktime(ts1); + t2 = timespec_to_ktime(ts2); + delta = ktime_sub(t2, t1); + ds = ktime_to_ns(delta); + pr_info("mlx4: fw exec time for %s is %lld nsec\n", cmd_to_str(op), (long long) ds); + } err = context->result; if (err) { - mlx4_err(dev, "command 0x%x failed: fw status = 0x%x\n", - op, context->fw_status); + mlx4_err(dev, "command %s (0x%x) failed: in_param=0x%llx, " + "in_mod=0x%x, op_mod=0x%x, fw status = 0x%x\n", + cmd_to_str(op), op, (unsigned long long) in_param, in_modifier, + op_modifier, context->fw_status); goto out; } @@ -640,7 +813,7 @@ static int mlx4_ACCESS_MEM(struct mlx4_d (slave & ~0x7f) | (size & 0xff)) { mlx4_err(dev, "Bad access mem params - slave_addr:0x%llx " "master_addr:0x%llx slave_id:%d size:%d\n", - (long long)slave_addr, (long long)master_addr, slave, size); + (unsigned long long) slave_addr, (unsigned long long) master_addr, slave, size); return -EINVAL; } @@ -813,6 +986,24 @@ static int mlx4_MAD_IFC_wrapper(struct m vhcr->op, MLX4_CMD_TIME_CLASS_C, MLX4_CMD_NATIVE); } +static int MLX4_CMD_DIAG_RPRT_wrapper(struct mlx4_dev *dev, int slave, + struct mlx4_vhcr *vhcr, + struct mlx4_cmd_mailbox *inbox, + struct mlx4_cmd_mailbox *outbox, + struct mlx4_cmd_info *cmd) +{ + return -EPERM; +} + +static int MLX4_CMD_UPDATE_QP_wrapper(struct mlx4_dev *dev, int slave, + struct mlx4_vhcr *vhcr, + struct mlx4_cmd_mailbox *inbox, + struct mlx4_cmd_mailbox *outbox, + struct mlx4_cmd_info *cmd) +{ + return -EPERM; +} + int mlx4_DMA_wrapper(struct mlx4_dev *dev, int slave, struct mlx4_vhcr *vhcr, struct mlx4_cmd_mailbox *inbox, @@ -950,6 +1141,16 @@ static struct mlx4_cmd_info cmd_info[] = .wrapper = NULL }, { + .opcode = MLX4_CMD_DIAG_RPRT, + .has_inbox = false, + .has_outbox = false, + .out_is_imm = false, + .encode_slave_id = false, + .skip_err_print = true, + .verify = NULL, + .wrapper = MLX4_CMD_DIAG_RPRT_wrapper + }, + { .opcode = MLX4_CMD_NOP, .has_inbox = false, .has_outbox = false, @@ -1247,6 +1448,16 @@ static struct mlx4_cmd_info cmd_info[] = .wrapper = mlx4_GEN_QP_wrapper }, { + .opcode = MLX4_CMD_UPDATE_QP, + .has_inbox = false, + .has_outbox = false, + .out_is_imm = false, + .encode_slave_id = false, + .skip_err_print = true, + .verify = NULL, + .wrapper = MLX4_CMD_UPDATE_QP_wrapper + }, + { .opcode = MLX4_CMD_CONF_SPECIAL_QP, .has_inbox = false, .has_outbox = false, @@ -1348,6 +1559,17 @@ static struct mlx4_cmd_info cmd_info[] = .verify = NULL, .wrapper = mlx4_QP_FLOW_STEERING_DETACH_wrapper }, + /* wol commands */ + { + .opcode = MLX4_CMD_MOD_STAT_CFG, + .has_inbox = false, + .has_outbox = false, + .out_is_imm = false, + .encode_slave_id = false, + .skip_err_print = true, + .verify = NULL, + .wrapper = mlx4_MOD_STAT_CFG_wrapper + }, }; static int mlx4_master_process_vhcr(struct mlx4_dev *dev, int slave, @@ -1401,8 +1623,8 @@ static int mlx4_master_process_vhcr(stru } } if (!cmd) { - mlx4_err(dev, "Unknown command:0x%x accepted from slave:%d\n", - vhcr->op, slave); + mlx4_err(dev, "unparavirt command: %s (0x%x) accepted from slave:%d\n", + cmd_to_str(vhcr->op), vhcr->op, slave); vhcr_cmd->status = CMD_STAT_BAD_PARAM; goto out_status; } @@ -1420,8 +1642,8 @@ static int mlx4_master_process_vhcr(stru if (mlx4_ACCESS_MEM(dev, inbox->dma, slave, vhcr->in_param, MLX4_MAILBOX_SIZE, 1)) { - mlx4_err(dev, "%s: Failed reading inbox (cmd:0x%x)\n", - __func__, cmd->opcode); + mlx4_err(dev, "%s: Failed reading inbox for cmd %s (0x%x)\n", + __func__, cmd_to_str(cmd->opcode), cmd->opcode); vhcr_cmd->status = CMD_STAT_INTERNAL_ERR; goto out_status; } @@ -1429,9 +1651,9 @@ static int mlx4_master_process_vhcr(stru /* Apply permission and bound checks if applicable */ if (cmd->verify && cmd->verify(dev, slave, vhcr, inbox)) { - mlx4_warn(dev, "Command:0x%x from slave: %d failed protection " - "checks for resource_id:%d\n", vhcr->op, slave, - vhcr->in_modifier); + mlx4_warn(dev, "Command %s (0x%x) from slave: %d failed protection " + "checks for resource_id: %d\n", cmd_to_str(vhcr->op), + vhcr->op, slave, vhcr->in_modifier); vhcr_cmd->status = CMD_STAT_BAD_OP; goto out_status; } @@ -1470,9 +1692,13 @@ static int mlx4_master_process_vhcr(stru } if (err) { - mlx4_warn(dev, "vhcr command:0x%x slave:%d failed with" - " error:%d, status %d\n", - vhcr->op, slave, vhcr->errno, err); + if (!cmd->skip_err_print) + mlx4_warn(dev, "vhcr command %s (0x%x) slave:%d " + "in_param 0x%llx in_mod=0x%x, op_mod=0x%x " + "failed with error:%d, status %d\n", + cmd_to_str(vhcr->op), vhcr->op, slave, + (unsigned long long) vhcr->in_param, vhcr->in_modifier, + vhcr->op_modifier, vhcr->errno, err); vhcr_cmd->status = mlx4_errno_to_status(err); goto out_status; } @@ -1487,7 +1713,7 @@ static int mlx4_master_process_vhcr(stru /* If we failed to write back the outbox after the *command was successfully executed, we must fail this * slave, as it is now in undefined state */ - mlx4_err(dev, "%s:Failed writing outbox\n", __func__); + mlx4_err(dev, "%s: Failed writing outbox\n", __func__); goto out; } } @@ -1516,6 +1742,75 @@ out: return ret; } +static int mlx4_master_immediate_activate_vlan_qos(struct mlx4_priv *priv, + int slave, int port) +{ + struct mlx4_vport_oper_state *vp_oper; + struct mlx4_vport_state *vp_admin; + struct mlx4_vf_immed_vlan_work *work; + int err; + int admin_vlan_ix = NO_INDX; + + vp_oper = &priv->mfunc.master.vf_oper[slave].vport[port]; + vp_admin = &priv->mfunc.master.vf_admin[slave].vport[port]; + + if (vp_oper->state.default_vlan == vp_admin->default_vlan && + vp_oper->state.default_qos == vp_admin->default_qos) + return 0; + + work = kzalloc(sizeof(*work), GFP_KERNEL); + if (!work) + return -ENOMEM; + + if (vp_oper->state.default_vlan != vp_admin->default_vlan) { + if (MLX4_VGT != vp_admin->default_vlan) { + err = __mlx4_register_vlan(&priv->dev, port, + vp_admin->default_vlan, + &admin_vlan_ix); + if (err) { + mlx4_warn((&priv->dev), + "No vlan resources slave %d, port %d\n", + slave, port); + return err; + } + } else { + admin_vlan_ix = NO_INDX; + } + work->flags |= MLX4_VF_IMMED_VLAN_FLAG_VLAN; + mlx4_dbg((&(priv->dev)), + "alloc vlan %d idx %d slave %d port %d\n", + (int)(vp_admin->default_vlan), + admin_vlan_ix, slave, port); + } + + /* save original vlan ix and vlan id */ + work->orig_vlan_id = vp_oper->state.default_vlan; + work->orig_vlan_ix = vp_oper->vlan_idx; + + /* handle new qos */ + if (vp_oper->state.default_qos != vp_admin->default_qos) + work->flags |= MLX4_VF_IMMED_VLAN_FLAG_QOS; + + if (work->flags & MLX4_VF_IMMED_VLAN_FLAG_VLAN) + vp_oper->vlan_idx = admin_vlan_ix; + + vp_oper->state.default_vlan = vp_admin->default_vlan; + vp_oper->state.default_qos = vp_admin->default_qos; + + /* iterate over QPs owned by this slave, using UPDATE_QP */ + work->port = port; + work->slave = slave; + work->qos = vp_oper->state.default_qos; + work->vlan_id = vp_oper->state.default_vlan; + work->vlan_ix = vp_oper->vlan_idx; + work->priv = priv; + INIT_WORK(&work->work, mlx4_vf_immed_vlan_work_handler); + queue_work(priv->mfunc.master.comm_wq, &work->work); + + return 0; +} + + static int mlx4_master_activate_admin_state(struct mlx4_priv *priv, int slave) { int port, err; @@ -1527,7 +1822,7 @@ static int mlx4_master_activate_admin_st vp_admin = &priv->mfunc.master.vf_admin[slave].vport[port]; vp_oper->state = *vp_admin; if (MLX4_VGT != vp_admin->default_vlan) { - err = mlx4_register_vlan(&priv->dev, port, + err = __mlx4_register_vlan(&priv->dev, port, vp_admin->default_vlan, &(vp_oper->vlan_idx)); if (err) { vp_oper->vlan_idx = NO_INDX; @@ -1548,12 +1843,12 @@ static int mlx4_master_activate_admin_st err = vp_oper->mac_idx; vp_oper->mac_idx = NO_INDX; mlx4_warn((&priv->dev), - "No mac resorces slave %d, port %d\n", + "No mac resources slave %d, port %d\n", slave, port); return err; } mlx4_dbg((&(priv->dev)), "alloc mac %llx idx %d slave %d port %d\n", - (long long)vp_oper->state.mac, vp_oper->mac_idx, slave, port); + (unsigned long long) vp_oper->state.mac, vp_oper->mac_idx, slave, port); } } return 0; @@ -1599,6 +1894,7 @@ static void mlx4_master_do_cmd(struct ml if (cmd == MLX4_COMM_CMD_RESET) { mlx4_warn(dev, "Received reset from slave:%d\n", slave); slave_state[slave].active = false; + slave_state[slave].old_vlan_api = false; mlx4_master_deactivate_admin_state(priv, slave); for (i = 0; i < MLX4_EVENT_TYPES_NUM; ++i) { slave_state[slave].event_eq[i].eqn = -1; @@ -1619,7 +1915,7 @@ static void mlx4_master_do_cmd(struct ml /*command from slave in the middle of FLR*/ if (cmd != MLX4_COMM_CMD_RESET && MLX4_COMM_CMD_FLR == slave_state[slave].last_cmd) { - mlx4_warn(dev, "slave:%d is Trying to run cmd(0x%x) " + mlx4_warn(dev, "slave:%d is Trying to run cmd (0x%x) " "in the middle of FLR\n", slave, cmd); return; } @@ -1630,7 +1926,6 @@ static void mlx4_master_do_cmd(struct ml goto reset_slave; slave_state[slave].vhcr_dma = ((u64) param) << 48; priv->mfunc.master.slave_state[slave].cookie = 0; - mutex_init(&priv->mfunc.master.gen_eqe_mutex[slave]); break; case MLX4_COMM_CMD_VHCR1: if (slave_state[slave].last_cmd != MLX4_COMM_CMD_VHCR0) @@ -1658,7 +1953,7 @@ static void mlx4_master_do_cmd(struct ml mutex_lock(&priv->cmd.slave_cmd_mutex); if (mlx4_master_process_vhcr(dev, slave, NULL)) { - mlx4_err(dev, "Failed processing vhcr for slave:%d," + mlx4_err(dev, "Failed processing vhcr for slave: %d," " resetting slave.\n", slave); mutex_unlock(&priv->cmd.slave_cmd_mutex); goto reset_slave; @@ -1666,7 +1961,7 @@ static void mlx4_master_do_cmd(struct ml mutex_unlock(&priv->cmd.slave_cmd_mutex); break; default: - mlx4_warn(dev, "Bad comm cmd:%d from slave:%d\n", cmd, slave); + mlx4_warn(dev, "Bad comm cmd: %d from slave: %d\n", cmd, slave); goto reset_slave; } spin_lock_irqsave(&priv->mfunc.master.slave_state_lock, flags); @@ -1676,8 +1971,8 @@ static void mlx4_master_do_cmd(struct ml is_going_down = 1; spin_unlock_irqrestore(&priv->mfunc.master.slave_state_lock, flags); if (is_going_down) { - mlx4_warn(dev, "Slave is going down aborting command(%d)" - " executing from slave:%d\n", + mlx4_warn(dev, "Slave is going down aborting command (%d)" + " executing from slave: %d\n", cmd, slave); return; } @@ -1696,8 +1991,6 @@ reset_slave: spin_unlock_irqrestore(&priv->mfunc.master.slave_state_lock, flags); /*with slave in the middle of flr, no need to clean resources again.*/ inform_slave_state: - memset(&slave_state[slave].event_eq, 0, - sizeof(struct mlx4_slave_event_eq_info)); __raw_writel((__force u32) cpu_to_be32(reply), &priv->mfunc.comm[slave].slave_read); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 13:58:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9EBBBD22; Tue, 23 Sep 2014 13:58:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89C46E2; Tue, 23 Sep 2014 13:58:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NDweo9000198; Tue, 23 Sep 2014 13:58:40 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NDwekQ000197; Tue, 23 Sep 2014 13:58:40 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201409231358.s8NDwekQ000197@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 23 Sep 2014 13:58:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272028 - head/usr.sbin/newsyslog X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 13:58:40 -0000 Author: bdrewery Date: Tue Sep 23 13:58:39 2014 New Revision: 272028 URL: http://svnweb.freebsd.org/changeset/base/272028 Log: Make it more explicitly clear that -t will not change filename. MFC after: 3 days Modified: head/usr.sbin/newsyslog/newsyslog.8 Modified: head/usr.sbin/newsyslog/newsyslog.8 ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.8 Tue Sep 23 12:37:01 2014 (r272027) +++ head/usr.sbin/newsyslog/newsyslog.8 Tue Sep 23 13:58:39 2014 (r272028) @@ -17,7 +17,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd May 19, 2014 +.Dd September 23, 2014 .Dt NEWSYSLOG 8 .Os .Sh NAME @@ -156,6 +156,7 @@ will create the .Dq rotated logfiles using the specified time format instead of the default sequential filenames. +The filename used will be kept until it is deleted. The time format is described in the .Xr strftime 3 manual page. From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 14:31:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 329617C7; Tue, 23 Sep 2014 14:31:12 +0000 (UTC) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 562E16EF; Tue, 23 Sep 2014 14:31:11 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id n12so2828053wgh.35 for ; Tue, 23 Sep 2014 07:31:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=OyffJ32lvZIw14B8p2uqyaphm6kCbfhUQ6Oh1zQdTaU=; b=oSg2axOTAM8sJCuyUjIGz+h7UAbd/qT9m1wa9YbajPBKwEh2uEM9cJSTzIm+Z1RUBU O1gTCSJVmTs9lJSPpYoyBKuTRKnD1j/hvVJHQA8cdQAAk1A+iQzY3wdz47GyxtikhLui 5sMU0elRvjhUNEoM4LbvgbMOSO/+feEOhuPbjkVnftZeoyyYHCljrpNNI5MKagN5xdoN 8/jQjrcEu+VS/LaTKjiGrWqwUHFuZKTHeur5BO8sNL8CuO9oUwG7g8oUq22tSlLYvfa0 9DR50M69LAy6W1StXpgWaI04ViGM3ts8ejgjYq0c8C3UvSBD49y8AShBv5hoJ+BQzclj L44g== MIME-Version: 1.0 X-Received: by 10.194.58.41 with SMTP id n9mr122219wjq.20.1411482669458; Tue, 23 Sep 2014 07:31:09 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.199 with HTTP; Tue, 23 Sep 2014 07:31:09 -0700 (PDT) In-Reply-To: <201409230631.s8N6VlX6087504@svn.freebsd.org> References: <201409230631.s8N6VlX6087504@svn.freebsd.org> Date: Tue, 23 Sep 2014 07:31:09 -0700 X-Google-Sender-Auth: AK8ND6XPbICgOgQv2zKyRr-ynxU Message-ID: Subject: Re: svn commit: r272018 - head/sys/pci From: Adrian Chadd To: Rui Paulo Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 14:31:12 -0000 Yay! -a On 22 September 2014 23:31, Rui Paulo wrote: > Author: rpaulo > Date: Tue Sep 23 06:31:46 2014 > New Revision: 272018 > URL: http://svnweb.freebsd.org/changeset/base/272018 > > Log: > Remove the empty sys/pci directory. > > Deleted: > head/sys/pci/ > From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 14:45:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE248E18; Tue, 23 Sep 2014 14:45:58 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97D7A8A4; Tue, 23 Sep 2014 14:45:58 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 340ABB93B; Tue, 23 Sep 2014 10:45:57 -0400 (EDT) From: John Baldwin To: Rui Paulo Subject: Re: svn commit: r272018 - head/sys/pci Date: Tue, 23 Sep 2014 10:12:09 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201409230631.s8N6VlX6087504@svn.freebsd.org> In-Reply-To: <201409230631.s8N6VlX6087504@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201409231012.09657.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 23 Sep 2014 10:45:57 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 14:45:58 -0000 On Tuesday, September 23, 2014 2:31:47 am Rui Paulo wrote: > Author: rpaulo > Date: Tue Sep 23 06:31:46 2014 > New Revision: 272018 > URL: http://svnweb.freebsd.org/changeset/base/272018 > > Log: > Remove the empty sys/pci directory. > > Deleted: > head/sys/pci/ Thanks for cleaning this up (even though I have pending patches to ncr I'll have to deal with when I merge. :-P) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 14:46:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8634F53; Tue, 23 Sep 2014 14:46:04 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 685E08A5; Tue, 23 Sep 2014 14:46:01 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D7250B988; Tue, 23 Sep 2014 10:46:00 -0400 (EDT) From: John Baldwin To: Bruce Evans Subject: Re: svn commit: r271771 - in head: bin/csh etc/mail lib/libc usr.bin/grep usr.sbin/mtree Date: Tue, 23 Sep 2014 10:19:37 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201409181441.s8IEfvR1075223@svn.freebsd.org> <541D2356.8040403@freebsd.org> <20140920172111.Q4941@besplex.bde.org> In-Reply-To: <20140920172111.Q4941@besplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201409231019.38023.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 23 Sep 2014 10:46:00 -0400 (EDT) Cc: src-committers@freebsd.org, Will Andrews , svn-src-all@freebsd.org, Navdeep Parhar , svn-src-head@freebsd.org, Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 14:46:04 -0000 On Saturday, September 20, 2014 3:38:03 am Bruce Evans wrote: > On Sat, 20 Sep 2014, Julian Elischer wrote: > > > On 9/18/14, 10:41 PM, Will Andrews wrote: > >> Author: will > >> Date: Thu Sep 18 14:41:57 2014 > >> New Revision: 271771 > >> URL: http://svnweb.freebsd.org/changeset/base/271771 > >> > >> Log: > >> Fix incremental builds involving non-root users with read-only source > >> files. > >> Makefiles should not assume that source files can be overwritten. > >> This is the > >> common case for Perforce source trees. > > > > I'm concerned that just adding -f may not really be fixing the problem.. > > why are the files getting overwritten? I'm not sure forcing an overwrite is > > teh right answer to read-only sources. > > The log message is confused. Source files are not being overwritten. > They are being copied to object directories using cp. Then if they > are read-only in the source directory, they are read-only in the object > directory, even if they are copied without -p so as to clobber their > timestamps (their mode is still preserved). Then if the source file's > mtime is changed, either by actually changing the file or just by > clobbering its mtime, the copy in the object directory becomes out of > date. Then the cp to make it up to date fails because it is read-only. I ran into this the other day with the cxgbe firmware config files during a kernel build due to the same issue. That is due to entries in sys/conf/files like this: t4fw_cfg.fw optional cxgbe \ dependency "$S/dev/cxgbe/firmware/t4fw_cfg.txt" \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t4fw_cfg.fw" Not sure if the correct solution there is to force -f for all of these or if ${CP} should be 'cp -f' for kernel builds. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 15:41:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13024BBC; Tue, 23 Sep 2014 15:41:28 +0000 (UTC) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id ABBA9F37; Tue, 23 Sep 2014 15:41:27 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.9/8.14.9) with ESMTP id s8NFfO3n084728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 23 Sep 2014 09:41:24 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.9/8.14.9/Submit) with ESMTP id s8NFfN9f084725; Tue, 23 Sep 2014 09:41:24 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Tue, 23 Sep 2014 09:41:23 -0600 (MDT) From: Warren Block To: =?ISO-8859-15?Q?Dag-Erling_Sm=F8rgrav?= Subject: Re: svn commit: r271434 - head/etc In-Reply-To: <86bnq6ssdv.fsf@nine.des.no> Message-ID: References: <201409111824.s8BIOGOE078057@svn.freebsd.org> <86bnq6ssdv.fsf@nine.des.no> User-Agent: Alpine 2.11 (BSF 23 2013-08-11) MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Tue, 23 Sep 2014 09:41:24 -0600 (MDT) Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warren Block X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 15:41:28 -0000 On Tue, 23 Sep 2014, Dag-Erling Smørgrav wrote: > Warren Block writes: >> +Security advisories and errata: https://www.FreeBSD.org/releases/ >> +Handbook: https://www.FreeBSD.org/handbook/ >> +FAQ: https://www.FreeBSD.org/faq/ >> +Mailing list: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/ >> +Forums: https://forums.FreeBSD.org/ > > Non-bikesheddy: the first line is wrong. Could you be more specific about that? It is an abbreviated form of "Links to security advisories and errata are available at". Maybe you mean that it does not link directly to the security advisories? > The fourth line is only half true. An abbreviated form of "the mailing list for asking general questions". > Bikesheddy: the rest of the file should be replaced with a link to a > "getting started" article. This was discussed a bit in the threads on -arch. From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 16:04:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2497722; Tue, 23 Sep 2014 16:04:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1C3C202; Tue, 23 Sep 2014 16:04:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NG41fX065992; Tue, 23 Sep 2014 16:04:01 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NG3wVK065938; Tue, 23 Sep 2014 16:03:58 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409231603.s8NG3wVK065938@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 23 Sep 2014 16:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r272029 - in stable/9/sys: amd64/linux32 compat/linux conf i386/linux kern modules/linux sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 16:04:02 -0000 Author: bz Date: Tue Sep 23 16:03:57 2014 New Revision: 272029 URL: http://svnweb.freebsd.org/changeset/base/272029 Log: MFC r269669,271743: Split up sys_ktimer_getoverrun() into a sys_ and a kern_ variant and export the kern_ version needed by an upcoming linuxolator change. Implement most of timer_{create,settime,gettime,getoverrun,delete} for amd64/linux32. Fix the entirely bogus (untested) version from r161310 for i386/linux using the same shared code in compat/linux. Reviewed by: jhb Differential Revision: D784 Sponsored by: DARPA/AFRL Added: stable/9/sys/compat/linux/linux_timer.c - copied unchanged from r271743, head/sys/compat/linux/linux_timer.c stable/9/sys/compat/linux/linux_timer.h - copied unchanged from r271743, head/sys/compat/linux/linux_timer.h Modified: stable/9/sys/amd64/linux32/linux.h stable/9/sys/amd64/linux32/linux32_dummy.c stable/9/sys/amd64/linux32/syscalls.master stable/9/sys/conf/files.amd64 stable/9/sys/conf/files.i386 stable/9/sys/conf/files.pc98 stable/9/sys/i386/linux/linux.h stable/9/sys/i386/linux/linux_machdep.c stable/9/sys/i386/linux/syscalls.master stable/9/sys/kern/kern_time.c stable/9/sys/modules/linux/Makefile stable/9/sys/sys/syscallsubr.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/modules/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/amd64/linux32/linux.h ============================================================================== --- stable/9/sys/amd64/linux32/linux.h Tue Sep 23 13:58:39 2014 (r272028) +++ stable/9/sys/amd64/linux32/linux.h Tue Sep 23 16:03:57 2014 (r272029) @@ -61,6 +61,11 @@ MALLOC_DECLARE(M_LINUX); #define PTRIN(v) (void *)(uintptr_t)(v) #define PTROUT(v) (l_uintptr_t)(uintptr_t)(v) +#define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0) +#define CP2(src,dst,sfld,dfld) do { (dst).dfld = (src).sfld; } while (0) +#define PTRIN_CP(src,dst,fld) \ + do { (dst).fld = PTRIN((src).fld); } while (0) + /* * Provide a separate set of types for the Linux types. */ Modified: stable/9/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_dummy.c Tue Sep 23 13:58:39 2014 (r272028) +++ stable/9/sys/amd64/linux32/linux32_dummy.c Tue Sep 23 16:03:57 2014 (r272029) @@ -74,11 +74,6 @@ DUMMY(epoll_create); DUMMY(epoll_ctl); DUMMY(epoll_wait); DUMMY(remap_file_pages); -DUMMY(timer_create); -DUMMY(timer_settime); -DUMMY(timer_gettime); -DUMMY(timer_getoverrun); -DUMMY(timer_delete); DUMMY(fstatfs64); DUMMY(mbind); DUMMY(get_mempolicy); Modified: stable/9/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/9/sys/amd64/linux32/syscalls.master Tue Sep 23 13:58:39 2014 (r272028) +++ stable/9/sys/amd64/linux32/syscalls.master Tue Sep 23 16:03:57 2014 (r272029) @@ -435,11 +435,13 @@ 256 AUE_NULL STD { int linux_epoll_wait(void); } 257 AUE_NULL STD { int linux_remap_file_pages(void); } 258 AUE_NULL STD { int linux_set_tid_address(int *tidptr); } -259 AUE_NULL STD { int linux_timer_create(void); } -260 AUE_NULL STD { int linux_timer_settime(void); } -261 AUE_NULL STD { int linux_timer_gettime(void); } -262 AUE_NULL STD { int linux_timer_getoverrun(void); } -263 AUE_NULL STD { int linux_timer_delete(void); } +259 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \ + struct sigevent *evp, l_timer_t *timerid); } +260 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, l_int flags, \ + const struct itimerspec *new, struct itimerspec *old); } +261 AUE_NULL STD { int linux_timer_gettime(l_timer_t timerid, struct itimerspec *setting); } +262 AUE_NULL STD { int linux_timer_getoverrun(l_timer_t timerid); } +263 AUE_NULL STD { int linux_timer_delete(l_timer_t timerid); } 264 AUE_CLOCK_SETTIME STD { int linux_clock_settime(clockid_t which, struct l_timespec *tp); } 265 AUE_NULL STD { int linux_clock_gettime(clockid_t which, struct l_timespec *tp); } 266 AUE_NULL STD { int linux_clock_getres(clockid_t which, struct l_timespec *tp); } Copied: stable/9/sys/compat/linux/linux_timer.c (from r271743, head/sys/compat/linux/linux_timer.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/compat/linux/linux_timer.c Tue Sep 23 16:03:57 2014 (r272029, copy of r271743, head/sys/compat/linux/linux_timer.c) @@ -0,0 +1,182 @@ +/*- + * Copyright (c) 2014 Bjoern A. Zeeb + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-11-C-0249 + * ("MRC2"), as part of the DARPA MRC research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_compat.h" + +#include +#include +#include +#include +#include +#include +#include + +#ifdef COMPAT_LINUX32 +#include +#include +#else +#include +#include +#endif +#include + +static int +linux_convert_l_clockid(clockid_t *clock_id) +{ + + switch (*clock_id) { + case LINUX_CLOCK_REALTIME: + *clock_id = CLOCK_REALTIME; + break; + case LINUX_CLOCK_MONOTONIC: + *clock_id = CLOCK_MONOTONIC; + break; + default: + return (EINVAL); + } + + return (0); +} + +static int +linux_convert_l_sigevent(struct l_sigevent *l_sig, struct sigevent *sig) +{ + + CP(*l_sig, *sig, sigev_notify); + switch (l_sig->sigev_notify) { + case L_SIGEV_SIGNAL: + sig->sigev_notify = SIGEV_SIGNAL; + CP(*l_sig, *sig, sigev_signo); + PTRIN_CP(*l_sig, *sig, sigev_value.sival_ptr); + break; + case L_SIGEV_NONE: + sig->sigev_notify = SIGEV_NONE; + break; + case L_SIGEV_THREAD: +#if 0 + /* Seems to not be used anywhere (anymore)? */ + sig->sigev_notify = SIGEV_THREAD; + return (ENOSYS); +#else + return (EINVAL); +#endif + case L_SIGEV_THREAD_ID: + sig->sigev_notify = SIGEV_THREAD_ID; + CP2(*l_sig, *sig, _l_sigev_un._tid, sigev_notify_thread_id); + CP(*l_sig, *sig, sigev_signo); + PTRIN_CP(*l_sig, *sig, sigev_value.sival_ptr); + break; + default: + return (EINVAL); + } + return (0); +} + +int +linux_timer_create(struct thread *td, struct linux_timer_create_args *uap) +{ + struct l_sigevent l_ev; + struct sigevent ev, *evp; + int error, id; + + if (uap->evp == NULL) { + evp = NULL; + } else { + error = copyin(uap->evp, &l_ev, sizeof(l_ev)); + if (error != 0) + return (error); + error = linux_convert_l_sigevent(&l_ev, &ev); + if (error != 0) + return (error); + evp = &ev; + } + error = linux_convert_l_clockid(&uap->clock_id); + if (error != 0) + return (error); + error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1); + if (error == 0) { + error = copyout(&id, uap->timerid, sizeof(int)); + if (error != 0) + kern_ktimer_delete(td, id); + } + return (error); +} + +int +linux_timer_settime(struct thread *td, struct linux_timer_settime_args *uap) +{ + struct l_itimerspec l_val, l_oval; + struct itimerspec val, oval, *ovalp; + int error; + + error = copyin(uap->new, &l_val, sizeof(l_val)); + if (error != 0) + return (error); + ITS_CP(l_val, val); + ovalp = uap->old != NULL ? &oval : NULL; + error = kern_ktimer_settime(td, uap->timerid, uap->flags, &val, ovalp); + if (error == 0 && uap->old != NULL) { + ITS_CP(oval, l_oval); + error = copyout(&l_oval, uap->old, sizeof(l_oval)); + } + return (error); +} + +int +linux_timer_gettime(struct thread *td, struct linux_timer_gettime_args *uap) +{ + struct l_itimerspec l_val; + struct itimerspec val; + int error; + + error = kern_ktimer_gettime(td, uap->timerid, &val); + if (error == 0) { + ITS_CP(val, l_val); + error = copyout(&l_val, uap->setting, sizeof(l_val)); + } + return (error); +} + +int +linux_timer_getoverrun(struct thread *td, struct linux_timer_getoverrun_args *uap) +{ + + return (kern_ktimer_getoverrun(td, uap->timerid)); +} + +int +linux_timer_delete(struct thread *td, struct linux_timer_delete_args *uap) +{ + + return (kern_ktimer_delete(td, uap->timerid)); +} + Copied: stable/9/sys/compat/linux/linux_timer.h (from r271743, head/sys/compat/linux/linux_timer.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/compat/linux/linux_timer.h Tue Sep 23 16:03:57 2014 (r272029, copy of r271743, head/sys/compat/linux/linux_timer.h) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2014 Bjoern A. Zeeb + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-11-C-0249 + * ("MRC2"), as part of the DARPA MRC research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_TIMER_H +#define _LINUX_TIMER_H + +#ifndef __LINUX_ARCH_SIGEV_PREAMBLE_SIZE +#define __LINUX_ARCH_SIGEV_PREAMBLE_SIZE \ + (sizeof(l_int) * 2 + sizeof(l_sigval_t)) +#endif + +#define LINUX_SIGEV_MAX_SIZE 64 +#define LINUX_SIGEV_PAD_SIZE \ + ((LINUX_SIGEV_MAX_SIZE - __LINUX_ARCH_SIGEV_PREAMBLE_SIZE) / \ + sizeof(l_int)) + +#define LINUX_CLOCK_REALTIME 0 +#define LINUX_CLOCK_MONOTONIC 1 +#define LINUX_CLOCK_PROCESS_CPUTIME_ID 2 +#define LINUX_CLOCK_THREAD_CPUTIME_ID 3 +#define LINUX_CLOCK_MONOTONIC_RAW 4 +#define LINUX_CLOCK_REALTIME_COARSE 5 +#define LINUX_CLOCK_MONOTONIC_COARSE 6 +#define LINUX_CLOCK_BOOTTIME 7 +#define LINUX_CLOCK_REALTIME_ALARM 8 +#define LINUX_CLOCK_BOOTTIME_ALARM 9 +#define LINUX_CLOCK_SGI_CYCLE 10 +#define LINUX_CLOCK_TAI 11 + +#define L_SIGEV_SIGNAL 0 +#define L_SIGEV_NONE 1 +#define L_SIGEV_THREAD 2 +#define L_SIGEV_THREAD_ID 4 + +#define TS_CP(src,dst,fld) do { \ + CP((src).fld,(dst).fld,tv_sec); \ + CP((src).fld,(dst).fld,tv_nsec); \ +} while (0) + +#define ITS_CP(src, dst) do { \ + TS_CP((src), (dst), it_interval); \ + TS_CP((src), (dst), it_value); \ +} while (0) + +struct l_sigevent { + l_sigval_t sigev_value; + l_int sigev_signo; + l_int sigev_notify; + union { + l_int _pad[LINUX_SIGEV_PAD_SIZE]; + l_int _tid; + struct { + l_uintptr_t _function; + l_uintptr_t _attribute; + } _l_sigev_thread; + } _l_sigev_un; +} +#if defined(__amd64__) && defined(COMPAT_LINUX32) +__packed +#endif +; + +struct l_itimerspec { + struct l_timespec it_interval; + struct l_timespec it_value; +}; + +#endif /* _LINUX_TIMER_H */ Modified: stable/9/sys/conf/files.amd64 ============================================================================== --- stable/9/sys/conf/files.amd64 Tue Sep 23 13:58:39 2014 (r272028) +++ stable/9/sys/conf/files.amd64 Tue Sep 23 16:03:57 2014 (r272029) @@ -477,6 +477,7 @@ compat/linux/linux_socket.c optional com compat/linux/linux_stats.c optional compat_linux32 compat/linux/linux_sysctl.c optional compat_linux32 compat/linux/linux_time.c optional compat_linux32 +compat/linux/linux_timer.c optional compat_linux32 compat/linux/linux_uid16.c optional compat_linux32 compat/linux/linux_util.c optional compat_linux32 dev/amr/amr_linux.c optional compat_linux32 amr Modified: stable/9/sys/conf/files.i386 ============================================================================== --- stable/9/sys/conf/files.i386 Tue Sep 23 13:58:39 2014 (r272028) +++ stable/9/sys/conf/files.i386 Tue Sep 23 16:03:57 2014 (r272029) @@ -93,6 +93,7 @@ compat/linux/linux_socket.c optional com compat/linux/linux_stats.c optional compat_linux compat/linux/linux_sysctl.c optional compat_linux compat/linux/linux_time.c optional compat_linux +compat/linux/linux_timer.c optional compat_linux compat/linux/linux_uid16.c optional compat_linux compat/linux/linux_util.c optional compat_linux compat/ndis/kern_ndis.c optional ndisapi pci Modified: stable/9/sys/conf/files.pc98 ============================================================================== --- stable/9/sys/conf/files.pc98 Tue Sep 23 13:58:39 2014 (r272028) +++ stable/9/sys/conf/files.pc98 Tue Sep 23 16:03:57 2014 (r272029) @@ -54,6 +54,7 @@ compat/linux/linux_socket.c optional com compat/linux/linux_stats.c optional compat_linux compat/linux/linux_sysctl.c optional compat_linux compat/linux/linux_time.c optional compat_linux +compat/linux/linux_timer.c optional compat_linux compat/linux/linux_uid16.c optional compat_linux compat/linux/linux_util.c optional compat_linux compat/svr4/imgact_svr4.c optional compat_svr4 Modified: stable/9/sys/i386/linux/linux.h ============================================================================== --- stable/9/sys/i386/linux/linux.h Tue Sep 23 13:58:39 2014 (r272028) +++ stable/9/sys/i386/linux/linux.h Tue Sep 23 16:03:57 2014 (r272029) @@ -54,6 +54,11 @@ MALLOC_DECLARE(M_LINUX); #define PTRIN(v) (void *)(v) #define PTROUT(v) (l_uintptr_t)(v) +#define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0) +#define CP2(src,dst,sfld,dfld) do { (dst).dfld = (src).sfld; } while (0) +#define PTRIN_CP(src,dst,fld) \ + do { (dst).fld = PTRIN((src).fld); } while (0) + /* * Provide a separate set of types for the Linux types. */ Modified: stable/9/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/9/sys/i386/linux/linux_machdep.c Tue Sep 23 13:58:39 2014 (r272028) +++ stable/9/sys/i386/linux/linux_machdep.c Tue Sep 23 16:03:57 2014 (r272029) @@ -977,37 +977,6 @@ linux_get_thread_area(struct thread *td, return (0); } -/* copied from kern/kern_time.c */ -int -linux_timer_create(struct thread *td, struct linux_timer_create_args *args) -{ - return sys_ktimer_create(td, (struct ktimer_create_args *) args); -} - -int -linux_timer_settime(struct thread *td, struct linux_timer_settime_args *args) -{ - return sys_ktimer_settime(td, (struct ktimer_settime_args *) args); -} - -int -linux_timer_gettime(struct thread *td, struct linux_timer_gettime_args *args) -{ - return sys_ktimer_gettime(td, (struct ktimer_gettime_args *) args); -} - -int -linux_timer_getoverrun(struct thread *td, struct linux_timer_getoverrun_args *args) -{ - return sys_ktimer_getoverrun(td, (struct ktimer_getoverrun_args *) args); -} - -int -linux_timer_delete(struct thread *td, struct linux_timer_delete_args *args) -{ - return sys_ktimer_delete(td, (struct ktimer_delete_args *) args); -} - /* XXX: this wont work with module - convert it */ int linux_mq_open(struct thread *td, struct linux_mq_open_args *args) Modified: stable/9/sys/i386/linux/syscalls.master ============================================================================== --- stable/9/sys/i386/linux/syscalls.master Tue Sep 23 13:58:39 2014 (r272028) +++ stable/9/sys/i386/linux/syscalls.master Tue Sep 23 16:03:57 2014 (r272029) @@ -439,7 +439,7 @@ 258 AUE_NULL STD { int linux_set_tid_address(int *tidptr); } 259 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \ struct sigevent *evp, l_timer_t *timerid); } -260 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, \ +260 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, l_int flags, \ const struct itimerspec *new, struct itimerspec *old); } 261 AUE_NULL STD { int linux_timer_gettime(l_timer_t timerid, struct itimerspec *setting); } 262 AUE_NULL STD { int linux_timer_getoverrun(l_timer_t timerid); } Modified: stable/9/sys/kern/kern_time.c ============================================================================== --- stable/9/sys/kern/kern_time.c Tue Sep 23 13:58:39 2014 (r272028) +++ stable/9/sys/kern/kern_time.c Tue Sep 23 16:03:57 2014 (r272029) @@ -1340,13 +1340,20 @@ struct timer_getoverrun_args { int sys_ktimer_getoverrun(struct thread *td, struct ktimer_getoverrun_args *uap) { + + return (kern_ktimer_getoverrun(td, uap->timerid)); +} + +int +kern_ktimer_getoverrun(struct thread *td, int timer_id) +{ struct proc *p = td->td_proc; struct itimer *it; int error ; PROC_LOCK(p); - if (uap->timerid < 3 || - (it = itimer_find(p, uap->timerid)) == NULL) { + if (timer_id < 3 || + (it = itimer_find(p, timer_id)) == NULL) { PROC_UNLOCK(p); error = EINVAL; } else { Modified: stable/9/sys/modules/linux/Makefile ============================================================================== --- stable/9/sys/modules/linux/Makefile Tue Sep 23 13:58:39 2014 (r272028) +++ stable/9/sys/modules/linux/Makefile Tue Sep 23 16:03:57 2014 (r272029) @@ -13,6 +13,7 @@ SRCS= linux_fork.c linux${SFX}_dummy.c l linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \ linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \ + linux_timer.c \ opt_inet6.h opt_compat.h opt_kdtrace.h opt_posix.h opt_usb.h \ vnode_if.h device_if.h bus_if.h assym.s Modified: stable/9/sys/sys/syscallsubr.h ============================================================================== --- stable/9/sys/sys/syscallsubr.h Tue Sep 23 13:58:39 2014 (r272028) +++ stable/9/sys/sys/syscallsubr.h Tue Sep 23 16:03:57 2014 (r272029) @@ -233,6 +233,7 @@ int kern_ktimer_settime(struct thread *t struct itimerspec *val, struct itimerspec *oval); int kern_ktimer_gettime(struct thread *td, int timer_id, struct itimerspec *val); +int kern_ktimer_getoverrun(struct thread *td, int timer_id); int kern_thr_new(struct thread *td, struct thr_param *param); int kern_thr_suspend(struct thread *td, struct timespec *tsp); int kern_truncate(struct thread *td, char *path, enum uio_seg pathseg, From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 16:05:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 251CA889; Tue, 23 Sep 2014 16:05:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04E5621D; Tue, 23 Sep 2014 16:05:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NG5Q0M066315; Tue, 23 Sep 2014 16:05:26 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NG5OwC066303; Tue, 23 Sep 2014 16:05:24 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409231605.s8NG5OwC066303@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Tue, 23 Sep 2014 16:05:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272030 - stable/10/usr.bin/mkimg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 16:05:27 -0000 Author: marcel Date: Tue Sep 23 16:05:23 2014 New Revision: 272030 URL: http://svnweb.freebsd.org/changeset/base/272030 Log: MFC 271881: Fix partition alignment and image rounding when any of -P (block size), -T (track size) or -H (number of heads) is given. Approved by: re@ (gjb) Modified: stable/10/usr.bin/mkimg/apm.c stable/10/usr.bin/mkimg/bsd.c stable/10/usr.bin/mkimg/ebr.c stable/10/usr.bin/mkimg/gpt.c stable/10/usr.bin/mkimg/mbr.c stable/10/usr.bin/mkimg/mkimg.h stable/10/usr.bin/mkimg/pc98.c stable/10/usr.bin/mkimg/scheme.c stable/10/usr.bin/mkimg/scheme.h stable/10/usr.bin/mkimg/vtoc8.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/apm.c ============================================================================== --- stable/10/usr.bin/mkimg/apm.c Tue Sep 23 16:03:57 2014 (r272029) +++ stable/10/usr.bin/mkimg/apm.c Tue Sep 23 16:05:23 2014 (r272030) @@ -57,13 +57,12 @@ static struct mkimg_alias apm_aliases[] { ALIAS_NONE, 0 } }; -static u_int -apm_metadata(u_int where) +static lba_t +apm_metadata(u_int where, lba_t blk) { - u_int secs; - secs = (where == SCHEME_META_IMG_START) ? nparts + 2 : 0; - return (secs); + blk += (where == SCHEME_META_IMG_START) ? nparts + 2 : 0; + return (round_block(blk)); } static int Modified: stable/10/usr.bin/mkimg/bsd.c ============================================================================== --- stable/10/usr.bin/mkimg/bsd.c Tue Sep 23 16:03:57 2014 (r272029) +++ stable/10/usr.bin/mkimg/bsd.c Tue Sep 23 16:05:23 2014 (r272030) @@ -52,13 +52,17 @@ static struct mkimg_alias bsd_aliases[] { ALIAS_NONE, 0 } }; -static u_int -bsd_metadata(u_int where) +static lba_t +bsd_metadata(u_int where, lba_t blk) { - u_int secs; - secs = BBSIZE / secsz; - return ((where == SCHEME_META_IMG_START) ? secs : 0); + if (where == SCHEME_META_IMG_START) + blk += BBSIZE / secsz; + else if (where == SCHEME_META_IMG_END) + blk = round_cylinder(blk); + else + blk = round_block(blk); + return (blk); } static int @@ -83,12 +87,6 @@ bsd_write(lba_t imgsz, void *bootcode) bsdparts = nparts + 1; /* Account for c partition */ if (bsdparts < MAXPARTITIONS) bsdparts = MAXPARTITIONS; - imgsz = (lba_t)ncyls * nheads * nsecs; - error = image_set_size(imgsz); - if (error) { - free(buf); - return (error); - } d = (void *)(buf + secsz); le32enc(&d->d_magic, DISKMAGIC); Modified: stable/10/usr.bin/mkimg/ebr.c ============================================================================== --- stable/10/usr.bin/mkimg/ebr.c Tue Sep 23 16:03:57 2014 (r272029) +++ stable/10/usr.bin/mkimg/ebr.c Tue Sep 23 16:05:23 2014 (r272030) @@ -49,13 +49,12 @@ static struct mkimg_alias ebr_aliases[] { ALIAS_NONE, 0 } }; -static u_int -ebr_metadata(u_int where) +static lba_t +ebr_metadata(u_int where, lba_t blk) { - u_int secs; - secs = (where == SCHEME_META_PART_BEFORE) ? nsecs : 0; - return (secs); + blk += (where == SCHEME_META_PART_BEFORE) ? 1 : 0; + return (round_track(blk)); } static void Modified: stable/10/usr.bin/mkimg/gpt.c ============================================================================== --- stable/10/usr.bin/mkimg/gpt.c Tue Sep 23 16:03:57 2014 (r272029) +++ stable/10/usr.bin/mkimg/gpt.c Tue Sep 23 16:05:23 2014 (r272030) @@ -153,17 +153,15 @@ gpt_tblsz(void) return ((nparts + ents - 1) / ents); } -static u_int -gpt_metadata(u_int where) +static lba_t +gpt_metadata(u_int where, lba_t blk) { - u_int secs; - if (where != SCHEME_META_IMG_START && where != SCHEME_META_IMG_END) - return (0); - - secs = gpt_tblsz(); - secs += (where == SCHEME_META_IMG_START) ? 2 : 1; - return (secs); + if (where == SCHEME_META_IMG_START || where == SCHEME_META_IMG_END) { + blk += gpt_tblsz(); + blk += (where == SCHEME_META_IMG_START) ? 2 : 1; + } + return (round_block(blk)); } static int Modified: stable/10/usr.bin/mkimg/mbr.c ============================================================================== --- stable/10/usr.bin/mkimg/mbr.c Tue Sep 23 16:03:57 2014 (r272029) +++ stable/10/usr.bin/mkimg/mbr.c Tue Sep 23 16:05:23 2014 (r272030) @@ -50,13 +50,12 @@ static struct mkimg_alias mbr_aliases[] { ALIAS_NONE, 0 } /* Keep last! */ }; -static u_int -mbr_metadata(u_int where) +static lba_t +mbr_metadata(u_int where, lba_t blk) { - u_int secs; - secs = (where == SCHEME_META_IMG_START) ? nsecs : 0; - return (secs); + blk += (where == SCHEME_META_IMG_START) ? 1 : 0; + return (round_track(blk)); } static void Modified: stable/10/usr.bin/mkimg/mkimg.h ============================================================================== --- stable/10/usr.bin/mkimg/mkimg.h Tue Sep 23 16:03:57 2014 (r272029) +++ stable/10/usr.bin/mkimg/mkimg.h Tue Sep 23 16:05:23 2014 (r272030) @@ -66,6 +66,21 @@ round_block(lba_t n) return ((n + b - 1) & ~(b - 1)); } +static inline lba_t +round_cylinder(lba_t n) +{ + u_int cyl = nsecs * nheads; + u_int r = n % cyl; + return ((r == 0) ? n : n + cyl - r); +} + +static inline lba_t +round_track(lba_t n) +{ + u_int r = n % nsecs; + return ((r == 0) ? n : n + nsecs - r); +} + #if !defined(SPARSE_WRITE) #define sparse_write write #else Modified: stable/10/usr.bin/mkimg/pc98.c ============================================================================== --- stable/10/usr.bin/mkimg/pc98.c Tue Sep 23 16:03:57 2014 (r272029) +++ stable/10/usr.bin/mkimg/pc98.c Tue Sep 23 16:05:23 2014 (r272030) @@ -59,13 +59,12 @@ static struct mkimg_alias pc98_aliases[] { ALIAS_NONE, 0 } }; -static u_int -pc98_metadata(u_int where) +static lba_t +pc98_metadata(u_int where, lba_t blk) { - u_int secs; - - secs = PC98_BOOTCODESZ / secsz; - return ((where == SCHEME_META_IMG_START) ? secs : 0); + if (where == SCHEME_META_IMG_START) + blk += PC98_BOOTCODESZ / secsz; + return (round_track(blk)); } static void Modified: stable/10/usr.bin/mkimg/scheme.c ============================================================================== --- stable/10/usr.bin/mkimg/scheme.c Tue Sep 23 16:03:57 2014 (r272029) +++ stable/10/usr.bin/mkimg/scheme.c Tue Sep 23 16:05:23 2014 (r272030) @@ -171,10 +171,8 @@ scheme_max_secsz(void) lba_t scheme_metadata(u_int where, lba_t start) { - lba_t secs; - secs = scheme->metadata(where); - return (round_block(start + secs)); + return (scheme->metadata(where, start)); } int Modified: stable/10/usr.bin/mkimg/scheme.h ============================================================================== --- stable/10/usr.bin/mkimg/scheme.h Tue Sep 23 16:03:57 2014 (r272029) +++ stable/10/usr.bin/mkimg/scheme.h Tue Sep 23 16:05:23 2014 (r272030) @@ -62,7 +62,7 @@ struct mkimg_scheme { const char *name; const char *description; struct mkimg_alias *aliases; - u_int (*metadata)(u_int); + lba_t (*metadata)(u_int, lba_t); #define SCHEME_META_IMG_START 1 #define SCHEME_META_IMG_END 2 #define SCHEME_META_PART_BEFORE 3 Modified: stable/10/usr.bin/mkimg/vtoc8.c ============================================================================== --- stable/10/usr.bin/mkimg/vtoc8.c Tue Sep 23 16:03:57 2014 (r272029) +++ stable/10/usr.bin/mkimg/vtoc8.c Tue Sep 23 16:05:23 2014 (r272030) @@ -53,13 +53,12 @@ static struct mkimg_alias vtoc8_aliases[ { ALIAS_NONE, 0 } }; -static u_int -vtoc8_metadata(u_int where) +static lba_t +vtoc8_metadata(u_int where, lba_t blk) { - u_int secs; - secs = (where == SCHEME_META_IMG_START) ? nsecs * nheads : 0; - return (secs); + blk += (where == SCHEME_META_IMG_START) ? 1 : 0; + return (round_cylinder(blk)); } static int @@ -87,10 +86,6 @@ vtoc8_write(lba_t imgsz, void *bootcode be16enc(&vtoc8.nsecs, nsecs); be16enc(&vtoc8.magic, VTOC_MAGIC); - error = image_set_size(imgsz); - if (error) - return (error); - be32enc(&vtoc8.map[VTOC_RAW_PART].nblks, imgsz); STAILQ_FOREACH(part, &partlist, link) { n = part->index + ((part->index >= VTOC_RAW_PART) ? 1 : 0); From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 16:06:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4BC69D3; Tue, 23 Sep 2014 16:06:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8476A230; Tue, 23 Sep 2014 16:06:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NG6VZm066530; Tue, 23 Sep 2014 16:06:31 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NG6SPQ066515; Tue, 23 Sep 2014 16:06:28 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409231606.s8NG6SPQ066515@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 23 Sep 2014 16:06:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r272031 - in stable/9/sys: amd64/linux32 i386/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 16:06:31 -0000 Author: bz Date: Tue Sep 23 16:06:28 2014 New Revision: 272031 URL: http://svnweb.freebsd.org/changeset/base/272031 Log: This is a direct commit rather than an MFC of r271744. Re-gen after r272029 (r271743 in head) implementing most of timer_{create,settime,gettime,getoverrun,delete}. Sponsored by: DARPA/AFRL Modified: stable/9/sys/amd64/linux32/linux32_proto.h stable/9/sys/amd64/linux32/linux32_syscall.h stable/9/sys/amd64/linux32/linux32_syscalls.c stable/9/sys/amd64/linux32/linux32_sysent.c stable/9/sys/amd64/linux32/linux32_systrace_args.c stable/9/sys/i386/linux/linux_proto.h stable/9/sys/i386/linux/linux_syscall.h stable/9/sys/i386/linux/linux_syscalls.c stable/9/sys/i386/linux/linux_sysent.c stable/9/sys/i386/linux/linux_systrace_args.c Modified: stable/9/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/9/sys/amd64/linux32/linux32_proto.h Tue Sep 23 16:05:23 2014 (r272030) +++ stable/9/sys/amd64/linux32/linux32_proto.h Tue Sep 23 16:06:28 2014 (r272031) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 248532 2013-03-19 20:18:30Z jkim + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 272029 2014-09-23 16:03:57Z bz */ #ifndef _LINUX_SYSPROTO_H_ @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -782,19 +783,25 @@ struct linux_set_tid_address_args { char tidptr_l_[PADL_(int *)]; int * tidptr; char tidptr_r_[PADR_(int *)]; }; struct linux_timer_create_args { - register_t dummy; + char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; + char evp_l_[PADL_(struct sigevent *)]; struct sigevent * evp; char evp_r_[PADR_(struct sigevent *)]; + char timerid_l_[PADL_(l_timer_t *)]; l_timer_t * timerid; char timerid_r_[PADR_(l_timer_t *)]; }; struct linux_timer_settime_args { - register_t dummy; + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char new_l_[PADL_(const struct itimerspec *)]; const struct itimerspec * new; char new_r_[PADR_(const struct itimerspec *)]; + char old_l_[PADL_(struct itimerspec *)]; struct itimerspec * old; char old_r_[PADR_(struct itimerspec *)]; }; struct linux_timer_gettime_args { - register_t dummy; + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; + char setting_l_[PADL_(struct itimerspec *)]; struct itimerspec * setting; char setting_r_[PADR_(struct itimerspec *)]; }; struct linux_timer_getoverrun_args { - register_t dummy; + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; }; struct linux_timer_delete_args { - register_t dummy; + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; }; struct linux_clock_settime_args { char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; Modified: stable/9/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/9/sys/amd64/linux32/linux32_syscall.h Tue Sep 23 16:05:23 2014 (r272030) +++ stable/9/sys/amd64/linux32/linux32_syscall.h Tue Sep 23 16:06:28 2014 (r272031) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 248532 2013-03-19 20:18:30Z jkim + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 272029 2014-09-23 16:03:57Z bz */ #define LINUX_SYS_exit 1 Modified: stable/9/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_syscalls.c Tue Sep 23 16:05:23 2014 (r272030) +++ stable/9/sys/amd64/linux32/linux32_syscalls.c Tue Sep 23 16:06:28 2014 (r272031) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 248532 2013-03-19 20:18:30Z jkim + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 272029 2014-09-23 16:03:57Z bz */ const char *linux_syscallnames[] = { Modified: stable/9/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_sysent.c Tue Sep 23 16:05:23 2014 (r272030) +++ stable/9/sys/amd64/linux32/linux32_sysent.c Tue Sep 23 16:06:28 2014 (r272031) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 248532 2013-03-19 20:18:30Z jkim + * created from FreeBSD: stable/9/sys/amd64/linux32/syscalls.master 272029 2014-09-23 16:03:57Z bz */ #include "opt_compat.h" @@ -278,11 +278,11 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_epoll_wait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 256 = linux_epoll_wait */ { 0, (sy_call_t *)linux_remap_file_pages, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 257 = linux_remap_file_pages */ { AS(linux_set_tid_address_args), (sy_call_t *)linux_set_tid_address, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 258 = linux_set_tid_address */ - { 0, (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 259 = linux_timer_create */ - { 0, (sy_call_t *)linux_timer_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 260 = linux_timer_settime */ - { 0, (sy_call_t *)linux_timer_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 261 = linux_timer_gettime */ - { 0, (sy_call_t *)linux_timer_getoverrun, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 262 = linux_timer_getoverrun */ - { 0, (sy_call_t *)linux_timer_delete, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 263 = linux_timer_delete */ + { AS(linux_timer_create_args), (sy_call_t *)linux_timer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 259 = linux_timer_create */ + { AS(linux_timer_settime_args), (sy_call_t *)linux_timer_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 260 = linux_timer_settime */ + { AS(linux_timer_gettime_args), (sy_call_t *)linux_timer_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 261 = linux_timer_gettime */ + { AS(linux_timer_getoverrun_args), (sy_call_t *)linux_timer_getoverrun, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 262 = linux_timer_getoverrun */ + { AS(linux_timer_delete_args), (sy_call_t *)linux_timer_delete, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 263 = linux_timer_delete */ { AS(linux_clock_settime_args), (sy_call_t *)linux_clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 264 = linux_clock_settime */ { AS(linux_clock_gettime_args), (sy_call_t *)linux_clock_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 265 = linux_clock_gettime */ { AS(linux_clock_getres_args), (sy_call_t *)linux_clock_getres, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 266 = linux_clock_getres */ Modified: stable/9/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_systrace_args.c Tue Sep 23 16:05:23 2014 (r272030) +++ stable/9/sys/amd64/linux32/linux32_systrace_args.c Tue Sep 23 16:06:28 2014 (r272031) @@ -1723,27 +1723,43 @@ systrace_args(int sysnum, void *params, } /* linux_timer_create */ case 259: { - *n_args = 0; + struct linux_timer_create_args *p = params; + iarg[0] = p->clock_id; /* clockid_t */ + uarg[1] = (intptr_t) p->evp; /* struct sigevent * */ + uarg[2] = (intptr_t) p->timerid; /* l_timer_t * */ + *n_args = 3; break; } /* linux_timer_settime */ case 260: { - *n_args = 0; + struct linux_timer_settime_args *p = params; + iarg[0] = p->timerid; /* l_timer_t */ + iarg[1] = p->flags; /* l_int */ + uarg[2] = (intptr_t) p->new; /* const struct itimerspec * */ + uarg[3] = (intptr_t) p->old; /* struct itimerspec * */ + *n_args = 4; break; } /* linux_timer_gettime */ case 261: { - *n_args = 0; + struct linux_timer_gettime_args *p = params; + iarg[0] = p->timerid; /* l_timer_t */ + uarg[1] = (intptr_t) p->setting; /* struct itimerspec * */ + *n_args = 2; break; } /* linux_timer_getoverrun */ case 262: { - *n_args = 0; + struct linux_timer_getoverrun_args *p = params; + iarg[0] = p->timerid; /* l_timer_t */ + *n_args = 1; break; } /* linux_timer_delete */ case 263: { - *n_args = 0; + struct linux_timer_delete_args *p = params; + iarg[0] = p->timerid; /* l_timer_t */ + *n_args = 1; break; } /* linux_clock_settime */ @@ -4840,18 +4856,71 @@ systrace_setargdesc(int sysnum, int ndx, break; /* linux_timer_create */ case 259: + switch(ndx) { + case 0: + p = "clockid_t"; + break; + case 1: + p = "struct sigevent *"; + break; + case 2: + p = "l_timer_t *"; + break; + default: + break; + }; break; /* linux_timer_settime */ case 260: + switch(ndx) { + case 0: + p = "l_timer_t"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "const struct itimerspec *"; + break; + case 3: + p = "struct itimerspec *"; + break; + default: + break; + }; break; /* linux_timer_gettime */ case 261: + switch(ndx) { + case 0: + p = "l_timer_t"; + break; + case 1: + p = "struct itimerspec *"; + break; + default: + break; + }; break; /* linux_timer_getoverrun */ case 262: + switch(ndx) { + case 0: + p = "l_timer_t"; + break; + default: + break; + }; break; /* linux_timer_delete */ case 263: + switch(ndx) { + case 0: + p = "l_timer_t"; + break; + default: + break; + }; break; /* linux_clock_settime */ case 264: Modified: stable/9/sys/i386/linux/linux_proto.h ============================================================================== --- stable/9/sys/i386/linux/linux_proto.h Tue Sep 23 16:05:23 2014 (r272030) +++ stable/9/sys/i386/linux/linux_proto.h Tue Sep 23 16:06:28 2014 (r272031) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 248532 2013-03-19 20:18:30Z jkim + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 272029 2014-09-23 16:03:57Z bz */ #ifndef _LINUX_SYSPROTO_H_ @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -788,6 +789,7 @@ struct linux_timer_create_args { }; struct linux_timer_settime_args { char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; char new_l_[PADL_(const struct itimerspec *)]; const struct itimerspec * new; char new_r_[PADR_(const struct itimerspec *)]; char old_l_[PADL_(struct itimerspec *)]; struct itimerspec * old; char old_r_[PADR_(struct itimerspec *)]; }; Modified: stable/9/sys/i386/linux/linux_syscall.h ============================================================================== --- stable/9/sys/i386/linux/linux_syscall.h Tue Sep 23 16:05:23 2014 (r272030) +++ stable/9/sys/i386/linux/linux_syscall.h Tue Sep 23 16:06:28 2014 (r272031) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 248532 2013-03-19 20:18:30Z jkim + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 272029 2014-09-23 16:03:57Z bz */ #define LINUX_SYS_exit 1 Modified: stable/9/sys/i386/linux/linux_syscalls.c ============================================================================== --- stable/9/sys/i386/linux/linux_syscalls.c Tue Sep 23 16:05:23 2014 (r272030) +++ stable/9/sys/i386/linux/linux_syscalls.c Tue Sep 23 16:06:28 2014 (r272031) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 248532 2013-03-19 20:18:30Z jkim + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 272029 2014-09-23 16:03:57Z bz */ const char *linux_syscallnames[] = { Modified: stable/9/sys/i386/linux/linux_sysent.c ============================================================================== --- stable/9/sys/i386/linux/linux_sysent.c Tue Sep 23 16:05:23 2014 (r272030) +++ stable/9/sys/i386/linux/linux_sysent.c Tue Sep 23 16:06:28 2014 (r272031) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 248532 2013-03-19 20:18:30Z jkim + * created from FreeBSD: stable/9/sys/i386/linux/syscalls.master 272029 2014-09-23 16:03:57Z bz */ #include Modified: stable/9/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/9/sys/i386/linux/linux_systrace_args.c Tue Sep 23 16:05:23 2014 (r272030) +++ stable/9/sys/i386/linux/linux_systrace_args.c Tue Sep 23 16:06:28 2014 (r272031) @@ -1784,9 +1784,10 @@ systrace_args(int sysnum, void *params, case 260: { struct linux_timer_settime_args *p = params; iarg[0] = p->timerid; /* l_timer_t */ - uarg[1] = (intptr_t) p->new; /* const struct itimerspec * */ - uarg[2] = (intptr_t) p->old; /* struct itimerspec * */ - *n_args = 3; + iarg[1] = p->flags; /* l_int */ + uarg[2] = (intptr_t) p->new; /* const struct itimerspec * */ + uarg[3] = (intptr_t) p->old; /* struct itimerspec * */ + *n_args = 4; break; } /* linux_timer_gettime */ @@ -5023,9 +5024,12 @@ systrace_setargdesc(int sysnum, int ndx, p = "l_timer_t"; break; case 1: - p = "const struct itimerspec *"; + p = "l_int"; break; case 2: + p = "const struct itimerspec *"; + break; + case 3: p = "struct itimerspec *"; break; default: From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 16:13:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FB872B4; Tue, 23 Sep 2014 16:13:40 +0000 (UTC) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F5FF366; Tue, 23 Sep 2014 16:13:39 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 588BB25D3871; Tue, 23 Sep 2014 16:13:29 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 12010C7700C; Tue, 23 Sep 2014 16:13:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 9u5HLkT_VUeq; Tue, 23 Sep 2014 16:13:24 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 28D9FC76FD2; Tue, 23 Sep 2014 16:13:22 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r266269 - in stable/9/sys: amd64/include i386/include modules modules/xenhvm xen From: "Bjoern A. Zeeb" In-Reply-To: <201405161928.s4GJSNBN050222@svn.freebsd.org> Date: Tue, 23 Sep 2014 16:13:20 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <02652F0F-9BCC-42BA-9F81-09BC24A1390C@lists.zabbadoz.net> References: <201405161928.s4GJSNBN050222@svn.freebsd.org> To: Colin Percival X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 16:13:40 -0000 On 16 May 2014, at 19:28 , Colin Percival wrote: > Author: cperciva > Date: Fri May 16 19:28:22 2014 > New Revision: 266269 > URL: http://svnweb.freebsd.org/changeset/base/266269 >=20 > Log: > Add xenhvm.ko, which can be loaded along with a !XENHVM kernel in = order to > provide support for the Xen/HVM environment. >=20 > This code is compiled with XENHVM defined; since this would result in = the > (no longer used) "last processed" values being included in PCPU data > structures, an additional MODXENHVM define is used to exclude those. = This > allows KBI to be retained for both GENERIC and XENHVM kernel = configurations > (which are not KBI compatible with each other). >=20 > This is a direct commit to stable/9, since stable/10 and HEAD have = XENHVM > merged into the GENERIC kernel configuration (but the changes in = stable/10 > and HEAD cannot be MFCed as-is). >=20 > Discussed with: royger, gjb > Relnotes: FreeBSD 9.3-RELEASE can run in Xen/HVM environments, > including Amazon EC2, using GENERIC + xenhvm.ko. >=20 I think it is this commit that completely broke the pc98 build on = stable/9 and probably has been broken since? The modules Makefile probably wants MACHINE =3D=3D =93i386=94 and not = MACHINE_CPUARCH for this module (as in you want to mov the _xenhvm=3D = into the dedicated amd64 and i386 sections? >>> stage 3.1: making dependencies -------------------------------------------------------------- = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//balloon/ball= oon.c:43:32: error: machine/xen/xen-os.h: No such file or directory = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//balloon/ball= oon.c:44:32: error: machine/xen/xenvar.h: No such file or directory = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//balloon/ball= oon.c:45:33: error: machine/xen/xenfunc.h: No such file or directory In file included from @/xen/interface/xen.h:33, from @/xen/hypervisor.h:32, from = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//balloon/ball= oon.c:46: @/xen/interface/arch-x86/xen.h:35:2: error: #error "using old handle" In file included from = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//balloon/ball= oon.c:46: @/xen/hypervisor.h:39:35: error: machine/xen/hypercall.h: No such file = or directory = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//blkfront/blk= front.c:54:32: error: machine/xen/xen-os.h: No such file or directory = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//blkfront/blk= front.c:55:32: error: machine/xen/xenvar.h: No such file or directory = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//blkfront/blk= front.c:56:33: error: machine/xen/xenfunc.h: No such file or directory In file included from @/xen/interface/xen.h:33, from @/xen/hypervisor.h:32, from = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//blkfront/blk= front.c:58: @/xen/interface/arch-x86/xen.h:35:2: error: #error "using old handle" In file included from = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//blkfront/blk= front.c:58: @/xen/hypervisor.h:39:35: error: machine/xen/hypercall.h: No such file = or directory In file included from = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//blkfront/blk= front.c:60: @/xen/evtchn.h:16:38: error: machine/xen/synch_bitops.h: No such file or = directory = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//blkback/blkb= ack.c:73:32: error: machine/xen/xen-os.h: No such file or directory In file included from @/xen/interface/xen.h:33, from @/xen/hypervisor.h:32, from @/xen/evtchn.h:15, from = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//blkback/blkb= ack.c:80: @/xen/interface/arch-x86/xen.h:35:2: error: #error "using old handle" In file included from @/xen/evtchn.h:15, from = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//blkback/blkb= ack.c:80: @/xen/hypervisor.h:39:35: error: machine/xen/hypercall.h: No such file = or directory In file included from = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//blkback/blkb= ack.c:80: @/xen/evtchn.h:16:38: error: machine/xen/synch_bitops.h: No such file or = directory = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//control/cont= rol.c:131:32: error: machine/xen/xen-os.h: No such file or directory In file included from @/xen/interface/xen.h:33, from @/xen/hypervisor.h:32, from @/xen/evtchn.h:15, from = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//control/cont= rol.c:138: @/xen/interface/arch-x86/xen.h:35:2: error: #error "using old handle" In file included from @/xen/evtchn.h:15, from = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//control/cont= rol.c:138: @/xen/hypervisor.h:39:35: error: machine/xen/hypercall.h: No such file = or directory In file included from = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//control/cont= rol.c:138: @/xen/evtchn.h:16:38: error: machine/xen/synch_bitops.h: No such file or = directory = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//netback/netb= ack.c:83:32: error: machine/xen/xen-os.h: No such file or directory = /scratch/tmp/bz/stable9.svn/sys/modules/xenhvm/../../dev/xen//netback/netb= ack.c:84:32: error: machine/xen/xenvar.h: No such file or directory In file included from @/xen/interface/xen.h:33, from @/xen/hypervisor.h:32, =85 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 17:04:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C77A6947; Tue, 23 Sep 2014 17:04:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2B40ADC; Tue, 23 Sep 2014 17:04:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NH4LG2098185; Tue, 23 Sep 2014 17:04:21 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NH4Lcv098184; Tue, 23 Sep 2014 17:04:21 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201409231704.s8NH4Lcv098184@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 23 Sep 2014 17:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272032 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 17:04:21 -0000 Author: bdrewery Date: Tue Sep 23 17:04:21 2014 New Revision: 272032 URL: http://svnweb.freebsd.org/changeset/base/272032 Log: DEBUG_LOCKS no longer modifies 'struct vnode', nor does fstat(1) use it. fstat(1) now uses libprocstat(9). There is no userland impact to using this. MFC after: 3 days Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Sep 23 16:06:28 2014 (r272031) +++ head/sys/conf/NOTES Tue Sep 23 17:04:21 2014 (r272032) @@ -2625,9 +2625,7 @@ options NSFBUFS=1024 # Enable extra debugging code for locks. This stores the filename and # line of whatever acquired the lock in the lock itself, and changes a # number of function calls to pass around the relevant data. This is -# not at all useful unless you are debugging lock code. Also note -# that it is likely to break e.g. fstat(1) unless you recompile your -# userland with -DDEBUG_LOCKS as well. +# not at all useful unless you are debugging lock code. # options DEBUG_LOCKS From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 17:30:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5E49E6A; Tue, 23 Sep 2014 17:30:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D17A5CF5; Tue, 23 Sep 2014 17:30:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NHU0Q7008584; Tue, 23 Sep 2014 17:30:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NHU0Od008581; Tue, 23 Sep 2014 17:30:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409231730.s8NHU0Od008581@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 23 Sep 2014 17:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272033 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 17:30:01 -0000 Author: mav Date: Tue Sep 23 17:30:00 2014 New Revision: 272033 URL: http://svnweb.freebsd.org/changeset/base/272033 Log: Fix ASCQ for "Logical unit not ready, manual intervention required" error. Modified: head/sys/cam/ctl/ctl_error.c Modified: head/sys/cam/ctl/ctl_error.c ============================================================================== --- head/sys/cam/ctl/ctl_error.c Tue Sep 23 17:04:21 2014 (r272032) +++ head/sys/cam/ctl/ctl_error.c Tue Sep 23 17:30:00 2014 (r272033) @@ -694,7 +694,7 @@ ctl_set_lun_not_ready(struct ctl_scsiio /*current_error*/ 1, /*sense_key*/ SSD_KEY_NOT_READY, /*asc*/ 0x04, - /*ascq*/ 0x05, + /*ascq*/ 0x03, SSD_ELEM_NONE); } From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 18:21:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4268855E; Tue, 23 Sep 2014 18:21:01 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A844230E; Tue, 23 Sep 2014 18:21:00 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s8NIKpAX011924 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 23 Sep 2014 21:20:52 +0300 (EEST) (envelope-from kostik@tom.home) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s8NIKpAX011924 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s8NIKpad011923; Tue, 23 Sep 2014 21:20:51 +0300 (EEST) (envelope-from kostik) Date: Tue, 23 Sep 2014 21:20:51 +0300 From: Konstantin Belousov To: Bryan Drewery Subject: Re: svn commit: r272032 - head/sys/conf Message-ID: <20140923182051.GF8870@kib.kiev.ua> References: <201409231704.s8NH4Lcv098184@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409231704.s8NH4Lcv098184@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 18:21:01 -0000 On Tue, Sep 23, 2014 at 05:04:21PM +0000, Bryan Drewery wrote: > Author: bdrewery > Date: Tue Sep 23 17:04:21 2014 > New Revision: 272032 > URL: http://svnweb.freebsd.org/changeset/base/272032 > > Log: > DEBUG_LOCKS no longer modifies 'struct vnode', nor does fstat(1) use it. > fstat(1) now uses libprocstat(9). There is no userland impact to using this. DEBUG_VFS_LOCKS does modify KBI of VFS, by adding struct stack to lockmgr, and lockmgr is embedded into each struct vnode. VFS modules, in particular, filesystems, compiled for mismatched kernel WRT DEBUG_VFS_LOCKS, would cause strange breakage. > > MFC after: 3 days > > Modified: > head/sys/conf/NOTES > > Modified: head/sys/conf/NOTES > ============================================================================== > --- head/sys/conf/NOTES Tue Sep 23 16:06:28 2014 (r272031) > +++ head/sys/conf/NOTES Tue Sep 23 17:04:21 2014 (r272032) > @@ -2625,9 +2625,7 @@ options NSFBUFS=1024 > # Enable extra debugging code for locks. This stores the filename and > # line of whatever acquired the lock in the lock itself, and changes a > # number of function calls to pass around the relevant data. This is > -# not at all useful unless you are debugging lock code. Also note > -# that it is likely to break e.g. fstat(1) unless you recompile your > -# userland with -DDEBUG_LOCKS as well. > +# not at all useful unless you are debugging lock code. > # > options DEBUG_LOCKS > From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 18:22:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBE506C3; Tue, 23 Sep 2014 18:22:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B56083F7; Tue, 23 Sep 2014 18:22:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NIMflB037438; Tue, 23 Sep 2014 18:22:41 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NIMfI8037437; Tue, 23 Sep 2014 18:22:41 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201409231822.s8NIMfI8037437@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 23 Sep 2014 18:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272034 - head/cddl/usr.sbin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 18:22:41 -0000 Author: rpaulo Date: Tue Sep 23 18:22:40 2014 New Revision: 272034 URL: http://svnweb.freebsd.org/changeset/base/272034 Log: Build plockstat if WITH_PLOCKSTAT is defined. Modified: head/cddl/usr.sbin/Makefile Modified: head/cddl/usr.sbin/Makefile ============================================================================== --- head/cddl/usr.sbin/Makefile Tue Sep 23 17:30:00 2014 (r272033) +++ head/cddl/usr.sbin/Makefile Tue Sep 23 18:22:40 2014 (r272034) @@ -5,6 +5,7 @@ SUBDIR= ${_dtrace} \ ${_dtruss} \ ${_lockstat} \ + ${_plockstat} \ ${_tests} \ ${_zdb} \ ${_zhack} @@ -24,6 +25,9 @@ _zhack= zhack _dtrace= dtrace _dtruss= dtruss _lockstat= lockstat +.if defined(WITH_PLOCKSTAT) +_plockstat= plockstat +.endif .endif .if ${MACHINE_CPUARCH} == "mips" From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 18:26:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36264881; Tue, 23 Sep 2014 18:26:00 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F4415FB; Tue, 23 Sep 2014 18:25:58 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8NIPnsg030004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 23 Sep 2014 22:25:49 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8NIPnD3030003; Tue, 23 Sep 2014 22:25:49 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 23 Sep 2014 22:25:49 +0400 From: Gleb Smirnoff To: Hans Petter Selasky Subject: Re: svn commit: r272027 - in head: contrib/ofed/libibverbs/examples contrib/ofed/libmlx4/src sys/conf sys/modules/mlx4 sys/modules/mlxen sys/ofed/drivers/infiniband/hw/mlx4 sys/ofed/drivers/infiniband/... Message-ID: <20140923182549.GG884@FreeBSD.org> References: <201409231237.s8NCb27N061223@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409231237.s8NCb27N061223@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 18:26:00 -0000 Hans, On Tue, Sep 23, 2014 at 12:37:02PM +0000, Hans Petter Selasky wrote: H> Author: hselasky H> Date: Tue Sep 23 12:37:01 2014 H> New Revision: 272027 H> URL: http://svnweb.freebsd.org/changeset/base/272027 H> H> Log: H> Hardware driver update from Mellanox Technologies, including: H> - improved performance H> - better stability H> - new features H> - bugfixes ... H> @@ -240,7 +240,7 @@ ipoib_ib_handle_rx_wc(struct ipoib_dev_p H> */ H> if (unlikely(!ipoib_alloc_rx_mb(priv, wr_id))) { H> memcpy(&priv->rx_ring[wr_id], &saverx, sizeof(saverx)); H> - dev->if_iqdrops++; H> + if_inc_counter(dev, IFCOUNTER_IQDROPS, 1); H> goto repost; H> } Thanks a lot for these changes :) However, to fully convert driver to new stats we need to 1) stop writing to ifnet if_foo fields, 2) provide if_get_counter() method, that will return current counter values. This can be achieved in two ways: 1) Dumb solution. Remove assignments for if_foo counters from mlx4_en_DUMP_ETH_STATS(). Provide if_get_counter() method, that will return the values using the same code we deleted. The cons of the solution is that we still run a useless callout to gather statistics, and that statistics are updated only on callout. If we query the interface faster than 1 time per second, we will get same results in two queries. Example of dumb solution can be found in igb(4). Since the code is shared between OSes, it could be that dumb solution is the best, since it is less disruptive. 2) Smarter solution. Remove assignments for if_foo counters from mlx4_en_DUMP_ETH_STATS(). Do not run mlx4_en_DUMP_ETH_STATS() periodically. Provide if_get_counter() method, that will first run mlx4_en_DUMP_ETH_STATS(), and then do a switch on counter type and return it. Example of smarter solution is vtnet(4). 3) Smart solution. Remove assignments for if_foo counters from mlx4_en_DUMP_ETH_STATS(). Do not run mlx4_en_DUMP_ETH_STATS() periodically. Provide if_get_counter() method, that will switch on the counter type and query the proper hardware register to fetch the value and return it. No examples available, yet :) Can you help me with this, please? I can code the dumb one quickly, but probably committing it w/o hardware test is a risky plan. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 18:31:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C82EC3A for ; Tue, 23 Sep 2014 18:31:50 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C90D6DB for ; Tue, 23 Sep 2014 18:31:50 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NIVoRb064316 for ; Tue, 23 Sep 2014 18:31:50 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s8NIVoGW064314 for svn-src-all@freebsd.org; Tue, 23 Sep 2014 18:31:50 GMT (envelope-from bdrewery) Received: (qmail 87722 invoked from network); 23 Sep 2014 13:31:47 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 23 Sep 2014 13:31:47 -0500 Message-ID: <5421BC8E.6000709@FreeBSD.org> Date: Tue, 23 Sep 2014 13:31:42 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r272032 - head/sys/conf References: <201409231704.s8NH4Lcv098184@svn.freebsd.org> <20140923182051.GF8870@kib.kiev.ua> In-Reply-To: <20140923182051.GF8870@kib.kiev.ua> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9PopXo3P8qq6o2Bi1nmsJHRlpAuSQNG93" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 18:31:50 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9PopXo3P8qq6o2Bi1nmsJHRlpAuSQNG93 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 9/23/2014 1:20 PM, Konstantin Belousov wrote: > On Tue, Sep 23, 2014 at 05:04:21PM +0000, Bryan Drewery wrote: >> Author: bdrewery >> Date: Tue Sep 23 17:04:21 2014 >> New Revision: 272032 >> URL: http://svnweb.freebsd.org/changeset/base/272032 >> >> Log: >> DEBUG_LOCKS no longer modifies 'struct vnode', nor does fstat(1) use= it. >> fstat(1) now uses libprocstat(9). There is no userland impact to us= ing this. >=20 > DEBUG_VFS_LOCKS does modify KBI of VFS, by adding struct stack to > lockmgr, and lockmgr is embedded into each struct vnode. >=20 > VFS modules, in particular, filesystems, compiled for mismatched > kernel WRT DEBUG_VFS_LOCKS, would cause strange breakage. Well, perhaps the comment needs to be updated to state that DEBUG_VFS_LOCKS modifies VFS KBI so any VFS modules will need to recompil= ed. I did see the stack was moved to lockmgr, but given the use of libprocstat, and lockmgr being a kernel struct, I don't think it's worth mentioning userland here. Sound good? >=20 >> =20 >> MFC after: 3 days >> >> Modified: >> head/sys/conf/NOTES >> >> Modified: head/sys/conf/NOTES >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/NOTES Tue Sep 23 16:06:28 2014 (r272031) >> +++ head/sys/conf/NOTES Tue Sep 23 17:04:21 2014 (r272032) >> @@ -2625,9 +2625,7 @@ options NSFBUFS=3D1024 >> # Enable extra debugging code for locks. This stores the filename an= d >> # line of whatever acquired the lock in the lock itself, and changes = a >> # number of function calls to pass around the relevant data. This is= >> -# not at all useful unless you are debugging lock code. Also note >> -# that it is likely to break e.g. fstat(1) unless you recompile your >> -# userland with -DDEBUG_LOCKS as well. >> +# not at all useful unless you are debugging lock code. >> # >> options DEBUG_LOCKS >> =20 --=20 Regards, Bryan Drewery --9PopXo3P8qq6o2Bi1nmsJHRlpAuSQNG93 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJUIbyOAAoJEDXXcbtuRpfPAMcH+wZrGw30oCPVbEuLAxsyyEMh 8bywkuRdvYtmcCyUE8iULukbpjlDe/VWs/rDJfS1i2CDlNq0JscLiitEtKWFCxoY bza0nYRScmgJCbCdDBLsijXJVbrKxK0Mlb+KYkP2iz2lIWXUSOPwjh9vM7UKCEX4 nHhGeCWCcKm5WfJ9k88OHH5Uqqp1xojaC4dJWDMFipUhCQ4rhF/snoHIcWc0qYcX QDAC40Hq+1BsP2FYXmTJAn8zWJbNyUhRMXamkxm1nxMHkrvc6jPL2ZyYj/BKOKcl YMpsgY36XNF8u9upTn4EKJo4JbCgUqZkGFi7wInR64HhhnanGPZAF0CSdKsex08= =E2cU -----END PGP SIGNATURE----- --9PopXo3P8qq6o2Bi1nmsJHRlpAuSQNG93-- From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 18:38:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80D54E3E; Tue, 23 Sep 2014 18:38:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BFBC78D; Tue, 23 Sep 2014 18:38:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NIc7Ca042980; Tue, 23 Sep 2014 18:38:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NIc7Vl042979; Tue, 23 Sep 2014 18:38:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201409231838.s8NIc7Vl042979@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 23 Sep 2014 18:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272035 - head/etc/defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 18:38:07 -0000 Author: markj Date: Tue Sep 23 18:38:06 2014 New Revision: 272035 URL: http://svnweb.freebsd.org/changeset/base/272035 Log: Remove settings for pkg_* scripts which are no longer present. MFC after: 1 week Modified: head/etc/defaults/periodic.conf Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Tue Sep 23 18:22:40 2014 (r272034) +++ head/etc/defaults/periodic.conf Tue Sep 23 18:38:06 2014 (r272035) @@ -75,10 +75,6 @@ daily_backup_passwd_enable="YES" # Bac # 210.backup-aliases daily_backup_aliases_enable="YES" # Backup mail aliases -# 220.backup-pkgdb -daily_backup_pkgdb_enable="YES" # Backup /var/db/pkg -daily_backup_pkgdb_dir="/var/backups" - # 300.calendar daily_calendar_enable="NO" # Run calendar -a @@ -257,10 +253,6 @@ security_status_passwdless_period="daily security_status_logincheck_enable="YES" security_status_logincheck_period="daily" -# 460.chkportsum -security_status_chkportsum_enable="NO" # Check ports w/ wrong checksum -security_status_chkportsum_period="daily" - # 500.ipfwdenied security_status_ipfwdenied_enable="YES" security_status_ipfwdenied_period="daily" From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 18:44:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FB7E10E; Tue, 23 Sep 2014 18:44:40 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C538F859; Tue, 23 Sep 2014 18:44:39 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s8NIiY9U012346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 23 Sep 2014 21:44:34 +0300 (EEST) (envelope-from kostik@tom.home) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s8NIiY9U012346 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s8NIiYnd012345; Tue, 23 Sep 2014 21:44:34 +0300 (EEST) (envelope-from kostik) Date: Tue, 23 Sep 2014 21:44:34 +0300 From: Konstantin Belousov To: Bryan Drewery Subject: Re: svn commit: r272032 - head/sys/conf Message-ID: <20140923184434.GG8870@kib.kiev.ua> References: <201409231704.s8NH4Lcv098184@svn.freebsd.org> <20140923182051.GF8870@kib.kiev.ua> <5421BC8E.6000709@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5421BC8E.6000709@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 18:44:40 -0000 On Tue, Sep 23, 2014 at 01:31:42PM -0500, Bryan Drewery wrote: > On 9/23/2014 1:20 PM, Konstantin Belousov wrote: > > On Tue, Sep 23, 2014 at 05:04:21PM +0000, Bryan Drewery wrote: > >> Author: bdrewery > >> Date: Tue Sep 23 17:04:21 2014 > >> New Revision: 272032 > >> URL: http://svnweb.freebsd.org/changeset/base/272032 > >> > >> Log: > >> DEBUG_LOCKS no longer modifies 'struct vnode', nor does fstat(1) use it. > >> fstat(1) now uses libprocstat(9). There is no userland impact to using this. > > > > DEBUG_VFS_LOCKS does modify KBI of VFS, by adding struct stack to > > lockmgr, and lockmgr is embedded into each struct vnode. > > > > VFS modules, in particular, filesystems, compiled for mismatched > > kernel WRT DEBUG_VFS_LOCKS, would cause strange breakage. > > Well, perhaps the comment needs to be updated to state that > DEBUG_VFS_LOCKS modifies VFS KBI so any VFS modules will need to recompiled. > > I did see the stack was moved to lockmgr, but given the use of > libprocstat, and lockmgr being a kernel struct, I don't think it's worth > mentioning userland here. > > Sound good? I agree, I do not think that userland is affected. From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 18:54:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03E95568; Tue, 23 Sep 2014 18:54:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E39D396A; Tue, 23 Sep 2014 18:54:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NIsNbX051941; Tue, 23 Sep 2014 18:54:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NIsNLA051940; Tue, 23 Sep 2014 18:54:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409231854.s8NIsNLA051940@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 23 Sep 2014 18:54:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272036 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 18:54:24 -0000 Author: kib Date: Tue Sep 23 18:54:23 2014 New Revision: 272036 URL: http://svnweb.freebsd.org/changeset/base/272036 Log: vm_map_pmap_enter() and pmap_enter_object() are currently not aware of the wired attribute of the mapping. As result, some pmap implementations clear the wired state of the page table entries, which breaks invariants and allows the entries to be lost. Avoid calling vm_map_pmap_enter() for the MADV_WILLNEED on the wired entry, the pages must be already mapped. Noted and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Tue Sep 23 18:38:06 2014 (r272035) +++ head/sys/vm/vm_map.c Tue Sep 23 18:54:23 2014 (r272036) @@ -2197,7 +2197,14 @@ vm_map_madvise( vm_object_madvise(current->object.vm_object, pstart, pend, behav); - if (behav == MADV_WILLNEED) { + + /* + * Pre-populate paging structures in the + * WILLNEED case. For wired entries, the + * paging structures are already populated. + */ + if (behav == MADV_WILLNEED && + current->wired_count == 0) { vm_map_pmap_enter(map, useStart, current->protection, From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 19:12:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03B20ABC; Tue, 23 Sep 2014 19:12:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3040B3F; Tue, 23 Sep 2014 19:12:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NJC6Nc061453; Tue, 23 Sep 2014 19:12:06 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NJC6TG061452; Tue, 23 Sep 2014 19:12:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409231912.s8NJC6TG061452@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 23 Sep 2014 19:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272037 - head/usr.sbin/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 19:12:07 -0000 Author: trasz Date: Tue Sep 23 19:12:06 2014 New Revision: 272037 URL: http://svnweb.freebsd.org/changeset/base/272037 Log: Fix thinko that, with two map entries like shown below, in that order, made automountd(8) mix them up: trying to access the second one would trigger mount for the first one. foo host:/foo foobar host:/foobar PR: 193584 MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/common.c Modified: head/usr.sbin/autofs/common.c ============================================================================== --- head/usr.sbin/autofs/common.c Tue Sep 23 18:54:23 2014 (r272036) +++ head/usr.sbin/autofs/common.c Tue Sep 23 19:12:06 2014 (r272037) @@ -673,11 +673,21 @@ node_find(struct node *node, const char { struct node *child, *found; char *tmp; + size_t tmplen; //log_debugx("looking up %s in %s", path, node->n_key); tmp = node_path(node); - if (strncmp(tmp, path, strlen(tmp)) != 0) { + tmplen = strlen(tmp); + if (strncmp(tmp, path, tmplen) != 0) { + free(tmp); + return (NULL); + } + if (path[tmplen] != '/' && path[tmplen] != '\0') { + /* + * If we have two map entries like 'foo' and 'foobar', make + * sure the search for 'foobar' won't match 'foo' instead. + */ free(tmp); return (NULL); } From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 19:24:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 352E8ED1; Tue, 23 Sep 2014 19:24:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 205C3C58; Tue, 23 Sep 2014 19:24:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NJODaa066554; Tue, 23 Sep 2014 19:24:13 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NJODpn066553; Tue, 23 Sep 2014 19:24:13 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201409231924.s8NJODpn066553@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 23 Sep 2014 19:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272038 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 19:24:14 -0000 Author: bdrewery Date: Tue Sep 23 19:24:13 2014 New Revision: 272038 URL: http://svnweb.freebsd.org/changeset/base/272038 Log: Note KBI breakage with DEBUG_LOCKS. It specifically modifies struct lock, which many other structures embed. Noted by: kib MFC after: 3 days X-MFC-with: r272032 Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Sep 23 19:12:06 2014 (r272037) +++ head/sys/conf/NOTES Tue Sep 23 19:24:13 2014 (r272038) @@ -2625,7 +2625,8 @@ options NSFBUFS=1024 # Enable extra debugging code for locks. This stores the filename and # line of whatever acquired the lock in the lock itself, and changes a # number of function calls to pass around the relevant data. This is -# not at all useful unless you are debugging lock code. +# not at all useful unless you are debugging lock code. Note that +# modules should be recompiled as this option modifies KBI. # options DEBUG_LOCKS From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 19:32:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9262C175; Tue, 23 Sep 2014 19:32:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D4A1D3D; Tue, 23 Sep 2014 19:32:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NJWhjC071039; Tue, 23 Sep 2014 19:32:43 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NJWh2L071038; Tue, 23 Sep 2014 19:32:43 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409231932.s8NJWh2L071038@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 23 Sep 2014 19:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r272039 - stable/9/sys/modules X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 19:32:43 -0000 Author: bz Date: Tue Sep 23 19:32:42 2014 New Revision: 272039 URL: http://svnweb.freebsd.org/changeset/base/272039 Log: After r266269 unbreak the pc98 builds by only building the xenhvm module for amd64 and i386 but not for pc98. Modified: stable/9/sys/modules/Makefile Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Tue Sep 23 19:24:13 2014 (r272038) +++ stable/9/sys/modules/Makefile Tue Sep 23 19:32:42 2014 (r272039) @@ -369,7 +369,6 @@ SUBDIR= \ .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" _filemon= filemon -_xenhvm= xenhvm .endif .if ${MACHINE_CPUARCH} != "powerpc" && ${MACHINE_CPUARCH} != "arm" && \ @@ -614,6 +613,7 @@ _twa= twa _vesa= vesa _virtio= virtio _x86bios= x86bios +_xenhvm= xenhvm .elif ${MACHINE} == "pc98" _canbepm= canbepm _canbus= canbus @@ -738,6 +738,7 @@ _viawd= viawd _virtio= virtio _vxge= vxge _x86bios= x86bios +_xenhvm= xenhvm _wbwd= wbwd _wi= wi _wpi= wpi From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 19:34:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50DD12BF; Tue, 23 Sep 2014 19:34:00 +0000 (UTC) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 08652D4A; Tue, 23 Sep 2014 19:33:59 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id C032325D3871; Tue, 23 Sep 2014 19:33:55 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 78E6FC77020; Tue, 23 Sep 2014 19:33:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id LQIxKSq6zklM; Tue, 23 Sep 2014 19:33:52 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:3c1b:4ee5:ce2b:1248] (unknown [IPv6:fde9:577b:c1a9:4410:3c1b:4ee5:ce2b:1248]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 2EDC5C76FD2; Tue, 23 Sep 2014 19:33:49 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r266269 - in stable/9/sys: amd64/include i386/include modules modules/xenhvm xen From: "Bjoern A. Zeeb" In-Reply-To: <02652F0F-9BCC-42BA-9F81-09BC24A1390C@lists.zabbadoz.net> Date: Tue, 23 Sep 2014 19:33:14 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <4BCBE502-37D6-4D00-AB51-EBAA46BE3097@lists.zabbadoz.net> References: <201405161928.s4GJSNBN050222@svn.freebsd.org> <02652F0F-9BCC-42BA-9F81-09BC24A1390C@lists.zabbadoz.net> To: Colin Percival X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 19:34:00 -0000 On 23 Sep 2014, at 16:13 , Bjoern A. Zeeb = wrote: >=20 > On 16 May 2014, at 19:28 , Colin Percival = wrote: >=20 >> Author: cperciva >> Date: Fri May 16 19:28:22 2014 >> New Revision: 266269 >> URL: http://svnweb.freebsd.org/changeset/base/266269 >>=20 >> Log: >> Add xenhvm.ko, which can be loaded along with a !XENHVM kernel in = order to >> provide support for the Xen/HVM environment. >>=20 >> This code is compiled with XENHVM defined; since this would result in = the >> (no longer used) "last processed" values being included in PCPU data >> structures, an additional MODXENHVM define is used to exclude those. = This >> allows KBI to be retained for both GENERIC and XENHVM kernel = configurations >> (which are not KBI compatible with each other). >>=20 >> This is a direct commit to stable/9, since stable/10 and HEAD have = XENHVM >> merged into the GENERIC kernel configuration (but the changes in = stable/10 >> and HEAD cannot be MFCed as-is). >>=20 >> Discussed with: royger, gjb >> Relnotes: FreeBSD 9.3-RELEASE can run in Xen/HVM environments, >> including Amazon EC2, using GENERIC + xenhvm.ko. >>=20 >=20 > I think it is this commit that completely broke the pc98 build on = stable/9 > and probably has been broken since? >=20 > The modules Makefile probably wants MACHINE =3D=3D =93i386=94 and not = MACHINE_CPUARCH for this module (as in you want to mov the _xenhvm=3D = into the dedicated amd64 and i386 sections? OK, just done so in r272039. Case closed. =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 19:38:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47D98594 for ; Tue, 23 Sep 2014 19:38:27 +0000 (UTC) Received: from o1.l99.sendgrid.net (o1.l99.sendgrid.net [198.37.153.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF574D87 for ; Tue, 23 Sep 2014 19:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=Rj/TCGZSBvzakbqc4sLAB4+k9J8=; b=RAJ54RcQqm7FzyTrs/ /XAKa2jBB94OnZqKunxr4HVk4L1pspjjxCLBI+dah/qOmeK7ZlccYp+yMYjsWZZn kyo24UPsaILr7OTkDkaQzSi3rLukTJMbD4bJ1Rwu/KmdjBH5We2oxffyR1Gd2XTs FU8UJRrAgNihiHApp7qV+ZF2Y= Received: by mf190.sendgrid.net with SMTP id mf190.11559.5421CC1CA 2014-09-23 19:38:05.105318872 +0000 UTC Received: from mail.tarsnap.com (unknown [10.100.60.97]) by ismtpd-027.iad1.sendgrid.net (SG) with ESMTP id 148a405514f.6d16.2f0fb1 for ; Tue, 23 Sep 2014 19:38:05 +0000 (GMT) Received: (qmail 37125 invoked from network); 23 Sep 2014 19:38:03 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 23 Sep 2014 19:38:03 -0000 Received: (qmail 2809 invoked from network); 23 Sep 2014 19:37:51 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 23 Sep 2014 19:37:51 -0000 Message-ID: <5421CC0E.7010909@freebsd.org> Date: Tue, 23 Sep 2014 12:37:50 -0700 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: "Bjoern A. Zeeb" Subject: Re: svn commit: r266269 - in stable/9/sys: amd64/include i386/include modules modules/xenhvm xen References: <201405161928.s4GJSNBN050222@svn.freebsd.org> <02652F0F-9BCC-42BA-9F81-09BC24A1390C@lists.zabbadoz.net> <4BCBE502-37D6-4D00-AB51-EBAA46BE3097@lists.zabbadoz.net> In-Reply-To: <4BCBE502-37D6-4D00-AB51-EBAA46BE3097@lists.zabbadoz.net> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=windows-1252 content-transfer-encoding: quoted-printable X-SG-EID: A6W2xSVPHetogaU8rnzccWwgBYtN+QvIzXyjfe/10PHOHiH0cL/XjA4T7UxZnqGuymvpu4/qibxCD/88ki+N9jxye818EPwWLCFUWfJeaSn+nA2RRbbIR4V5Bs1Xv9YPCxelKsFneZDln1h2im7J4Df2H/iswM00eUGqbY6tDwQ= Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 19:38:27 -0000 On 09/23/14 12:33, Bjoern A. Zeeb wrote:=0D > On 23 Sep 2014, at 16:13 , Bjoern A. Zeeb wrote:=0D >> On 16 May 2014, at 19:28 , Colin Percival wrote:= =0D >>> Author: cperciva=0D >>> Date: Fri May 16 19:28:22 2014=0D >>> New Revision: 266269=0D >>> URL: http://svnweb.freebsd.org/changeset/base/266269=0D >>>=0D >>> Log:=0D >>> Add xenhvm.ko, which can be loaded along with a !XENHVM kernel in order= to=0D >>> provide support for the Xen/HVM environment.=0D >>> [...]=0D >> I think it is this commit that completely broke the pc98 build on stable= /9=0D >> and probably has been broken since?=0D >>=0D >> The modules Makefile probably wants MACHINE =3D=3D =93i386=94 and not MA= CHINE_CPUARCH for this module (as in you want to mov the _xenhvm=3D into th= e dedicated amd64 and i386 sections?=0D > =0D > OK, just done so in r272039. Case closed.=0D =0D Thanks! I'm sure I ran a 'make universe' before that commit though...=0D =0D (/me runs off to catch his next flight)=0D =0D -- =0D Colin Percival=0D Security Officer Emeritus, FreeBSD | The power to serve=0D Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid= =0D From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 20:23:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1AB775; Tue, 23 Sep 2014 20:23:04 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C50E2BA; Tue, 23 Sep 2014 20:23:04 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A13A41FE027; Tue, 23 Sep 2014 22:23:00 +0200 (CEST) Message-ID: <5421D69B.3000206@selasky.org> Date: Tue, 23 Sep 2014 22:22:51 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r272027 - in head: contrib/ofed/libibverbs/examples contrib/ofed/libmlx4/src sys/conf sys/modules/mlx4 sys/modules/mlxen sys/ofed/drivers/infiniband/hw/mlx4 sys/ofed/drivers/infiniband/... References: <201409231237.s8NCb27N061223@svn.freebsd.org> <20140923182549.GG884@FreeBSD.org> In-Reply-To: <20140923182549.GG884@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 20:23:04 -0000 On 09/23/14 20:25, Gleb Smirnoff wrote: > Hans, > > On Tue, Sep 23, 2014 at 12:37:02PM +0000, Hans Petter Selasky wrote: > H> Author: hselasky > H> Date: Tue Sep 23 12:37:01 2014 > H> New Revision: 272027 > H> URL: http://svnweb.freebsd.org/changeset/base/272027 > H> > H> Log: > H> Hardware driver update from Mellanox Technologies, including: > H> - improved performance > H> - better stability > H> - new features > H> - bugfixes > ... > H> @@ -240,7 +240,7 @@ ipoib_ib_handle_rx_wc(struct ipoib_dev_p > H> */ > H> if (unlikely(!ipoib_alloc_rx_mb(priv, wr_id))) { > H> memcpy(&priv->rx_ring[wr_id], &saverx, sizeof(saverx)); > H> - dev->if_iqdrops++; > H> + if_inc_counter(dev, IFCOUNTER_IQDROPS, 1); > H> goto repost; > H> } > > Thanks a lot for these changes :) > > However, to fully convert driver to new stats we need to 1) stop > writing to ifnet if_foo fields, 2) provide if_get_counter() method, > that will return current counter values. > > This can be achieved in two ways: > > 1) Dumb solution. Remove assignments for if_foo counters from > mlx4_en_DUMP_ETH_STATS(). Provide if_get_counter() method, that will > return the values using the same code we deleted. > The cons of the solution is that we still run a useless callout > to gather statistics, and that statistics are updated only on callout. > If we query the interface faster than 1 time per second, we will get > same results in two queries. > > Example of dumb solution can be found in igb(4). > > Since the code is shared between OSes, it could be that dumb solution > is the best, since it is less disruptive. > > 2) Smarter solution. Remove assignments for if_foo counters from > mlx4_en_DUMP_ETH_STATS(). Do not run mlx4_en_DUMP_ETH_STATS() periodically. > Provide if_get_counter() method, that will first run mlx4_en_DUMP_ETH_STATS(), > and then do a switch on counter type and return it. > > Example of smarter solution is vtnet(4). > > 3) Smart solution. Remove assignments for if_foo counters from > mlx4_en_DUMP_ETH_STATS(). Do not run mlx4_en_DUMP_ETH_STATS() periodically. > Provide if_get_counter() method, that will switch on the counter type > and query the proper hardware register to fetch the value and return it. > > No examples available, yet :) > > Can you help me with this, please? I can code the dumb one quickly, but > probably committing it w/o hardware test is a risky plan. > Hi Gleb, I can give you a hand on this. It's currently late where I am, and I will look into this tomorrow. Thank you! --HPS From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 20:35:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECBF4405; Tue, 23 Sep 2014 20:35:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC6525FE; Tue, 23 Sep 2014 20:35:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NKZn3H000123; Tue, 23 Sep 2014 20:35:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NKZmjc000119; Tue, 23 Sep 2014 20:35:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409232035.s8NKZmjc000119@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 23 Sep 2014 20:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272040 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 20:35:50 -0000 Author: mav Date: Tue Sep 23 20:35:48 2014 New Revision: 272040 URL: http://svnweb.freebsd.org/changeset/base/272040 Log: When reporting some major UNIT ATTENTION condition, like POWER ON OCCURRED or I_T NEXUS LOSS, clear all minor UAs for the LUN, redundant in this case. All SAM specifications tell that target MAY do it, but libiscsi initiator seems require it to be done, terminating connection with error if some more UAs happen to be reported during iSCSI connection. MFC after: 3 days Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl.h head/sys/cam/ctl/ctl_error.c head/sys/cam/ctl/ctl_error.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Sep 23 19:32:42 2014 (r272039) +++ head/sys/cam/ctl/ctl.c Tue Sep 23 20:35:48 2014 (r272040) @@ -9689,13 +9689,10 @@ ctl_request_sense(struct ctl_scsiio *cts if (lun->pending_ua[initidx] != CTL_UA_NONE) { ctl_ua_type ua_type; - ua_type = ctl_build_ua(lun->pending_ua[initidx], + ua_type = ctl_build_ua(&lun->pending_ua[initidx], sense_ptr, sense_format); - if (ua_type != CTL_UA_NONE) { + if (ua_type != CTL_UA_NONE) have_error = 1; - /* We're reporting this UA, so clear it */ - lun->pending_ua[initidx] &= ~ua_type; - } } mtx_unlock(&lun->lun_lock); @@ -11743,8 +11740,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct if ((entry->flags & CTL_CMD_FLAG_NO_SENSE) == 0) { ctl_ua_type ua_type; - ua_type = lun->pending_ua[initidx]; - if (ua_type != CTL_UA_NONE) { + if (lun->pending_ua[initidx] != CTL_UA_NONE) { scsi_sense_data_type sense_format; if (lun != NULL) @@ -11754,14 +11750,13 @@ ctl_scsiio_precheck(struct ctl_softc *ct else sense_format = SSD_TYPE_FIXED; - ua_type = ctl_build_ua(ua_type, &ctsio->sense_data, - sense_format); + ua_type = ctl_build_ua(&lun->pending_ua[initidx], + &ctsio->sense_data, sense_format); if (ua_type != CTL_UA_NONE) { ctsio->scsi_status = SCSI_STATUS_CHECK_COND; ctsio->io_hdr.status = CTL_SCSI_ERROR | CTL_AUTOSENSE; ctsio->sense_len = SSD_FULL_SIZE; - lun->pending_ua[initidx] &= ~ua_type; mtx_unlock(&lun->lun_lock); ctl_done((union ctl_io *)ctsio); return (retval); Modified: head/sys/cam/ctl/ctl.h ============================================================================== --- head/sys/cam/ctl/ctl.h Tue Sep 23 19:32:42 2014 (r272039) +++ head/sys/cam/ctl/ctl.h Tue Sep 23 20:35:48 2014 (r272040) @@ -119,7 +119,7 @@ typedef enum { CTL_UA_I_T_NEXUS_LOSS = 0x0008, CTL_UA_LUN_RESET = 0x0010, CTL_UA_LUN_CHANGE = 0x0020, - CTL_UA_MODE_CHANGE = 0x0030, + CTL_UA_MODE_CHANGE = 0x0040, CTL_UA_LOG_CHANGE = 0x0080, CTL_UA_LVD = 0x0100, CTL_UA_SE = 0x0200, Modified: head/sys/cam/ctl/ctl_error.c ============================================================================== --- head/sys/cam/ctl/ctl_error.c Tue Sep 23 19:32:42 2014 (r272039) +++ head/sys/cam/ctl/ctl_error.c Tue Sep 23 20:35:48 2014 (r272040) @@ -367,44 +367,42 @@ ctl_set_ua(struct ctl_scsiio *ctsio, int } ctl_ua_type -ctl_build_ua(ctl_ua_type ua_type, struct scsi_sense_data *sense, +ctl_build_ua(ctl_ua_type *ua_type, struct scsi_sense_data *sense, scsi_sense_data_type sense_format) { - ctl_ua_type ua_to_build; - int i, asc, ascq; + ctl_ua_type ua_to_build, ua_to_clear; + int asc, ascq; - if (ua_type == CTL_UA_NONE) - return (ua_type); + if (*ua_type == CTL_UA_NONE) + return (CTL_UA_NONE); - ua_to_build = CTL_UA_NONE; - - for (i = 0; i < (sizeof(ua_type) * 8); i++) { - if (ua_type & (1 << i)) { - ua_to_build = 1 << i; - break; - } - } + ua_to_build = (1 << (ffs(*ua_type) - 1)); + ua_to_clear = ua_to_build; switch (ua_to_build) { case CTL_UA_POWERON: /* 29h/01h POWER ON OCCURRED */ asc = 0x29; ascq = 0x01; + ua_to_clear = ~0; break; case CTL_UA_BUS_RESET: /* 29h/02h SCSI BUS RESET OCCURRED */ asc = 0x29; ascq = 0x02; + ua_to_clear = ~0; break; case CTL_UA_TARG_RESET: /* 29h/03h BUS DEVICE RESET FUNCTION OCCURRED*/ asc = 0x29; ascq = 0x03; + ua_to_clear = ~0; break; case CTL_UA_I_T_NEXUS_LOSS: /* 29h/07h I_T NEXUS LOSS OCCURRED */ asc = 0x29; ascq = 0x07; + ua_to_clear = ~0; break; case CTL_UA_LUN_RESET: /* 29h/00h POWER ON, RESET, OR BUS DEVICE RESET OCCURRED */ @@ -466,9 +464,7 @@ ctl_build_ua(ctl_ua_type ua_type, struct ascq = 0x09; break; default: - ua_to_build = CTL_UA_NONE; - return (ua_to_build); - break; /* NOTREACHED */ + panic("ctl_build_ua: Unknown UA %x", ua_to_build); } ctl_set_sense_data(sense, @@ -480,6 +476,9 @@ ctl_build_ua(ctl_ua_type ua_type, struct ascq, SSD_ELEM_NONE); + /* We're reporting this UA, so clear it */ + *ua_type &= ~ua_to_clear; + return (ua_to_build); } Modified: head/sys/cam/ctl/ctl_error.h ============================================================================== --- head/sys/cam/ctl/ctl_error.h Tue Sep 23 19:32:42 2014 (r272039) +++ head/sys/cam/ctl/ctl_error.h Tue Sep 23 20:35:48 2014 (r272040) @@ -55,7 +55,7 @@ void ctl_sense_to_desc(struct scsi_sense void ctl_sense_to_fixed(struct scsi_sense_data_desc *sense_src, struct scsi_sense_data_fixed *sense_dest); void ctl_set_ua(struct ctl_scsiio *ctsio, int asc, int ascq); -ctl_ua_type ctl_build_ua(ctl_ua_type ua_type, struct scsi_sense_data *sense, +ctl_ua_type ctl_build_ua(ctl_ua_type *ua_type, struct scsi_sense_data *sense, scsi_sense_data_type sense_format); void ctl_set_overlapped_cmd(struct ctl_scsiio *ctsio); void ctl_set_overlapped_tag(struct ctl_scsiio *ctsio, uint8_t tag); From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 21:38:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECEFA446; Tue, 23 Sep 2014 21:38:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC22AC83; Tue, 23 Sep 2014 21:38:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NLc6gi029489; Tue, 23 Sep 2014 21:38:06 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NLc5va029484; Tue, 23 Sep 2014 21:38:05 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409232138.s8NLc5va029484@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Tue, 23 Sep 2014 21:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272041 - stable/10/usr.sbin/mfiutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 21:38:07 -0000 Author: smh Date: Tue Sep 23 21:38:05 2014 New Revision: 272041 URL: http://svnweb.freebsd.org/changeset/base/272041 Log: MFC r271429, r271882: Add support for controlling mfi(4) controller properties Approved by: re (glebius) Sponsored by: Multiplay Added: stable/10/usr.sbin/mfiutil/mfi_properties.c - copied, changed from r257820, head/usr.sbin/mfiutil/mfi_properties.c Modified: stable/10/usr.sbin/mfiutil/Makefile stable/10/usr.sbin/mfiutil/mfiutil.8 stable/10/usr.sbin/mfiutil/mfiutil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/mfiutil/Makefile ============================================================================== --- stable/10/usr.sbin/mfiutil/Makefile Tue Sep 23 20:35:48 2014 (r272040) +++ stable/10/usr.sbin/mfiutil/Makefile Tue Sep 23 21:38:05 2014 (r272041) @@ -2,7 +2,8 @@ PROG= mfiutil SRCS= mfiutil.c mfi_bbu.c mfi_cmd.c mfi_config.c mfi_drive.c mfi_evt.c \ - mfi_flash.c mfi_patrol.c mfi_show.c mfi_volume.c mfi_foreign.c + mfi_flash.c mfi_patrol.c mfi_show.c mfi_volume.c mfi_foreign.c \ + mfi_properties.c MAN8= mfiutil.8 CFLAGS.gcc+= -fno-builtin-strftime Copied and modified: stable/10/usr.sbin/mfiutil/mfi_properties.c (from r257820, head/usr.sbin/mfiutil/mfi_properties.c) ============================================================================== --- head/usr.sbin/mfiutil/mfi_properties.c Thu Nov 7 21:47:59 2013 (r257820, copy source) +++ stable/10/usr.sbin/mfiutil/mfi_properties.c Tue Sep 23 21:38:05 2014 (r272041) @@ -68,7 +68,7 @@ mfi_ctrl_set_properties(int fd, struct m static int mfi_ctrl_rebuild_rate(int ac, char **av) { - int error, fd; + int error, fd; struct mfi_ctrl_props ctrl_props; if (ac > 2) { @@ -76,40 +76,40 @@ mfi_ctrl_rebuild_rate(int ac, char **av) return(-1); } - fd = mfi_open(mfi_unit, O_RDWR); - if (fd < 0) { - error = errno; - warn("mfi_open"); - return (error); - } + fd = mfi_open(mfi_unit, O_RDWR); + if (fd < 0) { + error = errno; + warn("mfi_open"); + return (error); + } error = mfi_ctrl_get_properties(fd, &ctrl_props); - if ( error < 0) { - error = errno; - warn("Failed to get controller properties"); - close(fd); - return (error); - } + if ( error < 0) { + error = errno; + warn("Failed to get controller properties"); + close(fd); + return (error); + } /* * User requested a change to the rebuild rate */ if (ac > 1) { ctrl_props.rebuild_rate = atoi(av[ac - 1]); error = mfi_ctrl_set_properties(fd, &ctrl_props); - if ( error < 0) { - error = errno; - warn("Failed to set controller properties"); - close(fd); - return (error); - } + if ( error < 0) { + error = errno; + warn("Failed to set controller properties"); + close(fd); + return (error); + } error = mfi_ctrl_get_properties(fd, &ctrl_props); - if ( error < 0) { - error = errno; - warn("Failed to get controller properties"); - close(fd); - return (error); - } + if ( error < 0) { + error = errno; + warn("Failed to get controller properties"); + close(fd); + return (error); + } } printf ("controller rebuild rate: %%%u \n", ctrl_props.rebuild_rate); @@ -120,7 +120,7 @@ MFI_COMMAND(ctrlprop, rebuild, mfi_ctrl_ static int mfi_ctrl_alarm_enable(int ac, char **av) { - int error, fd; + int error, fd; struct mfi_ctrl_props ctrl_props; if (ac > 2) { @@ -128,40 +128,40 @@ mfi_ctrl_alarm_enable(int ac, char **av) return(-1); } - fd = mfi_open(mfi_unit, O_RDWR); - if (fd < 0) { - error = errno; - warn("mfi_open"); - return (error); - } + fd = mfi_open(mfi_unit, O_RDWR); + if (fd < 0) { + error = errno; + warn("mfi_open"); + return (error); + } error = mfi_ctrl_get_properties(fd, &ctrl_props); - if ( error < 0) { - error = errno; - warn("Failed to get controller properties"); - close(fd); - return (error); - } + if ( error < 0) { + error = errno; + warn("Failed to get controller properties"); + close(fd); + return (error); + } printf ("controller alarm was : %s\n", (ctrl_props.alarm_enable ? "enabled" : "disabled")); if (ac > 1) { ctrl_props.alarm_enable = atoi(av[ac - 1]); error = mfi_ctrl_set_properties(fd, &ctrl_props); - if ( error < 0) { - error = errno; - warn("Failed to set controller properties"); - close(fd); - return (error); - } + if ( error < 0) { + error = errno; + warn("Failed to set controller properties"); + close(fd); + return (error); + } error = mfi_ctrl_get_properties(fd, &ctrl_props); - if ( error < 0) { - error = errno; - warn("Failed to get controller properties"); - close(fd); - return (error); - } + if ( error < 0) { + error = errno; + warn("Failed to get controller properties"); + close(fd); + return (error); + } } printf ("controller alarm was : %s\n", (ctrl_props.alarm_enable ? "enabled" : "disabled")); Modified: stable/10/usr.sbin/mfiutil/mfiutil.8 ============================================================================== --- stable/10/usr.sbin/mfiutil/mfiutil.8 Tue Sep 23 20:35:48 2014 (r272040) +++ stable/10/usr.sbin/mfiutil/mfiutil.8 Tue Sep 23 21:38:05 2014 (r272041) @@ -168,6 +168,12 @@ .Nm .Op Fl u Ar unit .Cm bbu Ar setting Ar value +.Nm +.Op Fl u Ar unit +.Cm ctrlprop Ar rebuild Op Ar rate +.Nm +.Op Fl u Ar unit +.Cm ctrlprop Ar alarm Op Ar 0/1 .Sh DESCRIPTION The .Nm @@ -659,6 +665,12 @@ inclusive. Modes 1, 2 and 3 enable a transparent learn cycle, whereas modes 4 and 5 do not. The BBU's data retention time is greater when transparent learning is not used. .El +.It Cm ctrlprop Ar rebuild Op Ar rate +With no arguments display the rate of rebuild (percentage)a for volumes. +With an integer argument (0-100), set that value as the new rebuild rate for volumes. +.It Cm ctrlprop Ar alarm Op Ar 0/1 +With no arguments display the current alarm enable/disable status. +With a 0, disable alarms. With a 1, enable alarms. .El .Sh EXAMPLES Configure the cache for volume mfid0 to cache only writes: @@ -699,6 +711,10 @@ patrol read starting in 5 minutes: Display the second detected foreign configuration: .Pp .Dl Nm Cm show foreign 1 +.Pp +Set the current rebuild rate for volumes to 40%: +.Dl Nm Cm ctrlprop rebuild 40 +.Pp .Sh SEE ALSO .Xr mfi 4 .Sh HISTORY Modified: stable/10/usr.sbin/mfiutil/mfiutil.c ============================================================================== --- stable/10/usr.sbin/mfiutil/mfiutil.c Tue Sep 23 20:35:48 2014 (r272040) +++ stable/10/usr.sbin/mfiutil/mfiutil.c Tue Sep 23 21:38:05 2014 (r272041) @@ -93,6 +93,8 @@ usage(void) fprintf(stderr, " flash \n"); fprintf(stderr, " start learn - start a BBU relearn\n"); fprintf(stderr, " bbu - set BBU properties\n"); + fprintf(stderr, " ctrlprop rebuild [rate] - get/set the volume rebuild rate\n"); + fprintf(stderr, " ctrlprop alarm [0/1] - enable/disable controller alarms\n"); #ifdef DEBUG fprintf(stderr, " debug - debug 'show config'\n"); fprintf(stderr, " dump - display 'saved' config\n"); From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 21:56:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16F38CED; Tue, 23 Sep 2014 21:56:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 017DDEA0; Tue, 23 Sep 2014 21:56:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NLuFWf038802; Tue, 23 Sep 2014 21:56:15 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NLuFvc038801; Tue, 23 Sep 2014 21:56:15 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201409232156.s8NLuFvc038801@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 23 Sep 2014 21:56:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r272042 - stable/9/contrib/openbsm/bin/auditdistd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 21:56:16 -0000 Author: pjd Date: Tue Sep 23 21:56:15 2014 New Revision: 272042 URL: http://svnweb.freebsd.org/changeset/base/272042 Log: MFC r271577: Fix descriptors leak. PR: bin/191002 Reported by: Ryan Steinmetz Submitted by: mjg Modified: stable/9/contrib/openbsm/bin/auditdistd/subr.c Directory Properties: stable/9/contrib/openbsm/ (props changed) Modified: stable/9/contrib/openbsm/bin/auditdistd/subr.c ============================================================================== --- stable/9/contrib/openbsm/bin/auditdistd/subr.c Tue Sep 23 21:38:05 2014 (r272041) +++ stable/9/contrib/openbsm/bin/auditdistd/subr.c Tue Sep 23 21:56:15 2014 (r272042) @@ -228,6 +228,11 @@ wait_for_file_init(int fd) PJDLOG_ASSERT(fd != -1); #ifdef HAVE_KQUEUE + if (wait_for_file_kq != -1) { + close(wait_for_file_kq); + wait_for_file_kq = -1; + } + kq = kqueue(); if (kq == -1) { pjdlog_errno(LOG_WARNING, "kqueue() failed"); From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 22:07:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 136F914E; Tue, 23 Sep 2014 22:07:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F250EFCD; Tue, 23 Sep 2014 22:07:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NM783H043914; Tue, 23 Sep 2014 22:07:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NM786S043912; Tue, 23 Sep 2014 22:07:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409232207.s8NM786S043912@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 23 Sep 2014 22:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272043 - in head: etc/rc.d tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 22:07:09 -0000 Author: ngie Date: Tue Sep 23 22:07:08 2014 New Revision: 272043 URL: http://svnweb.freebsd.org/changeset/base/272043 Log: Don't install /etc/rc.d/keyserv unless MK_OPENSSL == yes Sponsored by: EMC / Isilon Storage Division Modified: head/etc/rc.d/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Tue Sep 23 21:56:15 2014 (r272042) +++ head/etc/rc.d/Makefile Tue Sep 23 22:07:08 2014 (r272043) @@ -72,7 +72,6 @@ FILES= DAEMON \ jail \ kadmind \ kdc \ - keyserv \ kfd \ kld \ kldxref \ @@ -186,6 +185,10 @@ _nscd= nscd _opensm= opensm .endif +.if ${MK_OPENSSL} != "no" +FILES+= keyserv +.endif + .if ${MK_OPENSSH} != "no" _sshd= sshd .endif Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Sep 23 21:56:15 2014 (r272042) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Sep 23 22:07:08 2014 (r272043) @@ -3510,9 +3510,9 @@ OLD_FILES+=usr/libexec/ssh-pkcs11-helper OLD_FILES+=usr/sbin/sshd .endif -#.if ${MK_OPENSSL} == no -# to be filled in -#.endif +.if ${MK_OPENSSL} == no +OLD_FILES+=etc/rc.d/keyserv +.endif .if ${MK_PC_SYSINSTALL} == no # backend-partmanager From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 22:08:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9CE002B6; Tue, 23 Sep 2014 22:08:28 +0000 (UTC) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BC59FD9; Tue, 23 Sep 2014 22:08:28 +0000 (UTC) Received: by mail-pa0-f50.google.com with SMTP id rd3so6366629pab.9 for ; Tue, 23 Sep 2014 15:08:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=HigTPxqxzTLVhhd1gD6yyRWRIR450g96e5QwJJtjxiQ=; b=ec3OtuTccfbDtxiyDI0Pw4RD5FTSxRnCuNeZAWNzNY5E6wS70iyP3o7gneyzFfZJ+a ZeKSKZ6PKVfocem/BUbAFUFRKJtkF9jDKc9eLzAvdq7ktzaC/CuXslDYlWd8D3N8H+8f TnqEi3Y2wqjblND3TOvBAe6zBIw0k8OPov2SPwfgdy5T/Wrft1SleO/X+/4oJBBEH7bb 6jgWYitXHKAjr750rYD7t+wUpE3joqncD8H+gVNMFK5hjahlg5RATm7CmpKrfI5lSZg6 0CMD/quwm9p3vpssOxWk4NzwTQ/4Yp4naOfZDFXRxbEWCb183yjUswUXJzzR6je9qhc5 W29g== X-Received: by 10.68.65.38 with SMTP id u6mr3585282pbs.48.1411510108011; Tue, 23 Sep 2014 15:08:28 -0700 (PDT) Received: from [192.168.242.58] (c-67-182-131-225.hsd1.wa.comcast.net. [67.182.131.225]) by mx.google.com with ESMTPSA id b16sm12931536pbu.45.2014.09.23.15.08.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Sep 2014 15:08:27 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_2FEA5F59-78A1-40CD-BDF0-A59D32BB4AFA"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r271893 - in head: etc/rc.d tools/build/mk From: Garrett Cooper In-Reply-To: <867g0uss49.fsf@nine.des.no> Date: Tue, 23 Sep 2014 15:08:25 -0700 Message-Id: <547744F0-A6BF-4023-9913-945CB81AB3EB@gmail.com> References: <201409200605.s8K65Ot8093395@svn.freebsd.org> <867g0uss49.fsf@nine.des.no> To: =?iso-8859-1?Q?Dag-Erling_Sm=F8rgrav?= X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Garrett Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 22:08:28 -0000 --Apple-Mail=_2FEA5F59-78A1-40CD-BDF0-A59D32BB4AFA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Sep 23, 2014, at 0:39, Dag-Erling Sm=F8rgrav wrote: > Garrett Cooper writes: >> Log: >> Don't install /etc/rc.d/rwho unless MK_RCMDS =3D=3D yes >=20 > please follow up by svn rm'ing everything that is = conditional > on MK_RCMDS=3D=3Dyes I=92ll bring up moving RCMDS from __DEFAULT_YES_OPTIONS to = __DEFAULT_NO_OPTIONS on -arch. Thanks for the comment :)! -Garrett --Apple-Mail=_2FEA5F59-78A1-40CD-BDF0-A59D32BB4AFA Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUIe9ZAAoJEMZr5QU6S73e6ukIAKnoSAYeZeovZomP+u5RZLCt 6X7OpbDM0JYnyf+UNq+Z8miET47HtLHiM12ADifPaxFwx78y+6jYd9c+ypgrDDDf o/DKir2EI0fn02NfmRgh6F1v0vkfFExzfbt4ML/RuCj8IP91q7w5kj+LmK/FxK3B s/J27luMPqkOtf9fqGkh59BCTBOZorkOkxrxzVd+UIH8e6Lxxk7jexd6uGd+Ktso YjlNwjZ7PBgHI7quehFRLHNsLeJgmUtEITyRrS6qbUNO9m445S/UQpcsksMvoVZb 5TdIm+F2udBXask62r3mN/Qc1NlNglYTy2l9LF6rQf/RiTg9eNN+X4LA2vhHrHQ= =BRp+ -----END PGP SIGNATURE----- --Apple-Mail=_2FEA5F59-78A1-40CD-BDF0-A59D32BB4AFA-- From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 22:15:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14EB26DE; Tue, 23 Sep 2014 22:15:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0025F12D; Tue, 23 Sep 2014 22:15:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NMF0WC048801; Tue, 23 Sep 2014 22:15:00 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NMF02p048799; Tue, 23 Sep 2014 22:15:00 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409232215.s8NMF02p048799@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 23 Sep 2014 22:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272044 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 22:15:01 -0000 Author: delphij Date: Tue Sep 23 22:15:00 2014 New Revision: 272044 URL: http://svnweb.freebsd.org/changeset/base/272044 Log: Constify a parameter of name2oid. No functional change. MFC after: 2 months Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Tue Sep 23 22:07:08 2014 (r272043) +++ head/sbin/sysctl/sysctl.c Tue Sep 23 22:15:00 2014 (r272044) @@ -78,7 +78,7 @@ static int parsefile(const char *); static int parse(const char *, int); static int show_var(int *, int); static int sysctl_all(int *oid, int len); -static int name2oid(char *, int *); +static int name2oid(const char *, int *); static int set_IK(const char *, int *); @@ -693,7 +693,7 @@ set_IK(const char *str, int *val) */ static int -name2oid(char *name, int *oidp) +name2oid(const char *name, int *oidp) { int oid[2]; int i; From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 22:20:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF5ABAC3; Tue, 23 Sep 2014 22:20:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA8DF157; Tue, 23 Sep 2014 22:20:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NMKJhn051535; Tue, 23 Sep 2014 22:20:19 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NMKJU2051534; Tue, 23 Sep 2014 22:20:19 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201409232220.s8NMKJU2051534@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Tue, 23 Sep 2014 22:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272046 - head/contrib/atf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 22:20:20 -0000 Author: rodrigc Date: Tue Sep 23 22:20:19 2014 New Revision: 272046 URL: http://svnweb.freebsd.org/changeset/base/272046 Log: The ATF source code is now hosted on GitHub. Modified: head/contrib/atf/FREEBSD-upgrade Modified: head/contrib/atf/FREEBSD-upgrade ============================================================================== --- head/contrib/atf/FREEBSD-upgrade Tue Sep 23 22:15:04 2014 (r272045) +++ head/contrib/atf/FREEBSD-upgrade Tue Sep 23 22:20:19 2014 (r272046) @@ -7,10 +7,9 @@ branches and you are supposed to follow http://www.freebsd.org/doc/en/articles/committers-guide/subversion-primer.html -The ATF source code is hosted on Google Code as a subcomponent of the -Kyua project: +The ATF source code is hosted on GitHub: - http://code.google.com/p/kyua/downloads/list + https://github.com/jmmv/atf and is imported into the atf vendor branch (see base/vendor/atf/). From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 22:27:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35A96FCA; Tue, 23 Sep 2014 22:27:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2088422C; Tue, 23 Sep 2014 22:27:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NMRYU8054370; Tue, 23 Sep 2014 22:27:34 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NMRYGC054369; Tue, 23 Sep 2014 22:27:34 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201409232227.s8NMRYGC054369@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Tue, 23 Sep 2014 22:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r272048 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 22:27:35 -0000 Author: pjd Date: Tue Sep 23 22:27:34 2014 New Revision: 272048 URL: http://svnweb.freebsd.org/changeset/base/272048 Log: MFC r236360,r236361: - Add missing system calls. - Remove rmdirat system call which doesn't exist. Modified: stable/9/sys/kern/capabilities.conf Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/capabilities.conf ============================================================================== --- stable/9/sys/kern/capabilities.conf Tue Sep 23 22:23:58 2014 (r272047) +++ stable/9/sys/kern/capabilities.conf Tue Sep 23 22:27:34 2014 (r272048) @@ -445,13 +445,17 @@ olio_listio faccessat fstatat fchmodat +fchownat futimesat +linkat mkdirat -rmdirat mkfifoat mknodat openat +readlinkat renameat +symlinkat +unlinkat ## ## Allow entry into open(2). This system call will fail, since access to the From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 22:29:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E122B273; Tue, 23 Sep 2014 22:29:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE39F23B; Tue, 23 Sep 2014 22:29:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NMT5Bs054734; Tue, 23 Sep 2014 22:29:05 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NMT4p5054719; Tue, 23 Sep 2014 22:29:04 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201409232229.s8NMT4p5054719@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Tue, 23 Sep 2014 22:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272049 - in head/contrib/atf: atf-c atf-c++ atf-sh doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 22:29:06 -0000 Author: rodrigc Date: Tue Sep 23 22:29:03 2014 New Revision: 272049 URL: http://svnweb.freebsd.org/changeset/base/272049 Log: Delete mentions to removed manpages Obtained from: atf (git 23c570d6f393c76dff041360bb5f7779900c7191) Modified: head/contrib/atf/atf-c++/atf-c++-api.3 head/contrib/atf/atf-c/atf-c-api.3 head/contrib/atf/atf-sh/atf-check.1 head/contrib/atf/atf-sh/atf-sh-api.3 head/contrib/atf/atf-sh/atf-sh.1 head/contrib/atf/doc/atf-test-case.4 head/contrib/atf/doc/atf-test-program.1 Modified: head/contrib/atf/atf-c++/atf-c++-api.3 ============================================================================== --- head/contrib/atf/atf-c++/atf-c++-api.3 Tue Sep 23 22:27:34 2014 (r272048) +++ head/contrib/atf/atf-c++/atf-c++-api.3 Tue Sep 23 22:29:03 2014 (r272049) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 15, 2013 +.Dd March 2, 2014 .Dt ATF-C++-API 3 .Os .Sh NAME @@ -330,9 +330,8 @@ If .Va exitcode is not .Sq -1 , -.Xr atf-run 1 -will validate that the exit code of the test case matches the one provided -in this call. +the runtime engine will validate that the exit code of the test case +matches the one provided in this call. Otherwise, the exact value will be ignored. .It Fn expect_fail "reason" Any failure (be it fatal or non-fatal) raised in this mode is recorded. @@ -368,9 +367,8 @@ If .Va signo is not .Sq -1 , -.Xr atf-run 1 -will validate that the signal that terminated the test case matches the one -provided in this call. +the runtime engine will validate that the signal that terminated the test +case matches the one provided in this call. Otherwise, the exact value will be ignored. .It Fn expect_timeout "reason" Expects the test case to execute for longer than its timeout. @@ -631,5 +629,4 @@ ATF_INIT_TEST_CASES(tcs) .Ed .Sh SEE ALSO .Xr atf-test-program 1 , -.Xr atf-test-case 4 , -.Xr atf 7 +.Xr atf-test-case 4 Modified: head/contrib/atf/atf-c/atf-c-api.3 ============================================================================== --- head/contrib/atf/atf-c/atf-c-api.3 Tue Sep 23 22:27:34 2014 (r272048) +++ head/contrib/atf/atf-c/atf-c-api.3 Tue Sep 23 22:29:03 2014 (r272049) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 15, 2013 +.Dd March 2, 2014 .Dt ATF-C-API 3 .Os .Sh NAME @@ -409,9 +409,8 @@ If .Va exitcode is not .Sq -1 , -.Xr atf-run 1 -will validate that the exit code of the test case matches the one provided -in this call. +the runtime engine will validate that the exit code of the test case +matches the one provided in this call. Otherwise, the exact value will be ignored. .It Fn atf_tc_expect_fail "reason" "..." Any failure (be it fatal or non-fatal) raised in this mode is recorded. @@ -443,9 +442,8 @@ If .Va signo is not .Sq -1 , -.Xr atf-run 1 -will validate that the signal that terminated the test case matches the one -provided in this call. +the runtime engine will validate that the signal that terminated the test +case matches the one provided in this call. Otherwise, the exact value will be ignored. .It Fn atf_tc_expect_timeout "reason" "..." Expects the test case to execute for longer than its timeout. @@ -771,5 +769,4 @@ ATF_TP_ADD_TCS(tp) .Ed .Sh SEE ALSO .Xr atf-test-program 1 , -.Xr atf-test-case 4 , -.Xr atf 7 +.Xr atf-test-case 4 Modified: head/contrib/atf/atf-sh/atf-check.1 ============================================================================== --- head/contrib/atf/atf-sh/atf-check.1 Tue Sep 23 22:27:34 2014 (r272048) +++ head/contrib/atf/atf-sh/atf-check.1 Tue Sep 23 22:29:03 2014 (r272049) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 27, 2010 +.Dd March 2, 2014 .Dt ATF-CHECK 1 .Os .Sh NAME @@ -118,15 +118,20 @@ Analyzes standard error (syntax identica Executes .Ar command as a shell command line, executing it with the system shell defined by -.Va ATF_SHELL -in -.Xr atf-config 1 . +.Va ATF_SHELL . You should avoid using this flag if at all possible to prevent shell quoting issues. .El .Sh EXIT STATUS .Nm exits 0 on success, and other (unspecified) value on failure. +.Sh ENVIRONMENT +.Bl -tag -width ATFXSHELLXX -compact +.It Va ATF_SHELL +Path to the system shell to be used when the +.Fl x +is given to run commands. +.El .Sh EXAMPLES .Bd -literal -offset indent # Exit code 0, nothing on stdout/stderr @@ -146,6 +151,3 @@ atf-check -s signal:sigsegv my_program # Combined checks atf-check -o match:foo -o not-match:bar echo foo baz .Ed -.Sh SEE ALSO -.Xr atf-config 1 , -.Xr atf 7 Modified: head/contrib/atf/atf-sh/atf-sh-api.3 ============================================================================== --- head/contrib/atf/atf-sh/atf-sh-api.3 Tue Sep 23 22:27:34 2014 (r272048) +++ head/contrib/atf/atf-sh/atf-sh-api.3 Tue Sep 23 22:29:03 2014 (r272049) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 13, 2013 +.Dd March 2, 2014 .Dt ATF-SH-API 3 .Os .Sh NAME @@ -224,9 +224,8 @@ If .Va exitcode is not .Sq -1 , -.Xr atf-run 1 -will validate that the exit code of the test case matches the one provided -in this call. +the runtime engine will validate that the exit code of the test case +matches the one provided in this call. Otherwise, the exact value will be ignored. .It Fn atf_expect_fail "reason" Any failure raised in this mode is recorded, but such failures do not report @@ -258,9 +257,8 @@ If .Va signo is not .Sq -1 , -.Xr atf-run 1 -will validate that the signal that terminated the test case matches the one -provided in this call. +the runtime engine will validate that the signal that terminated the test +case matches the one provided in this call. Otherwise, the exact value will be ignored. .It Fn atf_expect_timeout "reason" "..." Expects the test case to execute for longer than its timeout. @@ -339,5 +337,4 @@ atf_check -s exit:0 -o match:"^foo$" -e .Sh SEE ALSO .Xr atf-sh 1 , .Xr atf-test-program 1 , -.Xr atf-test-case 4 , -.Xr atf 7 +.Xr atf-test-case 4 Modified: head/contrib/atf/atf-sh/atf-sh.1 ============================================================================== --- head/contrib/atf/atf-sh/atf-sh.1 Tue Sep 23 22:27:34 2014 (r272048) +++ head/contrib/atf/atf-sh/atf-sh.1 Tue Sep 23 22:29:03 2014 (r272049) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 15, 2013 +.Dd March 2, 2014 .Dt ATF-SH 1 .Os .Sh NAME @@ -47,10 +47,8 @@ library. .Pp .Nm is not a real interpreter though: it is just a wrapper around -the system-wide shell defined by the -.Sq atf_shell -configuration value in -.Xr atf-config 1 . +the system-wide shell defined by +.Va ATF_SHELL . .Nm executes the interpreter, loads the .Xr atf-sh-api 3 @@ -68,7 +66,10 @@ The following options are available: .It Fl h Shows a short summary of all available options and their purpose. .El +.Sh ENVIRONMENT +.Bl -tag -width ATFXSHELLXX -compact +.It Va ATF_SHELL +Path to the system shell to be used in the generated scripts. +.El .Sh SEE ALSO -.Xr atf-config 1 , -.Xr atf-sh-api 3 , -.Xr atf 7 +.Xr atf-sh-api 3 Modified: head/contrib/atf/doc/atf-test-case.4 ============================================================================== --- head/contrib/atf/doc/atf-test-case.4 Tue Sep 23 22:27:34 2014 (r272048) +++ head/contrib/atf/doc/atf-test-case.4 Tue Sep 23 22:29:03 2014 (r272049) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 13, 2011 +.Dd March 2, 2014 .Dt ATF-TEST-CASE 4 .Os .Sh NAME @@ -171,9 +171,7 @@ Type: boolean. Optional. .Pp If set to true, specifies that the test case has a cleanup routine that has -to be executed by -.Xr atf-run 1 -during the cleanup phase of the execution. +to be executed by the runtime engine during the cleanup phase of the execution. This property is automatically set by the framework when defining a test case with a cleanup routine, so it should never be set by hand. .It ident @@ -251,8 +249,7 @@ the test case is .Pp If the test case is running as root and this property is .Sq unprivileged , -.Xr atf-run 1 -will automatically drop the privileges if the +the runtime engine will automatically drop the privileges if the .Sq unprivileged-user configuration property is set; otherwise the test case is .Em skipped . @@ -314,7 +311,4 @@ Test cases are always executed with a fi .Sq 0022 . The test case's code is free to change this during execution. .Sh SEE ALSO -.Xr atf-run 1 , -.Xr atf-test-program 1 , -.Xr atf-formats 5 , -.Xr atf 7 +.Xr atf-test-program 1 Modified: head/contrib/atf/doc/atf-test-program.1 ============================================================================== --- head/contrib/atf/doc/atf-test-program.1 Tue Sep 23 22:27:34 2014 (r272048) +++ head/contrib/atf/doc/atf-test-program.1 Tue Sep 23 22:29:03 2014 (r272049) @@ -26,7 +26,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 6, 2011 +.Dd March 2, 2014 .Dt ATF-TEST-PROGRAM 1 .Os .Sh NAME @@ -61,16 +61,17 @@ instead of the test case body; see Note that the test case is .Em executed without isolation , so it can and probably will create and modify files in the current directory. -To execute test cases in a controller manner, refer to -.Xr atf-run 1 , -which is the preferred way to run test cases. +To execute test cases in a controller manner, you need a runtime engine +that understands the ATF interface. +The recommended runtime engine is +.Xr kyua 1 . You should only execute test cases by hand for debugging purposes. .Pp In the second synopsis form, the test program will list all available test cases alongside their meta-data properties in a format that is machine parseable. This list is processed by -.Xr atf-run 1 +.Xr kyua 1 to know how to execute the test cases of a given test program. .Pp The following options are available: @@ -99,5 +100,4 @@ to the value .Ar value . .El .Sh SEE ALSO -.Xr atf-run 1 , -.Xr atf 7 +.Xr kyua 1 From owner-svn-src-all@FreeBSD.ORG Tue Sep 23 22:57:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A38C8FEE; Tue, 23 Sep 2014 22:57:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F25B7E2; Tue, 23 Sep 2014 22:57:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8NMvCVc070255; Tue, 23 Sep 2014 22:57:12 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8NMvCL3070254; Tue, 23 Sep 2014 22:57:12 GMT (envelope-from np@FreeBSD.org) Message-Id: <201409232257.s8NMvCL3070254@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 23 Sep 2014 22:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272051 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2014 22:57:12 -0000 Author: np Date: Tue Sep 23 22:57:11 2014 New Revision: 272051 URL: http://svnweb.freebsd.org/changeset/base/272051 Log: cxgbe(4): Verify that the addresses in if_multiaddrs really are multicast addresses. (The chip doesn't really care, it's just that it needs to be told explicitly if unicast DMACs are checked for "hits" in the hash that is used after the TCAM entries are all used up). Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Sep 23 22:38:10 2014 (r272050) +++ head/sys/dev/cxgbe/t4_main.c Tue Sep 23 22:57:11 2014 (r272051) @@ -3031,8 +3031,10 @@ update_mac_settings(struct ifnet *ifp, i TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - mcaddr[i++] = + mcaddr[i] = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); + MPASS(ETHER_IS_MULTICAST(mcaddr[i])); + i++; if (i == FW_MAC_EXACT_CHUNK) { rc = t4_alloc_mac_filt(sc, sc->mbox, viid, del, From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 01:21:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70CFC4A8; Wed, 24 Sep 2014 01:21:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5283768B; Wed, 24 Sep 2014 01:21:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8O1LW2I039986; Wed, 24 Sep 2014 01:21:32 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8O1LWrl039985; Wed, 24 Sep 2014 01:21:32 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201409240121.s8O1LWrl039985@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 24 Sep 2014 01:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272052 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 01:21:32 -0000 Author: cy Date: Wed Sep 24 01:21:31 2014 New Revision: 272052 URL: http://svnweb.freebsd.org/changeset/base/272052 Log: ipfilter bug #558 add in some missing frag table function comments. Approved by: glebius (mentor) Obtained from: ipfilter CVS repo (r1.36) Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_frag.c Tue Sep 23 22:57:11 2014 (r272051) +++ head/sys/contrib/ipfilter/netinet/ip_frag.c Wed Sep 24 01:21:31 2014 (r272052) @@ -930,7 +930,8 @@ ipf_frag_known(fin, passp) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_natforget */ /* Returns: Nil */ -/* Parameters: ptr(I) - pointer to data structure */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* ptr(I) - pointer to data structure */ /* */ /* Search through all of the fragment cache entries for NAT and wherever a */ /* pointer is found to match ptr, reset it to NULL. */ @@ -954,7 +955,8 @@ ipf_frag_natforget(softc, ptr) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_delete */ /* Returns: Nil */ -/* Parameters: fra(I) - pointer to fragment structure to delete */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* fra(I) - pointer to fragment structure to delete */ /* tail(IO) - pointer to the pointer to the tail of the frag */ /* list */ /* */ @@ -991,7 +993,10 @@ ipf_frag_delete(softc, fra, tail) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_free */ /* Returns: Nil */ +/* Parameters: softf(I) - pointer to fragment context information */ +/* fra(I) - pointer to fragment structure to free */ /* */ +/* Free up a fragment cache entry and bump relevent statistics. */ /* ------------------------------------------------------------------------ */ static void ipf_frag_free(softf, fra) @@ -1007,7 +1012,7 @@ ipf_frag_free(softf, fra) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_clear */ /* Returns: Nil */ -/* Parameters: Nil */ +/* Parameters: softc(I) - pointer to soft context main structure */ /* */ /* Free memory in use by fragment state information kept. Do the normal */ /* fragment state stuff first and then the NAT-fragment table. */ @@ -1048,7 +1053,7 @@ ipf_frag_clear(softc) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_expire */ /* Returns: Nil */ -/* Parameters: Nil */ +/* Parameters: softc(I) - pointer to soft context main structure */ /* */ /* Expire entries in the fragment cache table that have been there too long */ /* ------------------------------------------------------------------------ */ @@ -1120,6 +1125,13 @@ ipf_frag_expire(softc) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_pkt_next */ +/* Returns: int - 0 == success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* token(I) - pointer to token information for this caller */ +/* itp(I) - pointer to generic iterator from caller */ +/* */ +/* This function is used to step through the fragment cache list used for */ +/* filter rules. The hard work is done by the more generic ipf_frag_next. */ /* ------------------------------------------------------------------------ */ int ipf_frag_pkt_next(softc, token, itp) @@ -1140,6 +1152,13 @@ ipf_frag_pkt_next(softc, token, itp) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_nat_next */ +/* Returns: int - 0 == success, else error */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* token(I) - pointer to token information for this caller */ +/* itp(I) - pointer to generic iterator from caller */ +/* */ +/* This function is used to step through the fragment cache list used for */ +/* NAT. The hard work is done by the more generic ipf_frag_next. */ /* ------------------------------------------------------------------------ */ int ipf_frag_nat_next(softc, token, itp) @@ -1160,7 +1179,8 @@ ipf_frag_nat_next(softc, token, itp) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_next */ /* Returns: int - 0 == success, else error */ -/* Parameters: token(I) - pointer to token information for this caller */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* token(I) - pointer to token information for this caller */ /* itp(I) - pointer to generic iterator from caller */ /* top(I) - top of the fragment list */ /* lock(I) - fragment cache lock */ @@ -1239,7 +1259,11 @@ ipf_frag_next(softc, token, itp, top /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_pkt_deref */ /* Returns: Nil */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* data(I) - pointer to frag cache pointer */ /* */ +/* This function is the external interface for dropping a reference to a */ +/* fragment cache entry used by filter rules. */ /* ------------------------------------------------------------------------ */ void ipf_frag_pkt_deref(softc, data) @@ -1261,7 +1285,11 @@ ipf_frag_pkt_deref(softc, data) /* ------------------------------------------------------------------------ */ /* Function: ipf_frag_nat_deref */ /* Returns: Nil */ +/* Parameters: softc(I) - pointer to soft context main structure */ +/* data(I) - pointer to frag cache pointer */ /* */ +/* This function is the external interface for dropping a reference to a */ +/* fragment cache entry used by NAT table entries. */ /* ------------------------------------------------------------------------ */ void ipf_frag_nat_deref(softc, data) From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 04:06:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5AEF35A; Wed, 24 Sep 2014 04:06:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8245860; Wed, 24 Sep 2014 04:06:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8O46tN7018072; Wed, 24 Sep 2014 04:06:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8O46tgm018071; Wed, 24 Sep 2014 04:06:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409240406.s8O46tgm018071@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 24 Sep 2014 04:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272053 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 04:06:55 -0000 Author: ngie Date: Wed Sep 24 04:06:54 2014 New Revision: 272053 URL: http://svnweb.freebsd.org/changeset/base/272053 Log: Have distrib-dirs, distribution, hier, hierarchy, redistribute, and reinstall depend on the .MAKE special target This will allow users to do something like the following to print out the results of the running the simulated make target with bmake, like some of the other top-level make targets in Makefile.inc1: % make -f Makefile.inc1 -n distribution TARGET=i386 TARGET_ARCH=i386 MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Sep 24 01:21:31 2014 (r272052) +++ head/Makefile.inc1 Wed Sep 24 04:06:54 2014 (r272053) @@ -911,7 +911,7 @@ packageworld: # and do a 'make reinstall' on the *client* to install new binaries from the # most recent server build. # -reinstall: +reinstall: .MAKE @echo "--------------------------------------------------------------" @echo ">>> Making hierarchy" @echo "--------------------------------------------------------------" @@ -926,7 +926,7 @@ reinstall: ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32 .endif -redistribute: +redistribute: .MAKE @echo "--------------------------------------------------------------" @echo ">>> Distributing everything" @echo "--------------------------------------------------------------" @@ -936,7 +936,7 @@ redistribute: DISTRIBUTION=lib32 .endif -distrib-dirs distribution: +distrib-dirs distribution: .MAKE cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ ${IMAKE_INSTALL} ${IMAKE_MTREE} METALOG=${METALOG} ${.TARGET} @@ -1464,7 +1464,7 @@ native-xtools: .MAKE # # hierarchy - ensure that all the needed directories are present # -hierarchy hier: +hierarchy hier: .MAKE cd ${.CURDIR}/etc && ${HMAKE} distrib-dirs # From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 04:17:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFBE06CE; Wed, 24 Sep 2014 04:17:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAFBD942; Wed, 24 Sep 2014 04:17:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8O4HT7X023120; Wed, 24 Sep 2014 04:17:29 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8O4HTdH023119; Wed, 24 Sep 2014 04:17:29 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409240417.s8O4HTdH023119@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 24 Sep 2014 04:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272054 - head/usr.bin/mkimg/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 04:17:29 -0000 Author: marcel Date: Wed Sep 24 04:17:29 2014 New Revision: 272054 URL: http://svnweb.freebsd.org/changeset/base/272054 Log: Clean the generated baseline files by adding them to CLEANFILES. Modified: head/usr.bin/mkimg/tests/Makefile Modified: head/usr.bin/mkimg/tests/Makefile ============================================================================== --- head/usr.bin/mkimg/tests/Makefile Wed Sep 24 04:06:54 2014 (r272053) +++ head/usr.bin/mkimg/tests/Makefile Wed Sep 24 04:17:29 2014 (r272054) @@ -11,6 +11,8 @@ FILESDIR= ${TESTSDIR} ${FILES}: uudecode -p ${.CURDIR}/${.TARGET}.gz.uu | gunzip -c > ${.TARGET} +CLEANFILES+= ${FILES} + rebase: (cd ${.CURDIR}; atf-sh mkimg.sh rebase) From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 04:45:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E78FC71; Wed, 24 Sep 2014 04:45:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7051DBA1; Wed, 24 Sep 2014 04:45:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8O4jatq036791; Wed, 24 Sep 2014 04:45:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8O4jaR8036790; Wed, 24 Sep 2014 04:45:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409240445.s8O4jaR8036790@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 24 Sep 2014 04:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272055 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 04:45:36 -0000 Author: ngie Date: Wed Sep 24 04:45:35 2014 New Revision: 272055 URL: http://svnweb.freebsd.org/changeset/base/272055 Log: Improve bsd.progs.mk compatibility with bsd.prog.mk 1. Do not install FILES/SCRIPTS multiple times if PROGS is specified; this is already handled via bsd.prog.mk when it's called recursively (PR: 191055, 191955). 2. Some variables, like BINDIR and PROGNAME, default to a value if unset whereas others get appended to, like CFLAGS. Add support for the former case (PR: 191056) 3. Make "checkdpadd" and "clean" available targets for recursive execution. Reviewed by: marcel, sjg Phabric: D822 PR: 191055, 191056, 191955 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Wed Sep 24 04:17:29 2014 (r272054) +++ head/share/mk/bsd.progs.mk Wed Sep 24 04:45:35 2014 (r272055) @@ -42,10 +42,15 @@ PROG ?= $t .if defined(PROG) # just one of many -PROG_VARS += BINDIR CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD MAN SRCS +PROG_OVERRIDE_VARS += BINDIR MAN SRCS +PROG_VARS += CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} -.if defined(${v}.${PROG}) || defined(${v}_${PROG}) -$v += ${${v}_${PROG}:U${${v}.${PROG}}} +.if empty(${PROG_OVERRIDE_VARS:M$v}) +.if defined(${v}.${PROG}) +$v += ${${v}.${PROG}} +.elif defined(${v}_${PROG}) +$v += ${${v}_${PROG}} +.endif .else $v ?= .endif @@ -61,7 +66,7 @@ UPDATE_DEPENDFILE ?= NO DEPENDFILE?= .depend.${PROG} # prog.mk will do the rest .else -all: ${PROGS} +all: ${FILES} ${PROGS} ${SCRIPTS} # We cannot capture dependencies for meta mode here UPDATE_DEPENDFILE = NO @@ -75,7 +80,7 @@ UPDATE_DEPENDFILE = NO .ifndef _RECURSING_PROGS # tell progs.mk we might want to install things -PROGS_TARGETS+= cleandepend cleandir cleanobj depend install +PROGS_TARGETS+= checkdpadd clean cleandepend cleandir cleanobj depend install .for p in ${PROGS} .if defined(PROGS_CXX) && !empty(PROGS_CXX:M$p) @@ -98,18 +103,15 @@ $p.$t: .PHONY .MAKE $t: ${PROGS:%=%.$t} .endfor -SCRIPTS_TARGETS+= cleandepend cleandir cleanobj depend install +.if empty(PROGS) && !empty(SCRIPTS) -.for p in ${SCRIPTS} -.for t in ${SCRIPTS_TARGETS:O:u} -$p.$t: .PHONY .MAKE - (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ - SUBDIR= SCRIPT=$p ${x.$p} ${@:E}) -.endfor +.for t in ${PROGS_TARGETS:O:u} +scripts.$t: .PHONY .MAKE + (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} SUBDIR= _RECURSING_PROGS= \ + $t) +$t: scripts.$t .endfor -.for t in ${SCRIPTS_TARGETS:O:u} -$t: ${SCRIPTS:%=%.$t} -.endfor +.endif .endif From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 06:50:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A108FC92; Wed, 24 Sep 2014 06:50:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CE5F882; Wed, 24 Sep 2014 06:50:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8O6oFjs093949; Wed, 24 Sep 2014 06:50:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8O6oFF2093948; Wed, 24 Sep 2014 06:50:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409240650.s8O6oFF2093948@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 24 Sep 2014 06:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272056 - head/contrib/atf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 06:50:15 -0000 Author: ngie Date: Wed Sep 24 06:50:14 2014 New Revision: 272056 URL: http://svnweb.freebsd.org/changeset/base/272056 Log: Fix a typo in the upgrade directions MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/atf/FREEBSD-upgrade Modified: head/contrib/atf/FREEBSD-upgrade ============================================================================== --- head/contrib/atf/FREEBSD-upgrade Wed Sep 24 04:45:35 2014 (r272055) +++ head/contrib/atf/FREEBSD-upgrade Wed Sep 24 06:50:14 2014 (r272056) @@ -41,7 +41,7 @@ the vendor branch as you easily risk com tree. Lastly, with the list of old and new files in this import, make sure -to udpate the reachover Makefiles accordingly. +to update the reachover Makefiles accordingly. Test the build (keeping in mind the WITH_TESTS/WITHOUT_TESTS knobs) and, if all looks good, you are ready to commit all the changes in one go. From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 07:00:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8441FAE; Wed, 24 Sep 2014 07:00:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AED4959; Wed, 24 Sep 2014 07:00:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8O70agp099306; Wed, 24 Sep 2014 07:00:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8O70aCq099304; Wed, 24 Sep 2014 07:00:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409240700.s8O70aCq099304@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 24 Sep 2014 07:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272057 - in head: . contrib/pjdfstest tools/regression/pjdfstest X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 07:00:36 -0000 Author: ngie Date: Wed Sep 24 07:00:35 2014 New Revision: 272057 URL: http://svnweb.freebsd.org/changeset/base/272057 Log: Import pjdfstest from ^/vendor/pjdfstest/abf03c3a47745d4521b0e4aa141317553ca48f91 - Remove tools/regression/pjdfstest - Add upgrade directions for contrib/pjdfstest - Add a note to UPDATING for the move (the reachover Makefiles are coming soon) Functional differences: - ftruncate testcases are added from upstream (github) Non-functional differences: - The copyright for the project has been updated to 2012 - pjd's contact information has been updated Discussed with: -testing, jmmv, pjd MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Added: head/contrib/pjdfstest/ - copied from r272055, vendor/pjdfstest/abf03c3a47745d4521b0e4aa141317553ca48f91/ head/contrib/pjdfstest/FREEBSD-upgrade Deleted: head/tools/regression/pjdfstest/ Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Sep 24 06:50:14 2014 (r272056) +++ head/UPDATING Wed Sep 24 07:00:35 2014 (r272057) @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140923: + pjdfstest has been moved from tools/regression/pjdfstest to + contrib/pjdfstest . + 20140922: At svn r271982, The default linux compat kernel ABI has been adjusted to 2.6.18 in support of the linux-c6 compat ports infrastructure Added: head/contrib/pjdfstest/FREEBSD-upgrade ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/pjdfstest/FREEBSD-upgrade Wed Sep 24 07:00:35 2014 (r272057) @@ -0,0 +1,25 @@ +$FreeBSD$ + +This document contains a collection of notes specific to the import +of pjdfstest into head. These notes are built on the instructions in +the FreeBSD Subversion Primer that detail how to deal with vendor +branches and you are supposed to follow those: + + http://www.freebsd.org/doc/en/articles/committers-guide/subversion-primer.html + +The pjdfstest source code is hosted on GitHub: + + https://github.com/pjd/pjdfstest + +and is imported into the pjdfstest vendor branch (see base/vendor/pjdfstest/). + +To merge the vendor branch into head do something like this: + + cd .../base/head/contrib/pjdfstest + svn merge --accept=postpone \ + svn+ssh://svn.freebsd.org/base/vendor/pjdfstest/dist . + +and resolve any conflicts that may arise at this point. + +Lastly, with the list of old and new files in this import, make sure +to update the reachover Makefiles accordingly. From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 07:29:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D7AB753; Wed, 24 Sep 2014 07:29:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38147C0F; Wed, 24 Sep 2014 07:29:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8O7T8FR012532; Wed, 24 Sep 2014 07:29:08 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8O7T87F012531; Wed, 24 Sep 2014 07:29:08 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201409240729.s8O7T87F012531@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Wed, 24 Sep 2014 07:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272058 - stable/10/share/examples/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 07:29:08 -0000 Author: rodrigc Date: Wed Sep 24 07:29:07 2014 New Revision: 272058 URL: http://svnweb.freebsd.org/changeset/base/272058 Log: MFC r271447, r271496 - Attach the ISO to an ahci-cd emulated device - Propagate the error status of /usr/sbin/bhyve Approved by:re (delphij) Modified: stable/10/share/examples/bhyve/vmrun.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/share/examples/bhyve/vmrun.sh ============================================================================== --- stable/10/share/examples/bhyve/vmrun.sh Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/share/examples/bhyve/vmrun.sh Wed Sep 24 07:29:07 2014 (r272058) @@ -196,7 +196,7 @@ while [ 1 ]; do exit 1 fi BOOTDISK=${isofile} - installer_opt="-s 31:0,virtio-blk,${BOOTDISK}" + installer_opt="-s 31:0,ahci-cd,${BOOTDISK}" else BOOTDISK=${virtio_diskdev} installer_opt="" @@ -204,7 +204,8 @@ while [ 1 ]; do ${LOADER} -c ${console} -m ${memsize} -d ${BOOTDISK} ${loader_opt} \ ${vmname} - if [ $? -ne 0 ]; then + bhyve_exit=$? + if [ $bhyve_exit -ne 0 ]; then break fi @@ -239,6 +240,7 @@ while [ 1 ]; do ${installer_opt} \ ${vmname} + bhyve_exit=$? # bhyve returns the following status codes: # 0 - VM has been reset # 1 - VM has been powered off @@ -246,9 +248,18 @@ while [ 1 ]; do # 3 - VM generated a triple fault # all other non-zero status codes are errors # - if [ $? -ne 0 ]; then + if [ $bhyve_exit -ne 0 ]; then break fi done -exit 99 + +case $bhyve_exit in + 0|1|2) + # Cleanup /dev/vmm entry when bhyve did not exit + # due to an error. + ${BHYVECTL} --vm=${vmname} --destroy > /dev/null 2>&1 + ;; +esac + +exit $bhyve_exit From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 08:18:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A898FE2; Wed, 24 Sep 2014 08:18:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9427B118; Wed, 24 Sep 2014 08:18:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8O8IC5X036093; Wed, 24 Sep 2014 08:18:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8O8ICmX036091; Wed, 24 Sep 2014 08:18:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409240818.s8O8ICmX036091@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 24 Sep 2014 08:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272059 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 08:18:12 -0000 Author: mav Date: Wed Sep 24 08:18:11 2014 New Revision: 272059 URL: http://svnweb.freebsd.org/changeset/base/272059 Log: Remake Linux' SOUND_MIXER_INFO IOCTL as a wrapper around new FreeBSD's one. Submitted by: Dmitry Luhtionov MFC after: 3 days Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Wed Sep 24 07:29:07 2014 (r272058) +++ head/sys/compat/linux/linux_ioctl.c Wed Sep 24 08:18:11 2014 (r272059) @@ -1699,13 +1699,6 @@ linux_ioctl_vfat(struct thread *td, stru * Sound related ioctls */ -struct linux_mixer_info { - char id[16]; - char name[32]; - int modify_counter; - int fillers[10]; -}; - struct linux_old_mixer_info { char id[16]; char name[32]; @@ -1793,12 +1786,8 @@ linux_ioctl_sound(struct thread *td, str /* Key on encoded length */ switch ((args->cmd >> 16) & 0x1fff) { case 0x005c: { /* SOUND_MIXER_INFO */ - struct linux_mixer_info info; - bzero(&info, sizeof(info)); - strncpy(info.id, "OSS", sizeof(info.id) - 1); - strncpy(info.name, "FreeBSD OSS Mixer", sizeof(info.name) - 1); - copyout(&info, (void *)args->arg, sizeof(info)); - return (0); + args->cmd = SOUND_MIXER_INFO; + return (sys_ioctl(td, (struct ioctl_args *)args)); } case 0x0030: { /* SOUND_OLD_MIXER_INFO */ struct linux_old_mixer_info info; From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 08:28:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BEBF323; Wed, 24 Sep 2014 08:28:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CF4921B; Wed, 24 Sep 2014 08:28:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8O8SahL040756; Wed, 24 Sep 2014 08:28:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8O8SZDI040748; Wed, 24 Sep 2014 08:28:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409240828.s8O8SZDI040748@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 24 Sep 2014 08:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272060 - head/sys/ofed/drivers/net/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 08:28:36 -0000 Author: hselasky Date: Wed Sep 24 08:28:34 2014 New Revision: 272060 URL: http://svnweb.freebsd.org/changeset/base/272060 Log: Update code to use new network counter API. Fix some minor compile warnings while at it. Sponsored by: Mellanox Technologies Suggested by: glebius@ MFC after: 1 week Modified: head/sys/ofed/drivers/net/mlx4/en_port.c head/sys/ofed/drivers/net/mlx4/en_tx.c head/sys/ofed/drivers/net/mlx4/fw.h head/sys/ofed/drivers/net/mlx4/mlx4_en.h head/sys/ofed/drivers/net/mlx4/resource_tracker.c Modified: head/sys/ofed/drivers/net/mlx4/en_port.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_port.c Wed Sep 24 08:18:11 2014 (r272059) +++ head/sys/ofed/drivers/net/mlx4/en_port.c Wed Sep 24 08:28:34 2014 (r272060) @@ -546,17 +546,27 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_e } if (!mlx4_is_mfunc(mdev->dev)) { - /* netdevice stats format */ - dev = mdev->pndev[port]; - dev->if_ipackets = priv->pkstats.rx_packets; - dev->if_opackets = priv->pkstats.tx_packets; - dev->if_ibytes = priv->pkstats.rx_bytes; - dev->if_obytes = priv->pkstats.tx_bytes; - dev->if_ierrors = priv->pkstats.rx_errors; - dev->if_iqdrops = priv->pkstats.rx_dropped; - dev->if_imcasts = priv->pkstats.rx_multicast_packets; - dev->if_omcasts = priv->pkstats.tx_multicast_packets; - dev->if_collisions = 0; + if (reset == 0) { + /* netdevice stats format */ + dev = mdev->pndev[port]; + if_inc_counter(dev, IFCOUNTER_IPACKETS, + priv->pkstats.rx_packets - priv->pkstats_last.rx_packets); + if_inc_counter(dev, IFCOUNTER_OPACKETS, + priv->pkstats.tx_packets - priv->pkstats_last.tx_packets); + if_inc_counter(dev, IFCOUNTER_IBYTES, + priv->pkstats.rx_bytes - priv->pkstats_last.rx_bytes); + if_inc_counter(dev, IFCOUNTER_OBYTES, + priv->pkstats.tx_bytes - priv->pkstats_last.tx_bytes); + if_inc_counter(dev, IFCOUNTER_IERRORS, + priv->pkstats.rx_errors - priv->pkstats_last.rx_errors); + if_inc_counter(dev, IFCOUNTER_IQDROPS, + priv->pkstats.rx_dropped - priv->pkstats_last.rx_dropped); + if_inc_counter(dev, IFCOUNTER_IMCASTS, + priv->pkstats.rx_multicast_packets - priv->pkstats_last.rx_multicast_packets); + if_inc_counter(dev, IFCOUNTER_OMCASTS, + priv->pkstats.tx_multicast_packets - priv->pkstats_last.tx_multicast_packets); + } + priv->pkstats_last = priv->pkstats; } spin_unlock(&priv->stats_lock); Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_tx.c Wed Sep 24 08:18:11 2014 (r272059) +++ head/sys/ofed/drivers/net/mlx4/en_tx.c Wed Sep 24 08:28:34 2014 (r272060) @@ -1028,9 +1028,6 @@ mlx4_en_transmit_locked(struct ifnet *de } drbr_advance(dev, ring->br); enqueued++; - dev->if_obytes += next->m_pkthdr.len; - if (next->m_flags & M_MCAST) - if_inc_counter(dev, IFCOUNTER_OMCASTS, 1); if ((dev->if_drv_flags & IFF_DRV_RUNNING) == 0) break; } Modified: head/sys/ofed/drivers/net/mlx4/fw.h ============================================================================== --- head/sys/ofed/drivers/net/mlx4/fw.h Wed Sep 24 08:18:11 2014 (r272059) +++ head/sys/ofed/drivers/net/mlx4/fw.h Wed Sep 24 08:28:34 2014 (r272060) @@ -223,8 +223,6 @@ int mlx4_QUERY_HCA(struct mlx4_dev *dev, int mlx4_CLOSE_HCA(struct mlx4_dev *dev, int panic); int mlx4_map_cmd(struct mlx4_dev *dev, u16 op, struct mlx4_icm *icm, u64 virt); int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages); -int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm); -int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev); int mlx4_NOP(struct mlx4_dev *dev); int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg); void mlx4_opreq_action(struct work_struct *work); Modified: head/sys/ofed/drivers/net/mlx4/mlx4_en.h ============================================================================== --- head/sys/ofed/drivers/net/mlx4/mlx4_en.h Wed Sep 24 08:18:11 2014 (r272059) +++ head/sys/ofed/drivers/net/mlx4/mlx4_en.h Wed Sep 24 08:28:34 2014 (r272060) @@ -605,6 +605,7 @@ struct mlx4_en_priv { struct delayed_work service_task; struct mlx4_en_perf_stats pstats; struct mlx4_en_pkt_stats pkstats; + struct mlx4_en_pkt_stats pkstats_last; struct mlx4_en_flow_stats flowstats[MLX4_NUM_PRIORITIES]; struct mlx4_en_port_stats port_stats; struct mlx4_en_vport_stats vport_stats; Modified: head/sys/ofed/drivers/net/mlx4/resource_tracker.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/resource_tracker.c Wed Sep 24 08:18:11 2014 (r272059) +++ head/sys/ofed/drivers/net/mlx4/resource_tracker.c Wed Sep 24 08:28:34 2014 (r272060) @@ -1843,7 +1843,7 @@ static int mac_alloc_res(struct mlx4_dev int err = -EINVAL; int port; u64 mac; - u8 smac_index; + u8 smac_index = 0; if (op != RES_OP_RESERVE_AND_MAP) return err; From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 09:59:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79A9573C; Wed, 24 Sep 2014 09:59:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A187E88; Wed, 24 Sep 2014 09:59:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8O9xnD6082898; Wed, 24 Sep 2014 09:59:49 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8O9xno5082897; Wed, 24 Sep 2014 09:59:49 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409240959.s8O9xno5082897@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 24 Sep 2014 09:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272063 - stable/10/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 09:59:49 -0000 Author: smh Date: Wed Sep 24 09:59:48 2014 New Revision: 272063 URL: http://svnweb.freebsd.org/changeset/base/272063 Log: MFC r271934: Output boot code warning when zpool upgrade -a is used to add features. PR: 188328 Approved by: re (marius) Sponsored by: Multiplay Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Sep 24 09:28:37 2014 (r272062) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Sep 24 09:59:48 2014 (r272063) @@ -4524,7 +4524,8 @@ is_root_pool(zpool_handle_t *zhp) } static void -root_pool_upgrade_check(zpool_handle_t *zhp, char *poolname, int size) { +root_pool_upgrade_check(zpool_handle_t *zhp, char *poolname, int size) +{ if (poolname[0] == '\0' && is_root_pool(zhp)) (void) strlcpy(poolname, zpool_get_name(zhp), size); @@ -4623,7 +4624,7 @@ upgrade_cb(zpool_handle_t *zhp, void *ar #ifdef __FreeBSD__ root_pool_upgrade_check(zhp, cbp->cb_poolname, sizeof(cbp->cb_poolname)); -#endif /* ___FreeBSD__ */ +#endif /* __FreeBSD__ */ printnl = B_TRUE; #ifdef illumos @@ -4647,6 +4648,10 @@ upgrade_cb(zpool_handle_t *zhp, void *ar if (count > 0) { cbp->cb_first = B_FALSE; printnl = B_TRUE; +#ifdef __FreeBSD__ + root_pool_upgrade_check(zhp, cbp->cb_poolname, + sizeof(cbp->cb_poolname)); +#endif /* __FreeBSD__ */ /* * If they did "zpool upgrade -a", then we could * be doing ioctls to different pools. We need @@ -4788,7 +4793,7 @@ upgrade_one(zpool_handle_t *zhp, void *d #ifdef __FreeBSD__ root_pool_upgrade_check(zhp, cbp->cb_poolname, sizeof(cbp->cb_poolname)); -#endif /* ___FreeBSD__ */ +#endif /* __FreeBSD__ */ } if (cbp->cb_version >= SPA_VERSION_FEATURES) { From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 11:23:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50E3B83E; Wed, 24 Sep 2014 11:23:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BE24AED; Wed, 24 Sep 2014 11:23:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OBNu0u024620; Wed, 24 Sep 2014 11:23:56 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OBNutK024619; Wed, 24 Sep 2014 11:23:56 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409241123.s8OBNutK024619@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 24 Sep 2014 11:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272064 - head/sys/dev/et X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 11:23:56 -0000 Author: glebius Date: Wed Sep 24 11:23:55 2014 New Revision: 272064 URL: http://svnweb.freebsd.org/changeset/base/272064 Log: - Provide igb_get_counter() to return counters that are not collected, but taken from hardware. - Mechanically convert to if_inc_counter() the rest of counters. Modified: head/sys/dev/et/if_et.c Modified: head/sys/dev/et/if_et.c ============================================================================== --- head/sys/dev/et/if_et.c Wed Sep 24 09:59:48 2014 (r272063) +++ head/sys/dev/et/if_et.c Wed Sep 24 11:23:55 2014 (r272064) @@ -104,6 +104,7 @@ static int et_watchdog(struct et_softc * static int et_ifmedia_upd_locked(struct ifnet *); static int et_ifmedia_upd(struct ifnet *); static void et_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static uint64_t et_get_counter(struct ifnet *, ift_counter); static void et_add_sysctls(struct et_softc *); static int et_sysctl_rx_intr_npkts(SYSCTL_HANDLER_ARGS); @@ -324,6 +325,7 @@ et_attach(device_t dev) ifp->if_init = et_init; ifp->if_ioctl = et_ioctl; ifp->if_start = et_start; + ifp->if_get_counter = et_get_counter; ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_VLAN_MTU; ifp->if_capenable = ifp->if_capabilities; ifp->if_snd.ifq_drv_maxlen = ET_TX_NDESC - 1; @@ -1413,7 +1415,7 @@ et_start_locked(struct ifnet *ifp) if (et_encap(sc, &m_head)) { if (m_head == NULL) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); break; } IFQ_DRV_PREPEND(&ifp->if_snd, m_head); @@ -1465,7 +1467,7 @@ et_watchdog(struct et_softc *sc) if_printf(sc->ifp, "watchdog timed out (0x%08x) -- resetting\n", status); - sc->ifp->if_oerrors++; + if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1); sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; et_init_locked(sc); return (EJUSTRETURN); @@ -2093,12 +2095,12 @@ et_rxeof(struct et_softc *sc) CSR_WRITE_4(sc, ET_RXSTAT_POS, rxstat_pos); if (ring_idx >= ET_RX_NRING) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if_printf(ifp, "invalid ring index %d\n", ring_idx); continue; } if (buf_idx >= ET_RX_NDESC) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); if_printf(ifp, "invalid buf index %d\n", buf_idx); continue; } @@ -2110,13 +2112,13 @@ et_rxeof(struct et_softc *sc) rbd->rbd_discard(rbd, buf_idx); } else if (rbd->rbd_newbuf(rbd, buf_idx) != 0) { /* No available mbufs, discard it. */ - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); rbd->rbd_discard(rbd, buf_idx); } else { buflen -= ETHER_CRC_LEN; if (buflen < ETHER_HDR_LEN) { m_freem(m); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } else { m->m_pkthdr.len = m->m_len = buflen; m->m_pkthdr.rcvif = ifp; @@ -2625,7 +2627,6 @@ back: static void et_stats_update(struct et_softc *sc) { - struct ifnet *ifp; struct et_hw_stats *stats; stats = &sc->sc_stats; @@ -2675,18 +2676,35 @@ et_stats_update(struct et_softc *sc) stats->tx_oversize += CSR_READ_4(sc, ET_STAT_TX_OVERSIZE); stats->tx_undersize += CSR_READ_4(sc, ET_STAT_TX_UNDERSIZE); stats->tx_fragments += CSR_READ_4(sc, ET_STAT_TX_FRAG); +} - /* Update ifnet counters. */ - ifp = sc->ifp; - ifp->if_opackets = (u_long)stats->tx_frames; - ifp->if_collisions = stats->tx_total_colls; - ifp->if_oerrors = stats->tx_drop + stats->tx_jabbers + - stats->tx_crcerrs + stats->tx_excess_deferred + - stats->tx_late_colls; - ifp->if_ipackets = (u_long)stats->rx_frames; - ifp->if_ierrors = stats->rx_crcerrs + stats->rx_alignerrs + - stats->rx_lenerrs + stats->rx_codeerrs + stats->rx_cserrs + - stats->rx_runts + stats->rx_jabbers + stats->rx_drop; +static uint64_t +et_get_counter(struct ifnet *ifp, ift_counter cnt) +{ + struct et_softc *sc; + struct et_hw_stats *stats; + + sc = if_getsoftc(ifp); + stats = &sc->sc_stats; + + switch (cnt) { + case IFCOUNTER_OPACKETS: + return (stats->tx_frames); + case IFCOUNTER_COLLISIONS: + return (stats->tx_total_colls); + case IFCOUNTER_OERRORS: + return (stats->tx_drop + stats->tx_jabbers + + stats->tx_crcerrs + stats->tx_excess_deferred + + stats->tx_late_colls); + case IFCOUNTER_IPACKETS: + return (stats->rx_frames); + case IFCOUNTER_IERRORS: + return (stats->rx_crcerrs + stats->rx_alignerrs + + stats->rx_lenerrs + stats->rx_codeerrs + stats->rx_cserrs + + stats->rx_runts + stats->rx_jabbers + stats->rx_drop); + default: + return (if_get_counter_default(ifp, cnt)); + } } static int From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 11:26:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D69259D5; Wed, 24 Sep 2014 11:26:21 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 591B0B01; Wed, 24 Sep 2014 11:26:20 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8OBQHMs034248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 24 Sep 2014 15:26:17 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8OBQHuE034247; Wed, 24 Sep 2014 15:26:17 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 24 Sep 2014 15:26:17 +0400 From: Gleb Smirnoff To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r272064 - head/sys/dev/et Message-ID: <20140924112617.GN884@FreeBSD.org> References: <201409241123.s8OBNutK024619@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409241123.s8OBNutK024619@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 11:26:22 -0000 On Wed, Sep 24, 2014 at 11:23:56AM +0000, Gleb Smirnoff wrote: T> Author: glebius T> Date: Wed Sep 24 11:23:55 2014 T> New Revision: 272064 T> URL: http://svnweb.freebsd.org/changeset/base/272064 T> T> Log: T> - Provide igb_get_counter() to return counters that are not collected, T> but taken from hardware. Of course name should have been not igb_get_counter, but et_get_counter. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 11:31:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CAC3BEC; Wed, 24 Sep 2014 11:31:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 276F2BC9; Wed, 24 Sep 2014 11:31:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OBVlMM029073; Wed, 24 Sep 2014 11:31:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OBVlGu029072; Wed, 24 Sep 2014 11:31:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409241131.s8OBVlGu029072@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 24 Sep 2014 11:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272065 - head/sys/dev/vte X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 11:31:47 -0000 Author: glebius Date: Wed Sep 24 11:31:46 2014 New Revision: 272065 URL: http://svnweb.freebsd.org/changeset/base/272065 Log: - Provide vte_get_counter() to return counters that are not collected, but taken from hardware. - Mechanically convert to if_inc_counter() the rest of counters. Modified: head/sys/dev/vte/if_vte.c Modified: head/sys/dev/vte/if_vte.c ============================================================================== --- head/sys/dev/vte/if_vte.c Wed Sep 24 11:23:55 2014 (r272064) +++ head/sys/dev/vte/if_vte.c Wed Sep 24 11:31:46 2014 (r272065) @@ -109,6 +109,7 @@ static int vte_init_rx_ring(struct vte_s static int vte_init_tx_ring(struct vte_softc *); static void vte_intr(void *); static int vte_ioctl(struct ifnet *, u_long, caddr_t); +static uint64_t vte_get_counter(struct ifnet *, ift_counter); static void vte_mac_config(struct vte_softc *); static int vte_miibus_readreg(device_t, int, int); static void vte_miibus_statchg(device_t); @@ -449,6 +450,7 @@ vte_attach(device_t dev) ifp->if_ioctl = vte_ioctl; ifp->if_start = vte_start; ifp->if_init = vte_init; + ifp->if_get_counter = vte_get_counter; ifp->if_snd.ifq_drv_maxlen = VTE_TX_RING_CNT - 1; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); @@ -1171,7 +1173,7 @@ vte_watchdog(struct vte_softc *sc) ifp = sc->vte_ifp; if_printf(sc->vte_ifp, "watchdog timeout -- resetting\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vte_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -1272,12 +1274,10 @@ static void vte_stats_update(struct vte_softc *sc) { struct vte_hw_stats *stat; - struct ifnet *ifp; uint16_t value; VTE_LOCK_ASSERT(sc); - ifp = sc->vte_ifp; stat = &sc->vte_stats; CSR_READ_2(sc, VTE_MECISR); @@ -1304,14 +1304,32 @@ vte_stats_update(struct vte_softc *sc) value = CSR_READ_2(sc, VTE_CNT_PAUSE); stat->tx_pause_frames += (value >> 8); stat->rx_pause_frames += (value & 0xFF); +} - /* Update ifp counters. */ - ifp->if_opackets = stat->tx_frames; - ifp->if_collisions = stat->tx_late_colls; - ifp->if_oerrors = stat->tx_late_colls + stat->tx_underruns; - ifp->if_ipackets = stat->rx_frames; - ifp->if_ierrors = stat->rx_crcerrs + stat->rx_runts + - stat->rx_long_frames + stat->rx_fifo_full; +static uint64_t +vte_get_counter(struct ifnet *ifp, ift_counter cnt) +{ + struct vte_softc *sc; + struct vte_hw_stats *stat; + + sc = if_getsoftc(ifp); + stat = &sc->vte_stats; + + switch (cnt) { + case IFCOUNTER_OPACKETS: + return (stat->tx_frames); + case IFCOUNTER_COLLISIONS: + return (stat->tx_late_colls); + case IFCOUNTER_OERRORS: + return (stat->tx_late_colls + stat->tx_underruns); + case IFCOUNTER_IPACKETS: + return (stat->rx_frames); + case IFCOUNTER_IERRORS: + return (stat->rx_crcerrs + stat->rx_runts + + stat->rx_long_frames + stat->rx_fifo_full); + default: + return (if_get_counter_default(ifp, cnt)); + } } static void @@ -1503,7 +1521,7 @@ vte_rxeof(struct vte_softc *sc) continue; } if (vte_newbuf(sc, rxd) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); rxd->rx_desc->drlen = htole16(MCLBYTES - sizeof(uint32_t)); rxd->rx_desc->drst = htole16(VTE_DRST_RX_OWN); From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 11:33:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EE06D67; Wed, 24 Sep 2014 11:33:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FC9DBDE; Wed, 24 Sep 2014 11:33:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OBXhLV029391; Wed, 24 Sep 2014 11:33:44 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OBXhBO029390; Wed, 24 Sep 2014 11:33:43 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409241133.s8OBXhBO029390@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 24 Sep 2014 11:33:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272066 - head/sys/dev/jme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 11:33:44 -0000 Author: glebius Date: Wed Sep 24 11:33:43 2014 New Revision: 272066 URL: http://svnweb.freebsd.org/changeset/base/272066 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/jme/if_jme.c Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Wed Sep 24 11:31:46 2014 (r272065) +++ head/sys/dev/jme/if_jme.c Wed Sep 24 11:33:43 2014 (r272066) @@ -1947,7 +1947,7 @@ jme_watchdog(struct jme_softc *sc) ifp = sc->jme_ifp; if ((sc->jme_flags & JME_FLAG_LINK) == 0) { if_printf(sc->jme_ifp, "watchdog timeout (missed link)\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; jme_init_locked(sc); return; @@ -1962,7 +1962,7 @@ jme_watchdog(struct jme_softc *sc) } if_printf(sc->jme_ifp, "watchdog timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; jme_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -2281,7 +2281,7 @@ jme_link_task(void *arg, int pending) m_freem(txd->tx_m); txd->tx_m = NULL; txd->tx_ndesc = 0; - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } } } @@ -2449,13 +2449,13 @@ jme_txeof(struct jme_softc *sc) break; if ((status & (JME_TD_TMOUT | JME_TD_RETRY_EXP)) != 0) - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); else { - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); if ((status & JME_TD_COLLISION) != 0) - ifp->if_collisions += + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, le32toh(txd->tx_desc->buflen) & - JME_TD_BUF_LEN_MASK; + JME_TD_BUF_LEN_MASK); } /* * Only the first descriptor of multi-descriptor @@ -2526,7 +2526,7 @@ jme_rxeof(struct jme_softc *sc) nsegs = JME_RX_NSEGS(status); sc->jme_cdata.jme_rxlen = JME_RX_BYTES(status) - JME_RX_PAD_BYTES; if ((status & JME_RX_ERR_STAT) != 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); jme_discard_rxbuf(sc, sc->jme_cdata.jme_rx_cons); #ifdef JME_SHOW_ERRORS device_printf(sc->jme_dev, "%s : receive error = 0x%b\n", @@ -2543,7 +2543,7 @@ jme_rxeof(struct jme_softc *sc) mp = rxd->rx_m; /* Add a new receive buffer to the ring. */ if (jme_newbuf(sc, rxd) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); /* Reuse buffer. */ for (; count < nsegs; count++) { jme_discard_rxbuf(sc, cons); @@ -2626,7 +2626,7 @@ jme_rxeof(struct jme_softc *sc) m->m_flags |= M_VLANTAG; } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); /* Pass it on. */ JME_UNLOCK(sc); (*ifp->if_input)(ifp, m); From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 11:58:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A25D669; Wed, 24 Sep 2014 11:58:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5514EE3C; Wed, 24 Sep 2014 11:58:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OBwOB8039472; Wed, 24 Sep 2014 11:58:24 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OBwObo039471; Wed, 24 Sep 2014 11:58:24 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409241158.s8OBwObo039471@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 24 Sep 2014 11:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272067 - head/sys/dev/txp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 11:58:24 -0000 Author: glebius Date: Wed Sep 24 11:58:23 2014 New Revision: 272067 URL: http://svnweb.freebsd.org/changeset/base/272067 Log: - Provide txp_get_counter() to return counters that are not collected, but taken from hardware. - Mechanically convert to if_inc_counter() the rest of counters. Modified: head/sys/dev/txp/if_txp.c Modified: head/sys/dev/txp/if_txp.c ============================================================================== --- head/sys/dev/txp/if_txp.c Wed Sep 24 11:33:43 2014 (r272066) +++ head/sys/dev/txp/if_txp.c Wed Sep 24 11:58:23 2014 (r272067) @@ -149,6 +149,7 @@ static int txp_intr(void *); static void txp_int_task(void *, int); static void txp_tick(void *); static int txp_ioctl(struct ifnet *, u_long, caddr_t); +static uint64_t txp_get_counter(struct ifnet *, ift_counter); static void txp_start(struct ifnet *); static void txp_start_locked(struct ifnet *); static int txp_encap(struct txp_softc *, struct txp_tx_ring *, struct mbuf **); @@ -413,6 +414,7 @@ txp_attach(device_t dev) ifp->if_ioctl = txp_ioctl; ifp->if_start = txp_start; ifp->if_init = txp_init; + ifp->if_get_counter = txp_get_counter; ifp->if_snd.ifq_drv_maxlen = TX_ENTRIES - 1; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); @@ -2540,7 +2542,7 @@ txp_watchdog(struct txp_softc *sc) ifp = sc->sc_ifp; if_printf(ifp, "watchdog timeout -- resetting\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); txp_stop(sc); txp_init_locked(sc); } @@ -2816,13 +2818,11 @@ out: static void txp_stats_update(struct txp_softc *sc, struct txp_rsp_desc *rsp) { - struct ifnet *ifp; struct txp_hw_stats *ostats, *stats; struct txp_ext_desc *ext; TXP_LOCK_ASSERT(sc); - ifp = sc->sc_ifp; ext = (struct txp_ext_desc *)(rsp + 1); ostats = &sc->sc_ostats; stats = &sc->sc_stats; @@ -2856,15 +2856,34 @@ txp_stats_update(struct txp_softc *sc, s le32toh(ext[4].ext_3); stats->rx_oflows = ostats->rx_oflows + le32toh(ext[4].ext_4); stats->rx_filtered = ostats->rx_filtered + le32toh(ext[5].ext_1); +} - ifp->if_ierrors = stats->rx_fifo_oflows + stats->rx_badssd + - stats->rx_crcerrs + stats->rx_lenerrs + stats->rx_oflows; - ifp->if_oerrors = stats->tx_deferred + stats->tx_carrier_lost + - stats->tx_fifo_underruns + stats->tx_mcast_oflows; - ifp->if_collisions = stats->tx_late_colls + stats->tx_multi_colls + - stats->tx_excess_colls; - ifp->if_opackets = stats->tx_frames; - ifp->if_ipackets = stats->rx_frames; +static uint64_t +txp_get_counter(struct ifnet *ifp, ift_counter cnt) +{ + struct txp_softc *sc; + struct txp_hw_stats *stats; + + sc = if_getsoftc(ifp); + stats = &sc->sc_stats; + + switch (cnt) { + case IFCOUNTER_IERRORS: + return (stats->rx_fifo_oflows + stats->rx_badssd + + stats->rx_crcerrs + stats->rx_lenerrs + stats->rx_oflows); + case IFCOUNTER_OERRORS: + return (stats->tx_deferred + stats->tx_carrier_lost + + stats->tx_fifo_underruns + stats->tx_mcast_oflows); + case IFCOUNTER_COLLISIONS: + return (stats->tx_late_colls + stats->tx_multi_colls + + stats->tx_excess_colls); + case IFCOUNTER_OPACKETS: + return (stats->tx_frames); + case IFCOUNTER_IPACKETS: + return (stats->rx_frames); + default: + return (if_get_counter_default(ifp, cnt)); + } } #define TXP_SYSCTL_STAT_ADD32(c, h, n, p, d) \ From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 12:19:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CF72F96; Wed, 24 Sep 2014 12:19:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CF82139; Wed, 24 Sep 2014 12:19:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OCJ1Ch049263; Wed, 24 Sep 2014 12:19:01 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OCJ1x4049262; Wed, 24 Sep 2014 12:19:01 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409241219.s8OCJ1x4049262@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 24 Sep 2014 12:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272068 - head/sys/dev/wi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 12:19:01 -0000 Author: glebius Date: Wed Sep 24 12:19:00 2014 New Revision: 272068 URL: http://svnweb.freebsd.org/changeset/base/272068 Log: - Provide wi_get_counter() to return counters that are not collected, but taken from hardware. - Mechanically convert to if_inc_counter() the rest of counters. Modified: head/sys/dev/wi/if_wi.c Modified: head/sys/dev/wi/if_wi.c ============================================================================== --- head/sys/dev/wi/if_wi.c Wed Sep 24 11:58:23 2014 (r272067) +++ head/sys/dev/wi/if_wi.c Wed Sep 24 12:19:00 2014 (r272068) @@ -132,6 +132,7 @@ static int wi_reset(struct wi_softc *); static void wi_watchdog(void *); static int wi_ioctl(struct ifnet *, u_long, caddr_t); static void wi_media_status(struct ifnet *, struct ifmediareq *); +static uint64_t wi_get_counter(struct ifnet *, ift_counter); static void wi_rx_intr(struct wi_softc *); static void wi_tx_intr(struct wi_softc *); @@ -337,6 +338,7 @@ wi_attach(device_t dev) ifp->if_ioctl = wi_ioctl; ifp->if_start = wi_start; ifp->if_init = wi_init; + ifp->if_get_counter = wi_get_counter; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; IFQ_SET_READY(&ifp->if_snd); @@ -1028,7 +1030,7 @@ wi_start_locked(struct ifnet *ifp) continue; sc->sc_txnext = cur = (cur + 1) % sc->sc_ntxbuf; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } } @@ -1055,7 +1057,7 @@ wi_start_tx(struct ifnet *ifp, struct wi || wi_mwrite_bap(sc, fid, off, m0, m0->m_pkthdr.len) != 0; m_freem(m0); if (error) { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return -1; } sc->sc_txd[cur].d_len = off; @@ -1182,7 +1184,7 @@ wi_watchdog(void *arg) if (sc->sc_tx_timer && --sc->sc_tx_timer == 0) { if_printf(ifp, "device timeout\n"); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); wi_init_locked(ifp->if_softc); return; } @@ -1327,7 +1329,7 @@ wi_rx_intr(struct wi_softc *sc) /* First read in the frame header */ if (wi_read_bap(sc, fid, 0, &frmhdr, sizeof(frmhdr))) { CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_RX); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); DPRINTF(("wi_rx_intr: read fid %x failed\n", fid)); return; } @@ -1338,7 +1340,7 @@ wi_rx_intr(struct wi_softc *sc) status = le16toh(frmhdr.wi_status); if (status & WI_STAT_ERRSTAT) { CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_RX); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); DPRINTF(("wi_rx_intr: fid %x error status %x\n", fid, status)); return; } @@ -1353,7 +1355,7 @@ wi_rx_intr(struct wi_softc *sc) if (off + len > MCLBYTES) { if (ic->ic_opmode != IEEE80211_M_MONITOR) { CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_RX); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); DPRINTF(("wi_rx_intr: oversized packet\n")); return; } else @@ -1366,7 +1368,7 @@ wi_rx_intr(struct wi_softc *sc) m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_RX); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); DPRINTF(("wi_rx_intr: MGET failed\n")); return; } @@ -1450,11 +1452,9 @@ wi_tx_ex_intr(struct wi_softc *sc) printf(", status=0x%x", status); printf("\n"); } - ifp->if_oerrors++; - } else { + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + } else DPRINTF(("port disconnected\n")); - ifp->if_collisions++; /* XXX */ - } } else DPRINTF(("wi_tx_ex_intr: read fid %x failed\n", fid)); CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_TX_EXC); @@ -1497,8 +1497,7 @@ wi_tx_intr(struct wi_softc *sc) static __noinline void wi_info_intr(struct wi_softc *sc) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic = sc->sc_ifp->if_l2com; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); int i, fid, len, off; u_int16_t ltbuf[2]; @@ -1562,9 +1561,6 @@ wi_info_intr(struct wi_softc *sc) #endif *ptr += stat; } - ifp->if_collisions = sc->sc_stats.wi_tx_single_retries + - sc->sc_stats.wi_tx_multi_retries + - sc->sc_stats.wi_tx_retry_limit; break; default: DPRINTF(("wi_info_intr: got fid %x type %x len %d\n", fid, @@ -1575,6 +1571,23 @@ finish: CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_INFO); } +static uint64_t +wi_get_counter(struct ifnet *ifp, ift_counter cnt) +{ + struct wi_softc *sc; + + sc = if_getsoftc(ifp); + + switch (cnt) { + case IFCOUNTER_COLLISIONS: + return (sc->sc_stats.wi_tx_single_retries + + sc->sc_stats.wi_tx_multi_retries + + sc->sc_stats.wi_tx_retry_limit); + default: + return (if_get_counter_default(ifp, cnt)); + } +} + static int wi_write_multi(struct wi_softc *sc) { From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 12:39:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DB8876E; Wed, 24 Sep 2014 12:39:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 593603E8; Wed, 24 Sep 2014 12:39:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OCdDWp058742; Wed, 24 Sep 2014 12:39:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OCdDSq058741; Wed, 24 Sep 2014 12:39:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409241239.s8OCdDSq058741@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 24 Sep 2014 12:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272069 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 12:39:13 -0000 Author: kib Date: Wed Sep 24 12:39:12 2014 New Revision: 272069 URL: http://svnweb.freebsd.org/changeset/base/272069 Log: Switch the defaults to not split the RLIMIT_STACK-sized initial thread stack into the stacks of the created threads. Add knob LIBPTHREAD_SPLITSTACK_MAIN to restore the older behaviour. Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/lib/libthr/thread/thr_init.c Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Wed Sep 24 12:19:00 2014 (r272068) +++ head/lib/libthr/thread/thr_init.c Wed Sep 24 12:39:12 2014 (r272069) @@ -445,7 +445,7 @@ init_private(void) struct rlimit rlim; size_t len; int mib[2]; - char *env; + char *env, *env_bigstack, *env_splitstack; _thr_umutex_init(&_mutex_static_lock); _thr_umutex_init(&_cond_static_lock); @@ -473,8 +473,9 @@ init_private(void) len = sizeof (_usrstack); if (sysctl(mib, 2, &_usrstack, &len, NULL, 0) == -1) PANIC("Cannot get kern.usrstack from sysctl"); - env = getenv("LIBPTHREAD_BIGSTACK_MAIN"); - if (env != NULL) { + env_bigstack = getenv("LIBPTHREAD_BIGSTACK_MAIN"); + env_splitstack = getenv("LIBPTHREAD_SPLITSTACK_MAIN"); + if (env_bigstack != NULL || env_splitstack == NULL) { if (getrlimit(RLIMIT_STACK, &rlim) == -1) PANIC("Cannot get stack rlimit"); _thr_stack_initial = rlim.rlim_cur; From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 12:41:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB335952; Wed, 24 Sep 2014 12:41:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB12F674; Wed, 24 Sep 2014 12:41:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OCfdrU062007; Wed, 24 Sep 2014 12:41:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OCfdQO062006; Wed, 24 Sep 2014 12:41:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409241241.s8OCfdQO062006@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 24 Sep 2014 12:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272070 - head/lib/libthr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 12:41:40 -0000 Author: kib Date: Wed Sep 24 12:41:39 2014 New Revision: 272070 URL: http://svnweb.freebsd.org/changeset/base/272070 Log: Expand the libthr(3) manpage to document knobs accepted by libthr.so and explain some internal working of the library, neccessary to understand the knobs effects. Reviewed by: bjk, pluknet Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/lib/libthr/libthr.3 Modified: head/lib/libthr/libthr.3 ============================================================================== --- head/lib/libthr/libthr.3 Wed Sep 24 12:39:12 2014 (r272069) +++ head/lib/libthr/libthr.3 Wed Sep 24 12:41:39 2014 (r272070) @@ -1,6 +1,11 @@ .\" Copyright (c) 2005 Robert N. M. Watson +.\" Copyright (c) 2014 The FreeBSD Foundation, Inc. .\" All rights reserved. .\" +.\" Part of this documentation was written by +.\" Konstantin Belousov 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: @@ -24,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 19, 2007 +.Dd September 20, 2014 .Dt LIBTHR 3 .Os .Sh NAME @@ -45,8 +50,216 @@ has been optimized for use by applicatio semantics, and can provide significant performance improvements compared to .Lb libkse . +.Pp +The library is tightly integrated with the run-time link editor +.Xr ld-elf.so.1 1 +and +.Lb libc ; +all three components must be built from the same source tree. +Mixing +.Li libc +and +.Nm +libraries from different versions of +.Fx +is not supported. +The run-time linker +.Xr ld-elf.so.1 1 +has some code to ensure backward-compatibility with older versions of +.Nm . +.Pp +The man page documents the quirks and tunables of the +.Nm . +When linking with +.Li -lpthread , +the run-time dependency +.Li libthr.so.3 +is recorded in the produced object. +.Sh MUTEX ACQUISITION +A locked mutex (see +.Xr pthread_mutex_lock 3 ) +is represented by a volatile variable of type +.Dv lwpid_t , +which records the global system identifier of the thread +owning the lock. +.Nm +performs a contested mutex acquisition in three stages, each of which +is more resource-consuming than the previous. +.Pp +First, a spin loop +is performed, where the library attempts to acquire the lock by +.Xr atomic 9 +operations. +The loop count is controlled by the +.Ev LIBPTHREAD_SPINLOOPS +environment variable, with a default value of 2000. +.Pp +If the spin loop +was unable to acquire the mutex, a yield loop +is executed, performing the same +.Xr atomic 9 +acquisition attempts as the spin loop, +but each attempt is followed by a yield of the CPU time +of the thread using the +.Xr sched_yield 2 +syscall. +By default, the yield loop +is not executed. +This is controlled by the +.Ev LIBPTHREAD_YIELDLOOPS +environment variable. +.Pp +If both the spin and yield loops +failed to acquire the lock, the thread is taken off the CPU and +put to sleep in the kernel with the +.Xr umtx 2 +syscall. +The kernel wakes up a thread and hands the ownership of the lock to +the woken thread when the lock becomes available. +.Sh THREAD STACKS +Each thread is provided with a private user-mode stack area +used by the C runtime. +The size of the main (initial) thread stack is set by the kernel, and is +controlled by the +.Dv RLIMIT_STACK +process resource limit (see +.Xr getrlimit 2 ) . +.Pp +By default, the main thread's stack size is equal to the value of +.Dv RLIMIT_STACK +for the process. +If the +.Ev LIBPTHREAD_SPLITSTACK_MAIN +environment variable is present in the process environment +(its value does not matter), +the main thread's stack is reduced to 4MB on 64bit architectures, and to +2MB on 32bit architectures, when the threading library is initialized. +The rest of the address space area which has been reserved by the +kernel for the initial process stack is used for non-initial thread stacks +in this case. +The presence of the +.Ev LIBPTHREAD_BIGSTACK_MAIN +environment variable overrides +.Ev LIBPTHREAD_SPLITSTACK_MAIN ; +it is kept for backward-compatibility. +.Pp +The size of stacks for threads created by the process at run-time +with the +.Xr pthread_create 3 +call is controlled by thread attributes: see +.Xr pthread_attr 3 , +in particular, the +.Xr pthread_attr_setstacksize 3 , +.Xr pthread_attr_setguardsize 3 +and +.Xr pthread_attr_setstackaddr 3 +functions. +If no attributes for the thread stack size are specified, the default +non-initial thread stack size is 2MB for 64bit architectures, and 1MB +for 32bit architectures. +.Sh RUN-TIME SETTINGS +The following environment variables are recognized by +.Nm +and adjust the operation of the library at run-time: +.Bl -tag -width LIBPTHREAD_SPLITSTACK_MAIN +.It Ev LIBPTHREAD_BIGSTACK_MAIN +Disables the reduction of the initial thread stack enabled by +.Ev LIBPTHREAD_SPLITSTACK_MAIN . +.It Ev LIBPTHREAD_SPLITSTACK_MAIN +Causes a reduction of the initial thread stack, as described in the +section +.Sx THREAD STACKS . +This was the default behaviour of +.Nm +before +.Fx 11.0 . +.It Ev LIBPTHREAD_SPINLOOPS +The integer value of the variable overrides the default count of +iterations in the +.Li spin loop +of the mutex acquisition. +The default count is 2000, set by the +.Dv MUTEX_ADAPTIVE_SPINS +constant in the +.Nm +sources. +.It Ev LIBPTHREAD_YIELDLOOPS +A non-zero integer value enables the yield loop +in the process of the mutex acquisition. +The value is the count of loop operations. +.It Ev LIBPTHREAD_QUEUE_FIFO +The integer value of the variable specifies how often blocked +threads are inserted at the head of the sleep queue, instead of its tail. +Bigger values reduce the frequency of the FIFO discipline. +The value must be between 0 and 255. +.El +.Sh INTERACTION WITH RUN-TIME LINKER +The +.Nm +library must appear before +.Li libc +in the global order of depended objects. +.Pp +Loading +.Nm +with the +.Xr dlopen 3 +call in the process after the program binary is activated +is not supported, and causes miscellaneous and hard-to-diagnose misbehaviour. +This is due to +.Nm +interposing several important +.Li libc +symbols to provide thread-safe services. +In particular, +.Dv errno +and the locking stubs from +.Li libc +are affected. +This requirement is currently not enforced. +.Pp +If the program loads any modules at run-time, and those modules may require +threading services, the main program binary must be linked with +.Li libpthread , +even if it does not require any services from the library. +.Pp +.Nm +cannot be unloaded; the +.Xr dlclose 3 +function does not perform any action when called with a handle for +.Nm . +One of the reasons is that the interposing of +.Li libc +functions cannot be undone. +.Sh SIGNALS +The implementation also interposes the user-installed +.Xr signal 3 +handlers. +This interposing is done to postpone signal delivery to threads which +entered (libthr-internal) critical sections, where the calling +of the user-provided signal handler is unsafe. +An example of such a situation is owning the internal library lock. +When a signal is delivered while the signal handler cannot be safely +called, the call is postponed and performed until after the exit from +the critical section. +This should be taken into account when interpreting +.Xr ktrace 1 +logs. .Sh SEE ALSO -.Xr pthread 3 +.Xr ktrace 1 , +.Xr ld-elf.so.1 1 , +.Xr getrlimit 2 , +.Xr umtx 2 , +.Xr dlclose 3 , +.Xr dlopen 3 , +.Xr errno 3 , +.Xr getenv 3 , +.Xr libc 3 , +.Xr pthread_attr 3 , +.Xr pthread_attr_setstacksize 3 , +.Xr pthread_create 3 , +.Xr signal 3 , +.Xr atomic 9 .Sh AUTHORS .An -nosplit The From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 14:12:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11A6C780; Wed, 24 Sep 2014 14:12:06 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBEC0196; Wed, 24 Sep 2014 14:12:05 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C8569B97D; Wed, 24 Sep 2014 10:12:04 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r272032 - head/sys/conf Date: Wed, 24 Sep 2014 09:58:07 -0400 Message-ID: <8280436.uSRo73F0Mt@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <20140923184434.GG8870@kib.kiev.ua> References: <201409231704.s8NH4Lcv098184@svn.freebsd.org> <5421BC8E.6000709@FreeBSD.org> <20140923184434.GG8870@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 24 Sep 2014 10:12:04 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bryan Drewery X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 14:12:06 -0000 On Tuesday, September 23, 2014 09:44:34 PM Konstantin Belousov wrote: > On Tue, Sep 23, 2014 at 01:31:42PM -0500, Bryan Drewery wrote: > > On 9/23/2014 1:20 PM, Konstantin Belousov wrote: > > > On Tue, Sep 23, 2014 at 05:04:21PM +0000, Bryan Drewery wrote: > > >> Author: bdrewery > > >> Date: Tue Sep 23 17:04:21 2014 > > >> New Revision: 272032 > > >> URL: http://svnweb.freebsd.org/changeset/base/272032 > > >> > > >> Log: > > >> DEBUG_LOCKS no longer modifies 'struct vnode', nor does fstat(1) use > > >> it. > > >> fstat(1) now uses libprocstat(9). There is no userland impact to > > >> using this.> > > > > DEBUG_VFS_LOCKS does modify KBI of VFS, by adding struct stack to > > > lockmgr, and lockmgr is embedded into each struct vnode. > > > > > > VFS modules, in particular, filesystems, compiled for mismatched > > > kernel WRT DEBUG_VFS_LOCKS, would cause strange breakage. > > > > Well, perhaps the comment needs to be updated to state that > > DEBUG_VFS_LOCKS modifies VFS KBI so any VFS modules will need to > > recompiled. > > > > I did see the stack was moved to lockmgr, but given the use of > > libprocstat, and lockmgr being a kernel struct, I don't think it's worth > > mentioning userland here. > > > > Sound good? > > I agree, I do not think that userland is affected. It is for at least lsof (which does not use libprocstat and cannot easily be adopted to use it exclusively as it pulls a lot more data out than libprocstat exports such as the info about file locks, etc.) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 14:12:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE8C1782; Wed, 24 Sep 2014 14:12:06 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B54A7197; Wed, 24 Sep 2014 14:12:06 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9EEA5B97F; Wed, 24 Sep 2014 10:12:05 -0400 (EDT) From: John Baldwin To: Bryan Drewery Subject: Re: svn commit: r272032 - head/sys/conf Date: Wed, 24 Sep 2014 09:38:37 -0400 Message-ID: <1598020.ur8YbI6DkF@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <201409231704.s8NH4Lcv098184@svn.freebsd.org> References: <201409231704.s8NH4Lcv098184@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 24 Sep 2014 10:12:05 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 14:12:07 -0000 On Tuesday, September 23, 2014 05:04:21 PM Bryan Drewery wrote: > Author: bdrewery > Date: Tue Sep 23 17:04:21 2014 > New Revision: 272032 > URL: http://svnweb.freebsd.org/changeset/base/272032 > > Log: > DEBUG_LOCKS no longer modifies 'struct vnode', nor does fstat(1) use it. > fstat(1) now uses libprocstat(9). There is no userland impact to using > this. As your followup noted, it does change the size of 'struct lock' (and thus 'struct vnode') still. While fstat does not use it for live, it probably still uses it for coredumps. However, lsof uses kvm access, so it will break. I don't think that is worth noting here, but more of an FYI. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 14:23:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F719C2D; Wed, 24 Sep 2014 14:23:45 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80CA02E0; Wed, 24 Sep 2014 14:23:44 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s8OENdYs022052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 24 Sep 2014 17:23:39 +0300 (EEST) (envelope-from kostik@tom.home) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s8OENdYs022052 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s8OENdfa022051; Wed, 24 Sep 2014 17:23:39 +0300 (EEST) (envelope-from kostik) Date: Wed, 24 Sep 2014 17:23:39 +0300 From: Konstantin Belousov To: John Baldwin Subject: Re: svn commit: r272032 - head/sys/conf Message-ID: <20140924142339.GJ8870@kib.kiev.ua> References: <201409231704.s8NH4Lcv098184@svn.freebsd.org> <5421BC8E.6000709@FreeBSD.org> <20140923184434.GG8870@kib.kiev.ua> <8280436.uSRo73F0Mt@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8280436.uSRo73F0Mt@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bryan Drewery X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 14:23:45 -0000 On Wed, Sep 24, 2014 at 09:58:07AM -0400, John Baldwin wrote: > On Tuesday, September 23, 2014 09:44:34 PM Konstantin Belousov wrote: > > On Tue, Sep 23, 2014 at 01:31:42PM -0500, Bryan Drewery wrote: > > > On 9/23/2014 1:20 PM, Konstantin Belousov wrote: > > > > On Tue, Sep 23, 2014 at 05:04:21PM +0000, Bryan Drewery wrote: > > > >> Author: bdrewery > > > >> Date: Tue Sep 23 17:04:21 2014 > > > >> New Revision: 272032 > > > >> URL: http://svnweb.freebsd.org/changeset/base/272032 > > > >> > > > >> Log: > > > >> DEBUG_LOCKS no longer modifies 'struct vnode', nor does fstat(1) use > > > >> it. > > > >> fstat(1) now uses libprocstat(9). There is no userland impact to > > > >> using this.> > > > > > DEBUG_VFS_LOCKS does modify KBI of VFS, by adding struct stack to > > > > lockmgr, and lockmgr is embedded into each struct vnode. > > > > > > > > VFS modules, in particular, filesystems, compiled for mismatched > > > > kernel WRT DEBUG_VFS_LOCKS, would cause strange breakage. > > > > > > Well, perhaps the comment needs to be updated to state that > > > DEBUG_VFS_LOCKS modifies VFS KBI so any VFS modules will need to > > > recompiled. > > > > > > I did see the stack was moved to lockmgr, but given the use of > > > libprocstat, and lockmgr being a kernel struct, I don't think it's worth > > > mentioning userland here. > > > > > > Sound good? > > > > I agree, I do not think that userland is affected. > > It is for at least lsof (which does not use libprocstat and cannot easily be > adopted to use it exclusively as it pulls a lot more data out than libprocstat > exports such as the info about file locks, etc.) We cannot seriously consider the lsof as application which uses stable interfaces. I.e., binary incompatibility for lsof even on the stable branch or on -pX is not an issue. Lsof verifies kernel release name and warns if it differs from the one used at the compilation time, rightfully. From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 14:35:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5161122; Wed, 24 Sep 2014 14:35:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D085D636; Wed, 24 Sep 2014 14:35:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OEZ8G7015050; Wed, 24 Sep 2014 14:35:08 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OEZ85N015049; Wed, 24 Sep 2014 14:35:08 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409241435.s8OEZ85N015049@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 24 Sep 2014 14:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272071 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 14:35:09 -0000 Author: smh Date: Wed Sep 24 14:35:08 2014 New Revision: 272071 URL: http://svnweb.freebsd.org/changeset/base/272071 Log: Fix ticks wrap issue of lowmem test in vm_pageout_scan Reviewed by: jhb (D818) MFC after: 3 days Sponsored by: Multiplay Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/vm/vm_pageout.c Wed Sep 24 14:35:08 2014 (r272071) @@ -916,7 +916,7 @@ vm_pageout_scan(struct vm_domain *vmd, i * some. We rate limit to avoid thrashing. */ if (vmd == &vm_dom[0] && pass > 0 && - lowmem_ticks + (lowmem_period * hz) < ticks) { + (ticks - lowmem_ticks) / hz >= lowmem_period) { /* * Decrease registered cache sizes. */ From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 15:04:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4277770; Wed, 24 Sep 2014 15:04:36 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B6AA9EA; Wed, 24 Sep 2014 15:04:36 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 781CBB995; Wed, 24 Sep 2014 11:04:35 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r272032 - head/sys/conf Date: Wed, 24 Sep 2014 10:58:11 -0400 Message-ID: <18894593.erVri7Abnd@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <20140924142339.GJ8870@kib.kiev.ua> References: <201409231704.s8NH4Lcv098184@svn.freebsd.org> <8280436.uSRo73F0Mt@ralph.baldwin.cx> <20140924142339.GJ8870@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 24 Sep 2014 11:04:35 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bryan Drewery X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 15:04:36 -0000 On Wednesday, September 24, 2014 05:23:39 PM Konstantin Belousov wrote: > On Wed, Sep 24, 2014 at 09:58:07AM -0400, John Baldwin wrote: > > On Tuesday, September 23, 2014 09:44:34 PM Konstantin Belousov wrote: > > > On Tue, Sep 23, 2014 at 01:31:42PM -0500, Bryan Drewery wrote: > > > > On 9/23/2014 1:20 PM, Konstantin Belousov wrote: > > > > > On Tue, Sep 23, 2014 at 05:04:21PM +0000, Bryan Drewery wrote: > > > > >> Author: bdrewery > > > > >> Date: Tue Sep 23 17:04:21 2014 > > > > >> New Revision: 272032 > > > > >> URL: http://svnweb.freebsd.org/changeset/base/272032 > > > > >> > > > > >> Log: > > > > >> DEBUG_LOCKS no longer modifies 'struct vnode', nor does fstat(1) > > > > >> use > > > > >> it. > > > > >> fstat(1) now uses libprocstat(9). There is no userland impact to > > > > >> using this.> > > > > > > > > > > > DEBUG_VFS_LOCKS does modify KBI of VFS, by adding struct stack to > > > > > lockmgr, and lockmgr is embedded into each struct vnode. > > > > > > > > > > VFS modules, in particular, filesystems, compiled for mismatched > > > > > kernel WRT DEBUG_VFS_LOCKS, would cause strange breakage. > > > > > > > > Well, perhaps the comment needs to be updated to state that > > > > DEBUG_VFS_LOCKS modifies VFS KBI so any VFS modules will need to > > > > recompiled. > > > > > > > > I did see the stack was moved to lockmgr, but given the use of > > > > libprocstat, and lockmgr being a kernel struct, I don't think it's > > > > worth > > > > mentioning userland here. > > > > > > > > Sound good? > > > > > > I agree, I do not think that userland is affected. > > > > It is for at least lsof (which does not use libprocstat and cannot easily > > be adopted to use it exclusively as it pulls a lot more data out than > > libprocstat exports such as the info about file locks, etc.) > > We cannot seriously consider the lsof as application which uses > stable interfaces. I.e., binary incompatibility for lsof even > on the stable branch or on -pX is not an issue. > > Lsof verifies kernel release name and warns if it differs from the > one used at the compilation time, rightfully. I don't disagree. Just noting that it is a commonly-used tool that is affected by DEBUG_LOCKS. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 15:11:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D74AACE; Wed, 24 Sep 2014 15:11:53 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 5DF2AAF9; Wed, 24 Sep 2014 15:11:53 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 69A8B6ADF; Wed, 24 Sep 2014 15:11:46 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id A0A8A36A5; Wed, 24 Sep 2014 17:11:46 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Warren Block Subject: Re: svn commit: r271434 - head/etc References: <201409111824.s8BIOGOE078057@svn.freebsd.org> <86bnq6ssdv.fsf@nine.des.no> Date: Wed, 24 Sep 2014 17:11:46 +0200 In-Reply-To: (Warren Block's message of "Tue, 23 Sep 2014 09:41:23 -0600 (MDT)") Message-ID: <86r3z1f3yl.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warren Block X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 15:11:53 -0000 Warren Block writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Non-bikesheddy: the first line is wrong. > Could you be more specific about that? It is an abbreviated form of > "Links to security advisories and errata are available at". Maybe you > mean that it does not link directly to the security advisories? Precisely - the correct link for security information is http://security.freebsd.org/ or http://www.freebsd.org/security. Sorry for being somewhat gnomic :) > This was discussed a bit in the threads on -arch. Yes, I know... feel free to ignore the bikesheddy part :) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 15:14:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D995CC32; Wed, 24 Sep 2014 15:14:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B468DB12; Wed, 24 Sep 2014 15:14:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OFE2k6033483; Wed, 24 Sep 2014 15:14:02 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OFE2c8033482; Wed, 24 Sep 2014 15:14:02 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409241514.s8OFE2c8033482@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 24 Sep 2014 15:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272072 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 15:14:03 -0000 Author: marcel Date: Wed Sep 24 15:14:01 2014 New Revision: 272072 URL: http://svnweb.freebsd.org/changeset/base/272072 Log: Fix the creation of the L2 cluster table for version 1. The blkofs variable was assigned the image offset in bytes and not in blocks (i.e. sectors). This had image_data() return FALSE, which meant that we didn't assign a cluster when we needed and also meant that we didn't write parts of the L2 table when we should have. The result being that the actual data clusters were written at the wrong offset. Improve support for QCOW version 2. We're having the right layout and even know how many refcnt blocks we need. All we need to do is populate the refcnt blocks for every cluster we write and allocate a cluster when we need a new refcnt block. The allocation part is tricky in that it'll interleave with the assignment of clusters to L2 tables and data. Since version 2 is not quite done, keep it compiled out for now. Modified: head/usr.bin/mkimg/qcow.c Modified: head/usr.bin/mkimg/qcow.c ============================================================================== --- head/usr.bin/mkimg/qcow.c Wed Sep 24 14:35:08 2014 (r272071) +++ head/usr.bin/mkimg/qcow.c Wed Sep 24 15:14:01 2014 (r272072) @@ -46,6 +46,10 @@ __FBSDID("$FreeBSD$"); #define QCOW1_CLSTR_LOG2SZ 12 /* 4KB */ #define QCOW2_CLSTR_LOG2SZ 16 /* 64KB */ +/* Flag bits in cluster offsets */ +#define QCOW_CLSTR_COMPRESSED (1ULL << 62) +#define QCOW_CLSTR_COPIED (1ULL << 63) + struct qcow_header { uint32_t magic; #define QCOW_MAGIC 0x514649fb @@ -90,7 +94,7 @@ round_clstr(uint64_t ofs) static int qcow_resize(lba_t imgsz, u_int version) { - uint64_t clstrsz, imagesz; + uint64_t imagesz; switch (version) { case QCOW_VERSION_1: @@ -103,12 +107,11 @@ qcow_resize(lba_t imgsz, u_int version) return (EDOOFUS); } - clstrsz = 1UL << clstr_log2sz; imagesz = round_clstr(imgsz * secsz); if (verbose) - fprintf(stderr, "QCOW: image size = %ju, cluster size = %ju\n", - (uintmax_t)imagesz, (uintmax_t)clstrsz); + fprintf(stderr, "QCOW: image size = %ju, cluster size = %u\n", + (uintmax_t)imagesz, (u_int)(1U << clstr_log2sz)); return (image_set_size(imagesz / secsz)); } @@ -135,24 +138,45 @@ qcow_write(int fd, u_int version) struct qcow_header *hdr; uint64_t *l1tbl, *l2tbl; uint16_t *rctbl; - uint64_t n, clstrsz, imagesz, nclstrs; - uint64_t l1ofs, l2ofs, ofs, rcofs; - lba_t blk, blkofs, blkcnt, imgsz; - u_int l1idx, l2idx, l2clstrs; + uint64_t clstr_imgsz, clstr_l2tbls, clstr_l1tblsz; + uint64_t clstr_rcblks, clstr_rctblsz; + uint64_t n, imagesz, nclstrs, ofs, ofsflags; + lba_t blk, blkofs, blk_imgsz; + u_int l1clno, l2clno, rcclno; + u_int blk_clstrsz; + u_int clstrsz, l1idx, l2idx; int error; if (clstr_log2sz == 0) return (EDOOFUS); - clstrsz = 1UL << clstr_log2sz; - blkcnt = clstrsz / secsz; - imgsz = image_get_size(); - imagesz = imgsz * secsz; - nclstrs = imagesz >> clstr_log2sz; - l2clstrs = (nclstrs * 8 + clstrsz - 1) > clstr_log2sz; + clstrsz = 1U << clstr_log2sz; + blk_clstrsz = clstrsz / secsz; + blk_imgsz = image_get_size(); + imagesz = blk_imgsz * secsz; + clstr_imgsz = imagesz >> clstr_log2sz; + clstr_l2tbls = round_clstr(clstr_imgsz * 8) >> clstr_log2sz; + clstr_l1tblsz = round_clstr(clstr_l2tbls * 8) >> clstr_log2sz; + nclstrs = clstr_imgsz + clstr_l2tbls + clstr_l1tblsz + 1; + clstr_rcblks = clstr_rctblsz = 0; + do { + n = clstr_rcblks + clstr_rctblsz; + clstr_rcblks = round_clstr((nclstrs + n) * 2) >> clstr_log2sz; + clstr_rctblsz = round_clstr(clstr_rcblks * 8) >> clstr_log2sz; + } while (n < (clstr_rcblks + clstr_rctblsz)); + + /* + * We got all the sizes in clusters. Start the layout. + * 0 - header + * 1 - L1 table + * 2 - RC table (v2 only) + * 3 - First RC block (v2 only) + * 4 - L2 tables + * n - data + */ - l1ofs = clstrsz; - rcofs = round_clstr(l1ofs + l2clstrs * 8); + l1clno = 1; + rcclno = 0; hdr = calloc(1, clstrsz); if (hdr == NULL) @@ -163,18 +187,21 @@ qcow_write(int fd, u_int version) be64enc(&hdr->disk_size, imagesz); switch (version) { case QCOW_VERSION_1: - l2ofs = rcofs; /* No reference counting. */ + ofsflags = 0; + l2clno = l1clno + clstr_l1tblsz; hdr->u.v1.clstr_log2sz = clstr_log2sz; hdr->u.v1.l2_log2sz = clstr_log2sz - 3; - be64enc(&hdr->u.v1.l1_offset, l1ofs); + be64enc(&hdr->u.v1.l1_offset, clstrsz * l1clno); break; case QCOW_VERSION_2: - l2ofs = round_clstr(rcofs + (nclstrs + l2clstrs) * 2); + ofsflags = QCOW_CLSTR_COPIED; + rcclno = l1clno + clstr_l1tblsz; + l2clno = rcclno + clstr_rctblsz + 1; be32enc(&hdr->clstr_log2sz, clstr_log2sz); - be32enc(&hdr->u.v2.l1_entries, l2clstrs); - be64enc(&hdr->u.v2.l1_offset, l1ofs); - be64enc(&hdr->u.v2.refcnt_offset, rcofs); - be32enc(&hdr->u.v2.refcnt_entries, l2clstrs); + be32enc(&hdr->u.v2.l1_entries, clstr_l2tbls); + be64enc(&hdr->u.v2.l1_offset, clstrsz * l1clno); + be64enc(&hdr->u.v2.refcnt_offset, clstrsz * rcclno); + be32enc(&hdr->u.v2.refcnt_entries, clstr_rcblks); break; default: return (EDOOFUS); @@ -183,27 +210,27 @@ qcow_write(int fd, u_int version) l2tbl = l1tbl = NULL; rctbl = NULL; - l1tbl = calloc(1, (size_t)(rcofs - l1ofs)); + l1tbl = calloc(1, clstrsz * clstr_l1tblsz); if (l1tbl == NULL) { error = ENOMEM; goto out; } - if (l2ofs != rcofs) { - rctbl = calloc(1, (size_t)(l2ofs - rcofs)); + if (rcclno > 0) { + rctbl = calloc(1, clstrsz * clstr_rctblsz); if (rctbl == NULL) { error = ENOMEM; goto out; } } - ofs = l2ofs; - for (n = 0; n < nclstrs; n++) { + ofs = clstrsz * l2clno; + for (n = 0; n < clstr_imgsz; n++) { l1idx = n >> (clstr_log2sz - 3); if (l1tbl[l1idx] != 0UL) continue; - blk = n * blkcnt; - if (image_data(blk, blkcnt)) { - be64enc(l1tbl + l1idx, ofs); + blk = n * blk_clstrsz; + if (image_data(blk, blk_clstrsz)) { + be64enc(l1tbl + l1idx, ofs + ofsflags); ofs += clstrsz; } } @@ -211,9 +238,15 @@ qcow_write(int fd, u_int version) error = 0; if (!error && sparse_write(fd, hdr, clstrsz) < 0) error = errno; - if (!error && sparse_write(fd, l1tbl, (size_t)(rcofs - l1ofs)) < 0) + if (!error && sparse_write(fd, l1tbl, clstrsz * clstr_l1tblsz) < 0) error = errno; - /* XXX refcnt table. */ + if (rcclno > 0) { + if (!error && + sparse_write(fd, rctbl, clstrsz * clstr_rctblsz) < 0) + error = errno; + if (!error && sparse_write(fd, rctbl, clstrsz) < 0) + error = errno; + } if (error) goto out; @@ -230,17 +263,17 @@ qcow_write(int fd, u_int version) goto out; } - for (l1idx = 0; l1idx < l2clstrs; l1idx++) { + for (l1idx = 0; l1idx < clstr_l2tbls; l1idx++) { if (l1tbl[l1idx] == 0) continue; memset(l2tbl, 0, clstrsz); - blkofs = (lba_t)l1idx * (clstrsz * (clstrsz >> 3)); + blkofs = (lba_t)l1idx * blk_clstrsz * (clstrsz >> 3); for (l2idx = 0; l2idx < (clstrsz >> 3); l2idx++) { - blk = blkofs + (lba_t)l2idx * blkcnt; - if (blk >= imgsz) + blk = blkofs + (lba_t)l2idx * blk_clstrsz; + if (blk >= blk_imgsz) break; - if (image_data(blk, blkcnt)) { - be64enc(l2tbl + l2idx, ofs); + if (image_data(blk, blk_clstrsz)) { + be64enc(l2tbl + l2idx, ofs + ofsflags); ofs += clstrsz; } } @@ -256,10 +289,10 @@ qcow_write(int fd, u_int version) l1tbl = NULL; error = 0; - for (n = 0; n < nclstrs; n++) { - blk = n * blkcnt; - if (image_data(blk, blkcnt)) { - error = image_copyout_region(fd, blk, blkcnt); + for (n = 0; n < clstr_imgsz; n++) { + blk = n * blk_clstrsz; + if (image_data(blk, blk_clstrsz)) { + error = image_copyout_region(fd, blk, blk_clstrsz); if (error) break; } From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 15:15:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07C35DC5; Wed, 24 Sep 2014 15:15:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4C36B27; Wed, 24 Sep 2014 15:15:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OFFFY5033728; Wed, 24 Sep 2014 15:15:15 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OFFE9O033721; Wed, 24 Sep 2014 15:15:14 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409241515.s8OFFE9O033721@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 24 Sep 2014 15:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272073 - head/usr.bin/mkimg/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 15:15:16 -0000 Author: marcel Date: Wed Sep 24 15:15:14 2014 New Revision: 272073 URL: http://svnweb.freebsd.org/changeset/base/272073 Log: Update the baseline for QCOW version 1. A bug was found that rendered the baseline invalid. Modified: head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow.gz.uu head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow.gz.uu head/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow.gz.uu head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu head/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow.gz.uu head/usr.bin/mkimg/tests/img-1x1-4096-pc98.qcow.gz.uu head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.qcow.gz.uu head/usr.bin/mkimg/tests/img-1x1-512-apm.qcow.gz.uu head/usr.bin/mkimg/tests/img-1x1-512-bsd.qcow.gz.uu head/usr.bin/mkimg/tests/img-1x1-512-ebr.qcow.gz.uu head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu head/usr.bin/mkimg/tests/img-1x1-512-mbr.qcow.gz.uu head/usr.bin/mkimg/tests/img-1x1-512-pc98.qcow.gz.uu head/usr.bin/mkimg/tests/img-1x1-512-vtoc8.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-apm.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-bsd.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-ebr.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-mbr.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-apm.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-bsd.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-ebr.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-mbr.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-pc98.qcow.gz.uu head/usr.bin/mkimg/tests/img-63x255-512-vtoc8.qcow.gz.uu Modified: head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow.gz.uu Wed Sep 24 15:14:01 2014 (r272072) +++ head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow.gz.uu Wed Sep 24 15:15:14 2014 (r272073) @@ -1,60 +1,127 @@ # $FreeBSD$ begin 644 img-1x1-4096-apm.qcow.gz -M'XL("+-D'U0``VEM9RTQ>#$M-#`Y-BUA<&TN<6-O=RYO=70`K9Q+CQO'&47W -M^A6=K8$(O%75C]K%ABT@"P-*C*R=>C5@P(^!8R`;_7B30S)#SMRK.XHT(@8: -M$-^'[N;A@3`Z[,/A_#5-,Z:T3"E/>YV./U\>F&Y^N'],'_[Q[N]O;[\^O#DO -MP^$C4\]^3F'"9=W=KF^>UH735)L.^17KC@^Z[N;HXB<V_.ZA4Y! -MK0MTW?2_=2N=BFI=NEMW>'L%^KINHU.".UCN,IT2W,%R5^B4X`Z6NTJG!'>P -MW#4Z);B#Y:[3*<%=L-P-.B6X"Y:[G4X)[H+C#GQ*8[Y+B+CGN`O-=4MPEQUU@ -MODN*N]EQ%YCO9L7=[+@+S'>SXFZVW#'?S8J[V7+'?#9[Q;%W>JXB\QWJ^)N==Q% -MYKM5<;=:[ICO5L7=:KECOEL5=ZOECOEN5=RMECOFNU5QMUKNF.]6Q=UJN6.^ -M6Q5WF^6.^6Y3W&V6.^:[37&W.>X2GQ+<;8Z[Q'RW*>XVQUUBOML4=YOC+C'? -M;8J[S7&7F.\VQ=WFN$O,=YOB[OKK;[V.^2XK[K+C+C'?9<5=MMPQWV7%7;;< -M,=]EQ5VVW#'?9<5=MMPQWV7%7;;<,=]EQ5VVW#'?9<5=L=PQWQ7%7;'<,=\5 -MQ5UQW,U\2G!7''^JXJY:[ICOJN*N6NZ8[ZKBKEKNF.^JXJY:[ICO -MJN*N6NZ8[ZKBKEKNF.^JXJY9[ICOFN*N6>Z8[YKBKCGN%CXEN&N.NX7YKBGN -MFN-N8;YKBKOFN%N8[YKBKCGN%N:[IKAKCKN%^:XI[KKC;F&^ZXJ[[KA;F.^Z -MXJY;[ICONN*N6^Z8[[KBKEONF.^ZXJY;[ICONN*N6^Z8[[KBKEONF.^ZXFY8 -M[ICOAN)N6.Z8[X;B;CCN5CXEN!N.NY7Y;BCNAN-N9;X;BKOAN%N9[X;B;CCN -M5N:[H;@;CKN5^6XH[G;'W[XFZW -MW#'?[8J[W7+'?+_Z'7$=S@([G"PW!'?X2"X -MP\%QM_$ISAUL?[<1WT'U=[#]W49\!]7?P?9W&_$=5'\'V]]MQ'=0_1UL?[<1 -MWT'U=[#]W49\!]7?P?9W&_$=5'\'V]]MQ'=0_1UL?[<1WT'U=[#]W49\!]7? -MP?9W&_$=5'\'V]]MQ'=0_1UL?[<1WT'U=[#]W<9\I_H[V/YN8[Y3_1UL?Y?Y -ME.#.]G>9^4[U=[#]76:^4_T=;'^7F>]4?P?;WV7F.]7?P?9WF?E.]7>P_5UF -MOE/]'6Q_EYGO5'\'V]]EYCO5W\'V=YGY3O5WL/U=9KY3_1UL?Y>9[U1_!]O? -M9>8[U=_!]G>9^4[U=[#]76:^4_T=;'^7F>]4?P?;WQ4^);BS_5UAOE/]'6Q_ -M5YCO5'\'V]\5YCO5W\'V=X7Y3O5WL/U=8;Y3_1UL?U>8[U1_!]O?%>8[U=_! -M]G>%^4[U=[#]76&^4_T=;']7F.]4?P?;WQ7F.]7?P?9WA?E.]7>P_5UAOE/] -M'6Q_5YCO5'\'V]\5YCO5W\'V=Y5/">YL?U>9[U1_!]O?5>8[U=_!]G>5^4[U -M=[#]766^4_T=;']7F>]4?P?;WU7F.]7?P?9WE?E.]7>P_5UEOE/]'6Q_5YGO -M5'\'V]]5YCO5W\'V=Y7Y3O5WL/U=9;Y3_1UL?U>9[U1_!]O?5>8[U=_!]G>5 -M^4[U=[#]7>-3@CO;WS7F.]7?P?9WC?E.]7>P_5UCOE/]'6Q_UYCO5'\'V]\U -MYCO5W\'V=XWY3O5WL/U=8[Y3_1UL?]>8[U1_!]O?->8[U=_!]G>-^4[U=[#] -M76.^4_T=;'_7F.]4?P?;WS7F.]7?P?9WC?E.]7>P_5UCOE/]'6Q_U_F4X,[V -M=YWY3O5WL/U=9[Y3_1UL?]>9[U1_!]O?=>8[U=_!]G>=^4[U=[#]76>^4_T= -M;'_7F>]4?P?;WW7F.]7?P?9WG?E.]7>P_5UGOE/]'6Q_UYGO5'\'V]]UYCO5 -MW\'V=YWY3O5WL/U=9[Y3_1UL?]>9[U1_!]O?#3XEN+/]W6"^4_T=;'\WF.]4 -M?P?;WPWF.]7?P?9W@_E.]7>P_=U@OE/]'6Q_-YCO5'\'V]\-YCO5W\'V=X/Y -M3O5WL/W=8+Y3_1UL?S>8[U1_!]O?#>8[U=_!]G>#^4[U=[#]W6"^4_T=;'\W -MF.]4?P?;WPWF.]7?P?9W.Y\2W-G^;F>^4_T=;'^W,]^I_@ZVO]N9[U1_!]O? -M[]VYCO5W\'V=SOSG>KO8/N[G?E.]7>P_=W.?*?Z.]C^;F>^4_T= -M;'^W,]^I_@ZVO]N9[U1_!]O?[]VYCO5WX7K7YZMFY[6$=\=ISAW -MX5E_=[V?WO3$'?%=4/U=>-;?31?NIBMW\7!Z,LW3')YN;74:Q.FCF\_7'9Y. -M]KM_GO;\Y=FUBY]TL\2;=2]?BO/]^>+C_5N.[X+47\S%VX6X?^+#^^_9:QL? -M[]^2'L.LXV,Y_GMU?M7Q??WP\/,@Z[[8[0C/Z^++HYL?W[4+IFD-TYJF)5^^ -M+T<)C-/3EZ/[\:'\_L=/?_STVZ\_7M>=?+STT_#Z*4?W2WF@1\?OS_?_O[;I -ME:_M]5?DUW?&_6M[?6=$^MGMSSJ^QY=C.5WXXPMQ?*0PS7%*:0K]>.#SZ;DY -MOESX[O/?MSZ<7U"S?7[_PFN;U^T^WQT<]&?=;Q -M??3ZK7%:5\+FT_7[SW_/(%Z/[PM?OW2X7+_+YV?OO^LG/KQ_>__GO#`]+GSS -))\E=0RR#5@`` +M'XL("*DS(E0``VEM9RTQ>#$M-#`Y-BUA<&TN<6-O=RYO=70`K9W9CAW9<47? +M^RLN9[(XW8C(D;,$N0$_&&A;T+.4(R!`MA.R`+_PXUW%.D-5W+T9E+NI0H-$ +M(3>R3BTN":W%P_/Y]L?IU,JIZ4[->-KGT_6OTX><[OSB_L?IZ[___*]O[O[X +M^M/MF)R_\Y3[=:,G27/WMGY?Y_3FJ>5T'G]@[OH#SMUY._LGWN[.%WLY=_73 +M[1>+GU,V:/<&3VGNG-Y/R.DU/_9^7]R7*[>G]]M]N4J^W)8-=O<&?TES?TGO +MI^3+[=G<<&_N<%^NDB]W9'/3=V%1`LO,YI9@KH%/K6QN"^9:^-2.Y^0[W]O; +MN0X^)6Q.X=RIS/7P*6-SS;VY\YL,=)X;X%.$.PFY&^%3A#L)N9O@4X0[";F; +MX5.$.PFY6^!3A#L)N5OA4X0[#;G;X%.$.PVYV^%3A#N-N!/\%.%.(^X$^4X9 +M=QIQ)\AWRKC3B#M!OE/&G4;<"?*=,NXTXDZ0[Y1Q9Q%W@GQGC#N+N!/D.V/< +M6<@=\ITQ[BSD#OG.&'<6*GR+<-1%WBGS7,.Z:B#M%OFL8=TW$G2+?-8R[)N). +MD>\:QET3<:?(=PWCKHVX4^2[EG'71MPI\EW+N&M#[I#O6L9=&W*'?-XZR+N +M##]%N.LB[@SYKF/<=1%WAGS7,>ZZB#M#ONL8=UW$G2'?=8R[+N+.D.\ZQET? +M<6?(=SWCKH^X,^2[GG'7A]PAW_6,NS[D#OFN9]SU(7?(=SWCK@^Y0[[K&7=] +MR!WR7<^XZT/ND.]ZQMT0*N0[Y;&'=+Q%V'?+ZVB+L>^6YCW&T1=SWRW<:XVR+N>N2[C7&W1=SUR'<;XVZ/ +MN.N1[W;&W1YQUR/?[8R[/>0.^6YGW.TA=\AW.^-N#[E#OML9=WO('?+=SKC; +M0^Z0[W;&W1YRAWRW$^XD_X3/`=_)F7`GYY`[X#LY$^[D''$WX*LOY.POQN`[X3U=Q+V=P/PG;#^3L+^;@"^$];?2=C?#OO).SO9OP4X2[L[V;D.];?2=C?S]8?R=A?SOO).SO9N0[UM])V-_-R'>LOY.POYN1[UA_)V%_-R/?L?Y.POYN1KYC_9V$ +M_=V,?,?Z.PG[NQGYCO5W$O9W"WZ*OO).SO%N0[UM])V-\MR'>L +MOY.POUN0[UA_)V%_MR#?L?Y.POYN0;YC_9V$_=V"?,?Z.PG[NP7YCO5W$O9W +M"_(=Z^\D[.\6Y#O6WTG8WRW(=ZR_D["_6Y#O6'\G87^W(-^Q_D["_FY!OF/] +MG83]W8)\Q_H["?N[%3]%N`O[NQ7YCO5W$O9W*_(=Z^\D[.]6Y#O6WTG8WZW( +M=ZR_D["_6Y'O6'\G87^W(M^Q_D["_FY%OF/]G83]W8I\Q_H["?N[%?F.]7<2 +M]G]8?R=A?[OO).SO-N0[UM])V-]MR'>LOY.PO]N0[UA_)V%_MR'?L?Y.POYN +MQT\1[L+^;D>^8_V=A/W=CGS'^CL)^[L=^8[U=Q+V=SOR'>OO).SO=N0[UM]) +MV-_MR'>LOY.PO]N1[UA_)V%_MR/?L?Y.POYN1[YC_9V$_=V.?,?Z.PG[NQWY +MCO5W$O9W._(=Z^\D[.]VY#O6WVG^B9L[U3G@N^NG,'?J^KM\G]ZI<@=\IZR_ +M4]??G1)WI\R=G?%3F#MU_=TI<7?Z2YD#OE/6WZGK[TZ'.SM#]]\IZ^_4]7?E +M[.H<\)VR_DY=?P?F@.^4]7?J^CLP!WRGK+]3U]_EN0=U#OA.67^GKK][D.=. +M90[X3EE_IZZ_>Y"X>U"Y`[Y3UM^IZ^\>).X>5.Z`[Y3U=^KZNP?'Q=D!WRGK +M[]3U=^7LZASPG;+^3EU_!^:`[Y3U=^KZ.S`'?*>LOU/7W^6YAW4.^8[U=^KZ +MNX=YKG*'?,?Z.W7]WYBX>UBX0_??*>OOU/5W#P]_ +M=NC^.V7]G;K^KIQ=G4.^8_V=NOX.S"'?L?Y.77\'YI#O6'^GKK_+/\ESA#MU_IZR_4]??/4KHNOP-SR'>LOU/7WX$YY#O6WZGK[_+,\5[E#OF/]G;K^[G'B[G'A#MU_IZR_4]??/4[:YPA^Z_4];?J>OOGB3NGE3ND.]8?Z>NOWN2N'M2N4.^ +M8_V=NO[NR7%Q=LAWK+]3U]^5LZMSR'>LOU/7WX$YY#O6WZGK[\`<\AWK[]3U +M=WGN:9U#OF/]G;K^[FF>J]PAW['^3EU_]S1Q][1PA^Z_4];?J>OOGB;NGA;N +MT/UWROH[=?W=T\.?';K_3EE_IZZ_*V=7YY#O6'^GKK\#<\AWK+]3U]^!.>0[ +MUM^IZ^_RW+,ZAWS'^CMU_=VS/%>X0_??*>OOU/5WSQ)WSRIWR'>LOU/7WSU+ +MW#VKW"'?L?Y.77_W[+@X.^0[UM^IZ^_*V=4YY#O6WZGK[\`<\AWK[]3U=V`. +M^8[U=^KZNSSWO,XAW['^3EU_]SS/5>Z0[UA_IZZ_>YZX>UZX0_??*>OOU/5W +MSQ-WSPMWZ/X[9?V=NO[N^>'/#MU_IZR_4]??E;.K<\AWK+]3U]^!.>0[UM^I +MZ^_`'/(=Z^_4]7=Y[D6=0[YC_9VZ_NY%GBO6YRAWR'>OOU/5W5XF[J\(=NO]. +M67^GKK^[2MQ=%>[0_7?*^CMU_=W5X<\.W7^GK+]3U]^5LZMSR'>LOU/7WX$Y +MY#O6WZGK[\`<\AWK[]3U=WGN99U#OF/]G;K^[F6>*]RA^^^4]7?J^KN7B;N7 +ME3OD.];?J>OO7B;N7E;ND.]8?Z>NOWMY7)P=\AWK[]3U=^7LZASR'>OOU/5W +M8`[YCO5WZOH[,(=\Q_H[=?U=GGM5YY#O6'^GKK][E>'[K]3UM^IZ^_*V=4YY#O6 +MWZGK[\`<\AWK[]3U=V`.^8[U=^KZNSSWNLXAW['^3EU_]SK/%>[0_7?*^CMU +M_=WKQ-WKRAWR'>OOU/5WKQ-WKRMWR'>LOU/7W[T^+LX.^8[U=^KZNW)V=0[Y +MCO5WZOH[,(=\Q_H[=?T=F$.^8_V=NOXNS[VI<\AWK+_3J+\S=/^=LOY.H_[. +MT/UWROH[C?H[0_??*>OO-.KO#-U_IZR_TZB_,W3_G;+^3J/^SM#]=\KZ.XWZ +M.T/WWRGK[Y3T=V_K'/(=Z^_4]7=O\USA#MU_IZR_4]??O4WVNOP-SR'>LOU/7 +MWX$YY#O6WUG^B9L[USG@.V/]W?4G[G&7_72NW`'?&>OOS/5WY[1W+MRA^^^, +M]7?F^KMSXNYNORMG5^>`[XSU=^;Z.S`' +M?&>LOS/7WX$YX#MC_9VY_B[/29T#OC/6WYGK[R3/%>[0_7?&^CMS_9VDUY/* +M'?"=L?[.7'\GB3NIW`'?&>OOS/5W5 +M.^0[UM^9Z^\L<6>5.^0[UM^9Z^_LN#@[Y#O6WYGK[\K9U3GD.];?F>OOP!SR +M'>OOS/5W8`[YCO5WYOJ[/-?4.>0[UM^9Z^^:/%>Y0[YC_9VY_JY)W#6%.W3_ +MG;'^SEQ_UR3NFL(=NO_.6']GKK]K#G]VZ/X[8_V=N?ZNG%V=0[YC_9VY_@[, +M(=^Q_LYNO\MS;9U#OF/]G;G^KLUSA3MT_YVQ_LYZ.H=\Q_H[<_U=E^X0_??&>OOS/5WW>'/#MU_9ZR_,]??E;.K<\AWK+\SU]^! +M.>0[UM^9Z^_`'/(=Z^_,]7=YKJ]SR'>LOS/7W_5YKG"'[K\SUM^9Z^_ZQ%U? +MN4.^8_V=N?ZN3]SUE3OD.];?F>OO^N/B[)#O6']GKK\K9U?GD.]8?V>NOP-S +MR'>LOS/7WX$YY#O6WYGK[_+<4.>0[UA_9ZZ_&_)OOS/5WY>SJ'/(=Z^_,]7=@ +M#OF.]7?F^CLPAWS'^CMS_5V>>U?GD.]8?V>NOWN7YRIWR'>LOS/7W[U+W+TK +MW*'[[XSU=^;ZNW>)NW>%.W3_G;'^SEQ_]^[P9X?NOS/6WYGK[\K9U3GD.];? +MF>OOP!SR'>OOS/5W8`[YCO5WYOJ[//>^SB'?L?[.7'_W/L\5[M#]=\;Z.W/] +MW?O$W?O*'?(=Z^_,]7?O$W?O*W?(=ZR_,]??O3\NS@[YCO5WYOJ[LOS/7WWW(OOS/5W8`[YCO5WYOH[,(=\Q_H[<_U=GOM8YY#O6']GKK_[F.<*=^C^ +M.V/]G;G^[F/B[F/E#OF.]7?F^KN/B;N/E3OD.];?F>OO/AX79X=\Q_H[<_U= +M.;LZAWS'^CMS_1V80[YC_9VY_@[,(=^Q_LYOOS/5WGX^+LT.^ +M8_V=N?ZNG%V=0[YC_9VY_@[,(=^Q_LY:YR!WQW_13FKG']W9?$W9?,77/&3Y&_]]A]L5]R;_RFS*&_;[L\%#MW\W[-MW#L^J.[_M_3[0^]W^^.XV\;F$-_7_G_Z\N] +MG;/+MVN_6:63TZG74]^[YX?^ +M./BO>K_N!\Y/[YS?[6^2N^=WNOM^Z,]N_;KW^^[Y]7;J>\!F/;__^=];$//[ +C_<;GUYW3^9TG\$_^B:^_O+G_G]O!YMO@3_\'*;=.DB.F```` ` end Modified: head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow.gz.uu Wed Sep 24 15:14:01 2014 (r272072) +++ head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow.gz.uu Wed Sep 24 15:15:14 2014 (r272073) @@ -1,58 +1,125 @@ # $FreeBSD$ begin 644 img-1x1-4096-bsd.qcow.gz -M'XL("+1D'U0``VEM9RTQ>#$M-#`Y-BUB?SMYU\>WKX]?CDOP^F#J;OOU["$ -MR[J;7=^6EW7A::HMI_R)==\_P-:].;KX#X[NSER?!#/WOJYX_OQ[G1Q?O;^O],-XG0WM7"_6?CK9=V?E^,+XG0/M2[=K/OK -M[G2#.-VLUI4/80D"EJK6-;-NI5-=K1MFW4:G)E^'#Z[M>=U.IZ#6T=?MP_*R -M[J!34:U;;]:='JY`7]33@GN@N,.?$IP%QQW8+X+BKO@N`/S75#:[37&W6>Z8[S;%W6:Y8[[;%'>;Y8[Y;E/<;98[YKM- -M<;=9[ICO-L7=9KECOML4=[OECOEN5]SMECOFNUUQMSON(I\2W.V.N\A\MRON -M=L==9+[;%7>[XRXRW^V*N]UQ%YGO=L7=[KB+S'>[XNYPW$7FNT-Q=SCN(O/= -MH;@[+'?,=X?B[K#<,=\=BKO#^2XBXY[E;FNZ2XN_[SMU['?)<5=]EQMS+?9<5=MMPQWV7%7;;<,=]E -MQ5VVW#'?9<5=MMPQWV7%7;;<,=]EQ5VVW#'?9<5=L=PQWQ7%7;'<,=\5Q5UQ -MW&U\2G!7''<;\UU1W!7'W<9\5Q1WQ7&W,=\5Q5UQW&W,=T5Q5QQW&_-=4=Q= -M_QM2KV.^JXJ[ZKC;F.^JXJY:[ICOJN*N6NZ8[ZKBKEKNF.^JXJY:[ICOJN*N -M6NZ8[ZKBKEKNF.^JXJY9[ICOFN*N6>Z8[YKBKCGN=CXEN&N.NYWYKBGNFN-N -M9[YKBKOFN-N9[YKBKCGN=N:[IKAKCKN=^:XI[KKC;F>^ZXJ[[KC;F>^ZXJY; -M[ICONN*N6^Z8[[KBKEONF.^ZXJY;[ICONN*N6^Z8[[KBKEONF.^ZXFY8[ICO -MAN)N6.Z8[X;B;CCN#CXEN!N.NX/Y;BCNAN/N8+X;BKOAN#N8[X;B;CCN#N:[ -MH;@;CKN#^6XH[J;C[F"^FXJ[Z;@[F.^FXFY:[ICOIN)N6NZ8[Z;B;EKNF.^F -MXFY:[ICOIN)N6NZ8[Z;B;EKNF.^FX`[7+_0ZXCNZ([W`2W.'DN$M\ -MBG,'V]\EXCNH_@ZVOTO$=U#]'6Q_EXCOH/H[V/XN$=]!]7>P_5TBOH/J[V#[ -MNT1\!]7?P?9WB?@.JK^#[>\2\1U4?P?;WR7B.ZC^#K:_2\1W4/T=;'^7B.^@ -M^CO8_BX1WT'U=[#]72*^@^KO8/N[Q'RG^CO8_BXQWZG^#K:_RWQ*<&?[N\Q\ -MI_H[V/XN,]^I_@ZVO\O,=ZJ_@^WO,O.=ZN]@^[O,?*?Z.]C^+C/?J?X.MK_+ -MS'>JOX/M[S+SG>KO8/N[S'RG^CO8_BXSWZG^#K:_R\QWJK^#[>\R\YWJ[V#[ -MN\Q\I_H[V/XN,]^I_@ZVO\O,=ZJ_@^WO"I\2W-G^KC#?J?X.MK\KS'>JOX/M -M[PKSG>KO8/N[PGRG^CO8_JXPWZG^#K:_*\QWJK^#[>\*\YWJ[V#[N\)\I_H[ -MV/ZN,-^I_@ZVORO,=ZJ_@^WO"O.=ZN]@^[O"?*?Z.]C^KC#?J?X.MK\KS'>J -MOX/M[PKSG>KO8/N[RJ<$=[:_J\QWJK^#[>\J\YWJ[V#[N\I\I_H[V/ZN,M^I -M_@ZVOZO,=ZJ_@^WO*O.=ZN]@^[O*?*?Z.]C^KC+?J?X.MK^KS'>JOX/M[RKS -MG>KO8/N[RGRG^CO8_JXRWZG^#K:_J\QWJK^#[>\J\YWJ[V#[N\I\I_H[V/ZN -M\2G!G>WO&O.=ZN]@^[O&?*?Z.]C^KC'?J?X.MK]KS'>JOX/M[QKSG>KO8/N[ -MQGRG^CO8_JXQWZG^#K:_:\QWJK^#[>\:\YWJ[V#[N\9\I_H[V/ZN,=^I_@ZV -MOVO,=ZJ_@^WO&O.=ZN]@^[O&?*?Z.]C^KC'?J?X.MK_K?$IP9_N[SGRG^CO8 -M_JXSWZG^#K:_Z\QWJK^#[>\Z\YWJ[V#[N\Y\I_H[V/ZN,]^I_@ZVO^O,=ZJ_ -M@^WO.O.=ZN]@^[O.?*?Z.]C^KC/?J?X.MK_KS'>JOX/M[SKSG>KO8/N[SGRG -M^CO8_JXSWZG^#K:_Z\QWJK^#[>\&GQ+JOX/M[P;SG>KO8/N[P7RG^CO8_FXP -MWZG^#K:_&\QWJK^#[>\&\YWJ[V#[N\%\I_H[V/YN,-^I_@ZVOQO,=ZJ_@^WO -M!O.=ZN]@^[O)IP1WMK^;S'>JOX/M[R;SG>KO8/N[R7RG^CO8_FXRWZG^#K:_ -MF\QWJK^#[>\F\YWJ[V#[N\E\I_H[V/YN,M^I_@ZVOYO,=ZJ_@^WO)O.=ZN]@ -M^[O)?*?Z.]C^;C+?J?X.MK^;S'>JOPO7+^[6+:_KB.^^3W'NPEU_=[V?WO+* -M'?%=4/U=N.OOE@MWRY6[>'IZ<`W/?WGV[K-^X/';P^W[]89Z\?F&*]NQK-NR -M[4L*-\=S?WRO#SS^\=/OY&)$>L.53ZSCUS;2&Z[3T^(JEP<[H?'-_R_G2?)77<_CS>K`OF=)?;=?7#:_OQT7U]?W0L -M$OXO%^/=K3D^^'V_?SPO5YX9>_ -)`=FR!>?A50`` +M'XL("*LS(E0``VEM9RTQ>#$M-#`Y-BUB87<]F9EM\KOD!^OA1*2/=Z??=MM=K8:MBNAFEU.:R^_WK^;JN??G'_^^K;__S7?[_]^=NW/^[& +M;/V+I]*O!U_Y/'=OZQ^K-N=_/75W/7]'9=O-U)S>U_"8L+6`YJ[EC,#?C42<6=\5.".Z^X +M,_*=*^Z\XL[(=ZZX\XH[(]^YXLXK[HQ\YXH[K[@S\ITK[J+BSLAWH;B+BCLC +MWX7B+DKNR'>AN(N2._)=*.ZBY(Y\%XJ[*+DCWX7B+DKNR'>AN(N2._)=*.Z& +MDCORW:"X&TKNR'>#XFZHN'-^2G`W5-PY^6Y0W`T5=TZ^&Q1W0\6=D^\&Q=U0 +M<>?DNT%Q-U3<.?EN4-QM*NZ6W)'O1L7=6'$W\%."N['B;B#? +MC8J[L>)N(-^-BKNQXFX@WXV*N['B;B#?C8J[L>)N(-^-BKOEK[_U'/EN4MQ- +M%7<#^6Y2W$TE=^2[27$WE=R1[R;%W51R1[Z;%'=3R1WY;E+<325WY+M)<3>5 +MW)'O)L7=ON2.?+=7W.U+[LAW>\7=ON)NPT\)[O85=QORW5YQMZ^XVY#O]HJ[ +M?<7=AGRW5]SM*^XVY+N]XFY?<;2 +M._+=07%W*+DCWQT4=X>2._+=07%W*+DCWQT4=X>2._+=07%W*+DCWQT4=\>2 +M._+=47%W++DCWQT5=\>*NRT_);@[5MQMR7='Q=VQXFY+OCLJ[HX5=UORW5%Q +M=ZRXVY+OCHJ[8\7=EGQW5-R=*NZVY+N3XNY4<;2._+=27%W*KDC +MWYT4=Z>2._+=27%W*KDCWYT4=Z>2._+=27%W*KDCWYT4=^>2._+=67%W+KDC +MWYT5=^>*NQT_);@[5]SMR'=GQ=VYXFY'OCLK[LX5=SORW5EQ=ZZXVY'OSHJ[ +M<\7=CGQW5MQ=*NYVY+N+XNY2<;2._+=17%W*;DCWUT4=Y>2._+= +M17%W*;DCWUT4=Y>2._+=17%W*;DCWUT$=[;\1,^![VPMN+-UR1WXSM:".UM7 +MW(W\%'-G97\W@N],]7=6]G"[TSU=U;V=R/XSE1_9V5_-X+O +M3/5W5O9W(_C.5']G97\W@N],]7=6]G"[TSU=U;V=R/XSE1_ +M9V5_-X+O3/5W5O9W(_C.5']G97\W@N],]7=6]GKOK.SO]N0[U=]9V=_MR7>JO[.RO]N3[U1_9V5_MR??J?[. +MROYN3[Y3_9V5_=V>?*?Z.RO[NSWY3O5W5O9W>_*=ZN^L[._VY#O5WUG9W^W) +M=ZJ_L[*_VY/O5']G97^W)]^I_L[*_FY/OE/]G97]W8&?$MR5_=V!?*?Z.RO[ +MNP/Y3O5W5O9W!_*=ZN^L[.\.Y#O5WUG9WQW(=ZJ_L[*_.Y#O5']G97]W(-^I +M_L[*_NY`OE/]G97]W8%\I_H[*_N[`_E.]7=6]G<'\IWJ[ZSL[P[D.]7?6=G? +M'[*_NY(OE/]G97]W9%\I_H[ +M*_N[(_E.]7=6]G='\IWJ[ZSL[X[D.]7?6=G?'KOK.SOCN0[U=]9 +MV=\=R7>JO[.ROSN2[U1_9V5_=^*G!'=E?WKOK.SO3N0[U=]9V=^=R'>JO[.ROSN1[U1_9V5_ +M=R+?J?[.RO[N1+Y3_9V5_=V)?*?Z.RO[NQ/Y3O5W5O9W)_*=ZN^L[.].Y#O5 +MWUG9WYW(=ZJ_L[*_._-3@KNROSN3[U1_9V5_=R;?J?[.RO[N3+Y3_9V5_=V9 +M?*?Z.RO[NS/Y3O5W5O9W9_*=ZN^L[._.Y#O5WUG9WYW)=ZJ_L[*_.Y/O5']G +M97]W)M^I_L[*_NY,OE/]G97]W9E\I_H[*_N[,_E.]7=6]G=G\IWJ[ZSL[\[D +M.]7?6=G?7?@IP5W9WUW(=ZJ_L[*_NY#O5']G97]W(=^I_L[*_NY"OE/]G97] +MW85\I_H[*_N["_E.]7=6]G<7\IWJ[ZSL[R[D.]7?6=G?7;.4W^WW*>W +MZMR![USU=Y[ZN]7,W6KA+M;\%'/GJ;];S=RM_FQSX#M7_9VG_FYU36<7=/^= +MJ_[.4W_7SJ[/@>]<]7>>^CN8`]^YZN\\]7]"Y`]^YZN\\]7=.[`=Z[Z.T_]W8/K +MS=F![USU=Y[ZNW9V?0Y\YZJ_\]3?P1SXSE5_YZF_@SGPG:O^SE-_M\P]['/D +M.]7?>>KO'BYSG3ORG>KO//5W#V?N'C;NZ/X[5_V=I_[NX]4?^>IOX,Y\IWJ[SSU=\O< +MHSY'OE/]G:?^[M$RU[BC^^]<]7>>^KM',W>/.G?D.]7?>>KO'LWK]4 +M?^>IOWMTO3D[\IWJ[SSU=^WL^ASY3O5WGOH[F"/?J?[.4W\'<^0[U=]YZN^6 +MN<=]CGRG^CM/_=WC9:YS1[Y3_9VG_N[QS-WCQAW=?^>JO_/4WSV>N7OKO//5W,$>^4_V= +MI_YNF7O2Y\AWJK_SU-\]6>8:=W3_G:O^SE-_]V3F[DGGCGRG^CM/_=V3F;LG +MG3ORG>KO//5W3ZXW9T>^4_V=I_ZNG5V?(]^I_LY3?P=SY#O5WWGJ[V".?*?Z +M.T_]W3+WM,^1[U1_YZF_>[K,=>[(=ZJ_\]3?/9VY>]JXH_OO7/5WGOJ[IS-W +M3QMW=/^=J_[.4W_W])K/CNZ_<]7?>>KOVMGU.?*=ZN\\]7JO_/4WRUSS_H<^4[U=Y[ZNV?+7...[K]SU=]YZN^>S=P]Z]R1[U1_YZF_ +M>S9S]ZQS1[Y3_9VG_N[9]>;LR'>JO_/4W[6SZW/D.]7?>>KO8(Y\I_H[3_T= +MS)'O5'_GJ;];YI[W.?*=ZN\\]7?/E[G.'?E.]7>>^KOG,W?/&W=T_YVK_LY3 +M?_=\YNYYXX[NOW/5WWGJ[YY?\]G1_7>N^CM/_5T[NSY'OE/]G:?^#N;(=ZJ_ +M\]3?P1SY3O5WGOJ[9>Y%GR/?J?[.4W_W8IEKW-']=Z[Z.T_]W8N9NQ>=._*= +MZN\\]7=.[(=ZJ_\]3?O;C>G!WY3O5WGOJ[=G9]CGRG^CM/_1W,D>]4 +M?^>IOX,Y\IWJ[SSU=\O>KO7L[>^CN8(]^I_LY3?[?,O>ISY#O5WWGJ[UXM>^KM7UYNS(]^I_LY3?]?.KL^1[U1_YZF_ +M@SGRG>KO//5W,$>^4_V=I_YNF7O=Y\AWJK_SU-^]7N8Z=^0[U=]YZN]>S]R] +M;MS1_7>N^CM/_=WKF;O7C3NZ_\Y5?^>IOWM]S6=']]^YZN\\]7?M[/H<^4[U +M=Y[Z.Y@CWZG^SE-_!W/D.]7?>>KOEKDW?8Y\I_H[3_W=FV6N<4?WW[GJ[SSU +M=V]F[MYT[LAWJK_SU-^]F;E[T[DCWZG^SE-_]^9Z>KOVMGU.?*= +MZN\\]7JO_/4WRUS;_L<^4[U=U[U=T'WW[GJ[[SJ[X+N +MOW/5WWG5WP7=?^>JO_.JOPNZ_\Y5?^=5?Q=T_YVK_LZK_B[H_CM7_9U7_5W0 +M_7>N^CL7_=V[/D>^4_V=I_[NW3+7N*/[[USU=Y[ZNW +MS=R]Z]R1[U1_YZF_>W>].3ORG>KO//5W[>SZ'/E.]7>>^CN8(]^I_LY3?P=S +MY#O5W\7RDS2W[G/@NU#]W?^"]7?1>KOUO/>NG%']]^%ZN\B +M]7?KF;MUXX[NOPO5WT7J[];7?'9T_UVH_BY2?]?.KL^![T+U=Y'Z.Y@#WX7J +M[R+U=S`'O@O5WT7J[Y8YZW/@NU#]7:3^SI:YQAW=?Q>JOXO4W]G\\JQS![X+ +MU=]%ZN]LYLXZ=^"[4/U=I/[.KC=G![X+U=]%ZN_:V?4Y\%VH_BY2?P=SX+M0 +M_5VD_@[FP'>A^KM(_=TRYWV.?*?ZNTC]G2]SG3ORG>KO(O5W/G/GC3NZ_RY4 +M?Q>IO_.9.V_J +MOXO4W\$<^4[U=Y'ZNV4N^ASY3O5WD?J[6.8:=W3_7:C^+E)_%S-WT;DCWZG^ +M+E)_%S-WT;DCWZG^+E)_%]>;LR/?J?XN4G_7SJ[/D>]4?Q>IOX,Y\IWJ[R+U +M=S!'OE/]7:3^;ID;^ASY3O5WD?J[89GKW)'O5'\7J;\;9NZ&QAW=?Q>JOXO4 +MWPTS=T/CCNZ_"]7?1>KOAFL^.[K_+E1_%ZF_:V?7Y\AWJK^+U-_!'/E.]7>1 +M^CN8(]^I_BY2?[?,;?H<^4[U=Y'ZN\TRU[BC^^]"]7>1^KO-S-VF^4_U= +MI/YN,W.WZ=R1[U1_%ZF_VUQOSHY\I_J[2/U=.[L^1[Y3_5VD_@[FR'>JOXO4 +MW\$<^4[U=Y'ZNV5NV^?(=ZJ_B]3?;9>YSAWY3O5WD?J[[KO +M(O5W,$>^4_U=I/YNF=OU.?*=ZN\B]7>[9:YQ1_??A>KO(O5WNYF[7>>.?*?Z +MNTC]W6[F;M>Y(]^I_BY2?[>[WIP=^4[U=Y'ZNW9V?8Y\I_J[2/T=S)'O5'\7 +MJ;^#.?*=ZN\B]7?+W-CGR'>JOXO4WXW+7.>.?*?ZNTC]W3AS-S;NZ/Z[4/U= +MI/YNG+D;&W=T_UVH_BY2?S=>\]G1_7>A^KM(_5T[NSY'OE/]7:3^#N;(=ZJ_ +MB]3?P1SY3O5WD?J[96[J<^0[U=]%ZN^F9:YQ1_??A>KO(O5WT\S=U+DCWZG^ +M+E)_-\W<39T[\IWJ[R+U=]/UYNS(=ZJ_B]3?M;/K<^0[U=]%ZN]@CGRG^KM( +M_1W,D>]4?Q>IOUOFWOKOWE_SV=']=Z'ZNTC]73N[/D>^4_U=I/X.YLAW +MJK^+U-_!'/E.]7>1^KME[D.?(]^I_BY2?_=AF6O1^KMV=GV.?*?ZNTC]'KO(O5WR]S'/D>^4_U=I/[NXS+7N2/?J?XN4G_W<>;N8^.. +M[K\+U=]%ZN\^SMQ];-S1_7>A^KM(_=W':SX[NO\N5'\7J;]K9]?GR'>JOXO4 +MW\$<^4[U=Y'Z.Y@CWZG^+E)_M\Q]ZG/D.]7?1>KO/BUSC3NZ_RY4?Q>IO_LT +M<_>I^4_U=I/[NT\S=I\X=^4[U=Y'ZNT_7F[,CWZG^+E)_U\ZNSY'O5'\7 +MJ;^#.?*=ZN\B]7JOXO4WWU>YCIWY#O5WT7J[S[/ +MW'UNW-']=Z'ZNTC]W>>9N\^-.[K_+E1_%ZF_^WS-9T?WWX7J[R+U=^WL^ASY +M3O5WD?H[F"/?J?XN4G\'<^0[U=]%ZN^6N2]]CGRG^KM(_=V79:YQ1_??A>KO +M(O5W7V;NOG3NR'>JOXO4WWV9N?O2N2/?J?XN4G_WY7IS=N0[U=]%ZN_:V?4Y +M\IWJ[R+U=S!'OE/]7:3^#N;(=ZJ_&Y:?I+FO?0Y\-ZC^;DC]W==EKG,'OOO^ +M%',WI/[NZ\S=UX6[8Q6PV:UV:Y&_]U7^'___-_T"N_F_K8W +M?#='7V#\WEQ[P?8[?/\X\O4?[]O\:6OW!/-U>VS^^JOSZ*F.^]W5^\OM7MV_TA +MT=W]WV\_S7GQ=E?WYPZ__-S^^M4]N'UU]$6\_Y-/QLW5(;_Y)_>OD?M_Z'6?[RW!Y^U!_X]J^W]_^Y&QQ^#/[Q_[+N5S>!I0`` ` end Modified: head/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow.gz.uu Wed Sep 24 15:14:01 2014 (r272072) +++ head/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow.gz.uu Wed Sep 24 15:15:14 2014 (r272073) @@ -1,59 +1,127 @@ # $FreeBSD$ begin 644 img-1x1-4096-ebr.qcow.gz -M'XL("+9D'U0``VEM9RTQ>#$M-#`Y-BUE8G(N<6-O=RYO=70`K9R];AM'&$5[ -M/\6F36'PSN[LSG1!@`1(EQ1)VLQOG0?0PT<628F4[M55;$N$+('Z/NR21T>& -M?;BGT_EM62*6;5^VO,RZ/'Y]N6&Y^>+^MCS\\>MOGV_?'CZ=E^'TSM2KK[>P -MK)=U=[M^/CVO"U^FVG+*'UCW>`-;=W-TZ_\XNIN3?;ONQT_GD^5S02V\/]WE -MLNYZNA"/WO:QX_OIU>GB_.A]O],-XG2C6KC?+?S]LNZ?R_$%<;J'6I?NUOW[ -MZG2#.-VLUI5W80D"EJK6-;-NHU-=K1MF7:13DZ_#.\_M>=U.IZ#6!;IN>5YW -MT*E5K=ONUIT^7X&^KDMT2G`'RUVF4X([6.X*G1+XV -MQUW@4X*[S7$7F.\VQ=WFN`O,=YOB;G/:[37&W.>X"\]VFN-L<=X'Y;E/< -M1<==8+Z+BKOHN`O,=U%Q%RUWS'=1<1Z2XVYCODN*N^L_?^MUS'=9<9<==QOS75;<93X`XGRQWQ'4Z".YP<=XE/<>Y@ -M^[M$?`?5W\'V=XGX#JJ_@^WO$O$=5'\'V]\EXCNH_@ZVOTO$=U#]'6Q_EXCO -MH/H[V/XN$=]!]7>P_5TBOH/J[V#[NT1\!]7?P?9WB?@.JK^#[>\2\1U4?P?; -MWR7B.ZC^#K:_2\1W4/T=;'^7F.]4?P?;WR7F.]7?P?9WF4\)[FQ_EYGO5'\' -MV]]EYCO5W\'V=YGY3O5WL/U=9KY3_1UL?Y>9[U1_!]O?9>8[U=_!]G>9^4[U -M=[#]76:^4_T=;'^7F>]4?P?;WV7F.]7?P?9WF?E.]7>P_5UFOE/]'6Q_EYGO -M5'\'V]]EYCO5W\'V=YGY3O5WL/U=X5.".]O?%>8[U=_!]G>%^4[U=[#]76&^ -M4_T=;']7F.]4?P?;WQ7F.]7?P?9WA?E.]7>P_5UAOE/]'6Q_5YCO5'\'V]\5 -MYCO5W\'V=X7Y3O5WL/U=8;Y3_1UL?U>8[U1_!]O?%>8[U=_!]G>%^4[U=[#] -M76&^4_T=;']7^93@SO9WE?E.]7>P_5UEOE/]'6Q_5YGO5'\'V]]5YCO5W\'V -M=Y7Y3O5WL/U=9;Y3_1UL?U>9[U1_!]O?5>8[U=_!]G>5^4[U=[#]766^4_T= -M;']7F>]4?P?;WU7F.]7?P?9WE?E.]7>P_5UEOE/]'6Q_5YGO5'\'V]\U/B6X -ML_U=8[Y3_1UL?]>8[U1_!]O?->8[U=_!]G>-^4[U=[#]76.^4_T=;'_7F.]4 -M?P?;WS7F.]7?P?9WC?E.]7>P_5UCOE/]'6Q_UYCO5'\'V]\UYCO5W\'V=XWY -M3O5WL/U=8[Y3_1UL?]>8[U1_!]O?->8[U=_!]G>=3PGN;'_7F>]4?P?;WW7F -M.]7?P?9WG?E.]7>P_5UGOE/]'6Q_UYGO5'\'V]]UYCO5W\'V=YWY3O5WL/U= -M9[Y3_1UL?]>9[U1_!]O?=>8[U=_!]G>=^4[U=[#]76>^4_T=;'_7F>]4?P?; -MWW7F.]7?P?9WG?E.]7>P_=W@4X([V]\-YCO5W\'V=X/Y3O5WL/W=8+Y3_1UL -M?S>8[U1_!]O?#>8[U=_!]G>#^4[U=[#]W6"^4_T=;'\WF.]4?P?;WPWF.]7? -MP?9W@_E.]7>P_=U@OE/]'6Q_-YCO5'\'V]\-YCO5W\'V=X/Y3O5WL/W=8+Y3 -M_1UL?S?YE.#.]G>3^4[U=[#]W62^4_T=;'\WF>]4?P?;WTWF.]7?P?9WD_E. -M]7>P_=UDOE/]'6Q_-YGO5'\'V]]-YCO5W\'V=Y/Y3O5WL/W=9+Y3_1UL?S>9 -M[U1_!]O?3>8[U=_!]G>3^4[U=^'ZR:MUR\LZXKO'*-7?7:^GM[QP1WP7 -M5'\77O5WRX6[YB)3SS=]!WGLSA?46^FU;]Y?.*=\,M:G:]\\?L/CK<3+ -M)X^W\^7?KD_.XXE"']\/M^M86_E-I\OR[W<6QKB4\F;AG]?C>[I7@CX -MYJ.^X^'GS_?OS\?W]/KH>"Q;7.*^I/#1$_[[E[_8TT%?'_U5C]]YG;VIK[\``]VASPZ?GW#KV?OS6N0;Y_G -MIR*]O;R^_Y6HGI_?Y>7XR.^,<'>Z[QS?\O9TGWYG'/??CYMUP9SN:5M!_\R?VRY/XG][PN?%\1Q">S?/GK1"$?]1T/OW^^ -9?S\OW"X+O]LCN)WVQZ/\]!_U&W#4P5<````` +M'XL("*TS(E0``VEM9RTQ>#$M-#`Y-BUE8G(N<6-O=RYO=70`K9W9CAS728K(K*J,CGC`C;@M^L'VZ^WQN?Z`'Z\.62>TQVU-D.V1#4$$F1N5)U> +M6H2DQ=/K]:]OJ]7&5L-V-4RKRV'U_KHG3&_[+L;-;B]-_C/>>Y?\^MS +M\79W:FZ\-W=-;]?%VYW4W/ZWL+B`Y:#FCL7<@$^=U-RYF-O@4Q>>L]]\;G_- +M;?$I4W..@E[D1GQ+<6ZLY.Z` +M3PGNK.3NB$\)[JSD[H1/">Z\Y.Z,3PGNO.3N@D\)[KSBSO@IP9U7W!GYSA5W +M7G%GY#M7W'G%G9'O7''G%7=&OG/%G5?<&?G.%7=1<6?DNU#<1<6=D>]"<1]"<1)N4W)'OMLH[C8E=^2[ +MC>)N4W)'OMLH[C8E=^2[C>)N4W)'OMLH[K8E=^2[K>)N6W)'OMLJ[K85=\%/ +M">ZV%7=!OMLJ[K85=T&^VRKNMA5W0;[;*NZV%7=!OMLJ[K85=T&^VRKN=A5W +M0;[;*>YV%7=!OMLI[G8E=^2[G>)N5W)'OMLI[G8E=^2[G>)N5W)'OMLI[G8E +M=^2[G>)N5W)'OMLI[L:2._+=J+@;2^[(=Z/B;JRX&_@IP=U8<3>0[T;%W5AQ +M-Y#O1L7=6'$WD.]&Q=U8<3>0[T;%W5AQ-Y#O1L7=\I^_]1SY;E+<315W`_EN +M4MQ-)7?DNTEQ-Y7\FQ=U4^FQ1W4\D=^6Y2W$TE=^2[27$WE=R1[R;% +MW;[DCGRW5]SM2^[(=WO%W;[B;L-/">[V%7<;\MU><;>ON-N0[_:*NWW%W89\ +MMU?<[2ON-N2[O>)N7W&W(=_M%7?+_X;4<^2[@^+N4'&W(=\=%'>'DCORW4%Q +M=RBY(]\=%'>'DCORW4%Q=RBY(]\=%'>'DCORW4%Q=RBY(]\=%'?'DCORW5%Q +M=RRY(]\=%7?'BKLM/R6X.U;<;)N2[X[*NZ.%7=;\MU1<7>LN-N2 +M[XZ*NV/%W99\=U3GDCORW4EQ=RJY(]^=%'>G +MDCORW4EQ=RJY(]^=%'>GDCORW4EQ=RJY(]^=%'?GDCORW5EQ=RZY(]^=%7?G +MBKL=/R6X.U?<[)N1[X[*^[.%7<[\MU9<7>NN-N1[\Z*NW/%W8Y\ +M=U;<72KN=N2[B^+N4G&W(]]=%'>7DCORW45Q=RFY(]]=%'>7DCORW45Q=RFY +M(]]=%'>7DCORW45Q=RFY(]]=!'>V?$?/@>]L+;BS="[TSU=U;V +M=R/XSE1_9V5_-X+O3/5W5O9W(_C.5']G97\W@N],]7=6]G" +M[TSU=U;V=R/XSE1_9V5_-X+O3/5W5O9W(_E.]7=6]GKOK.SO]N0[U=]9V=_MR7>JO[.R +MO]N3[U1_9V5_MR??J?[.ROYN3[Y3_9V5_=V!GQ+KOK.SO#N0[U=]9V=\=R'>JO[.ROSN0[U1_9V5_=R#?J?[.RO[N +M0+Y3_9V5_=V!?*?Z.RO[NP/Y3O5W5O9W!_*=ZN^L[.\.Y#O5WUG9WQW(=ZJ_ +ML[*_.Y#O5']G97]W(-^I_L[*_N[(3PGNRO[N2+Y3_9V5_=V1?*?Z.RO[NR/Y +M3O5W5O9W1_*=ZN^L[.^.Y#O5WUG9WQW)=ZJ_L[*_.Y+O5']G97]W)-^I_L[* +M_NY(OE/]G97]W9%\I_H[*_N[(_E.]7=6]G='\IWJ[ZSL[X[D.]7?6=G?']4?V=E?WKOK.SO3N0[U=]9V=^= +MR'>JO[.ROSOS4X*[LK\[D^]4?V=E?WKOK.SOSN0[U=]9V=^=R7>JO[.ROSN3[U1_9V5_=R;? +MJ?[.RO[N3+Y3_9V5_=V9?*?Z.RO[NS/Y3O5W5O9W9_*=ZN^L[._.Y#O5WUG9 +MWUWX*<%=V=]=R'>JO[.RO[N0[U1_9V5_=R'?J?[.RO[N0KY3_9V5_=V%?*?Z +M.RO[NPOY3O5W5O9W%_*=ZN^L[.\NY#O5WUG9WUW(=ZJ_L[*_NY#O5']G97]W +M(=^I_L[*_NY"OE/]G97]W85\I_H[7[Z3YE9]#GSW_2GFSE-_M]RGM^K<@>]< +M]7>>^KO5S-UJX2[6_!1SYZF_6\WKO//5W,`>^<]7?>>KO8`Y\YZJ_\]3?+7,/^ASXSE5_YZF_>[#, +MK=H<^,Y5?^>IOWLP<_>@

^<]7?>>KO'LSC<@>]<]7>>^KL'UYNS`]^Y +MZN\\]7?M[/H<^,Y5?^>IOX,Y\)VK_LY3?P=SX#M7_9VG_FZ9>]CGR'>JO_/4 +MWSU-.[K_SE5_YZF_>WC- +M9T?WW[GJ[SSU=^WL^ASY3O5WGOH[F"/?J?[.4W\'<^0[U=]YZN^6N4=]CGRG +M^CM/_=VC9:YQ1_??N>KO//5WCV;N'G7NR'>JO_/4WSV:N7O4N2/?J?[.4W_W +MZ'IS=N0[U=]YZN_:V?4Y\IWJ[SSU=S!'OE/]G:?^#N;(=ZJ_\]3?+7./^QSY +M3O5WGOJ[Q\M/K_GLZ/X[5_V=I_ZNG5V?(]^I_LY3?P=SY#O5WWGJ[V".?*?Z.T_]W3+W +MI,^1[U1_YZF_>[+,->[H_CM7_9VG_N[)S-V3SAWY3O5WGOJ[)S-W3SIWY#O5 +MWWGJ[YY<;\Z.?*?Z.T_]73N[/D>^4_V=I_X.YLAWJK_SU-_!'/E.]7>>^KME +M[FF?(]^I_LY3?_=TF>O]4?^>IOWLZ<_>T<4?WW[GJ[SSU=T]G[IXV[NC^ +M.U?]G:?^[NDUGQW=?^>JO_/4W[6SZW/D.]7?>>KO8(Y\I_H[3_T=S)'O5'_G +MJ;];YI[U.?*=ZN\\]7?/EKG&'=U_YZJ_\]3?/9NY>]:Y(]^I_LY3?_=LYNY9 +MYXY\I_H[3_W=L^O-V9'O5'_GJ;]K9]?GR'>JO_/4W\$<^4[U=Y[Z.Y@CWZG^ +MSE-_M\P][W/D.]7?>>KOGB]SG3ORG>KO//5WSV?NGC?NZ/X[5_V=I_[N^]4?^>IOX,Y +M\IWJ[SSU=\O>^KL7,W>KO +M7LSC]4?^>IOWMQO3D[\IWJ[SSU=^WL^ASY3O5WGOH[F"/?J?[.4W\' +M<^0[U=]YZN^6N9=]CGRG^CM/_=W+9:YS1[Y3_9VG_N[ES-W+QAW=?^>JO_/4 +MW[VKO +M//5W,$>^4_V=I_YNF7O5Y\AWJK_SU-^]6N8:=W3_G:O^SE-_]VKF[E7GCGRG +M^CM/_=VKF;M7G3ORG>KO//5WKZXW9T>^4_V=I_ZNG5V?(]^I_LY3?P=SY#O5 +MWWGJ[V".?*?Z.T_]W3+WNL^1[U1_YZF_>[W,=>[(=ZJ_\]3?O9ZY>]VXH_OO +M7/5WGOJ[US-WKQMW=/^=J_[.4W_W^IK/CNZ_<]7?>>KOVMGU.?*=ZN\\]7

JO_/4WRUS;_H<^4[U=Y[ZNS?+7...[K]SU=]YZN_>S-R] +MZ=R1[U1_YZF_>S-S]Z9S1[Y3_9VG_N[-]>;LR'>JO_/4W[6SZW/D.]7?>>KO +M8(Y\I_H[3_T=S)'O5'_GJ;];YM[V.?*=ZN^\ZN^"[K]SU=]YU=\%W7_GJK_S +MJK\+NO_.57_G57\7=/^=J_[.J_XNZ/X[5_V=5_U=T/UWKOH[K_J[H/OO7/5W +M+OJ[=WV.?*?Z.T_]W;MEKG%']]^YZN\\]7?O9N[>=>[(=ZJ_\]3?O9NY>]>Y +M(]^I_LY3?_?N>G-VY#O5WWGJ[]K9]3GRG>KO//5W,$>^4_V=I_X.YLAWJK^+ +MY3MI;MWGP'>A^KOO/W&/N\5/Z\X=^"Y4?Q>IOUO/>^O&'=U_%ZJ_B]3?K6?N +MUHT[NO\N5'\7J;];7_/9T?UWH?J[2/U=.[L^![X+U=]%ZN]@#GP7JK^+U-_! +M'/@N5'\7J;];YJS/@>]"]7>1^CM;YAIW=/]=J/XN4G]G\\NSSAWX+E1_%ZF_ +MLYD[Z]R![T+U=Y'Z.[O>G!WX+E1_%ZF_:V?7Y\!WH?J[2/T=S('O0O5WD?H[ +MF`/?A>KO(O5WRYSW.?*=ZN\B]7>^S'7NR'>JOXO4W_G,G3?NZ/Z[4/U=I/[. +M9^Z\<4?WWX7J[R+U=W[-9T?WWX7J[R+U=^WL^ASY3O5WD?H[F"/?J?XN4G\' +M<^0[U=]%ZN^6N>ASY#O5WT7J[V*9:]S1_7>A^KM(_5W,W$7GCGRG^KM(_5W, +MW$7GCGRG^KM(_5U<;\Z.?*?ZNTC]73N[/D>^4_U=I/X.YLAWJK^+U-_!'/E. +M]7>1^KME;NASY#O5WT7J[X9EKG-'OE/]7:3^;IBY&QIW=/]=J/XN4G\WS-P- +MC3NZ_RY4?Q>IOQNN^>SH_KM0_5VD_JZ=79\CWZG^+E)_!W/D.]7?1>KO8(Y\ +MI_J[2/W=,K?I<^0[U=]%ZN\VRUSCCNZ_"]7?1>KO-C-WF\X=^4[U=Y'ZN\W, +MW:9S1[Y3_5VD_FYSO3D[\IWJ[R+U=^WL^ASY3O5WD?H[F"/?J?XN4G\'<^0[ +MU=]%ZN^6N6V?(]^I_BY2?[==YCIWY#O5WT7J[[8S=]O&'=U_%ZJ_B]3?;6?N +MMHT[NO\N5'\7J;_;7O/9T?UWH?J[2/U=.[L^1[Y3_5VD_@[FR'>JOXO4W\$< +M^4[U=Y'ZNV5NU^?(=ZJ_B]3?[9:YQAW=?Q>JOXO4W^UF[G:=._*=ZN\B]7>[ +MF;M=YXY\I_J[2/W=[GIS=N0[U=]%ZN_:V?4Y\IWJ[R+U=S!'OE/]7:3^#N;( +M=ZJ_B]3?+7-CGR/?J?XN4G\W+G.=._*=ZN\B]7?CS-W8N*/[[T+U=Y'ZNW'F +M;FS,UG1_??A>KO(O5W[>SZ'/E.]7>1^CN8(]^I_BY2?P=S +MY#O5WT7J[Y:YJ<^1[U1_%ZF_FY:YQAW=?Q>JOXO4WTTS=U/GCGRG^KM(_=TT +MKO(O5W,$>^ +M4_U=I/YNF7O?Y\AWJK^+U-^]7^8Z=^0[U=]%ZN_>S]R];]S1_7>A^KM(_=W[ +MF;OWC3NZ_RY4?Q>IOWM_S6=']]^%ZN\B]7?M[/H<^4[U=Y'Z.Y@CWZG^+E)_ +M!W/D.]7?1>KOEKD/?8Y\I_J[2/W=AV6N<4?WWX7J[R+U=Q]F[CYT[LAWJK^+ +MU-]]F+G[T+DCWZG^+E)_]^%ZKOVMGU.?*=ZN\B]7JOXO4WRUS'_L<^4[U=Y'ZNX_+7.>.?*?ZNTC]W<>9NX^-.[K_+E1_ +M%ZF_^SAS][%Q1_??A>KO(O5W'Z_Y[.C^NU#]7:3^KIU=GR/?J?XN4G\'<^0[ +MU=]%ZN]@CGRG^KM(_=TR]ZG/D>]4?Q>IO_NTS#7NZ/Z[4/U=I/[NT\S=I\X= +M^4[U=Y'ZNT\S=Y\Z=^0[U=]%ZN\^76_.CGRG^KM(_5T[NSY'OE/]7:3^#N;( +M=ZJ_B]3?P1SY3O5WD?J[9>YSGR/?J?XN4G_W>9GKW)'O5'\7J;_[/'/WN7%' +M]]^%ZN\B]7>?9^X^-^[H_KM0_5VD_N[S-9\=W7\7JK^+U-^UL^MSY#O5WT7J +M[V".?*?ZNTC]'KO(O5W7Y:YQAW=?Q>JOXO4WWV9 +MN?O2N2/?J?XN4G_W9>;N2^>.?*?ZNTC]W9?KS=F1[U1_%ZF_:V?7Y\AWJK^+ +MU-_!'/E.]7>1^CN8(]^I_FY8OI/FOO8Y\-V@^KLA]7=?E[G.'?CN^U/,W9#Z +MNZ\S=U\7[H8U/\7<#:F_^SIS]_5?;0Y\-ZC^KGTL<[DW'NC^N_Y4,7?GV[<_ +M7OXKOTQ=E_,[C9K/;[F\'_6E[?S\MT!E^M]_!W_1/?_O'V_E_M]?W\T]N;W6K8 +MK#;;U>A_]@W_S[_]-WTZZ$]O___.[]=<25][P?9GYG[^;GOG5]XE0__$MX[) +MVSO7UFWH3V_W%_%#+V?Z"?GJZ*N]_Q7V;OZ$]-W/\\^O%__]7XV7__N1KA%M +MG]]5?WU4E-][N[]Y?:O;M_OS=[3=_5]O=^:\>+NK^W.'WWYN?__J'MR^.OJ* +MZG_EDW'SYWS_Y#^Y/T;N_Y/[:\[_7A'L?IKEQV\Z>_B[_HEO_WQ[_Z]?@\,\ +4^+>=X+`>O[_*/_X7*6^YQ%^G```` ` end Modified: head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu Wed Sep 24 15:14:01 2014 (r272072) +++ head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu Wed Sep 24 15:15:14 2014 (r272073) @@ -1,64 +1,132 @@ # $FreeBSD$ begin 644 img-1x1-4096-gpt.qcow.gz -M'XL("+AD'U0``VEM9RTQ>#$M-#`Y-BUG<'0N<6-O=RYO=70`K9Q+;QO)&47W -M_A7M;8((O%7]J-X$R0`98':>(-DE0.JY'"1[_?CP*8OTO;HVAA8A2"#J0W?S -M]&E9.NS#X?)OFA9,\SK-^S3*=/S^^L#T[IO[Q_3ZZ\^_O+S_]_KI,@R'#U8] -M?#^'*5S'W#=PNHX[7+ANWT551C9OOQAU>;D#?QB6Z2G`'R]U.5PGN8+G+=)7@#I:[0E<)[F"Y -MJW25X`Z6NT97">Z"Y:[358([<;UXQ]V@JP1WP7$'ODIP%QQW8+X+BKO@N`/S -M75#8[Q;%W>*X"\QWB^)NL=PQWRV*N\5RQWRW*.X6RQWSW:*X -M6RQWS'>+XFZQW#'?+8J[Q7+'?+9[S;% -MW>:XB\QWF^)NL]PQWVV*N\URQWRW*>XVRQWSW::XVRQWS'>;XFZSW#'?;8J[ -MS7+'?+Z2Y8[Y+BGNDN-NYJL$=\EQ-S/?)<5=W7WWH<\]VNN-L==S/SW:ZXVRUWS'>[ -MXFZWW#'?[8J[W7+'?+QWQ7%'?%<;^JXJXZ[E;FNZJX:XZ[E?FN*>Z: -MXVYEOFN*NV:Y8[YKBKMFN6.^:XJ[9KECOFN*NV:Y8[YKBKMFN6.^:XJ[9KEC -MOFN*NVZY8[[KBKMNN6.^ZXJ[[KC;^"K!77?<;*K.'>P_5TBOH/J[V#[NT1\!]7?P?9WB?@.JK^#[>\2\1U4?P?; -MWR7B.ZC^#K:_2\1W4/T=;'^7B.^@^CO8_BX1WT'U=[#]72*^@^KO8/N[1'P' -MU=_!]G>)^`ZJOX/M[Q+Q'51_!]O?)>([J/X.MK]+S'>JOX/M[Q+SG>KO8/N[ -MG:\2W-G^;F>^4_T=;'^W,]^I_@ZVO]N9[U1_!]O?[]VYCO5W\'V -M=SOSG>KO8/N[G?E.]7>P_=W.?*?Z.]C^;F>^4_T=;'^W,]^I_@ZVO]N9[U1_ -M!]O?[]VYCO5W\'V=SOSG>KO8/N[G?E.]7>P_5WFJP1WMK_+S'>J -MOX/M[S+SG>KO8/N[S'RG^CO8_BXSWZG^#K:_R\QWJK^#[>\R\YWJ[V#[N\Q\ -MI_H[V/XN,]^I_@ZVO\O,=ZJ_@^WO,O.=ZN]@^[O,?*?Z.]C^+C/?J?X.MK_+ -MS'>JOX/M[S+SG>KO8/N[S'RG^CO8_J[P58([V]\5YCO5W\'V=X7Y3O5WL/U= -M8;Y3_1UL?U>8[U1_!]O?%>8[U=_!]G>%^4[U=[#]76&^4_T=;']7F.]4?P?; -MWQ7F.]7?P?9WA?E.]7>P_5UAOE/]'6Q_5YCO5'\'V]\5YCO5W\'V=X7Y3O5W -ML/U=8;Y3_1UL?U?Y*L&=[>\J\YWJ[V#[N\I\I_H[V/ZN,M^I_@ZVOZO,=ZJ_ -M@^WO*O.=ZN]@^[O*?*?Z.]C^KC+?J?X.MK^KS'>JOX/M[RKSG>KO8/N[RGRG -M^CO8_JXRWZG^#K:_J\QWJK^#[>\J\YWJ[V#[N\I\I_H[V/ZN,M^I_@ZVOVM\ -ME>#.]G>-^4[U=[#]76.^4_T=;'_7F.]4?P?;WS7F.]7?P?9WC?E.]7>P_5UC -MOE/]'6Q_UYCO5'\'V]\UYCO5W\'V=XWY3O5WL/U=8[Y3_1UL?]>8[U1_!]O? -M->8[U=_!]G>-^4[U=[#]76.^4_T=;'_7F.]4?P?;WW6^2G!G^[O.?*?Z.]C^ -MKC/?J?X.MK_KS'>JOX/M[SKSG>KO8/N[SGRG^CO8_JXSWZG^#K:_Z\QWJK^# -M[>\Z\YWJ[V#[N\Y\I_H[V/ZN,]^I_@ZVO^O,=ZJ_@^WO.O.=ZN]@^[O.?*?Z -M.]C^KC/?J?X.MK_KS'>JOX/M[P9?);BS_=U@OE/]'6Q_-YCO5'\'V]\-YCO5 -MW\'V=X/Y3O5WL/W=8+Y3_1UL?S>8[U1_!]O?#>8[U=_!]G>#^4[U=[#]W6"^ -M4_T=;'\WF.]4?P?;WPWF.]7?P?9W@_E.]7>P_=U@OE/]7;A]\3!N^CJ.^.ZX -MBG,7'OJ[V_WTIJ_<$=\%U=^%A_YNNG(WW;B+A].3[C]N -M-]2+YWO?_,#`V]&['W<[>O%R[YMS]-./Y_ZX/BZW?[N].,<=Q=U^W[T8GU_> -MC6-MY=LJ^01!Y;:[+/_^8."R3#E_,_"?M^T[WZYF7J[WK@SG$'+&M(1IF=_& -MG?=UJ>^W[V\__S)]^>O?_W$:]J^ONWN^74TYKC_^"!*G_G"0#I"[^V]V9L3+ -M[6K&X]&^C8MRW&<^[GSY:1^,8P\];OYHU=N-V[[CM;V,6P[WJ]+[5?%XF8S3 -MR%-N8MR?'\:Q_/OWD'=^YWM9I^WXGZY^NM]I':OXA2[.]V/ -M>_)M3N/Y_=ME>=K1VZ^PL(=^0AZ]?#EZ_""=CAX]95[?KA>?[\>QWOUW'+WY -M?-4X_6R2R6?]Q.N7E_N/R\#Y.O!I6W@<6)]X=IS&/?'L.(U[XMEQ&O?4L^,T -M\(EGQVG<$\^.T[@GGAVG<4\].XX#S[\S>])%_#0.E\OD:%,*4X\/VZ#$M-#`Y-BUG<'0N<6-O=RYO=70`K9W;;AS7M47? +M_16ENT1)5*^UJJJK=$^`!,B;$YSS=@Z0NCX&G7=]?-CDOI"KY]2*(=J$(4.H +MB>ZMP4'9'MX\'.[^:)I.FK9OVK'9Y^;F[].'-/?^YN%'\^/O?_W;]?T_?OQV +M-R:'GSSE_K[51M/<@ZT_-V5.ST\MS6'\+^9N/@3-W7MU]@=>W;TW>SEW]=O= +MF\7/*1NT!X--FCNDUR?D]-K_[O5]=V]7[D[O\=ZNDK?;L<'^P>#O:>Z?Z?4I +M>;M'-C<\F#NYMZOD[8YL;OHI+$I@F=G<$LRU\*F5S6W!7`>?VO&<_.37]FZN +MAT\)FX.?M]=-F3O"IXS-M0_F#M<9Z#PWP*<(=Q)R-\*G"'<2,.PNY0[XSQIV%W"'?&>/.0NZ0[XQQ9R%WR'?&N+.0.^0[8]RU +M(7?(=RWCK@VY0[YK&7=MQ)WBIPAW;<2=(M^UC+LVXDZ1[UK&71MQI\AW+>.N +MC;A3Y+N6<==&W"GR7*?-XZT/ND.]ZQET?.NC[@SY+N> +M<7>,N#/DNR/C[AAQ9\AW1\;=,>0.^>[(N#N&W"'?'1EWQY`[Y+LCX^X8ZFB+L.^6YB +MW$T1=QWRW<2XFR+N.N2[B7$W1=QUR'<3XR[_9T@^AWPW,^[FB+L.^6YFW,TA +M=\AW,^-N#KE#OIL9=W/('?+=S+B;0^Z0[V;&W1QRAWPW,^[FD#ODNYEQMX3< +M(=\MC+LEY`[Y;F'<+1%W/7Z*<+=$W/7(=POC;HFXZY'O%L;=$G'7(]\MC+LE +MXJY'OEL8=TO$78]\MS#NUHB['OEN9=RM$7<]\MW*N%M#[I#O5L;=&G*'?+\VQMT6<7=$ +MOML8=WO$W1'Y;F?<[1%W1^2[G7&WA]PAW^V,NSWD#OEN9]SM(7?(=SOC;@^Y +M0[[;&7=[R!WRWLOY.POQN`[X3U=Q+V=P/PG;#^3L+^;@"^$];?2=C?#OO).SO1N0[UM])V-^-R'>LOY.POQN1[UA_)V%_-R+?L?Y.POYN +M1+YC_9V$_=V(?,?Z.PG[NQ'YCO5W$O9W(_(=Z^\D[.]&Y#O6WTG8WXW(=ZR_ +MD["_&Y'O6'\G87\W(M^Q_D["_FY$OF/]G83]W8A\Q_H["?N["3]%N`O[NPGY +MCO5W$O9W$_(=Z^\D[.\FY#O6WTG8WTW(=ZR_D["_FY#O6'\G87\W(=^Q_D[" +M_FY"OF/]G83]W81\Q_H["?N["?F.]7<2]G<3\AWK[R3L[R;D.];?2=C?3]8?R=A?SOO).SO9N0[UM])V-_- +MR'>LOY.POYN1[UA_)V%_-R/?L?Y.POYNP4\1[L+^;D&^8_V=A/W=@GS'^CL) +M^[L%^8[U=Q+V=POR'>OO).SO%N0[UM])V-\MR'>LOY.POUN0[UA_)V%_MR#? +ML?Y.POYN0;YC_9V$_=V"?,?Z.PG[NP7YCO5W$O9W"_(=Z^\D[.\6Y#O6WTG8 +MWRW(=ZR_D["_6Y#O6'\G87^WXJ<(=V%_MR+?L?Y.POYN1;YC_9V$_=V*?,?Z +M.PG[NQ7YCO5W$O9W*_(=Z^\D[.]6Y#O6WTG8WZW(=ZR_D["_6Y'O6'\G87^W +M(M^Q_D["_FY%OF/]G83]W8I\Q_H["?N[%?F.]7<2]GOO).SO-N0[ +MUM])V-_M^"G"7=C?[]8?R=A?[^8_V=A/W= +MCGS'^CL)^[L=^8[U=Q+V=SOR'>OO).SO=N0[UM])V-_MR'>LOY.PO]N1[UA_ +M)V%_MR/?L?Y.POYN1[YC_9V$_=V.?,?Z.\T_<'--G0.^NWD*NO\OWZ365 +M.^`[9?V=NOZN2=PUF3L[X*OOU/5WSLOU/7 +MWSW)).Z>5.Z`[Y3U=^KZNR>)NR>5.^`[9?V=NO[NR>GB +M[(#OE/5WZOJ[OO\MS3.H=\ +MQ_H[=?W=TSQ7N4.^8_V=NO[N:>+N:>$.W7^GK+]3U]\]3=P]+=RA^^^4]7?J +M^KNG)W]VZ/X[9?V=NOZNG%V=0[YC_9VZ_@[,(=^Q_DY=?P?FD.]8?Z>NO\MS +MS^H<\AWK[]3U=\_R7.$.W7^GK+]3U]\]2]P]J]PAW['^3EU_]RQQ]ZQRAWS' +M^CMU_=VST\79(=^Q_DY=?U?.KLXAW['^3EU_!^:0[UA_IZZ_`W/(=ZR_4]?? +MY;GG=0[YCO5WZOJ[YWFNOOU/5W+_-GOS9H?OOE/5WZOJ[LOU/7W[W*O3A=GAWS'^CMU_5TYNSJ'?,?Z.W7]'9A#OF/] +MG;K^#LPAW['^3EU_E^=>USGD.];?J>OO7N>YRAWR'>OOU/5WKQ-WKPMWZ/X[ +M9?V=NO[N=>+N=>$.W7^GK+]3U]^]/OFS0_??*>OOU/5WY>SJ'/(=Z^_4]7=@ +M#OF.]7?J^CLPAWS'^CMU_5V>>U/GD.]8?Z>NOWN3YPIWZ/X[9?V=NO[N3>+N +M3>4.^8[U=^KZNS>)NS>5.^0[UM^IZ^_>G"[.#OF.]7?J^KMR=G4.^8[U=^KZ +M.S"'?,?Z.W7]'9A#OF/]G;K^+L]=U3GD.];?J>OOKO)$.W7^GK+]3U]]=)>ZN"G?H_CME_9VZ_N[JY,\.W7^GK+]3U]^5LZMSR'>L +MOU/7WX$YY#O6WZGK[\`<\AWK[]3U=WGN;9U#OF/]G;K^[FV>*]RA^^^4]7?J +M^KNWB;NWE3OD.];?J>OOWB;NWE;ND.]8?Z>NOWM[NC@[Y#O6WZGK[\K9U3GD +M.];?J>OOP!SR'>OOU/5W8`[YCO5WZOJ[//>NSB'?L?Y.77_W+L]5[I#O6'^G +MKK][E[A[5[A#]]\IZ^_4]7?O$G?O"G?H_CME_9VZ_N[=R9\=NO].67^GKK\K +M9U?GD.]8?Z>NOP-SR'>LOU/7WX$YY#O6WZGK[_+<^SJ'?,?Z.W7]W?L\5[A# +M]]\IZ^_4]7?O$W?O*W?(=ZR_4]??O4_LOU/7 +MWY6SJW/(=ZR_4]??@3GD.];?J>OOP!SR'>OOU/5W>>ZZSB'?L?Y.H_[.T/UW +MROH[C?H[0_??*>OO-.KO#-U_IZR_TZB_,W3_G;+^3J/^SM#]=\KZ.XWZ.T/W +MWRGK[S3J[PS=?Z>LOU/2WWVH<\AWK+]3U]]]R'.%.W3_G;+^3EU_]R%Q]Z%R +MAWS'^CMU_=V'Q-V'RAWR'>OOU/5W'TX79X=\Q_H[=?U=.;LZAWS'^CMU_1V8 +M0[YC_9VZ_@[,(=^Q_L[R#]S).*G?`=\;Z.W/]G9PNS@[XSEA_9ZZ_*V=7YX#O +MC/5WYOH[,`=\9ZR_,]??@3G@.V/]G;G^+L]IG4.^8_V=N?Y.\USE#OF.]7?F +M^CM-W&GA#MU_9ZR_,]??:>)."W?H_CMC_9VY_DY/_NS0_7?&^CMS_5TYNSJ' +M?,?Z.W/]'9A#OF/]G;G^#LPAW['^SEQ_E^>LSB'?L?[.7']G>:YPA^Z_,];? +MF>OO+'%GE3OD.];?F>OO+'%GE3OD.];?F>OO['1Q=LAWK+\SU]^5LZMSR'>L +MOS/7WX$YY#O6WYGK[\`<\AWK[\SU=WFNK7/(=ZR_,]??M7FNZ.#OD.];?F>OORMG5.>0[ +MUM^9Z^_`'/(=Z^_,]7=@#OF.]7?F^KL\U]NO^M/_NS0_7?&^CMS_5TYNSJ' +M?,?Z.W/]'9A#OF/]G;G^#LPAW['^SEQ_E^>.=0[YCO5WYOJ[8YXKW*'[[XSU +M=^;ZNV/B[EBY0[YC_9VY_NZ8N#M6[I#O6']GKK\[GB[.#OF.]7?F^KMR=G4. +M^8[U=^;Z.S"'?,?Z.W/]'9A#OF/]G;G^+L\-=0[YCO5WYOJ[(<]5[I#O6']G +MKK\;$G=#X0[=?V>LOS/7WPV)NZ%PA^Z_,];?F>OOAI,_.W3_G;'^SEQ_5\ZN +MSB'?L?[.7'\'YI#O6']GKK\#<\AWK+\SU]_EN;'.(=^Q_LYOOS/5W8`[YCO5WYOH[,(=\Q_H[<_U=GOM4YY#O6']GKK_[E.<* +M=^C^.V/]G;G^[E/B[E/E#OF.]7?F^KM/B;M/E3OD.];?F>OO/ITNS@[YCO5W +MYOJ[LOS/7WWW. +M?$W>?"';K_SEA_9ZZ_^WSR9X?N +MOS/6WYGK[\K9U3GD.];?F>OOP!SR'>OOS/5W8`[YCO5WYOJ[//>ESB'?L?[. +M7'_W)<\5[M#]=\;Z.W/]W9?$W9?*'?(=Z^_,]7=?$G=?*G?(=ZR_,]???3E= +MG!WR'>OOS/5WY>SJ'/(=Z^_,]7=@#OF.]7?F^CLPAWS'^CMS_5V>^UKGD.]8 +M?V>NO_N:YRIWR'>LOS/7WWU-W'TMW*'[[XSU=^;ZNZ^)NZ^%.W3_G;'^SEQ_ +M]_7DSP[=?V>LOS/7WY6SJW/(=ZR_,]??@3GD.];?F>OOP!SR'>OOS/5W>>Y; +MG4.^8_V=N?[N6YXKW*'[[XSU=^;ZNV^)NV^5.^0[UM^9Z^^^)>Z^5>Z0[UA_ +M9ZZ_^W:Z.#OD.];?F>OORMG5.>0[UM^9Z^_`'/(=Z^_,]7=@#OF.]7=M_H&; +M^U[G@.]:UM^UKK_[GNWYM=H<)O!7 +M_A,__GS]\,\R>'MWT!\8S*_PX5S^!>GN[@ZZC::V&W?NZ>,@]][P^9L>"W_# +M3Z[OS:'OS?PKYX>N^_G98-]]-V3=LW[9@N^>?[FMW#6;.Z0#D+?[O_[MWLW +M=_OE>_>GG>>,SCW!<[=?OM>?S*$//M?^[*F#TE=W\6M[-]<='CXUW'_J_-L, +M:_:IF58R]]7-H6\?_RODW=X<,/?-\>8?6F]^@R?-LI]_L/;G;[[;##>?)G?_ +M:49O_U^FL3G*^?^RNQG\\:^_7__K;NS]];_?IM=W=W.`X`_^$^ST[FX.&-C; +MS?]YD;_=YN$<^)W>KYW>^?M/=Z>%#.I\>_)3YU7C?/7V`G\E?_$C]^O'_YY-]BFP4=[A3>#RR-^=ISG'O&S +MXSSWB)\=Y[E'_>PX#S[B9\=Y[A$_.\YSC_C9<9Y[U,^.F\';?^?X2%_$SW-R +M]V5R7YM!F\W_AV[_Z=(_O2_Y,OXO@78WO$+^+GN9]_$=_^Z)M] +8Q"_BY[E'_2+>'HXWWOOM/_VP*B?UK``` ` end Modified: head/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow.gz.uu ============================================================================== --- head/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow.gz.uu Wed Sep 24 15:14:01 2014 (r272072) +++ head/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow.gz.uu Wed Sep 24 15:15:14 2014 (r272073) @@ -1,59 +1,127 @@ # $FreeBSD$ begin 644 img-1x1-4096-mbr.qcow.gz -M'XL("+ED'U0``VEM9RTQ>#$M-#`Y-BUM8G(N<6-O=RYO=70`K9R];B/)&47S -M>8K>U('`6]W57949"]B`LW5@.W7]QOL`>GA3(BF1TKVZVO7,$#,2J.]#%WET -MM-@YY.ET^;4L$9EW.GU]O6.X^>;PMS__\^S^>[G\]_[@LP^F+J0^? -M;V%9K^L>=OUZ>EL77J;:^@:V[N[KU#US=W6$_K_O+C\MA^5Q0"Q^/ -MNUS7W8X+\>AMW[N^OWXX+BZ/WL\[;A#'C6KA_K#PM^NZ_UZO+XCC'FI=>ECW -M^X?C!G'@U@6Z;GE; -M=]"I5:W;'M:=GFY`W]8E.B6X@^4NTRG!'2QWA4X)[F"YJW1*<`?+7:-3@CM8 -M[CJ=$MP%R]V@4X*[8+F;=$IP%QQWX%."N^"X`_-=4-P%QQV8[X+B+CCNP'P7 -M%'?!<0?FNZ"X"XX[,-\%Q=WJN`/SW:JX6QUW8+Y;%7>KY8[Y;E7:X"\QWF^)N<]P%YKM-<;ZX -M6YGO=L7=[KA;F>]VQ=WNN%N9[W;%W>ZX6YGO=L7=X;A;F>\.Q=WAN%N9[P[% -MW6&Y8[X[%'>'Y8[Y[E#<'98[YKM#<7=8[ICO#L7=8;ECOCL4=X?ECOGN4-PE -MRQWS75+<)1^:XH[HKC+C+?%<5=<=Q%YKNBN"N.N\A\5Q1WMW^& -MU.N8[ZKBKCKN(O-=5=Q5RQWS757<51WR'D^`.)\L=\1U.@CN<''>)3W'N -M8/N[1'P'U=_!]G>)^`ZJOX/M[Q+Q'51_!]O?)>([J/X.MK]+Q'=0_1UL?Y>( -M[Z#Z.]C^+A'?0?5WL/U=(KZ#ZN]@^[M$?`?5W\'V=XGX#JJ_@^WO$O$=5'\' -MV]\EXCNH_@ZVOTO$=U#]'6Q_EYCO5'\'V]\EYCO5W\'V=YE/">YL?Y>9[U1_ -M!]O?9>8[U=_!]G>9^4[U=[#]76:^4_T=;'^7F>]4?P?;WV7F.]7?P?9WF?E. -M]7>P_5UFOE/]'6Q_EYGO5'\'V]]EYCO5W\'V=YGY3O5WL/U=9KY3_1UL?Y>9 -M[U1_!]O?9>8[U=_!]G>9^4[U=[#]7>%3@CO;WQ7F.]7?P?9WA?E.]7>P_5UA -MOE/]'6Q_5YCO5'\'V]\5YCO5W\'V=X7Y3O5WL/U=8;Y3_1UL?U>8[U1_!]O? -M%>8[U=_!]G>%^4[U=[#]76&^4_T=;']7F.]4?P?;WQ7F.]7?P?9WA?E.]7>P -M_5UAOE/]'6Q_5_F4X,[V=Y7Y3O5WL/U=9;Y3_1UL?U>9[U1_!]O?5>8[U=_! -M]G>5^4[U=[#]766^4_T=;']7F>]4?P?;WU7F.]7?P?9WE?E.]7>P_5UEOE/] -M'6Q_5YGO5'\'V]]5YCO5W\'V=Y7Y3O5WL/U=9;Y3_1UL?U>9[U1_!]O?-3XE -MN+/]76.^4_T=;'_7F.]4?P?;WS7F.]7?P?9WC?E.]7>P_5UCOE/]'6Q_UYCO -M5'\'V]\UYCO5W\'V=XWY3O5WL/U=8[Y3_1UL?]>8[U1_!]O?->8[U=_!]G>- -M^4[U=[#]76.^4_T=;'_7F.]4?P?;WS7F.]7?P?9WG4\)[FQ_UYGO5'\'V]]U -MYCO5W\'V=YWY3O5WL/U=9[Y3_1UL?]>9[U1_!]O?=>8[U=_!]G>=^4[U=[#] -M76>^4_T=;'_7F>]4?P?;WW7F.]7?P?9WG?E.]7>P_5UGOE/]'6Q_UYGO5'\' -MV]]UYCO5W\'V=YWY3O5WL/W=X%.".]O?#>8[U=_!]G>#^4[U=[#]W6"^4_T= -M;'\WF.]4?P?;WPWF.]7?P?9W@_E.]7>P_=U@OE/]'6Q_-YCO5'\'V]\-YCO5 -MW\'V=X/Y3O5WL/W=8+Y3_1UL?S>8[U1_!]O?#>8[U=_!]G>#^4[U=[#]W6"^ -M4_T=;'\W^93@SO9WD_E.]7>P_=UDOE/]'6Q_-YGO5'\'V]]-YCO5W\'V=Y/Y -M3O5WL/W=9+Y3_1UL?S>9[U1_!]O?3>8[U=_!]G>3^4[U=[#]W62^4_T=;'\W -MF>]4?P?;WTWF.]7?P?9WD_E.]7?A]L&'=\^;\Q><;R5>/SC?+F__=GMRS@?%P[D?GHQ?GN[6L;;R;4K>05"Y -M'9?EWU\LC'$IY=/"?]VN+_SLI^/U]='Q6+:XQ'U)X;L'_L_?_DV^-U;Z^N@_ -M]?A=UMFWO/L[NOO"=#W_'\CLGE[]LZ_OZ&UZF7;^#![I!7Q]_? -M\,^S]^DUR/?/\VN1WMY?W_]!5&_/[_)^?>1G1G@X[A?7MWP^[NO/C./QZW&W -M+ICC+H_KZI?/[==7]\OGJV/-]O_S9'QZ)>TWOW-?ECQ^YU[6A9\K@OAJEI?_ -CG"CD3WW'\V]/C[\O"[?KPI_V"&ZG_7R5/_X'_3?=L<%7```` +M'XL("+`S(E0``VEM9RTQ>#$M-#`Y-BUM8G(N<6-O=RYO=70`K9W+CAM)DD7W +M]174^RW1S()DA-YH8`:87<]B9K;%YYH?H(\?E13AGFD\5U;=5:I$08(4%Z3G +MT1&ZZ\ASO?[Y;;7:V&K8KH9I=3FLOO]X_K#5G1_<_UA]^^___*^W=[]]^^WG +MF*U_\53Z\>"KF.?N;?UCW>;\CZ>.J_7T)^:^?QC-W7EU\2^\NCMO]G;NY6\_ +MWRP_YVKP_MM=S7/+VS5Q>L.?>WU?T]NUGZ?W][U=%V]WHP:W]P;_.<_]/K\^ +M%V]WI^;&>W/7]'9=O-U)S>U_"8L+6`YJ[EC,#?C42ID;\2G!G97<3?B4X,Y*[O;XE.#.2NX. +M^)3@SDKNCOB4X,Y*[D[XE.#.2^[.^)3@SDON+OB4X,XK[HR?$MQYQ9V1[UQQ +MYQ5W1KYSQ9U7W!GYSA5W7G%GY#M7W'G%G9'O7'$7%7=&O@O%753<&?DN%'=1 +M^"\5=E-R1[T)Q%R5WY+M0W$7)'?DN%'=1^"\5=E-R1[T)Q-Y3\& +MQ=U0^&Q1W0\6=\U."NZ'BSLEW@^)NJ+AS\MV@N!LJ[IQ\-RCNAHH[)]\- +MBKNAXL[)=X/B;E-QY^2[C>)N4W'GY+N-XFY3^VRCN-B5WY+N-XFY3^ +MVRCN-B5WY+N-XFY3^VRCN-B5WY+N-XFY;^VRKNMB5WY+NMXFY;<1?\ +ME.!N6W$7Y+NMXFY;<1?DNZWB;EMQ%^2[K>)N6W$7Y+NMXFY;<1?DNZWB;E=Q +M%^2[G>)N5W$7Y+N=XFY7^VRGN=B5WY+N=XFY7^VRGN=B5WY+N=XFY7 +M^VRGN=B5WY+N=XFXLN2/?C8J[L>2.?#2.?#<;>ON-N0 +M[_:*NWW%W89\MU?<[2ON-N2[O>)N^<^0>HY\=U#<'2KN-N2[@^+N4')'OCLH +M[@XE=^2[@^+N4')'OCLH[@XE=^2[@^+N4')'OCLH[@XE=^2[@^+N6')'OCLJ +M[HXE=^2[H^+N6'&WY:<$=\>*NRWY[JBX.U;<;)N2[X[*NZ.%7=; +M\MU1<7>LN-N2[XZ*NU/%W99\=U+*NQWY[JRX.U?<[)N1[X[*^[.%7<[\MU9<7>NN-N1 +M[\Z*NTO%W8Y\=U'<72KN=N2[B^+N4G)'OKLH[BXE=^2[B^+N4G)'OKLH[BXE +M=^2[B^+N4G)'OKLH[BXE=^2[B^#.EN_H.?"=K05WMBZY`]_96G!GZXJ[D9]B +M[JSL[T;PG:G^SLK^;@3?F>KOK.SO1O"=J?[.ROYN!-^9ZN^L[.]&\)VI_L[* +M_FX$WYGJ[ZSL[T;PG:G^SLK^;@3?F>KOK.SO1O"=J?[.ROYN!-^9ZN^L[.]& +M\)VI_L[*_FX$WYGJ[ZSL[T;PG:G^SLK^;B3?J?[.ROYN)-^I_L[*_F[BIP1W +M97\WD>]4?V=E?S>1[U1_9V5_-Y'O5']G97\WD>]4?V=E?S>1[U1_9V5_-Y'O +M5']G97\WD>]4?V=E?S>1[U1_9V5_-Y'O5']G97\WD>]4?V=E?S>1[U1_9V5_ +M-Y'O5']G97\WD>]4?V=E?S>1[U1_9V5_-Y'O5']G97^WYZ<$=V5_MR??J?[. +MROYN3[Y3_9V5_=V>?*?Z.RO[NSWY3O5W5O9W>_*=ZN^L[._VY#O5WUG9W^W) +M=ZJ_L[*_VY/O5']G97^W)]^I_L[*_FY/OE/]G97]W9Y\I_H[*_N[/?E.]7=6 +M]G=[\IWJ[ZSL[_;D.]7?6=G?[KOK.SO#N0[U=]9V=\=^2G!7=G?'KOK.SOCN0[U=]9 +MV=\=R7>JO[.ROSN2[U1_9V5_=R3?J?[.RO[N2+Y3_9V5_=V1?*?Z.RO[NR/Y +M3O5W5O9W1_*=ZN^L[.]._)3@KNSO3N0[U=]9V=^=R'>JO[.ROSN1[U1_9V5_ +M=R+?J?[.RO[N1+Y3_9V5_=V)?*?Z.RO[NQ/Y3O5W5O9W)_*=ZN^L[.].Y#O5 +MWUG9WYW(=ZJ_L[*_.Y'O5']G97]W(M^I_L[*_NY$OE/]G97]W8E\I_H[*_N[ +M$_E.]7=6]G=G?DIP5_9W9_*=ZN^L[._.Y#O5WUG9WYW)=ZJ_L[*_.Y/O5']G +M97]W)M^I_L[*_NY,OE/]G97]W9E\I_H[*_N[,_E.]7=6]G=G\IWJ[ZSL[\[D +M.]7?6=G?GKOK.SO +M+N0[U=]9V=]=R'>JO[.RO[N0[U1_Y\MWTMRJSX'OOC_%W'GJ[Y;[]%:=._"= +MJ_[.4W^WFKE;+=S%FI]B[CSU=ZN9N]7O;0Y\YZJ_\]3?K:[I[(+NOW/5WWGJ +M[]K9]3GPG:O^SE-_!W/@.U?]G:?^#N;`=Z[Z.T_]W3+WH,^![USU=Y[ZNP?+ +MW*K-@>]<]7>>^KL',W]<]7>>^CN8`]^YZN\\]7JO_/4WSVKO//5W,$>^4_V=I_YNF7O4Y\AW +MJK_SU-\]6N8:=W3_G:O^SE-_]VCF[E'GCGRG^CM/_=VCF;M'G3ORG>KO//5W +MCZXW9T>^4_V=I_ZNG5V?(]^I_LY3?P=SY#O5WWGJ[V".?*?Z.T_]W3+WN,^1 +M[U1_YZF_>[S,=>[(=ZJ_\]3?/9ZY>]RXH_OO7/5WGOJ[QS-WCQMW=/^=J_[. +M4W_W^)K/CNZ_<]7?>>KOVMGU.?*=ZN\\]7JO_/4WRUS +M3_H<^4[U=Y[ZNR?+7...[K]SU=]YZN^>S-P]Z=R1[U1_YZF_>S)S]Z1S1[Y3 +M_9VG_N[)]>;LR'>JO_/4W[6SZW/D.]7?>>KO8(Y\I_H[3_T=S)'O5'_GJ;]; +MYI[V.?*=ZN\\]7=/E[G.'?E.]7>>^KNG,W=/&W=T_YVK_LY3?_=TYNYIXX[N +MOW/5WWGJ[YY>\]G1_7>N^CM/_5T[NSY'OE/]G:?^#N;(=ZJ_\]3?P1SY3O5W +MGOJ[9>Y9GR/?J?[.4W_W;)EKW-']=Z[Z.T_]W;.9NV>=._*=ZN\\]7?/9NZ> +M=>[(=ZJ_\]3?/;O>G!WY3O5WGOJ[=G9]CGRG^CM/_1W,D>]4?^>IOX,Y\IWJ +M[SSU=\O<\SY'OE/]G:?^[ODRU[DCWZG^SE-_]WSF[GGCCNZ_<]7?>>KOGL_< +M/6_>^CN8 +M(]^I_LY3?[?,O>ASY#O5WWGJ[UXL>^KL7UYNS(]^I_LY3?]?.KL^1[U1_YZF_@SGRG>KO//5W +M,$>^4_V=I_YNF7O9Y\AWJK_SU-^]7.8Z=^0[U=]YZN]>SMR];-S1_7>N^CM/ +M_=W+F;N7C3NZ_\Y5?^>IOWMYS6=']]^YZN\\]7?M[/H<^4[U=Y[Z.Y@CWZG^ +MSE-_!W/D.]7?>>KOEKE7?8Y\I_H[3_W=JV6N<4?WW[GJ[SSU=Z]F[EYU[LAW +MJK_SU-^]FKE[U;DCWZG^SE-_]^IZ>KOVMGU.?*=ZN\\]7JO_/4WRUSK_L<^4[U=Y[ZN]?+7.>.?*?Z.T_]W>N9N]>-.[K_ +MSE5_YZF_>SUS][IQ1_??N>KO//5WKZ_Y[.C^.U?]G:?^KIU=GR/?J?[.4W\' +M<^0[U=]YZN]@CGRG^CM/_=TR]Z;/D>]4?^>IOWNSS#7NZ/X[5_V=I_[NS7&_.CGRG^CM/_5T[NSY'OE/]G:?^ +M#N;(=ZJ_\]3?P1SY3O5WGOJ[9>YMGR/?J?[.J_XNZ/X[5_V=5_U=T/UWKOH[ +MK_J[H/OO7/5W7O5W0???N>KOO.KO@NZ_<]7?>=7?!=U_YZJ_\ZJ_"[K_SE5_ +MYZ*_>]?GR'>JO_/4W[U;YAIW=/^=J_[.4W_W;N;N7>>.?*?Z.T_]W;N9NW>= +M._*=ZN\\]7?OKC=G1[Y3_9VG_JZ=79\CWZG^SE-_!W/D.]7?>>KO8(Y\I_J[ +M6+Z3YM9]#GP7JK_[_A/WN%O\M.[<@>]"]7>1^KOUO+=NW-']=Z'ZNTC]W7KF +M;MVXH_OO0O5WD?J[]36?'=U_%ZJ_B]3?M;/K<^"[4/U=I/X.YL!WH?J[2/T= +MS('O0O5WD?J[9<[Z'/@N5'\7J;^S9:YQ1_??A>KO(O5W-K\\Z]R![T+U=Y'Z +M.YNYL\X=^"Y4?Q>IO[/KS=F![T+U=Y'ZNW9V?0Y\%ZJ_B]3?P1SX+E1_%ZF_ +M@SGP7:C^+E)_M\QYGR/?J?XN4G_GRUSGCGRG^KM(_9W/W'GCCNZ_"]7?1>KO +M?.;.&W=T_UVH_BY2?^?7?'9T_UVH_BY2?]?.KL^1[U1_%ZF_@SGRG>KO(O5W +M,$>^4_U=I/YNF8L^1[Y3_5VD_BZ6N<8=W7\7JK^+U-_%S%UT[LAWJK^+U-_% +MS%UT[LAWJK^+U-_%]>;LR'>JOXO4W[6SZW/D.]7?1>KO8(Y\I_J[2/T=S)'O +M5'\7J;];YH8^1[Y3_5VD_FY8YCIWY#O5WT7J[X:9NZ%Q1_??A>KO(O5WP\S= +MT+BC^^]"]7>1^KOAFL^.[K\+U=]%ZN_:V?4Y\IWJ[R+U=S!'OE/]7:3^#N;( +M=ZJ_B]3?+7.;/D>^4_U=I/YNL\PU[NC^NU#]7:3^;C-SM^G]4?Q>IO]O, +MW&TZ=^0[U=]%ZN\VUYNS(]^I_BY2?]?.KL^1[U1_%ZF_@SGRG>KO(O5W,$>^ +M4_U=I/YNF=OV.?*=ZN\B]7?;9:YS1[Y3_5VD_FX[<[=MW-']=Z'ZNTC]W7;F +M;MNXH_OO0O5WD?J[[36?'=U_%ZJ_B]3?M;/K<^0[U=]%ZN]@CGRG^KM(_1W, +MD>]4?Q>IOUOF=GV.?*?ZNTC]W6Z9:]S1_7>A^KM(_=UNYF[7N2/?J?XN4G^W +MF[G;=>[(=ZJ_B]3?[:XW9T>^4_U=I/ZNG5V?(]^I_BY2?P=SY#O5WT7J[V". +M?*?ZNTC]W3(W]CGRG>KO(O5WXS+7N2/?J?XN4G\WSMR-C3NZ_RY4?Q>IOQMG +M[L;&'=U_%ZJ_B]3?C==\=G3_7:C^+E)_U\ZNSY'O5'\7J;^#.?*=ZN\B]7

A^KM(_=TTKOEKGW?8Y\I_J[2/W=^V6N^4_U=I/[N_1^KOWUWQV=/]=J/XN4G_7SJ[/D>]4?Q>IOX,Y\IWJ[R+U +M=S!'OE/]7:3^;IG[T.?(=ZJ_B]3??5CF&G=T_UVH_BY2?_=AYNY#YXY\I_J[ +M2/W=AYF[#YT[\IWJ[R+U=Q^N-V='OE/]7:3^KIU=GR/?J?XN4G\'<^0[U=]% +MZN]@CGRG^KM(_=TR]['/D>]4?Q>IO_NXS'7NR'>JOXO4WWVKO(O5W,$>^ +M4_U=I/X.YLAWJK^+U-\M1^KM/RUSCCNZ_"]7?1>KO/LWK< +MD>]4?Q>IO_LT<_>I^4_U=I/[NT_7F[,AWJK^+U-^UL^MSY#O5WT7J[V". +M?*?ZNTC]'KO(O5WGY>YSAWY3O5WD?J[SS-WGQMW +M=/]=J/XN4G_W>>;N<^..[K\+U=]%ZN\^7_/9T?UWH?J[2/U=.[L^1[Y3_5VD +M_@[FR'>JOXO4W\$<^4[U=Y'ZNV7N2Y\CWZG^+E)_]V69:]S1_7>A^KM(_=V7 +MF;LOG3ORG>KO(O5W7V;NOG3NR'>JOXO4WWVYWIP=^4[U=Y'ZNW9V?8Y\I_J[ +M2/T=S)'O5'\7J;^#.?*=ZN^&Y3MI[FN?`]\-JK\;4G_W=9GKW('OOC_%W`VI +MO_LZ<_=UX6Y8\U/,W9#ZNZ\S=U]_;W/@NT'U=^UCF#RQO>_+CJY_LO +M^/ZQW\S?^?ZQMCMO^(^O46SZ#3]X>V>.OI3R7SD_NIWG5X.;S6J_OQG\G^7U +M^=_]Z?CQU\$WN]6P66VVJ]'_[!O^O__XW_2&?\[1EX__M\[OYUR)=7WB5#_\2WCLG;._?@;>BO@_<7\8>OSO03\M71EX__*^S=_)7KNY_G +M'U^`_OO_UE[^#$M-#`Y-BUP8SDX+G%C;W64/[#NYQO8NE=7M_Z-JWMUV+?K?OMT.2R?"VKA -M>K=PN:X[7:\/XKNW?>SZOCX<%Y?OWJ\[;A#'C6KA?K?P^W7=G]?K"^*XAUJ7 -M[M;]]7#<((Z;U;KR+BQ!P%+5NF;6;72JJW7#K(MT:O)U>.>YO:S;Z134ND#7 -M+<_K#CJUJG7W&CA]N0%]6Y?HE.`.EKM,IP1WL-P5.B6X@^6NTBG!'2QWC4X) -M[F"YZW1*Z"Y6[2*<'=XZ^?-]R!3PGN@N,.S'=!<1<<=V"^"XJ[ -MX+@#\UU0W`7''9CO@N(N..[`?!<4=ZOC#LQWJ^)N==R!^6Y5W*V6.^:[57&W -M6NZ8[U;%W6JY8[Y;%7>KY8[Y;E78[S;%W>:X"\QWF^)N<]P%YKM-<;8[Z+B+EKNF.^BXBY:[ICOHN(N6NZ8[Z+B+EKN -MF.^BXBY:[ICOHN(N6NZ8[Z+B;K?<,=_MBKO=[XVYEOML5=[OC;F6^VQ5WN^-N9;[;%7>'XVYEOCL4=X?C -M;F6^.Q1WA^6.^>Y0W!V6.^:[0W%W6.Z8[P[%W6&Y8[X[%'>'Y8[Y[E#<'98[ -MYKM#<9^*XJXX[B+S75'<%<==9+XKBKOBN(O,=T5Q5QQWD?FN -M*.YN_PVIUS'?5<5===Q%YKNJN*N6.^:[JKBKECOFNZJXJY8[YKNJN*N6.^:[ -MJKBKECOFNZJXJY8[YKNJN&N6.^:[IKAKECOFNZ:X:XZ[G4\)[IKC;F>^:XJ[ -MYKC;F>^:XJXY[G;FNZ:X:XZ[G?FN*>Z:XVYGOFN*N^ZXVYGONN*N.^YVYKNN -MN.N6.^:[KKCKECOFNZZXZY8[YKNNN.N6.^:[KKCKECOFNZZXZY8[YKNNN!N6 -M.^:[H;@;ECOFNZ&X&XZ[@T\)[H;C[F"^&XJ[X;@[F.^&XFXX[@[FNZ&X&XZ[ -M@_EN*.Z&X^Y@OAN*N^FX.YCOIN)N.NX.YKNIN)N6.^:[J;B;ECOFNZFXFY8[ -MYKNIN)N6.^:[J;B;ECOFNZFXFY8[YKLIN,/M`[V.^`XGP1U.ECOB.YP$=S@Y -M[A*?XMS!]G>)^`ZJOX/M[Q+Q'51_!]O?)>([J/X.MK]+Q'=0_1UL?Y>([Z#Z -M.]C^+A'?0?5WL/U=(KZ#ZN]@^[M$?`?5W\'V=XGX#JJ_@^WO$O$=5'\'V]\E -MXCNH_@ZVOTO$=U#]'6Q_EXCOH/H[V/XN,=^I_@ZVOTO,=ZJ_@^WO,I\2W-G^ -M+C/?J?X.MK_+S'>JOX/M[S+SG>KO8/N[S'RG^CO8_BXSWZG^#K:_R\QWJK^# -M[>\R\YWJ[V#[N\Q\I_H[V/XN,]^I_@ZVO\O,=ZJ_@^WO,O.=ZN]@^[O,?*?Z -M.]C^+C/?J?X.MK_+S'>JOX/M[S+SG>KO8/N[PJ<$=[:_*\QWJK^#[>\*\YWJ -M[V#[N\)\I_H[V/ZN,-^I_@ZVORO,=ZJ_@^WO"O.=ZN]@^[O"?*?Z.]C^KC#? -MJ?X.MK\KS'>JOX/M[PKSG>KO8/N[PGRG^CO8_JXPWZG^#K:_*\QWJK^#[>\* -M\YWJ[V#[N\)\I_H[V/ZN\BG!G>WO*O.=ZN]@^[O*?*?Z.]C^KC+?J?X.MK^K -MS'>JOX/M[RKSG>KO8/N[RGRG^CO8_JXRWZG^#K:_J\QWJK^#[>\J\YWJ[V#[ -MN\I\I_H[V/ZN,M^I_@ZVOZO,=ZJ_@^WO*O.=ZN]@^[O*?*?Z.]C^KC+?J?X. -MMK]K?$IP9_N[QGRG^CO8_JXQWZG^#K:_:\QWJK^#[>\:\YWJ[V#[N\9\I_H[ -MV/ZN,=^I_@ZVOVO,=ZJ_@^WO&O.=ZN]@^[O&?*?Z.]C^KC'?J?X.MK]KS'>J -MOX/M[QKSG>KO8/N[QGRG^CO8_JXQWZG^#K:_:\QWJK^#[>\ZGQ+JOX/M[SKS -MG>KO8/N[SGRG^CO8_JXSWZG^#K:_Z\QWJK^#[>\Z\YWJ[V#[N\Y\I_H[V/ZN -M,]^I_@ZVO^O,=ZJ_@^WO.O.=ZN]@^[O!IP1WMK\;S'>JOX/M[P;SG>KO8/N[ -MP7RG^CO8_FXPWZG^#K:_&\QWJK^#[>\&\YWJ[V#[N\%\I_H[V/YN,-^I_@ZV -MOQO,=ZJ_@^WO!O.=ZN]@^[O!?*?Z.]C^;C#?J?X.MK\;S'>JOX/M[P;SG>KO -M8/N[P7RG^CO8_F[R*<&=[>\F\YWJ[V#[N\E\I_H[V/YN,M^I_@ZVOYO,=ZJ_ -M@^WO)O.=ZN]@^[O)?*?Z.]C^;C+?J?X.MK^;S'>JOX/M[R;SG>KO8/N[R7RG -M^CO8_FXRWZG^#K:_F\QWJK^#[>\F\YWJ[\+M@X=UR\LZXKN?4YR[\-#?W>ZG -MM[QP1WP75'\7'OJ[Y:\?^/'MR_WK[89ZZ_G^+7]C -M88Q+>;OPW[?K.]^_)6]+VQ[/]O3`G"]O=P^(YW:E]V]YGI(/D'77XVZ_^/L7 -MSP>.Q[+%)>Y+"A^]PC_^\1]RX/CK#GQ99^^_^'S!^,BZ\R^@5U_YU)\^EX7R -M@>?N(&>T!>';\AX?\,2WQS4YC7S_,Y(6\O?Y#_8);G -MYW=YN3XB^7!WW'>N;WE[W+/DC_NOQZMUP1QWN5]7WWUNW[^ZSV^OCD76_\^3 -M\>;6)A_\R7U:UD7?JT(CK.9GW[_%_)>/_#C^Y?[U\O"[;SPTW\!]AVL -%?"%7```` +M'XL("+(S(E0``VEM9RTQ>#$M-#`Y-BUP8SDX+G%C;WG`Z^;F[L=JM;;5L%D-T^J\7WW_]?QAJY]^V___5?;W_^\>V/ +MNS&[^<53Z=>#KX9Y[M[6/[ZV.?_QU&%U,_W&W/+MK-;BY-_CO>>[/ +M^?6Y>+M;-3?>F[NDM^OB[4YJ;O=+6%S`LE=SAV)NP*>.:NY4S*WQJ3//V2^^ +MMG=S&WS*U)SCW*K-;?&I4'/W-7#S=@%ZF1OQ*<&=E=Q-^)3@SDKN=OB4X,Y* *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 15:27:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A99C5412 for ; Wed, 24 Sep 2014 15:27:15 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70533CEE for ; Wed, 24 Sep 2014 15:27:15 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OFRF6W091779 for ; Wed, 24 Sep 2014 15:27:15 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s8OFRFgP091772 for svn-src-all@freebsd.org; Wed, 24 Sep 2014 15:27:15 GMT (envelope-from bdrewery) Received: (qmail 99404 invoked from network); 24 Sep 2014 10:27:13 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 24 Sep 2014 10:27:13 -0500 Message-ID: <5422E2CA.6050000@FreeBSD.org> Date: Wed, 24 Sep 2014 10:27:06 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r272032 - head/sys/conf References: <201409231704.s8NH4Lcv098184@svn.freebsd.org> <1598020.ur8YbI6DkF@ralph.baldwin.cx> In-Reply-To: <1598020.ur8YbI6DkF@ralph.baldwin.cx> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sBNWcvLaCLMcwBv7o5CTqumiTwVqjqX3n" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 15:27:15 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sBNWcvLaCLMcwBv7o5CTqumiTwVqjqX3n Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 9/24/2014 8:38 AM, John Baldwin wrote: > On Tuesday, September 23, 2014 05:04:21 PM Bryan Drewery wrote: >> Author: bdrewery >> Date: Tue Sep 23 17:04:21 2014 >> New Revision: 272032 >> URL: http://svnweb.freebsd.org/changeset/base/272032 >> >> Log: >> DEBUG_LOCKS no longer modifies 'struct vnode', nor does fstat(1) use= it. >> fstat(1) now uses libprocstat(9). There is no userland impact to us= ing >> this. >=20 > As your followup noted, it does change the size of 'struct lock' (and t= hus > 'struct vnode') still. While fstat does not use it for live, it probab= ly > still uses it for coredumps. However, lsof uses kvm access, so it will= break. > I don't think that is worth noting here, but more of an FYI. >=20 Hmm, I see my commit logs were not fully accurate. I was too focused on the stale comment about fstat(1). --=20 Regards, Bryan Drewery --sBNWcvLaCLMcwBv7o5CTqumiTwVqjqX3n Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJUIuLKAAoJEDXXcbtuRpfPCf0H/jMFpK2eaP3iC6MQD3uLvUnB Bn67mKToZ7q8YC9rli/sdNfjjgxwU5A+8rrw95cMSW37PEVZlZMqzzkfWegFi6Hf 5hViMnQLAxD1LNuYXIdcwh9DQbB0YI4E5SXkaXC5z9xGKOoVx8OVcLoJvTBrk23g aFW810OkMD6hdNo3B46vHgW7PyKFHg9idnTdTx6jbhkK0ILn/ssIg5QkrfrMW17i DYLJmGvxkOGF/a2JcF7Rhy+FHcGx17S4t2LQ9UOymqrqmfqT6dy0HSD8JHOqrOJH 4Ben8Qz8PNxwSkSBjn8MzZc65uOTYW8ZsitW0bRR5aGyV8ZhAaaYv4HfMoCJTFk= =NFEc -----END PGP SIGNATURE----- --sBNWcvLaCLMcwBv7o5CTqumiTwVqjqX3n-- From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 18:12:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8BFED73; Wed, 24 Sep 2014 18:12:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2542601; Wed, 24 Sep 2014 18:12:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OICQPg018032; Wed, 24 Sep 2014 18:12:26 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OICN99018013; Wed, 24 Sep 2014 18:12:23 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201409241812.s8OICN99018013@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Wed, 24 Sep 2014 18:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r272074 - in vendor/apr-util/dist: . crypto dbd dbm include test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 18:12:26 -0000 Author: peter Date: Wed Sep 24 18:12:23 2014 New Revision: 272074 URL: http://svnweb.freebsd.org/changeset/base/272074 Log: Vendor import apr-util-1.5.4 - a minor bug fix release. Modified: vendor/apr-util/dist/CHANGES vendor/apr-util/dist/NOTICE vendor/apr-util/dist/apr-util.spec vendor/apr-util/dist/configure vendor/apr-util/dist/crypto/apr_crypto.c vendor/apr-util/dist/crypto/apr_passwd.c vendor/apr-util/dist/dbd/apr_dbd_mysql.c vendor/apr-util/dist/dbd/apr_dbd_odbc.c vendor/apr-util/dist/dbm/NWGNUmakefile vendor/apr-util/dist/include/apu_version.h vendor/apr-util/dist/test/Makefile.win Modified: vendor/apr-util/dist/CHANGES ============================================================================== --- vendor/apr-util/dist/CHANGES Wed Sep 24 15:15:14 2014 (r272073) +++ vendor/apr-util/dist/CHANGES Wed Sep 24 18:12:23 2014 (r272074) @@ -1,4 +1,30 @@ -*- coding: utf-8 -*- +Changes with APR-util 1.5.4 + + *) MySQL driver: Fix incorrect handling of bad parameter in the + driver support for apr_dbd_transaction_end(). PR 56330. + [Weiqiang Li ] + + *) apr_crypto_get_driver(): Fix invalid storage reference on error path. + [Philip Martin ] + + *) Fix compile failure for Android. PR 56627. [Fredrik Fornwall + , Jeff Trawick] + + *) Fix to let ODBC driver build with MSVC6, which does not have intptr_t + [Tom Donovan] + + *) Windows cmake build: Fix incompatiblities with Visual Studio + generators with all cmake versions, and the NMake Makefile generator + with cmake 2.8.12 and later. PR 56616 and other bugs. [Jeff Trawick, + Bert Huijben] + + *) Fix detection of Berkeley DB 6.0. PR 55277. + [Lars Wendler ] + + *) Improve platform detection for bundled expat by updating + config.guess and config.sub. [Rainer Jung] + Changes with APR-util 1.5.3 *) Cygwin: Use correct file extension when loading APR DSOs. PR 55587. Modified: vendor/apr-util/dist/NOTICE ============================================================================== --- vendor/apr-util/dist/NOTICE Wed Sep 24 15:15:14 2014 (r272073) +++ vendor/apr-util/dist/NOTICE Wed Sep 24 18:12:23 2014 (r272074) @@ -1,7 +1,7 @@ Apache Portable Runtime Utility Library -Copyright (c) 2011 The Apache Software Foundation. +Copyright (c) 2000-2014 The Apache Software Foundation. -This product includes software developed by +This product includes software developed at The Apache Software Foundation (http://www.apache.org/). Portions of this software were developed at the National Center Modified: vendor/apr-util/dist/apr-util.spec ============================================================================== --- vendor/apr-util/dist/apr-util.spec Wed Sep 24 15:15:14 2014 (r272073) +++ vendor/apr-util/dist/apr-util.spec Wed Sep 24 18:12:23 2014 (r272074) @@ -3,7 +3,7 @@ Summary: Apache Portable Runtime Utility library Name: apr-util -Version: 1.5.3 +Version: 1.5.4 Release: 1 License: Apache Software License Group: System Environment/Libraries Modified: vendor/apr-util/dist/configure ============================================================================== --- vendor/apr-util/dist/configure Wed Sep 24 15:15:14 2014 (r272073) +++ vendor/apr-util/dist/configure Wed Sep 24 18:12:23 2014 (r272074) @@ -11608,19 +11608,34 @@ fi apu_db_version=0 # Maximum supported version announced in help string. - # Although we search for all versions up to 5.9, + # Although we search for all versions up to 6.9, # we should only include existing versions in our # help string. - db_max_version=53 - db_min_version=41 dbm_list="sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4" + db_max_version=48 + db_min_version=41 + db_version="$db_min_version" + while [ $db_version -le $db_max_version ] + do + dbm_list="$dbm_list, db$db_version" + db_version=`expr $db_version + 1` + done + db_max_version=53 + db_min_version=50 + db_version="$db_min_version" + while [ $db_version -le $db_max_version ] + do + dbm_list="$dbm_list, db$db_version" + db_version=`expr $db_version + 1` + done + db_max_version=60 + db_min_version=60 db_version="$db_min_version" while [ $db_version -le $db_max_version ] do dbm_list="$dbm_list, db$db_version" db_version=`expr $db_version + 1` done - dbm_list="$dbm_list, db60" # Check whether --with-dbm was given. @@ -12093,8 +12108,8 @@ if test "${with_berkeley_db+set}" = set; all_places="$check_places" - # Start version search at version 5.9 - db_version=59 + # Start version search at version 6.9 + db_version=69 while [ $db_version -ge 40 ] do db_major=`echo $db_version | sed -e 's/.$//'` @@ -12178,7 +12193,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5" -o ""${db_major}"" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -12580,7 +12595,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "3" = "3" -o "3" = "4" -o "3" = "5"; then + if test "3" = "3" -o "3" = "4" -o "3" = "5" -o "3" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -12978,7 +12993,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "2" = "3" -o "2" = "4" -o "2" = "5"; then + if test "2" = "3" -o "2" = "4" -o "2" = "5" -o "2" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -13376,7 +13391,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -13774,7 +13789,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -14186,7 +14201,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -14587,7 +14602,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -14988,7 +15003,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "2" = "3" -o "2" = "4" -o "2" = "5"; then + if test "2" = "3" -o "2" = "4" -o "2" = "5" -o "2" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -15389,7 +15404,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "3" = "3" -o "3" = "4" -o "3" = "5"; then + if test "3" = "3" -o "3" = "4" -o "3" = "5" -o "3" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -15794,7 +15809,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5" -o ""${db_major}"" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -16202,7 +16217,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5" -o ""${db_major}"" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -16534,8 +16549,8 @@ fi all_places="$check_places" - # Start version search at version 5.9 - db_version=59 + # Start version search at version 6.9 + db_version=69 while [ $db_version -ge 40 ] do db_major=`echo $db_version | sed -e 's/.$//'` @@ -16619,7 +16634,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5" -o ""${db_major}"" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -17021,7 +17036,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "3" = "3" -o "3" = "4" -o "3" = "5"; then + if test "3" = "3" -o "3" = "4" -o "3" = "5" -o "3" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -17419,7 +17434,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "2" = "3" -o "2" = "4" -o "2" = "5"; then + if test "2" = "3" -o "2" = "4" -o "2" = "5" -o "2" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -17817,7 +17832,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -18215,7 +18230,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of Modified: vendor/apr-util/dist/crypto/apr_crypto.c ============================================================================== --- vendor/apr-util/dist/crypto/apr_crypto.c Wed Sep 24 15:15:14 2014 (r272073) +++ vendor/apr-util/dist/crypto/apr_crypto.c Wed Sep 24 18:12:23 2014 (r272074) @@ -204,7 +204,7 @@ APU_DECLARE(apr_status_t) apr_crypto_get if (err && buffer) { apr_dso_error(dso, buffer, ERROR_SIZE - 1); err->msg = buffer; - err->reason = modname; + err->reason = apr_pstrdup(pool, modname); *result = err; } } Modified: vendor/apr-util/dist/crypto/apr_passwd.c ============================================================================== --- vendor/apr-util/dist/crypto/apr_passwd.c Wed Sep 24 15:15:14 2014 (r272073) +++ vendor/apr-util/dist/crypto/apr_passwd.c Wed Sep 24 18:12:23 2014 (r272074) @@ -66,6 +66,12 @@ static void crypt_mutex_unlock(void) #endif #endif +#if defined(WIN32) || defined(BEOS) || defined(NETWARE) || defined(__ANDROID__) +#define CRYPT_MISSING 1 +#else +#define CRYPT_MISSING 0 +#endif + /* * Validate a plaintext password against a smashed one. Uses either * crypt() (if available) or apr_md5_encode() or apr_sha1_base64(), depending @@ -77,7 +83,7 @@ APU_DECLARE(apr_status_t) apr_password_v const char *hash) { char sample[200]; -#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) +#if !CRYPT_MISSING char *crypt_pw; #endif if (hash[0] == '$' @@ -100,7 +106,7 @@ APU_DECLARE(apr_status_t) apr_password_v /* * It's not our algorithm, so feed it to crypt() if possible. */ -#if defined(WIN32) || defined(BEOS) || defined(NETWARE) +#if CRYPT_MISSING return (strcmp(passwd, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; #elif defined(CRYPT_R_CRYPTD) apr_status_t rv; Modified: vendor/apr-util/dist/dbd/apr_dbd_mysql.c ============================================================================== --- vendor/apr-util/dist/dbd/apr_dbd_mysql.c Wed Sep 24 15:15:14 2014 (r272073) +++ vendor/apr-util/dist/dbd/apr_dbd_mysql.c Wed Sep 24 18:12:23 2014 (r272074) @@ -1050,9 +1050,9 @@ static int dbd_mysql_end_transaction(apr else { ret = mysql_commit(trans->handle->conn); } + ret |= mysql_autocommit(trans->handle->conn, 1); + trans->handle->trans = NULL; } - ret |= mysql_autocommit(trans->handle->conn, 1); - trans->handle->trans = NULL; return ret; } /* Whether or not transactions work depends on whether the Modified: vendor/apr-util/dist/dbd/apr_dbd_odbc.c ============================================================================== --- vendor/apr-util/dist/dbd/apr_dbd_odbc.c Wed Sep 24 15:15:14 2014 (r272073) +++ vendor/apr-util/dist/dbd/apr_dbd_odbc.c Wed Sep 24 18:12:23 2014 (r272074) @@ -47,6 +47,21 @@ #include #endif +/* +* MSVC6 does not support intptr_t (C99) +* APR does not have a signed inptr type until 2.0 (r1557720) +*/ +#if defined(_MSC_VER) && _MSC_VER < 1400 +#if APR_SIZEOF_VOIDP == 8 +#define ODBC_INTPTR_T apr_int64_t +#else +#define ODBC_INTPTR_T apr_int32_t +#endif +#else +#define ODBC_INTPTR_T intptr_t +#endif + + /* Driver name is "odbc" and the entry point is 'apr_dbd_odbc_driver' * unless ODBC_DRIVER_NAME is defined and it is linked with another db library which * is ODBC source-compatible. e.g. DB2, Informix, TimesTen, mysql. @@ -114,9 +129,9 @@ struct apr_dbd_t char lastError[MAX_ERROR_STRING]; int defaultBufferSize; /* used for CLOBs in text mode, * and when fld size is indeterminate */ - intptr_t transaction_mode; - intptr_t dboptions; /* driver options re SQLGetData */ - intptr_t default_transaction_mode; + ODBC_INTPTR_T transaction_mode; + ODBC_INTPTR_T dboptions; /* driver options re SQLGetData */ + ODBC_INTPTR_T default_transaction_mode; int can_commit; /* controls end_trans behavior */ }; @@ -359,7 +374,7 @@ static SQLRETURN odbc_set_result_column( SQLHANDLE stmt) { SQLRETURN rc; - intptr_t maxsize, textsize, realsize, type, isunsigned = 1; + ODBC_INTPTR_T maxsize, textsize, realsize, type, isunsigned = 1; /* discover the sql type */ rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_UNSIGNED, NULL, 0, NULL, @@ -747,7 +762,7 @@ static void *odbc_get(const apr_dbd_row_ SQLRETURN rc; SQLLEN indicator; int state = row->res->colstate[col]; - intptr_t options = row->res->apr_dbd->dboptions; + ODBC_INTPTR_T options = row->res->apr_dbd->dboptions; switch (state) { case (COL_UNAVAIL): @@ -817,13 +832,13 @@ static apr_status_t odbc_parse_params(ap int *connect, SQLCHAR **datasource, SQLCHAR **user, SQLCHAR **password, int *defaultBufferSize, int *nattrs, - int **attrs, intptr_t **attrvals) + int **attrs, ODBC_INTPTR_T **attrvals) { char *seps, *last, *next, *name[MAX_PARAMS], *val[MAX_PARAMS]; int nparams = 0, i, j; *attrs = apr_pcalloc(pool, MAX_PARAMS * sizeof(char *)); - *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(intptr_t)); + *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(ODBC_INTPTR_T)); *nattrs = 0; seps = DEFAULTSEPS; name[nparams] = apr_strtok(apr_pstrdup(pool, params), seps, &last); @@ -1063,7 +1078,7 @@ static apr_dbd_t *odbc_open(apr_pool_t * SQLCHAR *datasource = (SQLCHAR *)"", *user = (SQLCHAR *)"", *password = (SQLCHAR *)""; int nattrs = 0, *attrs = NULL, connect = 0; - intptr_t *attrvals = NULL; + ODBC_INTPTR_T *attrvals = NULL; err_step = "SQLAllocHandle (SQL_HANDLE_DBC)"; err_htype = SQL_HANDLE_ENV; @@ -1117,10 +1132,10 @@ static apr_dbd_t *odbc_open(apr_pool_t * handle->default_transaction_mode = 0; handle->can_commit = APR_DBD_TRANSACTION_IGNORE_ERRORS; SQLGetInfo(hdbc, SQL_DEFAULT_TXN_ISOLATION, - &(handle->default_transaction_mode), sizeof(intptr_t), NULL); + &(handle->default_transaction_mode), sizeof(ODBC_INTPTR_T), NULL); handle->transaction_mode = handle->default_transaction_mode; SQLGetInfo(hdbc, SQL_GETDATA_EXTENSIONS ,&(handle->dboptions), - sizeof(intptr_t), NULL); + sizeof(ODBC_INTPTR_T), NULL); apr_pool_cleanup_register(pool, handle, odbc_close_cleanup, apr_pool_cleanup_null); return handle; } Modified: vendor/apr-util/dist/dbm/NWGNUmakefile ============================================================================== --- vendor/apr-util/dist/dbm/NWGNUmakefile Wed Sep 24 15:15:14 2014 (r272073) +++ vendor/apr-util/dist/dbm/NWGNUmakefile Wed Sep 24 18:12:23 2014 (r272074) @@ -235,7 +235,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms $(INSTDIRS) FORCE - copy $(OBJDIR)\*.nlm $(INSTALLBASE) + $(call COPY,$(OBJDIR)/*.nlm,$(INSTALLBASE)) # # Any specialized rules here Modified: vendor/apr-util/dist/include/apu_version.h ============================================================================== --- vendor/apr-util/dist/include/apu_version.h Wed Sep 24 15:15:14 2014 (r272073) +++ vendor/apr-util/dist/include/apu_version.h Wed Sep 24 18:12:23 2014 (r272074) @@ -38,7 +38,7 @@ */ -#define APU_COPYRIGHT "Copyright (c) 2013 The Apache Software " \ +#define APU_COPYRIGHT "Copyright (c) 2000-2014 The Apache Software " \ "Foundation or its licensors, as applicable." /* The numeric compile-time version constants. These constants are the @@ -62,7 +62,7 @@ * The Patch Level never includes API changes, simply bug fixes. * Reset to 0 when upgrading APR_MINOR_VERSION */ -#define APU_PATCH_VERSION 3 +#define APU_PATCH_VERSION 4 /** * The symbol APU_IS_DEV_VERSION is only defined for internal, Modified: vendor/apr-util/dist/test/Makefile.win ============================================================================== --- vendor/apr-util/dist/test/Makefile.win Wed Sep 24 15:15:14 2014 (r272073) +++ vendor/apr-util/dist/test/Makefile.win Wed Sep 24 18:12:23 2014 (r272074) @@ -88,6 +88,8 @@ APROUTDIR=$(OUTDIR) !IF "$(MODEL)" == "static" PROGRAM_DEPENDENCIES = \ $(APR_PATH)\$(APROUTDIR)\apr-1.lib \ + $(API_PATH)\$(OUTDIR)\apriconv-1.lib \ + ..\xml\expat\lib\$(OUTDIR)\xml.lib \ ..\$(OUTDIR)\aprutil-1.lib STATIC_CFLAGS = /D APR_DECLARE_STATIC /D APU_DECLARE_STATIC STATIC_LIBS = odbc32.lib odbccp32.lib wldap32.lib From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 18:14:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B42E4FA7; Wed, 24 Sep 2014 18:14:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86D4D623; Wed, 24 Sep 2014 18:14:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OIEG8G018439; Wed, 24 Sep 2014 18:14:16 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OIEGiO018438; Wed, 24 Sep 2014 18:14:16 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201409241814.s8OIEGiO018438@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Wed, 24 Sep 2014 18:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r272075 - vendor/apr-util/apr-util-1.5.4 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 18:14:16 -0000 Author: peter Date: Wed Sep 24 18:14:16 2014 New Revision: 272075 URL: http://svnweb.freebsd.org/changeset/base/272075 Log: Tag vendor import of apr-util-1.5.4 Added: vendor/apr-util/apr-util-1.5.4/ - copied from r272074, vendor/apr-util/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 18:38:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7B1994D; Wed, 24 Sep 2014 18:38:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B14EC953; Wed, 24 Sep 2014 18:38:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OIcs1k028466; Wed, 24 Sep 2014 18:38:54 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OIcpjo028447; Wed, 24 Sep 2014 18:38:51 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201409241838.s8OIcpjo028447@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Wed, 24 Sep 2014 18:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272076 - in head/contrib/apr-util: . crypto dbd dbm include test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 18:38:54 -0000 Author: peter Date: Wed Sep 24 18:38:51 2014 New Revision: 272076 URL: http://svnweb.freebsd.org/changeset/base/272076 Log: Merge apr-util 1.5.3 -> 1.5.4. A minor bug fix update. Modified: head/contrib/apr-util/CHANGES head/contrib/apr-util/NOTICE head/contrib/apr-util/apr-util.spec head/contrib/apr-util/configure head/contrib/apr-util/crypto/apr_crypto.c head/contrib/apr-util/crypto/apr_passwd.c head/contrib/apr-util/dbd/apr_dbd_mysql.c head/contrib/apr-util/dbd/apr_dbd_odbc.c head/contrib/apr-util/dbm/NWGNUmakefile head/contrib/apr-util/include/apu_version.h head/contrib/apr-util/test/Makefile.win Directory Properties: head/contrib/apr-util/ (props changed) Modified: head/contrib/apr-util/CHANGES ============================================================================== --- head/contrib/apr-util/CHANGES Wed Sep 24 18:14:16 2014 (r272075) +++ head/contrib/apr-util/CHANGES Wed Sep 24 18:38:51 2014 (r272076) @@ -1,4 +1,30 @@ -*- coding: utf-8 -*- +Changes with APR-util 1.5.4 + + *) MySQL driver: Fix incorrect handling of bad parameter in the + driver support for apr_dbd_transaction_end(). PR 56330. + [Weiqiang Li ] + + *) apr_crypto_get_driver(): Fix invalid storage reference on error path. + [Philip Martin ] + + *) Fix compile failure for Android. PR 56627. [Fredrik Fornwall + , Jeff Trawick] + + *) Fix to let ODBC driver build with MSVC6, which does not have intptr_t + [Tom Donovan] + + *) Windows cmake build: Fix incompatiblities with Visual Studio + generators with all cmake versions, and the NMake Makefile generator + with cmake 2.8.12 and later. PR 56616 and other bugs. [Jeff Trawick, + Bert Huijben] + + *) Fix detection of Berkeley DB 6.0. PR 55277. + [Lars Wendler ] + + *) Improve platform detection for bundled expat by updating + config.guess and config.sub. [Rainer Jung] + Changes with APR-util 1.5.3 *) Cygwin: Use correct file extension when loading APR DSOs. PR 55587. Modified: head/contrib/apr-util/NOTICE ============================================================================== --- head/contrib/apr-util/NOTICE Wed Sep 24 18:14:16 2014 (r272075) +++ head/contrib/apr-util/NOTICE Wed Sep 24 18:38:51 2014 (r272076) @@ -1,7 +1,7 @@ Apache Portable Runtime Utility Library -Copyright (c) 2011 The Apache Software Foundation. +Copyright (c) 2000-2014 The Apache Software Foundation. -This product includes software developed by +This product includes software developed at The Apache Software Foundation (http://www.apache.org/). Portions of this software were developed at the National Center Modified: head/contrib/apr-util/apr-util.spec ============================================================================== --- head/contrib/apr-util/apr-util.spec Wed Sep 24 18:14:16 2014 (r272075) +++ head/contrib/apr-util/apr-util.spec Wed Sep 24 18:38:51 2014 (r272076) @@ -3,7 +3,7 @@ Summary: Apache Portable Runtime Utility library Name: apr-util -Version: 1.5.3 +Version: 1.5.4 Release: 1 License: Apache Software License Group: System Environment/Libraries Modified: head/contrib/apr-util/configure ============================================================================== --- head/contrib/apr-util/configure Wed Sep 24 18:14:16 2014 (r272075) +++ head/contrib/apr-util/configure Wed Sep 24 18:38:51 2014 (r272076) @@ -11608,19 +11608,34 @@ fi apu_db_version=0 # Maximum supported version announced in help string. - # Although we search for all versions up to 5.9, + # Although we search for all versions up to 6.9, # we should only include existing versions in our # help string. - db_max_version=53 - db_min_version=41 dbm_list="sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4" + db_max_version=48 + db_min_version=41 + db_version="$db_min_version" + while [ $db_version -le $db_max_version ] + do + dbm_list="$dbm_list, db$db_version" + db_version=`expr $db_version + 1` + done + db_max_version=53 + db_min_version=50 + db_version="$db_min_version" + while [ $db_version -le $db_max_version ] + do + dbm_list="$dbm_list, db$db_version" + db_version=`expr $db_version + 1` + done + db_max_version=60 + db_min_version=60 db_version="$db_min_version" while [ $db_version -le $db_max_version ] do dbm_list="$dbm_list, db$db_version" db_version=`expr $db_version + 1` done - dbm_list="$dbm_list, db60" # Check whether --with-dbm was given. @@ -12093,8 +12108,8 @@ if test "${with_berkeley_db+set}" = set; all_places="$check_places" - # Start version search at version 5.9 - db_version=59 + # Start version search at version 6.9 + db_version=69 while [ $db_version -ge 40 ] do db_major=`echo $db_version | sed -e 's/.$//'` @@ -12178,7 +12193,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5" -o ""${db_major}"" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -12580,7 +12595,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "3" = "3" -o "3" = "4" -o "3" = "5"; then + if test "3" = "3" -o "3" = "4" -o "3" = "5" -o "3" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -12978,7 +12993,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "2" = "3" -o "2" = "4" -o "2" = "5"; then + if test "2" = "3" -o "2" = "4" -o "2" = "5" -o "2" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -13376,7 +13391,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -13774,7 +13789,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -14186,7 +14201,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -14587,7 +14602,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -14988,7 +15003,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "2" = "3" -o "2" = "4" -o "2" = "5"; then + if test "2" = "3" -o "2" = "4" -o "2" = "5" -o "2" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -15389,7 +15404,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "3" = "3" -o "3" = "4" -o "3" = "5"; then + if test "3" = "3" -o "3" = "4" -o "3" = "5" -o "3" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -15794,7 +15809,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5" -o ""${db_major}"" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -16202,7 +16217,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5" -o ""${db_major}"" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -16534,8 +16549,8 @@ fi all_places="$check_places" - # Start version search at version 5.9 - db_version=59 + # Start version search at version 6.9 + db_version=69 while [ $db_version -ge 40 ] do db_major=`echo $db_version | sed -e 's/.$//'` @@ -16619,7 +16634,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5"; then + if test ""${db_major}"" = "3" -o ""${db_major}"" = "4" -o ""${db_major}"" = "5" -o ""${db_major}"" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -17021,7 +17036,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "3" = "3" -o "3" = "4" -o "3" = "5"; then + if test "3" = "3" -o "3" = "4" -o "3" = "5" -o "3" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -17419,7 +17434,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "2" = "3" -o "2" = "4" -o "2" = "5"; then + if test "2" = "3" -o "2" = "4" -o "2" = "5" -o "2" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -17817,7 +17832,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of @@ -18215,7 +18230,7 @@ $as_echo "" >&6; } ac_fn_c_check_header_mongrel "$LINENO" "$bdb_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - if test "1" = "3" -o "1" = "4" -o "1" = "5"; then + if test "1" = "3" -o "1" = "4" -o "1" = "5" -o "1" = "6"; then # We generate a separate cache variable for each prefix and libname # we search under. That way, we avoid caching information that # changes if the user runs `configure' with a different set of Modified: head/contrib/apr-util/crypto/apr_crypto.c ============================================================================== --- head/contrib/apr-util/crypto/apr_crypto.c Wed Sep 24 18:14:16 2014 (r272075) +++ head/contrib/apr-util/crypto/apr_crypto.c Wed Sep 24 18:38:51 2014 (r272076) @@ -204,7 +204,7 @@ APU_DECLARE(apr_status_t) apr_crypto_get if (err && buffer) { apr_dso_error(dso, buffer, ERROR_SIZE - 1); err->msg = buffer; - err->reason = modname; + err->reason = apr_pstrdup(pool, modname); *result = err; } } Modified: head/contrib/apr-util/crypto/apr_passwd.c ============================================================================== --- head/contrib/apr-util/crypto/apr_passwd.c Wed Sep 24 18:14:16 2014 (r272075) +++ head/contrib/apr-util/crypto/apr_passwd.c Wed Sep 24 18:38:51 2014 (r272076) @@ -66,6 +66,12 @@ static void crypt_mutex_unlock(void) #endif #endif +#if defined(WIN32) || defined(BEOS) || defined(NETWARE) || defined(__ANDROID__) +#define CRYPT_MISSING 1 +#else +#define CRYPT_MISSING 0 +#endif + /* * Validate a plaintext password against a smashed one. Uses either * crypt() (if available) or apr_md5_encode() or apr_sha1_base64(), depending @@ -77,7 +83,7 @@ APU_DECLARE(apr_status_t) apr_password_v const char *hash) { char sample[200]; -#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE) +#if !CRYPT_MISSING char *crypt_pw; #endif if (hash[0] == '$' @@ -100,7 +106,7 @@ APU_DECLARE(apr_status_t) apr_password_v /* * It's not our algorithm, so feed it to crypt() if possible. */ -#if defined(WIN32) || defined(BEOS) || defined(NETWARE) +#if CRYPT_MISSING return (strcmp(passwd, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH; #elif defined(CRYPT_R_CRYPTD) apr_status_t rv; Modified: head/contrib/apr-util/dbd/apr_dbd_mysql.c ============================================================================== --- head/contrib/apr-util/dbd/apr_dbd_mysql.c Wed Sep 24 18:14:16 2014 (r272075) +++ head/contrib/apr-util/dbd/apr_dbd_mysql.c Wed Sep 24 18:38:51 2014 (r272076) @@ -1050,9 +1050,9 @@ static int dbd_mysql_end_transaction(apr else { ret = mysql_commit(trans->handle->conn); } + ret |= mysql_autocommit(trans->handle->conn, 1); + trans->handle->trans = NULL; } - ret |= mysql_autocommit(trans->handle->conn, 1); - trans->handle->trans = NULL; return ret; } /* Whether or not transactions work depends on whether the Modified: head/contrib/apr-util/dbd/apr_dbd_odbc.c ============================================================================== --- head/contrib/apr-util/dbd/apr_dbd_odbc.c Wed Sep 24 18:14:16 2014 (r272075) +++ head/contrib/apr-util/dbd/apr_dbd_odbc.c Wed Sep 24 18:38:51 2014 (r272076) @@ -47,6 +47,21 @@ #include #endif +/* +* MSVC6 does not support intptr_t (C99) +* APR does not have a signed inptr type until 2.0 (r1557720) +*/ +#if defined(_MSC_VER) && _MSC_VER < 1400 +#if APR_SIZEOF_VOIDP == 8 +#define ODBC_INTPTR_T apr_int64_t +#else +#define ODBC_INTPTR_T apr_int32_t +#endif +#else +#define ODBC_INTPTR_T intptr_t +#endif + + /* Driver name is "odbc" and the entry point is 'apr_dbd_odbc_driver' * unless ODBC_DRIVER_NAME is defined and it is linked with another db library which * is ODBC source-compatible. e.g. DB2, Informix, TimesTen, mysql. @@ -114,9 +129,9 @@ struct apr_dbd_t char lastError[MAX_ERROR_STRING]; int defaultBufferSize; /* used for CLOBs in text mode, * and when fld size is indeterminate */ - intptr_t transaction_mode; - intptr_t dboptions; /* driver options re SQLGetData */ - intptr_t default_transaction_mode; + ODBC_INTPTR_T transaction_mode; + ODBC_INTPTR_T dboptions; /* driver options re SQLGetData */ + ODBC_INTPTR_T default_transaction_mode; int can_commit; /* controls end_trans behavior */ }; @@ -359,7 +374,7 @@ static SQLRETURN odbc_set_result_column( SQLHANDLE stmt) { SQLRETURN rc; - intptr_t maxsize, textsize, realsize, type, isunsigned = 1; + ODBC_INTPTR_T maxsize, textsize, realsize, type, isunsigned = 1; /* discover the sql type */ rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_UNSIGNED, NULL, 0, NULL, @@ -747,7 +762,7 @@ static void *odbc_get(const apr_dbd_row_ SQLRETURN rc; SQLLEN indicator; int state = row->res->colstate[col]; - intptr_t options = row->res->apr_dbd->dboptions; + ODBC_INTPTR_T options = row->res->apr_dbd->dboptions; switch (state) { case (COL_UNAVAIL): @@ -817,13 +832,13 @@ static apr_status_t odbc_parse_params(ap int *connect, SQLCHAR **datasource, SQLCHAR **user, SQLCHAR **password, int *defaultBufferSize, int *nattrs, - int **attrs, intptr_t **attrvals) + int **attrs, ODBC_INTPTR_T **attrvals) { char *seps, *last, *next, *name[MAX_PARAMS], *val[MAX_PARAMS]; int nparams = 0, i, j; *attrs = apr_pcalloc(pool, MAX_PARAMS * sizeof(char *)); - *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(intptr_t)); + *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(ODBC_INTPTR_T)); *nattrs = 0; seps = DEFAULTSEPS; name[nparams] = apr_strtok(apr_pstrdup(pool, params), seps, &last); @@ -1063,7 +1078,7 @@ static apr_dbd_t *odbc_open(apr_pool_t * SQLCHAR *datasource = (SQLCHAR *)"", *user = (SQLCHAR *)"", *password = (SQLCHAR *)""; int nattrs = 0, *attrs = NULL, connect = 0; - intptr_t *attrvals = NULL; + ODBC_INTPTR_T *attrvals = NULL; err_step = "SQLAllocHandle (SQL_HANDLE_DBC)"; err_htype = SQL_HANDLE_ENV; @@ -1117,10 +1132,10 @@ static apr_dbd_t *odbc_open(apr_pool_t * handle->default_transaction_mode = 0; handle->can_commit = APR_DBD_TRANSACTION_IGNORE_ERRORS; SQLGetInfo(hdbc, SQL_DEFAULT_TXN_ISOLATION, - &(handle->default_transaction_mode), sizeof(intptr_t), NULL); + &(handle->default_transaction_mode), sizeof(ODBC_INTPTR_T), NULL); handle->transaction_mode = handle->default_transaction_mode; SQLGetInfo(hdbc, SQL_GETDATA_EXTENSIONS ,&(handle->dboptions), - sizeof(intptr_t), NULL); + sizeof(ODBC_INTPTR_T), NULL); apr_pool_cleanup_register(pool, handle, odbc_close_cleanup, apr_pool_cleanup_null); return handle; } Modified: head/contrib/apr-util/dbm/NWGNUmakefile ============================================================================== --- head/contrib/apr-util/dbm/NWGNUmakefile Wed Sep 24 18:14:16 2014 (r272075) +++ head/contrib/apr-util/dbm/NWGNUmakefile Wed Sep 24 18:38:51 2014 (r272076) @@ -235,7 +235,7 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(AP_WORK)\build\NWGNUhead.inc for examples) # install :: nlms $(INSTDIRS) FORCE - copy $(OBJDIR)\*.nlm $(INSTALLBASE) + $(call COPY,$(OBJDIR)/*.nlm,$(INSTALLBASE)) # # Any specialized rules here Modified: head/contrib/apr-util/include/apu_version.h ============================================================================== --- head/contrib/apr-util/include/apu_version.h Wed Sep 24 18:14:16 2014 (r272075) +++ head/contrib/apr-util/include/apu_version.h Wed Sep 24 18:38:51 2014 (r272076) @@ -38,7 +38,7 @@ */ -#define APU_COPYRIGHT "Copyright (c) 2013 The Apache Software " \ +#define APU_COPYRIGHT "Copyright (c) 2000-2014 The Apache Software " \ "Foundation or its licensors, as applicable." /* The numeric compile-time version constants. These constants are the @@ -62,7 +62,7 @@ * The Patch Level never includes API changes, simply bug fixes. * Reset to 0 when upgrading APR_MINOR_VERSION */ -#define APU_PATCH_VERSION 3 +#define APU_PATCH_VERSION 4 /** * The symbol APU_IS_DEV_VERSION is only defined for internal, Modified: head/contrib/apr-util/test/Makefile.win ============================================================================== --- head/contrib/apr-util/test/Makefile.win Wed Sep 24 18:14:16 2014 (r272075) +++ head/contrib/apr-util/test/Makefile.win Wed Sep 24 18:38:51 2014 (r272076) @@ -88,6 +88,8 @@ APROUTDIR=$(OUTDIR) !IF "$(MODEL)" == "static" PROGRAM_DEPENDENCIES = \ $(APR_PATH)\$(APROUTDIR)\apr-1.lib \ + $(API_PATH)\$(OUTDIR)\apriconv-1.lib \ + ..\xml\expat\lib\$(OUTDIR)\xml.lib \ ..\$(OUTDIR)\aprutil-1.lib STATIC_CFLAGS = /D APR_DECLARE_STATIC /D APU_DECLARE_STATIC STATIC_LIBS = odbc32.lib odbccp32.lib wldap32.lib From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 19:30:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C32C7D62; Wed, 24 Sep 2014 19:30:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE6DBFC7; Wed, 24 Sep 2014 19:30:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OJUDsF053015; Wed, 24 Sep 2014 19:30:13 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OJUDhW053013; Wed, 24 Sep 2014 19:30:13 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201409241930.s8OJUDhW053013@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 24 Sep 2014 19:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r272077 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 19:30:13 -0000 Author: gavin Date: Wed Sep 24 19:30:12 2014 New Revision: 272077 URL: http://svnweb.freebsd.org/changeset/base/272077 Log: Take odeds bit into safekeeping. Submitted by: odeds via hselasky and jhb Approved by: core (implicit) Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Wed Sep 24 18:38:51 2014 (r272076) +++ svnadmin/conf/access Wed Sep 24 19:30:12 2014 (r272077) @@ -165,7 +165,6 @@ np nwhitehorn nyan obrien -odeds oleg peter peter@wemm.org peterj Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Wed Sep 24 18:38:51 2014 (r272076) +++ svnadmin/conf/mentors Wed Sep 24 19:30:12 2014 (r272077) @@ -28,7 +28,6 @@ kadesai ken Co-mentor: scottl, ambrisk mahrens mckusick miwi rwatson monthadar adrian -odeds jhb Co-mentor: alfred peterj jhb Co-mentor: grog pkelsey jmallett slm ken Co-mentor: scottl, ambrisko From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 19:30:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3444E8A; Wed, 24 Sep 2014 19:30:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD652FCC; Wed, 24 Sep 2014 19:30:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OJUage055392; Wed, 24 Sep 2014 19:30:36 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OJUaB1055391; Wed, 24 Sep 2014 19:30:36 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201409241930.s8OJUaB1055391@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Wed, 24 Sep 2014 19:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272078 - stable/10/etc/defaults X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 19:30:37 -0000 Author: peter Date: Wed Sep 24 19:30:36 2014 New Revision: 272078 URL: http://svnweb.freebsd.org/changeset/base/272078 Log: MFC r269392: Add /usr/lib32/compat to the default ld-elf32.so.1 path. Approved by: re (gjb, delphij) Modified: stable/10/etc/defaults/rc.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Wed Sep 24 19:30:12 2014 (r272077) +++ stable/10/etc/defaults/rc.conf Wed Sep 24 19:30:36 2014 (r272078) @@ -619,7 +619,8 @@ clear_tmp_X="YES" # Clear and recreate ldconfig_insecure="NO" # Set to YES to disable ldconfig security checks ldconfig_paths="/usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg" # shared library search paths -ldconfig32_paths="/usr/lib32" # 32-bit compatibility shared library search paths +ldconfig32_paths="/usr/lib32 /usr/lib32/compat" + # 32-bit compatibility shared library search paths ldconfig_paths_aout="/usr/lib/compat/aout /usr/local/lib/aout" # a.out shared library search paths ldconfig_local_dirs="/usr/local/libdata/ldconfig" From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 20:04:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 450D0785; Wed, 24 Sep 2014 20:04:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30AFE3E8; Wed, 24 Sep 2014 20:04:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OK4COi071367; Wed, 24 Sep 2014 20:04:12 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OK4CHx071366; Wed, 24 Sep 2014 20:04:12 GMT (envelope-from np@FreeBSD.org) Message-Id: <201409242004.s8OK4CHx071366@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 24 Sep 2014 20:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272079 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 20:04:12 -0000 Author: np Date: Wed Sep 24 20:04:11 2014 New Revision: 272079 URL: http://svnweb.freebsd.org/changeset/base/272079 Log: cxgbe/tom: Catch up with r271119, syncache_add doesn't need tcbinfo lock. Modified: head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Wed Sep 24 19:30:36 2014 (r272078) +++ head/sys/dev/cxgbe/tom/t4_listen.c Wed Sep 24 20:04:11 2014 (r272079) @@ -1311,7 +1311,7 @@ do_pass_accept_req(struct sge_iq *iq, co REJECT_PASS_ACCEPT(); rpl = wrtod(wr); - INP_INFO_WLOCK(&V_tcbinfo); /* for 4-tuple check, syncache_add */ + INP_INFO_WLOCK(&V_tcbinfo); /* for 4-tuple check */ /* Don't offload if the 4-tuple is already in use */ if (toe_4tuple_check(&inc, &th, ifp) != 0) { @@ -1319,6 +1319,7 @@ do_pass_accept_req(struct sge_iq *iq, co free(wr, M_CXGBE); REJECT_PASS_ACCEPT(); } + INP_INFO_WUNLOCK(&V_tcbinfo); inp = lctx->inp; /* listening socket, not owned by TOE */ INP_WLOCK(inp); @@ -1331,7 +1332,6 @@ do_pass_accept_req(struct sge_iq *iq, co * resources tied to this listen context. */ INP_WUNLOCK(inp); - INP_INFO_WUNLOCK(&V_tcbinfo); free(wr, M_CXGBE); REJECT_PASS_ACCEPT(); } @@ -1383,7 +1383,6 @@ do_pass_accept_req(struct sge_iq *iq, co */ toe_syncache_add(&inc, &to, &th, inp, tod, synqe); INP_UNLOCK_ASSERT(inp); /* ok to assert, we have a ref on the inp */ - INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); /* * If we replied during syncache_add (synqe->wr has been consumed), From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 20:08:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 803B39FA; Wed, 24 Sep 2014 20:08:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B59B5FA; Wed, 24 Sep 2014 20:08:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OK8itU072169; Wed, 24 Sep 2014 20:08:44 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OK8iHe072168; Wed, 24 Sep 2014 20:08:44 GMT (envelope-from np@FreeBSD.org) Message-Id: <201409242008.s8OK8iHe072168@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 24 Sep 2014 20:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272080 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 20:08:44 -0000 Author: np Date: Wed Sep 24 20:08:43 2014 New Revision: 272080 URL: http://svnweb.freebsd.org/changeset/base/272080 Log: Update comment (missed this bit in r272079). Modified: head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Wed Sep 24 20:04:11 2014 (r272079) +++ head/sys/dev/cxgbe/tom/t4_listen.c Wed Sep 24 20:08:43 2014 (r272080) @@ -1378,8 +1378,7 @@ do_pass_accept_req(struct sge_iq *iq, co /* * If all goes well t4_syncache_respond will get called during - * syncache_add. Also note that syncache_add releases both pcbinfo and - * pcb locks. + * syncache_add. Note that syncache_add releases the pcb lock. */ toe_syncache_add(&inc, &to, &th, inp, tod, synqe); INP_UNLOCK_ASSERT(inp); /* ok to assert, we have a ref on the inp */ From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 20:12:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD205C94; Wed, 24 Sep 2014 20:12:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6AE76C4; Wed, 24 Sep 2014 20:12:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OKCf9B076414; Wed, 24 Sep 2014 20:12:41 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OKCfQ0076413; Wed, 24 Sep 2014 20:12:41 GMT (envelope-from np@FreeBSD.org) Message-Id: <201409242012.s8OKCfQ0076413@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 24 Sep 2014 20:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272081 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 20:12:41 -0000 Author: np Date: Wed Sep 24 20:12:40 2014 New Revision: 272081 URL: http://svnweb.freebsd.org/changeset/base/272081 Log: Catch up with r271119. Modified: head/sys/netinet/toecore.c Modified: head/sys/netinet/toecore.c ============================================================================== --- head/sys/netinet/toecore.c Wed Sep 24 20:08:43 2014 (r272080) +++ head/sys/netinet/toecore.c Wed Sep 24 20:12:40 2014 (r272081) @@ -329,7 +329,6 @@ toe_syncache_add(struct in_conninfo *inc { struct socket *lso = inp->inp_socket; - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); syncache_add(inc, to, th, inp, &lso, NULL, tod, todctx); From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 21:17:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C9E693E; Wed, 24 Sep 2014 21:17:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1813AD37; Wed, 24 Sep 2014 21:17:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OLH3ei005675; Wed, 24 Sep 2014 21:17:03 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OLH3cZ005674; Wed, 24 Sep 2014 21:17:03 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409242117.s8OLH3cZ005674@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 24 Sep 2014 21:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r272082 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 21:17:04 -0000 Author: glebius Date: Wed Sep 24 21:17:03 2014 New Revision: 272082 URL: http://svnweb.freebsd.org/changeset/base/272082 Log: Cy has proved that he can take care of ipfilter, thus release him from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Wed Sep 24 20:12:40 2014 (r272081) +++ svnadmin/conf/mentors Wed Sep 24 21:17:03 2014 (r272082) @@ -15,7 +15,6 @@ agc scottl Co-mentor: emax benl philip Co-mentor: simon carl jimharris cherry gibbs -cy andre Co-mentor: glebius edavis davidch eri gnn Co-mentor: thompsa ganbold stas From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 22:14:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 977AA68C; Wed, 24 Sep 2014 22:14:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81C1034B; Wed, 24 Sep 2014 22:14:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OMEs0f035031; Wed, 24 Sep 2014 22:14:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OMEsjL035030; Wed, 24 Sep 2014 22:14:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409242214.s8OMEsjL035030@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 24 Sep 2014 22:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272083 - head/contrib/pjdfstest/tests/open X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 22:14:54 -0000 Author: ngie Date: Wed Sep 24 22:14:53 2014 New Revision: 272083 URL: http://svnweb.freebsd.org/changeset/base/272083 Log: Expect ELOOP on Darwin/Linux with "O_NOFOLLOW was specified and the target is a symbolic link" case. Assume EMLINK on the rest of the OSes (FreeBSD, Solaris, etc) MFC after: 2 weeks X-MFC with: r272057 Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/pjdfstest/tests/open/16.t Modified: head/contrib/pjdfstest/tests/open/16.t ============================================================================== --- head/contrib/pjdfstest/tests/open/16.t Wed Sep 24 21:17:03 2014 (r272082) +++ head/contrib/pjdfstest/tests/open/16.t Wed Sep 24 22:14:53 2014 (r272083) @@ -1,19 +1,27 @@ #!/bin/sh # $FreeBSD: head/tools/regression/pjdfstest/tests/open/16.t 219621 2011-03-13 19:35:13Z pjd $ -desc="open returns ELOOP when O_NOFOLLOW was specified and the target is a symbolic link" - dir=`dirname $0` . ${dir}/../misc.sh +case "${os}" in +Darwin|Linux) + error=ELOOP + ;; +*) + error=EMLINK + ;; +esac +desc="open returns $error when O_NOFOLLOW was specified and the target is a symbolic link" + echo "1..6" n0=`namegen` n1=`namegen` expect 0 symlink ${n0} ${n1} -expect ELOOP open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644 -expect ELOOP open ${n1} O_RDONLY,O_NOFOLLOW -expect ELOOP open ${n1} O_WRONLY,O_NOFOLLOW -expect ELOOP open ${n1} O_RDWR,O_NOFOLLOW +expect $error open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644 +expect $error open ${n1} O_RDONLY,O_NOFOLLOW +expect $error open ${n1} O_WRONLY,O_NOFOLLOW +expect $error open ${n1} O_RDWR,O_NOFOLLOW expect 0 unlink ${n1} From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 22:18:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA21C80F; Wed, 24 Sep 2014 22:18:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5FC7368; Wed, 24 Sep 2014 22:18:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OMILqv035989; Wed, 24 Sep 2014 22:18:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OMILn8035988; Wed, 24 Sep 2014 22:18:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409242218.s8OMILn8035988@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 24 Sep 2014 22:18:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272084 - head/contrib/pjdfstest/tests/ftruncate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 22:18:21 -0000 Author: ngie Date: Wed Sep 24 22:18:21 2014 New Revision: 272084 URL: http://svnweb.freebsd.org/changeset/base/272084 Log: Fix the executed testplan count MFC after: 2 weeks X-MFC with: r272057 Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/pjdfstest/tests/ftruncate/00.t Modified: head/contrib/pjdfstest/tests/ftruncate/00.t ============================================================================== --- head/contrib/pjdfstest/tests/ftruncate/00.t Wed Sep 24 22:14:53 2014 (r272083) +++ head/contrib/pjdfstest/tests/ftruncate/00.t Wed Sep 24 22:18:21 2014 (r272084) @@ -6,7 +6,7 @@ desc="ftruncate descrease/increase file dir=`dirname $0` . ${dir}/../misc.sh -echo "1..21" +echo "1..26" n0=`namegen` n1=`namegen` From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 22:31:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF41ABB7; Wed, 24 Sep 2014 22:31:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8154F6AC; Wed, 24 Sep 2014 22:31:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OMVfak046235; Wed, 24 Sep 2014 22:31:41 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OMVfKX046233; Wed, 24 Sep 2014 22:31:41 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201409242231.s8OMVfKX046233@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Wed, 24 Sep 2014 22:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272085 - in head: share/misc usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 22:31:41 -0000 Author: jch Date: Wed Sep 24 22:31:40 2014 New Revision: 272085 URL: http://svnweb.freebsd.org/changeset/base/272085 Log: Add myself (jch) to calendar.freebsd and committers-src.dot Approved by: jhb (mentor) Modified: head/share/misc/committers-src.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Sep 24 22:18:21 2014 (r272084) +++ head/share/misc/committers-src.dot Wed Sep 24 22:31:40 2014 (r272085) @@ -179,6 +179,7 @@ ivoras [label="Ivan Voras\nivoras@FreeBS jamie [label="Jamie Gritton\njamie@FreeBSD.org\n2009/01/28"] jasone [label="Jason Evans\njasone@FreeBSD.org\n1999/03/03"] jceel [label="Jakub Klama\njceel@FreeBSD.org\n2011/09/25"] +jch [label="Julien Charbon\njch@FreeBSD.org\n2014/09/24"] jchandra [label="Jayachandran C.\njchandra@FreeBSD.org\n2010/05/19"] jeff [label="Jeff Roberson\njeff@FreeBSD.org\n2002/02/21"] jh [label="Jaakko Heinonen\njh@FreeBSD.org\n2009/10/02"] @@ -484,6 +485,7 @@ jdp -> fjoe jhb -> arr jhb -> avg +jhb -> jch jhb -> jeff jhb -> kbyanc jhb -> peterj Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Sep 24 22:18:21 2014 (r272084) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Sep 24 22:31:40 2014 (r272085) @@ -52,6 +52,7 @@ 02/03 Jason Helfman born in Royal Oak, Michigan, United States, 1972 02/04 Eitan Adler born in West Hempstead, New York, United States, 1991 02/05 Frank Laszlo born in Howell, Michigan, United States, 1983 +02/06 Julien Charbon born in Saint Etienne, Loire, France, 1978 02/10 David Greenman born in Portland, Oregon, United States, 1968 02/10 Paul Richards born in Ammanford, Carmarthenshire, United Kingdom, 1968 02/10 Simon Barner born in Rosenheim, Bayern, Germany, 1980 From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 22:45:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1B51F11; Wed, 24 Sep 2014 22:45:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B250B884; Wed, 24 Sep 2014 22:45:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OMj3eZ052504; Wed, 24 Sep 2014 22:45:03 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OMj3p3052503; Wed, 24 Sep 2014 22:45:03 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409242245.s8OMj3p3052503@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 24 Sep 2014 22:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272086 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 22:45:04 -0000 Author: marcel Date: Wed Sep 24 22:45:03 2014 New Revision: 272086 URL: http://svnweb.freebsd.org/changeset/base/272086 Log: Finish QCOW version 2 and stop making it conditional. We have a different ordering for the RC block(s) and L2 tables. This is expected to be a non-issue, because everything is found through file offsets in the corresponding RC table and L1 table. Files that grow organically have RC blocks and L2 tables scattered all over the place anyway. The reason for the difference is that mkimg needs to be able to write to a pipe. We can't seek forward and backward to fill in the bits in non-sequential order. Modified: head/usr.bin/mkimg/qcow.c Modified: head/usr.bin/mkimg/qcow.c ============================================================================== --- head/usr.bin/mkimg/qcow.c Wed Sep 24 22:31:40 2014 (r272085) +++ head/usr.bin/mkimg/qcow.c Wed Sep 24 22:45:03 2014 (r272086) @@ -40,8 +40,6 @@ __FBSDID("$FreeBSD$"); #include "format.h" #include "mkimg.h" -#undef QCOW_SUPPORT_QCOW2 - /* Default cluster sizes. */ #define QCOW1_CLSTR_LOG2SZ 12 /* 4KB */ #define QCOW2_CLSTR_LOG2SZ 16 /* 64KB */ @@ -123,21 +121,19 @@ qcow1_resize(lba_t imgsz) return (qcow_resize(imgsz, QCOW_VERSION_1)); } -#ifdef QCOW_SUPPORT_QCOW2 static int qcow2_resize(lba_t imgsz) { return (qcow_resize(imgsz, QCOW_VERSION_2)); } -#endif static int qcow_write(int fd, u_int version) { struct qcow_header *hdr; - uint64_t *l1tbl, *l2tbl; - uint16_t *rctbl; + uint64_t *l1tbl, *l2tbl, *rctbl; + uint16_t *rcblk; uint64_t clstr_imgsz, clstr_l2tbls, clstr_l1tblsz; uint64_t clstr_rcblks, clstr_rctblsz; uint64_t n, imagesz, nclstrs, ofs, ofsflags; @@ -170,13 +166,15 @@ qcow_write(int fd, u_int version) * 0 - header * 1 - L1 table * 2 - RC table (v2 only) - * 3 - First RC block (v2 only) - * 4 - L2 tables - * n - data + * 3 - L2 tables + * 4 - RC block (v2 only) + * 5 - data */ l1clno = 1; rcclno = 0; + rctbl = l2tbl = l1tbl = NULL; + rcblk = NULL; hdr = calloc(1, clstrsz); if (hdr == NULL) @@ -196,7 +194,7 @@ qcow_write(int fd, u_int version) case QCOW_VERSION_2: ofsflags = QCOW_CLSTR_COPIED; rcclno = l1clno + clstr_l1tblsz; - l2clno = rcclno + clstr_rctblsz + 1; + l2clno = rcclno + clstr_rctblsz; be32enc(&hdr->clstr_log2sz, clstr_log2sz); be32enc(&hdr->u.v2.l1_entries, clstr_l2tbls); be64enc(&hdr->u.v2.l1_offset, clstrsz * l1clno); @@ -207,52 +205,62 @@ qcow_write(int fd, u_int version) return (EDOOFUS); } - l2tbl = l1tbl = NULL; - rctbl = NULL; + if (sparse_write(fd, hdr, clstrsz) < 0) { + error = errno; + goto out; + } + + free(hdr); + hdr = NULL; + + ofs = clstrsz * l2clno; + nclstrs = 1 + clstr_l1tblsz + clstr_rctblsz; l1tbl = calloc(1, clstrsz * clstr_l1tblsz); if (l1tbl == NULL) { error = ENOMEM; goto out; } - if (rcclno > 0) { - rctbl = calloc(1, clstrsz * clstr_rctblsz); - if (rctbl == NULL) { - error = ENOMEM; - goto out; - } - } - ofs = clstrsz * l2clno; for (n = 0; n < clstr_imgsz; n++) { - l1idx = n >> (clstr_log2sz - 3); - if (l1tbl[l1idx] != 0UL) - continue; blk = n * blk_clstrsz; if (image_data(blk, blk_clstrsz)) { - be64enc(l1tbl + l1idx, ofs + ofsflags); - ofs += clstrsz; + nclstrs++; + l1idx = n >> (clstr_log2sz - 3); + if (l1tbl[l1idx] == 0) { + be64enc(l1tbl + l1idx, ofs + ofsflags); + ofs += clstrsz; + nclstrs++; + } } } - error = 0; - if (!error && sparse_write(fd, hdr, clstrsz) < 0) - error = errno; - if (!error && sparse_write(fd, l1tbl, clstrsz * clstr_l1tblsz) < 0) + if (sparse_write(fd, l1tbl, clstrsz * clstr_l1tblsz) < 0) { error = errno; - if (rcclno > 0) { - if (!error && - sparse_write(fd, rctbl, clstrsz * clstr_rctblsz) < 0) - error = errno; - if (!error && sparse_write(fd, rctbl, clstrsz) < 0) - error = errno; - } - if (error) goto out; + } - free(hdr); - hdr = NULL; - if (rctbl != NULL) { + clstr_rcblks = 0; + do { + n = clstr_rcblks; + clstr_rcblks = round_clstr((nclstrs + n) * 2) >> clstr_log2sz; + } while (n < clstr_rcblks); + + if (rcclno > 0) { + rctbl = calloc(1, clstrsz * clstr_rctblsz); + if (rctbl == NULL) { + error = ENOMEM; + goto out; + } + for (n = 0; n < clstr_rcblks; n++) { + be64enc(rctbl + n, ofs); + ofs += clstrsz; + nclstrs++; + } + if (sparse_write(fd, rctbl, clstrsz * clstr_rctblsz) < 0) { + error = errno; + goto out; + } free(rctbl); rctbl = NULL; } @@ -288,6 +296,22 @@ qcow_write(int fd, u_int version) free(l1tbl); l1tbl = NULL; + if (rcclno > 0) { + rcblk = calloc(1, clstrsz * clstr_rcblks); + if (rcblk == NULL) { + error = ENOMEM; + goto out; + } + for (n = 0; n < nclstrs; n++) + be16enc(rcblk + n, 1); + if (sparse_write(fd, rcblk, clstrsz * clstr_rcblks) < 0) { + error = errno; + goto out; + } + free(rcblk); + rcblk = NULL; + } + error = 0; for (n = 0; n < clstr_imgsz; n++) { blk = n * blk_clstrsz; @@ -301,6 +325,8 @@ qcow_write(int fd, u_int version) error = image_copyout_done(fd); out: + if (rcblk != NULL) + free(rcblk); if (l2tbl != NULL) free(l2tbl); if (rctbl != NULL) @@ -319,14 +345,12 @@ qcow1_write(int fd) return (qcow_write(fd, QCOW_VERSION_1)); } -#ifdef QCOW_SUPPORT_QCOW2 static int qcow2_write(int fd) { return (qcow_write(fd, QCOW_VERSION_2)); } -#endif static struct mkimg_format qcow1_format = { .name = "qcow", @@ -336,7 +360,6 @@ static struct mkimg_format qcow1_format }; FORMAT_DEFINE(qcow1_format); -#ifdef QCOW_SUPPORT_QCOW2 static struct mkimg_format qcow2_format = { .name = "qcow2", .description = "QEMU Copy-On-Write, version 2", @@ -344,4 +367,3 @@ static struct mkimg_format qcow2_format .write = qcow2_write, }; FORMAT_DEFINE(qcow2_format); -#endif From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 22:51:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89D26103; Wed, 24 Sep 2014 22:51:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73E678AC; Wed, 24 Sep 2014 22:51:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OMpNnd056441; Wed, 24 Sep 2014 22:51:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OMpHgl056228; Wed, 24 Sep 2014 22:51:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201409242251.s8OMpHgl056228@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 24 Sep 2014 22:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272087 - in head/contrib/pjdfstest/tests: chflags chmod chown ftruncate link mkdir mkfifo open rename rmdir symlink truncate unlink X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 22:51:23 -0000 Author: ngie Date: Wed Sep 24 22:51:16 2014 New Revision: 272087 URL: http://svnweb.freebsd.org/changeset/base/272087 Log: Increase the memory disk size in the following testcases to avoid mount failures, which would cause cascade failures in the rest of the test run: link/15.t, open/19.t, mkdir/11.t, mkfifo/11.t, symlink/11.t Fail quickly in all of the testcases if mdconfig, mount, umount, etc fails to avoid issues similar to this in the future Submitted by: Casey Peel MFC after: 2 weeks X-MFC with: r272057 Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/pjdfstest/tests/chflags/12.t head/contrib/pjdfstest/tests/chmod/09.t head/contrib/pjdfstest/tests/chown/09.t head/contrib/pjdfstest/tests/ftruncate/10.t head/contrib/pjdfstest/tests/link/05.t head/contrib/pjdfstest/tests/link/14.t head/contrib/pjdfstest/tests/link/15.t head/contrib/pjdfstest/tests/link/16.t head/contrib/pjdfstest/tests/mkdir/09.t head/contrib/pjdfstest/tests/mkdir/11.t head/contrib/pjdfstest/tests/mkfifo/08.t head/contrib/pjdfstest/tests/mkfifo/11.t head/contrib/pjdfstest/tests/open/14.t head/contrib/pjdfstest/tests/open/15.t head/contrib/pjdfstest/tests/open/19.t head/contrib/pjdfstest/tests/rename/15.t head/contrib/pjdfstest/tests/rename/16.t head/contrib/pjdfstest/tests/rmdir/13.t head/contrib/pjdfstest/tests/rmdir/14.t head/contrib/pjdfstest/tests/symlink/10.t head/contrib/pjdfstest/tests/symlink/11.t head/contrib/pjdfstest/tests/truncate/10.t head/contrib/pjdfstest/tests/unlink/12.t Modified: head/contrib/pjdfstest/tests/chflags/12.t ============================================================================== --- head/contrib/pjdfstest/tests/chflags/12.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/chflags/12.t Wed Sep 24 22:51:16 2014 (r272087) @@ -16,8 +16,8 @@ FreeBSD:UFS) n1=`namegen` expect 0 mkdir ${n0} 0755 - n=`mdconfig -a -n -t malloc -s 1m` - newfs /dev/md${n} >/dev/null + n=`mdconfig -a -n -t malloc -s 1m` || exit + newfs /dev/md${n} >/dev/null || exit mount /dev/md${n} ${n0} expect 0 create ${n0}/${n1} 0644 expect 0 chflags ${n0}/${n1} UF_IMMUTABLE @@ -34,7 +34,7 @@ FreeBSD:UFS) expect none stat ${n0}/${n1} flags expect 0 unlink ${n0}/${n1} umount /dev/md${n} - mdconfig -d -u ${n} + mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} ;; FreeBSD:ZFS) @@ -43,7 +43,7 @@ FreeBSD:ZFS) n0=`namegen` n1=`namegen` - n=`mdconfig -a -n -t malloc -s 128m` + n=`mdconfig -a -n -t malloc -s 128m` || exit zpool create ${n0} /dev/md${n} expect 0 create /${n0}/${n1} 0644 expect 0 chflags /${n0}/${n1} UF_NODUMP @@ -60,7 +60,7 @@ FreeBSD:ZFS) expect none stat /${n0}/${n1} flags expect 0 unlink /${n0}/${n1} zpool destroy ${n0} - mdconfig -d -u ${n} + mdconfig -d -u ${n} || exit ;; *) quick_exit Modified: head/contrib/pjdfstest/tests/chmod/09.t ============================================================================== --- head/contrib/pjdfstest/tests/chmod/09.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/chmod/09.t Wed Sep 24 22:51:16 2014 (r272087) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 chmod ${n0}/${n1} 0640 expect 0640 stat ${n0}/${n1} mode @@ -33,5 +33,5 @@ expect 0 lchmod ${n0}/${n1} 0640 expect 0640 stat ${n0}/${n1} mode expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/chown/09.t ============================================================================== --- head/contrib/pjdfstest/tests/chown/09.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/chown/09.t Wed Sep 24 22:51:16 2014 (r272087) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 chown ${n0}/${n1} 65534 65534 expect 65534,65534 stat ${n0}/${n1} uid,gid @@ -28,5 +28,5 @@ expect 0 chown ${n0}/${n1} 65533 65533 expect 65533,65533 stat ${n0}/${n1} uid,gid expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/ftruncate/10.t ============================================================================== --- head/contrib/pjdfstest/tests/ftruncate/10.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/ftruncate/10.t Wed Sep 24 22:51:16 2014 (r272087) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 truncate ${n0}/${n1} 123 expect 123 stat ${n0}/${n1} size @@ -28,5 +28,5 @@ expect 0 truncate ${n0}/${n1} 1234 expect 1234 stat ${n0}/${n1} size expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/link/05.t ============================================================================== --- head/contrib/pjdfstest/tests/link/05.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/link/05.t Wed Sep 24 22:51:16 2014 (r272087) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs -i 1 /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs -i 1 /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 i=1 while :; do @@ -32,5 +32,5 @@ test_check $i -eq 32767 expect EMLINK link ${n0}/${n1} ${n0}/${n2} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/link/14.t ============================================================================== --- head/contrib/pjdfstest/tests/link/14.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/link/14.t Wed Sep 24 22:51:16 2014 (r272087) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect EXDEV link ${n0}/${n1} ${n2} expect 0 unlink ${n0}/${n1} @@ -25,5 +25,5 @@ expect 0 create ${n1} 0644 expect EXDEV link ${n1} ${n0}/${n2} expect 0 unlink ${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/link/15.t ============================================================================== --- head/contrib/pjdfstest/tests/link/15.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/link/15.t Wed Sep 24 22:51:16 2014 (r272087) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 256k` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 512k` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 i=0 while :; do @@ -29,5 +29,5 @@ while :; do done expect ENOSPC link ${n0}/${n1} ${n0}/${n2} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/link/16.t ============================================================================== --- head/contrib/pjdfstest/tests/link/16.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/link/16.t Wed Sep 24 22:51:16 2014 (r272087) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 link ${n0}/${n1} ${n0}/${n2} @@ -30,5 +30,5 @@ expect 0 unlink ${n0}/${n2} expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/mkdir/09.t ============================================================================== --- head/contrib/pjdfstest/tests/mkdir/09.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/mkdir/09.t Wed Sep 24 22:51:16 2014 (r272087) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 mkdir ${n0}/${n1} 0755 expect 0 rmdir ${n0}/${n1} mount -ur /dev/md${n} @@ -25,5 +25,5 @@ mount -uw /dev/md${n} expect 0 mkdir ${n0}/${n1} 0755 expect 0 rmdir ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/mkdir/11.t ============================================================================== --- head/contrib/pjdfstest/tests/mkdir/11.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/mkdir/11.t Wed Sep 24 22:51:16 2014 (r272087) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 256k` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 512k` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit i=0 while :; do mkdir ${n0}/${i} >/dev/null 2>&1 @@ -27,5 +27,5 @@ while :; do done expect ENOSPC mkdir ${n0}/${n1} 0755 umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/mkfifo/08.t ============================================================================== --- head/contrib/pjdfstest/tests/mkfifo/08.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/mkfifo/08.t Wed Sep 24 22:51:16 2014 (r272087) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 mkfifo ${n0}/${n1} 0644 expect 0 unlink ${n0}/${n1} mount -ur /dev/md${n} @@ -25,5 +25,5 @@ mount -uw /dev/md${n} expect 0 mkfifo ${n0}/${n1} 0644 expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/mkfifo/11.t ============================================================================== --- head/contrib/pjdfstest/tests/mkfifo/11.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/mkfifo/11.t Wed Sep 24 22:51:16 2014 (r272087) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 256k` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 512k` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit i=0 while :; do mkfifo ${n0}/${i} >/dev/null 2>&1 @@ -27,5 +27,5 @@ while :; do done expect ENOSPC mkfifo ${n0}/${n1} 0644 umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/open/14.t ============================================================================== --- head/contrib/pjdfstest/tests/open/14.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/open/14.t Wed Sep 24 22:51:16 2014 (r272087) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 open ${n0}/${n1} O_WRONLY expect 0 open ${n0}/${n1} O_RDWR @@ -28,5 +28,5 @@ expect EROFS open ${n0}/${n1} O_RDONLY,O mount -uw /dev/md${n} expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/open/15.t ============================================================================== --- head/contrib/pjdfstest/tests/open/15.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/open/15.t Wed Sep 24 22:51:16 2014 (r272087) @@ -14,14 +14,14 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 open ${n0}/${n1} O_RDONLY,O_CREAT 0644 expect 0 unlink ${n0}/${n1} mount -ur /dev/md${n} expect EROFS open ${n0}/${n1} O_RDONLY,O_CREAT 0644 mount -uw /dev/md${n} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/open/19.t ============================================================================== --- head/contrib/pjdfstest/tests/open/19.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/open/19.t Wed Sep 24 22:51:16 2014 (r272087) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 256k` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 512k` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit i=0 while :; do touch ${n0}/${i} >/dev/null 2>&1 @@ -27,5 +27,5 @@ while :; do done expect ENOSPC open ${n0}/${i} O_RDONLY,O_CREAT 0644 umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/rename/15.t ============================================================================== --- head/contrib/pjdfstest/tests/rename/15.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/rename/15.t Wed Sep 24 22:51:16 2014 (r272087) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit for type in regular dir fifo block char socket symlink; do create_file ${type} ${n0}/${n1} @@ -30,5 +30,5 @@ for type in regular dir fifo block char done umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/rename/16.t ============================================================================== --- head/contrib/pjdfstest/tests/rename/16.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/rename/16.t Wed Sep 24 22:51:16 2014 (r272087) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 mount -ur /dev/md${n} @@ -28,5 +28,5 @@ expect EROFS rename ${n2} ${n0}/${n2} expect 0 unlink ${n2} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/rmdir/13.t ============================================================================== --- head/contrib/pjdfstest/tests/rmdir/13.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/rmdir/13.t Wed Sep 24 22:51:16 2014 (r272087) @@ -13,10 +13,10 @@ echo "1..3" n0=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect EBUSY rmdir ${n0} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/rmdir/14.t ============================================================================== --- head/contrib/pjdfstest/tests/rmdir/14.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/rmdir/14.t Wed Sep 24 22:51:16 2014 (r272087) @@ -14,14 +14,14 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 mkdir ${n0}/${n1} 0755 mount -ur /dev/md${n} expect EROFS rmdir ${n0}/${n1} mount -uw /dev/md${n} expect 0 rmdir ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/symlink/10.t ============================================================================== --- head/contrib/pjdfstest/tests/symlink/10.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/symlink/10.t Wed Sep 24 22:51:16 2014 (r272087) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 symlink test ${n0}/${n1} expect 0 unlink ${n0}/${n1} @@ -28,5 +28,5 @@ expect 0 symlink test ${n0}/${n1} expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/symlink/11.t ============================================================================== --- head/contrib/pjdfstest/tests/symlink/11.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/symlink/11.t Wed Sep 24 22:51:16 2014 (r272087) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 256k` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 512k` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit i=0 while :; do ln -s test ${n0}/${i} >/dev/null 2>&1 @@ -27,5 +27,5 @@ while :; do done expect ENOSPC symlink test ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/truncate/10.t ============================================================================== --- head/contrib/pjdfstest/tests/truncate/10.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/truncate/10.t Wed Sep 24 22:51:16 2014 (r272087) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 truncate ${n0}/${n1} 123 expect 123 stat ${n0}/${n1} size @@ -28,5 +28,5 @@ expect 0 truncate ${n0}/${n1} 1234 expect 1234 stat ${n0}/${n1} size expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: head/contrib/pjdfstest/tests/unlink/12.t ============================================================================== --- head/contrib/pjdfstest/tests/unlink/12.t Wed Sep 24 22:45:03 2014 (r272086) +++ head/contrib/pjdfstest/tests/unlink/12.t Wed Sep 24 22:51:16 2014 (r272087) @@ -14,14 +14,14 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 mount -ur /dev/md${n} expect EROFS unlink ${n0}/${n1} mount -uw /dev/md${n} expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} From owner-svn-src-all@FreeBSD.ORG Wed Sep 24 22:58:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE8C130E; Wed, 24 Sep 2014 22:58:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B898696E; Wed, 24 Sep 2014 22:58:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8OMwICB057661; Wed, 24 Sep 2014 22:58:18 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8OMwBNh057623; Wed, 24 Sep 2014 22:58:11 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409242258.s8OMwBNh057623@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 24 Sep 2014 22:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272088 - head/usr.bin/mkimg/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 22:58:18 -0000 Author: marcel Date: Wed Sep 24 22:58:10 2014 New Revision: 272088 URL: http://svnweb.freebsd.org/changeset/base/272088 Log: Add baseline files for QCOW2. Added: head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-pc98.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-apm.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-bsd.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-ebr.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-mbr.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-pc98.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-1x1-512-vtoc8.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-apm.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-bsd.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-ebr.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-mbr.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-apm.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-bsd.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-ebr.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-mbr.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-pc98.qcow2.gz.uu (contents, props changed) head/usr.bin/mkimg/tests/img-63x255-512-vtoc8.qcow2.gz.uu (contents, props changed) Modified: head/usr.bin/mkimg/tests/mkimg.sh Added: head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,22 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-apm.qcow2.gz +M'XL(")T[(U0``VEM9RTQ>#$M-#`Y-BUA<&TN<6-O=S(N;W5T`*V826_;,!!& +M[_D53/>F32K.D)35/9N!'@JD#7H.O,A`@"Y&&J`7__A2ULB4J1DQ-N0(1@SB +M>Q@/GT>FLZQ^*&6U,DZ90BVFRK^F"U3KQ?:E5M_&7T[:C]5!#=.9D&(6#&YP +M6ZSS@`,)E^GN@N9QK>J0P4&3ZH)2."-6U[?`X(X.UJU;;\8H2N`^P!HG;L9> +M]4%=7YPP>]8'0]>'?/]LDXL77']]6-<7IW()-TKB@$D5$FZ2Q"&3FDJX61)G +MF-1Z;1W4R8E>:?3WLV8E.2=3GLW9U*2=R!XIP*N9%*2=Q!Y=TBX1P&W8%*2 +M=Q!Y]YAP3S8XS:4D[R#R[BGAG@4<,^]`\@XB[YX3[D7`,?,.).\@\NXEX8X" +MCIEW('D'D7>O"/8>2=QAY9PGG`HZ9=RAYAY%W.>%&`8>2=QAY]X%P'P..F76X4YW*[/#GT@L+4P?C*; +M>2>'TH'/+ZRNOC+]L[4P_N/@IZF_W$PY^Z#Z3I?+GR6#DT^WNQ^G/`Z[U=G% +M^G\O2PXJ-\H5].P6RI75,E5WLYSW_[Y?=/@JANDFU?A?)?J?DV6;'5V +MX+TU#]S;YGX!!-S>6]749X9VSZRWPU6-]QOA+S\N+593SG_-4-96:Q:[P/%= +M69Y=7QS_&%^W^V>&_;'!^A-5NG_0ZE_](6GW3[7K5YXR;H7]_ +J_]4B-O4-W#^=4?_\2;W[+"^LKDZV_VJ@(>!@%1I73>>#_Z4*H1'E$P`` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,21 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-bsd.qcow2.gz +M'XL(")X[(U0``VEM9RTQ>#$M-#`Y-BUBS)=F +M0E'$EW.E=Z%RH7'[C7O\+`>YWH?AX0Z_?_Q<]E^'183Y`J2,@<`=;L"Z2SA" +MN,*/![R-ZU7'!HY.J3$HAPNPNJD!`W>].%ZZXV+4*L&7`",.+L9%]5&L3R?" +MA?71W/6Q??W*4TX/5-/U<:Q/IU8(5V=Q9*0:A%MG<6RD-@BWS>*"D7I`N%T6 +M5QJI/<#YC"J/N,I(>82C+&YEI!CA0A97&RGDG<][UQ@IY)W/>[]\WKL'(X6\(^"=2[B=D4+>D?+N2G!/$FYOI)!WI+Q[*KAG +M'0=*>^>"^Y%PAG]CI!WI+Q[*;A7"6?T.T+>D?+NM>"N$\[H=X2\(^7= +M&\&]33BCWQ'RCI1W[T;>>:/?$?*.E7?OA54DG-'O&'G'RCLO.$HXH]\Q\HZ5 +M=RRXD'!&OV/D'2OO2L%5"6?T.T;>L?)N);@ZX8Q^Q\@[5MXU@ON0<$:_8^0= +M*^\^"NY3PAG]CI%WK+S[++B;A#/Z'2/O@O+NB^"^)IS1[P+R+BCOO@GN-N&, +M?A>0=T%Y=R>X[QV.K%3G75'8A^#N1_1D#Q?ZFB_=;XC`<.OY;#=P0&`#$M-#`Y-BUE8G(N<6-O=S(N;W5T`*V76[/2,!#' +MW_D4PBS.^Z8/Z7"[]%'QXVV9IVNUN`TRAP\"$_V\VY)>E +MR;+P,,9;XW+C-J;:FOHS76!Z'X:7.?[^\7/5?QP7`68S)24,..QP`]9#Q(&& +MR^QXP,JX7G4HX."4&H-2.*=6-S4@X&X7[4_7+D;!$G@-,.#4Q;BJ/@CU\82[ +MLCZ8NSZ4?S]_RO&!?+H^#/7QU%K#%4D<"*F-ABN3.!126PVW2^*!L0I4:EPLIJ^$@B5L+*=1P+HDKA)3FG4U[MQ%2FG?2!6%G%"OT/-.V3>6<)!Q`G]#C7O +MD'F'A',1)_0[U+Q#YITG7!YQ0K]#S3MDWJT)5T2^0>?>%<'<1)_0[U+QSS+NOA/L6<4*_]47^AODI/;^HK3(_RMO<'+-2W[./V;>3$\ +MWQEG[MP&,MRY`0?S-@)H.TMM8/VM\:L^(_(V[D +%[($4```` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,26 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-gpt.qcow2.gz +M'XL("*([(U0``VEM9RTQ>#$M-#`Y-BUG<'0N<6-O=S(N;W5T`*V92V_4,!"` +M[_T5+F]:6.)7DN51:$LK]=8BN'')\UB)*PK\=N+8B9/)3-PNWK6BKJSY9#O? +MC)TT2>R',$)$(1U*3K@%Z]+C +M!(5+^+J#X[C9Z"2"$V/4&A3"*7)T6QT([N1H6+KA9N0@0AX"M#CR9APT/F'' +M!R/4@>,3L<PI7!'$2B2HI7!7$*22J +MIG!-$*>1J);`\8`J/2Y%HCB%$T%"N!R)HKSC8>_V2!3E'0][5R!1 +ME'<\[%V)1%'>\;!W%1)%>B +MA]0[07DG@'>G#O?&XY!Z)RCO!/#N[2X=Y['%+O).6=!-Y]<+B/'H?4.TEY)X%WGQSNS..0>B4^)-6-L)&ZL*Y$IW=!>[Y7<"#KG[ +M".`XPB7.35C;W+4/C$W#VM8UNU(N.)\=$)`)'^]FN#KR^@WI]@B@UJPH5L`? +MX_B&=.OSR[X;Z.W60S'0@FDUX8:YZFH^OJOK&W9[_NV[@?WTTQW2+2M8Q5F1 +MLP*.CE/3_8W9IVVZ92U<[1$G*=QT+`,X<[S(Z@TRV +M+88SUIYEW)S=>F!W?[>[M["WNU^G;GR*.R.P1G=0JZ>&RIQ3T\W\@P`Q7;;$ +M8:^1_FOU3%TN=;35VSM9L$9WD*M7V-7#%\FL'IHRW;AJ8\*-N#+NZG'["C,Q +M]7M]I3NZV]WR:X'*`:.-4*5M%3$[#"YB=AA(&9]PK,E8+\YRX^'_!UG;<#8^/Z^DV8FOKW]C$\9O11-S$ +B#6YS$\\:>K+V\Q=,-N(F;G!1-W&5F>/WT3\!FKQU%1H````` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,22 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-mbr.qcow2.gz +M'XL("*0[(U0``VEM9RTQ>#$M-#`Y-BUM8G(N<6-O=S(N;W5T`*V8V;+3,`Q` +MW_L5+LL%+E!BR4Y3E@OX`%X3I=\13^>)%;C1)'BMI/6DVG'T1G9/E:6 +M+`L?8[PU+C=N8ZJMJ?]3`]/[,VSF^/O'SU7_H,2B%!L0I4:EPM15L-!$K<6HE##N22N$*(T[VS:NXT0I7EGT]Z50I3FG4U[ +MMQ6B-.]LVKN=$*5Y9]/>[84HS3M0O#,1=Q"B-.^`>;?>*<*\C3JAWH'D'S+LWA+N-.*'>@>8= +M,._>$NY=Q`GU#C3O@'GW?N2=%>H=:-XA\^X#L;*($^H=:MXA\\X2#B).J'>H +M>8?,.R2(?-N3;@BXH1ZAYIWR+S;$.YCQ`GU +M#C7OD'GWB7"?(TZH=ZAYA\R[+X2[BSBAWJ'FG6/>?27A7GO/UV\/[;"4>^8`!:7`*;S.>F@','_._I +M[]B_&C?;A@LX_>T`=70)VW-P[=N!WIE],_2.X;W>,N(FWPXTCSP'J4/-SL_L +MGBM87'^=VV>U77RH97?*W?J:F)]06V`PW(G\S'BXS46\>]AFJ]@N0&*X9HC; +M3J[M=';+<7:[F1?#\YUQYLYM(,.=&W`P;R&`MK+4!M9GC8]ZQ_'7:O@-0$?` +1V6;0Y#$M-#`Y-BUP8SDX+G%C;W<`$\Y4!5RHI;^$@BULK*;1P(8NKE)3EG<][5RLIRSN?]VZCI"SO +M?-Z[K9*RO/-Y[W9*RO+.Y[V[5U*6=V!XYQBW5U*6=R"\6Q+N&>,.2LKR#H1W +MSPGWHL-Y+65Y!\*[EX2[8)S2[\#R#H1WKPCWFG%*OP/+.Q#>O2'<)>.4?@>6 +M=R"\>TNX=XQ3^AU8WH'P[OW(.Z_T.["\0^'=!V(5C%/Z'5K>H?#.$PX8I_0[ +MM+Q#X1T2+C!.Z7=H>8?"NTBXDG%*OT/+.Q3>K0E7,4[I=VAYA\*[FG`?&:?T +M.[2\0^'=)\)]9IS2[]#R#H5W7PAWQ3BEWZ'E71#>?27<-\8I_2Y8W@7AW7?" +M73-.Z7?!\BX([VX(=]OA0$MUWA6%?A#N;G3/PKS/GX&?C[URM@/V@G'-?-71%+5\&I%?Z[^ZM,&.:;<,+9VWD:Z`KVI^#:[7SO +MF[[_<&8.#!_.EHR;W,XW>Y2]-F!6%^>5!:`2N?XZMYNK'>]"Q:-MM[Z.ZU.: +M`0RF.U&?&T^W^=7M=L=B%=L%R$S7#7';R;6=KFXYKFXW\V*@O#-.O',;R/#. +I33B8MQ&$]+]>T?;(T=D>./Y:#=\)&`@XVQ4,9?/;L?@/'U:4T(,4```` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,21 @@ +# $FreeBSD$ +begin 644 img-1x1-4096-vtoc8.qcow2.gz +M'XL("*@[(U0``VEM9RTQ>#$M-#`Y-BUV=&]C."YQ8V]W,BYO=70`K9C;CM,P +M$(;O^Q3NM4O7;\9%4G@)<"`$S?CHOH@ +MU$<3YL+Z8.GZD%\_>\S1@7*^/@SUT=1&PE59'#"I6L)MLSAD4HV$VV5QADFU +M$LYE<99)[06>^V3$KR +M3N>]:YB4Y)W.>[=C4I)W.N]=RZ0D[T#P3B6<8U*2=T"\6T?<5<+MF93D'1#O +MGD3/8NXYPG']#N0O`/BW8N(>YEP3+\#R3L@WKV*N.N$8_H= +M2-X!\>YUQ+U).*;?@>0=$._>3KS33+\#R3LDWKV+K"+AF'Z'DG=(O-,1!PG' +M]#N4O$/B'4:<23BFWZ'D'1+O;,25"(?&NCKCW +M"?8JXVX1C^AU*WAGBW>>(^Y)P3+\SDG>& +M>/[N]X/Y,:S/+GU# +M8-/Z%=PR4535'\=!6C\[6K\ZB\MLAPT'LT6F&W#-N3C_X^*/]JU3SA'IZ@S@>@`,N&ZZ(4QWF/EOX#BL#NM)?0&7I@N#"(QPFJO. +MGQ;[UQC7)IRF/6MVLFNV.K>H*GU?/@O7;E7CNI-MLYG@KHZXOB_[`Y"_:9V^ +;RP.'GS?C9U#%1.!B[IFR:U2K?VQQ7;KP$@`` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-512-apm.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-512-apm.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,22 @@ +# $FreeBSD$ +begin 644 img-1x1-512-apm.qcow2.gz +M'XL("(\[(U0``VEM9RTQ>#$M-3$R+6%P;2YQ8V]W,BYO=70`K9A);]LP$$;O +M^15,]Z9-*LZ0E-P]FX$>"J0->@Z\R$"`+D8:H!?_^%+6R)2I&3$VY`A"#.)[ +M&`^?QZ:SK'XH9;4R3IF16DR5?TX7J-:3[4NMOHV_G+0?JX,:IC,AQ2P8W."V +M6.-:U2&#@R;5!:5P1JRN;X'!'1VL6[?>C")*X#[`&B=NQE[U +M05U?G#![U@=#UX=\_VR3BQ=G<@E7)''`I$82;I+$(9.:2KA9$F>8 +MU%S"E4F<95(+`:<3JGB<8U):PD$2ES,IE'`FB2N8E.2=3GLW8E*2=SKMW81) +M2=[IM'=3)B5YI]/>S9B4Y)U.>S=G4I)W('BG`JYD4I)W$'EW2+A'`;=@4I)W +M$'GWF'!/-CC-I23O(/+N*>&>!1PS[T#R#B+OGA/N1<`Q\PXD[R#R[B7AC@*. +MF7<@>0>1=Z\(]SK@F'D'DG<0>7?<\4XS\PXD[S#R[@VQLH!CYAU*WF'DG28< +M!!PS[U#R#B/OD'`FX)AYAY)W&'EG"><"CIEW*'F'D7H#%+L"^"FO<:-`7;.L7['?`0CA'9>M/R*(7>/F]PAQNUV>'/A#86A@_FA]WJ[&+] +MOY/]1OC+CTN+U93S7S.4M=6:Q2YP?%>6 +M9]<7QS_&U^W^F6%_;+#^1)7N'[3Z5[])VOU3[?K4YXV;HW]]_ +HM8A-?4/WKZ#^^9-Z]RXOK*Y.MO]JH"'@8!4:5TWG@_\+*`W"Y1,````` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-512-bsd.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-512-bsd.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,21 @@ +# $FreeBSD$ +begin 644 img-1x1-512-bsd.qcow2.gz +M'XL(")$[(U0``VEM9RTQ>#$M-3$R+6)S9"YQ8V]W,BYO=70`K9C;DM)`$(;O +M>8I9SZZ*F>Y)2#RLNNM:Y9W>Z#6P\!0\O!NFR22=_C-(!5*IHH;_JY[,EV9" +M4<27_PL![G>A^'A#K]__%SV7X=%A/D"I(R!P!UNP+I+.$*X +MPH\'O(WK5<<&CDZI,2B'"["ZJ0$#=[TX7KKC8M0JP9<`(PXNQD7U4:Q/)\*% +M]='<];%]_D"X7197 +M&JD]P/F,*H^XRDAYA*,L;F6D&.%"%E<;*>2=SWO7&"GDG<][MS92R#N?]VYC +MI)!W/N_=UD@A[WS>NPDO'LJN&<= +MSELIY!TI[YX+[D7"&?V.D'>DO'LIN%<)9_0[0MZ1\NZUX*X3SNAWA+PCY=T; +MP;U-.*/?$?*.E'?O1MYYH]\1\HZ5=^^%522\8>LO/LLN)N$,_H=(^^"\NZ+X+XFG-'O`O(N*.^^">XVX8Q^ +M%Y!W07EW)[CO'8ZL5.==4=B'X.Y']RS-N_\,:7_LC3,>F`#6_P..-PNA^\.>%SA-^O^Y@(.##<75PDW^3C:[K%WU@"LKIQ9%JI5KK_.KMD?'U).W5UM +MS;KU=:D^0V8:3'>B/C>>;ONKT3W=J55L<929KAOB-I-K.UW=U;BZ[#$M-3$R+65B=2C@X)0:@U(XIU8W-2#@;A?M3]`TPX-3%N*H^"/7QA+NR +M/IB[/I1_/W_*\8%\NCX,]?'46L,521P(J8V&*Y,X%%);#;=+XIR0VFNX0Q+G +MA52EX&Q"E1J7"RFKX2")6PLIU'`NB2N$E.:=37NW$5*:=S;M72FD-.]LVKNM +MD-*\LVGO=D)*\\ZFO=L+*B +MPUDII7D'S+N7A+N).*'?@>8=,.]>$>YUQ`G]#C3O@'GWAG"W$2?T.]"\`^;= +M6\*]BSBAWX'F'3#OWH^\LT*_`\T[9-Y](%86<4*_0\T[9-Y9PD'$"?T.->^0 +M>8>$K0E71)S0[U#S#IEW&\)]C#BAWZ'F +M'3+O/A'N<\0)_0XU[Y!Y]X5P=Q$G]#O4O'/,NZ^$^Q9Q0K]SFG>.>?>=+]\=6>-4')H#%)<"I"@-N +M,^N$?=@;EP&K2JO/A[U1?Z&^2D]OZBM,C_*V]PZ#.B]*_DK+X6;;'P&G'^9I +MH"O8GH-K#_.];_;-T`>&MV;+B)L\S##$M-3$R+6=P="YQ8V]W,BYO=70`K9A+;YPP$(#O +M^15.WTT:BLVL/+(]3%:EWVM]>C`T&,P/)UKMHE[N[CJ:?]LC`>$Q$(0-2C+@9Z]+A +M@,+%?#G`<=PD.X'@8(A:@K9PDLQN;0#!G1SU2]??C,R+$(<`#8Z\&0?E!R8_ +M/T(>F!^$SD_@ZZ>&.'\@6<]/F/S\J)3"99LX0*)R"E=LX@02M:=PY29.(E$5 +MA:LW<0J):@@0F+D.B*._XMG]*Y`H +MRCN^[=T>B:*\X]O>E4@4Y1W?]JY"HBCO@/"..5R-1%'>@>?=L<4]^%P2+\#RCOPO'MI<2<. +MA_0[H+P#S[M3BWOE<$B_`\H[\+P[6WC'D7X'E'?"\^ZU9<4.A_0[07DG/.^X +MQ8'#(?U.4-X)SSMA<=+AD'XG*.^$YYVRN,3AD'XG*.^$YUUJ<9G#(?U.4-X) +MS[OO;>X#PZ']#M!>2<][SY:W">' +M0_J=I+R3GG?G%G?A<$B_DY1WTO/NTN(^CSC`HD;OXAB_+.YJ4;.`]#N9W!.W +M6^+HAY5#CK/2';3`P(RX>-H@JL"KU]?;@\`*L6*8@'\ +M/N37EUM77^;=0&>WZIN!`J;DB.OGJLII?E>[:W9S_O6;AOUPT^W+3>-J_;!4 +M)%YVG)KNU1?$/F7*+6W\U1YP@L*-QS(/IX\7:;6"PR[6_B%P1TW;%LL4RX`E):L*$O=KADL"FR?U\#YA:JV"KEUM9L(L>(%>O,*N'+Y)."BV9=EBUH>`&W#[PZB5ZN*N/KG\O +M?^F!]B::?PU06F"P#&72E`&K0^,"5H?&!:P.C0M:'1H8L#HT+F!U:%S`ZM"X +MH-71`>LXW":N<=J]/&.J8KED335/@]R.V^@G.MT:UK;^E4T#$M-3$R+6UB*VD]:3:M-5R1Q($0M=%P91*'0M16P^V2."=$[37<(8GS +M0E2EX&Q"E1J7"U%6PT$2MQ:B4,.Y)*X0HC3O;-J[C1"E>6?3WI5"E.:=37NW +M%:(T[VS:NYT0I7EGT][MA2C-.U"\,Q%W$*(T[X!YMR3/2?< +MBPYGI2C-.V#>O23<3<0)]0XT[X!Y]XIPKR-.J'>@>0?,NS>$NXTXH=Z!YATP +M[]X2[EW$"?4.-.^`>?=^Y)T5ZAUHWB'S[@.QLH@3ZAUJWB'SSA(.(DZH=ZAY +MA\P[))R+.*'>H>8=,N\\X?*($^H=:MXA\VY-N"+BA'J'FG?(O-L0[F/$"?4. +M->^0>?>)<)\C3JAWJ'F'S+LOA+N+.*'>H>:=8]Y])=RWB!/JG=.\<\R[[X2[ +MCSBAWCG-.\>\>R#<8X<#*:KS+LOD1KBGT9Z%>>\_7;P_ML)1[Y@`%I<`IS(, +MN,VL`_9AP(T&I7#4.X[WJ^&W`[:;[0)@/3]5-0+2@'W8;/4)=2L]_:A;F"\: +MGNU=T84!+U<]W'[F^6OWQP5`[TU9CH!_3OG!W,OA&J!?-YO,YZ:`F7TS]([AO=XRXB;?#C2//`>I0\W.S^R> +M*UA+C-1;Q[V&:KV"Y`8KAFB-M. +MKNUT=LMQ=KN9%\/SG7'FSFT@PYT;<#!O(8"VLM0&UF>-CWK'\==J^`U`1\#9 +09M#ES:5H\1\W+X2OTA0````` +` +end Added: head/usr.bin/mkimg/tests/img-1x1-512-pc98.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-1x1-512-pc98.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,21 @@ +# $FreeBSD$ +begin 644 img-1x1-512-pc98.qcow2.gz +M'XL(")D[(U0``VEM9RTQ>#$M-3$R+7!C.3@N<6-O=S(N;W5T`*V8VY+3,`R& +M[_L4+H<%%BBQ9*<)AP7VP`QW<`%\CNM5APH.'E-C4`X7S.JF!A3<'"BGZ\-4GTRM+5R5Q8&2JBW<)HM#);6U<+LL+BBI>PNW +MS^*BDCH8.)]1Y0%7*BEOX2"+6RLIM'`ABZN4E.6=SWM7*RG+.Y_W;J.D+.]\ +MWKNMDK*\\WGO=DK*\L[GO;M74I9W8'CG&+=74I9W(+Q;$NX9XPY*RO(.A'?/ +M"?>BPWDM97D'PKN7A+M@G-+OP/(.A'>O"/>:<4J_`\L[$-Z](=PEXY1^!Y9W +M(+Q[2[AWC%/Z'5C>@?#N_<@[K_0[L+Q#X=T'8A6,4_H=6MZA\,X3#ABG]#NT +MO$/A'1(N,$[I=VAYA\*[2+B2<4J_0\L[%-ZM"55=$-Y])=PWQBG]+EC>!>'==\)= +M,T[I=\'R+@CO;@AWV^%`2W7>%85^$.YN=,_"O,^?@9^/O7*V!R:`U5.`4Q4F +M7#WKA&.:<*/!1CG;`\?KU?#=`5MAG@",T6W&P#]IPC$)4P>W"]J\#@<^3KA^ +M<6YA8K,DLUX_:"<1KH"O:GX-KM?.^; +MOO]P9@X,'\Z6C)OUVQV(5VP7(3-<-<=O)M9VN;CFN;C?S8J"\,TZ\#$M-3$R+79T;V,X+G%C;WITZ((#Z6L5J94IE;[1OG/\0(U^#"^U.'7X_>;X>.P"C!=""EFP.`)-V+= +M)QQ(N$)/!S2/&U2'#`Z.J2DHAS-B=7,##.YZU2]=OQD52>`EP(`3-^.B^B#4 +M1Q/FPOI@Z?J07S][S-&!Z;QW-9.2O--Y[[9,2O). +MY[UKF)3DG +M1-S3$TYS*O8JXZX1C^AU( +MW@'Q[G7$O4DXIM^!Y!T0[]Y.O--,OP/).R3>O8NL(N&8?H>2=TB\TQ$'"0=$N]LQ)4)Q_0[E+Q#XMTFXJJ$8_H=2MXA\:Z.N/<) +MQ_0[E+Q#XMV'B/N8<$R_0\D[)-Y]BKC;A&/Z'4K>&>+=YXC[DG!,OS.2=X9X +M]S7B[A*.Z7=&\LX0[^XC[N&$`RYU\JXH^"OBODV^L[#L^=.D\[%FWN6!&6#U +M/\"Y"@.N7G3"-DS8WSIN0)6VN[P2%KN=]$U$F58"/OYU[N[W@_DQK,\N?4-@ +MT_H5W#)15-4?QT%:/SM:OSJ+RVR'#0>S1:8;<,VY./_CXH_VK5/.$=R?`6ZW +M\&;HR71==_+WQZGJ#.!Z``RX;KHA3'>8^6_@.*P.ZTE]`9>F"X,(C'":J\Z? +M%OO7&-.ZDVVSF>"NCKB^+_L#D+]IG;[+ +:`X>?-^-G4,5$X&+NF;)K5*M_;'%=NO`2```` +` +end Added: head/usr.bin/mkimg/tests/img-63x255-4096-apm.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-63x255-4096-apm.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,22 @@ +# $FreeBSD$ +begin 644 img-63x255-4096-apm.qcow2.gz +M'XL("+@[(U0``VEM9RTV,W@R-34M-#`Y-BUA<&TN<6-O=S(N;W5T`*V826_; +M,!!&[_D53/>F32K.D)35/9N!'@JD#7H.O,A`@"Y&&J`7__A2ULB4J1DQ-N0( +M1@SB>Q@/GT>FLZQ^*&6U,DZ90BVFRK^F"U3KQ?:E5M_&7T[:C]5!#=.9D&(6 +M#&YP6ZSS@`,)E^GN@N9QK>J0P4&3ZH)2."-6U[?`X(X.UJU;;\8H2N`^P!HG +M;L9>]4%=7YPP>]8'0]>'?/]LDXL77']]6-<7IW()-TKB@$D5$FZ2Q"&3FDJX +M61)GF-1Z;1W4R8E>:?3WLV8E.2=3GLW9U*2=R!XIP*N9%*2=Q!Y=TBX1P&W +M8%*2=Q!Y]YAP3S8XS:4D[R#R[BGAG@4<,^]`\@XB[YX3[D7`,?,.).\@\NXE +MX8X"CIEW('D'D7>O"/8>2=QAY9PGG`HZ9=RAYAY%W.>%&`8>2=QAY]X%P'P..F76X4YW*[/#GT@L+4P +M?C*;>2>'TH'/+ZRNOC+]L[4P_N/@IZF_W$PY^Z#Z3I?+GR6#DT^WNQ^G/`Z[ +MU=G%^G\O2PXJ-\H5].P6RI75,E5WLYSW_[Y?=/@JANDFU?A?)?J?DV6 +M;'5VX+TU#]S;YGX!!-S>6]749X9VSZRWPU6-]QOA+S\N+593SG_-4-96:Q:[ +MP/%=69Y=7QS_&%^W^V>&_;'!^A-5NG_0ZE_](6GW3[7K5YXR; +MH7]__]4B-O4-W#^=4?_\2;W[+"^LKDZV_VJ@(>!@%1I73>>#_Z4*H1'E$P`` +` +end Added: head/usr.bin/mkimg/tests/img-63x255-4096-bsd.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-63x255-4096-bsd.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,21 @@ +# $FreeBSD$ +begin 644 img-63x255-4096-bsd.qcow2.gz +M'XL("+H[(U0``VEM9RTV,W@R-34M-#`Y-BUB.FD[F>FX_S=R +M_%E)6A3IY5SI7:A<:-UQY^Z_TP?3`]5\?9CJDZG:PC59'"BIUL)MLSA44CL+M\_B@I*Z +MLW#&SAW@2B5U-'`^H\H]KE)2WL)!%ET2XQXP[*BG+ +M.Q#>/2'.4?@>6=R"\>T&XEXQ3^AU8WH'P[A7AKABG +M]#NPO`/AW6O"O6&4="N^0<(%Q2K]#RSL4WI6$JQBG]#NTO$/A74VXAG%*OT/+.Q3>M81[ +MSSBEWZ'E'0KO/A#N(^.4?H>6=RB\^T2X:\8I_0XM[X+P;D.XSXQ3^EVPO`O" +MNR^$NV&!UJJ]ZXH]`_A;B=[%I:]_PQ\?^R5HSTP`VS^ +M!SA78<*UBTZX3!..&FR5HSUPNEF/WSWPO,)E'5>UK%P##ZWPS^WOZ83+!5S'41KH"NZWX`2W&>#B%>TX^.5P'=W>\_8?$@>XZ\3K<+./H_$>^Z`-F),M +M%Y8%&I$;KG.\M8MWX%UW%[=F_?HZKD^1&4;3G:G/3:<;KQK]TYU8CXB#S'3= +M&!>O&F)?\A)FSMYF6MU^X<5`N3,>N',C9+QS$PZ6;020_IM_@&MW,`2X6H6L'9B"H-+A.BK(:#*"X7HE##N2BN$*(T[VS\J +M(4KSSL:]VPE1FGB-*\LW'O#D*4YATHWIF`.PI1FG?`O'M"N)N`JX4H +MS3M@WCTEW+,>9Z4HS3M@WCTGW(N`$_H=:-X!\^Z6<"\#3NAWH'D'S+M7A+L+ +M.*'?@>8=,.]>$^Y-P`G]#C3O@'GW=N*=%?H=:-XA\^X=L9*`$_H=:MXA\\X2 +M#@).Z'>H>8?,.R2<"SBAWZ'F'3+O4L)E`2?T.]2\0^9=3K@BX(1^AYIWR+PK +M"?<^X(1^AYIWR+S[0+B/`2?T.]2\0^;=)\)M`D[H=ZAYYYAW6\)]#CBAWSG- +M.\>\^T*X^X`3^IW3O'/,NZ^$^];C0(KJO4L2>2//R_/)C.]Q6927L]8'3_7K\[8"%?SN0MT669J:` +MQV;X]^&/L+[%<@]\'J>_':"!+N&^(TYPVP$.O7V!,BBKD7?#WP/<9ATZZ?=/A!U%UMVI]ROKPGY";T%1M.=R<], +MI]M>Q/N';;8>+0XBTS5CW+E1#=9SM(21L[>99K=?>#$LKXQ'5FX+&5>NQ\&R +FC:`\=Y;&P.:HZ5X?./UZ`BXV!ET67OM7?T'9%>AF-(4```` +` +end Added: head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,26 @@ +# $FreeBSD$ +begin 644 img-63x255-4096-gpt.qcow2.gz +M'XL("+X[(U0``VEM9RTV,W@R-34M-#`Y-BUG<'0N<6-O=S(N;W5T`*V92V_4 +M,!"`[_T5+F]:6.)7DN51:$LK]=8BN'')\UB)*PK\=N+8B9/)3-PNWK6BKJSY +M9#O?C)TT2>R',$)$(1U*3K@% +MZ]+C!(5+^+J#X[C9Z"2"$V/4&A3"*7)T6QT([N1H6+KA9N0@0AX"M#CR9APT +M/F''!R/4@>,3L<PI7!'$2B2HI7!7$ +M*22JIG!-$*>1J);`\8`J/2Y%HCB%$T%"N!R)HKSC8>_V2!3E'0][ +M5R!1E'<\[%V)1%'>\;!W%1)%>BA]0[07DG@'>G#O?&XY!Z)RCO!/#N[2X=Y['%+O).6=!-Y]<+B/'H?4.TEY)X%WGQSNS..0>B4^)-6-L)&ZL*Y$IW=!>[Y7<" +M#KG[".`XPB7.35C;W+4/C$W#VM8UNU(N.)\=$)`)'^]FN#KR^@WI]@B@UJPH +M5L`?X_B&=.OSR[X;Z.W60S'0@FDUX8:YZFH^OJOK&W9[_NV[@?WTTQW2+2M8 +MQ5F1LP*.CE/3_8W9IVVZ92U<[1$G*=QT+`,X<[S(Z@TRV+88SUIYEW)S=>F!W?[>[M["WNU^G;GR*.R.P1G=0JZ>&RIQ3T\W\@P`Q +M7;;$8:^1_FOU3%TN=;35VSM9L$9WD*M7V-7#%\FL'IHRW;AJ8\*-N#+NZG'[ +M"C,Q]7M]I3NZV]WR:X'*`:.-4*5M%3$[#"YB=AA(&9]PK,E8+\YRX^'_!UG;<#8^/Z^DV8FOKW]C$\9O1 +E1-S$#6YS$\\:>K+V\Q=,-N(F;G!1-W&5F>/WT3\!FKQU%1H````` +` +end Added: head/usr.bin/mkimg/tests/img-63x255-4096-mbr.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-63x255-4096-mbr.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,23 @@ +# $FreeBSD$ +begin 644 img-63x255-4096-mbr.qcow2.gz +M'XL(",`[(U0``VEM9RTV,W@R-34M-#`Y-BUM8G(N<6-O=S(N;W5T`*V8VY+3 +M,`Q`W_=M)F,NVX.B/; +M1VJ2+(LOYW+O0N%"Y0X;UWRG`USOR_!PQU_??RSZK^--A/G,B%(&EOL.-V#] +M8QQ8N,R/![R.ZV6'"@[.46-0"A?,[*8&%-SMS6GI3IM1B@B\!AAQYF9[90HRSLPO'.,VRM1EG<@O'M$N,>,.RA1 +MEG<@O'M"N*<=SFM1EG<@O'M&N.>,4_H=6-Z!\.X%X5XR3NEW8'D'PKM7A+ME +MG-+OP/(.A'>O"?>&<4J_`\L[$-Z]'7GGE7X'EG.4?H>6=RB\0\(%QBG]#BWO4'B7$ZY@G-+OT/(.A7=+PI6,4_H=6MZA\*XB +MW'O&*?T.+>]0>/>!_T9^/K8*V=[8`)8 +M7@*.-XMAN\.>"JV"X#-^AP.(R!-.(_%UOR@.>J< +M/C1'+!":WM9SF0TGO*928]QNYO4[U<<%P#QW=3T"_C[G!Y-I7)[?XV2HXXNS'#31P3KAKL2/G4Z\*[_ +MN8=;+;C5-[C)QPWM/=1>&S`GF\\K2]DUJ\[6WCZWE^[M'=;YWUM<>G?[ZS@_ +MI5G!8+H3^;GQ=-NK@N[N7>Q'BX/$=-T0US:J_GX.MC"Q>JMQ=MN9-\/+RGA@ +MY;:08>5&',S;"*I39VD,;'XU/ML#QY^+X3L"`P%G6\%0M/]M-_\!8,LR/2,5 +"```` +` +end Added: head/usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,22 @@ +# $FreeBSD$ +begin 644 img-63x255-4096-pc98.qcow2.gz +M'XL(",([(U0``VEM9RTV,W@R-34M-#`Y-BUP8SDX+G%C;W8."Y18LG/ATET6EAG>X`%X;KO-5W3X=NK:C1)%BKLE;2;3CD=G +M9/M8L5,4\6.,M\:5QC6FW9C#_W2!Z?T97F;_\]OW9?^S7T28+90HH:':=;@! +MZR_A0,,5=MQ@95PO.Q1P<(H:@W(XIV8WU2#@KA;'H3M.1LTB\!)@Q*F3<5%^ +M$//C$>["_&#N_%`>/W^*XPWE='X8\^-1E8:KLS@0HAH-M\[B4(C::+AM%N>$ +MJ'L-IZS<'LX+4:V"LQE5#KA2B+(:#K*X2HA"#>>RN%J(TKRS>>\:(4KSSN:] +M6PM1FGW@>*=(=Q.B-*\`^;=HX1[3+A6 +MB-*\`^;=DX1[VN&L%*5Y!\R[9PGWG'!"O0/-.V#>O4BXEX03ZAUHW@'S[E7" +M71%.J'>@>0?,N]<)]X9P0KT#S3M@WKT=>6>%>@>:=\B\>Y=8!>&$>H>:=\B\ +MLPD'A!/J'6K>(?,.$\X13JAWJ'F'S#N?<"7AA'J'FG?(O*L2KB:<4.]0\PZ9 +M=TW"O2><4.]0\PZ9=Q\2[B/AA'J'FG?(O/N4<"O""?4.->\<\^XZX6X()]0[ +MIWGGF'>?$^Z6<$*]&^=CB0HCKOBD*^$NYNM&9AWOVGH_VQ%>YZ +MPP2P?@AP*L.(:V;ML(\=#AJLA;O>L+]=#K\=\"C,`X#>F_48^"MVV$=A&F>V +M3NI7V])UQOCYN87Q84IF'3\03VC_D6&UFSG#.KYPJ,*Z]:6IX=P,_]S]%J:D +MGN\,&7'Z"X?4<$H86PUWW<-AU(PHO95JMI8*?/]W#[=:4K$_X"9?.(13U$YJ +M4#OKYY6E[LK5Z>K/<]B\AS/6Z?G--M_=_!K*3RA7,.CN1'YFW-VP+^C.[VP^ +M`@XRW35#7-@7].=S,(69T5N-L]O./!F6KXPS5VZ`#%=NQ,&\A:`Y5I:#@:&* +=C^YZP_['`LXV@*\/3;?$/F4FZ`B45```` +` +end Added: head/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,21 @@ +# $FreeBSD$ +begin 644 img-63x255-4096-vtoc8.qcow2.gz +M'XL(",0[(U0``VEM9RTV,W@R-34M-#`Y-BUV=&]C."YQ8V]W,BYO=70`K9C; +M;M-`$(;O\Q3+J4"!DIW9=6Q.A1XB<8$$X@6(8_L!N$/*P[.Q-QE[/.--(J=6 +MI-3]/\VNO_ZUNUQV+V.\-2XSKC!-:<+G>(#I?1@>9O=K_?VF_]HM.IA=*JG1 +M"6M6Q1$W8/TC'&BX$!>^)>)ZTZ&`@T-J#$KAG#K=U`D!=[UHMZZ]&#E+X"7` +M#J=>C(OF@VX^GG`7S@=SSX?R_OD+Y\/YY\-Z*L<'SU+S82.D5AHN3^&>$E-5PD,1Y(84:SB5QF9#R&B[I +MG5L)*0>*=X9P6R&E>0?, +MNR<1]Y1PE9#2O`/FW;.(>TZX6DAIW@'S[D7$71%.Z#O0O`/FWW7$>2FE +M>0?,N]<1=TTXH>]`\PZ8=V\B[BWAA+X#S3M@WKT;>>>%O@/-.V3>O8^L)>&$ +MOD/-.V3>V8@#P@E]AYIWR+S#B'.$$_H.->^0>>H>8?,NU7$Y803 +M^@XU[Y!Y5T3:=\B\^QAQGP@G]!UJWB'S[G/$?2&H>>>8=[<1 +M]Y5P0M\YS3O'O/L6<7>$$_K.:=XYYMU]Q#T03N@[IWGGF'>/$;C +M^WCH.V?WZP?T42-S5?A]O,M=P.5YZ*"_4= +M;NVKVM0UP_WIX;8S7PP[6FY]N//'"Y9K#\M%^N&F;;[0?PJN]\MVRW&T7&`I +M^D>-E:8SXG35$5=NJ?-.V;U["3?Y9'O^WIW$3```` +` +end Added: head/usr.bin/mkimg/tests/img-63x255-512-apm.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-63x255-512-apm.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,22 @@ +# $FreeBSD$ +begin 644 img-63x255-512-apm.qcow2.gz +M'XL("*H[(U0``VEM9RTV,W@R-34M-3$R+6%P;2YQ8V]W,BYO=70`K9A);]LP +M$$;O^15,]Z9-*LZ0E-P]FX$>"J0->@Z\R$"`+D8:H!?_^%+6R)2I&3$VY`A" +M#.)[&`^?QZ:SK'XH9;4R3IF16DR5?TX7J-:3[4NMOHV_G+0?JX,:IC,AQ2P8 +MW."V6.-:U2&#@R;5!:5P1JRN;X'!'1VL6[?>C")*X#[`&B=N +MQE[U05U?G#![U@=#UX=\_VR3BQ=G<@E7)''`I$82;I+$(9.:2KA9 +M$F>8U%S"E4F<95(+`:<3JGB<8U):PD$2ES,IE'`FB2N8E.2=3GLW8E*2=SKM +MW81)2=[IM'=3)B5YI]/>S9B4Y)U.>S=G4I)W('BG`JYD4I)W$'EW2+A'`;=@ +M4I)W$'GWF'!/-CC-I23O(/+N*>&>!1PS[T#R#B+OGA/N1<`Q\PXD[R#R[B7A +MC@*.F7<@>0>1=Z\(]SK@F'D'DG<0>7?<\4XS\PXD[S#R[@VQLH!CYAU*WF'D +MG28<"CIEW*'F'D7H#%+L"^"FO<:-`7;.L7['?`0CA'9>M/R*(7>/F]PAQNUV>'/A#86A@_ +MFA]WJ +M[&+]OY/]1OC+CTN+U93S7S.4M=6:Q2YP +M?%>69]<7QS_&U^W^F6%_;+#^1)7N'[3Z5[])VOU3[?K4YXV;H +KW]]_M8A-?4/WKZ#^^9-Z]RXOK*Y.MO]JH"'@8!4:5TWG@_\+*`W"Y1,````` +` +end Added: head/usr.bin/mkimg/tests/img-63x255-512-bsd.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-63x255-512-bsd.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,21 @@ +# $FreeBSD$ +begin 644 img-63x255-512-bsd.qcow2.gz +M'XL("*P[(U0``VEM9RTV,W@R-34M-3$R+6)S9"YQ8V]W,BYO=70`K9C;DM,P +M#(;O^Q3F#`N46').'+:PL,QP!S=PW7;;I^CP[*QK)4H4*5XZ:3N9Z;C_-W+\ +M64E:%.GE7.E=J%QHW7'G[K_3!]S@R_CC3K^^_U@/7Z=5@OG"2"D#]:''C5A_ +M&0<6KO#3`:_C!M6A@H,N-07E<,&L;FY`P5VMSJ?NO!B-2.`EP(0S%^.B^B#5 +M)Q/APOI@Z?I0/W]EEY,#U7Q]F.J3J=K"-5D<**G6PFVS.%12.PNWS^*"DKJS +M<,;.'>!*)74T<#ZCRCVN4E+>PD$65RLIM'`ABVN4E.6=SWO7*BG+.Y_W;JND +M+.]\WKN=DK*\\WGO]DK*\L[GO;M34I9W8'CG&'=04I9W(+Q[1+C'C#LJ*UE.4=".^>$>XYXY1^!Y9W(+Q[0;B7C%/Z'5C>@?#N%>&N&*?T +M.["\`^'=:\*]89S2[\#R#H1W;R?>>:7?@>4="N_>$:M@G-+OT/(.A7>><,`X +MI=^AY1T*[Y!P@7%*OT/+.Q3>E82K&*?T.[2\0^%=3;B&<4J_0\L[%-ZUA'O/ +M.*7?H>4="N\^$.XCXY1^AY9W*+S[1+AKQBG]#BWO@O!N0[C/C%/Z7;"\"\*[ +M+X2[89S2[X+E71#>?27_IA,L%5SCA +M[,=1&N@*[K?@!+<9X.(5[3CXY7`=W=[S]A\2![CKQ.MPLX^C\1[[H`V8DRT7 +ME@4:D1NN<[RUBW?@77<7MV;]^CJN3Y$91M.=J<]-IQNO&OW3G5B/B(/,=-T8 +M%Z\:8E_R$F;.WF9:W7[AQ4"Y,QZX^#TK\ZD[+T;!(O`:H,>IBW%5?N#S +MXQ'NROQ@Z?Q0/G]I%\<'LOG\T.?'HW(-5T1Q($25&JZ*XE"(VFFX?13GA*B# +MAE,J=X!+A:A:P=F(*@TN$Z*LAH,H+A>B4,.Y**X0HC3O;-R[4HC2O+-Q[RHA +M2O/.QKW;"5&:=S;NW5Z(TKRS<>\.0I3F'2C>F8`["E&:=\"\>T*XFX"KA2C- +M.V#>/27/2?@>0?,NU>$NPLX +MH=^!YATP[UX3[DW`"?T.-.^`>?=VXIT5^AUHWB'S[AVQDH`3^AUJWB'SSA(. +M`D[H=ZAYA\P[))P+.*'?H>8=,N]2PF4!)_0[U+Q#YEU.N"+@A'Z'FG?(O"L) +M]S[@A'Z'FG?(O/M`N(\!)_0[U+Q#YMTGPFT"3NAWJ'GGF'=;PGT..*'?.E +MIUM?!DQ34U43X.\N/YA-X_+\\F,[W%9E)>SU@=/]>OSM@(5_.Y"W199FIH#' +M9OCWX8^POL5R#WP>I[\=H($NX;XC3G#;`0Z]?8$R**N1=\/?`]QF'3IS@YM] +M.]`^\ARE`76RZ;*R%'UOZ6T=K'-[I]T^$'476W:GW*^O"?D)O05&TYW)STRG +MVU[$^X=MMAXM#B+3-6/^U=_0=D5Z&8TA0````` +` +end Added: head/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow2.gz.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow2.gz.uu Wed Sep 24 22:58:10 2014 (r272088) @@ -0,0 +1,26 @@ +# $FreeBSD$ +begin 644 img-63x255-512-gpt.qcow2.gz +M'XL("+`[(U0``VEM9RTV,W@R-34M-3$R+6=P="YQ8V]W,BYO=70`K9A+;YPP +M$(#O^15.WTT:BLVL/+(]3%:EWVM]>C`T&,P/)UKMHE[N[CJ:?]LC`>$Q$(0-2C+@9 +MZ]+A@,+%?#G`<=PD.X'@8(A:@K9PDLQN;0#!G1SU2]??C,R+$(<`#8Z\&0?E +M!R8_/T(>F!^$SD_@ZZ>&.'\@6<]/F/S\J)3"99LX0*)R"E=LX@02M:=PY29. +M(E$5A:LW<0J):@@0F+D.B*._XMG] +M*Y`HRCN^[=T>B:*\X]O>E4@4Y1W?]JY"HBCO@/"..5R-1%'>@>?=L<4]^%P2+\#RCOPO'MI +M<2<.A_0[H+P#S[M3BWOE<$B_`\H[\+P[6WC'D7X'E'?"\^ZU9<4.A_0[07DG +M/.^XQ8'#(?U.4-X)SSMA<=+AD'XG*.^$YYVRN,3AD'XG*.^$YUUJ<9G#(?U. +M4-X)S[OO;>X#PZ']#M!>2<][SY: +MW">'0_J=I+R3GG?G%G?A<$B_DY1WTO/NTN(^CSC`HD;OXAB_+.YJ4;.`]#N9 +MW!.W6^+HAY5#CK/2';3`P(RX>-H@JL"KU]?;@\`*L6* +M8@'\/N37EUM77^;=0&>WZIN!`J;DB.OGJLII?E>[:W9S_O6;AOUPT^W+3>-J +M_;!4)%YVG)KNU1?$/F7*+6W\U1YP@L*-QS(/IX\7:;6"PR[6_B%P1TW;%LL4RX`E):L*$O=KADL"FR?U\#YA:JV"KEUM9L(L>(%>O,*N'+Y)."BV9=EBUH>`&W#[PZB5ZN*N/ +MKG\O?^F!]B::?PU06F"P#&72E`&K0^,"5H?&!:P.C0M:'1H8L#HT+F!U:%S` +MZM"XH-71`>LXW":N<=J]/&.J8KED335/@]R.V^@G.MT:UK;^E4T2D"9<6%I89WN`!>$YO7]'AVTEJ-4H4*=YVTF8R[;@Z(]M' +M:I(LBR_GE.FU&*"+P&&''F9ER5'\3\ +M9$2X,C^8.S_4UR\_Q\F!8CH_C/G)J*6%*Y,X4*(J"U^;1WE1)E>>?3WM5* +ME.6=3WNW4:(L[WS:NZT297GGT][ME"C+.S"\T2XQXP[*%&6 +M=R"\>T*XIQW.:U&6=R"\>T:XYXQ3^AU8WH'P[@7A7C).Z7=@>0?"NU>$NV6< +MTN_`\@Z$=Z\)]X9Q2K\#RSL0WKT=>>>5?@>6=RB\>T>LC'%*OT/+.Q3>><(! +MXY1^AY9W*+Q#P@7&*?T.+>]0>)<3KF"\8I_0XM[U!X]X%P'QFG]#NTO$/AW2?"K1BG]#NTO`O"NS7A/C-.Z7?!\BX( +M[[X0[HYQ2K\+EG=!>/>5<-\Z'&A1G7=9IA^$NQ_5+,Q[_1GX^M@K9WM@`EA> +M`IS*,.*J62>UG.9#2>\IE)CW&[F]3O5QP7`/'=U/0+^/N<'DVET]U%X;,">;SRM+V36KSM;>/K>7[NT=UOG?6UQZ=_OK.#^E +M6<%@NA/YN?%TVZN"[NY=[$>+@\1TW1#7-JK^?@ZV,+%ZJW%VVYDWP\O*>&#E +MMI!AY489O_SV_=E_[-?1)@ME"BAH=IUN`'K +M+^%`PQ5VW&!E7"\[%'!PBAJ#A.TY&S2+P$F#$J9-Q47X0 +M\^,1[L+\8.[\4!X_?XKC#>5T?ACSXU&5AJNS.!"B&@VWSN)0B-IHN&T6YX2H +M>PVGK-P>S@M1K8*S&54.N%*(LAH.LKA*B$(-Y[*X6HC2O+-Y[QHA2O/.YKU; +M"U&:=S;OW4:(TKRS>>^V0I3FG<<$*]`\T[8-Z]2+B7A!/J'6C>`?/N5<)= +M$4ZH=Z!Y!\R[UPGWAG!"O0/-.V#>O1UY9X5Z!YIWR+Q[EU@%X81ZAYIWR+RS +M"0>$$^H=:MXA\PX3SA%.J'>H>8?,.Y]P)>&$>H>:=\B\JQ*N)IQ0[U#S#IEW +M3<*])YQ0[U#S#IEW'Q+N(^&$>H>:=\B\^Y1P*\()]0XU[QSS[CKA;@@GU#NG +M>>>8=Y\3[I9P0KUSFG>.>?_:>C_;$5[GK# +M!+!^"'`JPXAK9NVPCQT.&JR%N]ZPOUT.OQWP*,P#@-Z;]1CX*W;81V$:9[9. +MZE?;TG7&^/FYA?%A2F8=/Q!/:/^18;6;.<,ZOG"HPKKUI:GAW`S_W/T6IJ2> +M[PP9'J)`Z%5*/@;%(5YX24U7"0Q'DAA1K.)7&9D/(:+NF= +M6PDIS3N;]BX74IIW-NU=(:0T[VS:NXV0TKRS:>]*(:5Y!XIWAG!;(:5Y!\R[ +M)Q'WE'"5D-*\`^;=LXA[3KA:2&G>`?/N1<1=$4[H.]"\`^;=RXA[=<1Y*:5Y +M!\R[UQ%W33BA[T#S#IAW;R+N+>&$O@/-.V#>O1MYYX6^`\T[9-Z]CZPEX82^ +M0\T[9-[9B`/""7V'FG?(O,.((?/N<\1](9S0=ZAYYYAWMQ'W +ME7!"WSG-.\>\^Q9Q=X03^LYIWCGFW7W$/1!.Z#NG>>>8=X\1MR9<,^O]IZ/[ +M=RN\ZR,J$;C^6]=W +MOQ\`?_3F\W,_$'C:O^5@@Q1@WMZ.@[9_?K!_11(W-5^'V\RUW`Y7GHH+]1UN +M[:O:U#7#_>GAMC-?##M:;GVX\\<+EFL/RT7ZX:9MOM!_"J[WRW;+<;1<8"GZ +M1XV5IC/B=-415VZI\T[9O7L)-_ED>_[>G=Q\U<:4P1-KFJV.@\DASE8ERUM@ +BN&<)3\'C=_W$[N?-\*L#N@B<;<+P@!9>B_]NV1VQX1,````` +` +end Modified: head/usr.bin/mkimg/tests/mkimg.sh ============================================================================== --- head/usr.bin/mkimg/tests/mkimg.sh Wed Sep 24 22:51:16 2014 (r272087) +++ head/usr.bin/mkimg/tests/mkimg.sh Wed Sep 24 22:58:10 2014 (r272088) @@ -1,7 +1,7 @@ # $FreeBSD$ mkimg_blksz_list="512 4096" -mkimg_format_list="qcow raw vhd vhdf vmdk" +mkimg_format_list="qcow qcow2 raw vhd vhdf vmdk" mkimg_geom_list="1x1 63x255" mkimg_scheme_list="apm bsd ebr gpt mbr pc98 vtoc8" From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 02:26:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8109DE33; Thu, 25 Sep 2014 02:26:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C933E21; Thu, 25 Sep 2014 02:26:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8P2Q6Aj055636; Thu, 25 Sep 2014 02:26:06 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8P2Q6AS055635; Thu, 25 Sep 2014 02:26:06 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201409250226.s8P2Q6AS055635@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 25 Sep 2014 02:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272089 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 02:26:06 -0000 Author: sbruno Date: Thu Sep 25 02:26:05 2014 New Revision: 272089 URL: http://svnweb.freebsd.org/changeset/base/272089 Log: Fix NULL pointer deref in ipfw when using dummynet at layer 2. Drop packet if pkg->ifp is NULL, which is the case here. ref. https://github.com/HardenedBSD/hardenedBSD commit 4eef3881c64f6e3aa38eebbeaf27a947a5d47dd7 PR 193861 -- DUMMYNET LAYER2: kernel panic in this case a kernel panic occurs. Hence, when we do not get an interface, we just drop the packet in question. PR: 193681 Submitted by: David Carlier Obtained from: Hardened BSD MFC after: 2 weeks Relnotes: yes Modified: head/sys/netpfil/ipfw/ip_dn_io.c Modified: head/sys/netpfil/ipfw/ip_dn_io.c ============================================================================== --- head/sys/netpfil/ipfw/ip_dn_io.c Wed Sep 24 22:58:10 2014 (r272088) +++ head/sys/netpfil/ipfw/ip_dn_io.c Thu Sep 25 02:26:05 2014 (r272089) @@ -751,10 +751,15 @@ dummynet_send(struct mbuf *m) /* extract the dummynet info, rename the tag * to carry reinject info. */ - dst = pkt->dn_dir; - ifp = pkt->ifp; - tag->m_tag_cookie = MTAG_IPFW_RULE; - tag->m_tag_id = 0; + if (pkt->dn_dir == (DIR_OUT | PROTO_LAYER2) && + pkt->ifp == NULL) { + dst = DIR_DROP; + } else { + dst = pkt->dn_dir; + ifp = pkt->ifp; + tag->m_tag_cookie = MTAG_IPFW_RULE; + tag->m_tag_id = 0; + } } switch (dst) { From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 02:40:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9965E1A4; Thu, 25 Sep 2014 02:40:26 +0000 (UTC) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCE4CF97; Thu, 25 Sep 2014 02:40:25 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id n12so5344933wgh.11 for ; Wed, 24 Sep 2014 19:40:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=VlCRwntCZvxDglG8D3QUqMvnREc7Z36ldIWBZUmHHtQ=; b=fL3lrxoDbfAl07fJBkOHqCo4C7qmllNcAzVuBkz+Ix9RdhjMuzlXX+LMpfF/tAsFX0 JFlXzSf2k/xvotc9amG973SRPqCzhn2gE6Xzar5SepId9mO1sGUuSNI06Pkkg5Rhr+Og 5pvK7QkTe65gfhP6qb5n5xoMtIk+B7Q9CKyEUuiAB+eQ3H2mZoM34j9Ls5lpECqwSitz GUgZf5UIsO93qNunJ+lZGhIgFlgfcipLcAqoJ/GKsdPfmGvnNeHHZ7GhVy5FWG5/pYDg Qr8ZTMRV8Pa+DzKNm/Q5yEVNxs8xY/6Zw7v4snw6B/e3dcVxNb3Qnv9PqXVbOBh+NEaD OCZQ== MIME-Version: 1.0 X-Received: by 10.194.94.196 with SMTP id de4mr12756683wjb.86.1411612824003; Wed, 24 Sep 2014 19:40:24 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Wed, 24 Sep 2014 19:40:23 -0700 (PDT) In-Reply-To: <201409250226.s8P2Q6AS055635@svn.freebsd.org> References: <201409250226.s8P2Q6AS055635@svn.freebsd.org> Date: Wed, 24 Sep 2014 19:40:23 -0700 X-Google-Sender-Auth: ekaX7D3PRAPfEd5S0vmGrrbknis Message-ID: Subject: Re: svn commit: r272089 - head/sys/netpfil/ipfw From: Adrian Chadd To: Sean Bruno Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 02:40:26 -0000 Hm, I saw this from Kate on IRC. Did anyone figure out _where_ these frames are coming from? Just dropping them is cool, but I'd really like to see the contents of the frames and what their origin is. I'm worried that they're valid stack-generated frames.. -a On 24 September 2014 19:26, Sean Bruno wrote: > Author: sbruno > Date: Thu Sep 25 02:26:05 2014 > New Revision: 272089 > URL: http://svnweb.freebsd.org/changeset/base/272089 > > Log: > Fix NULL pointer deref in ipfw when using dummynet at layer 2. > Drop packet if pkg->ifp is NULL, which is the case here. > > ref. https://github.com/HardenedBSD/hardenedBSD > commit 4eef3881c64f6e3aa38eebbeaf27a947a5d47dd7 > > PR 193861 -- DUMMYNET LAYER2: kernel panic > > in this case a kernel panic occurs. Hence, when we do not get an interface, > we just drop the packet in question. > > PR: 193681 > Submitted by: David Carlier > Obtained from: Hardened BSD > MFC after: 2 weeks > Relnotes: yes > > Modified: > head/sys/netpfil/ipfw/ip_dn_io.c > > Modified: head/sys/netpfil/ipfw/ip_dn_io.c > ============================================================================== > --- head/sys/netpfil/ipfw/ip_dn_io.c Wed Sep 24 22:58:10 2014 (r272088) > +++ head/sys/netpfil/ipfw/ip_dn_io.c Thu Sep 25 02:26:05 2014 (r272089) > @@ -751,10 +751,15 @@ dummynet_send(struct mbuf *m) > /* extract the dummynet info, rename the tag > * to carry reinject info. > */ > - dst = pkt->dn_dir; > - ifp = pkt->ifp; > - tag->m_tag_cookie = MTAG_IPFW_RULE; > - tag->m_tag_id = 0; > + if (pkt->dn_dir == (DIR_OUT | PROTO_LAYER2) && > + pkt->ifp == NULL) { > + dst = DIR_DROP; > + } else { > + dst = pkt->dn_dir; > + ifp = pkt->ifp; > + tag->m_tag_cookie = MTAG_IPFW_RULE; > + tag->m_tag_id = 0; > + } > } > > switch (dst) { > From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 05:18:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14B7363B; Thu, 25 Sep 2014 05:18:13 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 84BC0B3; Thu, 25 Sep 2014 05:18:11 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8P5I8BF038677 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 25 Sep 2014 09:18:08 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8P5I8Nc038676; Thu, 25 Sep 2014 09:18:08 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 25 Sep 2014 09:18:08 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r272089 - head/sys/netpfil/ipfw Message-ID: <20140925051808.GS884@FreeBSD.org> References: <201409250226.s8P2Q6AS055635@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , Sean Bruno , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 05:18:13 -0000 On Wed, Sep 24, 2014 at 07:40:23PM -0700, Adrian Chadd wrote: A> Hm, I saw this from Kate on IRC. Did anyone figure out _where_ these A> frames are coming from? A> A> Just dropping them is cool, but I'd really like to see the contents of A> the frames and what their origin is. A> A> I'm worried that they're valid stack-generated frames.. I agree on this. Fixing NULL pointer derefs with NULL check is not always a right thing to do. A> -a A> A> A> On 24 September 2014 19:26, Sean Bruno wrote: A> > Author: sbruno A> > Date: Thu Sep 25 02:26:05 2014 A> > New Revision: 272089 A> > URL: http://svnweb.freebsd.org/changeset/base/272089 A> > A> > Log: A> > Fix NULL pointer deref in ipfw when using dummynet at layer 2. A> > Drop packet if pkg->ifp is NULL, which is the case here. A> > A> > ref. https://github.com/HardenedBSD/hardenedBSD A> > commit 4eef3881c64f6e3aa38eebbeaf27a947a5d47dd7 A> > A> > PR 193861 -- DUMMYNET LAYER2: kernel panic A> > A> > in this case a kernel panic occurs. Hence, when we do not get an interface, A> > we just drop the packet in question. A> > A> > PR: 193681 A> > Submitted by: David Carlier A> > Obtained from: Hardened BSD A> > MFC after: 2 weeks A> > Relnotes: yes A> > A> > Modified: A> > head/sys/netpfil/ipfw/ip_dn_io.c A> > A> > Modified: head/sys/netpfil/ipfw/ip_dn_io.c A> > ============================================================================== A> > --- head/sys/netpfil/ipfw/ip_dn_io.c Wed Sep 24 22:58:10 2014 (r272088) A> > +++ head/sys/netpfil/ipfw/ip_dn_io.c Thu Sep 25 02:26:05 2014 (r272089) A> > @@ -751,10 +751,15 @@ dummynet_send(struct mbuf *m) A> > /* extract the dummynet info, rename the tag A> > * to carry reinject info. A> > */ A> > - dst = pkt->dn_dir; A> > - ifp = pkt->ifp; A> > - tag->m_tag_cookie = MTAG_IPFW_RULE; A> > - tag->m_tag_id = 0; A> > + if (pkt->dn_dir == (DIR_OUT | PROTO_LAYER2) && A> > + pkt->ifp == NULL) { A> > + dst = DIR_DROP; A> > + } else { A> > + dst = pkt->dn_dir; A> > + ifp = pkt->ifp; A> > + tag->m_tag_cookie = MTAG_IPFW_RULE; A> > + tag->m_tag_id = 0; A> > + } A> > } A> > A> > switch (dst) { A> > A> -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 05:45:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A8B8B8B; Thu, 25 Sep 2014 05:45:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7545F339; Thu, 25 Sep 2014 05:45:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8P5jrwT049027; Thu, 25 Sep 2014 05:45:53 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8P5jr8s049026; Thu, 25 Sep 2014 05:45:53 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409250545.s8P5jr8s049026@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 25 Sep 2014 05:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272090 - head/sys/dev/mxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 05:45:53 -0000 Author: glebius Date: Thu Sep 25 05:45:52 2014 New Revision: 272090 URL: http://svnweb.freebsd.org/changeset/base/272090 Log: - Provide mxge_get_counter() to return counters that are not collected, but taken from hardware. - Mechanically convert to if_inc_counter() the rest of counters. Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Thu Sep 25 02:26:05 2014 (r272089) +++ head/sys/dev/mxge/if_mxge.c Thu Sep 25 05:45:52 2014 (r272090) @@ -2678,7 +2678,7 @@ mxge_rx_done_big(struct mxge_slice_state /* try to replace the received mbuf */ if (mxge_get_buf_big(ss, rx->extra_map, idx)) { /* drop the frame -- the old mbuf is re-cycled */ - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } @@ -2747,7 +2747,7 @@ mxge_rx_done_small(struct mxge_slice_sta /* try to replace the received mbuf */ if (mxge_get_buf_small(ss, rx->extra_map, idx)) { /* drop the frame -- the old mbuf is re-cycled */ - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); return; } @@ -4036,43 +4036,45 @@ mxge_watchdog(mxge_softc_t *sc) return (err); } -static u_long -mxge_update_stats(mxge_softc_t *sc) +static uint64_t +mxge_get_counter(struct ifnet *ifp, ift_counter cnt) { - struct mxge_slice_state *ss; - u_long pkts = 0; - u_long ipackets = 0; - u_long opackets = 0; -#ifdef IFNET_BUF_RING - u_long obytes = 0; - u_long omcasts = 0; - u_long odrops = 0; -#endif - u_long oerrors = 0; - int slice; + struct mxge_softc *sc; + uint64_t rv; - for (slice = 0; slice < sc->num_slices; slice++) { - ss = &sc->ss[slice]; - ipackets += ss->ipackets; - opackets += ss->opackets; -#ifdef IFNET_BUF_RING - obytes += ss->obytes; - omcasts += ss->omcasts; - odrops += ss->tx.br->br_drops; -#endif - oerrors += ss->oerrors; - } - pkts = (ipackets - sc->ifp->if_ipackets); - pkts += (opackets - sc->ifp->if_opackets); - sc->ifp->if_ipackets = ipackets; - sc->ifp->if_opackets = opackets; + sc = if_getsoftc(ifp); + rv = 0; + + switch (cnt) { + case IFCOUNTER_IPACKETS: + for (int s = 0; s < sc->num_slices; s++) + rv += sc->ss[s].ipackets; + return (rv); + case IFCOUNTER_OPACKETS: + for (int s = 0; s < sc->num_slices; s++) + rv += sc->ss[s].opackets; + return (rv); + case IFCOUNTER_OERRORS: + for (int s = 0; s < sc->num_slices; s++) + rv += sc->ss[s].oerrors; + return (rv); #ifdef IFNET_BUF_RING - sc->ifp->if_obytes = obytes; - sc->ifp->if_omcasts = omcasts; - sc->ifp->if_oqdrops = odrops; + case IFCOUNTER_OBYTES: + for (int s = 0; s < sc->num_slices; s++) + rv += sc->ss[s].obytes; + return (rv); + case IFCOUNTER_OMCASTS: + for (int s = 0; s < sc->num_slices; s++) + rv += sc->ss[s].omcasts; + return (rv); + case IFCOUNTER_OQDROPS: + for (int s = 0; s < sc->num_slices; s++) + rv += sc->ss[s].tx.br->br_drops; + return (rv); #endif - sc->ifp->if_oerrors = oerrors; - return pkts; + default: + return (if_get_counter_default(ifp, cnt)); + } } static void @@ -4087,8 +4089,6 @@ mxge_tick(void *arg) ticks = mxge_ticks; running = sc->ifp->if_drv_flags & IFF_DRV_RUNNING; if (running) { - /* aggregate stats from different slices */ - pkts = mxge_update_stats(sc); if (!sc->watchdog_countdown) { err = mxge_watchdog(sc); sc->watchdog_countdown = 4; @@ -4925,6 +4925,7 @@ mxge_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = mxge_ioctl; ifp->if_start = mxge_start; + ifp->if_get_counter = mxge_get_counter; /* Initialise the ifmedia structure */ ifmedia_init(&sc->media, 0, mxge_media_change, mxge_media_status); From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 05:47:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2073CE5; Thu, 25 Sep 2014 05:47:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8125E34A; Thu, 25 Sep 2014 05:47:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8P5lYaF049282; Thu, 25 Sep 2014 05:47:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8P5lYZO049281; Thu, 25 Sep 2014 05:47:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409250547.s8P5lYZO049281@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 25 Sep 2014 05:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272091 - head/sys/dev/mxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 05:47:34 -0000 Author: glebius Date: Thu Sep 25 05:47:33 2014 New Revision: 272091 URL: http://svnweb.freebsd.org/changeset/base/272091 Log: Whitespace cleanup. Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Thu Sep 25 05:45:52 2014 (r272090) +++ head/sys/dev/mxge/if_mxge.c Thu Sep 25 05:47:33 2014 (r272091) @@ -211,7 +211,7 @@ mxge_dmamap_callback(void *arg, bus_dma_ } static int -mxge_dma_alloc(mxge_softc_t *sc, mxge_dma_t *dma, size_t bytes, +mxge_dma_alloc(mxge_softc_t *sc, mxge_dma_t *dma, size_t bytes, bus_size_t alignment) { int err; @@ -245,8 +245,8 @@ mxge_dma_alloc(mxge_softc_t *sc, mxge_dm } /* allocate DMAable memory & map */ - err = bus_dmamem_alloc(dma->dmat, &dma->addr, - (BUS_DMA_WAITOK | BUS_DMA_COHERENT + err = bus_dmamem_alloc(dma->dmat, &dma->addr, + (BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO), &dma->map); if (err != 0) { device_printf(dev, "couldn't alloc mem (err = %d)\n", err); @@ -385,7 +385,7 @@ mxge_enable_nvidia_ecrc(mxge_softc_t *sc /* XXXX Test below is commented because it is believed that doing config read/write beyond 0xff will access the config space - for the next larger function. Uncomment this and remove + for the next larger function. Uncomment this and remove the hacky pmap_mapdev() way of accessing config space when FreeBSD grows support for extended pcie config space access */ @@ -454,7 +454,7 @@ mxge_enable_nvidia_ecrc(mxge_softc_t *sc } *ptr32 = val | 0x40; pmap_unmapdev((vm_offset_t)va, PAGE_SIZE); - if (mxge_verbose) + if (mxge_verbose) device_printf(sc->dev, "Enabled ECRC on upstream Nvidia bridge " "at %d:%d:%d\n", @@ -573,7 +573,7 @@ mxge_firmware_probe(mxge_softc_t *sc) } } - /* + /* * load the optimized firmware (which assumes aligned PCIe * completions) in order to see if it works on this host. */ @@ -583,12 +583,12 @@ mxge_firmware_probe(mxge_softc_t *sc) return status; } - /* + /* * Enable ECRC if possible */ mxge_enable_nvidia_ecrc(sc); - /* + /* * Run a DMA test which watches for unaligned completions and * aborts on the first one seen. Not required on Z8ES or newer. */ @@ -657,7 +657,7 @@ mxge_validate_firmware(mxge_softc_t *sc, if (be32toh(hdr->mcp_type) != MCP_TYPE_ETH) { - device_printf(sc->dev, "Bad firmware type: 0x%x\n", + device_printf(sc->dev, "Bad firmware type: 0x%x\n", be32toh(hdr->mcp_type)); return EIO; } @@ -685,16 +685,16 @@ mxge_validate_firmware(mxge_softc_t *sc, static void * z_alloc(void *nil, u_int items, u_int size) { - void *ptr; + void *ptr; - ptr = malloc(items * size, M_TEMP, M_NOWAIT); - return ptr; + ptr = malloc(items * size, M_TEMP, M_NOWAIT); + return ptr; } static void z_free(void *nil, void *ptr) { - free(ptr, M_TEMP); + free(ptr, M_TEMP); } @@ -732,7 +732,7 @@ mxge_load_firmware_helper(mxge_softc_t * /* the uncompressed size is stored as the firmware version, which would otherwise go unused */ - fw_len = (size_t) fw->version; + fw_len = (size_t) fw->version; inflate_buffer = malloc(fw_len, M_TEMP, M_NOWAIT); if (inflate_buffer == NULL) goto abort_with_zs; @@ -755,7 +755,7 @@ mxge_load_firmware_helper(mxge_softc_t * status = EIO; goto abort_with_buffer; } - hdr = (const void*)(inflate_buffer + hdr_offset); + hdr = (const void*)(inflate_buffer + hdr_offset); status = mxge_validate_firmware(sc, hdr); if (status != 0) @@ -832,14 +832,14 @@ mxge_dummy_rdma(mxge_softc_t *sc, int en i++; } if (*confirm != 0xffffffff) { - device_printf(sc->dev, "dummy rdma %s failed (%p = 0x%x)", - (enable ? "enable" : "disable"), confirm, + device_printf(sc->dev, "dummy rdma %s failed (%p = 0x%x)", + (enable ? "enable" : "disable"), confirm, *confirm); } return; } -static int +static int mxge_send_cmd(mxge_softc_t *sc, uint32_t cmd, mxge_cmd_t *data) { mcp_cmd_t *buf; @@ -869,7 +869,7 @@ mxge_send_cmd(mxge_softc_t *sc, uint32_t /* wait up to 20ms */ err = EAGAIN; for (sleep_total = 0; sleep_total < 20; sleep_total++) { - bus_dmamap_sync(sc->cmd_dma.dmat, + bus_dmamap_sync(sc->cmd_dma.dmat, sc->cmd_dma.map, BUS_DMASYNC_POSTREAD); wmb(); switch (be32toh(response->result)) { @@ -893,7 +893,7 @@ mxge_send_cmd(mxge_softc_t *sc, uint32_t err = ENXIO; break; default: - device_printf(sc->dev, + device_printf(sc->dev, "mxge: command %d " "failed, result = %d\n", cmd, be32toh(response->result)); @@ -924,7 +924,7 @@ mxge_adopt_running_firmware(mxge_softc_t (sc->sram + MCP_HEADER_PTR_OFFSET)); if ((hdr_offset & 3) || hdr_offset + sizeof(*hdr) > sc->sram_size) { - device_printf(sc->dev, + device_printf(sc->dev, "Running firmware has bad header offset (%d)\n", (int)hdr_offset); return EIO; @@ -943,7 +943,7 @@ mxge_adopt_running_firmware(mxge_softc_t status = mxge_validate_firmware(sc, hdr); free(hdr, M_DEVBUF); - /* + /* * check to see if adopted firmware has bug where adopting * it will cause broadcasts to be filtered unless the NIC * is kept in ALLMULTI mode @@ -1034,11 +1034,11 @@ mxge_load_firmware(mxge_softc_t *sc, int while (*confirm != 0xffffffff && i < 20) { DELAY(1000*10); i++; - bus_dmamap_sync(sc->cmd_dma.dmat, + bus_dmamap_sync(sc->cmd_dma.dmat, sc->cmd_dma.map, BUS_DMASYNC_POSTREAD); } if (*confirm != 0xffffffff) { - device_printf(sc->dev,"handoff failed (%p = 0x%x)", + device_printf(sc->dev,"handoff failed (%p = 0x%x)", confirm, *confirm); return ENXIO; @@ -1054,7 +1054,7 @@ mxge_update_mac_address(mxge_softc_t *sc int status; - cmd.data0 = ((addr[0] << 24) | (addr[1] << 16) + cmd.data0 = ((addr[0] << 24) | (addr[1] << 16) | (addr[2] << 8) | addr[3]); cmd.data1 = ((addr[4] << 8) | (addr[5])); @@ -1136,7 +1136,7 @@ mxge_set_multicast_list(mxge_softc_t *sc err = mxge_send_cmd(sc, MXGEFW_LEAVE_ALL_MULTICAST_GROUPS, &cmd); if (err != 0) { - device_printf(sc->dev, + device_printf(sc->dev, "Failed MXGEFW_LEAVE_ALL_MULTICAST_GROUPS" ", error status: %d\n", err); return; @@ -1219,7 +1219,7 @@ mxge_reset(mxge_softc_t *sc, int interru cmd.data0 = sc->rx_ring_size; status = mxge_send_cmd(sc, MXGEFW_CMD_SET_INTRQ_SIZE, &cmd); - /* + /* * Even though we already know how many slices are supported * via mxge_slice_probe(), MXGEFW_CMD_GET_MAX_RSS_QUEUES * has magic side effects, and must be called after a reset. @@ -1229,17 +1229,17 @@ mxge_reset(mxge_softc_t *sc, int interru * MXGEFW_CMD_SET_INTRQ_SIZE, since the intrq size is used by * the firmware to compute offsets. */ - + if (sc->num_slices > 1) { /* ask the maximum number of slices it supports */ status = mxge_send_cmd(sc, MXGEFW_CMD_GET_MAX_RSS_QUEUES, &cmd); if (status != 0) { - device_printf(sc->dev, + device_printf(sc->dev, "failed to get number of slices\n"); return status; } - /* + /* * MXGEFW_CMD_ENABLE_RSS_QUEUES must be called prior * to setting up the interrupt queue DMA */ @@ -1272,7 +1272,7 @@ mxge_reset(mxge_softc_t *sc, int interru } } - status |= mxge_send_cmd(sc, + status |= mxge_send_cmd(sc, MXGEFW_CMD_GET_INTR_COAL_DELAY_OFFSET, &cmd); @@ -1282,7 +1282,7 @@ mxge_reset(mxge_softc_t *sc, int interru irq_claim = (volatile uint32_t *)(sc->sram + cmd.data0); - status |= mxge_send_cmd(sc, MXGEFW_CMD_GET_IRQ_DEASSERT_OFFSET, + status |= mxge_send_cmd(sc, MXGEFW_CMD_GET_IRQ_DEASSERT_OFFSET, &cmd); sc->irq_deassert = (volatile uint32_t *)(sc->sram + cmd.data0); if (status != 0) { @@ -1349,15 +1349,15 @@ mxge_change_throttle(SYSCTL_HANDLER_ARGS sc = arg1; throttle = sc->throttle; err = sysctl_handle_int(oidp, &throttle, arg2, req); - if (err != 0) { - return err; - } + if (err != 0) { + return err; + } if (throttle == sc->throttle) return 0; - if (throttle < MXGE_MIN_THROTTLE || throttle > MXGE_MAX_THROTTLE) - return EINVAL; + if (throttle < MXGE_MIN_THROTTLE || throttle > MXGE_MAX_THROTTLE) + return EINVAL; mtx_lock(&sc->driver_mtx); cmd.data0 = throttle; @@ -1371,64 +1371,64 @@ mxge_change_throttle(SYSCTL_HANDLER_ARGS static int mxge_change_intr_coal(SYSCTL_HANDLER_ARGS) { - mxge_softc_t *sc; - unsigned int intr_coal_delay; - int err; - - sc = arg1; - intr_coal_delay = sc->intr_coal_delay; - err = sysctl_handle_int(oidp, &intr_coal_delay, arg2, req); - if (err != 0) { - return err; - } - if (intr_coal_delay == sc->intr_coal_delay) - return 0; + mxge_softc_t *sc; + unsigned int intr_coal_delay; + int err; - if (intr_coal_delay == 0 || intr_coal_delay > 1000*1000) - return EINVAL; + sc = arg1; + intr_coal_delay = sc->intr_coal_delay; + err = sysctl_handle_int(oidp, &intr_coal_delay, arg2, req); + if (err != 0) { + return err; + } + if (intr_coal_delay == sc->intr_coal_delay) + return 0; + + if (intr_coal_delay == 0 || intr_coal_delay > 1000*1000) + return EINVAL; mtx_lock(&sc->driver_mtx); *sc->intr_coal_delay_ptr = htobe32(intr_coal_delay); sc->intr_coal_delay = intr_coal_delay; mtx_unlock(&sc->driver_mtx); - return err; + return err; } static int mxge_change_flow_control(SYSCTL_HANDLER_ARGS) { - mxge_softc_t *sc; - unsigned int enabled; - int err; - - sc = arg1; - enabled = sc->pause; - err = sysctl_handle_int(oidp, &enabled, arg2, req); - if (err != 0) { - return err; - } - if (enabled == sc->pause) - return 0; + mxge_softc_t *sc; + unsigned int enabled; + int err; + + sc = arg1; + enabled = sc->pause; + err = sysctl_handle_int(oidp, &enabled, arg2, req); + if (err != 0) { + return err; + } + if (enabled == sc->pause) + return 0; mtx_lock(&sc->driver_mtx); err = mxge_change_pause(sc, enabled); mtx_unlock(&sc->driver_mtx); - return err; + return err; } static int mxge_handle_be32(SYSCTL_HANDLER_ARGS) { - int err; + int err; - if (arg1 == NULL) - return EFAULT; - arg2 = be32toh(*(int *)arg1); - arg1 = NULL; - err = sysctl_handle_int(oidp, arg1, arg2, req); + if (arg1 == NULL) + return EFAULT; + arg2 = be32toh(*(int *)arg1); + arg1 = NULL; + err = sysctl_handle_int(oidp, arg1, arg2, req); - return err; + return err; } static void @@ -1466,156 +1466,156 @@ mxge_add_sysctls(mxge_softc_t *sc) fw = sc->ss[0].fw_stats; /* random information */ - SYSCTL_ADD_STRING(ctx, children, OID_AUTO, + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "firmware_version", CTLFLAG_RD, &sc->fw_version, 0, "firmware version"); - SYSCTL_ADD_STRING(ctx, children, OID_AUTO, + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "serial_number", CTLFLAG_RD, &sc->serial_number_string, 0, "serial number"); - SYSCTL_ADD_STRING(ctx, children, OID_AUTO, + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "product_code", CTLFLAG_RD, &sc->product_code_string, 0, "product_code"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "pcie_link_width", CTLFLAG_RD, &sc->link_width, 0, "tx_boundary"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_boundary", CTLFLAG_RD, &sc->tx_boundary, 0, "tx_boundary"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "write_combine", CTLFLAG_RD, &sc->wc, 0, "write combining PIO?"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "read_dma_MBs", CTLFLAG_RD, &sc->read_dma, 0, "DMA Read speed in MB/s"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "write_dma_MBs", CTLFLAG_RD, &sc->write_dma, 0, "DMA Write speed in MB/s"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "read_write_dma_MBs", CTLFLAG_RD, &sc->read_write_dma, 0, "DMA concurrent Read/Write speed in MB/s"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "watchdog_resets", CTLFLAG_RD, &sc->watchdog_resets, 0, "Number of times NIC was reset"); /* performance related tunables */ - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_delay", CTLTYPE_INT|CTLFLAG_RW, sc, - 0, mxge_change_intr_coal, + 0, mxge_change_intr_coal, "I", "interrupt coalescing delay in usecs"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "throttle", CTLTYPE_INT|CTLFLAG_RW, sc, - 0, mxge_change_throttle, + 0, mxge_change_throttle, "I", "transmit throttling"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "flow_control_enabled", CTLTYPE_INT|CTLFLAG_RW, sc, 0, mxge_change_flow_control, "I", "interrupt coalescing delay in usecs"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "deassert_wait", CTLFLAG_RW, &mxge_deassert_wait, 0, "Wait for IRQ line to go low in ihandler"); - /* stats block from firmware is in network byte order. + /* stats block from firmware is in network byte order. Need to swap it */ - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "link_up", CTLTYPE_INT|CTLFLAG_RD, &fw->link_up, 0, mxge_handle_be32, "I", "link up"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rdma_tags_available", CTLTYPE_INT|CTLFLAG_RD, &fw->rdma_tags_available, 0, mxge_handle_be32, "I", "rdma_tags_available"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dropped_bad_crc32", - CTLTYPE_INT|CTLFLAG_RD, + CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_bad_crc32, 0, mxge_handle_be32, "I", "dropped_bad_crc32"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dropped_bad_phy", - CTLTYPE_INT|CTLFLAG_RD, + CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_bad_phy, 0, mxge_handle_be32, "I", "dropped_bad_phy"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dropped_link_error_or_filtered", - CTLTYPE_INT|CTLFLAG_RD, + CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_link_error_or_filtered, 0, mxge_handle_be32, "I", "dropped_link_error_or_filtered"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dropped_link_overflow", CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_link_overflow, 0, mxge_handle_be32, "I", "dropped_link_overflow"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dropped_multicast_filtered", - CTLTYPE_INT|CTLFLAG_RD, + CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_multicast_filtered, 0, mxge_handle_be32, "I", "dropped_multicast_filtered"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dropped_no_big_buffer", CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_no_big_buffer, 0, mxge_handle_be32, "I", "dropped_no_big_buffer"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dropped_no_small_buffer", - CTLTYPE_INT|CTLFLAG_RD, + CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_no_small_buffer, 0, mxge_handle_be32, "I", "dropped_no_small_buffer"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dropped_overrun", CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_overrun, 0, mxge_handle_be32, "I", "dropped_overrun"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dropped_pause", - CTLTYPE_INT|CTLFLAG_RD, + CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_pause, 0, mxge_handle_be32, "I", "dropped_pause"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dropped_runt", CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_runt, 0, mxge_handle_be32, "I", "dropped_runt"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dropped_unicast_filtered", CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_unicast_filtered, 0, mxge_handle_be32, "I", "dropped_unicast_filtered"); /* verbose printing? */ - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "verbose", CTLFLAG_RW, &mxge_verbose, 0, "verbose printing"); /* add counters exported for debugging from all slices */ sysctl_ctx_init(&sc->slice_sysctl_ctx); - sc->slice_sysctl_tree = + sc->slice_sysctl_tree = SYSCTL_ADD_NODE(&sc->slice_sysctl_ctx, children, OID_AUTO, "slice", CTLFLAG_RD, 0, ""); @@ -1625,15 +1625,15 @@ mxge_add_sysctls(mxge_softc_t *sc) ctx = &ss->sysctl_ctx; children = SYSCTL_CHILDREN(sc->slice_sysctl_tree); sprintf(slice_num, "%d", slice); - ss->sysctl_tree = + ss->sysctl_tree = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, slice_num, CTLFLAG_RD, 0, ""); children = SYSCTL_CHILDREN(ss->sysctl_tree); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_small_cnt", CTLFLAG_RD, &ss->rx_small.cnt, 0, "rx_small_cnt"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_big_cnt", CTLFLAG_RD, &ss->rx_big.cnt, 0, "rx_small_cnt"); @@ -1655,118 +1655,118 @@ mxge_add_sysctls(mxge_softc_t *sc) if (slice > 0) continue; #endif - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_req", CTLFLAG_RD, &ss->tx.req, 0, "tx_req"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_done", CTLFLAG_RD, &ss->tx.done, 0, "tx_done"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_pkt_done", CTLFLAG_RD, &ss->tx.pkt_done, 0, "tx_done"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_stall", CTLFLAG_RD, &ss->tx.stall, 0, "tx_stall"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_wake", CTLFLAG_RD, &ss->tx.wake, 0, "tx_wake"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_defrag", CTLFLAG_RD, &ss->tx.defrag, 0, "tx_defrag"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_queue_active", CTLFLAG_RD, &ss->tx.queue_active, 0, "tx_queue_active"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_activate", CTLFLAG_RD, &ss->tx.activate, 0, "tx_activate"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_deactivate", CTLFLAG_RD, &ss->tx.deactivate, 0, "tx_deactivate"); } } -/* copy an array of mcp_kreq_ether_send_t's to the mcp. Copy +/* copy an array of mcp_kreq_ether_send_t's to the mcp. Copy backwards one at a time and handle ring wraps */ -static inline void -mxge_submit_req_backwards(mxge_tx_ring_t *tx, +static inline void +mxge_submit_req_backwards(mxge_tx_ring_t *tx, mcp_kreq_ether_send_t *src, int cnt) { - int idx, starting_slot; - starting_slot = tx->req; - while (cnt > 1) { - cnt--; - idx = (starting_slot + cnt) & tx->mask; - mxge_pio_copy(&tx->lanai[idx], + int idx, starting_slot; + starting_slot = tx->req; + while (cnt > 1) { + cnt--; + idx = (starting_slot + cnt) & tx->mask; + mxge_pio_copy(&tx->lanai[idx], &src[cnt], sizeof(*src)); - wmb(); - } + wmb(); + } } /* * copy an array of mcp_kreq_ether_send_t's to the mcp. Copy * at most 32 bytes at a time, so as to avoid involving the software * pio handler in the nic. We re-write the first segment's flags - * to mark them valid only after writing the entire chain + * to mark them valid only after writing the entire chain */ -static inline void -mxge_submit_req(mxge_tx_ring_t *tx, mcp_kreq_ether_send_t *src, - int cnt) +static inline void +mxge_submit_req(mxge_tx_ring_t *tx, mcp_kreq_ether_send_t *src, + int cnt) { - int idx, i; - uint32_t *src_ints; + int idx, i; + uint32_t *src_ints; volatile uint32_t *dst_ints; - mcp_kreq_ether_send_t *srcp; + mcp_kreq_ether_send_t *srcp; volatile mcp_kreq_ether_send_t *dstp, *dst; uint8_t last_flags; - - idx = tx->req & tx->mask; + + idx = tx->req & tx->mask; last_flags = src->flags; src->flags = 0; - wmb(); - dst = dstp = &tx->lanai[idx]; - srcp = src; - - if ((idx + cnt) < tx->mask) { - for (i = 0; i < (cnt - 1); i += 2) { - mxge_pio_copy(dstp, srcp, 2 * sizeof(*src)); - wmb(); /* force write every 32 bytes */ - srcp += 2; - dstp += 2; - } - } else { - /* submit all but the first request, and ensure - that it is submitted below */ - mxge_submit_req_backwards(tx, src, cnt); - i = 0; - } - if (i < cnt) { - /* submit the first request */ - mxge_pio_copy(dstp, srcp, sizeof(*src)); - wmb(); /* barrier before setting valid flag */ - } - - /* re-write the last 32-bits with the valid flags */ - src->flags = last_flags; - src_ints = (uint32_t *)src; - src_ints+=3; - dst_ints = (volatile uint32_t *)dst; - dst_ints+=3; - *dst_ints = *src_ints; - tx->req += cnt; - wmb(); + wmb(); + dst = dstp = &tx->lanai[idx]; + srcp = src; + + if ((idx + cnt) < tx->mask) { + for (i = 0; i < (cnt - 1); i += 2) { + mxge_pio_copy(dstp, srcp, 2 * sizeof(*src)); + wmb(); /* force write every 32 bytes */ + srcp += 2; + dstp += 2; + } + } else { + /* submit all but the first request, and ensure + that it is submitted below */ + mxge_submit_req_backwards(tx, src, cnt); + i = 0; + } + if (i < cnt) { + /* submit the first request */ + mxge_pio_copy(dstp, srcp, sizeof(*src)); + wmb(); /* barrier before setting valid flag */ + } + + /* re-write the last 32-bits with the valid flags */ + src->flags = last_flags; + src_ints = (uint32_t *)src; + src_ints+=3; + dst_ints = (volatile uint32_t *)dst; + dst_ints+=3; + *dst_ints = *src_ints; + tx->req += cnt; + wmb(); } static int @@ -1969,7 +1969,7 @@ mxge_encap_tso(struct mxge_slice_state * seglen = -cum_len; small = (mss <= MXGEFW_SEND_SMALL_SIZE); flags_next = MXGEFW_FLAGS_TSO_PLD | - MXGEFW_FLAGS_FIRST | + MXGEFW_FLAGS_FIRST | (small * MXGEFW_FLAGS_SMALL); } @@ -2038,7 +2038,7 @@ drop: #endif /* IFCAP_TSO4 */ #ifdef MXGE_NEW_VLAN_API -/* +/* * We reproduce the software vlan tag insertion from * net/if_vlan.c:vlan_start() here so that we can advertise "hardware" * vlan tag insertion. We need to advertise this in order to have the @@ -2083,7 +2083,7 @@ mxge_encap(struct mxge_slice_state *ss, mxge_tx_ring_t *tx; int cnt, cum_len, err, i, idx, odd_flag; uint16_t pseudo_hdr_offset; - uint8_t flags, cksum_offset; + uint8_t flags, cksum_offset; sc = ss->sc; @@ -2106,7 +2106,7 @@ mxge_encap(struct mxge_slice_state *ss, /* (try to) map the frame for DMA */ idx = tx->req & tx->mask; err = bus_dmamap_load_mbuf_sg(tx->dmat, tx->info[idx].map, - m, tx->seg_list, &cnt, + m, tx->seg_list, &cnt, BUS_DMA_NOWAIT); if (__predict_false(err == EFBIG)) { /* Too many segments in the chain. Try @@ -2117,9 +2117,9 @@ mxge_encap(struct mxge_slice_state *ss, } ss->tx.defrag++; m = m_tmp; - err = bus_dmamap_load_mbuf_sg(tx->dmat, + err = bus_dmamap_load_mbuf_sg(tx->dmat, tx->info[idx].map, - m, tx->seg_list, &cnt, + m, tx->seg_list, &cnt, BUS_DMA_NOWAIT); } if (__predict_false(err != 0)) { @@ -2166,9 +2166,9 @@ mxge_encap(struct mxge_slice_state *ss, seg = tx->seg_list; req->flags = MXGEFW_FLAGS_FIRST; for (i = 0; i < cnt; i++) { - req->addr_low = + req->addr_low = htobe32(MXGE_LOWPART_TO_U32(seg->ds_addr)); - req->addr_high = + req->addr_high = htobe32(MXGE_HIGHPART_TO_U32(seg->ds_addr)); req->length = htobe16(seg->ds_len); req->cksum_offset = cksum_offset; @@ -2189,9 +2189,9 @@ mxge_encap(struct mxge_slice_state *ss, /* pad runts to 60 bytes */ if (cum_len < 60) { req++; - req->addr_low = + req->addr_low = htobe32(MXGE_LOWPART_TO_U32(sc->zeropad_dma.bus_addr)); - req->addr_high = + req->addr_high = htobe32(MXGE_HIGHPART_TO_U32(sc->zeropad_dma.bus_addr)); req->length = htobe16(60 - cum_len); req->cksum_offset = 0; @@ -2427,16 +2427,16 @@ mxge_get_buf_small(struct mxge_slice_sta goto done; } m->m_len = MHLEN; - err = bus_dmamap_load_mbuf_sg(rx->dmat, map, m, + err = bus_dmamap_load_mbuf_sg(rx->dmat, map, m, &seg, &cnt, BUS_DMA_NOWAIT); if (err != 0) { m_free(m); goto done; } rx->info[idx].m = m; - rx->shadow[idx].addr_low = + rx->shadow[idx].addr_low = htobe32(MXGE_LOWPART_TO_U32(seg.ds_addr)); - rx->shadow[idx].addr_high = + rx->shadow[idx].addr_high = htobe32(MXGE_HIGHPART_TO_U32(seg.ds_addr)); done: @@ -2460,23 +2460,23 @@ mxge_get_buf_big(struct mxge_slice_state goto done; } m->m_len = rx->mlen; - err = bus_dmamap_load_mbuf_sg(rx->dmat, map, m, + err = bus_dmamap_load_mbuf_sg(rx->dmat, map, m, seg, &cnt, BUS_DMA_NOWAIT); if (err != 0) { m_free(m); goto done; } rx->info[idx].m = m; - rx->shadow[idx].addr_low = + rx->shadow[idx].addr_low = htobe32(MXGE_LOWPART_TO_U32(seg->ds_addr)); - rx->shadow[idx].addr_high = + rx->shadow[idx].addr_high = htobe32(MXGE_HIGHPART_TO_U32(seg->ds_addr)); #if MXGE_VIRT_JUMBOS for (i = 1; i < cnt; i++) { - rx->shadow[idx + i].addr_low = + rx->shadow[idx + i].addr_low = htobe32(MXGE_LOWPART_TO_U32(seg[i].ds_addr)); - rx->shadow[idx + i].addr_high = + rx->shadow[idx + i].addr_high = htobe32(MXGE_HIGHPART_TO_U32(seg[i].ds_addr)); } #endif @@ -2548,7 +2548,7 @@ mxge_rx_csum6(void *p, struct mbuf *m, u return (c); } #endif /* INET6 */ -/* +/* * Myri10GE hardware checksums are not valid if the sender * padded the frame with non-zero padding. This is because * the firmware just does a simple 16-bit 1s complement @@ -2616,14 +2616,14 @@ mxge_vlan_tag_remove(struct mbuf *m, uin */ /* put checksum into host byte order */ - *csum = ntohs(*csum); + *csum = ntohs(*csum); partial = ntohl(*(uint32_t *)(mtod(m, char *) + ETHER_HDR_LEN)); (*csum) += ~partial; (*csum) += ((*csum) < ~partial); (*csum) = ((*csum) >> 16) + ((*csum) & 0xFFFF); (*csum) = ((*csum) >> 16) + ((*csum) & 0xFFFF); - /* restore checksum to network byte order; + /* restore checksum to network byte order; later consumers expect this */ *csum = htons(*csum); @@ -2863,7 +2863,7 @@ mxge_tx_done(struct mxge_slice_state *ss } /* If we have space, clear IFF_OACTIVE to tell the stack that - its OK to send packets */ + its OK to send packets */ #ifdef IFNET_BUF_RING flags = &ss->if_drv_flags; #else @@ -2919,7 +2919,7 @@ mxge_media_set(mxge_softc_t *sc, int med { - ifmedia_add(&sc->media, IFM_ETHER | IFM_FDX | media_type, + ifmedia_add(&sc->media, IFM_ETHER | IFM_FDX | media_type, 0, NULL); ifmedia_set(&sc->media, IFM_ETHER | IFM_FDX | media_type); sc->current_media = media_type; @@ -2935,7 +2935,7 @@ mxge_media_init(mxge_softc_t *sc) ifmedia_removeall(&sc->media); mxge_media_set(sc, IFM_AUTO); - /* + /* * parse the product code to deterimine the interface type * (CX4, XFP, Quad Ribbon Fiber) by looking at the character * after the 3rd dash in the driver's cached copy of the @@ -2980,7 +2980,7 @@ mxge_media_init(mxge_softc_t *sc) * themselves only when their link is up, so this is initiated via a * link up interrupt. However, this can potentially take up to * several milliseconds, so it is run via the watchdog routine, rather - * than in the interrupt handler itself. + * than in the interrupt handler itself. */ static void mxge_media_probe(mxge_softc_t *sc) @@ -2997,7 +2997,7 @@ mxge_media_probe(mxge_softc_t *sc) if (sc->connector == MXGE_XFP) { /* -R is XFP */ mxge_media_types = mxge_xfp_media_types; - mxge_media_type_entries = + mxge_media_type_entries = sizeof (mxge_xfp_media_types) / sizeof (mxge_xfp_media_types[0]); byte = MXGE_XFP_COMPLIANCE_BYTE; @@ -3005,7 +3005,7 @@ mxge_media_probe(mxge_softc_t *sc) } else if (sc->connector == MXGE_SFP) { /* -S or -2S is SFP+ */ mxge_media_types = mxge_sfp_media_types; - mxge_media_type_entries = + mxge_media_type_entries = sizeof (mxge_sfp_media_types) / sizeof (mxge_sfp_media_types[0]); cage_type = "SFP+"; @@ -3151,7 +3151,7 @@ mxge_intr(void *arg) } if (sc->rdma_tags_available != be32toh(stats->rdma_tags_available)) { - sc->rdma_tags_available = + sc->rdma_tags_available = be32toh(stats->rdma_tags_available); device_printf(sc->dev, "RDMA timed out! %d tags " "left\n", sc->rdma_tags_available); @@ -3384,7 +3384,7 @@ mxge_alloc_slice_rings(struct mxge_slice return err; } for (i = 0; i <= ss->rx_small.mask; i++) { - err = bus_dmamap_create(ss->rx_small.dmat, 0, + err = bus_dmamap_create(ss->rx_small.dmat, 0, &ss->rx_small.info[i].map); if (err != 0) { device_printf(sc->dev, "Err %d rx_small dmamap\n", @@ -3392,7 +3392,7 @@ mxge_alloc_slice_rings(struct mxge_slice return err; } } - err = bus_dmamap_create(ss->rx_small.dmat, 0, + err = bus_dmamap_create(ss->rx_small.dmat, 0, &ss->rx_small.extra_map); if (err != 0) { device_printf(sc->dev, "Err %d extra rx_small dmamap\n", @@ -3401,7 +3401,7 @@ mxge_alloc_slice_rings(struct mxge_slice } for (i = 0; i <= ss->rx_big.mask; i++) { - err = bus_dmamap_create(ss->rx_big.dmat, 0, + err = bus_dmamap_create(ss->rx_big.dmat, 0, &ss->rx_big.info[i].map); if (err != 0) { device_printf(sc->dev, "Err %d rx_big dmamap\n", @@ -3409,7 +3409,7 @@ mxge_alloc_slice_rings(struct mxge_slice return err; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 05:59:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1CD5180; Thu, 25 Sep 2014 05:59:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBAAF66C; Thu, 25 Sep 2014 05:59:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8P5xDur054116; Thu, 25 Sep 2014 05:59:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8P5xDWW054115; Thu, 25 Sep 2014 05:59:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409250559.s8P5xDWW054115@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 25 Sep 2014 05:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r272092 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 05:59:13 -0000 Author: hselasky Date: Thu Sep 25 05:59:12 2014 New Revision: 272092 URL: http://svnweb.freebsd.org/changeset/base/272092 Log: MFC r271953: Some XHCI hardware requires dropping the endpoint context before adding it again. Modified: stable/9/sys/dev/usb/controller/xhci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Thu Sep 25 05:47:33 2014 (r272091) +++ stable/9/sys/dev/usb/controller/xhci.c Thu Sep 25 05:59:12 2014 (r272092) @@ -2217,7 +2217,14 @@ xhci_configure_mask(struct usb_device *u xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, mask); xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, 0); } else { - xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, 0); + /* + * Some hardware requires that we drop the endpoint + * context before adding it again: + */ + xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, + mask & XHCI_INCTX_NON_CTRL_MASK); + + /* Add new endpoint context */ xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, mask); /* find most significant set bit */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 06:00:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A77F2CD; Thu, 25 Sep 2014 06:00:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04651680; Thu, 25 Sep 2014 06:00:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8P60V7e055069; Thu, 25 Sep 2014 06:00:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8P60VLp055068; Thu, 25 Sep 2014 06:00:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409250600.s8P60VLp055068@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 25 Sep 2014 06:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r272093 - stable/8/sys/dev/usb/controller X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 06:00:32 -0000 Author: hselasky Date: Thu Sep 25 06:00:31 2014 New Revision: 272093 URL: http://svnweb.freebsd.org/changeset/base/272093 Log: MFC r271953: Some XHCI hardware requires dropping the endpoint context before adding it again. Modified: stable/8/sys/dev/usb/controller/xhci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci.c Thu Sep 25 05:59:12 2014 (r272092) +++ stable/8/sys/dev/usb/controller/xhci.c Thu Sep 25 06:00:31 2014 (r272093) @@ -2217,7 +2217,14 @@ xhci_configure_mask(struct usb_device *u xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, mask); xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, 0); } else { - xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, 0); + /* + * Some hardware requires that we drop the endpoint + * context before adding it again: + */ + xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, + mask & XHCI_INCTX_NON_CTRL_MASK); + + /* Add new endpoint context */ xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, mask); /* find most significant set bit */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 06:47:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ADEF0A7E; Thu, 25 Sep 2014 06:47:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 971F4AF2; Thu, 25 Sep 2014 06:47:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8P6lcKd077594; Thu, 25 Sep 2014 06:47:38 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8P6lcJJ077592; Thu, 25 Sep 2014 06:47:38 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409250647.s8P6lcJJ077592@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 25 Sep 2014 06:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272094 - head/sys/dev/lmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 06:47:38 -0000 Author: glebius Date: Thu Sep 25 06:47:38 2014 New Revision: 272094 URL: http://svnweb.freebsd.org/changeset/base/272094 Log: Run through unifdef(1) with slight hand-editing after. It is obvious, that the driver is not going to be ever improved in terms of hardware support, it is going to be only maintained as our kernel APIs change. Carrying all the compatibility with ancient versions of NetBSD, OpenBSD, Linux and BSDI, as well as obsoleted FreeBSD versions has no reason. Modified: head/sys/dev/lmc/if_lmc.c head/sys/dev/lmc/if_lmc.h Modified: head/sys/dev/lmc/if_lmc.c ============================================================================== --- head/sys/dev/lmc/if_lmc.c Thu Sep 25 06:00:31 2014 (r272093) +++ head/sys/dev/lmc/if_lmc.c Thu Sep 25 06:47:38 2014 (r272094) @@ -71,7 +71,6 @@ * * Send bug reports and improvements to . */ -#ifdef __FreeBSD__ # include /* OS version */ # define IFNET 1 # include "opt_inet.h" /* INET */ @@ -90,15 +89,9 @@ # define NETGRAPH 0 # endif # define P2P 0 /* not in FreeBSD */ -# if (__FreeBSD_version >= 500000) -# define NSPPP 1 /* No count devices in FreeBSD 5 */ -# include "opt_bpf.h" /* DEV_BPF */ -# define NBPFILTER DEV_BPF -# else /* FreeBSD-4 */ -# include "sppp.h" /* NSPPP */ -# include "bpf.h" /* NBPF */ -# define NBPFILTER NBPF -# endif +# define NSPPP 1 /* No count devices in FreeBSD 5 */ +# include "opt_bpf.h" /* DEV_BPF */ +# define NBPFILTER DEV_BPF # define GEN_HDLC 0 /* not in FreeBSD */ # # include @@ -121,16 +114,9 @@ # include # include # include -# if (__FreeBSD_version >= 700000) -# include -# endif -# if (__FreeBSD_version >= 500000) +# include # include # include -# else /* FreeBSD-4 */ -# include -# include -# endif # if NETGRAPH # include # include @@ -147,180 +133,10 @@ # endif /* and finally... */ # include -#endif /*__FreeBSD__*/ -#ifdef __NetBSD__ -# include /* OS version */ -# define IFNET 1 -# include "opt_inet.h" /* INET6, INET */ -# define NETGRAPH 0 /* not in NetBSD */ -# include "sppp.h" /* NSPPP */ -# define P2P 0 /* not in NetBSD */ -# include "opt_altq_enabled.h" /* ALTQ */ -# include "bpfilter.h" /* NBPFILTER */ -# define GEN_HDLC 0 /* not in NetBSD */ -# -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# if (__NetBSD_Version__ >= 106000000) -# include -# else -# include -# endif -# if (INET || INET6) -# include -# include -# endif -# if NSPPP -# if (__NetBSD_Version__ >= 106000000) -# include -# else -# include -# endif -# endif -# if NBPFILTER -# include -# endif -/* and finally... */ -# include "if_lmc.h" -#endif /*__NetBSD__*/ -#ifdef __OpenBSD__ -# include /* OS version */ -# define IFNET 1 -/* -DINET is passed on the compiler command line */ -/* -DINET6 is passed on the compiler command line */ -# define NETGRAPH 0 /* not in OpenBSD */ -# include "sppp.h" /* NSPPP */ -# define P2P 0 /* not in OpenBSD */ -/* -DALTQ is passed on the compiler command line */ -# include "bpfilter.h" /* NBPFILTER */ -# define GEN_HDLC 0 /* not in OpenBSD */ -# -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# if (OpenBSD >= 200206) -# include -# else -# include -# endif -# if (INET || INET6) -# include -# include -# endif -# if NSPPP -# include -# endif -# if NBPFILTER -# include -# endif -/* and finally... */ -# include "if_lmc.h" -#endif /*__OpenBSD__*/ -#ifdef __bsdi__ -# include /* OS version */ -# define IFNET 1 -/* -DINET is passed on the compiler command line */ -/* -DINET6 is passed on the compiler command line */ -# define NETGRAPH 0 /* not in BSD/OS */ -# define NSPPP 0 /* not in BSD/OS */ -/* -DPPP is passed on the compiler command line */ -/* -DCISCO_HDLC is passed on the compiler command line */ -/* -DFR is passed on the compiler command line */ -# if (PPP || CISCO_HDLC || FR) -# define P2P 1 -# else -# define P2P 0 -# endif -# define ALTQ 0 /* not in BSD/OS */ -# include "bpfilter.h" /* NBPFILTER */ -# define GEN_HDLC 0 /* not in BSD/OS */ -# -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# if (INET || INET6) -# include -# include -# endif -# if P2P -# include -# include -# endif -# if NBPFILTER -# include -# endif -/* and finally... */ -# include "if_lmc.h" -#endif /*__bsdi__*/ -#ifdef __linux__ -# include -# if (CONFIG_HDLC || CONFIG_HDLC_MODULE) -# define GEN_HDLC 1 -# else -# define GEN_HDLC 0 -# endif -# define IFNET 0 /* different in Linux */ -# define NETGRAPH 0 /* not in Linux */ -# define NSPPP 0 /* different in Linux */ -# define P2P 0 /* not in Linux */ -# define ALTQ 0 /* different in Linux */ -# define NBPFILTER 0 /* different in Linux */ -# -# include -# include -# include -# include -# if GEN_HDLC -# include -# endif -/* and finally... */ -# include "if_lmc.h" -#endif /* __linux__ */ /* The SROM is a generic 93C46 serial EEPROM (64 words by 16 bits). */ /* Data is set up before the RISING edge of CLK; CLK is parked low. */ @@ -2484,44 +2300,6 @@ struct card t1_card = /* RAWIP is raw IP packets (v4 or v6) in HDLC frames with NO HEADERS. */ /* No HDLC Address/Control fields! No line control protocol at all! */ -/* This code is BSD/ifnet-specific; Linux and Netgraph also do RAWIP. */ - -#if IFNET - -# if ((defined(__FreeBSD__) && (__FreeBSD_version < 500000)) ||\ - defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)) -static void -netisr_dispatch(int isr, struct mbuf *mbuf) - { - struct ifqueue *intrq = NULL; - int qfull = 0; - -#if INET - if (isr == NETISR_IP) intrq = &ipintrq; -#endif -#if INET6 - if (isr == NETISR_IPV6) intrq = &ip6intrq; -#endif - - if ((intrq != NULL) && ((qfull = IF_QFULL(intrq)) == 0)) - { - /* rxintr_cleanup() ENQUEUES in a hard interrupt. */ - /* networking code DEQUEUES in a soft interrupt. */ - /* Some BSD QUEUE routines are not interrupt-safe. */ - DISABLE_INTR; /* noop in FreeBSD */ - IF_ENQUEUE(intrq, mbuf); - ENABLE_INTR; - schednetisr(isr); /* schedule a soft interrupt */ - } - else - { - m_freem(mbuf); - if ((intrq != NULL) && (qfull != 0)) - IF_DROP(intrq); - } - } -# endif /* ((__FreeBSD__ && (__FreeBSD_version < 500000)) || */ - /* __NetBSD__ || __OpenBSD__ || __bsdi__) */ /* rxintr_cleanup calls this to give a newly arrived pkt to higher levels. */ static void @@ -2549,20 +2327,12 @@ lmc_raw_input(struct ifnet *ifp, struct } } -#endif /* IFNET */ - -/* There are TWO VERSIONS of interrupt/DMA code: Linux & BSD. - * Handling Linux and the BSDs with CPP directives would - * make the code unreadable, so there are two versions. - * Conceptually, the two versions do the same thing and - * core_interrupt() doesn't know they are different. - * +/* * We are "standing on the head of a pin" in these routines. * Tulip CSRs can be accessed, but nothing else is interrupt-safe! * Do NOT access: MII, GPIO, SROM, BIOSROM, XILINX, SYNTH, or DAC. */ -#if BSD /* BSD version of interrupt/DMA code */ /* Singly-linked tail-queues hold mbufs with active DMA. * For RX, single mbuf clusters; for TX, mbuf chains are queued. @@ -2593,7 +2363,6 @@ mbuf_dequeue(struct desc_ring *ring) return m; } -# ifdef __FreeBSD__ static void /* *** FreeBSD ONLY *** Callout from bus_dmamap_load() */ fbsd_dmamap_load(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { @@ -2602,7 +2371,6 @@ fbsd_dmamap_load(void *arg, bus_dma_segm ring->segs[0] = segs[0]; ring->segs[1] = segs[1]; } -# endif /* Initialize a DMA descriptor ring. */ static int /* BSD version */ @@ -2620,15 +2388,12 @@ create_ring(softc_t *sc, struct desc_rin return EINVAL; } -#ifdef __FreeBSD__ /* Create a DMA tag for descriptors and buffers. */ if ((error = bus_dma_tag_create(bus_get_dma_tag(sc->dev), 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, PAGE_SIZE, 2, PAGE_SIZE, BUS_DMA_ALLOCNOW, -# if (__FreeBSD_version >= 502000) NULL, NULL, -# endif &ring->tag))) { printf("%s: bus_dma_tag_create() failed: error %d\n", NAME_UNIT, error); @@ -2662,70 +2427,6 @@ create_ring(softc_t *sc, struct desc_rin return error; } -#elif (defined(__NetBSD__) || defined(__OpenBSD__)) - - /* Use the DMA tag passed to attach() for descriptors and buffers. */ - ring->tag = sc->pa_dmat; - - /* Allocate wired physical memory for DMA descriptor array. */ - if ((error = bus_dmamem_alloc(ring->tag, size_descs, PAGE_SIZE, 0, - ring->segs, 1, &ring->nsegs, BUS_DMA_NOWAIT))) - { - printf("%s: bus_dmamem_alloc() failed; error %d\n", NAME_UNIT, error); - return error; - } - - /* Map physical address to kernel virtual address. */ - if ((error = bus_dmamem_map(ring->tag, ring->segs, ring->nsegs, - size_descs, (caddr_t *)&ring->first, BUS_DMA_NOWAIT | BUS_DMA_COHERENT))) - { - printf("%s: bus_dmamem_map() failed; error %d\n", NAME_UNIT, error); - return error; - } - descs = ring->first; /* suppress compiler warning about aliasing */ - memset(descs, 0, size_descs); - - /* Allocate dmamap for PCI access to DMA descriptor array. */ - if ((error = bus_dmamap_create(ring->tag, size_descs, 1, - size_descs, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, &ring->map))) - { - printf("%s: bus_dmamap_create() failed; error %d\n", NAME_UNIT, error); - return error; - } - - /* Map kernel virtual address to PCI address for DMA descriptor array. */ - if ((error = bus_dmamap_load(ring->tag, ring->map, descs, size_descs, - 0, BUS_DMA_NOWAIT))) - { - printf("%s: bus_dmamap_load() failed; error %d\n", NAME_UNIT, error); - return error; - } - ring->dma_addr = ring->map->dm_segs[0].ds_addr; - - /* Allocate dmamaps for each DMA descriptor. */ - for (i=0; itag, MAX_DESC_LEN, 2, - MAX_CHUNK_LEN, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, &descs[i].map))) - { - printf("%s: bus_dmamap_create() failed; error %d\n", NAME_UNIT, error); - return error; - } - -#elif defined(__bsdi__) - - /* Allocate wired physical memory for DMA descriptor array. */ - if ((ring->first = malloc(size_descs, M_DEVBUF, M_NOWAIT)) == NULL) - { - printf("%s: malloc() failed for DMA descriptor array\n", NAME_UNIT); - return ENOMEM; - } - descs = ring->first; - memset(descs, 0, size_descs); - - /* Map kernel virtual address to PCI address for DMA descriptor array. */ - ring->dma_addr = vtophys(descs); /* Relax! BSD/OS only. */ - -#endif ring->read = descs; ring->write = descs; @@ -2765,7 +2466,6 @@ destroy_ring(softc_t *sc, struct desc_ri if (ring->read++ == ring->last) ring->read = ring->first; } -#ifdef __FreeBSD__ /* Free the dmamaps of all DMA descriptors. */ for (desc=ring->first; desc!=ring->last+1; desc++) @@ -2782,33 +2482,6 @@ destroy_ring(softc_t *sc, struct desc_ri if (ring->tag != NULL) bus_dma_tag_destroy(ring->tag); -#elif (defined(__NetBSD__) || defined(__OpenBSD__)) - - /* Free the dmamaps of all DMA descriptors. */ - for (desc=ring->first; desc!=ring->last+1; desc++) - if (desc->map != NULL) - bus_dmamap_destroy(ring->tag, desc->map); - - /* Unmap PCI address for DMA descriptor array. */ - if (ring->dma_addr != 0) - bus_dmamap_unload(ring->tag, ring->map); - /* Free dmamap for DMA descriptor array. */ - if (ring->map != NULL) - bus_dmamap_destroy(ring->tag, ring->map); - /* Unmap kernel address for DMA descriptor array. */ - if (ring->first != NULL) - bus_dmamem_unmap(ring->tag, (caddr_t)ring->first, ring->size_descs); - /* Free kernel memory for DMA descriptor array. */ - if (ring->segs[0].ds_addr != 0) - bus_dmamem_free(ring->tag, ring->segs, ring->nsegs); - -#elif defined(__bsdi__) - - /* Free kernel memory for DMA descriptor array. */ - if (ring->first != NULL) - free(ring->first, M_DEVBUF); - -#endif } /* Clean up after a packet has been received. */ @@ -2821,7 +2494,7 @@ rxintr_cleanup(softc_t *sc) struct mbuf *new_mbuf; int pkt_len, desc_len; -#if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) +#if defined(DEVICE_POLLING) /* Input packet flow control (livelock prevention): */ /* Give pkts to higher levels only if quota is > 0. */ if (sc->quota <= 0) return 0; @@ -2890,11 +2563,7 @@ rxintr_cleanup(softc_t *sc) { first_mbuf = new_mbuf; first_mbuf->m_pkthdr.len = pkt_len; /* total pkt length */ -#if IFNET first_mbuf->m_pkthdr.rcvif = sc->ifp; /* how it got here */ -#else - first_mbuf->m_pkthdr.rcvif = NULL; -#endif } else /* 2) link mbufs. */ { @@ -2933,11 +2602,9 @@ rxintr_cleanup(softc_t *sc) /* Include CRC and one flag byte in input byte count. */ sc->status.cntrs.ibytes += first_mbuf->m_pkthdr.len + sc->config.crc_len +1; sc->status.cntrs.ipackets++; -#if IFNET sc->ifp->if_ipackets++; LMC_BPF_MTAP(first_mbuf); -#endif -#if (defined(__FreeBSD__) && defined(DEVICE_POLLING)) +#if defined(DEVICE_POLLING) sc->quota--; #endif @@ -2945,12 +2612,8 @@ rxintr_cleanup(softc_t *sc) #if NETGRAPH if (sc->ng_hook != NULL) /* is hook connected? */ { -# if (__FreeBSD_version >= 500000) int error; /* ignore error */ NG_SEND_DATA_ONLY(error, sc->ng_hook, first_mbuf); -# else /* FreeBSD-4 */ - ng_queue_data(sc->ng_hook, first_mbuf, NULL); -# endif return 1; /* did something */ } #endif /* NETGRAPH */ @@ -3053,13 +2716,7 @@ rxintr_setup(softc_t *sc) DMA_SYNC(desc->map, desc_len, BUS_DMASYNC_PREREAD); /* Set up the DMA descriptor. */ -#ifdef __FreeBSD__ desc->address1 = ring->segs[0].ds_addr; -#elif (defined(__NetBSD__) || defined(__OpenBSD__)) - desc->address1 = desc->map->dm_segs[0].ds_addr; -#elif defined(__bsdi__) - desc->address1 = vtophys(m->m_data); /* Relax! BSD/OS only. */ -#endif desc->length1 = desc_len>>1; desc->address2 = desc->address1 + desc->length1; desc->length2 = desc_len>>1; @@ -3108,10 +2765,8 @@ txintr_cleanup(softc_t *sc) /* Include CRC and one flag byte in output byte count. */ sc->status.cntrs.obytes += m->m_pkthdr.len + sc->config.crc_len +1; sc->status.cntrs.opackets++; -#if IFNET sc->ifp->if_opackets++; LMC_BPF_MTAP(m); -#endif /* The only bad TX status is fifo underrun. */ if ((desc->status & TLP_DSTS_TX_UNDERRUN) != 0) sc->status.cntrs.fifo_under++; @@ -3181,15 +2836,9 @@ txintr_setup_mbuf(softc_t *sc, struct mb /* Prevent wild fetches if mapping fails (nsegs==0). */ desc->length1 = desc->length2 = 0; desc->address1 = desc->address2 = 0; -#if (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) { -# ifdef __FreeBSD__ bus_dma_segment_t *segs = ring->segs; int nsegs = ring->nsegs; -# elif (defined(__NetBSD__) || defined(__OpenBSD__)) - bus_dma_segment_t *segs = desc->map->dm_segs; - int nsegs = desc->map->dm_nsegs; -# endif if (nsegs >= 1) { desc->address1 = segs[0].ds_addr; @@ -3201,10 +2850,6 @@ txintr_setup_mbuf(softc_t *sc, struct mb desc->length2 = segs[1].ds_len; } } -#elif defined(__bsdi__) - desc->address1 = vtophys(data); /* Relax! BSD/OS only. */ - desc->length1 = desc_len; -#endif data += desc_len; length -= desc_len; @@ -3296,737 +2941,201 @@ txintr_setup(softc_t *sc) return 1; /* did something */ } -#endif /* BSD */ - -#ifdef __linux__ -/* NOTE: this is the LINUX version of the interrupt/DMA code, */ - -/* Singly-linked tail-queues hold sk_buffs with active DMA. - * skbuffs are linked through their sk_buff.next field. - * Callers must hold sc->bottom_lock; not otherwise locked. - */ - -/* Put an skbuff on the tail of the descriptor ring queue. */ -static void /* Linux version */ -skbuff_enqueue(struct desc_ring *ring, struct sk_buff *skb) - { - skb->next = NULL; - if (ring->tail == NULL) - ring->head = skb; - else - ring->tail->next = skb; - ring->tail = skb; - } - -/* Get an skbuff from the head of the descriptor ring queue. */ -static struct sk_buff* /* Linux version */ -skbuff_dequeue(struct desc_ring *ring) - { - struct sk_buff *skb = ring->head; - if (skb != NULL) - if ((ring->head = skb->next) == NULL) - ring->tail = NULL; - return skb; - } - -/* Initialize a DMA descriptor ring. */ -static int /* Linux version */ -create_ring(softc_t *sc, struct desc_ring *ring, int num_descs) - { - struct dma_desc *descs; - int size_descs = sizeof(struct dma_desc)*num_descs; - - /* Allocate and map memory for DMA descriptor array. */ - if ((descs = pci_alloc_consistent(sc->pci_dev, size_descs, - &ring->dma_addr)) == NULL) - { - printk("%s: pci_alloc_consistent() failed\n", NAME_UNIT); - return ENOMEM; - } - memset(descs, 0, size_descs); - - ring->read = descs; - ring->write = descs; - ring->first = descs; - ring->last = descs + num_descs -1; - ring->last->control = TLP_DCTL_END_RING; - ring->num_descs = num_descs; - ring->size_descs = size_descs; - ring->head = NULL; - ring->tail = NULL; - return 0; - } -/* Destroy a DMA descriptor ring */ -static void /* Linux version */ -destroy_ring(softc_t *sc, struct desc_ring *ring) +static void +check_intr_status(softc_t *sc) { - struct sk_buff *skb; + u_int32_t status, cfcs, op_mode; + u_int32_t missed, overruns; - /* Free queued skbuffs. */ - while ((skb = skbuff_dequeue(ring)) != NULL) - dev_kfree_skb(skb); + /* Check for four unusual events: + * 1) fatal PCI bus errors - some are recoverable + * 2) transmitter FIFO underruns - increase fifo threshold + * 3) receiver FIFO overruns - clear potential hangup + * 4) no receive descs or bufs - count missed packets + */ - /* TX may have one pkt that is not on any queue. */ - if (sc->tx_skb != NULL) + /* 1) A fatal bus error causes a Tulip to stop initiating bus cycles. */ + /* Module unload/load or boot are the only fixes for Parity Errors. */ + /* Master and Target Aborts can be cleared and life may continue. */ + status = READ_CSR(TLP_STATUS); + if ((status & TLP_STAT_FATAL_ERROR) != 0) { - dev_kfree_skb(sc->tx_skb); - sc->tx_skb = NULL; + u_int32_t fatal = (status & TLP_STAT_FATAL_BITS)>>TLP_STAT_FATAL_SHIFT; + printf("%s: FATAL PCI BUS ERROR: %s%s%s%s\n", NAME_UNIT, + (fatal == 0) ? "PARITY ERROR" : "", + (fatal == 1) ? "MASTER ABORT" : "", + (fatal == 2) ? "TARGET ABORT" : "", + (fatal >= 3) ? "RESERVED (?)" : ""); + cfcs = READ_PCI_CFG(sc, TLP_CFCS); /* try to clear it */ + cfcs &= ~(TLP_CFCS_MSTR_ABORT | TLP_CFCS_TARG_ABORT); + WRITE_PCI_CFG(sc, TLP_CFCS, cfcs); } - if (ring->first != NULL) + /* 2) If the transmitter fifo underruns, increase the transmit fifo */ + /* threshold: the number of bytes required to be in the fifo */ + /* before starting the transmitter (cost: increased tx delay). */ + /* The TX_FSM must be stopped to change this parameter. */ + if ((status & TLP_STAT_TX_UNDERRUN) != 0) { - /* Unmap active DMA descriptors. */ - while (ring->read != ring->write) + op_mode = READ_CSR(TLP_OP_MODE); + /* enable store-and-forward mode if tx_threshold tops out? */ + if ((op_mode & TLP_OP_TX_THRESH) < TLP_OP_TX_THRESH) { - pci_unmap_single(sc->pci_dev, ring->read->address1, - ring->read->length1 + ring->read->length2, PCI_DMA_BIDIRECTIONAL); - if (ring->read++ == ring->last) ring->read = ring->first; + op_mode += 0x4000; /* increment TX_THRESH field; can't overflow */ + WRITE_CSR(TLP_OP_MODE, op_mode & ~TLP_OP_TX_RUN); + /* Wait for the TX FSM to stop; it might be processing a pkt. */ + while (READ_CSR(TLP_STATUS) & TLP_STAT_TX_FSM); /* XXX HANG */ + WRITE_CSR(TLP_OP_MODE, op_mode); /* restart tx */ + if (DRIVER_DEBUG) + printf("%s: tx underrun; tx fifo threshold now %d bytes\n", + NAME_UNIT, 128<<((op_mode>>TLP_OP_TR_SHIFT)&3)); } - - /* Unmap and free memory for DMA descriptor array. */ - pci_free_consistent(sc->pci_dev, ring->size_descs, ring->first, - ring->dma_addr); } - } - -static int /* Linux version */ -rxintr_cleanup(softc_t *sc) - { - struct desc_ring *ring = &sc->rxring; - struct dma_desc *first_desc, *last_desc; - struct sk_buff *first_skb=NULL, *last_skb=NULL; - struct sk_buff *new_skb; - int pkt_len, desc_len; - /* Input packet flow control (livelock prevention): */ - /* Give pkts to higher levels only if quota is > 0. */ - if (sc->quota <= 0) return 0; - - /* This looks complicated, but remember: packets up to 4032 */ - /* bytes long fit in one skbuff and use one DMA descriptor. */ - - first_desc = last_desc = ring->read; - - /* ASSERTION: If there is a descriptor in the ring and the hardware has */ - /* finished with it, then that descriptor will have RX_FIRST_DESC set. */ - if ((ring->read != ring->write) && /* descriptor ring not empty */ - ((ring->read->status & TLP_DSTS_OWNER) == 0) && /* hardware done */ - ((ring->read->status & TLP_DSTS_RX_FIRST_DESC) == 0)) /* should be set */ - panic("%s: rxintr_cleanup: rx-first-descriptor not set.\n", NAME_UNIT); - - /* First decide if a complete packet has arrived. */ - /* Run down DMA descriptors looking for one marked "last". */ - /* Bail out if an active descriptor is encountered. */ - /* Accumulate most significant bits of packet length. */ - pkt_len = 0; - for (;;) - { - if (last_desc == ring->write) return 0; /* no more descs */ - if (last_desc->status & TLP_DSTS_OWNER) return 0; /* still active */ - if (last_desc->status & TLP_DSTS_RX_LAST_DESC) break; /* end of packet */ - pkt_len += last_desc->length1 + last_desc->length2; /* entire desc filled */ - if (last_desc++->control & TLP_DCTL_END_RING) last_desc = ring->first; /* ring wrap */ - } - - /* A complete packet has arrived; how long is it? */ - /* H/w ref man shows RX pkt length as a 14-bit field. */ - /* An experiment found that only the 12 LSBs work. */ - if (((last_desc->status>>16)&0xFFF) == 0) pkt_len += 4096; /* carry-bit */ - pkt_len = (pkt_len & 0xF000) + ((last_desc->status>>16) & 0x0FFF); - /* Subtract the CRC length unless doing so would underflow. */ - if (pkt_len >= sc->config.crc_len) pkt_len -= sc->config.crc_len; - - /* Run down DMA descriptors again doing the following: - * 1) put pkt info in hdr of first skbuff. - * 2) put additional skbuffs on frag_list. - * 3) set skbuff lengths. - */ - first_desc = ring->read; - do + /* 3) Errata memo from Digital Equipment Corp warns that 21140A */ + /* receivers through rev 2.2 can hang if the fifo overruns. */ + /* Recommended fix: stop and start the RX FSM after an overrun. */ + missed = READ_CSR(TLP_MISSED); + if ((overruns = ((missed & TLP_MISS_OVERRUN)>>TLP_OVERRUN_SHIFT)) != 0) { - /* Read a DMA descriptor from the ring. */ - last_desc = ring->read; - /* Advance the ring read pointer. */ - if (ring->read++ == ring->last) ring->read = ring->first; - - /* Dequeue the corresponding skbuff. */ - new_skb = skbuff_dequeue(ring); - if (new_skb == NULL) - panic("%s: rxintr_cleanup: expected an skbuff\n", NAME_UNIT); - - desc_len = last_desc->length1 + last_desc->length2; - /* Unmap kernel virtual addresss to PCI address. */ - pci_unmap_single(sc->pci_dev, last_desc->address1, - desc_len, PCI_DMA_FROMDEVICE); - - /* Set skbuff length. */ - skb_put(new_skb, (pkt_len >= desc_len) ? desc_len : pkt_len); - pkt_len -= new_skb->len; - - /* 1) Put pkt info in hdr of first skbuff. */ - if (last_desc == first_desc) + if (DRIVER_DEBUG) + printf("%s: rx overrun cntr=%d\n", NAME_UNIT, overruns); + sc->status.cntrs.overruns += overruns; + if ((READ_PCI_CFG(sc, TLP_CFRV) & 0xFF) <= 0x22) { - first_skb = new_skb; - if (sc->config.line_pkg == PKG_RAWIP) - { - if (first_skb->data[0]>>4 == 4) - first_skb->protocol = htons(ETH_P_IP); - else if (first_skb->data[0]>>4 == 6) - first_skb->protocol = htons(ETH_P_IPV6); - } - else -#if GEN_HDLC - first_skb->protocol = hdlc_type_trans(first_skb, sc->net_dev); -#else - first_skb->protocol = htons(ETH_P_HDLC); -#endif - first_skb->mac.raw = first_skb->data; - first_skb->dev = sc->net_dev; - do_gettimeofday(&first_skb->stamp); - sc->net_dev->last_rx = jiffies; - } - else /* 2) link skbuffs. */ - { - /* Put this skbuff on the frag_list of the first skbuff. */ - new_skb->next = NULL; - if (skb_shinfo(first_skb)->frag_list == NULL) - skb_shinfo(first_skb)->frag_list = new_skb; - else - last_skb->next = new_skb; - /* 3) set skbuff lengths. */ - first_skb->len += new_skb->len; - first_skb->data_len += new_skb->len; + op_mode = READ_CSR(TLP_OP_MODE); + WRITE_CSR(TLP_OP_MODE, op_mode & ~TLP_OP_RX_RUN); + /* Wait for the RX FSM to stop; it might be processing a pkt. */ + while (READ_CSR(TLP_STATUS) & TLP_STAT_RX_FSM); /* XXX HANG */ + WRITE_CSR(TLP_OP_MODE, op_mode); /* restart rx */ } - last_skb = new_skb; - } while ((last_desc->status & TLP_DSTS_RX_LAST_DESC) == 0); - - /* Decide whether to accept or to discard this packet. */ - /* RxHDLC sets MIIERR for bad CRC, abort and partial byte at pkt end. */ - if (((last_desc->status & TLP_DSTS_RX_BAD) == 0) && - (sc->status.oper_status == STATUS_UP) && - (first_skb->len > 0)) - { - /* Optimization: copy a small pkt into a small skbuff. */ - if (first_skb->len <= COPY_BREAK) - if ((new_skb = skb_copy(first_skb, GFP_ATOMIC)) != NULL) - { - dev_kfree_skb_any(first_skb); - first_skb = new_skb; - } - - /* Include CRC and one flag byte in input byte count. */ - sc->status.cntrs.ibytes += first_skb->len + sc->config.crc_len +1; - sc->status.cntrs.ipackets++; - - /* Give this good packet to the network stacks. */ - netif_receive_skb(first_skb); /* NAPI */ - sc->quota--; - } - else if (sc->status.oper_status != STATUS_UP) - { - /* If the link is down, this packet is probably noise. */ - sc->status.cntrs.idiscards++; - dev_kfree_skb_any(first_skb); - if (DRIVER_DEBUG) - printk("%s: rxintr_cleanup: rx pkt discarded: link down\n", NAME_UNIT); } - else /* Log and discard this bad packet. */ + + /* 4) When the receiver is enabled and a packet arrives, but no DMA */ + /* descriptor is available, the packet is counted as 'missed'. */ + /* The receiver should never miss packets; warn if it happens. */ + if ((missed = (missed & TLP_MISS_MISSED)) != 0) { if (DRIVER_DEBUG) - printk("%s: RX bad pkt; len=%d %s%s%s%s\n", - NAME_UNIT, first_skb->len, - (last_desc->status & TLP_DSTS_RX_MII_ERR) ? " miierr" : "", - (last_desc->status & TLP_DSTS_RX_DRIBBLE) ? " dribble" : "", - (last_desc->status & TLP_DSTS_RX_DESC_ERR) ? " descerr" : "", - (last_desc->status & TLP_DSTS_RX_OVERRUN) ? " overrun" : ""); - if (last_desc->status & TLP_DSTS_RX_OVERRUN) - sc->status.cntrs.fifo_over++; - else - sc->status.cntrs.ierrors++; - dev_kfree_skb_any(first_skb); + printf("%s: rx missed %d pkts\n", NAME_UNIT, missed); + sc->status.cntrs.missed += missed; } - - return 1; /* did something */ } -/* Setup (prepare) to receive a packet. */ -/* Try to keep the RX descriptor ring full of empty buffers. */ -static int /* Linux version */ -rxintr_setup(softc_t *sc) +static void /* This is where the work gets done. */ +core_interrupt(void *arg, int check_status) { - struct desc_ring *ring = &sc->rxring; - struct dma_desc *desc; - struct sk_buff *skb; - u_int32_t dma_addr; - - /* Ring is full if (wrap(write+1)==read) */ - if (((ring->write == ring->last) ? ring->first : ring->write+1) == ring->read) - return 0; /* ring is full; nothing to do */ + softc_t *sc = arg; + int activity; - /* Allocate an skbuff. */ - if ((skb = dev_alloc_skb(MAX_DESC_LEN)) == NULL) + /* If any CPU is inside this critical section, then */ + /* other CPUs should go away without doing anything. */ + if (BOTTOM_TRYLOCK == 0) { - sc->status.cntrs.rxdma++; - if (DRIVER_DEBUG) - printk("%s: rxintr_setup: dev_alloc_skb() failed\n", NAME_UNIT); - return 0; + sc->status.cntrs.lck_intr++; + return; } - skb->dev = sc->net_dev; - /* Queue the skbuff for later processing by rxintr_cleanup. */ - skbuff_enqueue(ring, skb); - - /* Write a DMA descriptor into the ring. */ - /* Hardware won't see it until the OWNER bit is set. */ - desc = ring->write; - /* Advance the ring write pointer. */ - if (ring->write++ == ring->last) ring->write = ring->first; + /* Clear pending card interrupts. */ + WRITE_CSR(TLP_STATUS, READ_CSR(TLP_STATUS)); - /* Map kernel virtual addresses to PCI addresses. */ - dma_addr = pci_map_single(sc->pci_dev, skb->data, - MAX_DESC_LEN, PCI_DMA_FROMDEVICE); - /* Set up the DMA descriptor. */ - desc->address1 = dma_addr; - desc->length1 = MAX_CHUNK_LEN; - desc->address2 = desc->address1 + desc->length1; - desc->length2 = MAX_CHUNK_LEN; + /* In Linux, pci_alloc_consistent() means DMA descriptors */ + /* don't need explicit syncing. */ + { + struct desc_ring *ring = &sc->txring; + DMA_SYNC(sc->txring.map, sc->txring.size_descs, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + ring = &sc->rxring; + DMA_SYNC(sc->rxring.map, sc->rxring.size_descs, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + } - /* Before setting the OWNER bit, flush the cache (memory barrier). */ - wmb(); /* write memory barrier */ + do /* This is the main loop for interrupt processing. */ + { + activity = txintr_cleanup(sc); + activity += txintr_setup(sc); + activity += rxintr_cleanup(sc); + activity += rxintr_setup(sc); + } while (activity); - /* Commit the DMA descriptor to the hardware. */ - desc->status = TLP_DSTS_OWNER; + { + struct desc_ring *ring = &sc->txring; + DMA_SYNC(sc->txring.map, sc->txring.size_descs, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + ring = &sc->rxring; + DMA_SYNC(sc->rxring.map, sc->rxring.size_descs, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + } - /* Notify the receiver that there is another buffer available. */ - WRITE_CSR(TLP_RX_POLL, 1); + /* As the interrupt is dismissed, check for four unusual events. */ + if (check_status) check_intr_status(sc); - return 1; /* did something */ + BOTTOM_UNLOCK; } -/* Clean up after a packet has been transmitted. */ -/* Free the sk_buff and update the DMA descriptor ring. */ -static int /* Linux version */ -txintr_cleanup(softc_t *sc) +/* user_interrupt() may be called from a syscall or a softirq */ +static void +user_interrupt(softc_t *sc, int check_status) { - struct desc_ring *ring = &sc->txring; - struct dma_desc *desc; - - while ((ring->read != ring->write) && /* ring is not empty */ - ((ring->read->status & TLP_DSTS_OWNER) == 0)) - { - /* Read a DMA descriptor from the ring. */ - desc = ring->read; - /* Advance the ring read pointer. */ - if (ring->read++ == ring->last) ring->read = ring->first; - /* Unmap kernel virtual address to PCI address. */ - pci_unmap_single(sc->pci_dev, desc->address1, - desc->length1 + desc->length2, PCI_DMA_TODEVICE); + DISABLE_INTR; /* noop on FreeBSD-5 and Linux */ + core_interrupt(sc, check_status); + ENABLE_INTR; /* noop on FreeBSD-5 and Linux */ + } - /* If this descriptor is the last segment of a packet, */ - /* then dequeue and free the corresponding skbuff. */ - if ((desc->control & TLP_DCTL_TX_LAST_SEG) != 0) - { - struct sk_buff *skb; - if ((skb = skbuff_dequeue(ring)) == NULL) - panic("%s: txintr_cleanup: expected an sk_buff\n", NAME_UNIT); - /* Include CRC and one flag byte in output byte count. */ - sc->status.cntrs.obytes += skb->len + sc->config.crc_len +1; - sc->status.cntrs.opackets++; +# if defined(DEVICE_POLLING) - /* The only bad TX status is fifo underrun. */ - if ((desc->status & TLP_DSTS_TX_UNDERRUN) != 0) - { - sc->status.cntrs.fifo_under++; /* also increment oerrors? */ - if (DRIVER_DEBUG) - printk("%s: txintr_cleanup: tx fifo underrun\n", NAME_UNIT); - } +/* Service the card from the kernel idle loop without interrupts. */ +static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 07:00:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 744AFE65; Thu, 25 Sep 2014 07:00:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F5A3C0A; Thu, 25 Sep 2014 07:00:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8P70WOG082716; Thu, 25 Sep 2014 07:00:32 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8P70W5H082715; Thu, 25 Sep 2014 07:00:32 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409250700.s8P70W5H082715@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 25 Sep 2014 07:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272095 - head/sys/dev/lmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 07:00:32 -0000 Author: glebius Date: Thu Sep 25 07:00:31 2014 New Revision: 272095 URL: http://svnweb.freebsd.org/changeset/base/272095 Log: - Provide lmc_get_counter() to return counters that are not collected, but taken from hardware. - Mechanically convert to if_inc_counter() the rest of counters. Modified: head/sys/dev/lmc/if_lmc.c Modified: head/sys/dev/lmc/if_lmc.c ============================================================================== --- head/sys/dev/lmc/if_lmc.c Thu Sep 25 06:47:38 2014 (r272094) +++ head/sys/dev/lmc/if_lmc.c Thu Sep 25 07:00:31 2014 (r272095) @@ -2602,7 +2602,7 @@ rxintr_cleanup(softc_t *sc) /* Include CRC and one flag byte in input byte count. */ sc->status.cntrs.ibytes += first_mbuf->m_pkthdr.len + sc->config.crc_len +1; sc->status.cntrs.ipackets++; - sc->ifp->if_ipackets++; + if_inc_counter(sc->ifp, IFCOUNTER_IPACKETS, 1); LMC_BPF_MTAP(first_mbuf); #if defined(DEVICE_POLLING) sc->quota--; @@ -2765,7 +2765,7 @@ txintr_cleanup(softc_t *sc) /* Include CRC and one flag byte in output byte count. */ sc->status.cntrs.obytes += m->m_pkthdr.len + sc->config.crc_len +1; sc->status.cntrs.opackets++; - sc->ifp->if_opackets++; + if_inc_counter(sc->ifp, IFCOUNTER_OPACKETS, 1); LMC_BPF_MTAP(m); /* The only bad TX status is fifo underrun. */ if ((desc->status & TLP_DSTS_TX_UNDERRUN) != 0) @@ -3680,7 +3680,7 @@ lmc_raw_output(struct ifnet *ifp, struct { m_freem(m); sc->status.cntrs.odiscards++; - ifp->if_oqdrops++; + if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1); if (DRIVER_DEBUG) printf("%s: lmc_raw_output: IFQ_ENQUEUE() failed; error %d\n", NAME_UNIT, error); @@ -3692,11 +3692,10 @@ lmc_raw_output(struct ifnet *ifp, struct /* Called from a softirq once a second. */ static void lmc_watchdog(void *arg) - { +{ struct ifnet *ifp = arg; softc_t *sc = IFP2SC(ifp); u_int8_t old_oper_status = sc->status.oper_status; - struct event_cntrs *cntrs = &sc->status.cntrs; core_watchdog(sc); /* updates oper_status */ @@ -3762,16 +3761,7 @@ lmc_watchdog(void *arg) # endif } - /* Copy statistics from sc to ifp. */ ifp->if_baudrate = sc->status.tx_speed; - ifp->if_ipackets = cntrs->ipackets; - ifp->if_opackets = cntrs->opackets; - ifp->if_ibytes = cntrs->ibytes; - ifp->if_obytes = cntrs->obytes; - ifp->if_ierrors = cntrs->ierrors; - ifp->if_oerrors = cntrs->oerrors; - ifp->if_iqdrops = cntrs->idiscards; - if (sc->status.oper_status == STATUS_UP) ifp->if_link_state = LINK_STATE_UP; else @@ -3779,8 +3769,36 @@ lmc_watchdog(void *arg) /* Call this procedure again after one second. */ callout_reset(&sc->callout, hz, lmc_watchdog, ifp); - } +} +static uint64_t +lmc_get_counter(struct ifnet *ifp, ift_counter cnt) +{ + softc_t *sc; + struct event_cntrs *cntrs; + + sc = if_getsoftc(ifp); + cntrs = &sc->status.cntrs; + + switch (cnt) { + case IFCOUNTER_IPACKETS: + return (cntrs->ipackets); + case IFCOUNTER_OPACKETS: + return (cntrs->opackets); + case IFCOUNTER_IBYTES: + return (cntrs->ibytes); + case IFCOUNTER_OBYTES: + return (cntrs->obytes); + case IFCOUNTER_IERRORS: + return (cntrs->ierrors); + case IFCOUNTER_OERRORS: + return (cntrs->oerrors); + case IFCOUNTER_IQDROPS: + return (cntrs->idiscards); + default: + return (if_get_counter_default(ifp, cnt)); + } +} static void setup_ifnet(struct ifnet *ifp) @@ -3794,6 +3812,7 @@ setup_ifnet(struct ifnet *ifp) ifp->if_start = lmc_ifnet_start; /* sppp changes this */ ifp->if_output = lmc_raw_output; /* sppp & p2p change this */ ifp->if_input = lmc_raw_input; + ifp->if_get_counter = lmc_get_counter; ifp->if_mtu = MAX_DESC_LEN; /* sppp & p2p change this */ ifp->if_type = IFT_PTPSERIAL; /* p2p changes this */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 07:22:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD9162AB; Thu, 25 Sep 2014 07:22:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8733E69; Thu, 25 Sep 2014 07:22:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8P7MPTI095707; Thu, 25 Sep 2014 07:22:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8P7MPfD095702; Thu, 25 Sep 2014 07:22:25 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409250722.s8P7MPfD095702@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 25 Sep 2014 07:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272096 - head/sys/dev/bce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 07:22:25 -0000 Author: glebius Date: Thu Sep 25 07:22:24 2014 New Revision: 272096 URL: http://svnweb.freebsd.org/changeset/base/272096 Log: - Provide bce_get_counter() to return counters that are not collected, but taken from hardware. - Mechanically convert to if_inc_counter() the rest of counters. - While here fix 3 instances of the same bug, when error counter was ++ in one place and then assigned in other place, losing the increment. Achieve that storing soft errors counters in softc. Modified: head/sys/dev/bce/if_bce.c head/sys/dev/bce/if_bcereg.h Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Thu Sep 25 07:00:31 2014 (r272095) +++ head/sys/dev/bce/if_bce.c Thu Sep 25 07:22:24 2014 (r272096) @@ -457,9 +457,10 @@ static struct mbuf *bce_tso_setup (struc struct mbuf **, u16 *); static int bce_tx_encap (struct bce_softc *, struct mbuf **); static void bce_start_locked (struct ifnet *); -static void bce_start (struct ifnet *); -static int bce_ioctl (struct ifnet *, u_long, caddr_t); -static void bce_watchdog (struct bce_softc *); +static void bce_start (struct ifnet *); +static int bce_ioctl (struct ifnet *, u_long, caddr_t); +static uint64_t bce_get_counter (struct ifnet *, ift_counter); +static void bce_watchdog (struct bce_softc *); static int bce_ifmedia_upd (struct ifnet *); static int bce_ifmedia_upd_locked (struct ifnet *); static void bce_ifmedia_sts (struct ifnet *, struct ifmediareq *); @@ -1389,6 +1390,7 @@ bce_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = bce_ioctl; ifp->if_start = bce_start; + ifp->if_get_counter = bce_get_counter; ifp->if_init = bce_init; ifp->if_mtu = ETHERMTU; @@ -6747,9 +6749,7 @@ bce_rx_intr(struct bce_softc *sc) L2_FHDR_ERRORS_TOO_SHORT | L2_FHDR_ERRORS_GIANT_FRAME)) { /* Log the error and release the mbuf. */ - ifp->if_ierrors++; sc->l2fhdr_error_count++; - m_freem(m0); m0 = NULL; goto bce_rx_intr_next_rx; @@ -6830,7 +6830,7 @@ bce_rx_intr(struct bce_softc *sc) } /* Increment received packet statistics. */ - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); bce_rx_intr_next_rx: sw_rx_cons = NEXT_RX_BD(sw_rx_cons); @@ -6988,7 +6988,7 @@ bce_tx_intr(struct bce_softc *sc) sc->tx_mbuf_ptr[sw_tx_chain_cons] = NULL; DBRUN(sc->debug_tx_mbuf_alloc--); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } sc->used_tx_bd--; @@ -7901,7 +7901,7 @@ bce_watchdog(struct bce_softc *sc) sc->bce_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; bce_init_locked(sc); - sc->bce_ifp->if_oerrors++; + sc->watchdog_timeouts++; bce_watchdog_exit: REG_WR(sc, BCE_EMAC_RX_STATUS, status); @@ -8157,28 +8157,15 @@ bce_set_rx_mode(struct bce_softc *sc) static void bce_stats_update(struct bce_softc *sc) { - struct ifnet *ifp; struct statistics_block *stats; DBENTER(BCE_EXTREME_MISC); - ifp = sc->bce_ifp; - bus_dmamap_sync(sc->stats_tag, sc->stats_map, BUS_DMASYNC_POSTREAD); stats = (struct statistics_block *) sc->stats_block; /* - * Certain controllers don't report - * carrier sense errors correctly. - * See errata E11_5708CA0_1165. - */ - if (!(BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5706) && - !(BCE_CHIP_ID(sc) == BCE_CHIP_ID_5708_A0)) - ifp->if_oerrors += - (u_long) stats->stat_Dot3StatsCarrierSenseErrors; - - /* * Update the sysctl statistics from the * hardware statistics. */ @@ -8359,35 +8346,51 @@ bce_stats_update(struct bce_softc *sc) sc->com_no_buffers = REG_RD_IND(sc, 0x120084); - /* - * Update the interface statistics from the - * hardware statistics. - */ - ifp->if_collisions = - (u_long) sc->stat_EtherStatsCollisions; - - /* ToDo: This method loses soft errors. */ - ifp->if_ierrors = - (u_long) sc->stat_EtherStatsUndersizePkts + - (u_long) sc->stat_EtherStatsOversizePkts + - (u_long) sc->stat_IfInMBUFDiscards + - (u_long) sc->stat_Dot3StatsAlignmentErrors + - (u_long) sc->stat_Dot3StatsFCSErrors + - (u_long) sc->stat_IfInRuleCheckerDiscards + - (u_long) sc->stat_IfInFTQDiscards + - (u_long) sc->com_no_buffers; - - /* ToDo: This method loses soft errors. */ - ifp->if_oerrors = - (u_long) sc->stat_emac_tx_stat_dot3statsinternalmactransmiterrors + - (u_long) sc->stat_Dot3StatsExcessiveCollisions + - (u_long) sc->stat_Dot3StatsLateCollisions; - /* ToDo: Add additional statistics? */ DBEXIT(BCE_EXTREME_MISC); } +static uint64_t +bce_get_counter(struct ifnet *ifp, ift_counter cnt) +{ + struct bce_softc *sc; + uint64_t rv; + + sc = if_getsoftc(ifp); + + switch (cnt) { + case IFCOUNTER_COLLISIONS: + return (sc->stat_EtherStatsCollisions); + case IFCOUNTER_IERRORS: + return (sc->stat_EtherStatsUndersizePkts + + sc->stat_EtherStatsOversizePkts + + sc->stat_IfInMBUFDiscards + + sc->stat_Dot3StatsAlignmentErrors + + sc->stat_Dot3StatsFCSErrors + + sc->stat_IfInRuleCheckerDiscards + + sc->stat_IfInFTQDiscards + + sc->l2fhdr_error_count + + sc->com_no_buffers); + case IFCOUNTER_OERRORS: + rv = sc->stat_Dot3StatsExcessiveCollisions + + sc->stat_emac_tx_stat_dot3statsinternalmactransmiterrors + + sc->stat_Dot3StatsLateCollisions + + sc->watchdog_timeouts; + /* + * Certain controllers don't report + * carrier sense errors correctly. + * See errata E11_5708CA0_1165. + */ + if (!(BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5706) && + !(BCE_CHIP_ID(sc) == BCE_CHIP_ID_5708_A0)) + rv += sc->stat_Dot3StatsCarrierSenseErrors; + return (rv); + default: + return (if_get_counter_default(ifp, cnt)); + } +} + /****************************************************************************/ /* Periodic function to notify the bootcode that the driver is still */ Modified: head/sys/dev/bce/if_bcereg.h ============================================================================== --- head/sys/dev/bce/if_bcereg.h Thu Sep 25 07:00:31 2014 (r272095) +++ head/sys/dev/bce/if_bcereg.h Thu Sep 25 07:22:24 2014 (r272096) @@ -6692,6 +6692,7 @@ struct bce_softc u32 l2fhdr_error_count; u32 dma_map_addr_tx_failed_count; u32 dma_map_addr_rx_failed_count; + u32 watchdog_timeouts; /* Host coalescing block command register */ u32 hc_command; From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 07:37:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2C1A658; Thu, 25 Sep 2014 07:37:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C7FEF90; Thu, 25 Sep 2014 07:37:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8P7bgIQ001213; Thu, 25 Sep 2014 07:37:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8P7bgHR001212; Thu, 25 Sep 2014 07:37:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409250737.s8P7bgHR001212@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 25 Sep 2014 07:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272097 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 07:37:42 -0000 Author: hselasky Date: Thu Sep 25 07:37:41 2014 New Revision: 272097 URL: http://svnweb.freebsd.org/changeset/base/272097 Log: MFC r271953: Some XHCI hardware requires dropping the endpoint context before adding it again. Approved by: re, glebius Modified: stable/10/sys/dev/usb/controller/xhci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci.c Thu Sep 25 07:22:24 2014 (r272096) +++ stable/10/sys/dev/usb/controller/xhci.c Thu Sep 25 07:37:41 2014 (r272097) @@ -2252,7 +2252,14 @@ xhci_configure_mask(struct usb_device *u xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, mask); xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, 0); } else { - xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, 0); + /* + * Some hardware requires that we drop the endpoint + * context before adding it again: + */ + xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, + mask & XHCI_INCTX_NON_CTRL_MASK); + + /* Add new endpoint context */ xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, mask); /* find most significant set bit */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 08:28:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE8A2260; Thu, 25 Sep 2014 08:28:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D71497B1; Thu, 25 Sep 2014 08:28:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8P8SD8O025306; Thu, 25 Sep 2014 08:28:13 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8P8SBb0025290; Thu, 25 Sep 2014 08:28:11 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409250828.s8P8SBb0025290@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Thu, 25 Sep 2014 08:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272098 - in head/sys: amd64/amd64 arm/arm ddb i386/i386 mips/mips pc98/pc98 powerpc/aim powerpc/booke sparc64/sparc64 x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 08:28:14 -0000 Author: royger Date: Thu Sep 25 08:28:10 2014 New Revision: 272098 URL: http://svnweb.freebsd.org/changeset/base/272098 Log: ddb: allow specifying the exact address of the symtab and strtab When the FreeBSD kernel is loaded from Xen the symtab and strtab are not loaded the same way as the native boot loader. This patch adds three new global variables to ddb that can be used to specify the exact position and size of those tables, so they can be directly used as parameters to db_add_symbol_table. A new helper is introduced, so callers that used to set ksym_start and ksym_end can use this helper to set the new variables. It also adds support for loading them from the Xen PVH port, that was previously missing those tables. Sponsored by: Citrix Systems R&D Reviewed by: kib ddb/db_main.c: - Add three new global variables: ksymtab, kstrtab, ksymtab_size that can be used to specify the position and size of the symtab and strtab. - Use those new variables in db_init in order to call db_add_symbol_table. - Move the logic in db_init to db_fetch_symtab in order to set ksymtab, kstrtab, ksymtab_size from ksym_start and ksym_end. ddb/ddb.h: - Add prototype for db_fetch_ksymtab. - Declate the extern variables ksymtab, kstrtab and ksymtab_size. x86/xen/pv.c: - Add support for finding the symtab and strtab when booted as a Xen PVH guest. Since Xen loads the symtab and strtab as NetBSD expects to find them we have to adapt and use the same method. amd64/amd64/machdep.c: arm/arm/machdep.c: i386/i386/machdep.c: mips/mips/machdep.c: pc98/pc98/machdep.c: powerpc/aim/machdep.c: powerpc/booke/machdep.c: sparc64/sparc64/machdep.c: - Use the newly introduced db_fetch_ksymtab in order to set ksymtab, kstrtab and ksymtab_size. Modified: head/sys/amd64/amd64/machdep.c head/sys/arm/arm/machdep.c head/sys/ddb/db_main.c head/sys/ddb/ddb.h head/sys/i386/i386/machdep.c head/sys/mips/mips/machdep.c head/sys/pc98/pc98/machdep.c head/sys/powerpc/aim/machdep.c head/sys/powerpc/booke/machdep.c head/sys/sparc64/sparc64/machdep.c head/sys/x86/xen/pv.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Sep 25 07:37:41 2014 (r272097) +++ head/sys/amd64/amd64/machdep.c Thu Sep 25 08:28:10 2014 (r272098) @@ -184,9 +184,6 @@ struct init_ops init_ops = { * the physical address at which the kernel is loaded. */ extern char kernphys[]; -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif struct msgbuf *msgbufp; @@ -1823,6 +1820,10 @@ static caddr_t native_parse_preload_data(u_int64_t modulep) { caddr_t kmdp; +#ifdef DDB + vm_offset_t ksym_start; + vm_offset_t ksym_end; +#endif preload_metadata = (caddr_t)(uintptr_t)(modulep + KERNBASE); preload_bootstrap_relocate(KERNBASE); @@ -1834,6 +1835,7 @@ native_parse_preload_data(u_int64_t modu #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); + db_fetch_ksymtab(ksym_start, ksym_end); #endif return (kmdp); Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Thu Sep 25 07:37:41 2014 (r272097) +++ head/sys/arm/arm/machdep.c Thu Sep 25 08:28:10 2014 (r272098) @@ -111,6 +111,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef DDB +#include +#endif + #ifdef DEBUG #define debugf(fmt, args...) printf(fmt, ##args) #else @@ -131,9 +135,6 @@ int _min_memcpy_size = 0; int _min_bzero_size = 0; extern int *end; -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif #ifdef FDT /* @@ -817,8 +818,7 @@ fake_preload_metadata(struct arm_boot_pa lastaddr = *(uint32_t *)(KERNVIRTADDR + 8); zend = lastaddr; zstart = *(uint32_t *)(KERNVIRTADDR + 4); - ksym_start = zstart; - ksym_end = zend; + db_fetch_ksymtab(zstart, zend); } else #endif lastaddr = (vm_offset_t)&end; @@ -912,6 +912,10 @@ freebsd_parse_boot_param(struct arm_boot vm_offset_t lastaddr = 0; void *mdp; void *kmdp; +#ifdef DDB + vm_offset_t ksym_start; + vm_offset_t ksym_end; +#endif /* * Mask metadata pointer: it is supposed to be on page boundary. If @@ -934,6 +938,7 @@ freebsd_parse_boot_param(struct arm_boot #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); + db_fetch_ksymtab(ksym_start, ksym_end); #endif preload_addr_relocate = KERNVIRTADDR - abp->abp_physaddr; return lastaddr; Modified: head/sys/ddb/db_main.c ============================================================================== --- head/sys/ddb/db_main.c Thu Sep 25 07:37:41 2014 (r272097) +++ head/sys/ddb/db_main.c Thu Sep 25 08:28:10 2014 (r272098) @@ -56,7 +56,12 @@ static dbbe_trace_thread_f db_trace_thre KDB_BACKEND(ddb, db_init, db_trace_self_wrapper, db_trace_thread_wrapper, db_trap); -vm_offset_t ksym_start, ksym_end; +/* + * Symbols can be loaded by specifying the exact addresses of + * the symtab and strtab in memory. This is used when loaded from + * boot loaders different than the native one (like Xen). + */ +vm_offset_t ksymtab, kstrtab, ksymtab_size; boolean_t X_db_line_at_pc(db_symtab_t *symtab, c_db_sym_t sym, char **file, int *line, @@ -168,24 +173,39 @@ X_db_symbol_values(db_symtab_t *symtab, } } +int +db_fetch_ksymtab(vm_offset_t ksym_start, vm_offset_t ksym_end) +{ + Elf_Size strsz; + + if (ksym_end > ksym_start && ksym_start != 0) { + ksymtab = ksym_start; + ksymtab_size = *(Elf_Size*)ksymtab; + ksymtab += sizeof(Elf_Size); + kstrtab = ksymtab + ksymtab_size; + strsz = *(Elf_Size*)kstrtab; + kstrtab += sizeof(Elf_Size); + if (kstrtab + strsz > ksym_end) { + /* Sizes doesn't match, unset everything. */ + ksymtab = ksymtab_size = kstrtab = 0; + } + } + + if (ksymtab == 0 || ksymtab_size == 0 || kstrtab == 0) + return (-1); + + return (0); +} + static int db_init(void) { - uintptr_t symtab, strtab; - Elf_Size tabsz, strsz; db_command_init(); - if (ksym_end > ksym_start && ksym_start != 0) { - symtab = ksym_start; - tabsz = *((Elf_Size*)symtab); - symtab += sizeof(Elf_Size); - strtab = symtab + tabsz; - strsz = *((Elf_Size*)strtab); - strtab += sizeof(Elf_Size); - if (strtab + strsz <= ksym_end) { - db_add_symbol_table((char *)symtab, - (char *)(symtab + tabsz), "elf", (char *)strtab); - } + + if (ksymtab != 0 && kstrtab != 0 && ksymtab_size != 0) { + db_add_symbol_table((char *)ksymtab, + (char *)(ksymtab + ksymtab_size), "elf", (char *)kstrtab); } db_add_symbol_table(NULL, NULL, "kld", NULL); return (1); /* We're the default debugger. */ Modified: head/sys/ddb/ddb.h ============================================================================== --- head/sys/ddb/ddb.h Thu Sep 25 07:37:41 2014 (r272097) +++ head/sys/ddb/ddb.h Thu Sep 25 08:28:10 2014 (r272098) @@ -77,6 +77,13 @@ int DB_CALL(db_expr_t, db_expr_t *, int, #endif /* + * Extern variables to set the address and size of the symtab and strtab. + * Most users should use db_fetch_symtab in order to set them from the + * boot loader provided values. + */ +extern vm_offset_t ksymtab, kstrtab, ksymtab_size; + +/* * There are three "command tables": * - One for simple commands; a list of these is displayed * by typing 'help' at the debugger prompt. @@ -218,6 +225,7 @@ int db_value_of_name_vnet(const char *n int db_write_bytes(vm_offset_t addr, size_t size, char *data); void db_command_register(struct command_table *, struct command *); void db_command_unregister(struct command_table *, struct command *); +int db_fetch_ksymtab(vm_offset_t ksym_start, vm_offset_t ksym_end); db_cmdfcn_t db_breakpoint_cmd; db_cmdfcn_t db_capture_cmd; Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Thu Sep 25 07:37:41 2014 (r272097) +++ head/sys/i386/i386/machdep.c Thu Sep 25 08:28:10 2014 (r272098) @@ -197,10 +197,6 @@ static void fill_fpregs_xmm(struct savex #endif /* CPU_ENABLE_SSE */ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif - /* Intel ICH registers */ #define ICH_PMBASE 0x400 #define ICH_SMI_EN ICH_PMBASE + 0x30 @@ -2736,8 +2732,7 @@ init386(first) #endif #ifdef DDB - ksym_start = bootinfo.bi_symtab; - ksym_end = bootinfo.bi_esymtab; + db_fetch_ksymtab(bootinfo.bi_symtab, bootinfo.bi_esymtab); #endif kdb_init(); @@ -3013,8 +3008,7 @@ init386(first) #endif #ifdef DDB - ksym_start = bootinfo.bi_symtab; - ksym_end = bootinfo.bi_esymtab; + db_fetch_ksymtab(bootinfo.bi_symtab, bootinfo.bi_esymtab); #endif kdb_init(); Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Thu Sep 25 07:37:41 2014 (r272097) +++ head/sys/mips/mips/machdep.c Thu Sep 25 08:28:10 2014 (r272098) @@ -167,9 +167,6 @@ extern char MipsCache[], MipsCacheEnd[]; extern char MipsWaitStart[], MipsWaitEnd[]; extern char edata[], end[]; -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif u_int32_t bootdev; struct bootinfo bootinfo; @@ -434,6 +431,8 @@ mips_postboot_fixup(void) #ifdef DDB Elf_Size *trampoline_data = (Elf_Size*)kernel_kseg0_end; Elf_Size symtabsize = 0; + vm_offset_t ksym_start; + vm_offset_t ksym_end; if (trampoline_data[0] == SYMTAB_MAGIC) { symtabsize = trampoline_data[1]; @@ -443,6 +442,7 @@ mips_postboot_fixup(void) kernel_kseg0_end += symtabsize; /* end of .strtab */ ksym_end = kernel_kseg0_end; + db_fetch_ksymtab(ksym_start, ksym_end); } #endif } Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Thu Sep 25 07:37:41 2014 (r272097) +++ head/sys/pc98/pc98/machdep.c Thu Sep 25 08:28:10 2014 (r272098) @@ -169,10 +169,6 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, int need_pre_dma_flush; /* If 1, use wbinvd befor DMA transfer. */ int need_post_dma_flush; /* If 1, use invd after DMA transfer. */ -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif - int _udatasel, _ucodesel; u_int basemem; @@ -2298,8 +2294,7 @@ init386(first) #endif #ifdef DDB - ksym_start = bootinfo.bi_symtab; - ksym_end = bootinfo.bi_esymtab; + db_fetch_ksymtab(bootinfo.bi_symtab,bootinfo.bi_esymtab); #endif kdb_init(); Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Thu Sep 25 07:37:41 2014 (r272097) +++ head/sys/powerpc/aim/machdep.c Thu Sep 25 08:28:10 2014 (r272098) @@ -129,10 +129,6 @@ __FBSDID("$FreeBSD$"); #include -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif - int cold = 1; #ifdef __powerpc64__ extern int n_slbs; @@ -268,6 +264,10 @@ powerpc_init(vm_offset_t startkernel, vm #ifndef __powerpc64__ int ppc64; #endif +#ifdef DDB + vm_offset_t ksym_start; + vm_offset_t ksym_end; +#endif kmdp = NULL; trap_offset = 0; @@ -302,6 +302,7 @@ powerpc_init(vm_offset_t startkernel, vm #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); + db_fetch_ksymtab(ksym_start, ksym_end); #endif } } Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Thu Sep 25 07:37:41 2014 (r272097) +++ head/sys/powerpc/booke/machdep.c Thu Sep 25 08:28:10 2014 (r272098) @@ -142,7 +142,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef DDB -extern vm_offset_t ksym_start, ksym_end; +#include #endif #ifdef DEBUG @@ -300,6 +300,10 @@ booke_init(uint32_t arg1, uint32_t arg2) struct pcpu *pc; void *kmdp, *mdp; vm_offset_t dtbp, end; +#ifdef DDB + vm_offset_t ksym_start; + vm_offset_t ksym_end; +#endif kmdp = NULL; @@ -360,6 +364,7 @@ booke_init(uint32_t arg1, uint32_t arg2) #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); + db_fetch_ksymtab(ksym_start, ksym_end); #endif } } else { Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Thu Sep 25 07:37:41 2014 (r272097) +++ head/sys/sparc64/sparc64/machdep.c Thu Sep 25 08:28:10 2014 (r272098) @@ -114,10 +114,6 @@ __FBSDID("$FreeBSD$"); typedef int ofw_vec_t(void *); -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif - int dtlb_slots; int itlb_slots; struct tlb_entry *kernel_tlbs; Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Thu Sep 25 07:37:41 2014 (r272097) +++ head/sys/x86/xen/pv.c Thu Sep 25 08:28:10 2014 (r272098) @@ -29,12 +29,15 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ddb.h" + #include #include #include #include #include #include +#include #include #include #include @@ -66,6 +69,10 @@ __FBSDID("$FreeBSD$"); #include +#ifdef DDB +#include +#endif + /* Native initial function */ extern u_int64_t hammer_time(u_int64_t, u_int64_t); /* Xen initial function */ @@ -93,6 +100,12 @@ extern int bootAP; extern char *bootSTK; #endif +/* + * Placed by the linker at the end of the bss section, which is the last + * section loaded by Xen before loading the symtab and strtab. + */ +extern uint32_t end; + /*-------------------------------- Global Data -------------------------------*/ /* Xen init_ops implementation. */ struct init_ops xen_init_ops = { @@ -297,6 +310,68 @@ xen_pv_set_boothowto(void) } } +#ifdef DDB +/* + * The way Xen loads the symtab is different from the native boot loader, + * because it's tailored for NetBSD. So we have to adapt and use the same + * method as NetBSD. Portions of the code below have been picked from NetBSD: + * sys/kern/kern_ksyms.c CVS Revision 1.71. + */ +static void +xen_pv_parse_symtab(void) +{ + Elf_Ehdr *ehdr; + Elf_Shdr *shdr; + vm_offset_t sym_end; + uint32_t size; + int i, j; + + size = end; + sym_end = HYPERVISOR_start_info->mod_start != 0 ? + HYPERVISOR_start_info->mod_start : + HYPERVISOR_start_info->mfn_list; + + /* + * Make sure the size is right headed, sym_end is just a + * high boundary, but at least allows us to fail earlier. + */ + if ((vm_offset_t)&end + size > sym_end) { + xc_printf("Unable to load ELF symtab: size mismatch\n"); + return; + } + + ehdr = (Elf_Ehdr *)(&end + 1); + if (memcmp(ehdr->e_ident, ELFMAG, SELFMAG) || + ehdr->e_ident[EI_CLASS] != ELF_TARG_CLASS || + ehdr->e_version > 1) { + xc_printf("Unable to load ELF symtab: invalid symbol table\n"); + return; + } + + shdr = (Elf_Shdr *)((uint8_t *)ehdr + ehdr->e_shoff); + /* Find the symbol table and the corresponding string table. */ + for (i = 1; i < ehdr->e_shnum; i++) { + if (shdr[i].sh_type != SHT_SYMTAB) + continue; + if (shdr[i].sh_offset == 0) + continue; + ksymtab = (uintptr_t)((uint8_t *)ehdr + shdr[i].sh_offset); + ksymtab_size = shdr[i].sh_size; + j = shdr[i].sh_link; + if (shdr[j].sh_offset == 0) + continue; /* Can this happen? */ + kstrtab = (uintptr_t)((uint8_t *)ehdr + shdr[j].sh_offset); + break; + } + + if (ksymtab == 0 || kstrtab == 0) { + xc_printf( + "Unable to load ELF symtab: could not find symtab or strtab\n"); + return; + } +} +#endif + static caddr_t xen_pv_parse_preload_data(u_int64_t modulep) { @@ -304,6 +379,10 @@ xen_pv_parse_preload_data(u_int64_t modu xen_pv_set_env(); xen_pv_set_boothowto(); +#ifdef DDB + xen_pv_parse_symtab(); +#endif + return (NULL); } From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 08:36:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D25D5BA; Thu, 25 Sep 2014 08:36:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CD5888A; Thu, 25 Sep 2014 08:36:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8P8aCCx029960; Thu, 25 Sep 2014 08:36:12 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8P8aCLu029959; Thu, 25 Sep 2014 08:36:12 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409250836.s8P8aCLu029959@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 25 Sep 2014 08:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272099 - head/sys/dev/vmware/vmxnet3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 08:36:12 -0000 Author: glebius Date: Thu Sep 25 08:36:11 2014 New Revision: 272099 URL: http://svnweb.freebsd.org/changeset/base/272099 Log: Provide vmxnet3_get_counter() to return counters that are not collected, but taken from hardware. Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Thu Sep 25 08:28:10 2014 (r272098) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Thu Sep 25 08:36:11 2014 (r272099) @@ -187,6 +187,7 @@ static void vmxnet3_unregister_vlan(void static void vmxnet3_set_rxfilter(struct vmxnet3_softc *); static int vmxnet3_change_mtu(struct vmxnet3_softc *, int); static int vmxnet3_ioctl(struct ifnet *, u_long, caddr_t); +static uint64_t vmxnet3_get_counter(struct ifnet *, ift_counter); #ifndef VMXNET3_LEGACY_TX static void vmxnet3_qflush(struct ifnet *); @@ -194,10 +195,6 @@ static void vmxnet3_qflush(struct ifnet static int vmxnet3_watchdog(struct vmxnet3_txqueue *); static void vmxnet3_refresh_host_stats(struct vmxnet3_softc *); -static void vmxnet3_txq_accum_stats(struct vmxnet3_txqueue *, - struct vmxnet3_txq_stats *); -static void vmxnet3_rxq_accum_stats(struct vmxnet3_rxqueue *, - struct vmxnet3_rxq_stats *); static void vmxnet3_tick(void *); static void vmxnet3_link_status(struct vmxnet3_softc *); static void vmxnet3_media_status(struct ifnet *, struct ifmediareq *); @@ -1722,6 +1719,7 @@ vmxnet3_setup_interface(struct vmxnet3_s ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_init = vmxnet3_init; ifp->if_ioctl = vmxnet3_ioctl; + ifp->if_get_counter = vmxnet3_get_counter; ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); ifp->if_hw_tsomaxsegcount = VMXNET3_TX_MAXSEGS; ifp->if_hw_tsomaxsegsize = VMXNET3_TX_MAXSEGSIZE; @@ -3344,56 +3342,14 @@ vmxnet3_refresh_host_stats(struct vmxnet vmxnet3_write_cmd(sc, VMXNET3_CMD_GET_STATS); } -static void -vmxnet3_txq_accum_stats(struct vmxnet3_txqueue *txq, - struct vmxnet3_txq_stats *accum) -{ - struct vmxnet3_txq_stats *st; - - st = &txq->vxtxq_stats; - - accum->vmtxs_opackets += st->vmtxs_opackets; - accum->vmtxs_obytes += st->vmtxs_obytes; - accum->vmtxs_omcasts += st->vmtxs_omcasts; - accum->vmtxs_csum += st->vmtxs_csum; - accum->vmtxs_tso += st->vmtxs_tso; - accum->vmtxs_full += st->vmtxs_full; - accum->vmtxs_offload_failed += st->vmtxs_offload_failed; -} - -static void -vmxnet3_rxq_accum_stats(struct vmxnet3_rxqueue *rxq, - struct vmxnet3_rxq_stats *accum) +static uint64_t +vmxnet3_get_counter(struct ifnet *ifp, ift_counter cnt) { - struct vmxnet3_rxq_stats *st; - - st = &rxq->vxrxq_stats; - - accum->vmrxs_ipackets += st->vmrxs_ipackets; - accum->vmrxs_ibytes += st->vmrxs_ibytes; - accum->vmrxs_iqdrops += st->vmrxs_iqdrops; - accum->vmrxs_ierrors += st->vmrxs_ierrors; -} - -static void -vmxnet3_accumulate_stats(struct vmxnet3_softc *sc) -{ - struct ifnet *ifp; - struct vmxnet3_statistics *st; - struct vmxnet3_txq_stats txaccum; - struct vmxnet3_rxq_stats rxaccum; - int i; - - ifp = sc->vmx_ifp; - st = &sc->vmx_stats; - - bzero(&txaccum, sizeof(struct vmxnet3_txq_stats)); - bzero(&rxaccum, sizeof(struct vmxnet3_rxq_stats)); + struct vmxnet3_softc *sc; + uint64_t rv; - for (i = 0; i < sc->vmx_ntxqueues; i++) - vmxnet3_txq_accum_stats(&sc->vmx_txq[i], &txaccum); - for (i = 0; i < sc->vmx_nrxqueues; i++) - vmxnet3_rxq_accum_stats(&sc->vmx_rxq[i], &rxaccum); + sc = if_getsoftc(ifp); + rv = 0; /* * With the exception of if_ierrors, these ifnet statistics are @@ -3401,14 +3357,36 @@ vmxnet3_accumulate_stats(struct vmxnet3_ * values. if_ierrors is updated in ether_input() for malformed * frames that we should have already discarded. */ - ifp->if_ipackets = rxaccum.vmrxs_ipackets; - ifp->if_iqdrops = rxaccum.vmrxs_iqdrops; - ifp->if_ierrors = rxaccum.vmrxs_ierrors; - ifp->if_opackets = txaccum.vmtxs_opackets; + switch (cnt) { + case IFCOUNTER_IPACKETS: + for (int i = 0; i < sc->vmx_nrxqueues; i++) + rv += sc->vmx_rxq[i].vxrxq_stats.vmrxs_ipackets; + return (rv); + case IFCOUNTER_IQDROPS: + for (int i = 0; i < sc->vmx_nrxqueues; i++) + rv += sc->vmx_rxq[i].vxrxq_stats.vmrxs_iqdrops; + return (rv); + case IFCOUNTER_IERRORS: + for (int i = 0; i < sc->vmx_nrxqueues; i++) + rv += sc->vmx_rxq[i].vxrxq_stats.vmrxs_ierrors; + return (rv); + case IFCOUNTER_OPACKETS: + for (int i = 0; i < sc->vmx_ntxqueues; i++) + rv += sc->vmx_txq[i].vxtxq_stats.vmtxs_opackets; + return (rv); #ifndef VMXNET3_LEGACY_TX - ifp->if_obytes = txaccum.vmtxs_obytes; - ifp->if_omcasts = txaccum.vmtxs_omcasts; + case IFCOUNTER_OBYTES: + for (int i = 0; i < sc->vmx_ntxqueues; i++) + rv += sc->vmx_txq[i].vxtxq_stats.vmtxs_obytes; + return (rv); + case IFCOUNTER_OMCASTS: + for (int i = 0; i < sc->vmx_ntxqueues; i++) + rv += sc->vmx_txq[i].vxtxq_stats.vmtxs_omcasts; + return (rv); #endif + default: + return (if_get_counter_default(ifp, cnt)); + } } static void @@ -3424,7 +3402,6 @@ vmxnet3_tick(void *xsc) VMXNET3_CORE_LOCK_ASSERT(sc); - vmxnet3_accumulate_stats(sc); vmxnet3_refresh_host_stats(sc); for (i = 0; i < sc->vmx_ntxqueues; i++) From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 09:11:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3161EEB; Thu, 25 Sep 2014 09:11:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C441EC0A; Thu, 25 Sep 2014 09:11:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8P9B19a045693; Thu, 25 Sep 2014 09:11:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8P9B1VA045692; Thu, 25 Sep 2014 09:11:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409250911.s8P9B1VA045692@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 25 Sep 2014 09:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272100 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 09:11:02 -0000 Author: mav Date: Thu Sep 25 09:11:01 2014 New Revision: 272100 URL: http://svnweb.freebsd.org/changeset/base/272100 Log: MFC r271949: Fix UNMAP stuck if the last block descriptor in the list is empty. Approved by: re (glebius) Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Sep 25 08:36:11 2014 (r272099) +++ stable/10/sys/cam/ctl/ctl.c Thu Sep 25 09:11:01 2014 (r272100) @@ -6039,7 +6039,7 @@ ctl_unmap(struct ctl_scsiio *ctsio) struct scsi_unmap *cdb; struct ctl_ptr_len_flags *ptrlen; struct scsi_unmap_header *hdr; - struct scsi_unmap_desc *buf, *end; + struct scsi_unmap_desc *buf, *end, *endnz, *range; uint64_t lba; uint32_t num_blocks; int len, retval; @@ -6092,24 +6092,38 @@ ctl_unmap(struct ctl_scsiio *ctsio) buf = (struct scsi_unmap_desc *)(hdr + 1); end = buf + len / sizeof(*buf); - ptrlen = (struct ctl_ptr_len_flags *)&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; - ptrlen->ptr = (void *)buf; - ptrlen->len = len; - ptrlen->flags = byte2; - - for (; buf < end; buf++) { - lba = scsi_8btou64(buf->lba); - num_blocks = scsi_4btoul(buf->length); + endnz = buf; + for (range = buf; range < end; range++) { + lba = scsi_8btou64(range->lba); + num_blocks = scsi_4btoul(range->length); if (((lba + num_blocks) > (lun->be_lun->maxlba + 1)) || ((lba + num_blocks) < lba)) { ctl_set_lba_out_of_range(ctsio); ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } + if (num_blocks != 0) + endnz = range + 1; } - retval = lun->backend->config_write((union ctl_io *)ctsio); + /* + * Block backend can not handle zero last range. + * Filter it out and return if there is nothing left. + */ + len = (uint8_t *)endnz - (uint8_t *)buf; + if (len == 0) { + ctl_set_success(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + ptrlen = (struct ctl_ptr_len_flags *) + &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + ptrlen->ptr = (void *)buf; + ptrlen->len = len; + ptrlen->flags = byte2; + retval = lun->backend->config_write((union ctl_io *)ctsio); return (retval); } From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 09:12:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5AD2A6; Thu, 25 Sep 2014 09:12:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0E9DCA5; Thu, 25 Sep 2014 09:12:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8P9CCCY048798; Thu, 25 Sep 2014 09:12:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8P9CCKm048797; Thu, 25 Sep 2014 09:12:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409250912.s8P9CCKm048797@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 25 Sep 2014 09:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272101 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 09:12:12 -0000 Author: mav Date: Thu Sep 25 09:12:11 2014 New Revision: 272101 URL: http://svnweb.freebsd.org/changeset/base/272101 Log: MFC r271957: Fix read overrun handling, broken by using wrong variable. Approved by: re (marius) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Thu Sep 25 09:11:01 2014 (r272100) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Thu Sep 25 09:12:11 2014 (r272101) @@ -2509,10 +2509,10 @@ cfiscsi_datamove_in(union ctl_io *io) sg_addr += len; sg_len -= len; - KASSERT(buffer_offset + request->ip_data_len <= expected_len, + KASSERT(buffer_offset + response->ip_data_len <= expected_len, ("buffer_offset %zd + ip_data_len %zd > expected_len %zd", - buffer_offset, request->ip_data_len, expected_len)); - if (buffer_offset + request->ip_data_len == expected_len) { + buffer_offset, response->ip_data_len, expected_len)); + if (buffer_offset + response->ip_data_len == expected_len) { /* * Already have the amount of data the initiator wanted. */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 10:59:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A386AB48; Thu, 25 Sep 2014 10:59:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8ED429E0; Thu, 25 Sep 2014 10:59:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PAx2JB099683; Thu, 25 Sep 2014 10:59:02 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PAx2M2099682; Thu, 25 Sep 2014 10:59:02 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <201409251059.s8PAx2M2099682@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Thu, 25 Sep 2014 10:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272102 - head/lib/libnv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 10:59:02 -0000 Author: pjd Date: Thu Sep 25 10:59:01 2014 New Revision: 272102 URL: http://svnweb.freebsd.org/changeset/base/272102 Log: Document the new nvlist_get_parent() function. Submitted by: Mariusz Zaborski Modified: head/lib/libnv/nv.3 Modified: head/lib/libnv/nv.3 ============================================================================== --- head/lib/libnv/nv.3 Thu Sep 25 09:12:11 2014 (r272101) +++ head/lib/libnv/nv.3 Thu Sep 25 10:59:01 2014 (r272102) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2014 +.Dd September 25, 2014 .Dt NV 3 .Os .Sh NAME @@ -150,6 +150,8 @@ .Fn nvlist_get_descriptor "const nvlist_t *nvl" "const char *name" .Ft "const void *" .Fn nvlist_get_binary "const nvlist_t *nvl" "const char *name" "size_t *sizep" +.Ft "const nvlist_t *" +.Fn nvlist_get_parent "const nvlist_t *nvl" .\" .Ft bool .Fn nvlist_take_bool "nvlist_t *nvl" "const char *name" @@ -437,6 +439,10 @@ extension, which allows to provide defau The nvlist must not be in error state. .Pp The +.Fn nvlist_get_parent +function allows to obtain the parent nvlist from the nested nvlist. +.Pp +The .Fn nvlist_take_bool , .Fn nvlist_take_number , .Fn nvlist_take_string , From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 11:38:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A95CE53; Thu, 25 Sep 2014 11:38:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73B4FEC9; Thu, 25 Sep 2014 11:38:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PBcWBt020605; Thu, 25 Sep 2014 11:38:32 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PBcRR9020580; Thu, 25 Sep 2014 11:38:27 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201409251138.s8PBcRR9020580@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Thu, 25 Sep 2014 11:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272103 - in head/sys: arm/conf arm/s3c2xx0 arm/samsung/s3c2xx0 dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 11:38:32 -0000 Author: gavin Date: Thu Sep 25 11:38:26 2014 New Revision: 272103 URL: http://svnweb.freebsd.org/changeset/base/272103 Log: Move the ARM Samsung s3c2xx0 support files into the samsung directory, to match other platforms. Discussed with: andrew Added: head/sys/arm/samsung/s3c2xx0/ - copied from r272070, head/sys/arm/s3c2xx0/ Deleted: head/sys/arm/s3c2xx0/ Modified: head/sys/arm/conf/LN2410SBC head/sys/arm/conf/NOTES head/sys/arm/samsung/s3c2xx0/board_ln2410sbc.c head/sys/arm/samsung/s3c2xx0/files.s3c2xx0 head/sys/arm/samsung/s3c2xx0/s3c2410reg.h head/sys/arm/samsung/s3c2xx0/s3c2410var.h head/sys/arm/samsung/s3c2xx0/s3c2440reg.h head/sys/arm/samsung/s3c2xx0/s3c24x0.c head/sys/arm/samsung/s3c2xx0/s3c24x0_clk.c head/sys/arm/samsung/s3c2xx0/s3c24x0_machdep.c head/sys/arm/samsung/s3c2xx0/s3c24x0_rtc.c head/sys/arm/samsung/s3c2xx0/s3c24x0reg.h head/sys/arm/samsung/s3c2xx0/s3c24x0var.h head/sys/arm/samsung/s3c2xx0/std.ln2410sbc head/sys/arm/samsung/s3c2xx0/std.s3c2410 head/sys/arm/samsung/s3c2xx0/uart_bus_s3c2410.c head/sys/arm/samsung/s3c2xx0/uart_cpu_s3c2410.c head/sys/arm/samsung/s3c2xx0/uart_dev_s3c2410.c head/sys/dev/usb/controller/ohci_s3c24x0.c Modified: head/sys/arm/conf/LN2410SBC ============================================================================== --- head/sys/arm/conf/LN2410SBC Thu Sep 25 10:59:01 2014 (r272102) +++ head/sys/arm/conf/LN2410SBC Thu Sep 25 11:38:26 2014 (r272103) @@ -19,7 +19,7 @@ ident LN2410SBC -include "../s3c2xx0/std.ln2410sbc" +include "../samsung/s3c2xx0/std.ln2410sbc" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" # Default places to look for devices. makeoptions MODULES_OVERRIDE="" Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Thu Sep 25 10:59:01 2014 (r272102) +++ head/sys/arm/conf/NOTES Thu Sep 25 11:38:26 2014 (r272103) @@ -19,7 +19,7 @@ files "../mv/discovery/files.db78xxx" files "../mv/kirkwood/files.kirkwood" files "../mv/orion/files.db88f5xxx" files "../mv/orion/files.ts7800" -files "../s3c2xx0/files.s3c2xx0" +files "../samsung/s3c2xx0/files.s3c2xx0" files "../xscale/i80321/files.ep80219" files "../xscale/i80321/files.i80219" files "../xscale/i80321/files.i80321" Modified: head/sys/arm/samsung/s3c2xx0/board_ln2410sbc.c ============================================================================== --- head/sys/arm/s3c2xx0/board_ln2410sbc.c Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/board_ln2410sbc.c Thu Sep 25 11:38:26 2014 (r272103) @@ -30,8 +30,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include extern vm_offset_t s3c2410_uart_vaddr; Modified: head/sys/arm/samsung/s3c2xx0/files.s3c2xx0 ============================================================================== --- head/sys/arm/s3c2xx0/files.s3c2xx0 Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/files.s3c2xx0 Thu Sep 25 11:38:26 2014 (r272103) @@ -2,14 +2,14 @@ arm/arm/bus_space_asm_generic.S standard arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_arm9.S standard -arm/s3c2xx0/board_ln2410sbc.c optional board_ln2410sbc -arm/s3c2xx0/s3c24x0_rtc.c standard -arm/s3c2xx0/s3c24x0_machdep.c standard -arm/s3c2xx0/s3c24x0.c standard -arm/s3c2xx0/s3c2xx0_space.c standard -arm/s3c2xx0/s3c24x0_clk.c standard -arm/s3c2xx0/uart_bus_s3c2410.c optional uart -arm/s3c2xx0/uart_cpu_s3c2410.c optional uart -arm/s3c2xx0/uart_dev_s3c2410.c optional uart +arm/samsung/s3c2xx0/board_ln2410sbc.c optional board_ln2410sbc +arm/samsung/s3c2xx0/s3c24x0_rtc.c standard +arm/samsung/s3c2xx0/s3c24x0_machdep.c standard +arm/samsung/s3c2xx0/s3c24x0.c standard +arm/samsung/s3c2xx0/s3c2xx0_space.c standard +arm/samsung/s3c2xx0/s3c24x0_clk.c standard +arm/samsung/s3c2xx0/uart_bus_s3c2410.c optional uart +arm/samsung/s3c2xx0/uart_cpu_s3c2410.c optional uart +arm/samsung/s3c2xx0/uart_dev_s3c2410.c optional uart dev/usb/controller/ohci_s3c24x0.c optional ohci Modified: head/sys/arm/samsung/s3c2xx0/s3c2410reg.h ============================================================================== --- head/sys/arm/s3c2xx0/s3c2410reg.h Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/s3c2410reg.h Thu Sep 25 11:38:26 2014 (r272103) @@ -42,7 +42,7 @@ #define _ARM_S3C2XX0_S3C2410REG_H_ /* common definitions for S3C2410 and S3C2440 */ -#include +#include /* * Memory Map Modified: head/sys/arm/samsung/s3c2xx0/s3c2410var.h ============================================================================== --- head/sys/arm/s3c2xx0/s3c2410var.h Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/s3c2410var.h Thu Sep 25 11:38:26 2014 (r272103) @@ -34,7 +34,7 @@ #ifndef _ARM_S3C2410VAR_H_ #define _ARM_S3C2410VAR_H_ -#include +#include int s3c2410_sscom_cnattach(bus_space_tag_t, int, int, int, tcflag_t); int s3c2410_sscom_kgdb_attach(bus_space_tag_t, int, int, int, tcflag_t); Modified: head/sys/arm/samsung/s3c2xx0/s3c2440reg.h ============================================================================== --- head/sys/arm/s3c2xx0/s3c2440reg.h Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/s3c2440reg.h Thu Sep 25 11:38:26 2014 (r272103) @@ -36,7 +36,7 @@ #define _ARM_S3C2XX0_S3C2440REG_H_ /* common definitions for S3C2410 and S3C2440 */ -#include +#include /* * Memory Map Modified: head/sys/arm/samsung/s3c2xx0/s3c24x0.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0.c Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/s3c24x0.c Thu Sep 25 11:38:26 2014 (r272103) @@ -49,9 +49,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include +#include +#include +#include #include #define S3C2XX0_XTAL_CLK 12000000 Modified: head/sys/arm/samsung/s3c2xx0/s3c24x0_clk.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0_clk.c Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/s3c24x0_clk.c Thu Sep 25 11:38:26 2014 (r272103) @@ -48,8 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include +#include +#include struct s3c24x0_timer_softc { device_t dev; Modified: head/sys/arm/samsung/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0_machdep.c Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/s3c24x0_machdep.c Thu Sep 25 11:38:26 2014 (r272103) @@ -89,9 +89,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include +#include +#include +#include /* Page table for mapping proc0 zero page */ #define KERNEL_PT_SYS 0 Modified: head/sys/arm/samsung/s3c2xx0/s3c24x0_rtc.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0_rtc.c Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/s3c24x0_rtc.c Thu Sep 25 11:38:26 2014 (r272103) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include "clock_if.h" Modified: head/sys/arm/samsung/s3c2xx0/s3c24x0reg.h ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0reg.h Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/s3c24x0reg.h Thu Sep 25 11:38:26 2014 (r272103) @@ -43,7 +43,7 @@ #define _ARM_S3C2XX0_S3C24X0REG_H_ /* common definitions for S3C2800, S3C2410 and S3C2440 */ -#include +#include /* * Map the device registers into kernel space. Modified: head/sys/arm/samsung/s3c2xx0/s3c24x0var.h ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0var.h Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/s3c24x0var.h Thu Sep 25 11:38:26 2014 (r272103) @@ -34,7 +34,7 @@ #ifndef _ARM_S3C24X0VAR_H_ #define _ARM_S3C24X0VAR_H_ -#include +#include struct s3c24x0_softc { struct s3c2xx0_softc sc_sx; Modified: head/sys/arm/samsung/s3c2xx0/std.ln2410sbc ============================================================================== --- head/sys/arm/s3c2xx0/std.ln2410sbc Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/std.ln2410sbc Thu Sep 25 11:38:26 2014 (r272103) @@ -1,5 +1,5 @@ #$FreeBSD$ -include "../s3c2xx0/std.s3c2410" +include "../samsung/s3c2xx0/std.s3c2410" makeoptions KERNPHYSADDR=0x30000000 makeoptions KERNVIRTADDR=0xc0000000 Modified: head/sys/arm/samsung/s3c2xx0/std.s3c2410 ============================================================================== --- head/sys/arm/s3c2xx0/std.s3c2410 Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/std.s3c2410 Thu Sep 25 11:38:26 2014 (r272103) @@ -1,6 +1,6 @@ # $FreeBSD$ -files "../s3c2xx0/files.s3c2xx0" +files "../samsung/s3c2xx0/files.s3c2xx0" cpu CPU_ARM9 machine arm Modified: head/sys/arm/samsung/s3c2xx0/uart_bus_s3c2410.c ============================================================================== --- head/sys/arm/s3c2xx0/uart_bus_s3c2410.c Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/uart_bus_s3c2410.c Thu Sep 25 11:38:26 2014 (r272103) @@ -15,7 +15,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "uart_if.h" Modified: head/sys/arm/samsung/s3c2xx0/uart_cpu_s3c2410.c ============================================================================== --- head/sys/arm/s3c2xx0/uart_cpu_s3c2410.c Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/uart_cpu_s3c2410.c Thu Sep 25 11:38:26 2014 (r272103) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include bus_space_tag_t uart_bus_space_io; bus_space_tag_t uart_bus_space_mem; Modified: head/sys/arm/samsung/s3c2xx0/uart_dev_s3c2410.c ============================================================================== --- head/sys/arm/s3c2xx0/uart_dev_s3c2410.c Wed Sep 24 12:41:39 2014 (r272070) +++ head/sys/arm/samsung/s3c2xx0/uart_dev_s3c2410.c Thu Sep 25 11:38:26 2014 (r272103) @@ -41,10 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "uart_if.h" /* Finds the subirq from the parent */ Modified: head/sys/dev/usb/controller/ohci_s3c24x0.c ============================================================================== --- head/sys/dev/usb/controller/ohci_s3c24x0.c Thu Sep 25 10:59:01 2014 (r272102) +++ head/sys/dev/usb/controller/ohci_s3c24x0.c Thu Sep 25 11:38:26 2014 (r272103) @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include static device_probe_t ohci_s3c24x0_probe; static device_attach_t ohci_s3c24x0_attach; From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 11:07:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DBF3F93; Thu, 25 Sep 2014 11:07:13 +0000 (UTC) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F3C3AD7; Thu, 25 Sep 2014 11:07:13 +0000 (UTC) Received: from [172.22.0.99] (unknown [213.222.32.13]) (using SSLv3 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 75B811928C4; Thu, 25 Sep 2014 11:07:08 +0000 (UTC) Subject: Re: svn commit: r272089 - head/sys/netpfil/ipfw From: Sean Bruno Reply-To: sbruno@freebsd.org To: Gleb Smirnoff In-Reply-To: <20140925051808.GS884@FreeBSD.org> References: <201409250226.s8P2Q6AS055635@svn.freebsd.org> <20140925051808.GS884@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" Date: Thu, 25 Sep 2014 04:07:03 -0700 Message-ID: <1411643223.2161.2.camel@bruno> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Thu, 25 Sep 2014 12:35:33 +0000 Cc: FreeBSD Net , Adrian Chadd , David Carlier X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 11:07:13 -0000 On Thu, 2014-09-25 at 09:18 +0400, Gleb Smirnoff wrote: > On Wed, Sep 24, 2014 at 07:40:23PM -0700, Adrian Chadd wrote: > A> Hm, I saw this from Kate on IRC. Did anyone figure out _where_ these > A> frames are coming from? > A> > A> Just dropping them is cool, but I'd really like to see the contents of > A> the frames and what their origin is. > A> > A> I'm worried that they're valid stack-generated frames.. > > I agree on this. Fixing NULL pointer derefs with NULL check is not > always a right thing to do. > > A> -a > A> > A> > A> On 24 September 2014 19:26, Sean Bruno wrote: > A> > Author: sbruno > A> > Date: Thu Sep 25 02:26:05 2014 > A> > New Revision: 272089 > A> > URL: http://svnweb.freebsd.org/changeset/base/272089 > A> > > A> > Log: > A> > Fix NULL pointer deref in ipfw when using dummynet at layer 2. > A> > Drop packet if pkg->ifp is NULL, which is the case here. > A> > > A> > ref. https://github.com/HardenedBSD/hardenedBSD > A> > commit 4eef3881c64f6e3aa38eebbeaf27a947a5d47dd7 > A> > > A> > PR 193861 -- DUMMYNET LAYER2: kernel panic > A> > > A> > in this case a kernel panic occurs. Hence, when we do not get an interface, > A> > we just drop the packet in question. > A> > > A> > PR: 193681 > A> > Submitted by: David Carlier > A> > Obtained from: Hardened BSD > A> > MFC after: 2 weeks > A> > Relnotes: yes > A> > > A> > Modified: > A> > head/sys/netpfil/ipfw/ip_dn_io.c > A> > > A> > Modified: head/sys/netpfil/ipfw/ip_dn_io.c > A> > ============================================================================== > A> > --- head/sys/netpfil/ipfw/ip_dn_io.c Wed Sep 24 22:58:10 2014 (r272088) > A> > +++ head/sys/netpfil/ipfw/ip_dn_io.c Thu Sep 25 02:26:05 2014 (r272089) > A> > @@ -751,10 +751,15 @@ dummynet_send(struct mbuf *m) > A> > /* extract the dummynet info, rename the tag > A> > * to carry reinject info. > A> > */ > A> > - dst = pkt->dn_dir; > A> > - ifp = pkt->ifp; > A> > - tag->m_tag_cookie = MTAG_IPFW_RULE; > A> > - tag->m_tag_id = 0; > A> > + if (pkt->dn_dir == (DIR_OUT | PROTO_LAYER2) && > A> > + pkt->ifp == NULL) { > A> > + dst = DIR_DROP; > A> > + } else { > A> > + dst = pkt->dn_dir; > A> > + ifp = pkt->ifp; > A> > + tag->m_tag_cookie = MTAG_IPFW_RULE; > A> > + tag->m_tag_id = 0; > A> > + } > A> > } > A> > > A> > switch (dst) { > A> > > A> > Ok, moving off to freebsd-net. How should we proceded with debugging further? sean bcc src-all src-head From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 13:08:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54AB4B0C; Thu, 25 Sep 2014 13:08:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25840ACA; Thu, 25 Sep 2014 13:08:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PD8W7w064330; Thu, 25 Sep 2014 13:08:32 GMT (envelope-from ray@FreeBSD.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PD8WAn064329; Thu, 25 Sep 2014 13:08:32 GMT (envelope-from ray@FreeBSD.org) Message-Id: <201409251308.s8PD8WAn064329@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ray set sender to ray@FreeBSD.org using -f From: Aleksandr Rybalko Date: Thu, 25 Sep 2014 13:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272104 - stable/10/sys/dev/drm2 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 13:08:32 -0000 Author: ray Date: Thu Sep 25 13:08:31 2014 New Revision: 272104 URL: http://svnweb.freebsd.org/changeset/base/272104 Log: MFC r268981 Remove #ifdef-s to reduce difference to upstream. Pointed by: kib Approved by: re (glebius) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/drm2/drm_fb_helper.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- stable/10/sys/dev/drm2/drm_fb_helper.c Thu Sep 25 11:38:26 2014 (r272103) +++ stable/10/sys/dev/drm2/drm_fb_helper.c Thu Sep 25 13:08:31 2014 (r272104) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__FreeBSD__) #include @@ -76,7 +75,6 @@ vt_kms_postswitch(void *arg) return (0); } -#endif static DRM_LIST_HEAD(kernel_fb_helper_list); @@ -941,10 +939,8 @@ int drm_fb_helper_single_fb_probe(struct struct fb_info *info; struct drm_fb_helper_surface_size sizes; int gamma_size = 0; -#if defined(__FreeBSD__) struct vt_kms_softc *sc; device_t kdev; -#endif memset(&sizes, 0, sizeof(struct drm_fb_helper_surface_size)); sizes.surface_depth = 24; @@ -1021,7 +1017,6 @@ int drm_fb_helper_single_fb_probe(struct if (new_fb < 0) return new_fb; -#if defined(__FreeBSD__) sc = malloc(sizeof(struct vt_kms_softc), DRM_MEM_KMS, M_WAITOK | M_ZERO); sc->fb_helper = fb_helper; @@ -1036,14 +1031,12 @@ int drm_fb_helper_single_fb_probe(struct info->fb_stride = fb_helper->fb->pitches[0]; info->fb_priv = sc; info->enter = &vt_kms_postswitch; -#endif /* set the fb pointer */ for (i = 0; i < fb_helper->crtc_count; i++) { fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; } -#if defined(__FreeBSD__) if (new_fb) { device_t fbd; int ret; @@ -1059,30 +1052,6 @@ int drm_fb_helper_single_fb_probe(struct DRM_ERROR("Failed to attach fbd device: %d\n", ret); #endif } -#else - if (new_fb) { - info->var.pixclock = 0; - if (register_framebuffer(info) < 0) { - return -EINVAL; - } - - printf("fb%d: %s frame buffer device\n", info->node, - info->fix.id); - - } else { - drm_fb_helper_set_par(info); - } - - /* Switch back to kernel console on panic */ - /* multi card linked list maybe */ - if (list_empty(&kernel_fb_helper_list)) { - printf("drm: registered panic notifier\n"); - atomic_notifier_chain_register(&panic_notifier_list, - &paniced); - } - if (new_fb) - list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list); -#endif return 0; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 13:31:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EACAE46E; Thu, 25 Sep 2014 13:31:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5E91D25; Thu, 25 Sep 2014 13:31:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PDV8TR077150; Thu, 25 Sep 2014 13:31:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PDV8da077149; Thu, 25 Sep 2014 13:31:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201409251331.s8PDV8da077149@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 25 Sep 2014 13:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272105 - head/sys/boot/efi/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 13:31:09 -0000 Author: emaste Date: Thu Sep 25 13:31:08 2014 New Revision: 272105 URL: http://svnweb.freebsd.org/changeset/base/272105 Log: Remove duplicated header content I fail at patch(1). MFC after: 3 days Modified: head/sys/boot/efi/include/eficonsctl.h Modified: head/sys/boot/efi/include/eficonsctl.h ============================================================================== --- head/sys/boot/efi/include/eficonsctl.h Thu Sep 25 13:08:31 2014 (r272104) +++ head/sys/boot/efi/include/eficonsctl.h Thu Sep 25 13:31:08 2014 (r272105) @@ -132,122 +132,3 @@ struct _EFI_CONSOLE_CONTROL_PROTOCOL { extern EFI_GUID gEfiConsoleControlProtocolGuid; #endif -/*- - * Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved. - * - * This program and the accompanying materials are licensed and made available - * under the terms and conditions of the BSD License which accompanies this - * distribution. The full text of the license may be found at - * http://opensource.org/licenses/bsd-license.php - * - * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR - * IMPLIED. - * - * Original Module Name: ConsoleControl.h - * Abstract: Abstraction of a Text mode or GOP/UGA screen - */ - -/* $FreeBSD */ - -#ifndef _EFI_CONS_CTL_H -#define _EFI_CONS_CTL_H - -#define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \ - { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} } - -typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL EFI_CONSOLE_CONTROL_PROTOCOL; - - -typedef enum { - EfiConsoleControlScreenText, - EfiConsoleControlScreenGraphics, - EfiConsoleControlScreenMaxValue -} EFI_CONSOLE_CONTROL_SCREEN_MODE; - - -typedef -EFI_STATUS -(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE) ( - IN EFI_CONSOLE_CONTROL_PROTOCOL *This, - OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode, - OUT BOOLEAN *GopUgaExists, OPTIONAL - OUT BOOLEAN *StdInLocked OPTIONAL - ) -/*++ - - Routine Description: - Return the current video mode information. Also returns info about existence - of Graphics Output devices or UGA Draw devices in system, and if the Std In - device is locked. All the arguments are optional and only returned if a non - NULL pointer is passed in. - - Arguments: - This - Protocol instance pointer. - Mode - Are we in text of grahics mode. - GopUgaExists - TRUE if Console Spliter has found a GOP or UGA device - StdInLocked - TRUE if StdIn device is keyboard locked - - Returns: - EFI_SUCCESS - Mode information returned. - ---*/ -; - - -typedef -EFI_STATUS -(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE) ( - IN EFI_CONSOLE_CONTROL_PROTOCOL *This, - IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode - ) -/*++ - - Routine Description: - Set the current mode to either text or graphics. Graphics is - for Quiet Boot. - - Arguments: - This - Protocol instance pointer. - Mode - Mode to set the - - Returns: - EFI_SUCCESS - Mode information returned. - ---*/ -; - - -typedef -EFI_STATUS -(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN) ( - IN EFI_CONSOLE_CONTROL_PROTOCOL *This, - IN CHAR16 *Password - ) -/*++ - - Routine Description: - Lock Std In devices until Password is typed. - - Arguments: - This - Protocol instance pointer. - Password - Password needed to unlock screen. NULL means unlock keyboard - - Returns: - EFI_SUCCESS - Mode information returned. - EFI_DEVICE_ERROR - Std In not locked - ---*/ -; - - - -struct _EFI_CONSOLE_CONTROL_PROTOCOL { - EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE GetMode; - EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE SetMode; - EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN LockStdIn; -}; - -extern EFI_GUID gEfiConsoleControlProtocolGuid; - -#endif From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 14:18:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9E6138A; Thu, 25 Sep 2014 14:18:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4C90301; Thu, 25 Sep 2014 14:18:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PEIZvt097924; Thu, 25 Sep 2014 14:18:35 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PEIZKs097921; Thu, 25 Sep 2014 14:18:35 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201409251418.s8PEIZKs097921@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Thu, 25 Sep 2014 14:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272106 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 14:18:36 -0000 Author: gavin Date: Thu Sep 25 14:18:34 2014 New Revision: 272106 URL: http://svnweb.freebsd.org/changeset/base/272106 Log: Add basic man page for ipheth(4). MFC after: 1 week Added: head/share/man/man4/ipheth.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Sep 25 13:31:08 2014 (r272105) +++ head/share/man/man4/Makefile Thu Sep 25 14:18:34 2014 (r272106) @@ -200,6 +200,7 @@ MAN= aac.4 \ ip.4 \ ip6.4 \ ipfirewall.4 \ + ipheth.4 \ ${_ipmi.4} \ ips.4 \ ipsec.4 \ Added: head/share/man/man4/ipheth.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ipheth.4 Thu Sep 25 14:18:34 2014 (r272106) @@ -0,0 +1,93 @@ +.\" Copyright (c) 2014 Gavin Atkinson +.\" 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. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 25, 2014 +.Dt IPHETH 4 +.Os +.Sh NAME +.Nm ipheth +.Nd "USB Apple iPhone/iPad Ethernet driver" +.Sh SYNOPSIS +To load the driver as a module at boot time, place the +following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_ipheth_load="YES" +.Ed +.Pp +Alternatively, to compile this driver into the kernel, place the +following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device uhci" +.Cd "device ohci" +.Cd "device usb" +.Cd "device ipheth" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for network access through Apple +iPhone and iPad devices, often referred to as USB tethering. +.Pp +.Nm +should work with any Apple iPhone or iPad device. +In most cases this must be explicitly enabled on the device first. +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The following devices are supported by the +.Nm +driver: +.Pp +.Bl -bullet -compact +.It +Apple iPhone (all models) +.It +Apple iPad (all models) +.El +.Sh SEE ALSO +.Xr arp 4 , +.Xr cdce 4 , +.Xr intro 4 , +.Xr netintro 4 , +.Xr urndis 4 , +.Xr usb 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 8.2 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 14:22:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33214644; Thu, 25 Sep 2014 14:22:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CB28608; Thu, 25 Sep 2014 14:22:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PEMWMr001977; Thu, 25 Sep 2014 14:22:32 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PEMWh7001975; Thu, 25 Sep 2014 14:22:32 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201409251422.s8PEMWh7001975@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Thu, 25 Sep 2014 14:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272107 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 14:22:33 -0000 Author: gavin Date: Thu Sep 25 14:22:32 2014 New Revision: 272107 URL: http://svnweb.freebsd.org/changeset/base/272107 Log: Cross reference cdce(4), ipheth(4) and urndis(4) from each other. MFC after: 1 week Modified: head/share/man/man4/cdce.4 head/share/man/man4/urndis.4 Modified: head/share/man/man4/cdce.4 ============================================================================== --- head/share/man/man4/cdce.4 Thu Sep 25 14:18:34 2014 (r272106) +++ head/share/man/man4/cdce.4 Thu Sep 25 14:22:32 2014 (r272107) @@ -28,7 +28,7 @@ .\" $NetBSD: cdce.4,v 1.4 2004/12/08 18:35:56 peter Exp $ .\" $FreeBSD$ .\" -.Dd September 17, 2005 +.Dd September 25, 2014 .Dt CDCE 4 .Os .Sh NAME @@ -114,9 +114,10 @@ is running low on mbufs. .Sh SEE ALSO .Xr arp 4 , .Xr intro 4 , +.Xr ipheth 4 , .Xr netintro 4 , +.Xr urndis 4 , .Xr usb 4 , -.\" .Xr hostname.if 5 , .Xr ifconfig 8 .Rs .%T "Universal Serial Bus Class Definitions for Communication Devices" Modified: head/share/man/man4/urndis.4 ============================================================================== --- head/share/man/man4/urndis.4 Thu Sep 25 14:18:34 2014 (r272106) +++ head/share/man/man4/urndis.4 Thu Sep 25 14:22:32 2014 (r272107) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 21, 2014 +.Dd September 25, 2014 .Dt URNDIS 4 .Os .Sh NAME @@ -70,6 +70,8 @@ For more information on configuring this .Xr ifconfig 8 . .Sh SEE ALSO .Xr arp 4 , +.Xr cdce 4 , +.Xr ipheth 4 , .Xr netintro 4 , .Xr usb 4 , .Xr ifconfig 8 From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 14:25:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C34F870; Thu, 25 Sep 2014 14:25:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17E3563A; Thu, 25 Sep 2014 14:25:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PEPc5J002405; Thu, 25 Sep 2014 14:25:38 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PEPcbI002404; Thu, 25 Sep 2014 14:25:38 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201409251425.s8PEPcbI002404@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Thu, 25 Sep 2014 14:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272108 - head/sys/modules/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 14:25:39 -0000 Author: luigi Date: Thu Sep 25 14:25:38 2014 New Revision: 272108 URL: http://svnweb.freebsd.org/changeset/base/272108 Log: add missing file Submitted by: Daniel Peyrolon MFC after: 3 days Modified: head/sys/modules/netmap/Makefile Modified: head/sys/modules/netmap/Makefile ============================================================================== --- head/sys/modules/netmap/Makefile Thu Sep 25 14:22:32 2014 (r272107) +++ head/sys/modules/netmap/Makefile Thu Sep 25 14:25:38 2014 (r272108) @@ -16,5 +16,6 @@ SRCS += netmap_vale.c SRCS += netmap_freebsd.c SRCS += netmap_offloadings.c SRCS += netmap_pipe.c +SRCS += netmap_monitor.c .include From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 15:02:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EED50826; Thu, 25 Sep 2014 15:02:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D01BCAB1; Thu, 25 Sep 2014 15:02:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PF2aKZ021277; Thu, 25 Sep 2014 15:02:36 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PF2Y5v021266; Thu, 25 Sep 2014 15:02:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409251502.s8PF2Y5v021266@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 25 Sep 2014 15:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272109 - in head/sys: dev/fdt dev/ofw mips/beri powerpc/ofw powerpc/pseries X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 15:02:37 -0000 Author: ian Date: Thu Sep 25 15:02:33 2014 New Revision: 272109 URL: http://svnweb.freebsd.org/changeset/base/272109 Log: Replace multiple nearly-identical copies of code to walk through an FDT node's interrupts=<...> property creating resource list entries with a single common implementation. This change makes ofw_bus_intr_to_rl() the one true copy of that code and removes the copies of it from other places. This also adds handling of the interrupts-extended property, which allows specifying multiple interrupts for a node where each interrupt can have a separate interrupt-parent. The bindings for this state that the property cells contain an xref phandle to the interrupt parent followed by whatever interrupt info that parent normally expects. This leads to having a variable number of icells per interrupt in the property. For example you could have <&intc1 1 &intc2 26 9 0 &intc3 9 4>. Differential Revision: https://reviews.freebsd.org/D803 Modified: head/sys/dev/fdt/fdt_common.c head/sys/dev/fdt/fdt_common.h head/sys/dev/fdt/simplebus.c head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h head/sys/dev/ofw/ofwbus.c head/sys/mips/beri/beri_simplebus.c head/sys/powerpc/ofw/ofw_pcibus.c head/sys/powerpc/pseries/vdevice.c Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Thu Sep 25 14:25:38 2014 (r272108) +++ head/sys/dev/fdt/fdt_common.c Thu Sep 25 15:02:33 2014 (r272109) @@ -494,46 +494,6 @@ out: } int -fdt_intr_to_rl(device_t dev, phandle_t node, struct resource_list *rl, - struct fdt_sense_level *intr_sl) -{ - phandle_t iparent; - uint32_t *intr, icells; - int nintr, i, k; - - nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), - (void **)&intr); - if (nintr > 0) { - if (OF_searchencprop(node, "interrupt-parent", &iparent, - sizeof(iparent)) == -1) { - device_printf(dev, "No interrupt-parent found, " - "assuming direct parent\n"); - iparent = OF_parent(node); - } - if (OF_searchencprop(OF_node_from_xref(iparent), - "#interrupt-cells", &icells, sizeof(icells)) == -1) { - device_printf(dev, "Missing #interrupt-cells property, " - "assuming <1>\n"); - icells = 1; - } - if (icells < 1 || icells > nintr) { - device_printf(dev, "Invalid #interrupt-cells property " - "value <%d>, assuming <1>\n", icells); - icells = 1; - } - for (i = 0, k = 0; i < nintr; i += icells, k++) { - intr[i] = ofw_bus_map_intr(dev, iparent, icells, - &intr[i]); - resource_list_add(rl, SYS_RES_IRQ, k, intr[i], intr[i], - 1); - } - free(intr, M_OFWPROP); - } - - return (0); -} - -int fdt_get_phyaddr(phandle_t node, device_t dev, int *phy_addr, void **phy_sc) { phandle_t phy_node; Modified: head/sys/dev/fdt/fdt_common.h ============================================================================== --- head/sys/dev/fdt/fdt_common.h Thu Sep 25 14:25:38 2014 (r272108) +++ head/sys/dev/fdt/fdt_common.h Thu Sep 25 15:02:33 2014 (r272109) @@ -88,7 +88,6 @@ int fdt_get_phyaddr(phandle_t, device_t, int fdt_get_range(phandle_t, int, u_long *, u_long *); int fdt_immr_addr(vm_offset_t); int fdt_regsize(phandle_t, u_long *, u_long *); -int fdt_intr_to_rl(device_t, phandle_t, struct resource_list *, struct fdt_sense_level *); int fdt_is_compatible(phandle_t, const char *); int fdt_is_compatible_strict(phandle_t, const char *); int fdt_is_enabled(phandle_t); Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Thu Sep 25 14:25:38 2014 (r272108) +++ head/sys/dev/fdt/simplebus.c Thu Sep 25 15:02:33 2014 (r272109) @@ -247,11 +247,9 @@ simplebus_setup_dinfo(device_t dev, phan { struct simplebus_softc *sc; struct simplebus_devinfo *ndi; - uint32_t *reg, *intr, icells; + uint32_t *reg; uint64_t phys, size; - phandle_t iparent; int i, j, k; - int nintr; int nreg; sc = device_get_softc(dev); @@ -289,34 +287,7 @@ simplebus_setup_dinfo(device_t dev, phan } free(reg, M_OFWPROP); - nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), - (void **)&intr); - if (nintr > 0) { - if (OF_searchencprop(node, "interrupt-parent", &iparent, - sizeof(iparent)) == -1) { - device_printf(dev, "No interrupt-parent found, " - "assuming direct parent\n"); - iparent = OF_parent(node); - } - if (OF_searchencprop(OF_node_from_xref(iparent), - "#interrupt-cells", &icells, sizeof(icells)) == -1) { - device_printf(dev, "Missing #interrupt-cells property, " - "assuming <1>\n"); - icells = 1; - } - if (icells < 1 || icells > nintr) { - device_printf(dev, "Invalid #interrupt-cells property " - "value <%d>, assuming <1>\n", icells); - icells = 1; - } - for (i = 0, k = 0; i < nintr; i += icells, k++) { - intr[i] = ofw_bus_map_intr(dev, iparent, icells, - &intr[i]); - resource_list_add(&ndi->rl, SYS_RES_IRQ, k, intr[i], - intr[i], 1); - } - free(intr, M_OFWPROP); - } + ofw_bus_intr_to_rl(dev, node, &ndi->rl); return (ndi); } Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Thu Sep 25 14:25:38 2014 (r272108) +++ head/sys/dev/ofw/ofw_bus_subr.c Thu Sep 25 15:02:33 2014 (r272109) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -367,3 +369,64 @@ ofw_bus_search_intrmap(void *intr, int i return (0); } +int +ofw_bus_intr_to_rl(device_t dev, phandle_t node, struct resource_list *rl) +{ + phandle_t iparent; + uint32_t icells, *intr; + int err, i, irqnum, nintr, rid; + boolean_t extended; + + nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), + (void **)&intr); + if (nintr > 0) { + if (OF_searchencprop(node, "interrupt-parent", &iparent, + sizeof(iparent)) == -1) { + device_printf(dev, "No interrupt-parent found, " + "assuming direct parent\n"); + iparent = OF_parent(node); + } + if (OF_searchencprop(OF_node_from_xref(iparent), + "#interrupt-cells", &icells, sizeof(icells)) == -1) { + device_printf(dev, "Missing #interrupt-cells " + "property, assuming <1>\n"); + icells = 1; + } + if (icells < 1 || icells > nintr) { + device_printf(dev, "Invalid #interrupt-cells property " + "value <%d>, assuming <1>\n", icells); + icells = 1; + } + extended = false; + } else { + nintr = OF_getencprop_alloc(node, "interrupts-extended", + sizeof(*intr), (void **)&intr); + if (nintr <= 0) + return (0); + extended = true; + } + err = 0; + rid = 0; + for (i = 0; i < nintr; i += icells) { + if (extended) { + iparent = intr[i++]; + if (OF_searchencprop(OF_node_from_xref(iparent), + "#interrupt-cells", &icells, sizeof(icells)) == -1) { + device_printf(dev, "Missing #interrupt-cells " + "property\n"); + err = ENOENT; + break; + } + if (icells < 1 || (i + icells) > nintr) { + device_printf(dev, "Invalid #interrupt-cells " + "property value <%d>\n", icells); + err = ERANGE; + break; + } + } + irqnum = ofw_bus_map_intr(dev, iparent, icells, &intr[i]); + resource_list_add(rl, SYS_RES_IRQ, rid++, irqnum, irqnum, 1); + } + free(intr, M_OFWPROP); + return (err); +} Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Thu Sep 25 14:25:38 2014 (r272108) +++ head/sys/dev/ofw/ofw_bus_subr.h Thu Sep 25 15:02:33 2014 (r272109) @@ -72,6 +72,9 @@ int ofw_bus_lookup_imap(phandle_t, struc int ofw_bus_search_intrmap(void *, int, void *, int, void *, int, void *, void *, void *, int, phandle_t *); +/* Routines for parsing device-tree data into resource lists. */ +int ofw_bus_intr_to_rl(device_t, phandle_t, struct resource_list *); + /* Helper to get device status property */ const char *ofw_bus_get_status(device_t dev); int ofw_bus_status_okay(device_t dev); Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Thu Sep 25 14:25:38 2014 (r272108) +++ head/sys/dev/ofw/ofwbus.c Thu Sep 25 15:02:33 2014 (r272109) @@ -436,11 +436,9 @@ ofwbus_setup_dinfo(device_t dev, phandle struct ofwbus_softc *sc; struct ofwbus_devinfo *ndi; const char *nodename; - uint32_t *reg, *intr, icells; + uint32_t *reg; uint64_t phys, size; - phandle_t iparent; int i, j, rid; - int nintr; int nreg; sc = device_get_softc(dev); @@ -485,35 +483,7 @@ ofwbus_setup_dinfo(device_t dev, phandle } free(reg, M_OFWPROP); - nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), - (void **)&intr); - if (nintr > 0) { - if (OF_searchencprop(node, "interrupt-parent", &iparent, - sizeof(iparent)) == -1) { - device_printf(dev, "No interrupt-parent found, " - "assuming nexus on <%s>\n", nodename); - iparent = 0xffffffff; - } - if (OF_searchencprop(OF_node_from_xref(iparent), - "#interrupt-cells", &icells, sizeof(icells)) == -1) { - device_printf(dev, "Missing #interrupt-cells property, " - "assuming <1> on <%s>\n", nodename); - icells = 1; - } - if (icells < 1 || icells > nintr) { - device_printf(dev, "Invalid #interrupt-cells property " - "value <%d>, assuming <1> on <%s>\n", icells, - nodename); - icells = 1; - } - for (i = 0, rid = 0; i < nintr; i += icells, rid++) { - intr[i] = ofw_bus_map_intr(dev, iparent, icells, - &intr[i]); - resource_list_add(&ndi->ndi_rl, SYS_RES_IRQ, rid, intr[i], - intr[i], 1); - } - free(intr, M_OFWPROP); - } + ofw_bus_intr_to_rl(dev, node, &ndi->ndi_rl); return (ndi); } Modified: head/sys/mips/beri/beri_simplebus.c ============================================================================== --- head/sys/mips/beri/beri_simplebus.c Thu Sep 25 14:25:38 2014 (r272108) +++ head/sys/mips/beri/beri_simplebus.c Thu Sep 25 15:02:33 2014 (r272109) @@ -198,7 +198,7 @@ simplebus_attach(device_t dev) continue; } - if (fdt_intr_to_rl(dev, dt_child, &di->di_res, di->di_intr_sl)) { + if (ofw_bus_intr_to_rl(dev, dt_child, &di->di_res)) { device_printf(dev, "%s: could not process " "'interrupts' property\n", di->di_ofw.obd_name); resource_list_free(&di->di_res); Modified: head/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcibus.c Thu Sep 25 14:25:38 2014 (r272108) +++ head/sys/powerpc/ofw/ofw_pcibus.c Thu Sep 25 15:02:33 2014 (r272109) @@ -200,29 +200,8 @@ ofw_pcibus_enum_devtree(device_t dev, u_ * interrupts property, so add that value to the device's * resource list. */ - if (dinfo->opd_dinfo.cfg.intpin == 0) { - ofw_pci_intr_t intr[2]; - phandle_t iparent; - int icells; - - if (OF_getprop(child, "interrupts", &intr, - sizeof(intr)) > 0) { - iparent = 0; - icells = 1; - OF_getprop(child, "interrupt-parent", &iparent, - sizeof(iparent)); - if (iparent != 0) { - OF_getprop(OF_node_from_xref(iparent), - "#interrupt-cells", &icells, - sizeof(icells)); - intr[0] = ofw_bus_map_intr(dev, iparent, - icells, intr); - } - - resource_list_add(&dinfo->opd_dinfo.resources, - SYS_RES_IRQ, 0, intr[0], intr[0], 1); - } - } + if (dinfo->opd_dinfo.cfg.intpin == 0) + ofw_bus_intr_to_rl(dev, node, &dinfo->opd_dinfo.resources); } } Modified: head/sys/powerpc/pseries/vdevice.c ============================================================================== --- head/sys/powerpc/pseries/vdevice.c Thu Sep 25 14:25:38 2014 (r272108) +++ head/sys/powerpc/pseries/vdevice.c Thu Sep 25 15:02:33 2014 (r272109) @@ -128,8 +128,6 @@ vdevice_attach(device_t dev) { phandle_t root, child; device_t cdev; - int icells, i, nintr, *intr; - phandle_t iparent; struct vdevice_devinfo *dinfo; root = ofw_bus_get_node(dev); @@ -144,25 +142,7 @@ vdevice_attach(device_t dev) } resource_list_init(&dinfo->mdi_resources); - if (OF_searchprop(child, "#interrupt-cells", &icells, - sizeof(icells)) <= 0) - icells = 2; - if (OF_getprop(child, "interrupt-parent", &iparent, - sizeof(iparent)) <= 0) - iparent = -1; - nintr = OF_getprop_alloc(child, "interrupts", sizeof(*intr), - (void **)&intr); - if (nintr > 0) { - for (i = 0; i < nintr; i += icells) { - u_int irq = intr[i]; - if (iparent != -1) - irq = ofw_bus_map_intr(dev, iparent, - icells, &intr[i]); - - resource_list_add(&dinfo->mdi_resources, - SYS_RES_IRQ, i, irq, irq, i); - } - } + ofw_bus_intr_to_rl(dev, child, &dinfo->mdi_resources); cdev = device_add_child(dev, NULL, -1); if (cdev == NULL) { From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 15:57:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49865F28; Thu, 25 Sep 2014 15:57:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34E81114; Thu, 25 Sep 2014 15:57:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PFvwHJ046924; Thu, 25 Sep 2014 15:57:58 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PFvwvr046923; Thu, 25 Sep 2014 15:57:58 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201409251557.s8PFvwvr046923@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Thu, 25 Sep 2014 15:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272110 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 15:57:58 -0000 Author: luigi Date: Thu Sep 25 15:57:57 2014 New Revision: 272110 URL: http://svnweb.freebsd.org/changeset/base/272110 Log: adapt the code to different freebsd versions. Not necessary to MFC Modified: head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Thu Sep 25 15:02:33 2014 (r272109) +++ head/sys/dev/netmap/netmap_kern.h Thu Sep 25 15:57:57 2014 (r272110) @@ -63,6 +63,12 @@ #define NM_ATOMIC_TEST_AND_SET(p) (!atomic_cmpset_acq_int((p), 0, 1)) #define NM_ATOMIC_CLEAR(p) atomic_store_rel_int((p), 0) +#if __FreeBSD_version >= 1100030 +#define WNA(_ifp) (_ifp)->if_netmap +#else /* older FreeBSD */ +#define WNA(_ifp) (_ifp)->if_pspare[0] +#endif /* older FreeBSD */ + #if __FreeBSD_version >= 1100005 struct netmap_adapter *netmap_getna(if_t ifp); #endif @@ -1186,9 +1192,6 @@ extern int netmap_generic_rings; * NA returns a pointer to the struct netmap adapter from the ifp, * WNA is used to write it. */ -#ifndef WNA -#define WNA(_ifp) (_ifp)->if_netmap -#endif #define NA(_ifp) ((struct netmap_adapter *)WNA(_ifp)) /* From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 16:22:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F62BF92; Thu, 25 Sep 2014 16:22:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AC7CAC7; Thu, 25 Sep 2014 16:22:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PGMX6W061071; Thu, 25 Sep 2014 16:22:33 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PGMXgM061070; Thu, 25 Sep 2014 16:22:33 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201409251622.s8PGMXgM061070@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Thu, 25 Sep 2014 16:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272111 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 16:22:33 -0000 Author: luigi Date: Thu Sep 25 16:22:32 2014 New Revision: 272111 URL: http://svnweb.freebsd.org/changeset/base/272111 Log: fix a panic when passing ifioctl from a netmap file descriptor to the underlying device. This needs to be merged to 10.1 Reported by: Patrick Kelsey MFC after: 3 days Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Thu Sep 25 15:57:57 2014 (r272110) +++ head/sys/dev/netmap/netmap.c Thu Sep 25 16:22:32 2014 (r272111) @@ -2222,23 +2222,18 @@ netmap_ioctl(struct cdev *dev, u_long cm default: /* allow device-specific ioctls */ { - struct socket so; - struct ifnet *ifp; - - bzero(&so, sizeof(so)); - NMG_LOCK(); - error = netmap_get_na(nmr, &na, 0 /* don't create */); /* keep reference */ - if (error) { - netmap_adapter_put(na); - NMG_UNLOCK(); - break; + struct ifnet *ifp = ifunit_ref(nmr->nr_name); + if (ifp == NULL) { + error = ENXIO; + } else { + struct socket so; + + bzero(&so, sizeof(so)); + so.so_vnet = ifp->if_vnet; + // so->so_proto not null. + error = ifioctl(&so, cmd, data, td); + if_rele(ifp); } - ifp = na->ifp; - so.so_vnet = ifp->if_vnet; - // so->so_proto not null. - error = ifioctl(&so, cmd, data, td); - netmap_adapter_put(na); - NMG_UNLOCK(); break; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 16:48:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53C96310; Thu, 25 Sep 2014 16:48:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E7A8D1F; Thu, 25 Sep 2014 16:48:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PGmKW0071709; Thu, 25 Sep 2014 16:48:20 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PGmKnq071708; Thu, 25 Sep 2014 16:48:20 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409251648.s8PGmKnq071708@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 25 Sep 2014 16:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272113 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 16:48:20 -0000 Author: gjb Date: Thu Sep 25 16:48:19 2014 New Revision: 272113 URL: http://svnweb.freebsd.org/changeset/base/272113 Log: Document r271880, serial and null console support added to UEFI boot loader. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Sep 25 16:35:19 2014 (r272112) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Sep 25 16:48:19 2014 (r272113) @@ -454,6 +454,10 @@ + Serial console and null console + support has been added to the UEFI boot + loader. + Support has been added to cache &man.geli.8; passphrases during system boot. When a system is configured with multiple GEOM_ELI From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 16:48:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2CE34C4; Thu, 25 Sep 2014 16:48:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD425D21; Thu, 25 Sep 2014 16:48:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PGmOX4071803; Thu, 25 Sep 2014 16:48:24 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PGmO2I071802; Thu, 25 Sep 2014 16:48:24 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409251648.s8PGmO2I071802@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 25 Sep 2014 16:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272115 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 16:48:24 -0000 Author: gjb Date: Thu Sep 25 16:48:23 2014 New Revision: 272115 URL: http://svnweb.freebsd.org/changeset/base/272115 Log: Document r271947, OpenPAM updated to Ourouparia (20140912). Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Sep 25 16:48:21 2014 (r272114) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Sep 25 16:48:23 2014 (r272115) @@ -1423,6 +1423,9 @@ The timezone database has been updated to version tzdata2014f. + + OpenPAM has + been updated to Ourouparia (20140912). From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 16:48:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9581D3E8; Thu, 25 Sep 2014 16:48:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E27BD20; Thu, 25 Sep 2014 16:48:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PGmM1b071756; Thu, 25 Sep 2014 16:48:22 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PGmMJa071755; Thu, 25 Sep 2014 16:48:22 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409251648.s8PGmMJa071755@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 25 Sep 2014 16:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272114 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 16:48:22 -0000 Author: gjb Date: Thu Sep 25 16:48:21 2014 New Revision: 272114 URL: http://svnweb.freebsd.org/changeset/base/272114 Log: Document r271943, Latest/pkg.txz symlink included on the DVD to make bootstrapping pkg(8) easier. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Sep 25 16:48:19 2014 (r272113) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Sep 25 16:48:21 2014 (r272114) @@ -1446,6 +1446,19 @@ been updated to produce UEFI-capable and BIOS-capable CD-ROM ISOs as well as memory stick images for the &os;/&arch.amd64; architecture. + + The + release/scripts/pkg-stage.sh script has + been updated to include a symlink to the on-disc version of + &man.pkg.8; in the packages/ structure on the + DVD installer. This allows the &man.pkg.7; bootstrap utility + to properly locate the Latest/pkg.txz + file on the DVD when REPOS_DIR is set to + /dist/packages/repos, + eliminating the need for a network connection or explicitly + providing the path to the version included on the DVD + installation medium. From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 16:35:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3CE1DA3; Thu, 25 Sep 2014 16:35:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AED9FBDD; Thu, 25 Sep 2014 16:35:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PGZJkj066392; Thu, 25 Sep 2014 16:35:19 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PGZJ6w066391; Thu, 25 Sep 2014 16:35:19 GMT (envelope-from se@FreeBSD.org) Message-Id: <201409251635.s8PGZJ6w066391@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Thu, 25 Sep 2014 16:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272112 - stable/10/etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 16:35:19 -0000 Author: se Date: Thu Sep 25 16:35:19 2014 New Revision: 272112 URL: http://svnweb.freebsd.org/changeset/base/272112 Log: MFC r271958: Permit use of "no" as specification of a Norwegian keymap file. Only "keymap=NO" (the default in defaults/rc.conf) or "keymap=" (an empty value) will prevent loading of a keymap file. Approved by: re (gjb) Modified: stable/10/etc/rc.d/syscons Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/syscons ============================================================================== --- stable/10/etc/rc.d/syscons Thu Sep 25 16:22:32 2014 (r272111) +++ stable/10/etc/rc.d/syscons Thu Sep 25 16:35:19 2014 (r272112) @@ -167,7 +167,7 @@ syscons_configure_keyboard() # keymap # case ${keymap} in - [Nn][Oo] | '') + NO | '') ;; *) sc_init From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 17:28:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4FA49A9D; Thu, 25 Sep 2014 17:28:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A323222; Thu, 25 Sep 2014 17:28:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PHSUIW091693; Thu, 25 Sep 2014 17:28:30 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PHSU0W091692; Thu, 25 Sep 2014 17:28:30 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409251728.s8PHSU0W091692@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 25 Sep 2014 17:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272116 - stable/10/sys/fs/autofs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 17:28:30 -0000 Author: trasz Date: Thu Sep 25 17:28:29 2014 New Revision: 272116 URL: http://svnweb.freebsd.org/changeset/base/272116 Log: MFC r272025: Fix thinko that, with two map entries like shown below, in that order, made autofs mix them up: the second one wasn't visible in ls(1) output, and trying to access it would trigger mount for the first one. foobar host:/foobar foo host:/foo Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs_vnops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vnops.c Thu Sep 25 16:48:23 2014 (r272115) +++ stable/10/sys/fs/autofs/autofs_vnops.c Thu Sep 25 17:28:29 2014 (r272116) @@ -544,6 +544,8 @@ autofs_node_find(struct autofs_node *par TAILQ_FOREACH(anp, &parent->an_children, an_next) { if (namelen >= 0) { + if (strlen(anp->an_name) != namelen) + continue; if (strncmp(anp->an_name, name, namelen) != 0) continue; } else { From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 17:38:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D041DCE6; Thu, 25 Sep 2014 17:38:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA6A0360; Thu, 25 Sep 2014 17:38:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PHchwe096425; Thu, 25 Sep 2014 17:38:43 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PHchWD096424; Thu, 25 Sep 2014 17:38:43 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409251738.s8PHchWD096424@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 25 Sep 2014 17:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272117 - stable/10/usr.sbin/autofs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 17:38:43 -0000 Author: trasz Date: Thu Sep 25 17:38:42 2014 New Revision: 272117 URL: http://svnweb.freebsd.org/changeset/base/272117 Log: MFC r272037: Fix thinko that, with two map entries like shown below, in that order, made automountd(8) mix them up: trying to access the second one would trigger mount for the first one. foo host:/foo foobar host:/foobar PR: 193584 Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/autofs/common.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/common.c ============================================================================== --- stable/10/usr.sbin/autofs/common.c Thu Sep 25 17:28:29 2014 (r272116) +++ stable/10/usr.sbin/autofs/common.c Thu Sep 25 17:38:42 2014 (r272117) @@ -673,11 +673,21 @@ node_find(struct node *node, const char { struct node *child, *found; char *tmp; + size_t tmplen; //log_debugx("looking up %s in %s", path, node->n_key); tmp = node_path(node); - if (strncmp(tmp, path, strlen(tmp)) != 0) { + tmplen = strlen(tmp); + if (strncmp(tmp, path, tmplen) != 0) { + free(tmp); + return (NULL); + } + if (path[tmplen] != '/' && path[tmplen] != '\0') { + /* + * If we have two map entries like 'foo' and 'foobar', make + * sure the search for 'foobar' won't match 'foo' instead. + */ free(tmp); return (NULL); } From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 17:47:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 522FCD6; Thu, 25 Sep 2014 17:47:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C1DB759; Thu, 25 Sep 2014 17:47:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PHlROY001112; Thu, 25 Sep 2014 17:47:27 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PHlRZ5001111; Thu, 25 Sep 2014 17:47:27 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409251747.s8PHlRZ5001111@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 25 Sep 2014 17:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272118 - stable/10/contrib/smbfs/mount_smbfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 17:47:27 -0000 Author: trasz Date: Thu Sep 25 17:47:26 2014 New Revision: 272118 URL: http://svnweb.freebsd.org/changeset/base/272118 Log: MFC r271258: Make mount_smbfs(8) preserve the "automounted" mount flag. The issue here is that we have to pass this flag as a string, in iov, because it doesn't fit in mntflags, which is an int. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: stable/10/contrib/smbfs/mount_smbfs/mount_smbfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/smbfs/mount_smbfs/mount_smbfs.c ============================================================================== --- stable/10/contrib/smbfs/mount_smbfs/mount_smbfs.c Thu Sep 25 17:38:42 2014 (r272117) +++ stable/10/contrib/smbfs/mount_smbfs/mount_smbfs.c Thu Sep 25 17:47:26 2014 (r272118) @@ -81,7 +81,7 @@ main(int argc, char *argv[]) #else struct xvfsconf vfc; #endif - char *next; + char *next, *p, *val; int opt, error, mntflags, caseopt, fd; uid_t uid; gid_t gid; @@ -194,6 +194,13 @@ main(int argc, char *argv[]) }; case 'o': getmntopts(optarg, mopts, &mntflags, 0); + p = strchr(optarg, '='); + val = NULL; + if (p != NULL) { + *p = '\0'; + val = p + 1; + } + build_iovec(&iov, &iovlen, optarg, val, (size_t)-1); break; case 'c': switch (optarg[0]) { From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 17:59:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C172428; Thu, 25 Sep 2014 17:59:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3613387B; Thu, 25 Sep 2014 17:59:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PHx1iH005970; Thu, 25 Sep 2014 17:59:01 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PHx1Mk005968; Thu, 25 Sep 2014 17:59:01 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201409251759.s8PHx1Mk005968@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 25 Sep 2014 17:59:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272119 - stable/10/contrib/smbfs/lib/smb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 17:59:01 -0000 Author: trasz Date: Thu Sep 25 17:59:00 2014 New Revision: 272119 URL: http://svnweb.freebsd.org/changeset/base/272119 Log: MFC r271259: Make it possible to use empty user name ("-U ''") for mount_smbfs(8). It's just like "-U guest", except that it actually works, at least with Samba 4, which seems to return authentication failure for "-U guest". Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: stable/10/contrib/smbfs/lib/smb/ctx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/smbfs/lib/smb/ctx.c ============================================================================== --- stable/10/contrib/smbfs/lib/smb/ctx.c Thu Sep 25 17:47:26 2014 (r272118) +++ stable/10/contrib/smbfs/lib/smb/ctx.c Thu Sep 25 17:59:00 2014 (r272119) @@ -191,10 +191,6 @@ smb_ctx_parseunc(struct smb_ctx *ctx, co smb_error("no user name required", 0); return EINVAL; } - if (*p1 == 0) { - smb_error("empty user name", 0); - return EINVAL; - } error = smb_ctx_setuser(ctx, tmp); if (error) return error; @@ -521,11 +517,6 @@ smb_ctx_resolve(struct smb_ctx *ctx) smb_error("no server name specified", 0); return EINVAL; } - if (ssn->ioc_user[0] == 0) { - smb_error("no user name specified for server %s", - 0, ssn->ioc_srvname); - return EINVAL; - } if (ctx->ct_minlevel >= SMBL_SHARE && sh->ioc_share[0] == 0) { smb_error("no share name specified for %s@%s", 0, ssn->ioc_user, ssn->ioc_srvname); From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 18:03:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D2C26C6; Thu, 25 Sep 2014 18:03:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CA34946; Thu, 25 Sep 2014 18:03:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PI3Fth010105; Thu, 25 Sep 2014 18:03:15 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PI3E5D010096; Thu, 25 Sep 2014 18:03:14 GMT (envelope-from br@FreeBSD.org) Message-Id: <201409251803.s8PI3E5D010096@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 25 Sep 2014 18:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272120 - in head/sys: arm/altera/socfpga arm/conf boot/fdt/dts/arm dev/dwc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 18:03:16 -0000 Author: br Date: Thu Sep 25 18:03:14 2014 New Revision: 272120 URL: http://svnweb.freebsd.org/changeset/base/272120 Log: Add driver for Synopsys DesignWare 3504-0 Universal 10/100/1000 Ethernet MAC. Sponsored by: DARPA, AFRL Added: head/sys/dev/dwc/ head/sys/dev/dwc/if_dwc.c (contents, props changed) head/sys/dev/dwc/if_dwc.h (contents, props changed) Modified: head/sys/arm/altera/socfpga/files.socfpga head/sys/arm/conf/SOCKIT head/sys/boot/fdt/dts/arm/socfpga-sockit.dts head/sys/boot/fdt/dts/arm/socfpga.dtsi Modified: head/sys/arm/altera/socfpga/files.socfpga ============================================================================== --- head/sys/arm/altera/socfpga/files.socfpga Thu Sep 25 17:59:00 2014 (r272119) +++ head/sys/arm/altera/socfpga/files.socfpga Thu Sep 25 18:03:14 2014 (r272120) @@ -17,3 +17,5 @@ arm/altera/socfpga/socfpga_common.c sta arm/altera/socfpga/socfpga_machdep.c standard arm/altera/socfpga/socfpga_manager.c standard arm/altera/socfpga/socfpga_rstmgr.c standard + +dev/dwc/if_dwc.c optional dwc Modified: head/sys/arm/conf/SOCKIT ============================================================================== --- head/sys/arm/conf/SOCKIT Thu Sep 25 17:59:00 2014 (r272119) +++ head/sys/arm/conf/SOCKIT Thu Sep 25 18:03:14 2014 (r272120) @@ -124,6 +124,7 @@ device ether device mii device smsc device smscphy +device dwc # USB ethernet support, requires miibus device miibus Modified: head/sys/boot/fdt/dts/arm/socfpga-sockit.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/socfpga-sockit.dts Thu Sep 25 17:59:00 2014 (r272119) +++ head/sys/boot/fdt/dts/arm/socfpga-sockit.dts Thu Sep 25 18:03:14 2014 (r272120) @@ -51,6 +51,10 @@ usb1: usb@ffb40000 { status = "okay"; }; + + gmac1: ethernet@ff702000 { + status = "okay"; + }; }; chosen { Modified: head/sys/boot/fdt/dts/arm/socfpga.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/socfpga.dtsi Thu Sep 25 17:59:00 2014 (r272119) +++ head/sys/boot/fdt/dts/arm/socfpga.dtsi Thu Sep 25 18:03:14 2014 (r272120) @@ -71,6 +71,11 @@ interrupt-parent = < &GIC >; }; + sysmgr: sysmgr@ffd08000 { + compatible = "altr,sys-mgr"; + reg = <0xffd08000 0x1000>; + }; + rstmgr: rstmgr@ffd05000 { compatible = "altr,rst-mgr"; reg = <0xffd05000 0x1000>; @@ -127,5 +132,25 @@ dr_mode = "host"; status = "disabled"; }; + + gmac0: ethernet@ff700000 { + compatible = "altr,socfpga-stmmac", + "snps,dwmac-3.70a", "snps,dwmac"; + reg = <0xff700000 0x2000>; + interrupts = <147>; + interrupt-parent = <&GIC>; + phy-mode = "rgmii"; + status = "disabled"; + }; + + gmac1: ethernet@ff702000 { + compatible = "altr,socfpga-stmmac", + "snps,dwmac-3.70a", "snps,dwmac"; + reg = <0xff702000 0x2000>; + interrupts = <152>; + interrupt-parent = <&GIC>; + phy-mode = "rgmii"; + status = "disabled"; + }; }; }; Added: head/sys/dev/dwc/if_dwc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/dwc/if_dwc.c Thu Sep 25 18:03:14 2014 (r272120) @@ -0,0 +1,1324 @@ +/*- + * Copyright (c) 2014 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Ethernet media access controller (EMAC) + * Chapter 17, Altera Cyclone V Device Handbook (CV-5V2 2014.07.22) + * + * EMAC is an instance of the Synopsys DesignWare 3504-0 + * Universal 10/100/1000 Ethernet MAC (DWC_gmac). + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include "miibus_if.h" + +#define READ4(_sc, _reg) \ + bus_read_4((_sc)->res[0], _reg) +#define WRITE4(_sc, _reg, _val) \ + bus_write_4((_sc)->res[0], _reg, _val) + +#define WATCHDOG_TIMEOUT_SECS 5 +#define STATS_HARVEST_INTERVAL 2 +#define MII_CLK_VAL 2 + +#include + +#define DWC_LOCK(sc) mtx_lock(&(sc)->mtx) +#define DWC_UNLOCK(sc) mtx_unlock(&(sc)->mtx) +#define DWC_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED); +#define DWC_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED); + +#define DDESC_TDES0_OWN (1 << 31) +#define DDESC_TDES0_TXINT (1 << 30) +#define DDESC_TDES0_TXLAST (1 << 29) +#define DDESC_TDES0_TXFIRST (1 << 28) +#define DDESC_TDES0_TXCRCDIS (1 << 27) +#define DDESC_TDES0_TXRINGEND (1 << 21) +#define DDESC_TDES0_TXCHAIN (1 << 20) + +#define DDESC_RDES0_OWN (1 << 31) +#define DDESC_RDES0_FL_MASK 0x3fff +#define DDESC_RDES0_FL_SHIFT 16 /* Frame Length */ +#define DDESC_RDES1_CHAINED (1 << 14) + +struct dwc_bufmap { + bus_dmamap_t map; + struct mbuf *mbuf; +}; + +/* + * A hardware buffer descriptor. Rx and Tx buffers have the same descriptor + * layout, but the bits in the flags field have different meanings. + */ +struct dwc_hwdesc +{ + uint32_t tdes0; + uint32_t tdes1; + uint32_t addr; /* pointer to buffer data */ + uint32_t addr_next; /* link to next descriptor */ +}; + +/* + * Driver data and defines. + */ +#define RX_DESC_COUNT 1024 +#define RX_DESC_SIZE (sizeof(struct dwc_hwdesc) * RX_DESC_COUNT) +#define TX_DESC_COUNT 1024 +#define TX_DESC_SIZE (sizeof(struct dwc_hwdesc) * TX_DESC_COUNT) + +/* + * The hardware imposes alignment restrictions on various objects involved in + * DMA transfers. These values are expressed in bytes (not bits). + */ +#define DWC_DESC_RING_ALIGN 2048 + +struct dwc_softc { + struct resource *res[2]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + device_t dev; + int mii_clk; + device_t miibus; + struct mii_data * mii_softc; + struct ifnet *ifp; + int if_flags; + struct mtx mtx; + void * intr_cookie; + struct callout dwc_callout; + uint8_t phy_conn_type; + uint8_t mactype; + boolean_t link_is_up; + boolean_t is_attached; + boolean_t is_detaching; + int tx_watchdog_count; + int stats_harvest_count; + + /* RX */ + bus_dma_tag_t rxdesc_tag; + bus_dmamap_t rxdesc_map; + struct dwc_hwdesc *rxdesc_ring; + bus_addr_t rxdesc_ring_paddr; + bus_dma_tag_t rxbuf_tag; + struct dwc_bufmap rxbuf_map[RX_DESC_COUNT]; + uint32_t rx_idx; + + /* TX */ + bus_dma_tag_t txdesc_tag; + bus_dmamap_t txdesc_map; + struct dwc_hwdesc *txdesc_ring; + bus_addr_t txdesc_ring_paddr; + bus_dma_tag_t txbuf_tag; + struct dwc_bufmap txbuf_map[RX_DESC_COUNT]; + uint32_t tx_idx_head; + uint32_t tx_idx_tail; + int txcount; +}; + +static struct resource_spec dwc_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static void dwc_txfinish_locked(struct dwc_softc *sc); +static void dwc_rxfinish_locked(struct dwc_softc *sc); +static void dwc_stop_locked(struct dwc_softc *sc); +static void dwc_setup_rxfilter(struct dwc_softc *sc); + +static inline uint32_t +next_rxidx(struct dwc_softc *sc, uint32_t curidx) +{ + + return ((curidx + 1) % RX_DESC_COUNT); +} + +static inline uint32_t +next_txidx(struct dwc_softc *sc, uint32_t curidx) +{ + + return ((curidx + 1) % TX_DESC_COUNT); +} + +static void +dwc_get1paddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + + if (error != 0) + return; + *(bus_addr_t *)arg = segs[0].ds_addr; +} + +inline static uint32_t +dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_addr_t paddr, + uint32_t len) +{ + uint32_t flags; + uint32_t nidx; + + nidx = next_txidx(sc, idx); + + /* Addr/len 0 means we're clearing the descriptor after xmit done. */ + if (paddr == 0 || len == 0) { + flags = 0; + --sc->txcount; + } else { + flags = DDESC_TDES0_TXCHAIN | DDESC_TDES0_TXFIRST + | DDESC_TDES0_TXLAST | DDESC_TDES0_TXINT; + ++sc->txcount; + } + + sc->txdesc_ring[idx].addr = (uint32_t)(paddr); + sc->txdesc_ring[idx].tdes0 = flags; + sc->txdesc_ring[idx].tdes1 = len; + + if (paddr && len) { + wmb(); + sc->txdesc_ring[idx].tdes0 |= DDESC_TDES0_OWN; + wmb(); + } + + return (nidx); +} + +static int +dwc_setup_txbuf(struct dwc_softc *sc, int idx, struct mbuf **mp) +{ + struct bus_dma_segment seg; + int error, nsegs; + struct mbuf * m; + + if ((m = m_defrag(*mp, M_NOWAIT)) == NULL) + return (ENOMEM); + *mp = m; + + error = bus_dmamap_load_mbuf_sg(sc->txbuf_tag, sc->txbuf_map[idx].map, + m, &seg, &nsegs, 0); + if (error != 0) { + return (ENOMEM); + } + + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + bus_dmamap_sync(sc->txbuf_tag, sc->txbuf_map[idx].map, + BUS_DMASYNC_PREWRITE); + + sc->txbuf_map[idx].mbuf = m; + + dwc_setup_txdesc(sc, idx, seg.ds_addr, seg.ds_len); + + return (0); +} + +static void +dwc_txstart_locked(struct dwc_softc *sc) +{ + struct ifnet *ifp; + struct mbuf *m; + int enqueued; + + DWC_ASSERT_LOCKED(sc); + + if (!sc->link_is_up) + return; + + ifp = sc->ifp; + + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { + return; + } + + enqueued = 0; + + for (;;) { + if (sc->txcount == (TX_DESC_COUNT-1)) { + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + break; + } + + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) + break; + if (dwc_setup_txbuf(sc, sc->tx_idx_head, &m) != 0) { + IFQ_DRV_PREPEND(&ifp->if_snd, m); + break; + } + BPF_MTAP(ifp, m); + sc->tx_idx_head = next_txidx(sc, sc->tx_idx_head); + ++enqueued; + } + + if (enqueued != 0) { + WRITE4(sc, TRANSMIT_POLL_DEMAND, 0x1); + sc->tx_watchdog_count = WATCHDOG_TIMEOUT_SECS; + } +} + +static void +dwc_txstart(struct ifnet *ifp) +{ + struct dwc_softc *sc = ifp->if_softc; + + DWC_LOCK(sc); + dwc_txstart_locked(sc); + DWC_UNLOCK(sc); +} + +static void +dwc_stop_locked(struct dwc_softc *sc) +{ + struct ifnet *ifp; + int reg; + + DWC_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + sc->tx_watchdog_count = 0; + sc->stats_harvest_count = 0; + + callout_stop(&sc->dwc_callout); + + /* Stop DMA TX */ + reg = READ4(sc, OPERATION_MODE); + reg &= ~(MODE_ST); + WRITE4(sc, OPERATION_MODE, reg); + + /* Flush TX */ + reg = READ4(sc, OPERATION_MODE); + reg |= (MODE_FTF); + WRITE4(sc, OPERATION_MODE, reg); + + /* Stop transmitters */ + reg = READ4(sc, MAC_CONFIGURATION); + reg &= ~(CONF_TE | CONF_RE); + WRITE4(sc, MAC_CONFIGURATION, reg); + + /* Stop DMA RX */ + reg = READ4(sc, OPERATION_MODE); + reg &= ~(MODE_SR); + WRITE4(sc, OPERATION_MODE, reg); +} + +static void dwc_clear_stats(struct dwc_softc *sc) +{ + int reg; + + reg = READ4(sc, MMC_CONTROL); + reg |= (MMC_CONTROL_CNTRST); + WRITE4(sc, MMC_CONTROL, reg); +} + +static void +dwc_harvest_stats(struct dwc_softc *sc) +{ + struct ifnet *ifp; + + /* We don't need to harvest too often. */ + if (++sc->stats_harvest_count < STATS_HARVEST_INTERVAL) + return; + + sc->stats_harvest_count = 0; + ifp = sc->ifp; + + if_inc_counter(ifp, IFCOUNTER_IPACKETS, READ4(sc, RXFRAMECOUNT_GB)); + if_inc_counter(ifp, IFCOUNTER_IMCASTS, READ4(sc, RXMULTICASTFRAMES_G)); + if_inc_counter(ifp, IFCOUNTER_IERRORS, + READ4(sc, RXOVERSIZE_G) + READ4(sc, RXUNDERSIZE_G) + + READ4(sc, RXCRCERROR) + READ4(sc, RXALIGNMENTERROR) + + READ4(sc, RXRUNTERROR) + READ4(sc, RXJABBERERROR) + + READ4(sc, RXLENGTHERROR)); + + if_inc_counter(ifp, IFCOUNTER_OPACKETS, READ4(sc, TXFRAMECOUNT_G)); + if_inc_counter(ifp, IFCOUNTER_OMCASTS, READ4(sc, TXMULTICASTFRAMES_G)); + if_inc_counter(ifp, IFCOUNTER_OERRORS, + READ4(sc, TXOVERSIZE_G) + READ4(sc, TXEXCESSDEF) + + READ4(sc, TXCARRIERERR) + READ4(sc, TXUNDERFLOWERROR)); + + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, + READ4(sc, TXEXESSCOL) + READ4(sc, TXLATECOL)); + + dwc_clear_stats(sc); +} + +static void +dwc_tick(void *arg) +{ + struct dwc_softc *sc; + struct ifnet *ifp; + int link_was_up; + + sc = arg; + + DWC_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + return; + + /* + * Typical tx watchdog. If this fires it indicates that we enqueued + * packets for output and never got a txdone interrupt for them. Maybe + * it's a missed interrupt somehow, just pretend we got one. + */ + if (sc->tx_watchdog_count > 0) { + if (--sc->tx_watchdog_count == 0) { + dwc_txfinish_locked(sc); + } + } + + /* Gather stats from hardware counters. */ + dwc_harvest_stats(sc); + + /* Check the media status. */ + link_was_up = sc->link_is_up; + mii_tick(sc->mii_softc); + if (sc->link_is_up && !link_was_up) + dwc_txstart_locked(sc); + + /* Schedule another check one second from now. */ + callout_reset(&sc->dwc_callout, hz, dwc_tick, sc); +} + +static void +dwc_init_locked(struct dwc_softc *sc) +{ + struct ifnet *ifp = sc->ifp; + int reg; + + DWC_ASSERT_LOCKED(sc); + + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + return; + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + + dwc_setup_rxfilter(sc); + + /* Initializa DMA and enable transmitters */ + reg = READ4(sc, OPERATION_MODE); + reg |= (MODE_TSF | MODE_OSF | MODE_FUF); + reg &= ~(MODE_RSF); + reg |= (MODE_RTC_LEV32 << MODE_RTC_SHIFT); + WRITE4(sc, OPERATION_MODE, reg); + + WRITE4(sc, INTERRUPT_ENABLE, INT_EN_DEFAULT); + + /* Start DMA */ + reg = READ4(sc, OPERATION_MODE); + reg |= (MODE_ST | MODE_SR); + WRITE4(sc, OPERATION_MODE, reg); + + /* Enable transmitters */ + reg = READ4(sc, MAC_CONFIGURATION); + reg |= (CONF_JD | CONF_ACS | CONF_BE); + reg |= (CONF_TE | CONF_RE); + WRITE4(sc, MAC_CONFIGURATION, reg); + + /* + * Call mii_mediachg() which will call back into dwc_miibus_statchg() + * to set up the remaining config registers based on current media. + */ + mii_mediachg(sc->mii_softc); + callout_reset(&sc->dwc_callout, hz, dwc_tick, sc); +} + +static void +dwc_init(void *if_softc) +{ + struct dwc_softc *sc = if_softc; + + DWC_LOCK(sc); + dwc_init_locked(sc); + DWC_UNLOCK(sc); +} + +inline static uint32_t +dwc_setup_rxdesc(struct dwc_softc *sc, int idx, bus_addr_t paddr) +{ + uint32_t nidx; + + sc->rxdesc_ring[idx].addr = (uint32_t)paddr; + nidx = next_rxidx(sc, idx); + sc->rxdesc_ring[idx].addr_next = sc->rxdesc_ring_paddr + \ + (nidx * sizeof(struct dwc_hwdesc)); + sc->rxdesc_ring[idx].tdes1 = DDESC_RDES1_CHAINED | MCLBYTES; + + wmb(); + sc->rxdesc_ring[idx].tdes0 = DDESC_RDES0_OWN; + wmb(); + + return (nidx); +} + +static int +dwc_setup_rxbuf(struct dwc_softc *sc, int idx, struct mbuf *m) +{ + struct bus_dma_segment seg; + int error, nsegs; + + m_adj(m, ETHER_ALIGN); + + error = bus_dmamap_load_mbuf_sg(sc->rxbuf_tag, sc->rxbuf_map[idx].map, + m, &seg, &nsegs, 0); + if (error != 0) { + return (error); + } + + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + bus_dmamap_sync(sc->rxbuf_tag, sc->rxbuf_map[idx].map, + BUS_DMASYNC_PREREAD); + + sc->rxbuf_map[idx].mbuf = m; + dwc_setup_rxdesc(sc, idx, seg.ds_addr); + + return (0); +} + +static struct mbuf * +dwc_alloc_mbufcl(struct dwc_softc *sc) +{ + struct mbuf *m; + + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + m->m_pkthdr.len = m->m_len = m->m_ext.ext_size; + + return (m); +} + +static void +dwc_media_status(struct ifnet * ifp, struct ifmediareq *ifmr) +{ + struct dwc_softc *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + mii = sc->mii_softc; + DWC_LOCK(sc); + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; + DWC_UNLOCK(sc); +} + +static int +dwc_media_change_locked(struct dwc_softc *sc) +{ + + return (mii_mediachg(sc->mii_softc)); +} + +static int +dwc_media_change(struct ifnet * ifp) +{ + struct dwc_softc *sc; + int error; + + sc = ifp->if_softc; + + DWC_LOCK(sc); + error = dwc_media_change_locked(sc); + DWC_UNLOCK(sc); + return (error); +} + +static const uint8_t nibbletab[] = { + /* 0x0 0000 -> 0000 */ 0x0, + /* 0x1 0001 -> 1000 */ 0x8, + /* 0x2 0010 -> 0100 */ 0x4, + /* 0x3 0011 -> 1100 */ 0xc, + /* 0x4 0100 -> 0010 */ 0x2, + /* 0x5 0101 -> 1010 */ 0xa, + /* 0x6 0110 -> 0110 */ 0x6, + /* 0x7 0111 -> 1110 */ 0xe, + /* 0x8 1000 -> 0001 */ 0x1, + /* 0x9 1001 -> 1001 */ 0x9, + /* 0xa 1010 -> 0101 */ 0x5, + /* 0xb 1011 -> 1101 */ 0xd, + /* 0xc 1100 -> 0011 */ 0x3, + /* 0xd 1101 -> 1011 */ 0xb, + /* 0xe 1110 -> 0111 */ 0x7, + /* 0xf 1111 -> 1111 */ 0xf, }; + +static uint8_t +bitreverse(uint8_t x) +{ + + return (nibbletab[x & 0xf] << 4) | nibbletab[x >> 4]; +} + +static void +dwc_setup_rxfilter(struct dwc_softc *sc) +{ + struct ifmultiaddr *ifma; + struct ifnet *ifp; + uint8_t *eaddr; + uint32_t crc; + uint8_t val; + int hashbit; + int hashreg; + int ffval; + int reg; + int lo; + int hi; + + DWC_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + + /* + * Set the multicast (group) filter hash. + */ + if ((ifp->if_flags & IFF_ALLMULTI)) + ffval = (FRAME_FILTER_PM); + else { + ffval = (FRAME_FILTER_HMC); + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN); + + /* Take lower 8 bits and reverse it */ + val = bitreverse(~crc & 0xff); + hashreg = (val >> 5); + hashbit = (val & 31); + + reg = READ4(sc, HASH_TABLE_REG(hashreg)); + reg |= (1 << hashbit); + WRITE4(sc, HASH_TABLE_REG(hashreg), reg); + } + if_maddr_runlock(ifp); + } + + /* + * Set the individual address filter hash. + */ + if (ifp->if_flags & IFF_PROMISC) + ffval |= (FRAME_FILTER_PR); + + /* + * Set the primary address. + */ + eaddr = IF_LLADDR(ifp); + lo = eaddr[0] | (eaddr[1] << 8) | (eaddr[2] << 16) | + (eaddr[3] << 24); + hi = eaddr[4] | (eaddr[5] << 8); + WRITE4(sc, MAC_ADDRESS_LOW(0), lo); + WRITE4(sc, MAC_ADDRESS_HIGH(0), hi); + WRITE4(sc, MAC_FRAME_FILTER, ffval); +} + +static int +dwc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +{ + struct dwc_softc *sc; + struct mii_data *mii; + struct ifreq *ifr; + int mask, error; + + sc = ifp->if_softc; + ifr = (struct ifreq *)data; + + error = 0; + switch (cmd) { + case SIOCSIFFLAGS: + DWC_LOCK(sc); + if (ifp->if_flags & IFF_UP) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if ((ifp->if_flags ^ sc->if_flags) & + (IFF_PROMISC | IFF_ALLMULTI)) + dwc_setup_rxfilter(sc); + } else { + if (!sc->is_detaching) + dwc_init_locked(sc); + } + } else { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + dwc_stop_locked(sc); + } + sc->if_flags = ifp->if_flags; + DWC_UNLOCK(sc); + break; + case SIOCADDMULTI: + case SIOCDELMULTI: + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + DWC_LOCK(sc); + dwc_setup_rxfilter(sc); + DWC_UNLOCK(sc); + } + break; + case SIOCSIFMEDIA: + case SIOCGIFMEDIA: + mii = sc->mii_softc; + error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, cmd); + break; + case SIOCSIFCAP: + mask = ifp->if_capenable ^ ifr->ifr_reqcap; + if (mask & IFCAP_VLAN_MTU) { + /* No work to do except acknowledge the change took */ + ifp->if_capenable ^= IFCAP_VLAN_MTU; + } + break; + + default: + error = ether_ioctl(ifp, cmd, data); + break; + } + + return (error); +} + +static void +dwc_txfinish_locked(struct dwc_softc *sc) +{ + struct dwc_bufmap *bmap; + struct dwc_hwdesc *desc; + struct ifnet *ifp; + + DWC_ASSERT_LOCKED(sc); + + ifp = sc->ifp; + + while (sc->tx_idx_tail != sc->tx_idx_head) { + desc = &sc->txdesc_ring[sc->tx_idx_tail]; + if ((desc->tdes0 & DDESC_TDES0_OWN) != 0) + break; + bmap = &sc->txbuf_map[sc->tx_idx_tail]; + bus_dmamap_sync(sc->txbuf_tag, bmap->map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->txbuf_tag, bmap->map); + m_freem(bmap->mbuf); + bmap->mbuf = NULL; + dwc_setup_txdesc(sc, sc->tx_idx_tail, 0, 0); + sc->tx_idx_tail = next_txidx(sc, sc->tx_idx_tail); + } + + /* If there are no buffers outstanding, muzzle the watchdog. */ + if (sc->tx_idx_tail == sc->tx_idx_head) { + sc->tx_watchdog_count = 0; + } +} + +static void +dwc_rxfinish_locked(struct dwc_softc *sc) +{ + struct ifnet *ifp; + struct mbuf *m0; + struct mbuf *m; + int error; + int rdes0; + int idx; + int len; + + ifp = sc->ifp; + + for (;;) { + idx = sc->rx_idx; + + rdes0 = sc->rxdesc_ring[idx].tdes0; + if ((rdes0 & DDESC_RDES0_OWN) != 0) + break; + + bus_dmamap_sync(sc->rxbuf_tag, sc->rxbuf_map[idx].map, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->rxbuf_tag, sc->rxbuf_map[idx].map); + + len = (rdes0 >> DDESC_RDES0_FL_SHIFT) & DDESC_RDES0_FL_MASK; + if (len != 0) { + m = sc->rxbuf_map[idx].mbuf; + m->m_pkthdr.rcvif = ifp; + m->m_pkthdr.len = len; + m->m_len = len; + ifp->if_ipackets++; + + DWC_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + DWC_LOCK(sc); + } else { + /* XXX Zero-length packet ? */ + } + + if ((m0 = dwc_alloc_mbufcl(sc)) != NULL) { + if ((error = dwc_setup_rxbuf(sc, idx, m0)) != 0) { + /* + * XXX Now what? + * We've got a hole in the rx ring. + */ + } + } else + if_inc_counter(sc->ifp, IFCOUNTER_IQDROPS, 1); + + sc->rx_idx = next_rxidx(sc, sc->rx_idx); + } +} + +static void +dwc_intr(void *arg) +{ + struct dwc_softc *sc; + uint32_t reg; + + sc = arg; + + DWC_LOCK(sc); + + reg = READ4(sc, INTERRUPT_STATUS); + if (reg) { + mii_mediachg(sc->mii_softc); + READ4(sc, SGMII_RGMII_SMII_CTRL_STATUS); + } + + reg = READ4(sc, DMA_STATUS); + if (reg & DMA_STATUS_NIS) { + if (reg & DMA_STATUS_RI) + dwc_rxfinish_locked(sc); + + if (reg & DMA_STATUS_TI) + dwc_txfinish_locked(sc); + } + + if (reg & DMA_STATUS_AIS) { + if (reg & DMA_STATUS_FBI) { + /* Fatal bus error */ + device_printf(sc->dev, + "Ethernet DMA error, restarting controller.\n"); + dwc_stop_locked(sc); + dwc_init_locked(sc); + } + } + + WRITE4(sc, DMA_STATUS, reg & DMA_STATUS_INTR_MASK); + DWC_UNLOCK(sc); +} + +static int +setup_dma(struct dwc_softc *sc) +{ + struct mbuf *m; + int error; + int nidx; + int idx; + + /* + * Set up TX descriptor ring, descriptors, and dma maps. + */ + error = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), /* Parent tag. */ + DWC_DESC_RING_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + TX_DESC_SIZE, 1, /* maxsize, nsegments */ + TX_DESC_SIZE, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->txdesc_tag); + if (error != 0) { + device_printf(sc->dev, + "could not create TX ring DMA tag.\n"); + goto out; + } + + error = bus_dmamem_alloc(sc->txdesc_tag, (void**)&sc->txdesc_ring, + BUS_DMA_COHERENT | BUS_DMA_WAITOK | BUS_DMA_ZERO, + &sc->txdesc_map); + if (error != 0) { + device_printf(sc->dev, + "could not allocate TX descriptor ring.\n"); + goto out; + } + + error = bus_dmamap_load(sc->txdesc_tag, sc->txdesc_map, + sc->txdesc_ring, TX_DESC_SIZE, dwc_get1paddr, + &sc->txdesc_ring_paddr, 0); + if (error != 0) { + device_printf(sc->dev, + "could not load TX descriptor ring map.\n"); + goto out; + } + + for (idx = 0; idx < TX_DESC_COUNT; idx++) { + sc->txdesc_ring[idx].tdes0 = DDESC_TDES0_TXCHAIN; + sc->txdesc_ring[idx].tdes1 = 0; + nidx = next_txidx(sc, idx); + sc->txdesc_ring[idx].addr_next = sc->txdesc_ring_paddr + \ + (nidx * sizeof(struct dwc_hwdesc)); + } + + error = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), /* Parent tag. */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES, 1, /* maxsize, nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 18:43:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3877C403; Thu, 25 Sep 2014 18:43:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22591D4F; Thu, 25 Sep 2014 18:43:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PIhr2W029303; Thu, 25 Sep 2014 18:43:53 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PIhqot029301; Thu, 25 Sep 2014 18:43:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409251843.s8PIhqot029301@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 25 Sep 2014 18:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272121 - in head/sys: conf dev/ncr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 18:43:53 -0000 Author: jhb Date: Thu Sep 25 18:43:52 2014 New Revision: 272121 URL: http://svnweb.freebsd.org/changeset/base/272121 Log: Lock ncr(4) and mark it MPSAFE along with various other fixes: - Use bus_*() instead of bus_space_*(). - Use device_printf(). - Remove unused global variables and the extra warning suppression they required. - Use callout() instead of timeout(). Reviewed by: se Modified: head/sys/conf/files head/sys/dev/ncr/ncr.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Sep 25 18:03:14 2014 (r272120) +++ head/sys/conf/files Thu Sep 25 18:43:52 2014 (r272121) @@ -1949,8 +1949,7 @@ dev/nand/nandsim_ctrl.c optional nandsi dev/nand/nandsim_log.c optional nandsim nand dev/nand/nandsim_swap.c optional nandsim nand dev/nand/nfc_if.m optional nand -dev/ncr/ncr.c optional ncr pci \ - compile-with "${NORMAL_C} -Wno-unused" +dev/ncr/ncr.c optional ncr pci dev/ncv/ncr53c500.c optional ncv dev/ncv/ncr53c500_pccard.c optional ncv pccard dev/netmap/netmap.c optional netmap Modified: head/sys/dev/ncr/ncr.c ============================================================================== --- head/sys/dev/ncr/ncr.c Thu Sep 25 18:03:14 2014 (r272120) +++ head/sys/dev/ncr/ncr.c Thu Sep 25 18:43:52 2014 (r272121) @@ -43,11 +43,6 @@ __FBSDID("$FreeBSD$"); -#define NCR_DATE "pl30 98/1/1" - -#define NCR_VERSION (2) -#define MAX_UNITS (16) - #define NCR_GETCC_WITHMSG #if defined (__FreeBSD__) && defined(_KERNEL) @@ -274,25 +269,22 @@ __FBSDID("$FreeBSD$"); **========================================================== */ -#define INB(r) bus_space_read_1(np->bst, np->bsh, offsetof(struct ncr_reg, r)) -#define INW(r) bus_space_read_2(np->bst, np->bsh, offsetof(struct ncr_reg, r)) -#define INL(r) bus_space_read_4(np->bst, np->bsh, offsetof(struct ncr_reg, r)) - -#define OUTB(r, val) bus_space_write_1(np->bst, np->bsh, \ - offsetof(struct ncr_reg, r), val) -#define OUTW(r, val) bus_space_write_2(np->bst, np->bsh, \ - offsetof(struct ncr_reg, r), val) -#define OUTL(r, val) bus_space_write_4(np->bst, np->bsh, \ - offsetof(struct ncr_reg, r), val) -#define OUTL_OFF(o, val) bus_space_write_4(np->bst, np->bsh, o, val) - -#define INB_OFF(o) bus_space_read_1(np->bst, np->bsh, o) -#define INW_OFF(o) bus_space_read_2(np->bst, np->bsh, o) -#define INL_OFF(o) bus_space_read_4(np->bst, np->bsh, o) +#define INB(r) bus_read_1(np->reg_res, offsetof(struct ncr_reg, r)) +#define INW(r) bus_read_2(np->reg_res, offsetof(struct ncr_reg, r)) +#define INL(r) bus_read_4(np->reg_res, offsetof(struct ncr_reg, r)) + +#define OUTB(r, val) bus_write_1(np->reg_res, offsetof(struct ncr_reg, r), val) +#define OUTW(r, val) bus_write_2(np->reg_res, offsetof(struct ncr_reg, r), val) +#define OUTL(r, val) bus_write_4(np->reg_res, offsetof(struct ncr_reg, r), val) +#define OUTL_OFF(o, val) bus_write_4(np->reg_res, o, val) + +#define INB_OFF(o) bus_read_1(np->reg_res, o) +#define INW_OFF(o) bus_read_2(np->reg_res, o) +#define INL_OFF(o) bus_read_4(np->reg_res, o) #define READSCRIPT_OFF(base, off) \ (base ? *((volatile u_int32_t *)((volatile char *)base + (off))) : \ - bus_space_read_4(np->bst2, np->bsh2, off)) + bus_read_4(np->sram_res, off)) #define WRITESCRIPT_OFF(base, off, val) \ do { \ @@ -300,7 +292,7 @@ __FBSDID("$FreeBSD$"); *((volatile u_int32_t *) \ ((volatile char *)base + (off))) = (val); \ else \ - bus_space_write_4(np->bst2, np->bsh2, off, val); \ + bus_write_4(np->sram_res, off, val); \ } while (0) #define READSCRIPT(r) \ @@ -974,7 +966,7 @@ struct ncb { */ struct head header; - int unit; + device_t dev; /*----------------------------------------------- ** Scripts .. @@ -999,13 +991,9 @@ struct ncb { */ int reg_rid; struct resource *reg_res; - bus_space_tag_t bst; - bus_space_handle_t bsh; int sram_rid; struct resource *sram_res; - bus_space_tag_t bst2; - bus_space_handle_t bsh2; struct resource *irq_res; void *irq_handle; @@ -1086,7 +1074,7 @@ struct ncb { u_short ticks; u_short latetime; time_t lasttime; - struct callout_handle timeout_ch; + struct callout timer; /*----------------------------------------------- ** Debug and profiling @@ -1129,6 +1117,7 @@ struct ncb { */ u_char maxwide; + struct mtx lock; #ifdef NCR_IOMAPPED /* ** address of the ncr control registers in io space @@ -1261,6 +1250,7 @@ static u_int32_t ncr_info(int unit); #endif static void ncr_init(ncb_p np, char * msg, u_long code); static void ncr_intr(void *vnp); +static void ncr_intr_locked(ncb_p np); static void ncr_int_ma(ncb_p np, u_char dstat); static void ncr_int_sir(ncb_p np); static void ncr_int_sto(ncb_p np); @@ -1299,12 +1289,6 @@ static int ncr_attach(device_t dev); **========================================================== */ -static const u_long ncr_version = NCR_VERSION * 11 - + (u_long) sizeof (struct ncb) * 7 - + (u_long) sizeof (struct nccb) * 5 - + (u_long) sizeof (struct lcb) * 3 - + (u_long) sizeof (struct tcb) * 2; - #ifdef _KERNEL static int ncr_debug = SCSI_NCR_DEBUG; @@ -1335,13 +1319,6 @@ static int ncr_cache; /* to be aligned _ #define NCR_1510D_ID (0x000a1000ul) -static char *ncr_name (ncb_p np) -{ - static char name[10]; - snprintf(name, sizeof(name), "ncr%d", np->unit); - return (name); -} - /*========================================================== ** ** @@ -3017,8 +2994,8 @@ static void ncr_script_copy_and_bind (nc */ if (opcode == 0) { - printf ("%s: ERROR0 IN SCRIPT at %d.\n", - ncr_name(np), (int) (src-start-1)); + device_printf(np->dev, "ERROR0 IN SCRIPT at %d.\n", + (int)(src - start - 1)); DELAY (1000000); }; @@ -3043,8 +3020,9 @@ static void ncr_script_copy_and_bind (nc if ((tmp2 & RELOC_MASK) == RELOC_KVAR) tmp2 = 0; if ((tmp1 ^ tmp2) & 3) { - printf ("%s: ERROR1 IN SCRIPT at %d.\n", - ncr_name(np), (int) (src-start-1)); + device_printf(np->dev, + "ERROR1 IN SCRIPT at %d.\n", + (int)(src - start - 1)); DELAY (1000000); } /* @@ -3368,14 +3346,16 @@ ncr_attach (device_t dev) ** allocate and initialize structures. */ - np->unit = device_get_unit(dev); + np->dev = dev; + mtx_init(&np->lock, "ncr", NULL, MTX_DEF); + callout_init_mtx(&np->timer, &np->lock, 0); /* ** Try to map the controller chip to ** virtual and physical memory. */ - np->reg_rid = 0x14; + np->reg_rid = PCIR_BAR(1); np->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &np->reg_rid, RF_ACTIVE); if (!np->reg_res) { @@ -3384,15 +3364,10 @@ ncr_attach (device_t dev) } /* - ** Make the controller's registers available. ** Now the INB INW INL OUTB OUTW OUTL macros ** can be used safely. */ - np->bst = rman_get_bustag(np->reg_res); - np->bsh = rman_get_bushandle(np->reg_res); - - #ifdef NCR_IOMAPPED /* ** Try to map the controller chip into iospace. @@ -3463,8 +3438,7 @@ ncr_attach (device_t dev) #ifdef NCR_TEKRAM_EEPROM if (bootverbose) { - printf ("%s: Tekram EEPROM read %s\n", - ncr_name(np), + device_printf(dev, "Tekram EEPROM read %s\n", read_tekram_eeprom (np, NULL) ? "succeeded" : "failed"); } @@ -3572,7 +3546,7 @@ ncr_attach (device_t dev) ** Get on-chip SRAM address, if supported */ if ((np->features & FE_RAM) && sizeof(struct script) <= 4096) { - np->sram_rid = 0x18; + np->sram_rid = PCIR_BAR(2); np->sram_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &np->sram_rid, RF_ACTIVE); @@ -3584,8 +3558,6 @@ ncr_attach (device_t dev) if (np->sram_res != NULL) { np->script = NULL; np->p_script = rman_get_start(np->sram_res); - np->bst2 = rman_get_bustag(np->sram_res); - np->bsh2 = rman_get_bushandle(np->sram_res); } else if (sizeof (struct script) > PAGE_SIZE) { np->script = (struct script*) contigmalloc (round_page(sizeof (struct script)), M_DEVBUF, M_WAITOK, @@ -3617,15 +3589,16 @@ ncr_attach (device_t dev) if (!cachelnsz) { cachelnsz = 8; - printf("%s: setting PCI cache line size register to %d.\n", - ncr_name(np), (int)cachelnsz); + device_printf(dev, + "setting PCI cache line size register to %d.\n", + (int)cachelnsz); pci_write_config(dev, PCIR_CACHELNSZ, cachelnsz, 1); } if (!(command & PCIM_CMD_MWRICEN)) { command |= PCIM_CMD_MWRICEN; - printf("%s: setting PCI command write and invalidate.\n", - ncr_name(np)); + device_printf(dev, + "setting PCI command write and invalidate.\n"); pci_write_config(dev, PCIR_COMMAND, command, 2); } } @@ -3662,8 +3635,9 @@ ncr_attach (device_t dev) ** Bells and whistles ;-) */ if (bootverbose) - printf("%s: minsync=%d, maxsync=%d, maxoffs=%d, %d dwords burst, %s dma fifo\n", - ncr_name(np), np->minsync, np->maxsync, np->maxoffs, + device_printf(dev, + "minsync=%d, maxsync=%d, maxoffs=%d, %d dwords burst, %s dma fifo\n", + np->minsync, np->maxsync, np->maxoffs, burst_length(np->maxburst), (np->rv_ctest5 & DFS) ? "large" : "normal"); @@ -3671,8 +3645,7 @@ ncr_attach (device_t dev) ** Print some complementary information that can be helpfull. */ if (bootverbose) - printf("%s: %s, %s IRQ driver%s\n", - ncr_name(np), + device_printf(dev, "%s, %s IRQ driver%s\n", np->rv_stest2 & 0x20 ? "differential" : "single-ended", np->rv_dcntl & IRQM ? "totem pole" : "open drain", np->sram_res ? ", using on-chip SRAM" : ""); @@ -3759,8 +3732,8 @@ ncr_attach (device_t dev) device_printf(dev, "interruptless mode: reduced performance.\n"); } else { - bus_setup_intr(dev, np->irq_res, INTR_TYPE_CAM | INTR_ENTROPY, - NULL, ncr_intr, np, &np->irq_handle); + bus_setup_intr(dev, np->irq_res, INTR_TYPE_CAM | INTR_ENTROPY | + INTR_MPSAFE, NULL, ncr_intr, np, &np->irq_handle); } /* @@ -3776,16 +3749,17 @@ ncr_attach (device_t dev) ** Now tell the generic SCSI layer ** about our bus. */ - np->sim = cam_sim_alloc(ncr_action, ncr_poll, "ncr", np, np->unit, - &Giant, 1, MAX_TAGS, devq); + np->sim = cam_sim_alloc(ncr_action, ncr_poll, "ncr", np, + device_get_unit(dev), &np->lock, 1, MAX_TAGS, devq); if (np->sim == NULL) { cam_simq_free(devq); return ENOMEM; } - + mtx_lock(&np->lock); if (xpt_bus_register(np->sim, dev, 0) != CAM_SUCCESS) { cam_sim_free(np->sim, /*free_devq*/ TRUE); + mtx_unlock(&np->lock); return ENOMEM; } @@ -3794,6 +3768,7 @@ ncr_attach (device_t dev) CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_bus_deregister(cam_sim_path(np->sim)); cam_sim_free(np->sim, /*free_devq*/TRUE); + mtx_unlock(&np->lock); return ENOMEM; } @@ -3802,6 +3777,7 @@ ncr_attach (device_t dev) */ ncr_timeout (np); np->lasttime=0; + mtx_unlock(&np->lock); return 0; } @@ -3820,7 +3796,15 @@ ncr_intr(vnp) void *vnp; { ncb_p np = vnp; - int oldspl = splcam(); + + mtx_lock(&np->lock); + ncr_intr_locked(np); + mtx_unlock(&np->lock); +} + +static void +ncr_intr_locked(ncb_p np) +{ if (DEBUG_FLAGS & DEBUG_TINY) printf ("["); @@ -3836,8 +3820,6 @@ ncr_intr(vnp) }; if (DEBUG_FLAGS & DEBUG_TINY) printf ("]\n"); - - splx (oldspl); } /*========================================================== @@ -3856,6 +3838,7 @@ ncr_action (struct cam_sim *sim, union c ncb_p np; np = (ncb_p) cam_sim_softc(sim); + mtx_assert(&np->lock, MA_OWNED); switch (ccb->ccb_h.func_code) { /* Common cases first */ @@ -3864,7 +3847,6 @@ ncr_action (struct cam_sim *sim, union c nccb_p cp; lcb_p lp; tcb_p tp; - int oldspl; struct ccb_scsiio *csio; u_int8_t *msgptr; u_int msglen; @@ -3877,15 +3859,12 @@ ncr_action (struct cam_sim *sim, union c tp = &np->target[ccb->ccb_h.target_id]; csio = &ccb->csio; - oldspl = splcam(); - /* * Last time we need to check if this CCB needs to * be aborted. */ if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG) { xpt_done(ccb); - splx(oldspl); return; } ccb->ccb_h.status |= CAM_SIM_QUEUED; @@ -4040,7 +4019,6 @@ ncr_action (struct cam_sim *sim, union c if (segments < 0) { ccb->ccb_h.status = CAM_REQ_TOO_BIG; ncr_free_nccb(np, cp); - splx(oldspl); xpt_done(ccb); return; } @@ -4153,8 +4131,8 @@ ncr_action (struct cam_sim *sim, union c np->squeueput = qidx; if(DEBUG_FLAGS & DEBUG_QUEUE) - printf("%s: queuepos=%d tryoffset=%d.\n", - ncr_name (np), np->squeueput, + device_printf(np->dev, "queuepos=%d tryoffset=%d.\n", + np->squeueput, (unsigned)(READSCRIPT(startpos[0]) - (NCB_SCRIPTH_PHYS (np, tryloop)))); @@ -4163,11 +4141,6 @@ ncr_action (struct cam_sim *sim, union c ** Wake it up. */ OUTB (nc_istat, SIGP); - - /* - ** and reenable interrupts - */ - splx (oldspl); break; } case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */ @@ -4185,7 +4158,6 @@ ncr_action (struct cam_sim *sim, union c struct ccb_trans_settings *cts = &ccb->cts; tcb_p tp; u_int update_type; - int s; struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; struct ccb_trans_settings_spi *spi = @@ -4197,7 +4169,6 @@ ncr_action (struct cam_sim *sim, union c if (cts->type == CTS_TYPE_USER_SETTINGS) update_type |= NCR_TRANS_USER; - s = splcam(); tp = &np->target[ccb->ccb_h.target_id]; /* Tag and disc enables */ if ((spi->valid & CTS_SPI_VALID_DISC) != 0) { @@ -4271,7 +4242,6 @@ ncr_action (struct cam_sim *sim, union c if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0) tp->tinfo.goal.width = spi->bus_width; } - splx(s); ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; @@ -4282,7 +4252,6 @@ ncr_action (struct cam_sim *sim, union c struct ccb_trans_settings *cts = &ccb->cts; struct ncr_transinfo *tinfo; tcb_p tp = &np->target[ccb->ccb_h.target_id]; - int s; struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; struct ccb_trans_settings_spi *spi = @@ -4293,7 +4262,6 @@ ncr_action (struct cam_sim *sim, union c cts->transport = XPORT_SPI; cts->transport_version = 2; - s = splcam(); if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { tinfo = &tp->tinfo.current; if (tp->tinfo.disc_tag & NCR_CUR_DISCENB) @@ -4322,7 +4290,6 @@ ncr_action (struct cam_sim *sim, union c spi->sync_offset = tinfo->offset; spi->bus_width = tinfo->width; - splx(s); spi->valid = CTS_SPI_VALID_SYNC_RATE | CTS_SPI_VALID_SYNC_OFFSET | CTS_SPI_VALID_BUS_WIDTH @@ -4718,7 +4685,8 @@ ncr_init(ncb_p np, char * msg, u_long co ** Message. */ - if (msg) printf ("%s: restart (%s).\n", ncr_name (np), msg); + if (msg) + device_printf(np->dev, "restart (%s).\n", msg); /* ** Clear Start Queue @@ -4813,7 +4781,7 @@ ncr_init(ncb_p np, char * msg, u_long co static void ncr_poll(struct cam_sim *sim) { - ncr_intr(cam_sim_softc(sim)); + ncr_intr_locked(cam_sim_softc(sim)); } @@ -5089,11 +5057,8 @@ ncr_timeout (void *arg) long signed t; nccb_p cp; + mtx_assert(&np->lock, MA_OWNED); if (np->lasttime != thistime) { - /* - ** block ncr interrupts - */ - int oldspl = splcam(); np->lasttime = thistime; /*---------------------------------------------------- @@ -5143,8 +5108,8 @@ ncr_timeout (void *arg) cp->jump_nccb.l_cmd = (SCR_JUMP); if (cp->phys.header.launch.l_paddr == NCB_SCRIPT_PHYS (np, select)) { - printf ("%s: timeout nccb=%p (skip)\n", - ncr_name (np), cp); + device_printf(np->dev, + "timeout nccb=%p (skip)\n", cp); cp->phys.header.launch.l_paddr = NCB_SCRIPT_PHYS (np, skip); }; @@ -5164,11 +5129,9 @@ ncr_timeout (void *arg) */ ncr_complete (np, cp); }; - splx (oldspl); } - np->timeout_ch = - timeout (ncr_timeout, (caddr_t) np, step ? step : 1); + callout_reset(&np->timer, step ? step : 1, ncr_timeout, np); if (INB(nc_istat) & (INTF|SIP|DIP)) { @@ -5176,11 +5139,9 @@ ncr_timeout (void *arg) ** Process pending interrupts. */ - int oldspl = splcam(); if (DEBUG_FLAGS & DEBUG_TINY) printf ("{"); ncr_exception (np); if (DEBUG_FLAGS & DEBUG_TINY) printf ("}"); - splx (oldspl); }; } @@ -5245,19 +5206,20 @@ static void ncr_log_hard_error(ncb_p np, script_name = "mem"; } - printf ("%s:%d: ERROR (%x:%x) (%x-%x-%x) (%x/%x) @ (%s %x:%08x).\n", - ncr_name (np), (unsigned)INB (nc_sdid)&0x0f, dstat, sist, + device_printf(np->dev, + "%d: ERROR (%x:%x) (%x-%x-%x) (%x/%x) @ (%s %x:%08x).\n", + (unsigned)INB (nc_sdid)&0x0f, dstat, sist, (unsigned)INB (nc_socl), (unsigned)INB (nc_sbcl), (unsigned)INB (nc_sbdl), (unsigned)INB (nc_sxfer),(unsigned)INB (nc_scntl3), script_name, script_ofs, (unsigned)INL (nc_dbc)); if (((script_ofs & 3) == 0) && (unsigned)script_ofs < script_size) { - printf ("%s: script cmd = %08x\n", ncr_name(np), + device_printf(np->dev, "script cmd = %08x\n", (int)READSCRIPT_OFF(script_base, script_ofs)); } - printf ("%s: regdump:", ncr_name(np)); + device_printf(np->dev, "regdump:"); for (i=0; i<16;i++) printf (" %02x", (unsigned)INB_OFF(i)); printf (".\n"); @@ -5411,7 +5373,7 @@ static void ncr_exception (ncb_p np) (INB(nc_sstat1) & (FF3210) ) || (INB(nc_sstat2) & (ILF1|ORF1|OLF1)) || /* wide .. */ !(dstat & DFE)) { - printf ("%s: have to clear fifos.\n", ncr_name (np)); + device_printf(np->dev, "have to clear fifos.\n"); OUTB (nc_stest3, TE|CSF); /* clear scsi fifo */ OUTB (nc_ctest3, np->rv_ctest3 | CLF); /* clear dma fifo */ @@ -5423,7 +5385,7 @@ static void ncr_exception (ncb_p np) */ if (sist & HTH) { - printf ("%s: handshake timeout\n", ncr_name(np)); + device_printf(np->dev, "handshake timeout\n"); OUTB (nc_scntl1, CRST); DELAY (1000); OUTB (nc_scntl1, 0x00); @@ -5466,12 +5428,11 @@ static void ncr_exception (ncb_p np) /* ** info message */ - printf ("%s: INFO: LDSC while IID.\n", - ncr_name (np)); + device_printf(np->dev, "INFO: LDSC while IID.\n"); return; }; - printf ("%s: target %d doesn't release the bus.\n", - ncr_name (np), INB (nc_sdid)&0x0f); + device_printf(np->dev, "target %d doesn't release the bus.\n", + INB (nc_sdid)&0x0f); /* ** return without restarting the NCR. ** timeout will do the real work. @@ -5515,8 +5476,7 @@ static void ncr_exception (ncb_p np) switch (i%16) { case 0: - printf ("%s: reg[%d0]: ", - ncr_name(np),i/16); + device_printf(np->dev, "reg[%d0]: ", i / 16); break; case 4: case 8: @@ -5524,14 +5484,14 @@ static void ncr_exception (ncb_p np) printf (" "); break; }; - val = bus_space_read_1(np->bst, np->bsh, i); + val = bus_read_1(np->reg_res, i); printf (" %x%x", val/16, val%16); if (i%16==15) printf (".\n"); }; - untimeout (ncr_timeout, (caddr_t) np, np->timeout_ch); + callout_stop(&np->timer); - printf ("%s: halted!\n", ncr_name(np)); + device_printf(np->dev, "halted!\n"); /* ** don't restart controller ... */ @@ -5678,14 +5638,16 @@ static void ncr_int_ma (ncb_p np, u_char cp = cp->link_nccb; if (!cp) { - printf ("%s: SCSI phase error fixup: CCB already dequeued (%p)\n", - ncr_name (np), (void *) np->header.cp); - return; + device_printf(np->dev, + "SCSI phase error fixup: CCB already dequeued (%p)\n", + (void *)np->header.cp); + return; } if (cp != np->header.cp) { - printf ("%s: SCSI phase error fixup: CCB address mismatch " + device_printf(np->dev, + "SCSI phase error fixup: CCB address mismatch " "(%p != %p) np->nccb = %p\n", - ncr_name (np), (void *)cp, (void *)np->header.cp, + (void *)cp, (void *)np->header.cp, (void *)np->link_nccb); /* return;*/ } @@ -5889,7 +5851,7 @@ static void ncr_int_sir (ncb_p np) */ if (DEBUG_FLAGS & DEBUG_RESTART) - printf ("%s: int#%d",ncr_name (np),num); + device_printf(np->dev, "int#%d", num); cp = (nccb_p) 0; for (i=0; idev, "queue empty.\n"); WRITESCRIPT(start1[0], SCR_INT ^ IFFALSE (0)); break; }; @@ -6424,7 +6386,7 @@ static nccb_p ncr_get_nccb if (cp != NULL) { if (cp->magic) { - printf("%s: Bogus free cp found\n", ncr_name(np)); + device_printf(np->dev, "Bogus free cp found\n"); return (NULL); } cp->magic = 1; @@ -6913,7 +6875,7 @@ static void ncr_selectclock(ncb_p np, u_ } if (bootverbose >= 2) - printf ("%s: enabling clock multiplier\n", ncr_name(np)); + device_printf(np->dev, "enabling clock multiplier\n"); OUTB(nc_stest1, DBLEN); /* Enable clock multiplier */ if (np->multiplier > 2) { /* Poll bit 5 of stest4 for quadrupler */ @@ -6921,7 +6883,8 @@ static void ncr_selectclock(ncb_p np, u_ while (!(INB(nc_stest4) & LCKFRQ) && --i > 0) DELAY(20); if (!i) - printf("%s: the chip cannot lock the frequency\n", ncr_name(np)); + device_printf(np->dev, + "the chip cannot lock the frequency\n"); } else /* Wait 20 micro-seconds for doubler */ DELAY(20); OUTB(nc_stest3, HSC); /* Halt the scsi clock */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 18:52:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53EDA6C0; Thu, 25 Sep 2014 18:52:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E85CE5D; Thu, 25 Sep 2014 18:52:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PIqIfn033823; Thu, 25 Sep 2014 18:52:18 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PIqIRD033822; Thu, 25 Sep 2014 18:52:18 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201409251852.s8PIqIRD033822@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 25 Sep 2014 18:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272122 - head/lib/libc/stdtime X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 18:52:18 -0000 Author: pfg Date: Thu Sep 25 18:52:17 2014 New Revision: 272122 URL: http://svnweb.freebsd.org/changeset/base/272122 Log: Add strptime(3) support for %U and %W Add support for the missing POSIX-2001 %U and %W features: the existing FreeBSD strptime code recognizes both directives and validates that the week number lies in the permitted range, but then simply discards the value. Initial support for the feature was written by Paul Green with important fixes by Andrey Chernov. Additional support for handling tm_wday/tm_yday was written by David Carlier. PR: 137307 MFC after: 1 month Modified: head/lib/libc/stdtime/strptime.c Modified: head/lib/libc/stdtime/strptime.c ============================================================================== --- head/lib/libc/stdtime/strptime.c Thu Sep 25 18:43:52 2014 (r272121) +++ head/lib/libc/stdtime/strptime.c Thu Sep 25 18:52:17 2014 (r272122) @@ -55,10 +55,32 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" #include "timelocal.h" +#include "tzfile.h" static char * _strptime(const char *, const char *, struct tm *, int *, locale_t); -#define asizeof(a) (sizeof (a) / sizeof ((a)[0])) +#define asizeof(a) (sizeof(a) / sizeof((a)[0])) + +#define FLAG_NONE (1 << 0) +#define FLAG_YEAR (1 << 1) +#define FLAG_MONTH (1 << 2) +#define FLAG_YDAY (1 << 3) +#define FLAG_MDAY (1 << 4) +#define FLAG_WDAY (1 << 5) + +/* + * Calculate the week day of the first day of a year. Valid for + * the Gregorian calendar, which began Sept 14, 1752 in the UK + * and its colonies. Ref: + * http://en.wikipedia.org/wiki/Calculating_the_day_of_the_week/ + */ + +static int +first_wday_of(int year) +{ + return (((2 * (3 - (year / 100) % 4)) + (year % 100) + + ((year % 100) / 4) + (isleap(year) ? 6 : 0) + 1) % 7); +} static char * _strptime(const char *buf, const char *fmt, struct tm *tm, int *GMTp, @@ -66,9 +88,17 @@ _strptime(const char *buf, const char *f { char c; const char *ptr; + int day_offset = -1, wday_offset; int i, len; + int flags; int Ealternative, Oalternative; - struct lc_time_T *tptr = __get_current_time_locale(locale); + const struct lc_time_T *tptr = __get_current_time_locale(locale); + static int start_of_month[2][13] = { + {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}, + {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366} + }; + + flags = FLAG_NONE; ptr = fmt; while (*ptr != 0) { @@ -119,7 +149,9 @@ label: if (i < 19) return (NULL); - tm->tm_year = i * 100 - 1900; + tm->tm_year = i * 100 - TM_YEAR_BASE; + flags |= FLAG_YEAR; + break; case 'c': @@ -197,6 +229,8 @@ label: return (NULL); tm->tm_yday = i - 1; + flags |= FLAG_YDAY; + break; case 'M': @@ -303,7 +337,32 @@ label: return (NULL); tm->tm_wday = i; + if (day_offset >= 0 && (i - day_offset) != 0) { + tm->tm_yday += i - day_offset; + i = 0; + while (tm->tm_yday >= + start_of_month[isleap(tm->tm_year + + TM_YEAR_BASE)][i]) + i++; + if (i > 12) + { + i = 1; + tm->tm_yday -= + start_of_month[isleap(tm->tm_year + + TM_YEAR_BASE)] + [12]; + tm->tm_year++; + } + tm->tm_mon = i - 1; + tm->tm_mday = tm->tm_yday - + start_of_month[isleap(tm->tm_year + + TM_YEAR_BASE)] + [i - 1] + 1; + } buf += len; + flags |= FLAG_YEAR | FLAG_MONTH | FLAG_YDAY | + FLAG_MDAY | FLAG_WDAY; + break; case 'U': @@ -313,6 +372,8 @@ label: * information present in the tm structure at this * point to calculate a real value, so just check the * range for now. + * We expect that the year has already been + * parsed. */ if (!isdigit_l((unsigned char)*buf, locale)) return (NULL); @@ -327,6 +388,45 @@ label: if (i > 53) return (NULL); + /* Week numbers are l-origin. So that we can always + * return the date of a Sunday (or Monday), treat week + * 0 as week 1. + */ + + if (i == 0) + i = 1; + + if (c == 'U') + day_offset = TM_SUNDAY; + else + day_offset = TM_MONDAY; + + /* Set the date to the first Sunday (or Monday) + * of the specified week of the year. + */ + + tm->tm_yday = (7 - first_wday_of(tm->tm_year + + TM_YEAR_BASE) + day_offset) % 7 + (i - 1) * 7; + i = 0; + while (tm->tm_yday >= + start_of_month[isleap(tm->tm_year + TM_YEAR_BASE)][i]) + i++; + if (i > 12) + { + i = 1; + tm->tm_yday -= + start_of_month[isleap(tm->tm_year + + TM_YEAR_BASE)][12]; + tm->tm_year++; + } + tm->tm_mon = i - 1; + tm->tm_mday = tm->tm_yday - + start_of_month[isleap(tm->tm_year + TM_YEAR_BASE)] + [i - 1] + 1; + tm->tm_wday = day_offset; + flags |= FLAG_YEAR | FLAG_MONTH | FLAG_YDAY | + FLAG_MDAY | FLAG_WDAY; + break; case 'w': @@ -338,6 +438,7 @@ label: return (NULL); tm->tm_wday = i; + flags != FLAG_WDAY; break; @@ -374,6 +475,7 @@ label: return (NULL); tm->tm_mday = i; + flags |= FLAG_MDAY; break; @@ -413,6 +515,8 @@ label: tm->tm_mon = i; buf += len; + flags |= FLAG_MONTH; + break; case 'm': @@ -430,6 +534,7 @@ label: return (NULL); tm->tm_mon = i - 1; + flags |= FLAG_MONTH; break; @@ -471,13 +576,14 @@ label: len--; } if (c == 'Y') - i -= 1900; + i -= TM_YEAR_BASE; if (c == 'y' && i < 69) i += 100; if (i < 0) return (NULL); tm->tm_year = i; + flags |= FLAG_YEAR; break; @@ -543,10 +649,25 @@ label: break; } } + + if (flags & (FLAG_YEAR | FLAG_MONTH)) { + if (!tm->tm_yday && (flags & FLAG_MDAY)) + tm->tm_yday = start_of_month[isleap(tm->tm_year + + TM_YEAR_BASE)][tm->tm_mon] + (tm->tm_mday - 1); + if (!tm->tm_wday) { + i = 0; + wday_offset = first_wday_of(tm->tm_year); + while (i++ <= tm->tm_yday) + if (wday_offset++ >= 6) + wday_offset = 0; + + tm->tm_wday = wday_offset; + } + } + return ((char *)buf); } - char * strptime_l(const char * __restrict buf, const char * __restrict fmt, struct tm * __restrict tm, locale_t loc) From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 18:53:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9ACED867; Thu, 25 Sep 2014 18:53:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A23AE72; Thu, 25 Sep 2014 18:53:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PIrSVA034014; Thu, 25 Sep 2014 18:53:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PIrSF0034013; Thu, 25 Sep 2014 18:53:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409251853.s8PIrSF0034013@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 25 Sep 2014 18:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272123 - head/sys/pc98/cbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 18:53:28 -0000 Author: jhb Date: Thu Sep 25 18:53:27 2014 New Revision: 272123 URL: http://svnweb.freebsd.org/changeset/base/272123 Log: Use callout() instead of timeout(). This is almost identical to the changes in r271963. Approved by: nyan Modified: head/sys/pc98/cbus/pckbd.c Modified: head/sys/pc98/cbus/pckbd.c ============================================================================== --- head/sys/pc98/cbus/pckbd.c Thu Sep 25 18:52:17 2014 (r272122) +++ head/sys/pc98/cbus/pckbd.c Thu Sep 25 18:53:27 2014 (r272123) @@ -52,6 +52,19 @@ /* device configuration flags */ #define KB_CONF_FAIL_IF_NO_KBD (1 << 0) /* don't install if no kbd is found */ +typedef caddr_t KBDC; + +typedef struct pckbd_state { + KBDC kbdc; /* keyboard controller */ + int ks_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ + int ks_flags; /* flags */ +#define COMPOSE (1 << 0) + int ks_state; /* shift/lock key state */ + int ks_accents; /* accent key index (> 0) */ + u_int ks_composed_char; /* composed char code (> 0) */ + struct callout ks_timer; +} pckbd_state_t; + static devclass_t pckbd_devclass; static int pckbdprobe(device_t dev); @@ -186,6 +199,7 @@ static int pckbd_attach_unit(device_t dev, keyboard_t **kbd, int port, int irq, int flags) { keyboard_switch_t *sw; + pckbd_state_t *state; int args[2]; int error; int unit; @@ -218,6 +232,8 @@ pckbd_attach_unit(device_t dev, keyboard * This is a kludge to compensate for lost keyboard interrupts. * A similar code used to be in syscons. See below. XXX */ + state = (pckbd_state_t *)(*kbd)->kb_data; + callout_init(&state->ks_timer, 0); pckbd_timeout(*kbd); if (bootverbose) @@ -229,6 +245,7 @@ pckbd_attach_unit(device_t dev, keyboard static void pckbd_timeout(void *arg) { + pckbd_state_t *state; keyboard_t *kbd; int s; @@ -259,7 +276,8 @@ pckbd_timeout(void *arg) kbdd_intr(kbd, NULL); } splx(s); - timeout(pckbd_timeout, arg, hz/10); + state = (pckbd_state_t *)kbd->kb_data; + callout_reset(&state->ks_timer, hz / 10, pckbd_timeout, arg); } /* LOW-LEVEL */ @@ -268,18 +286,6 @@ pckbd_timeout(void *arg) #define PC98KBD_DEFAULT 0 -typedef caddr_t KBDC; - -typedef struct pckbd_state { - KBDC kbdc; /* keyboard controller */ - int ks_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ - int ks_flags; /* flags */ -#define COMPOSE (1 << 0) - int ks_state; /* shift/lock key state */ - int ks_accents; /* accent key index (> 0) */ - u_int ks_composed_char; /* composed char code (> 0) */ -} pckbd_state_t; - /* keyboard driver declaration */ static int pckbd_configure(int flags); static kbd_probe_t pckbd_probe; @@ -486,7 +492,10 @@ pckbd_init(int unit, keyboard_t **kbdp, static int pckbd_term(keyboard_t *kbd) { + pckbd_state_t *state = (pckbd_state_t *)kbd->kb_data; + kbd_unregister(kbd); + callout_drain(&state->ks_timer); return 0; } From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 18:54:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 466109BD; Thu, 25 Sep 2014 18:54:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3196EE7F; Thu, 25 Sep 2014 18:54:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PIsbmL034206; Thu, 25 Sep 2014 18:54:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PIsbcA034205; Thu, 25 Sep 2014 18:54:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409251854.s8PIsbcA034205@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 25 Sep 2014 18:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272124 - head/sys/pc98/cbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 18:54:37 -0000 Author: jhb Date: Thu Sep 25 18:54:36 2014 New Revision: 272124 URL: http://svnweb.freebsd.org/changeset/base/272124 Log: Use callout(9) instead of timeout(9). Approved by: nyan Modified: head/sys/pc98/cbus/olpt.c Modified: head/sys/pc98/cbus/olpt.c ============================================================================== --- head/sys/pc98/cbus/olpt.c Thu Sep 25 18:53:27 2014 (r272123) +++ head/sys/pc98/cbus/olpt.c Thu Sep 25 18:54:36 2014 (r272124) @@ -140,6 +140,7 @@ struct lpt_softc { struct resource *res_port; struct resource *res_irq; void *sc_ih; + struct callout timer; int sc_port; short sc_state; @@ -319,6 +320,7 @@ lpt_attach(device_t dev) unit = device_get_unit(dev); sc = device_get_softc(dev); + callout_init(&sc->timer, 0); rid = 0; sc->res_port = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &rid, @@ -418,8 +420,8 @@ lptopen (struct cdev *dev, int flags, in lprintf(("irq %x\n", sc->sc_irq)); if (sc->sc_irq & LP_USE_IRQ) { sc->sc_state |= TOUT; - timeout (lptout, (caddr_t)sc, - (sc->sc_backoff = hz/LPTOUTINITIAL)); + sc->sc_backoff = hz / LPTOUTINITIAL;; + callout_reset(&sc->timer, sc->sc_backoff, lptout, sc); } lprintf(("opened.\n")); @@ -437,7 +439,7 @@ lptout (void *arg) sc->sc_backoff++; if (sc->sc_backoff > hz/LPTOUTMAX) sc->sc_backoff = sc->sc_backoff > hz/LPTOUTMAX; - timeout (lptout, (caddr_t)sc, sc->sc_backoff); + callout_reset(&sc->timer, sc->sc_backoff, lptout, sc); } else sc->sc_state &= ~TOUT; From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 19:08:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F9B8EFF; Thu, 25 Sep 2014 19:08:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E7F0FB6; Thu, 25 Sep 2014 19:08:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PJ865W039437; Thu, 25 Sep 2014 19:08:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PJ86LK039436; Thu, 25 Sep 2014 19:08:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201409251908.s8PJ86LK039436@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 25 Sep 2014 19:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272125 - head/lib/libproc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 19:08:07 -0000 Author: markj Date: Thu Sep 25 19:08:06 2014 New Revision: 272125 URL: http://svnweb.freebsd.org/changeset/base/272125 Log: Factor out some of the duplicated code in the symbol lookup functions, in preparation for adding userland CTF support to DTrace. MFC after: 1 month Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libproc/proc_sym.c Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Thu Sep 25 18:54:36 2014 (r272124) +++ head/lib/libproc/proc_sym.c Thu Sep 25 19:08:06 2014 (r272125) @@ -26,20 +26,20 @@ * 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 +__FBSDID("$FreeBSD$"); + #include #include #include #include -#include +#include #include -#include +#include #include -#include #include #include #include @@ -228,22 +228,56 @@ proc_addr2map(struct proc_handle *p, uin return (NULL); } +/* + * Look up the symbol at addr, returning a copy of the symbol and its name. + */ +static int +lookup_addr(Elf *e, Elf_Scn *scn, u_long stridx, uintptr_t off, uintptr_t addr, + const char **name, GElf_Sym *symcopy) +{ + GElf_Sym sym; + Elf_Data *data; + const char *s; + uint64_t rsym; + int i; + + if ((data = elf_getdata(scn, NULL)) == NULL) { + DPRINTFX("ERROR: elf_getdata() failed: %s", elf_errmsg(-1)); + return (1); + } + for (i = 0; gelf_getsym(data, i, &sym) != NULL; i++) { + rsym = off + sym.st_value; + if (addr >= rsym && addr < rsym + sym.st_size) { + s = elf_strptr(e, stridx, sym.st_name); + if (s != NULL) { + *name = s; + memcpy(symcopy, &sym, sizeof(*symcopy)); + /* + * DTrace expects the st_value to contain + * only the address relative to the start of + * the function. + */ + symcopy->st_value = rsym; + return (0); + } + } + } + return (1); +} + int proc_addr2sym(struct proc_handle *p, uintptr_t addr, char *name, size_t namesz, GElf_Sym *symcopy) { + GElf_Ehdr ehdr; + GElf_Shdr shdr; Elf *e; Elf_Scn *scn, *dynsymscn = NULL, *symtabscn = NULL; - Elf_Data *data; - GElf_Shdr shdr; - GElf_Sym sym; - GElf_Ehdr ehdr; - int fd, error = -1; - size_t i; - uint64_t rsym; prmap_t *map; - char *s; - unsigned long symtabstridx = 0, dynsymstridx = 0; + const char *s; + uintptr_t off; + u_long symtabstridx = 0, dynsymstridx = 0; + int fd, error = -1; if ((map = proc_addr2map(p, addr)) == NULL) return (-1); @@ -259,6 +293,7 @@ proc_addr2sym(struct proc_handle *p, uin DPRINTFX("ERROR: gelf_getehdr() failed: %s", elf_errmsg(-1)); goto err2; } + /* * Find the index of the STRTAB and SYMTAB sections to locate * symbol names. @@ -275,80 +310,25 @@ proc_addr2sym(struct proc_handle *p, uin dynsymscn = scn; dynsymstridx = shdr.sh_link; break; - default: - break; - } - } - /* - * Iterate over the Dynamic Symbols table to find the symbol. - * Then look up the string name in STRTAB (.dynstr) - */ - if ((data = elf_getdata(dynsymscn, NULL)) == NULL) { - DPRINTFX("ERROR: elf_getdata() failed: %s", elf_errmsg(-1)); - goto symtab; - } - i = 0; - while (gelf_getsym(data, i++, &sym) != NULL) { - /* - * Calculate the address mapped to the virtual memory - * by rtld. - */ - if (ehdr.e_type != ET_EXEC) - rsym = map->pr_vaddr + sym.st_value; - else - rsym = sym.st_value; - if (addr >= rsym && addr < rsym + sym.st_size) { - s = elf_strptr(e, dynsymstridx, sym.st_name); - if (s) { - demangle(s, name, namesz); - memcpy(symcopy, &sym, sizeof(sym)); - /* - * DTrace expects the st_value to contain - * only the address relative to the start of - * the function. - */ - symcopy->st_value = rsym; - error = 0; - goto out; - } } } -symtab: + + off = ehdr.e_type == ET_EXEC ? 0 : map->pr_vaddr; + /* - * Iterate over the Symbols Table to find the symbol. - * Then look up the string name in STRTAB (.dynstr) + * First look up the symbol in the dynsymtab, and fall back to the + * symtab if the lookup fails. */ - if ((data = elf_getdata(symtabscn, NULL)) == NULL) { - DPRINTFX("ERROR: elf_getdata() failed: %s", elf_errmsg(-1)); - goto err2; - } - i = 0; - while (gelf_getsym(data, i++, &sym) != NULL) { - /* - * Calculate the address mapped to the virtual memory - * by rtld. - */ - if (ehdr.e_type != ET_EXEC) - rsym = map->pr_vaddr + sym.st_value; - else - rsym = sym.st_value; - if (addr >= rsym && addr < rsym + sym.st_size) { - s = elf_strptr(e, symtabstridx, sym.st_name); - if (s) { - demangle(s, name, namesz); - memcpy(symcopy, &sym, sizeof(sym)); - /* - * DTrace expects the st_value to contain - * only the address relative to the start of - * the function. - */ - symcopy->st_value = rsym; - error = 0; - goto out; - } - } - } + error = lookup_addr(e, dynsymscn, dynsymstridx, off, addr, &s, symcopy); + if (error == 0) + goto out; + + error = lookup_addr(e, symtabscn, symtabstridx, off, addr, &s, symcopy); + if (error == 0) + goto out; + out: + demangle(s, name, namesz); err2: elf_end(e); err1: @@ -363,7 +343,7 @@ proc_name2map(struct proc_handle *p, con { size_t i; int cnt; - prmap_t *map; + prmap_t *map = NULL; char tmppath[MAXPATHLEN]; struct kinfo_vmentry *kves, *kve; rd_loadobj_t *rdl; @@ -382,30 +362,52 @@ proc_name2map(struct proc_handle *p, con basename_r(kve->kve_path, tmppath); if (strcmp(tmppath, name) == 0) { map = proc_addr2map(p, kve->kve_start); - free(kves); - return (map); + break; } } free(kves); - return (NULL); - } - if ((name == NULL || strcmp(name, "a.out") == 0) && - p->rdexec != NULL) { + } else + for (i = 0; i < p->nobjs; i++) { + rdl = &p->rdobjs[i]; + basename_r(rdl->rdl_path, tmppath); + if (strcmp(tmppath, name) == 0) { + if ((map = malloc(sizeof(*map))) == NULL) + return (NULL); + proc_rdl2prmap(rdl, map); + break; + } + } + + if (map == NULL && strcmp(name, "a.out") == 0 && p->rdexec != NULL) map = proc_addr2map(p, p->rdexec->rdl_saddr); - return (map); + + return (map); +} + +/* + * Look up the symbol with the given name and return a copy of it. + */ +static int +lookup_name(Elf *e, Elf_Scn *scn, u_long stridx, const char *symbol, + GElf_Sym *symcopy) +{ + GElf_Sym sym; + Elf_Data *data; + char *s; + int i; + + if ((data = elf_getdata(scn, NULL)) == NULL) { + DPRINTFX("ERROR: elf_getdata() failed: %s", elf_errmsg(-1)); + return (1); } - for (i = 0; i < p->nobjs; i++) { - rdl = &p->rdobjs[i]; - basename_r(rdl->rdl_path, tmppath); - if (strcmp(tmppath, name) == 0) { - if ((map = malloc(sizeof(*map))) == NULL) - return (NULL); - proc_rdl2prmap(rdl, map); - return (map); + for (i = 0; gelf_getsym(data, i, &sym) != NULL; i++) { + s = elf_strptr(e, stridx, sym.st_name); + if (s != NULL && strcmp(s, symbol) == 0) { + memcpy(symcopy, &sym, sizeof(*symcopy)); + return (0); } } - - return (NULL); + return (1); } int @@ -414,15 +416,12 @@ proc_name2sym(struct proc_handle *p, con { Elf *e; Elf_Scn *scn, *dynsymscn = NULL, *symtabscn = NULL; - Elf_Data *data; GElf_Shdr shdr; - GElf_Sym sym; GElf_Ehdr ehdr; - int fd, error = -1; - size_t i; prmap_t *map; - char *s; - unsigned long symtabstridx = 0, dynsymstridx = 0; + uintptr_t off; + u_long symtabstridx = 0, dynsymstridx = 0; + int fd, error = -1; if ((map = proc_name2map(p, object)) == NULL) { DPRINTFX("ERROR: couldn't find object %s", object); @@ -456,46 +455,25 @@ proc_name2sym(struct proc_handle *p, con dynsymscn = scn; dynsymstridx = shdr.sh_link; break; - default: - break; - } - } - /* - * Iterate over the Dynamic Symbols table to find the symbol. - * Then look up the string name in STRTAB (.dynstr) - */ - if ((data = elf_getdata(dynsymscn, NULL))) { - i = 0; - while (gelf_getsym(data, i++, &sym) != NULL) { - s = elf_strptr(e, dynsymstridx, sym.st_name); - if (s && strcmp(s, symbol) == 0) { - memcpy(symcopy, &sym, sizeof(sym)); - if (ehdr.e_type != ET_EXEC) - symcopy->st_value += map->pr_vaddr; - error = 0; - goto out; - } } } + /* - * Iterate over the Symbols Table to find the symbol. - * Then look up the string name in STRTAB (.dynstr) + * First look up the symbol in the dynsymtab, and fall back to the + * symtab if the lookup fails. */ - if ((data = elf_getdata(symtabscn, NULL))) { - i = 0; - while (gelf_getsym(data, i++, &sym) != NULL) { - s = elf_strptr(e, symtabstridx, sym.st_name); - if (s && strcmp(s, symbol) == 0) { - memcpy(symcopy, &sym, sizeof(sym)); - if (ehdr.e_type != ET_EXEC) - symcopy->st_value += map->pr_vaddr; - error = 0; - goto out; - } - } - } + error = lookup_name(e, dynsymscn, dynsymstridx, symbol, symcopy); + if (error == 0) + goto out; + + error = lookup_name(e, symtabscn, symtabstridx, symbol, symcopy); + if (error == 0) + goto out; + out: - DPRINTFX("found addr 0x%lx for %s", symcopy->st_value, symbol); + off = ehdr.e_type == ET_EXEC ? 0 : map->pr_vaddr; + symcopy->st_value += off; + err2: elf_end(e); err1: @@ -506,7 +484,6 @@ err0: return (error); } - int proc_iter_symbyaddr(struct proc_handle *p, const char *object, int which, int mask, proc_sym_f *func, void *cd) @@ -543,7 +520,7 @@ proc_iter_symbyaddr(struct proc_handle * scn = NULL; while ((scn = elf_nextscn(e, scn)) != NULL) { gelf_getshdr(scn, &shdr); - if (which == PR_SYMTAB && + if (which == PR_SYMTAB && shdr.sh_type == SHT_SYMTAB) { foundscn = scn; break; @@ -560,8 +537,7 @@ proc_iter_symbyaddr(struct proc_handle * DPRINTFX("ERROR: elf_getdata() failed: %s", elf_errmsg(-1)); goto err2; } - i = 0; - while (gelf_getsym(data, i++, &sym) != NULL) { + for (i = 0; gelf_getsym(data, i, &sym) != NULL; i++) { if (GELF_ST_BIND(sym.st_info) == STB_LOCAL && (mask & BIND_LOCAL) == 0) continue; From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 19:10:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22654269; Thu, 25 Sep 2014 19:10:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D4E1FD2; Thu, 25 Sep 2014 19:10:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PJAW7S040226; Thu, 25 Sep 2014 19:10:32 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PJAWRt040225; Thu, 25 Sep 2014 19:10:32 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201409251910.s8PJAWRt040225@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 25 Sep 2014 19:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272126 - head/sys/gnu/fs/reiserfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 19:10:33 -0000 Author: pfg Date: Thu Sep 25 19:10:32 2014 New Revision: 272126 URL: http://svnweb.freebsd.org/changeset/base/272126 Log: reiserfs: Use signed i_nlink Unlike Linux, FreeBSD's kernel doesn't like unsigned file link count. This is consistent with our ext2fs implementation. MFC after: 1 month Modified: head/sys/gnu/fs/reiserfs/reiserfs_fs_i.h Modified: head/sys/gnu/fs/reiserfs/reiserfs_fs_i.h ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_fs_i.h Thu Sep 25 19:08:06 2014 (r272125) +++ head/sys/gnu/fs/reiserfs/reiserfs_fs_i.h Thu Sep 25 19:10:32 2014 (r272126) @@ -59,7 +59,7 @@ struct reiserfs_node { flags read from sd_attrs. */ uint16_t i_mode; /* IFMT, permissions. */ - uint16_t i_nlink; /* File link count. */ + int16_t i_nlink; /* File link count. */ uint64_t i_size; /* File byte count. */ uint32_t i_bytes; uid_t i_uid; /* File owner. */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 19:22:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2122B6F2; Thu, 25 Sep 2014 19:22:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C160226; Thu, 25 Sep 2014 19:22:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PJMQQx048546; Thu, 25 Sep 2014 19:22:26 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PJMQnR048545; Thu, 25 Sep 2014 19:22:26 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201409251922.s8PJMQnR048545@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 25 Sep 2014 19:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272127 - head/usr.bin/grep/regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 19:22:27 -0000 Author: pfg Date: Thu Sep 25 19:22:26 2014 New Revision: 272127 URL: http://svnweb.freebsd.org/changeset/base/272127 Log: bsdgrep: Work-around for segmentation fault. Fix by David Carlier. Obtained from: HardenedBSD PR: 167921 MFC after: 1 month Modified: head/usr.bin/grep/regex/tre-fastmatch.c Modified: head/usr.bin/grep/regex/tre-fastmatch.c ============================================================================== --- head/usr.bin/grep/regex/tre-fastmatch.c Thu Sep 25 19:10:32 2014 (r272126) +++ head/usr.bin/grep/regex/tre-fastmatch.c Thu Sep 25 19:22:26 2014 (r272127) @@ -727,7 +727,7 @@ badpat: for (unsigned int i = 0; i < fg->len; i++) if (fg->pattern[i] == '\\') escaped = !escaped; - else if (fg->pattern[i] == '.' && escaped) + else if (fg->pattern[i] == '.' && fg->escmap && escaped) { fg->escmap[i] = true; escaped = false; From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 19:53:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD8EE604 for ; Thu, 25 Sep 2014 19:53:30 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7BEE7D9 for ; Thu, 25 Sep 2014 19:53:30 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PJrUn1074878 for ; Thu, 25 Sep 2014 19:53:30 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s8PJrUJ0074873 for svn-src-all@freebsd.org; Thu, 25 Sep 2014 19:53:30 GMT (envelope-from bdrewery) Received: (qmail 33785 invoked from network); 25 Sep 2014 14:53:28 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 25 Sep 2014 14:53:28 -0500 Message-ID: <542472AF.7020402@FreeBSD.org> Date: Thu, 25 Sep 2014 14:53:19 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r272122 - head/lib/libc/stdtime References: <201409251852.s8PIqIRD033822@svn.freebsd.org> In-Reply-To: <201409251852.s8PIqIRD033822@svn.freebsd.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8kqUtjJGjGjuu4x8BkdPXcgquw85HWItm" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 19:53:31 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8kqUtjJGjGjuu4x8BkdPXcgquw85HWItm Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 9/25/2014 1:52 PM, Pedro F. Giffuni wrote: > Author: pfg > Date: Thu Sep 25 18:52:17 2014 > New Revision: 272122 > URL: http://svnweb.freebsd.org/changeset/base/272122 >=20 > Log: > Add strptime(3) support for %U and %W > =20 > Add support for the missing POSIX-2001 %U and %W features: the > existing FreeBSD strptime code recognizes both directives and > validates that the week number lies in the permitted range, > but then simply discards the value. > =20 > Initial support for the feature was written by Paul Green with > important fixes by Andrey Chernov. Additional support for > handling tm_wday/tm_yday was written by David Carlier. > =20 > PR: 137307 > MFC after: 1 month Seems Relnotes worthy. >=20 > Modified: > head/lib/libc/stdtime/strptime.c >=20 > Modified: head/lib/libc/stdtime/strptime.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/lib/libc/stdtime/strptime.c Thu Sep 25 18:43:52 2014 (r272121)= > +++ head/lib/libc/stdtime/strptime.c Thu Sep 25 18:52:17 2014 (r272122)= > @@ -55,10 +55,32 @@ __FBSDID("$FreeBSD$"); > #include "un-namespace.h" > #include "libc_private.h" > #include "timelocal.h" > +#include "tzfile.h" > =20 > static char * _strptime(const char *, const char *, struct tm *, int *= , locale_t); > =20 > -#define asizeof(a) (sizeof (a) / sizeof ((a)[0])) > +#define asizeof(a) (sizeof(a) / sizeof((a)[0])) > + > +#define FLAG_NONE (1 << 0) > +#define FLAG_YEAR (1 << 1) > +#define FLAG_MONTH (1 << 2) > +#define FLAG_YDAY (1 << 3) > +#define FLAG_MDAY (1 << 4) > +#define FLAG_WDAY (1 << 5) > + > +/* > + * Calculate the week day of the first day of a year. Valid for > + * the Gregorian calendar, which began Sept 14, 1752 in the UK > + * and its colonies. Ref: > + * http://en.wikipedia.org/wiki/Calculating_the_day_of_the_week/ > + */ > + > +static int > +first_wday_of(int year) > +{ > + return (((2 * (3 - (year / 100) % 4)) + (year % 100) + > + ((year % 100) / 4) + (isleap(year) ? 6 : 0) + 1) % 7); > +} > =20 > static char * > _strptime(const char *buf, const char *fmt, struct tm *tm, int *GMTp, > @@ -66,9 +88,17 @@ _strptime(const char *buf, const char *f > { > char c; > const char *ptr; > + int day_offset =3D -1, wday_offset; > int i, len; > + int flags; > int Ealternative, Oalternative; > - struct lc_time_T *tptr =3D __get_current_time_locale(locale); > + const struct lc_time_T *tptr =3D __get_current_time_locale(locale); > + static int start_of_month[2][13] =3D { > + {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}, > + {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366} > + }; > + > + flags =3D FLAG_NONE; > =20 > ptr =3D fmt; > while (*ptr !=3D 0) { > @@ -119,7 +149,9 @@ label: > if (i < 19) > return (NULL); > =20 > - tm->tm_year =3D i * 100 - 1900; > + tm->tm_year =3D i * 100 - TM_YEAR_BASE; > + flags |=3D FLAG_YEAR; > + > break; > =20 > case 'c': > @@ -197,6 +229,8 @@ label: > return (NULL); > =20 > tm->tm_yday =3D i - 1; > + flags |=3D FLAG_YDAY; > + > break; > =20 > case 'M': > @@ -303,7 +337,32 @@ label: > return (NULL); > =20 > tm->tm_wday =3D i; > + if (day_offset >=3D 0 && (i - day_offset) !=3D 0) { > + tm->tm_yday +=3D i - day_offset; > + i =3D 0; > + while (tm->tm_yday >=3D > + start_of_month[isleap(tm->tm_year + > + TM_YEAR_BASE)][i]) > + i++; > + if (i > 12) > + { > + i =3D 1; > + tm->tm_yday -=3D > + start_of_month[isleap(tm->tm_year + > + TM_YEAR_BASE)] > + [12]; > + tm->tm_year++; > + } > + tm->tm_mon =3D i - 1; > + tm->tm_mday =3D tm->tm_yday - > + start_of_month[isleap(tm->tm_year + > + TM_YEAR_BASE)] > + [i - 1] + 1; > + } > buf +=3D len; > + flags |=3D FLAG_YEAR | FLAG_MONTH | FLAG_YDAY | > + FLAG_MDAY | FLAG_WDAY; > + > break; > =20 > case 'U': > @@ -313,6 +372,8 @@ label: > * information present in the tm structure at this > * point to calculate a real value, so just check the > * range for now. > + * We expect that the year has already been > + * parsed. > */ > if (!isdigit_l((unsigned char)*buf, locale)) > return (NULL); > @@ -327,6 +388,45 @@ label: > if (i > 53) > return (NULL); > =20 > + /* Week numbers are l-origin. So that we can always > + * return the date of a Sunday (or Monday), treat week > + * 0 as week 1. > + */ > + > + if (i =3D=3D 0) > + i =3D 1; > + > + if (c =3D=3D 'U') > + day_offset =3D TM_SUNDAY; > + else > + day_offset =3D TM_MONDAY; > + > + /* Set the date to the first Sunday (or Monday) > + * of the specified week of the year. > + */ > + > + tm->tm_yday =3D (7 - first_wday_of(tm->tm_year + > + TM_YEAR_BASE) + day_offset) % 7 + (i - 1) * 7; > + i =3D 0; > + while (tm->tm_yday >=3D > + start_of_month[isleap(tm->tm_year + TM_YEAR_BASE)][i]) > + i++; > + if (i > 12) > + { > + i =3D 1; > + tm->tm_yday -=3D > + start_of_month[isleap(tm->tm_year + > + TM_YEAR_BASE)][12]; > + tm->tm_year++; > + } > + tm->tm_mon =3D i - 1; > + tm->tm_mday =3D tm->tm_yday - > + start_of_month[isleap(tm->tm_year + TM_YEAR_BASE)] > + [i - 1] + 1; > + tm->tm_wday =3D day_offset; > + flags |=3D FLAG_YEAR | FLAG_MONTH | FLAG_YDAY | > + FLAG_MDAY | FLAG_WDAY; > + > break; > =20 > case 'w': > @@ -338,6 +438,7 @@ label: > return (NULL); > =20 > tm->tm_wday =3D i; > + flags !=3D FLAG_WDAY; > =20 > break; > =20 > @@ -374,6 +475,7 @@ label: > return (NULL); > =20 > tm->tm_mday =3D i; > + flags |=3D FLAG_MDAY; > =20 > break; > =20 > @@ -413,6 +515,8 @@ label: > =20 > tm->tm_mon =3D i; > buf +=3D len; > + flags |=3D FLAG_MONTH; > + > break; > =20 > case 'm': > @@ -430,6 +534,7 @@ label: > return (NULL); > =20 > tm->tm_mon =3D i - 1; > + flags |=3D FLAG_MONTH; > =20 > break; > =20 > @@ -471,13 +576,14 @@ label: > len--; > } > if (c =3D=3D 'Y') > - i -=3D 1900; > + i -=3D TM_YEAR_BASE; > if (c =3D=3D 'y' && i < 69) > i +=3D 100; > if (i < 0) > return (NULL); > =20 > tm->tm_year =3D i; > + flags |=3D FLAG_YEAR; > =20 > break; > =20 > @@ -543,10 +649,25 @@ label: > break; > } > } > + > + if (flags & (FLAG_YEAR | FLAG_MONTH)) { > + if (!tm->tm_yday && (flags & FLAG_MDAY)) > + tm->tm_yday =3D start_of_month[isleap(tm->tm_year > + + TM_YEAR_BASE)][tm->tm_mon] + (tm->tm_mday - 1); > + if (!tm->tm_wday) { > + i =3D 0; > + wday_offset =3D first_wday_of(tm->tm_year); > + while (i++ <=3D tm->tm_yday) > + if (wday_offset++ >=3D 6) > + wday_offset =3D 0; > + > + tm->tm_wday =3D wday_offset; > + } > + } > + > return ((char *)buf); > } > =20 > - > char * > strptime_l(const char * __restrict buf, const char * __restrict fmt, > struct tm * __restrict tm, locale_t loc) >=20 --=20 Regards, Bryan Drewery --8kqUtjJGjGjuu4x8BkdPXcgquw85HWItm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJUJHKvAAoJEDXXcbtuRpfPksoH/0JL4qt5Hwwmn+P3bT3MsLfo GqvUAzNmie1oBHl0hC8VrCBi5WBmep0YwWbLkdG1j6FK57zpa0H2cS/Eyx2Aj27C GYxLDdwW8pGrOMGFL2RV3gQtzFgyKzdo0pgkR6kuTvyX8qNrrerXOtuse0IP9+cK l90sJfrmNnJVv5537nAwYng6RsMGdglH/gh8HZMbjde66X9sUt79YIVaQs1GkkEb f55QeKHgnFuqhhZLSX7QUD1o+gJDV/DqvHIl8IbmLgJYZgVir2Sc6ql5MKNmpCFl A6mx0LjbVIFttHOZEGyQyJ59R29qBh4g/Lw7WuncUw41I6ynv3w2rxvQPP9khVo= =SRWK -----END PGP SIGNATURE----- --8kqUtjJGjGjuu4x8BkdPXcgquw85HWItm-- From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 20:34:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E6A6694; Thu, 25 Sep 2014 20:34:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 746BEC45; Thu, 25 Sep 2014 20:34:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PKYH9v082522; Thu, 25 Sep 2014 20:34:17 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PKYE3m082507; Thu, 25 Sep 2014 20:34:14 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409252034.s8PKYE3m082507@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 25 Sep 2014 20:34:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272128 - in stable/10: . contrib/hyperv etc/devd etc/mtree libexec libexec/hyperv share/mk sys/conf sys/dev/hyperv/include sys/dev/hyperv/utilities sys/modules/hyperv/utilities tools/b... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 20:34:17 -0000 Author: delphij Date: Thu Sep 25 20:34:13 2014 New Revision: 272128 URL: http://svnweb.freebsd.org/changeset/base/272128 Log: MFC r271493,271688,271689,271696,271854: Import HyperV Key-Value Pair (KVP) driver and daemon code by Microsoft, many thanks for their continued support of FreeBSD. While I'm there, also implement a new build knob, WITHOUT_HYPERV to disable building and installing of the HyperV utilities when necessary. The HyperV utilities are only built for i386 and amd64 targets. Approved by: re (gjb) Added: stable/10/contrib/hyperv/ - copied from r271493, head/contrib/hyperv/ stable/10/etc/devd/hyperv.conf - copied, changed from r271696, head/etc/devd/hyperv.conf stable/10/libexec/hyperv/ - copied from r271493, head/libexec/hyperv/ stable/10/sys/dev/hyperv/utilities/hv_kvp.c - copied unchanged from r271493, head/sys/dev/hyperv/utilities/hv_kvp.c stable/10/sys/dev/hyperv/utilities/unicode.h - copied unchanged from r271493, head/sys/dev/hyperv/utilities/unicode.h stable/10/tools/build/options/WITHOUT_HYPERV - copied unchanged from r271493, head/tools/build/options/WITHOUT_HYPERV stable/10/tools/build/options/WITH_HYPERV - copied unchanged from r271493, head/tools/build/options/WITH_HYPERV stable/10/usr.sbin/hyperv/ - copied from r271493, head/usr.sbin/hyperv/ Modified: stable/10/ObsoleteFiles.inc stable/10/etc/devd/Makefile stable/10/etc/mtree/BSD.usr.dist stable/10/etc/mtree/BSD.var.dist stable/10/libexec/Makefile stable/10/share/mk/bsd.own.mk stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/utilities/hv_kvp.h stable/10/sys/dev/hyperv/utilities/hv_util.c stable/10/sys/modules/hyperv/utilities/Makefile stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.sbin/Makefile.amd64 stable/10/usr.sbin/Makefile.i386 Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Thu Sep 25 19:22:26 2014 (r272127) +++ stable/10/ObsoleteFiles.inc Thu Sep 25 20:34:13 2014 (r272128) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20140925: hv_kvpd rc.d script removed in favor of devd configuration +OLD_FILES+=etc/rc.d/hv_kvpd # 20140814: libopie version bump OLD_LIBS+=usr/lib/libopie.so.7 OLD_LIBS+=usr/lib32/libopie.so.7 Modified: stable/10/etc/devd/Makefile ============================================================================== --- stable/10/etc/devd/Makefile Thu Sep 25 19:22:26 2014 (r272127) +++ stable/10/etc/devd/Makefile Thu Sep 25 20:34:13 2014 (r272128) @@ -10,6 +10,10 @@ FILES+= apple.conf FILES+= asus.conf .endif +.if ${MK_HYPERV} != "no" +FILES+= hyperv.conf +.endif + NO_OBJ= FILESDIR= /etc/devd FILESMODE= 644 Copied and modified: stable/10/etc/devd/hyperv.conf (from r271696, head/etc/devd/hyperv.conf) ============================================================================== --- head/etc/devd/hyperv.conf Wed Sep 17 02:32:22 2014 (r271696, copy source) +++ stable/10/etc/devd/hyperv.conf Thu Sep 25 20:34:13 2014 (r272128) @@ -6,7 +6,7 @@ notify 10 { match "system" "DEVFS"; match "subsystem" "CDEV"; match "type" "CREATE"; - match "cdev" "/dev/hv_kvp_dev"; + match "cdev" "hv_kvp_dev"; action "/usr/sbin/hv_kvp_daemon"; }; @@ -14,6 +14,6 @@ notify 10 { match "system" "DEVFS"; match "subsystem" "CDEV"; match "type" "DESTROY"; - match "cdev" "/dev/hv_kvp_dev"; + match "cdev" "hv_kvp_dev"; action "pkill -x hv_kvp_daemon"; }; Modified: stable/10/etc/mtree/BSD.usr.dist ============================================================================== --- stable/10/etc/mtree/BSD.usr.dist Thu Sep 25 19:22:26 2014 (r272127) +++ stable/10/etc/mtree/BSD.usr.dist Thu Sep 25 20:34:13 2014 (r272128) @@ -108,6 +108,8 @@ .. bsdinstall .. + hyperv + .. lpr ru .. Modified: stable/10/etc/mtree/BSD.var.dist ============================================================================== --- stable/10/etc/mtree/BSD.var.dist Thu Sep 25 19:22:26 2014 (r272127) +++ stable/10/etc/mtree/BSD.var.dist Thu Sep 25 20:34:13 2014 (r272128) @@ -42,6 +42,8 @@ .. freebsd-update mode=0700 .. + hyperv mode=0700 + .. ipf mode=0700 .. pkg Modified: stable/10/libexec/Makefile ============================================================================== --- stable/10/libexec/Makefile Thu Sep 25 19:22:26 2014 (r272127) +++ stable/10/libexec/Makefile Thu Sep 25 20:34:13 2014 (r272128) @@ -10,6 +10,7 @@ SUBDIR= ${_atf} \ fingerd \ ftpd \ getty \ + ${_hyperv} \ ${_mail.local} \ ${_mknetid} \ ${_pppoed} \ @@ -42,6 +43,10 @@ _atrun= atrun _comsat= comsat .endif +.if ${MK_HYPERV} != "no" +_hyperv= hyperv +.endif + .if ${MK_NIS} != "no" _mknetid= mknetid _ypxfr= ypxfr Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Thu Sep 25 19:22:26 2014 (r272127) +++ stable/10/share/mk/bsd.own.mk Thu Sep 25 20:34:13 2014 (r272128) @@ -438,6 +438,12 @@ __DEFAULT_YES_OPTIONS+=FDT .else __DEFAULT_NO_OPTIONS+=FDT .endif +# HyperV is only available for x86 and amd64. +.if ${__T} == "amd64" || ${__T} == "i386" +__DEFAULT_YES_OPTIONS+=HYPERV +.else +__DEFAULT_NO_OPTIONS+=HYPERV +.endif .undef __T # Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Thu Sep 25 19:22:26 2014 (r272127) +++ stable/10/sys/conf/files.amd64 Thu Sep 25 20:34:13 2014 (r272128) @@ -234,6 +234,7 @@ dev/hyperv/netvsc/hv_netvsc_drv_freebsd. dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv dev/hyperv/stordisengage/hv_ata_pci_disengage.c optional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv +dev/hyperv/utilities/hv_kvp.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hv_channel.c optional hyperv dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Thu Sep 25 19:22:26 2014 (r272127) +++ stable/10/sys/conf/files.i386 Thu Sep 25 20:34:13 2014 (r272128) @@ -227,6 +227,7 @@ dev/hyperv/netvsc/hv_netvsc_drv_freebsd. dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv dev/hyperv/stordisengage/hv_ata_pci_disengage.c optional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv +dev/hyperv/utilities/hv_kvp.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hv_channel.c optional hyperv dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Thu Sep 25 19:22:26 2014 (r272127) +++ stable/10/sys/dev/hyperv/include/hyperv.h Thu Sep 25 20:34:13 2014 (r272128) @@ -795,5 +795,34 @@ hv_get_phys_addr(void *virt) return (ret); } + +/** + * KVP related structures + * + */ +typedef struct hv_vmbus_service { + hv_guid guid; /* Hyper-V GUID */ + char *name; /* name of service */ + boolean_t enabled; /* service enabled */ + hv_work_queue *work_queue; /* background work queue */ + + /* + * function to initialize service + */ + int (*init)(struct hv_vmbus_service *); + + /* + * function to process Hyper-V messages + */ + void (*callback)(void *); +} hv_vmbus_service; + +extern uint8_t* receive_buffer[]; +extern hv_vmbus_service service_table[]; + +void hv_kvp_callback(void *context); +int hv_kvp_init(hv_vmbus_service *serv); +void hv_kvp_deinit(void); + #endif /* __HYPERV_H__ */ Copied: stable/10/sys/dev/hyperv/utilities/hv_kvp.c (from r271493, head/sys/dev/hyperv/utilities/hv_kvp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/hyperv/utilities/hv_kvp.c Thu Sep 25 20:34:13 2014 (r272128, copy of r271493, head/sys/dev/hyperv/utilities/hv_kvp.c) @@ -0,0 +1,1001 @@ +/*- + * Copyright (c) 2014 Microsoft Corp. + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Author: Sainath Varanasi. + * Date: 4/2012 + * Email: bsdic@microsoft.com + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "unicode.h" +#include "hv_kvp.h" + +/* hv_kvp defines */ +#define BUFFERSIZE sizeof(struct hv_kvp_msg) +#define KVP_SUCCESS 0 +#define KVP_ERROR 1 +#define kvp_hdr hdr.kvp_hdr + +/* hv_kvp debug control */ +static int hv_kvp_log = 0; +SYSCTL_INT(_dev, OID_AUTO, hv_kvp_log, CTLFLAG_RW, &hv_kvp_log, 0, + "hv_kvp log"); + +#define hv_kvp_log_error(...) do { \ + if (hv_kvp_log > 0) \ + log(LOG_ERR, "hv_kvp: " __VA_ARGS__); \ +} while (0) + +#define hv_kvp_log_info(...) do { \ + if (hv_kvp_log > 1) \ + log(LOG_INFO, "hv_kvp: " __VA_ARGS__); \ +} while (0) + +/* character device prototypes */ +static d_open_t hv_kvp_dev_open; +static d_close_t hv_kvp_dev_close; +static d_read_t hv_kvp_dev_daemon_read; +static d_write_t hv_kvp_dev_daemon_write; +static d_poll_t hv_kvp_dev_daemon_poll; + +/* hv_kvp prototypes */ +static int hv_kvp_req_in_progress(void); +static void hv_kvp_transaction_init(uint32_t, hv_vmbus_channel *, uint64_t, uint8_t *); +static void hv_kvp_send_msg_to_daemon(void); +static void hv_kvp_process_request(void *context); + +/* hv_kvp character device structure */ +static struct cdevsw hv_kvp_cdevsw = +{ + .d_version = D_VERSION, + .d_open = hv_kvp_dev_open, + .d_close = hv_kvp_dev_close, + .d_read = hv_kvp_dev_daemon_read, + .d_write = hv_kvp_dev_daemon_write, + .d_poll = hv_kvp_dev_daemon_poll, + .d_name = "hv_kvp_dev", +}; +static struct cdev *hv_kvp_dev; +static struct hv_kvp_msg *hv_kvp_dev_buf; +struct proc *daemon_task; + +/* + * Global state to track and synchronize multiple + * KVP transaction requests from the host. + */ +static struct { + + /* Pre-allocated work item for queue */ + hv_work_item work_item; + + /* Unless specified the pending mutex should be + * used to alter the values of the following paramters: + * 1. req_in_progress + * 2. req_timed_out + * 3. pending_reqs. + */ + struct mtx pending_mutex; + + /* To track if transaction is active or not */ + boolean_t req_in_progress; + /* Tracks if daemon did not reply back in time */ + boolean_t req_timed_out; + /* Tracks if daemon is serving a request currently */ + boolean_t daemon_busy; + /* Count of KVP requests from Hyper-V. */ + uint64_t pending_reqs; + + + /* Length of host message */ + uint32_t host_msg_len; + + /* Pointer to channel */ + hv_vmbus_channel *channelp; + + /* Host message id */ + uint64_t host_msg_id; + + /* Current kvp message from the host */ + struct hv_kvp_msg *host_kvp_msg; + + /* Current kvp message for daemon */ + struct hv_kvp_msg daemon_kvp_msg; + + /* Rcv buffer for communicating with the host*/ + uint8_t *rcv_buf; + + /* Device semaphore to control communication */ + struct sema dev_sema; + + /* Indicates if daemon registered with driver */ + boolean_t register_done; + + /* Character device status */ + boolean_t dev_accessed; +} kvp_globals; + +/* global vars */ +MALLOC_DECLARE(M_HV_KVP_DEV_BUF); +MALLOC_DEFINE(M_HV_KVP_DEV_BUF, "hv_kvp_dev buffer", "buffer for hv_kvp_dev module"); + +/* + * hv_kvp low level functions + */ + +/* + * Check if kvp transaction is in progres + */ +static int +hv_kvp_req_in_progress(void) +{ + + return (kvp_globals.req_in_progress); +} + + +/* + * This routine is called whenever a message is received from the host + */ +static void +hv_kvp_transaction_init(uint32_t rcv_len, hv_vmbus_channel *rcv_channel, + uint64_t request_id, uint8_t *rcv_buf) +{ + + /* Store all the relevant message details in the global structure */ + /* Do not need to use mutex for req_in_progress here */ + kvp_globals.req_in_progress = true; + kvp_globals.host_msg_len = rcv_len; + kvp_globals.channelp = rcv_channel; + kvp_globals.host_msg_id = request_id; + kvp_globals.rcv_buf = rcv_buf; + kvp_globals.host_kvp_msg = (struct hv_kvp_msg *)&rcv_buf[ + sizeof(struct hv_vmbus_pipe_hdr) + + sizeof(struct hv_vmbus_icmsg_hdr)]; +} + + +/* + * hv_kvp - version neogtiation function + */ +static void +hv_kvp_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, + struct hv_vmbus_icmsg_negotiate *negop, + uint8_t *buf) +{ + int icframe_vercnt; + int icmsg_vercnt; + + icmsghdrp->icmsgsize = 0x10; + + negop = (struct hv_vmbus_icmsg_negotiate *)&buf[ + sizeof(struct hv_vmbus_pipe_hdr) + + sizeof(struct hv_vmbus_icmsg_hdr)]; + icframe_vercnt = negop->icframe_vercnt; + icmsg_vercnt = negop->icmsg_vercnt; + + /* + * Select the framework version number we will support + */ + if ((icframe_vercnt >= 2) && (negop->icversion_data[1].major == 3)) { + icframe_vercnt = 3; + if (icmsg_vercnt >= 2) + icmsg_vercnt = 4; + else + icmsg_vercnt = 3; + } else { + icframe_vercnt = 1; + icmsg_vercnt = 1; + } + + negop->icframe_vercnt = 1; + negop->icmsg_vercnt = 1; + negop->icversion_data[0].major = icframe_vercnt; + negop->icversion_data[0].minor = 0; + negop->icversion_data[1].major = icmsg_vercnt; + negop->icversion_data[1].minor = 0; +} + + +/* + * Convert ip related info in umsg from utf8 to utf16 and store in hmsg + */ +static int +hv_kvp_convert_utf8_ipinfo_to_utf16(struct hv_kvp_msg *umsg, + struct hv_kvp_ip_msg *host_ip_msg) +{ + int err_ip, err_subnet, err_gway, err_dns, err_adap; + int UNUSED_FLAG = 1; + + utf8_to_utf16((uint16_t *)host_ip_msg->kvp_ip_val.ip_addr, + MAX_IP_ADDR_SIZE, + (char *)umsg->body.kvp_ip_val.ip_addr, + strlen((char *)umsg->body.kvp_ip_val.ip_addr), + UNUSED_FLAG, + &err_ip); + utf8_to_utf16((uint16_t *)host_ip_msg->kvp_ip_val.sub_net, + MAX_IP_ADDR_SIZE, + (char *)umsg->body.kvp_ip_val.sub_net, + strlen((char *)umsg->body.kvp_ip_val.sub_net), + UNUSED_FLAG, + &err_subnet); + utf8_to_utf16((uint16_t *)host_ip_msg->kvp_ip_val.gate_way, + MAX_GATEWAY_SIZE, + (char *)umsg->body.kvp_ip_val.gate_way, + strlen((char *)umsg->body.kvp_ip_val.gate_way), + UNUSED_FLAG, + &err_gway); + utf8_to_utf16((uint16_t *)host_ip_msg->kvp_ip_val.dns_addr, + MAX_IP_ADDR_SIZE, + (char *)umsg->body.kvp_ip_val.dns_addr, + strlen((char *)umsg->body.kvp_ip_val.dns_addr), + UNUSED_FLAG, + &err_dns); + utf8_to_utf16((uint16_t *)host_ip_msg->kvp_ip_val.adapter_id, + MAX_IP_ADDR_SIZE, + (char *)umsg->body.kvp_ip_val.adapter_id, + strlen((char *)umsg->body.kvp_ip_val.adapter_id), + UNUSED_FLAG, + &err_adap); + + host_ip_msg->kvp_ip_val.dhcp_enabled = umsg->body.kvp_ip_val.dhcp_enabled; + host_ip_msg->kvp_ip_val.addr_family = umsg->body.kvp_ip_val.addr_family; + + return (err_ip | err_subnet | err_gway | err_dns | err_adap); +} + + +/* + * Convert ip related info in hmsg from utf16 to utf8 and store in umsg + */ +static int +hv_kvp_convert_utf16_ipinfo_to_utf8(struct hv_kvp_ip_msg *host_ip_msg, + struct hv_kvp_msg *umsg) +{ + int err_ip, err_subnet, err_gway, err_dns, err_adap; + int UNUSED_FLAG = 1; + int guid_index; + struct hv_device *hv_dev; /* GUID Data Structure */ + hn_softc_t *sc; /* hn softc structure */ + char if_name[4]; + unsigned char guid_instance[40]; + char *guid_data = NULL; + char buf[39]; + + struct guid_extract { + char a1[2]; + char a2[2]; + char a3[2]; + char a4[2]; + char b1[2]; + char b2[2]; + char c1[2]; + char c2[2]; + char d[4]; + char e[12]; + }; + + struct guid_extract *id; + device_t *devs; + int devcnt; + + /* IP Address */ + utf16_to_utf8((char *)umsg->body.kvp_ip_val.ip_addr, + MAX_IP_ADDR_SIZE, + (uint16_t *)host_ip_msg->kvp_ip_val.ip_addr, + MAX_IP_ADDR_SIZE, + UNUSED_FLAG, + &err_ip); + + /* Adapter ID : GUID */ + utf16_to_utf8((char *)umsg->body.kvp_ip_val.adapter_id, + MAX_ADAPTER_ID_SIZE, + (uint16_t *)host_ip_msg->kvp_ip_val.adapter_id, + MAX_ADAPTER_ID_SIZE, + UNUSED_FLAG, + &err_adap); + + if (devclass_get_devices(devclass_find("hn"), &devs, &devcnt) == 0) { + for (devcnt = devcnt - 1; devcnt >= 0; devcnt--) { + sc = device_get_softc(devs[devcnt]); + + /* Trying to find GUID of Network Device */ + hv_dev = sc->hn_dev_obj; + + for (guid_index = 0; guid_index < 16; guid_index++) { + sprintf(&guid_instance[guid_index * 2], "%02x", + hv_dev->device_id.data[guid_index]); + } + + guid_data = (char *)guid_instance; + id = (struct guid_extract *)guid_data; + snprintf(buf, sizeof(buf), "{%.2s%.2s%.2s%.2s-%.2s%.2s-%.2s%.2s-%.4s-%s}", + id->a4, id->a3, id->a2, id->a1, + id->b2, id->b1, id->c2, id->c1, id->d, id->e); + guid_data = NULL; + sprintf(if_name, "%s%d", "hn", device_get_unit(devs[devcnt])); + + if (strncmp(buf, (char *)umsg->body.kvp_ip_val.adapter_id, 39) == 0) { + strcpy((char *)umsg->body.kvp_ip_val.adapter_id, if_name); + break; + } + } + free(devs, M_TEMP); + } + + /* Address Family , DHCP , SUBNET, Gateway, DNS */ + umsg->kvp_hdr.operation = host_ip_msg->operation; + umsg->body.kvp_ip_val.addr_family = host_ip_msg->kvp_ip_val.addr_family; + umsg->body.kvp_ip_val.dhcp_enabled = host_ip_msg->kvp_ip_val.dhcp_enabled; + utf16_to_utf8((char *)umsg->body.kvp_ip_val.sub_net, MAX_IP_ADDR_SIZE, + (uint16_t *)host_ip_msg->kvp_ip_val.sub_net, + MAX_IP_ADDR_SIZE, + UNUSED_FLAG, + &err_subnet); + + utf16_to_utf8((char *)umsg->body.kvp_ip_val.gate_way, MAX_GATEWAY_SIZE, + (uint16_t *)host_ip_msg->kvp_ip_val.gate_way, + MAX_GATEWAY_SIZE, + UNUSED_FLAG, + &err_gway); + + utf16_to_utf8((char *)umsg->body.kvp_ip_val.dns_addr, MAX_IP_ADDR_SIZE, + (uint16_t *)host_ip_msg->kvp_ip_val.dns_addr, + MAX_IP_ADDR_SIZE, + UNUSED_FLAG, + &err_dns); + + return (err_ip | err_subnet | err_gway | err_dns | err_adap); +} + + +/* + * Prepare a user kvp msg based on host kvp msg (utf16 to utf8) + * Ensure utf16_utf8 takes care of the additional string terminating char!! + */ +static void +hv_kvp_convert_hostmsg_to_usermsg(void) +{ + int utf_err = 0; + uint32_t value_type; + struct hv_kvp_ip_msg *host_ip_msg = (struct hv_kvp_ip_msg *) + kvp_globals.host_kvp_msg; + + struct hv_kvp_msg *hmsg = kvp_globals.host_kvp_msg; + struct hv_kvp_msg *umsg = &kvp_globals.daemon_kvp_msg; + + memset(umsg, 0, sizeof(struct hv_kvp_msg)); + + umsg->kvp_hdr.operation = hmsg->kvp_hdr.operation; + umsg->kvp_hdr.pool = hmsg->kvp_hdr.pool; + + switch (umsg->kvp_hdr.operation) { + case HV_KVP_OP_SET_IP_INFO: + hv_kvp_convert_utf16_ipinfo_to_utf8(host_ip_msg, umsg); + break; + + case HV_KVP_OP_GET_IP_INFO: + utf16_to_utf8((char *)umsg->body.kvp_ip_val.adapter_id, + MAX_ADAPTER_ID_SIZE, + (uint16_t *)host_ip_msg->kvp_ip_val.adapter_id, + MAX_ADAPTER_ID_SIZE, 1, &utf_err); + + umsg->body.kvp_ip_val.addr_family = + host_ip_msg->kvp_ip_val.addr_family; + break; + + case HV_KVP_OP_SET: + value_type = hmsg->body.kvp_set.data.value_type; + + switch (value_type) { + case HV_REG_SZ: + umsg->body.kvp_set.data.value_size = + utf16_to_utf8( + (char *)umsg->body.kvp_set.data.msg_value.value, + HV_KVP_EXCHANGE_MAX_VALUE_SIZE - 1, + (uint16_t *)hmsg->body.kvp_set.data.msg_value.value, + hmsg->body.kvp_set.data.value_size, + 1, &utf_err); + /* utf8 encoding */ + umsg->body.kvp_set.data.value_size = + umsg->body.kvp_set.data.value_size / 2; + break; + + case HV_REG_U32: + umsg->body.kvp_set.data.value_size = + sprintf(umsg->body.kvp_set.data.msg_value.value, "%d", + hmsg->body.kvp_set.data.msg_value.value_u32) + 1; + break; + + case HV_REG_U64: + umsg->body.kvp_set.data.value_size = + sprintf(umsg->body.kvp_set.data.msg_value.value, "%llu", + (unsigned long long) + hmsg->body.kvp_set.data.msg_value.value_u64) + 1; + break; + } + + umsg->body.kvp_set.data.key_size = + utf16_to_utf8( + umsg->body.kvp_set.data.key, + HV_KVP_EXCHANGE_MAX_KEY_SIZE - 1, + (uint16_t *)hmsg->body.kvp_set.data.key, + hmsg->body.kvp_set.data.key_size, + 1, &utf_err); + + /* utf8 encoding */ + umsg->body.kvp_set.data.key_size = + umsg->body.kvp_set.data.key_size / 2; + break; + + case HV_KVP_OP_GET: + umsg->body.kvp_get.data.key_size = + utf16_to_utf8(umsg->body.kvp_get.data.key, + HV_KVP_EXCHANGE_MAX_KEY_SIZE - 1, + (uint16_t *)hmsg->body.kvp_get.data.key, + hmsg->body.kvp_get.data.key_size, + 1, &utf_err); + /* utf8 encoding */ + umsg->body.kvp_get.data.key_size = + umsg->body.kvp_get.data.key_size / 2; + break; + + case HV_KVP_OP_DELETE: + umsg->body.kvp_delete.key_size = + utf16_to_utf8(umsg->body.kvp_delete.key, + HV_KVP_EXCHANGE_MAX_KEY_SIZE - 1, + (uint16_t *)hmsg->body.kvp_delete.key, + hmsg->body.kvp_delete.key_size, + 1, &utf_err); + /* utf8 encoding */ + umsg->body.kvp_delete.key_size = + umsg->body.kvp_delete.key_size / 2; + break; + + case HV_KVP_OP_ENUMERATE: + umsg->body.kvp_enum_data.index = + hmsg->body.kvp_enum_data.index; + break; + + default: + hv_kvp_log_info("%s: daemon_kvp_msg: Invalid operation : %d\n", + __func__, umsg->kvp_hdr.operation); + } +} + + +/* + * Prepare a host kvp msg based on user kvp msg (utf8 to utf16) + */ +static int +hv_kvp_convert_usermsg_to_hostmsg(void) +{ + int hkey_len = 0, hvalue_len = 0, utf_err = 0; + struct hv_kvp_exchg_msg_value *host_exchg_data; + char *key_name, *value; + + struct hv_kvp_msg *umsg = &kvp_globals.daemon_kvp_msg; + struct hv_kvp_msg *hmsg = kvp_globals.host_kvp_msg; + struct hv_kvp_ip_msg *host_ip_msg = (struct hv_kvp_ip_msg *)hmsg; + + switch (hmsg->kvp_hdr.operation) { + case HV_KVP_OP_GET_IP_INFO: + return (hv_kvp_convert_utf8_ipinfo_to_utf16(umsg, host_ip_msg)); + + case HV_KVP_OP_SET_IP_INFO: + case HV_KVP_OP_SET: + case HV_KVP_OP_DELETE: + return (KVP_SUCCESS); + + case HV_KVP_OP_ENUMERATE: + host_exchg_data = &hmsg->body.kvp_enum_data.data; + key_name = umsg->body.kvp_enum_data.data.key; + hkey_len = utf8_to_utf16((uint16_t *)host_exchg_data->key, + ((HV_KVP_EXCHANGE_MAX_KEY_SIZE / 2) - 2), + key_name, strlen(key_name), + 1, &utf_err); + /* utf16 encoding */ + host_exchg_data->key_size = 2 * (hkey_len + 1); + value = umsg->body.kvp_enum_data.data.msg_value.value; + hvalue_len = utf8_to_utf16( + (uint16_t *)host_exchg_data->msg_value.value, + ((HV_KVP_EXCHANGE_MAX_VALUE_SIZE / 2) - 2), + value, strlen(value), + 1, &utf_err); + host_exchg_data->value_size = 2 * (hvalue_len + 1); + host_exchg_data->value_type = HV_REG_SZ; + + if ((hkey_len < 0) || (hvalue_len < 0)) + return (HV_KVP_E_FAIL); + + return (KVP_SUCCESS); + + case HV_KVP_OP_GET: + host_exchg_data = &hmsg->body.kvp_get.data; + value = umsg->body.kvp_get.data.msg_value.value; + hvalue_len = utf8_to_utf16( + (uint16_t *)host_exchg_data->msg_value.value, + ((HV_KVP_EXCHANGE_MAX_VALUE_SIZE / 2) - 2), + value, strlen(value), + 1, &utf_err); + /* Convert value size to uft16 */ + host_exchg_data->value_size = 2 * (hvalue_len + 1); + /* Use values by string */ + host_exchg_data->value_type = HV_REG_SZ; + + if ((hkey_len < 0) || (hvalue_len < 0)) + return (HV_KVP_E_FAIL); + + return (KVP_SUCCESS); + + default: + return (HV_KVP_E_FAIL); + } +} + + +/* + * Send the response back to the host. + */ +static void +hv_kvp_respond_host(int error) +{ + struct hv_vmbus_icmsg_hdr *hv_icmsg_hdrp; + + hv_icmsg_hdrp = (struct hv_vmbus_icmsg_hdr *) + &kvp_globals.rcv_buf[sizeof(struct hv_vmbus_pipe_hdr)]; + + if (error) + error = HV_KVP_E_FAIL; + + hv_icmsg_hdrp->status = error; + hv_icmsg_hdrp->icflags = HV_ICMSGHDRFLAG_TRANSACTION | HV_ICMSGHDRFLAG_RESPONSE; + + error = hv_vmbus_channel_send_packet(kvp_globals.channelp, + kvp_globals.rcv_buf, + kvp_globals.host_msg_len, kvp_globals.host_msg_id, + HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, 0); + + if (error) + hv_kvp_log_info("%s: hv_kvp_respond_host: sendpacket error:%d\n", + __func__, error); +} + + +/* + * This is the main kvp kernel process that interacts with both user daemon + * and the host + */ +static void +hv_kvp_send_msg_to_daemon(void) +{ + /* Prepare kvp_msg to be sent to user */ + hv_kvp_convert_hostmsg_to_usermsg(); + + /* Send the msg to user via function deamon_read - setting sema */ + sema_post(&kvp_globals.dev_sema); +} + + +/* + * Function to read the kvp request buffer from host + * and interact with daemon + */ +static void +hv_kvp_process_request(void *context) +{ + uint8_t *kvp_buf; + hv_vmbus_channel *channel = context; + uint32_t recvlen = 0; + uint64_t requestid; + struct hv_vmbus_icmsg_hdr *icmsghdrp; + int ret = 0; + uint64_t pending_cnt = 1; + + hv_kvp_log_info("%s: entering hv_kvp_process_request\n", __func__); + kvp_buf = receive_buffer[HV_KVP]; + ret = hv_vmbus_channel_recv_packet(channel, kvp_buf, 2 * PAGE_SIZE, + &recvlen, &requestid); + + /* + * We start counting only after the daemon registers + * and therefore there could be requests pending in + * the VMBus that are not reflected in pending_cnt. + * Therefore we continue reading as long as either of + * the below conditions is true. + */ + + while ((pending_cnt>0) || ((ret == 0) && (recvlen > 0))) { + + if ((ret == 0) && (recvlen>0)) { + + icmsghdrp = (struct hv_vmbus_icmsg_hdr *) + &kvp_buf[sizeof(struct hv_vmbus_pipe_hdr)]; + + hv_kvp_transaction_init(recvlen, channel, requestid, kvp_buf); + if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { + hv_kvp_negotiate_version(icmsghdrp, NULL, kvp_buf); + hv_kvp_respond_host(ret); + + /* + * It is ok to not acquire the mutex before setting + * req_in_progress here because negotiation is the + * first thing that happens and hence there is no + * chance of a race condition. + */ + + kvp_globals.req_in_progress = false; + hv_kvp_log_info("%s :version negotiated\n", __func__); + + } else { + if (!kvp_globals.daemon_busy) { + + hv_kvp_log_info("%s: issuing qury to daemon\n", __func__); + mtx_lock(&kvp_globals.pending_mutex); + kvp_globals.req_timed_out = false; + kvp_globals.daemon_busy = true; + mtx_unlock(&kvp_globals.pending_mutex); + + hv_kvp_send_msg_to_daemon(); + hv_kvp_log_info("%s: waiting for daemon\n", __func__); + } + + /* Wait 5 seconds for daemon to respond back */ + tsleep(&kvp_globals, 0, "kvpworkitem", 5 * hz); + hv_kvp_log_info("%s: came out of wait\n", __func__); + } + } + + mtx_lock(&kvp_globals.pending_mutex); + + /* Notice that once req_timed_out is set to true + * it will remain true until the next request is + * sent to the daemon. The response from daemon + * is forwarded to host only when this flag is + * false. + */ + kvp_globals.req_timed_out = true; + + /* + * Cancel request if so need be. + */ + if (hv_kvp_req_in_progress()) { + hv_kvp_log_info("%s: request was still active after wait so failing\n", __func__); + hv_kvp_respond_host(HV_KVP_E_FAIL); + kvp_globals.req_in_progress = false; + } + + /* + * Decrement pending request count and + */ + if (kvp_globals.pending_reqs>0) { + kvp_globals.pending_reqs = kvp_globals.pending_reqs - 1; + } + pending_cnt = kvp_globals.pending_reqs; + + mtx_unlock(&kvp_globals.pending_mutex); + + /* + * Try reading next buffer + */ + recvlen = 0; + ret = hv_vmbus_channel_recv_packet(channel, kvp_buf, 2 * PAGE_SIZE, + &recvlen, &requestid); + hv_kvp_log_info("%s: read: context %p, pending_cnt %ju ret =%d, recvlen=%d\n", + __func__, context, pending_cnt, ret, recvlen); + } +} + + +/* + * Callback routine that gets called whenever there is a message from host + */ +void +hv_kvp_callback(void *context) +{ + uint64_t pending_cnt = 0; + + if (kvp_globals.register_done == false) { + + kvp_globals.channelp = context; + } else { + + mtx_lock(&kvp_globals.pending_mutex); + kvp_globals.pending_reqs = kvp_globals.pending_reqs + 1; + pending_cnt = kvp_globals.pending_reqs; + mtx_unlock(&kvp_globals.pending_mutex); + if (pending_cnt == 1) { + hv_kvp_log_info("%s: Queuing work item\n", __func__); + hv_queue_work_item( + service_table[HV_KVP].work_queue, + hv_kvp_process_request, + context + ); + } + } +} + + +/* + * This function is called by the hv_kvp_init - + * creates character device hv_kvp_dev + * allocates memory to hv_kvp_dev_buf + * + */ +static int +hv_kvp_dev_init(void) +{ + int error = 0; + + /* initialize semaphore */ + sema_init(&kvp_globals.dev_sema, 0, "hv_kvp device semaphore"); + /* create character device */ + error = make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, + &hv_kvp_dev, + &hv_kvp_cdevsw, + 0, + UID_ROOT, + GID_WHEEL, + 0640, + "hv_kvp_dev"); + + if (error != 0) + return (error); + + /* + * Malloc with M_WAITOK flag will never fail. + */ + hv_kvp_dev_buf = malloc(sizeof(*hv_kvp_dev_buf), M_HV_KVP_DEV_BUF, M_WAITOK | + M_ZERO); + + return (0); +} + + +/* + * This function is called by the hv_kvp_deinit - + * destroy character device + */ +static void +hv_kvp_dev_destroy(void) +{ + + if (daemon_task != NULL) { + PROC_LOCK(daemon_task); + kern_psignal(daemon_task, SIGKILL); + PROC_UNLOCK(daemon_task); + } + + destroy_dev(hv_kvp_dev); + free(hv_kvp_dev_buf, M_HV_KVP_DEV_BUF); + return; +} + + +static int +hv_kvp_dev_open(struct cdev *dev, int oflags, int devtype, + struct thread *td) +{ + + hv_kvp_log_info("%s: Opened device \"hv_kvp_device\" successfully.\n", __func__); + if (kvp_globals.dev_accessed) + return (-EBUSY); + + daemon_task = curproc; + kvp_globals.dev_accessed = true; + kvp_globals.daemon_busy = false; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 20:40:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C482C9CA; Thu, 25 Sep 2014 20:40:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADEB8CB7; Thu, 25 Sep 2014 20:40:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PKePsF083567; Thu, 25 Sep 2014 20:40:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PKeOAo083562; Thu, 25 Sep 2014 20:40:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409252040.s8PKeOAo083562@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 25 Sep 2014 20:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272129 - in head/sys: conf dev/fdc modules/fdc pc98/cbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 20:40:25 -0000 Author: jhb Date: Thu Sep 25 20:40:24 2014 New Revision: 272129 URL: http://svnweb.freebsd.org/changeset/base/272129 Log: Merge the PC98 fdc(4) driver into the MI driver. While here, replace the magic numbers used with NE7CMD_SPECIFY with invocations of the NE7_SPEC_x() macros. Approved by: nyan Added: head/sys/dev/fdc/fdc_cbus.c - copied, changed from r272118, head/sys/pc98/cbus/fdc_cbus.c Deleted: head/sys/pc98/cbus/fdc.c head/sys/pc98/cbus/fdc_cbus.c head/sys/pc98/cbus/fdcreg.h head/sys/pc98/cbus/fdcvar.h Modified: head/sys/conf/files.pc98 head/sys/dev/fdc/fdc.c head/sys/dev/fdc/fdcvar.h head/sys/modules/fdc/Makefile Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Thu Sep 25 20:34:13 2014 (r272128) +++ head/sys/conf/files.pc98 Thu Sep 25 20:40:24 2014 (r272129) @@ -98,6 +98,8 @@ dev/ct/ct_isa.c optional ct isa dev/ed/if_ed_cbus.c optional ed isa dev/ed/if_ed_wd80x3.c optional ed isa dev/fb/fb.c optional fb | gdc +dev/fdc/fdc.c optional fdc +dev/fdc/fdc_cbus.c optional fdc isa dev/fe/if_fe_cbus.c optional fe isa dev/hwpmc/hwpmc_amd.c optional hwpmc dev/hwpmc/hwpmc_intel.c optional hwpmc @@ -217,8 +219,6 @@ libkern/udivdi3.c standard libkern/umoddi3.c standard pc98/apm/apm_bioscall.S optional apm pc98/cbus/cbus_dma.c optional isa -pc98/cbus/fdc.c optional fdc -pc98/cbus/fdc_cbus.c optional fdc isa pc98/cbus/gdc.c optional gdc pc98/cbus/nmi.c standard pc98/cbus/olpt.c optional olpt Modified: head/sys/dev/fdc/fdc.c ============================================================================== --- head/sys/dev/fdc/fdc.c Thu Sep 25 20:34:13 2014 (r272128) +++ head/sys/dev/fdc/fdc.c Thu Sep 25 20:40:24 2014 (r272129) @@ -82,9 +82,13 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef PC98 +#include +#else #include -#include #include +#endif +#include #include @@ -136,33 +140,56 @@ __FBSDID("$FreeBSD$"); */ static struct fd_type fd_searchlist_360k[] = { +#ifndef PC98 { FDF_5_360 }, +#endif { 0 } }; static struct fd_type fd_searchlist_12m[] = { +#ifdef PC98 + { FDF_5_1200 | FL_AUTO }, + { FDF_5_720 | FL_AUTO }, + { FDF_5_360 | FL_AUTO }, + { FDF_5_640 | FL_AUTO }, + { FDF_5_1230 | FL_AUTO }, +#else { FDF_5_1200 | FL_AUTO }, { FDF_5_360 | FL_2STEP | FL_AUTO}, +#endif { 0 } }; static struct fd_type fd_searchlist_720k[] = { +#ifndef PC98 { FDF_3_720 }, +#endif { 0 } }; static struct fd_type fd_searchlist_144m[] = { +#ifdef PC98 { FDF_3_1440 | FL_AUTO}, + { FDF_3_1200 | FL_AUTO}, { FDF_3_720 | FL_AUTO}, + { FDF_3_360 | FL_AUTO}, + { FDF_3_640 | FL_AUTO}, + { FDF_3_1230 | FL_AUTO}, +#else + { FDF_3_1440 | FL_AUTO}, + { FDF_3_720 | FL_AUTO}, +#endif { 0 } }; static struct fd_type fd_searchlist_288m[] = { +#ifndef PC98 { FDF_3_1440 | FL_AUTO }, #if 0 { FDF_3_2880 | FL_AUTO }, /* XXX: probably doesn't work */ #endif { FDF_3_720 | FL_AUTO}, +#endif { 0 } }; @@ -183,6 +210,26 @@ static struct fd_type *fd_native_types[] * Internals start here */ +#ifdef PC98 +/* registers */ +#define FDSTS 0 /* NEC 765 Main Status Register (R) */ +#define FDDATA 1 /* NEC 765 Data Register (R/W) */ +#define FDCTL 2 /* FD Control Register */ +#define FDC_RST 0x80 /* FDC RESET */ +#define FDC_RDY 0x40 /* force READY */ +#define FDC_DD 0x20 /* FDD Mode Exchange 0:1M 1:640K */ +#define FDC_DMAE 0x10 /* enable floppy DMA */ +#define FDC_MTON 0x08 /* MOTOR ON (when EMTON=1)*/ +#define FDC_TMSK 0x04 /* TIMER MASK */ +#define FDC_TTRG 0x01 /* TIMER TRIGER */ + +#define FDP 3 +#define FDP_EMTON 0x04 /* enable MTON */ +#define FDP_FDDEXC 0x02 /* FDD Mode Exchange 1:1M 0:640K */ +#define FDP_PORTEXC 0x01 /* PORT Exchane 1:1M 0:640K */ + +#define FDEM 4 +#else /* registers */ #define FDOUT 2 /* Digital Output Register (W) */ #define FDO_FDSEL 0x03 /* floppy device select */ @@ -197,6 +244,7 @@ static struct fd_type *fd_native_types[] #define FDDSR 4 /* Data Rate Select Register (W) */ #define FDDATA 5 /* NEC 765 Data Register (R/W) */ #define FDCTL 7 /* Control Register (W) */ +#endif /* PC98 */ /* * The YE-DATA PC Card floppies use PIO to read in the data rather @@ -219,9 +267,11 @@ static struct fd_type *fd_native_types[] #define FDBCDR 0 /* And 1 */ #define FD_YE_DATAPORT 6 /* Drive Data port */ +#ifndef PC98 #define FDI_DCHG 0x80 /* diskette has been changed */ /* requires drive and motor being selected */ /* is cleared by any step pulse to drive */ +#endif /* * We have three private BIO commands. @@ -258,6 +308,9 @@ struct fd_data { struct g_provider *fd_provider; device_t dev; struct bio_queue_head fd_bq; +#ifdef PC98 + int pc98_trans; +#endif }; #define FD_NOT_VALID -2 @@ -281,11 +334,19 @@ static int retries = 10; SYSCTL_INT(_debug_fdc, OID_AUTO, retries, CTLFLAG_RW, &retries, 0, "Number of retries to attempt"); -static int spec1 = 0xaf; +#ifdef PC98 +static int spec1 = NE7_SPEC_1(4, 240); +#else +static int spec1 = NE7_SPEC_1(6, 240); +#endif SYSCTL_INT(_debug_fdc, OID_AUTO, spec1, CTLFLAG_RW, &spec1, 0, "Specification byte one (step-rate + head unload)"); -static int spec2 = 0x10; +#ifdef PC98 +static int spec2 = NE7_SPEC_2(2, 0); +#else +static int spec2 = NE7_SPEC_2(16, 0); +#endif SYSCTL_INT(_debug_fdc, OID_AUTO, spec2, CTLFLAG_RW, &spec2, 0, "Specification byte two (head load time + no-dma)"); @@ -335,12 +396,14 @@ fdctl_wr(struct fdc_data *fdc, u_int8_t fdregwr(fdc, FDCTL, v); } +#ifndef PC98 static void fdout_wr(struct fdc_data *fdc, u_int8_t v) { fdregwr(fdc, FDOUT, v); } +#endif static u_int8_t fdsts_rd(struct fdc_data *fdc) @@ -349,12 +412,14 @@ fdsts_rd(struct fdc_data *fdc) return fdregrd(fdc, FDSTS); } +#ifndef PC98 static void fddsr_wr(struct fdc_data *fdc, u_int8_t v) { fdregwr(fdc, FDDSR, v); } +#endif static void fddata_wr(struct fdc_data *fdc, u_int8_t v) @@ -370,12 +435,14 @@ fddata_rd(struct fdc_data *fdc) return fdregrd(fdc, FDDATA); } +#ifndef PC98 static u_int8_t fdin_rd(struct fdc_data *fdc) { return fdregrd(fdc, FDCTL); } +#endif /* * Magic pseudo-DMA initialization for YE FDC. Sets count and @@ -502,11 +569,90 @@ fdc_cmd(struct fdc_data *fdc, int n_out, return (0); } +#ifdef PC98 +static void fd_motor(struct fd_data *fd, int turnon); + +static int pc98_trans = 0; /* 0 : HD , 1 : DD , 2 : 1.44 */ +static int pc98_trans_prev = -1; + +static void +set_density(struct fdc_data *fdc) +{ + /* always motor on */ + fdregwr(fdc, FDP, (pc98_trans != 1 ? FDP_FDDEXC : 0) | FDP_PORTEXC); + DELAY(100); + fdctl_wr(fdc, FDC_RST | FDC_DMAE); + /* in the case of note W, always inhibit 100ms timer */ +} + +static int +pc98_fd_check_ready(struct fd_data *fd) +{ + struct fdc_data *fdc = fd->fdc; + int retry = 0, status; + int fdu = device_get_unit(fd->dev); + + while (retry++ < 30000) { + fd_motor(fd, 1); + fdc_out(fdc, NE7CMD_SENSED); /* Sense Drive Status */ + DELAY(100); + fdc_out(fdc, fdu); /* Drive number */ + DELAY(100); + if ((fdc_in(fdc, &status) == 0) && (status & NE7_ST3_RD)) { + fdctl_wr(fdc, FDC_DMAE | FDC_MTON); + DELAY(10); + return (0); + } + } + return (-1); +} + +static void +pc98_fd_check_type(struct fd_data *fd, int unit) +{ + struct fdc_data *fdc; + + if (fd->type != FDT_NONE || unit < 0 || unit > 3) + return; + + fdc = fd->fdc; + + /* Look up what the BIOS thinks we have. */ + if (!((PC98_SYSTEM_PARAMETER(0x55c) >> unit) & 0x01)) { + fd->type = FDT_NONE; + return; + } + if ((PC98_SYSTEM_PARAMETER(0x5ae) >> unit) & 0x01) { + /* Check 3mode I/F */ + fd->pc98_trans = 0; + fdregwr(fdc, FDEM, (unit << 5) | 0x10); + if (!(fdregrd(fdc, FDEM) & 0x01)) { + fd->type = FDT_144M; + return; + } + device_printf(fd->dev, + "Warning: can't control 3mode I/F, fallback to 2mode.\n"); + } + + fd->type = FDT_12M; +} +#endif /* PC98 */ + static void fdc_reset(struct fdc_data *fdc) { int i, r[10]; +#ifdef PC98 + set_density(fdc); + if (pc98_machine_type & M_EPSON_PC98) + fdctl_wr(fdc, FDC_RST | FDC_RDY | FDC_DD | FDC_MTON); + else + fdctl_wr(fdc, FDC_RST | FDC_RDY | FDC_DMAE | FDC_MTON); + DELAY(200); + fdctl_wr(fdc, FDC_DMAE | FDC_MTON); + DELAY(10); +#else if (fdc->fdct == FDC_ENHANCED) { /* Try a software reset, default precomp, and 500 kb/s */ fddsr_wr(fdc, I8207X_DSR_SR); @@ -519,6 +665,7 @@ fdc_reset(struct fdc_data *fdc) } DELAY(100); fdout_wr(fdc, fdc->fdout); +#endif /* XXX after a reset, silently believe the FDC will accept commands */ if (fdc_cmd(fdc, 3, NE7CMD_SPECIFY, spec1, spec2, 0)) @@ -612,6 +759,7 @@ fdc_read_status(struct fdc_data *fdc) return ret; } +#ifndef PC98 /* * Select this drive */ @@ -649,6 +797,7 @@ fd_turnon(void *arg) if (once) wakeup(&fd->fdc->head); } +#endif static void fd_motor(struct fd_data *fd, int turnon) @@ -659,6 +808,11 @@ fd_motor(struct fd_data *fd, int turnon) /* mtx_assert(&fdc->fdc_mtx, MA_OWNED); */ +#ifdef PC98 + fdregwr(fdc, FDP, (pc98_trans != 1 ? FDP_FDDEXC : 0) | FDP_PORTEXC); + DELAY(10); + fdctl_wr(fdc, FDC_DMAE | FDC_MTON); +#else if (turnon) { fd->flags |= FD_MOTORWAIT; fdc->fdout |= (FDO_MOEN0 << fd->fdsu); @@ -669,6 +823,7 @@ fd_motor(struct fd_data *fd, int turnon) fdc->fdout &= ~(FDO_MOEN0 << fd->fdsu); } fdout_wr(fdc, fdc->fdout); +#endif } static void @@ -836,15 +991,41 @@ fdc_worker(struct fdc_data *fdc) } /* Select drive, setup params */ +#ifdef PC98 + pc98_trans = fd->ft->trans; + if (pc98_trans_prev != pc98_trans) { + int i; + + set_density(fdc); + for (i = 0; i < 10; i++) { + outb(0x5f, 0); + outb(0x5f, 0); + } + pc98_trans_prev = pc98_trans; + } + if (pc98_trans != fd->pc98_trans) { + if (fd->type == FDT_144M) { + fdregwr(fdc, FDEM, + (device_get_unit(fd->dev) << 5) | 0x10 | + (pc98_trans >> 1)); + outb(0x5f, 0); + outb(0x5f, 0); + } + fd->pc98_trans = pc98_trans; + } +#else fd_select(fd); if (fdc->fdct == FDC_ENHANCED) fddsr_wr(fdc, fd->ft->trans); else fdctl_wr(fdc, fd->ft->trans); +#endif if (bp->bio_cmd & BIO_PROBE) { if ((!(device_get_flags(fd->dev) & FD_NO_CHLINE) && +#ifndef PC98 !(fdin_rd(fdc) & FDI_DCHG) && +#endif !(fd->flags & FD_EMPTY)) || fd_probe_disk(fd, &need_recal) == 0) return (fdc_biodone(fdc, 0)); @@ -857,6 +1038,7 @@ fdc_worker(struct fdc_data *fdc) if (fd->flags & FD_EMPTY) return (fdc_biodone(fdc, ENXIO)); +#ifndef PC98 /* Check if we lost our media */ if (fdin_rd(fdc) & FDI_DCHG) { if (debugflags & 0x40) @@ -874,9 +1056,10 @@ fdc_worker(struct fdc_data *fdc) g_topology_unlock(); return (fdc_biodone(fdc, ENXIO)); } +#endif /* Check if the floppy is write-protected */ - if(bp->bio_cmd & (BIO_FMT | BIO_WRITE)) { + if (bp->bio_cmd & (BIO_FMT | BIO_WRITE)) { retry_line = __LINE__; if(fdc_sense_drive(fdc, &st3) != 0) return (1); @@ -907,6 +1090,9 @@ fdc_worker(struct fdc_data *fdc) if ((need_recal & (1 << fd->fdsu)) || (cylinder == 0 && fd->track != 0) || fdc->retry > 2) { +#ifdef PC98 + pc98_fd_check_ready(fd); +#endif retry_line = __LINE__; if (fdc_cmd(fdc, 2, NE7CMD_RECAL, fd->fdsu, 0)) return (1); @@ -928,6 +1114,9 @@ fdc_worker(struct fdc_data *fdc) * SEEK to where we want to be */ if (cylinder != fd->track) { +#ifdef PC98 + pc98_fd_check_ready(fd); +#endif retry_line = __LINE__; if (fdc_cmd(fdc, 3, NE7CMD_SEEK, fd->fdsu, descyl, 0)) return (1); @@ -1230,6 +1419,7 @@ fd_probe_disk(struct fd_data *fd, int *r if (fdc_sense_int(fdc, &st0, &cyl) == FD_NOT_VALID) goto done; /* XXX */ *recal |= (1 << fd->fdsu); +#ifndef PC98 if (fdin_rd(fdc) & FDI_DCHG) { if (debugflags & 0x40) printf("Empty in probe\n"); @@ -1237,6 +1427,9 @@ fd_probe_disk(struct fd_data *fd, int *r fd->flags |= FD_EMPTY; mtx_unlock(&fdc->fdc_mtx); } else { +#else + { +#endif if (fdc_sense_drive(fdc, &st3) != 0) goto done; if (debugflags & 0x40) @@ -1372,7 +1565,12 @@ fdautoselect(struct fd_data *fd) } else { if (debugflags & 0x40) { device_printf(fd->dev, - "autoselected %d KB medium\n", fd->ft->size / 2); + "autoselected %d KB medium\n", +#ifdef PC98 + (128 << (fd->ft->secsize)) * fd->ft->size / 1024); +#else + fd->ft->size / 2); +#endif fdprinttype(fd->ft); } return (0); @@ -1425,6 +1623,10 @@ fd_access(struct g_provider *pp, int r, busy = 0; if (pp->acr == 0 && pp->acw == 0 && pp->ace == 0) { +#ifdef PC98 + if (pc98_fd_check_ready(fd) == -1) + return (ENXIO); +#endif if (fdmisccmd(fd, BIO_PROBE, NULL)) return (ENXIO); if (fd->flags & FD_EMPTY) @@ -1494,6 +1696,10 @@ fd_ioctl(struct g_provider *pp, u_long c fd = pp->geom->softc; +#ifdef PC98 + pc98_fd_check_ready(fd); +#endif + switch (cmd) { case FD_GTYPE: /* get drive type */ *(struct fd_type *)data = *fd->ft; @@ -1661,6 +1867,12 @@ fdc_initial_reset(device_t dev, struct f { int ic_type, part_id; +#ifdef PC98 + /* See if it can handle a command. */ + if (fdc_cmd(fdc, 3, NE7CMD_SPECIFY, NE7_SPEC_1(4, 240), + NE7_SPEC_2(2, 0), 0)) + return (ENXIO); +#else /* * A status value of 0xff is very unlikely, but not theoretically * impossible, but it is far more likely to indicate an empty bus. @@ -1686,8 +1898,10 @@ fdc_initial_reset(device_t dev, struct f return (ENXIO); /* Then, see if it can handle a command. */ - if (fdc_cmd(fdc, 3, NE7CMD_SPECIFY, 0xaf, 0x1e, 0)) + if (fdc_cmd(fdc, 3, NE7CMD_SPECIFY, NE7_SPEC_1(6, 240), + NE7_SPEC_2(31, 0), 0)) return (ENXIO); +#endif /* * Try to identify the chip. @@ -1749,7 +1963,11 @@ fdc_detach(device_t dev) mtx_unlock(&fdc->fdc_mtx); /* reset controller, turn motor off */ +#ifdef PC98 + fdc_reset(fdc); +#else fdout_wr(fdc, 0); +#endif if (!(fdc->flags & FDC_NODMA)) isa_dma_release(fdc->dmachan); @@ -1823,7 +2041,11 @@ fdc_attach(device_t dev) mtx_init(&fdc->fdc_mtx, "fdc lock", NULL, MTX_DEF); /* reset controller, turn motor off, clear fdout mirror reg */ +#ifdef PC98 + fdc_reset(fdc); +#else fdout_wr(fdc, fdc->fdout = 0); +#endif bioq_init(&fdc->head); kproc_create(fdc_thread, fdc, &fdc->fdc_thread, 0, 0, @@ -1877,8 +2099,11 @@ fdc_print_child(device_t me, device_t ch static int fd_probe(device_t dev) { - int i, unit; + int unit; +#ifndef PC98 + int i; u_int st0, st3; +#endif struct fd_data *fd; struct fdc_data *fdc; int fdsu; @@ -1905,7 +2130,9 @@ fd_probe(device_t dev) fd->type = type; } -#if (defined(__i386__) && !defined(PC98)) || defined(__amd64__) +#ifdef PC98 + pc98_fd_check_type(fd, unit); +#elif defined(__i386__) || defined(__amd64__) if (fd->type == FDT_NONE && (unit == 0 || unit == 1)) { /* Look up what the BIOS thinks we have. */ if (unit == 0) @@ -1920,6 +2147,7 @@ fd_probe(device_t dev) if (fd->type == FDT_NONE) return (ENXIO); +#ifndef PC98 /* mtx_lock(&fdc->fdc_mtx); */ @@ -1972,10 +2200,19 @@ fd_probe(device_t dev) if ((flags & FD_NO_PROBE) == 0 && (st0 & NE7_ST0_EC) != 0) /* no track 0 -> no drive present */ return (ENXIO); +#endif /* PC98 */ done: switch (fd->type) { +#ifdef PC98 + case FDT_144M: + device_set_desc(dev, "1.44M FDD"); + break; + case FDT_12M: + device_set_desc(dev, "1M/640K FDD"); + break; +#else case FDT_12M: device_set_desc(dev, "1200-KB 5.25\" drive"); break; @@ -1991,6 +2228,7 @@ done: case FDT_720K: device_set_desc(dev, "720-KB 3.5\" drive"); break; +#endif default: return (ENXIO); } @@ -1998,6 +2236,9 @@ done: fd->fdc = fdc; fd->fdsu = fdsu; fd->options = 0; +#ifdef PC98 + fd->pc98_trans = 0; +#endif callout_init_mtx(&fd->toffhandle, &fd->fdc->fdc_mtx, 0); /* initialize densities for subdevices */ Copied and modified: head/sys/dev/fdc/fdc_cbus.c (from r272118, head/sys/pc98/cbus/fdc_cbus.c) ============================================================================== --- head/sys/pc98/cbus/fdc_cbus.c Thu Sep 25 17:47:26 2014 (r272118, copy source) +++ head/sys/dev/fdc/fdc_cbus.c Thu Sep 25 20:40:24 2014 (r272129) @@ -33,15 +33,16 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include #include -#include -#include +#include #include @@ -50,62 +51,70 @@ static bus_addr_t fdc_iat[] = {0, 2, 4}; static int fdc_cbus_alloc_resources(device_t dev, struct fdc_data *fdc) { - int rid; + struct resource *res; + int i, rid; fdc->fdc_dev = dev; - fdc->rid_ioport = 0; - fdc->rid_irq = 0; - fdc->rid_drq = 0; - fdc->res_irq = 0; - fdc->res_drq = 0; - - fdc->res_ioport = isa_alloc_resourcev(dev, SYS_RES_IOPORT, - &fdc->rid_ioport, fdc_iat, - 3, RF_ACTIVE); - if (fdc->res_ioport == 0) { + rid = 0; + res = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &rid, fdc_iat, 3, + RF_ACTIVE); + if (res == NULL) { device_printf(dev, "cannot reserve I/O port range\n"); - return ENXIO; + return (ENXIO); } - isa_load_resourcev(fdc->res_ioport, fdc_iat, 3); - fdc->portt = rman_get_bustag(fdc->res_ioport); - fdc->porth = rman_get_bushandle(fdc->res_ioport); - + isa_load_resourcev(res, fdc_iat, 3); + for (i = 0; i < 3; i++) { + fdc->resio[i] = res; + fdc->ridio[i] = rid; + fdc->ioff[i] = i; + fdc->ioh[i] = rman_get_bushandle(res); + } + fdc->iot = rman_get_bustag(res); + rid = 3; bus_set_resource(dev, SYS_RES_IOPORT, rid, IO_FDPORT, 1); - fdc->res_fdsio = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, - RF_ACTIVE); - if (fdc->res_fdsio == 0) - return ENXIO; - fdc->sc_fdsiot = rman_get_bustag(fdc->res_fdsio); - fdc->sc_fdsioh = rman_get_bushandle(fdc->res_fdsio); + res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); + if (res == NULL) { + device_printf(dev, "cannot reserve I/O port range\n"); + return (ENXIO); + } + fdc->resio[3] = res; + fdc->ridio[3] = rid; + fdc->ioff[3] = 0; + fdc->ioh[3] = rman_get_bushandle(res); + /* XXX: Reuses fdc->iot */ rid = 4; bus_set_resource(dev, SYS_RES_IOPORT, rid, 0x4be, 1); - fdc->res_fdemsio = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, - RF_ACTIVE); - if (fdc->res_fdemsio == 0) - return ENXIO; - fdc->sc_fdemsiot = rman_get_bustag(fdc->res_fdemsio); - fdc->sc_fdemsioh = rman_get_bushandle(fdc->res_fdemsio); + res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); + if (res == NULL) { + device_printf(dev, "cannot reserve I/O port range\n"); + return (ENXIO); + } + fdc->resio[4] = res; + fdc->ridio[4] = rid; + fdc->ioff[4] = 0; + fdc->ioh[4] = rman_get_bushandle(res); + /* XXX: Reuses fdc->iot */ fdc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &fdc->rid_irq, - RF_ACTIVE); - if (fdc->res_irq == 0) { + RF_ACTIVE); + if (fdc->res_irq == NULL) { device_printf(dev, "cannot reserve interrupt line\n"); - return ENXIO; + return (ENXIO); } if ((fdc->flags & FDC_NODMA) == 0) { fdc->res_drq = bus_alloc_resource_any(dev, SYS_RES_DRQ, - &fdc->rid_drq, RF_ACTIVE); - if (fdc->res_drq == 0) { + &fdc->rid_drq, RF_ACTIVE); + if (fdc->res_drq == NULL) { device_printf(dev, "cannot reserve DMA request line\n"); - return ENXIO; + return (ENXIO); } fdc->dmachan = rman_get_start(fdc->res_drq); } - return 0; + return (0); } static int @@ -122,8 +131,8 @@ fdc_cbus_probe(device_t dev) /* Attempt to allocate our resources for the duration of the probe */ error = fdc_cbus_alloc_resources(dev, fdc); - if (!error) - error = fdc_initial_reset(fdc); + if (error == 0) + error = fdc_initial_reset(dev, fdc); fdc_release_resources(fdc); return (error); @@ -136,15 +145,14 @@ fdc_cbus_attach(device_t dev) int error; fdc = device_get_softc(dev); - - if ((error = fdc_cbus_alloc_resources(dev, fdc)) != 0 || - (error = fdc_attach(dev)) != 0 || - (error = fdc_hints_probe(dev)) != 0) { + error = fdc_cbus_alloc_resources(dev, fdc); + if (error == 0) + error = fdc_attach(dev); + if (error == 0) + error = fdc_hints_probe(dev); + if (error) fdc_release_resources(fdc); - return (error); - } - - return (0); + return (error); } static device_method_t fdc_methods[] = { Modified: head/sys/dev/fdc/fdcvar.h ============================================================================== --- head/sys/dev/fdc/fdcvar.h Thu Sep 25 20:34:13 2014 (r272128) +++ head/sys/dev/fdc/fdcvar.h Thu Sep 25 20:40:24 2014 (r272129) @@ -49,7 +49,9 @@ struct fdc_data { #define FDC_KTHREAD_ALIVE 0x2000 /* worker thread is alive */ struct fd_data *fd; /* The active drive */ int retry; +#ifndef PC98 int fdout; /* mirror of the w/o digital output reg */ +#endif u_int status[7]; /* copy of the registers */ enum fdc_type fdct; /* chip version of FDC */ int fdc_errs; /* number of logged errors */ Modified: head/sys/modules/fdc/Makefile ============================================================================== --- head/sys/modules/fdc/Makefile Thu Sep 25 20:34:13 2014 (r272128) +++ head/sys/modules/fdc/Makefile Thu Sep 25 20:40:24 2014 (r272129) @@ -2,11 +2,10 @@ KMOD= fdc +.PATH: ${.CURDIR}/../../dev/fdc .if ${MACHINE} == "pc98" -.PATH: ${.CURDIR}/../../pc98/cbus SRCS= fdc.c fdc_cbus.c .else -.PATH: ${.CURDIR}/../../dev/fdc SRCS= fdc.c fdc_isa.c fdc_pccard.c .if ${MACHINE} == "i386" || ${MACHINE} == "amd64" SRCS+= opt_acpi.h acpi_if.h fdc_acpi.c From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 20:41:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33229BB3 for ; Thu, 25 Sep 2014 20:41:14 +0000 (UTC) Received: from nm38-vm9.bullet.mail.bf1.yahoo.com (nm38-vm9.bullet.mail.bf1.yahoo.com [72.30.239.25]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9462CCD for ; Thu, 25 Sep 2014 20:41:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1411677356; bh=dYhnFZVpasgkzq+1eZOILGSH5XzY2C2Yg+bdrKcowNU=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:From:Subject; b=O9wcD6Rh4hzIiF3xtutpxLVPH17Ob8cjzbUfvesSxqlJVAvEo5lOppUZFOyGBhaS07kqnkQNYpX/Bo1E455FtMNY5zSgDmoJEsFynKcoF9XCugwsNlQj4LZ/odl1zu5ksRn41hH1Kcl9NSBupn6PtaITDJTQAwL7m1Z9BVhvGRegB627vOq9JqgAT+0ajLA7p5BgmCPAmaEoxGeQK7GmN8wNjsRlaTJ+rYxuMaMOCuVuCMadcby2mNu90Rq/8FQJllUJh+E4udTPhHS5dDziO/gJD9DWEMQoQh0CFNu/vCyQSEZVHqVBCRUW2Yy0XZQ3a+5N3TbcT0P8eNCq+3ixsg== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=Wu2aRH5kVMkhPw8+9MmoMs3kZuik9gPZeyGGSTxDLB/ZXNj3j4OtFxfk/46h+EnwYd5ZKtBU6Wnpk4FlVWjkOkneX3vlhq0ysf3oVQQCJzVuZKs+SH47JToOAW7FfugJsmdPv9tJ+fT/hbPFjEd+KSpezJdCVeAAWCZ/3meeLmQqtYoL9m3+xqqXhT5jYufL9TFL7QsWtJxIVQ4KbDlXB51gkH5ObKW2voIOIm2BUAvJECsK0xUn/x9Ya07ky9UYSOL94ECnNFrRI63sd/KF1Te92jkiS/2KJQQ56BdVzGWk1n2TID794grNRqMYc604+pZxQfnY1E3X+whf5UEujQ==; Received: from [98.139.215.143] by nm38.bullet.mail.bf1.yahoo.com with NNFMP; 25 Sep 2014 20:35:56 -0000 Received: from [68.142.230.65] by tm14.bullet.mail.bf1.yahoo.com with NNFMP; 25 Sep 2014 20:35:56 -0000 Received: from [127.0.0.1] by smtp222.mail.bf1.yahoo.com with NNFMP; 25 Sep 2014 20:35:56 -0000 X-Yahoo-Newman-Id: 303366.11464.bm@smtp222.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Lt934_IVM1n2EbgIwVISsmu4GnMtIgALnvqGlcQaTiujqGO jl3rdx9VURym_Au_ELrOH6GKEmhoN8s5NpX.Es3_mBHKMLSR1gYKH89bvUMp YErWVvlHe5XxyLmqGc3dQrn5trhtRDqsoVT3iJ.azDsTBVyoFMF5r0ZBprnh iWatGdBnAcXd_AJ1exGJMyE_aGpiAmjcveyW1tD_uLgTW9NK2UkxDz8sdx4J PLaK9D2iSrBc4IVc8Tyy6hcyT7xAtY9Rfzvr9YfcbpFgNXCfQ.lxttqbERuN j0bhRV509pM9niqtZ_mJkRFkF7TkTwxRDP2kqlnwBQgF2B2ti_d1_Q5RRa1. ud0C7YOMXrM2u4Xl0.j53rIUM.YKbZoOnS0V4oqkxrdD3zKSduygsVs7xwln nMHEg9VgiloFHdbef14ppet4hK6sYGYMB4YQ6Uzi4h5FPMLgrSSb81CeRaG9 BbwiUN115tUWbN71.M4Uhp2W7gQVDjnUkjJ0u.pBAlGnB6AzujPrdECqW_va gOzX3QMUdz7NUEzi2I7rUM3td_4h9Z6wfvuKkglZgYovQGEzxJ4VQXua0qvf gF_w_rL4LG11H1ajNYhmIreoqpBGowj7yExpxB1tlmvHODgaQs3mKRXpL85U c X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <54247CAC.6010407@freebsd.org> Date: Thu, 25 Sep 2014 15:35:56 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r272122 - head/lib/libc/stdtime References: <201409251852.s8PIqIRD033822@svn.freebsd.org> <542472AF.7020402@FreeBSD.org> In-Reply-To: <542472AF.7020402@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 20:41:14 -0000 On 09/25/14 14:53, Bryan Drewery wrote: > On 9/25/2014 1:52 PM, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Thu Sep 25 18:52:17 2014 >> New Revision: 272122 >> URL: http://svnweb.freebsd.org/changeset/base/272122 >> >> Log: >> Add strptime(3) support for %U and %W >> >> Add support for the missing POSIX-2001 %U and %W features: the >> existing FreeBSD strptime code recognizes both directives and >> validates that the week number lies in the permitted range, >> but then simply discards the value. >> >> Initial support for the feature was written by Paul Green with >> important fixes by Andrey Chernov. Additional support for >> handling tm_wday/tm_yday was written by David Carlier. >> >> PR: 137307 >> MFC after: 1 month > Seems Relnotes worthy. Ugh . yes, but it is not planned for 10.1 and there are still issues to fix. Pedro. From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 20:42:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 413B2DF9; Thu, 25 Sep 2014 20:42:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2108BD76; Thu, 25 Sep 2014 20:42:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PKgQJp087365; Thu, 25 Sep 2014 20:42:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PKgPQp087364; Thu, 25 Sep 2014 20:42:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409252042.s8PKgPQp087364@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 25 Sep 2014 20:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272130 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 20:42:26 -0000 Author: kib Date: Thu Sep 25 20:42:25 2014 New Revision: 272130 URL: http://svnweb.freebsd.org/changeset/base/272130 Log: In kern_linkat() and kern_renameat(), do not call namei(9) while holding a write reference on the filesystem. Try to get write reference in unblocked way after all vnodes are resolved; if failed, drop all locks and retry after waiting for suspension end. The VFS_UNMOUNT() methods for UFS and tmpfs try to establish suspension on unmount, while covered vnode is locked by VFS, which prevents namei() from stepping over the mount point. The thread doing namei() sleeps on the covered vnode lock, owning the write ref. Reported by: bdrewery Tested by: bdrewery (previous version), pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Sep 25 20:40:24 2014 (r272129) +++ head/sys/kern/vfs_syscalls.c Thu Sep 25 20:42:25 2014 (r272130) @@ -1551,10 +1551,10 @@ kern_linkat(struct thread *td, int fd1, cap_rights_t rights; int error; +again: bwillwrite(); NDINIT_AT(&nd, LOOKUP, follow | AUDITVNODE1, segflg, path1, fd1, td); -again: if ((error = namei(&nd)) != 0) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); @@ -1563,50 +1563,65 @@ again: vrele(vp); return (EPERM); /* POSIX */ } - if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) { - vrele(vp); - return (error); - } NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE2, segflg, path2, fd2, cap_rights_init(&rights, CAP_LINKAT), td); if ((error = namei(&nd)) == 0) { if (nd.ni_vp != NULL) { + NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_dvp == nd.ni_vp) vrele(nd.ni_dvp); else vput(nd.ni_dvp); vrele(nd.ni_vp); - error = EEXIST; - } else if ((error = vn_lock(vp, LK_EXCLUSIVE)) == 0) { + vrele(vp); + return (EEXIST); + } else if (nd.ni_dvp->v_mount != vp->v_mount) { /* - * Check for cross-device links. No need to - * recheck vp->v_type, since it cannot change - * for non-doomed vnode. + * Cross-device link. No need to recheck + * vp->v_type, since it cannot change, except + * to VBAD. */ - if (nd.ni_dvp->v_mount != vp->v_mount) - error = EXDEV; - else - error = can_hardlink(vp, td->td_ucred); - if (error == 0) + NDFREE(&nd, NDF_ONLY_PNBUF); + vput(nd.ni_dvp); + vrele(vp); + return (EXDEV); + } else if ((error = vn_lock(vp, LK_EXCLUSIVE)) == 0) { + error = can_hardlink(vp, td->td_ucred); #ifdef MAC + if (error == 0) error = mac_vnode_check_link(td->td_ucred, nd.ni_dvp, vp, &nd.ni_cnd); - if (error == 0) #endif - error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd); + if (error != 0) { + vput(vp); + vput(nd.ni_dvp); + NDFREE(&nd, NDF_ONLY_PNBUF); + return (error); + } + error = vn_start_write(vp, &mp, V_NOWAIT); + if (error != 0) { + vput(vp); + vput(nd.ni_dvp); + NDFREE(&nd, NDF_ONLY_PNBUF); + error = vn_start_write(NULL, &mp, + V_XSLEEP | PCATCH); + if (error != 0) + return (error); + goto again; + } + error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd); VOP_UNLOCK(vp, 0); vput(nd.ni_dvp); + vn_finished_write(mp); + NDFREE(&nd, NDF_ONLY_PNBUF); } else { vput(nd.ni_dvp); NDFREE(&nd, NDF_ONLY_PNBUF); vrele(vp); - vn_finished_write(mp); goto again; } - NDFREE(&nd, NDF_ONLY_PNBUF); } vrele(vp); - vn_finished_write(mp); return (error); } @@ -3519,6 +3534,7 @@ kern_renameat(struct thread *td, int old cap_rights_t rights; int error; +again: bwillwrite(); #ifdef MAC NDINIT_ATRIGHTS(&fromnd, DELETE, LOCKPARENT | LOCKLEAF | SAVESTART | @@ -3539,14 +3555,6 @@ kern_renameat(struct thread *td, int old VOP_UNLOCK(fromnd.ni_vp, 0); #endif fvp = fromnd.ni_vp; - if (error == 0) - error = vn_start_write(fvp, &mp, V_WAIT | PCATCH); - if (error != 0) { - NDFREE(&fromnd, NDF_ONLY_PNBUF); - vrele(fromnd.ni_dvp); - vrele(fvp); - goto out1; - } NDINIT_ATRIGHTS(&tond, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART | AUDITVNODE2, pathseg, new, newfd, cap_rights_init(&rights, CAP_LINKAT), td); @@ -3559,11 +3567,30 @@ kern_renameat(struct thread *td, int old NDFREE(&fromnd, NDF_ONLY_PNBUF); vrele(fromnd.ni_dvp); vrele(fvp); - vn_finished_write(mp); goto out1; } tdvp = tond.ni_dvp; tvp = tond.ni_vp; + error = vn_start_write(fvp, &mp, V_NOWAIT); + if (error != 0) { + NDFREE(&fromnd, NDF_ONLY_PNBUF); + NDFREE(&tond, NDF_ONLY_PNBUF); + if (tvp != NULL) + vput(tvp); + if (tdvp == tvp) + vrele(tdvp); + else + vput(tdvp); + vrele(fromnd.ni_dvp); + vrele(fvp); + vrele(tond.ni_startdir); + if (fromnd.ni_startdir != NULL) + vrele(fromnd.ni_startdir); + error = vn_start_write(NULL, &mp, V_XSLEEP | PCATCH); + if (error != 0) + return (error); + goto again; + } if (tvp != NULL) { if (fvp->v_type == VDIR && tvp->v_type != VDIR) { error = ENOTDIR; From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 20:56:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE13B30B; Thu, 25 Sep 2014 20:56:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C83EDE8D; Thu, 25 Sep 2014 20:56:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PKu51e092707; Thu, 25 Sep 2014 20:56:05 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PKu5fm092706; Thu, 25 Sep 2014 20:56:05 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409252056.s8PKu5fm092706@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 25 Sep 2014 20:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272131 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 20:56:06 -0000 Author: delphij Date: Thu Sep 25 20:56:05 2014 New Revision: 272131 URL: http://svnweb.freebsd.org/changeset/base/272131 Log: Regen. This is a direct commit to stable/10 instead of a MFC of r271494. Approved by: re (gjb) Modified: stable/10/share/man/man5/src.conf.5 Modified: stable/10/share/man/man5/src.conf.5 ============================================================================== --- stable/10/share/man/man5/src.conf.5 Thu Sep 25 20:42:25 2014 (r272130) +++ stable/10/share/man/man5/src.conf.5 Thu Sep 25 20:56:05 2014 (r272131) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: stable/10/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd July 8, 2014 +.Dd September 25, 2014 .Dt SRC.CONF 5 .Os .Sh NAME @@ -469,6 +469,18 @@ Set to build Hesiod support. .It Va WITHOUT_HTML .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_HTML 156932 2006-03-21 07:50:50Z ru Set to not build HTML docs. +.It Va WITHOUT_HYPERV +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_HYPERV 272128 2014-09-25 20:34:13Z delphij +Set to not build or install HyperV utilities. +.Pp +It is a default setting on +arm/arm, arm/armeb, arm/armv6, ia64/ia64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc, powerpc/powerpc64 and sparc64/sparc64. +.It Va WITH_HYPERV +.\" from FreeBSD: stable/10/tools/build/options/WITH_HYPERV 272128 2014-09-25 20:34:13Z delphij +Set to build and install HyperV utilities. +.Pp +It is a default setting on +amd64/amd64, i386/i386 and pc98/i386. .It Va WITHOUT_ICONV .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ICONV 254919 2013-08-26 17:15:56Z antoine Set to not build iconv as part of libc. From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 21:07:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E374960; Thu, 25 Sep 2014 21:07:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38756FCF; Thu, 25 Sep 2014 21:07:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PL7Lgi097916; Thu, 25 Sep 2014 21:07:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PL7KaM097913; Thu, 25 Sep 2014 21:07:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409252107.s8PL7KaM097913@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 25 Sep 2014 21:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272132 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 21:07:21 -0000 Author: kib Date: Thu Sep 25 21:07:19 2014 New Revision: 272132 URL: http://svnweb.freebsd.org/changeset/base/272132 Log: Fix fcntl(2) compat32 after r270691. The copyin and copyout of the struct flock are done in the sys_fcntl(), which mean that compat32 used direct access to userland pointers. Move code from sys_fcntl() to new wrapper, kern_fcntl_freebsd(), which performs neccessary userland memory accesses, and use it from both native and compat32 fcntl syscalls. Reported by: jhibbits Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/kern_descrip.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Sep 25 20:56:05 2014 (r272131) +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Sep 25 21:07:19 2014 (r272132) @@ -2984,7 +2984,7 @@ freebsd32_procctl(struct thread *td, str int freebsd32_fcntl(struct thread *td, struct freebsd32_fcntl_args *uap) { - intptr_t tmp; + long tmp; switch (uap->cmd) { /* @@ -3003,5 +3003,5 @@ freebsd32_fcntl(struct thread *td, struc tmp = uap->arg; break; } - return (kern_fcntl(td, uap->fd, uap->cmd, tmp)); + return (kern_fcntl_freebsd(td, uap->fd, uap->cmd, tmp)); } Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Sep 25 20:56:05 2014 (r272131) +++ head/sys/kern/kern_descrip.c Thu Sep 25 21:07:19 2014 (r272132) @@ -378,22 +378,27 @@ struct fcntl_args { int sys_fcntl(struct thread *td, struct fcntl_args *uap) { + + return (kern_fcntl_freebsd(td, uap->fd, uap->cmd, uap->arg)); +} + +int +kern_fcntl_freebsd(struct thread *td, int fd, int cmd, long arg) +{ struct flock fl; struct __oflock ofl; - intptr_t arg; + intptr_t arg1; int error; - int cmd; error = 0; - cmd = uap->cmd; - switch (uap->cmd) { + switch (cmd) { case F_OGETLK: case F_OSETLK: case F_OSETLKW: /* * Convert old flock structure to new. */ - error = copyin((void *)(intptr_t)uap->arg, &ofl, sizeof(ofl)); + error = copyin((void *)(intptr_t)arg, &ofl, sizeof(ofl)); fl.l_start = ofl.l_start; fl.l_len = ofl.l_len; fl.l_pid = ofl.l_pid; @@ -401,7 +406,7 @@ sys_fcntl(struct thread *td, struct fcnt fl.l_whence = ofl.l_whence; fl.l_sysid = 0; - switch (uap->cmd) { + switch (cmd) { case F_OGETLK: cmd = F_GETLK; break; @@ -412,33 +417,33 @@ sys_fcntl(struct thread *td, struct fcnt cmd = F_SETLKW; break; } - arg = (intptr_t)&fl; + arg1 = (intptr_t)&fl; break; case F_GETLK: case F_SETLK: case F_SETLKW: case F_SETLK_REMOTE: - error = copyin((void *)(intptr_t)uap->arg, &fl, sizeof(fl)); - arg = (intptr_t)&fl; + error = copyin((void *)(intptr_t)arg, &fl, sizeof(fl)); + arg1 = (intptr_t)&fl; break; default: - arg = uap->arg; + arg1 = arg; break; } if (error) return (error); - error = kern_fcntl(td, uap->fd, cmd, arg); + error = kern_fcntl(td, fd, cmd, arg1); if (error) return (error); - if (uap->cmd == F_OGETLK) { + if (cmd == F_OGETLK) { ofl.l_start = fl.l_start; ofl.l_len = fl.l_len; ofl.l_pid = fl.l_pid; ofl.l_type = fl.l_type; ofl.l_whence = fl.l_whence; - error = copyout(&ofl, (void *)(intptr_t)uap->arg, sizeof(ofl)); - } else if (uap->cmd == F_GETLK) { - error = copyout(&fl, (void *)(intptr_t)uap->arg, sizeof(fl)); + error = copyout(&ofl, (void *)(intptr_t)arg, sizeof(ofl)); + } else if (cmd == F_GETLK) { + error = copyout(&fl, (void *)(intptr_t)arg, sizeof(fl)); } return (error); } Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Thu Sep 25 20:56:05 2014 (r272131) +++ head/sys/sys/syscallsubr.h Thu Sep 25 21:07:19 2014 (r272132) @@ -97,6 +97,7 @@ int kern_fchmodat(struct thread *td, int int kern_fchownat(struct thread *td, int fd, char *path, enum uio_seg pathseg, int uid, int gid, int flag); int kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg); +int kern_fcntl_freebsd(struct thread *td, int fd, int cmd, long arg); int kern_fhstat(struct thread *td, fhandle_t fh, struct stat *buf); int kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf); int kern_fstat(struct thread *td, int fd, struct stat *sbp); From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 21:07:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24C16AB0; Thu, 25 Sep 2014 21:07:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EB1CFD3; Thu, 25 Sep 2014 21:07:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PL7UUr097990; Thu, 25 Sep 2014 21:07:30 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PL7Ukc097988; Thu, 25 Sep 2014 21:07:30 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409252107.s8PL7Ukc097988@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 25 Sep 2014 21:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272133 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 21:07:31 -0000 Author: delphij Date: Thu Sep 25 21:07:30 2014 New Revision: 272133 URL: http://svnweb.freebsd.org/changeset/base/272133 Log: MFC r271534: MFV r271517: In zil_claim, don't issue warning if we get EBUSY (inconsistent) when opening an objset, instead, ignore it silently. Illumos issue: 5140 message about "%recv could not be opened" is printed when booting after crash Approved by: re (gjb) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Thu Sep 25 21:07:19 2014 (r272132) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Thu Sep 25 21:07:30 2014 (r272133) @@ -647,7 +647,14 @@ zil_claim(const char *osname, void *txar error = dmu_objset_own(osname, DMU_OST_ANY, B_FALSE, FTAG, &os); if (error != 0) { - cmn_err(CE_WARN, "can't open objset for %s", osname); + /* + * EBUSY indicates that the objset is inconsistent, in which + * case it can not have a ZIL. + */ + if (error != EBUSY) { + cmn_err(CE_WARN, "can't open objset for %s, error %u", + osname, error); + } return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 21:28:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6DE9102; Thu, 25 Sep 2014 21:28:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0FC7273; Thu, 25 Sep 2014 21:28:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PLSKP1007900; Thu, 25 Sep 2014 21:28:20 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PLSKsG007898; Thu, 25 Sep 2014 21:28:20 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409252128.s8PLSKsG007898@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 25 Sep 2014 21:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272134 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 21:28:20 -0000 Author: delphij Date: Thu Sep 25 21:28:19 2014 New Revision: 272134 URL: http://svnweb.freebsd.org/changeset/base/272134 Log: MFC r271536: MFV r271518: Correctly report hole at end of file. When asked to find a hole, the DMU sees that there are no holes in the object, and returns ESRCH. The ZPL interprets this as "no holes before the end of the file", and therefore inserts the "virtual hole" at the end of the file. Because DMU and ZPL have different ideas of where the end of an object/file is, we will end up returning the end of file, which is generally larger, instead of returning the end of object. The fix is to handle the "virtual hole" in the DMU. If no hole is found, the DMU will return a hole at the end of the file, rather than an error. Illumos issue: 5139 SEEK_HOLE failed to report a hole at end of file Approved by: re (gjb) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Sep 25 21:07:30 2014 (r272133) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Sep 25 21:28:19 2014 (r272134) @@ -1948,6 +1948,15 @@ dnode_next_offset(dnode_t *dn, int flags flags, offset, lvl, blkfill, txg); } + /* + * There's always a "virtual hole" at the end of the object, even + * if all BP's which physically exist are non-holes. + */ + if ((flags & DNODE_FIND_HOLE) && error == ESRCH && txg == 0 && + minlvl == 1 && blkfill == 1 && !(flags & DNODE_FIND_BACKWARDS)) { + error = 0; + } + if (error == 0 && (flags & DNODE_FIND_BACKWARDS ? initial_offset < *offset : initial_offset > *offset)) error = SET_ERROR(ESRCH); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Sep 25 21:07:30 2014 (r272133) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Sep 25 21:28:19 2014 (r272134) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ @@ -266,16 +266,19 @@ zfs_holey(vnode_t *vp, u_long cmd, offse error = dmu_offset_next(zp->z_zfsvfs->z_os, zp->z_id, hole, &noff); - /* end of file? */ - if ((error == ESRCH) || (noff > file_sz)) { - /* - * Handle the virtual hole at the end of file. - */ - if (hole) { - *off = file_sz; - return (0); - } + if (error == ESRCH) return (SET_ERROR(ENXIO)); + + /* + * We could find a hole that begins after the logical end-of-file, + * because dmu_offset_next() only works on whole blocks. If the + * EOF falls mid-block, then indicate that the "virtual hole" + * at the end of the file begins at the logical EOF, rather than + * at the end of the last block. + */ + if (noff > file_sz) { + ASSERT(hole); + noff = file_sz; } if (noff < *off) From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 21:34:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DAA3E3CE; Thu, 25 Sep 2014 21:34:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5A03366; Thu, 25 Sep 2014 21:34:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PLYvPo012521; Thu, 25 Sep 2014 21:34:57 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PLYvU6012520; Thu, 25 Sep 2014 21:34:57 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201409252134.s8PLYvU6012520@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 25 Sep 2014 21:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272135 - head/usr.bin/man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 21:34:58 -0000 Author: allanjude (doc committer) Date: Thu Sep 25 21:34:57 2014 New Revision: 272135 URL: http://svnweb.freebsd.org/changeset/base/272135 Log: Update man(1) to list the different sections of the manual Add each of the intro sections to the 'Also See' list PR: 193460 Differential Revision: D834 Approved by: bcr (mentor) Sponsored by: ScaleEngine Inc. Modified: head/usr.bin/man/man.1 Modified: head/usr.bin/man/man.1 ============================================================================== --- head/usr.bin/man/man.1 Thu Sep 25 21:28:19 2014 (r272134) +++ head/usr.bin/man/man.1 Thu Sep 25 21:34:57 2014 (r272135) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 3, 2011 +.Dd September 26, 2014 .Dt MAN 1 .Os .Sh NAME @@ -58,6 +58,28 @@ is provided, .Nm restricts the search to the specific section of the manual. .Pp +The sections of the manual are: +.Bl -enum -offset indent -compact +.It +\*[volume-operating-system] \*[volume-ds-1] +.It +\*[volume-operating-system] \*[volume-ds-2] +.It +\*[volume-operating-system] \*[volume-ds-3] +.It +\*[volume-operating-system] \*[volume-ds-4] +.It +\*[volume-operating-system] \*[volume-ds-5] +.It +\*[volume-operating-system] \*[volume-ds-6] +.It +\*[volume-operating-system] \*[volume-ds-7] +.It +\*[volume-operating-system] \*[volume-ds-8] +.It +\*[volume-operating-system] \*[volume-ds-9] +.El +.Pp Options that .Nm understands: @@ -318,6 +340,14 @@ Local configuration files. .Sh SEE ALSO .Xr apropos 1 , .Xr intro 1 , +.Xr intro 2 , +.Xr intro 3 , +.Xr intro 4 , +.Xr intro 5 , +.Xr intro 6 , +.Xr intro 7 , +.Xr intro 8 , +.Xr intro 9 , .Xr locale 1 , .Xr manpath 1 , .Xr nroff 1 , From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 21:45:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3576D633; Thu, 25 Sep 2014 21:45:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FB6F692; Thu, 25 Sep 2014 21:45:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PLj79S017462; Thu, 25 Sep 2014 21:45:07 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PLj78b017461; Thu, 25 Sep 2014 21:45:07 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409252145.s8PLj78b017461@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 25 Sep 2014 21:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272136 - stable/10/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 21:45:08 -0000 Author: delphij Date: Thu Sep 25 21:45:07 2014 New Revision: 272136 URL: http://svnweb.freebsd.org/changeset/base/272136 Log: MFC r271227: MFV r271225: Iterate through all the children instead of returning error when we hit the first error. This makes the error message give more information rather than just the first device that causes problem. Illumos issue: 5118 When verifying or creating a storage pool, error messages only show one device Approved by: re (gjb) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Thu Sep 25 21:34:57 2014 (r272135) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Thu Sep 25 21:45:07 2014 (r272136) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ /* @@ -1068,8 +1069,8 @@ is_spare(nvlist_t *config, const char *p * Go through and find any devices that are in use. We rely on libdiskmgt for * the majority of this task. */ -static int -check_in_use(nvlist_t *config, nvlist_t *nv, boolean_t force, +static boolean_t +is_device_in_use(nvlist_t *config, nvlist_t *nv, boolean_t force, boolean_t replacing, boolean_t isspare) { nvlist_t **child; @@ -1078,6 +1079,7 @@ check_in_use(nvlist_t *config, nvlist_t int ret; char buf[MAXPATHLEN]; uint64_t wholedisk; + boolean_t anyinuse = B_FALSE; verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &type) == 0); @@ -1102,38 +1104,37 @@ check_in_use(nvlist_t *config, nvlist_t (void) strlcpy(buf, path, sizeof (buf)); if (is_spare(config, buf)) - return (0); + return (B_FALSE); } if (strcmp(type, VDEV_TYPE_DISK) == 0) ret = check_device(path, force, isspare); - - if (strcmp(type, VDEV_TYPE_FILE) == 0) + else if (strcmp(type, VDEV_TYPE_FILE) == 0) ret = check_file(path, force, isspare); - return (ret); + return (ret != 0); } for (c = 0; c < children; c++) - if ((ret = check_in_use(config, child[c], force, - replacing, B_FALSE)) != 0) - return (ret); + if (is_device_in_use(config, child[c], force, replacing, + B_FALSE)) + anyinuse = B_TRUE; if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_SPARES, &child, &children) == 0) for (c = 0; c < children; c++) - if ((ret = check_in_use(config, child[c], force, - replacing, B_TRUE)) != 0) - return (ret); + if (is_device_in_use(config, child[c], force, replacing, + B_TRUE)) + anyinuse = B_TRUE; if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE, &child, &children) == 0) for (c = 0; c < children; c++) - if ((ret = check_in_use(config, child[c], force, - replacing, B_FALSE)) != 0) - return (ret); + if (is_device_in_use(config, child[c], force, replacing, + B_FALSE)) + anyinuse = B_TRUE; - return (0); + return (anyinuse); } static const char * @@ -1487,7 +1488,7 @@ make_root_vdev(zpool_handle_t *zhp, int * uses (such as a dedicated dump device) that even '-f' cannot * override. */ - if (check_in_use(poolconfig, newroot, force, replacing, B_FALSE) != 0) { + if (is_device_in_use(poolconfig, newroot, force, replacing, B_FALSE)) { nvlist_free(newroot); return (NULL); } From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 21:57:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7792DB6A; Thu, 25 Sep 2014 21:57:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 631CE7FC; Thu, 25 Sep 2014 21:57:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PLvaDa022456; Thu, 25 Sep 2014 21:57:36 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PLvaWw022455; Thu, 25 Sep 2014 21:57:36 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201409252157.s8PLvaWw022455@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Thu, 25 Sep 2014 21:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272137 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 21:57:36 -0000 Author: wblock (doc committer) Date: Thu Sep 25 21:57:35 2014 New Revision: 272137 URL: http://svnweb.freebsd.org/changeset/base/272137 Log: Revised to better point to release notes and errata, security advisories, and be more specific about the -questions list. MFC after: 3 days Modified: head/etc/motd Modified: head/etc/motd ============================================================================== --- head/etc/motd Thu Sep 25 21:45:07 2014 (r272136) +++ head/etc/motd Thu Sep 25 21:57:35 2014 (r272137) @@ -1,12 +1,13 @@ FreeBSD ?.?.? (UNKNOWN) -Welcome to FreeBSD! Handy technical support resources: +Welcome to FreeBSD! -Security advisories and errata: https://www.FreeBSD.org/releases/ -Handbook: https://www.FreeBSD.org/handbook/ -FAQ: https://www.FreeBSD.org/faq/ -Mailing list: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/ -Forums: https://forums.FreeBSD.org/ +Release Notes, Errata: https://www.FreeBSD.org/releases/ +Security Advisories: https://www.FreeBSD.org/security/ +FreeBSD Handbook: https://www.FreeBSD.org/handbook/ +FreeBSD FAQ: https://www.FreeBSD.org/faq/ +Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/ +FreeBSD Forums: https://forums.FreeBSD.org/ Documents installed with the system are in the /usr/local/share/doc/freebsd/ directory, or can be installed later with: pkg install en-freebsd-doc @@ -14,7 +15,6 @@ For other languages, replace "en" with a Show the version of FreeBSD installed: uname -a Please include that output and any error messages when posting questions. - Introduction to manual pages: man man FreeBSD directory layout: man hier From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 22:15:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E62FEE8; Thu, 25 Sep 2014 22:15:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09D3C9C5; Thu, 25 Sep 2014 22:15:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PMFAGR031837; Thu, 25 Sep 2014 22:15:10 GMT (envelope-from kargl@FreeBSD.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PMFA2p031836; Thu, 25 Sep 2014 22:15:10 GMT (envelope-from kargl@FreeBSD.org) Message-Id: <201409252215.s8PMFA2p031836@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kargl set sender to kargl@FreeBSD.org using -f From: Steve Kargl Date: Thu, 25 Sep 2014 22:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272138 - head/lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 22:15:11 -0000 Author: kargl Date: Thu Sep 25 22:15:10 2014 New Revision: 272138 URL: http://svnweb.freebsd.org/changeset/base/272138 Log: * Whitespace. Modified: head/lib/msun/src/e_lgamma_r.c Modified: head/lib/msun/src/e_lgamma_r.c ============================================================================== --- head/lib/msun/src/e_lgamma_r.c Thu Sep 25 21:57:35 2014 (r272137) +++ head/lib/msun/src/e_lgamma_r.c Thu Sep 25 22:15:10 2014 (r272138) @@ -1,4 +1,3 @@ - /* @(#)e_lgamma_r.c 1.3 95/01/18 */ /* * ==================================================== @@ -6,10 +5,9 @@ * * Developed at SunSoft, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== - * */ #include From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 22:22:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E236316F; Thu, 25 Sep 2014 22:22:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDB2AA7E; Thu, 25 Sep 2014 22:22:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PMMhxK036174; Thu, 25 Sep 2014 22:22:43 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PMMh2L036173; Thu, 25 Sep 2014 22:22:43 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409252222.s8PMMh2L036173@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 25 Sep 2014 22:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272139 - head/contrib/hyperv/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 22:22:44 -0000 Author: delphij Date: Thu Sep 25 22:22:43 2014 New Revision: 272139 URL: http://svnweb.freebsd.org/changeset/base/272139 Log: Being able to access a path do not necessarily mean we have access to a directory. So instead of doing this, we just call mkdir(2) directly and test if the returned value is 0 or errno is EISDIR. Reported by: Coverity CID: 1238925 MFC after: 1 week Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c ============================================================================== --- head/contrib/hyperv/tools/hv_kvp_daemon.c Thu Sep 25 22:15:10 2014 (r272138) +++ head/contrib/hyperv/tools/hv_kvp_daemon.c Thu Sep 25 22:22:43 2014 (r272139) @@ -284,12 +284,10 @@ kvp_file_init(void) int i; int alloc_unit = sizeof(struct kvp_record) * ENTRIES_PER_BLOCK; - if (access("/var/db/hyperv/pool", F_OK)) { - if (mkdir("/var/db/hyperv/pool", - S_IRUSR | S_IWUSR | S_IROTH)) { - KVP_LOG(LOG_ERR, " Failed to create /var/db/hyperv/pool\n"); - exit(EXIT_FAILURE); - } + if (mkdir("/var/db/hyperv/pool", S_IRUSR | S_IWUSR | S_IROTH) < 0 && + errno != EISDIR) { + KVP_LOG(LOG_ERR, " Failed to create /var/db/hyperv/pool\n"); + exit(EXIT_FAILURE); } for (i = 0; i < HV_KVP_POOL_COUNT; i++) From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 22:22:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 868152AA; Thu, 25 Sep 2014 22:22:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72093A7F; Thu, 25 Sep 2014 22:22:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PMMngo036233; Thu, 25 Sep 2014 22:22:49 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PMMnvg036232; Thu, 25 Sep 2014 22:22:49 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409252222.s8PMMnvg036232@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 25 Sep 2014 22:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272140 - head/contrib/hyperv/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 22:22:49 -0000 Author: delphij Date: Thu Sep 25 22:22:48 2014 New Revision: 272140 URL: http://svnweb.freebsd.org/changeset/base/272140 Log: Plug a file descriptor leak. Reported by: Coverity CID: 1238916 MFC after: 1 week Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c ============================================================================== --- head/contrib/hyperv/tools/hv_kvp_daemon.c Thu Sep 25 22:22:43 2014 (r272139) +++ head/contrib/hyperv/tools/hv_kvp_daemon.c Thu Sep 25 22:22:48 2014 (r272140) @@ -305,11 +305,13 @@ kvp_file_init(void) filep = fopen(fname, "r"); if (!filep) { + close(fd); return (1); } record = malloc(alloc_unit * num_blocks); if (record == NULL) { + close(fd); fclose(filep); return (1); } @@ -334,6 +336,7 @@ kvp_file_init(void) record = realloc(record, alloc_unit * num_blocks); if (record == NULL) { + close(fd); fclose(filep); return (1); } From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 22:22:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BC59383; Thu, 25 Sep 2014 22:22:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37809A80; Thu, 25 Sep 2014 22:22:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PMMqe6036294; Thu, 25 Sep 2014 22:22:52 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PMMqfS036293; Thu, 25 Sep 2014 22:22:52 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409252222.s8PMMqfS036293@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 25 Sep 2014 22:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272141 - head/contrib/hyperv/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 22:22:52 -0000 Author: delphij Date: Thu Sep 25 22:22:51 2014 New Revision: 272141 URL: http://svnweb.freebsd.org/changeset/base/272141 Log: Refactor the code a little bit to avoid NULL deference when allocation was failed. Reported by: Coverity CID: 1238915 MFC after: 1 week Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c ============================================================================== --- head/contrib/hyperv/tools/hv_kvp_daemon.c Thu Sep 25 22:22:48 2014 (r272140) +++ head/contrib/hyperv/tools/hv_kvp_daemon.c Thu Sep 25 22:22:51 2014 (r272141) @@ -612,18 +612,17 @@ kvp_mac_to_if_name(char *mac) sdl = (struct sockaddr_dl *)(uintptr_t)ifaddrs_ptr->ifa_addr; if (sdl->sdl_type == IFT_ETHER) { buf_ptr = strdup(ether_ntoa((struct ether_addr *)(LLADDR(sdl)))); - for (i = 0; i < strlen(buf_ptr); i++) - { - buf_ptr[i] = toupper(buf_ptr[i]); - } - - if (strncmp(buf_ptr, mac, strlen(mac)) == 0) { - /* Caller will free the memory */ - if_name = strdup(ifaddrs_ptr->ifa_name); - free(buf_ptr); - break; - }else if (buf_ptr != NULL) { - free(buf_ptr); + if (buf_ptr != NULL) { + for (i = 0; i < strlen(buf_ptr); i++) + buf_ptr[i] = toupper(buf_ptr[i]); + + if (strncmp(buf_ptr, mac, strlen(mac)) == 0) { + /* Caller will free the memory */ + if_name = strdup(ifaddrs_ptr->ifa_name); + free(buf_ptr); + break; + } else + free(buf_ptr); } } } while ((ifaddrs_ptr = ifaddrs_ptr->ifa_next) != NULL); From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 22:22:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4F3F4DD; Thu, 25 Sep 2014 22:22:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77BFCA81; Thu, 25 Sep 2014 22:22:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PMMtnF036348; Thu, 25 Sep 2014 22:22:55 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PMMtUi036347; Thu, 25 Sep 2014 22:22:55 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409252222.s8PMMtUi036347@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 25 Sep 2014 22:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272142 - head/contrib/hyperv/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 22:22:55 -0000 Author: delphij Date: Thu Sep 25 22:22:54 2014 New Revision: 272142 URL: http://svnweb.freebsd.org/changeset/base/272142 Log: Use strlcpy(). I don't believe these are real problems but it's better to use a safe idiom. Reported by: Coverity CID: 1238914 MFC after: 1 week Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c ============================================================================== --- head/contrib/hyperv/tools/hv_kvp_daemon.c Thu Sep 25 22:22:51 2014 (r272141) +++ head/contrib/hyperv/tools/hv_kvp_daemon.c Thu Sep 25 22:22:54 2014 (r272142) @@ -1249,7 +1249,7 @@ kvp_op_enumerate(struct hv_kvp_msg *op_m case IntegrationServicesVersion: strcpy(key_name, "IntegrationServicesVersion"); - strcpy(key_value, lic_version); + strlcpy(key_value, lic_version, HV_KVP_EXCHANGE_MAX_VALUE_SIZE); break; case NetworkAddressIPv4: @@ -1265,32 +1265,32 @@ kvp_op_enumerate(struct hv_kvp_msg *op_m break; case OSBuildNumber: - strcpy(key_value, os_build); + strlcpy(key_value, os_build, HV_KVP_EXCHANGE_MAX_VALUE_SIZE); strcpy(key_name, "OSBuildNumber"); break; case OSName: - strcpy(key_value, os_name); + strlcpy(key_value, os_name, HV_KVP_EXCHANGE_MAX_VALUE_SIZE); strcpy(key_name, "OSName"); break; case OSMajorVersion: - strcpy(key_value, os_major); + strlcpy(key_value, os_major, HV_KVP_EXCHANGE_MAX_VALUE_SIZE); strcpy(key_name, "OSMajorVersion"); break; case OSMinorVersion: - strcpy(key_value, os_minor); + strlcpy(key_value, os_minor, HV_KVP_EXCHANGE_MAX_VALUE_SIZE); strcpy(key_name, "OSMinorVersion"); break; case OSVersion: - strcpy(key_value, os_build); + strlcpy(key_value, os_build, HV_KVP_EXCHANGE_MAX_VALUE_SIZE); strcpy(key_name, "OSVersion"); break; case ProcessorArchitecture: - strcpy(key_value, processor_arch); + strlcpy(key_value, processor_arch, HV_KVP_EXCHANGE_MAX_VALUE_SIZE); strcpy(key_name, "ProcessorArchitecture"); break; From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 22:22:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 685385FD; Thu, 25 Sep 2014 22:22:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54021A84; Thu, 25 Sep 2014 22:22:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PMMw8F036413; Thu, 25 Sep 2014 22:22:58 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PMMwMX036412; Thu, 25 Sep 2014 22:22:58 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409252222.s8PMMwMX036412@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 25 Sep 2014 22:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272143 - head/contrib/hyperv/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 22:22:58 -0000 Author: delphij Date: Thu Sep 25 22:22:57 2014 New Revision: 272143 URL: http://svnweb.freebsd.org/changeset/base/272143 Log: Use a char * as iterator over a bounded string. MFC after: 1 week Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c Modified: head/contrib/hyperv/tools/hv_kvp_daemon.c ============================================================================== --- head/contrib/hyperv/tools/hv_kvp_daemon.c Thu Sep 25 22:22:54 2014 (r272142) +++ head/contrib/hyperv/tools/hv_kvp_daemon.c Thu Sep 25 22:22:57 2014 (r272143) @@ -601,8 +601,7 @@ kvp_mac_to_if_name(char *mac) struct ifaddrs *head_ifaddrs_ptr; struct sockaddr_dl *sdl; int status; - size_t i; - char *buf_ptr; + char *buf_ptr, *p; status = getifaddrs(&ifaddrs_ptr); @@ -613,8 +612,8 @@ kvp_mac_to_if_name(char *mac) if (sdl->sdl_type == IFT_ETHER) { buf_ptr = strdup(ether_ntoa((struct ether_addr *)(LLADDR(sdl)))); if (buf_ptr != NULL) { - for (i = 0; i < strlen(buf_ptr); i++) - buf_ptr[i] = toupper(buf_ptr[i]); + for (p = buf_ptr; *p != '\0'; p++) + *p = toupper(*p); if (strncmp(buf_ptr, mac, strlen(mac)) == 0) { /* Caller will free the memory */ From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 22:37:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE9988ED; Thu, 25 Sep 2014 22:37:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE95AB94; Thu, 25 Sep 2014 22:37:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PMbSED041680; Thu, 25 Sep 2014 22:37:28 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PMbScl041679; Thu, 25 Sep 2014 22:37:28 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409252237.s8PMbScl041679@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 25 Sep 2014 22:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272144 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 22:37:29 -0000 Author: delphij Date: Thu Sep 25 22:37:27 2014 New Revision: 272144 URL: http://svnweb.freebsd.org/changeset/base/272144 Log: The strtol(3) family of functions would set errno when it hits one. Check errno and handle it as invalid input. Obtained from: HardenedBSD Submitted by: David CARLIER MFC after: 2 weeks Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Thu Sep 25 22:22:57 2014 (r272143) +++ head/sbin/sysctl/sysctl.c Thu Sep 25 22:37:27 2014 (r272144) @@ -305,7 +305,8 @@ parse(const char *string, int lineno) } else { intval = (int)strtol(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') { + if (errno != 0 || endptr == newval || + *endptr != '\0') { warnx("invalid integer '%s'%s", (char *)newval, line); return (1); @@ -316,7 +317,8 @@ parse(const char *string, int lineno) break; case CTLTYPE_UINT: uintval = (int) strtoul(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') { + if (errno != 0 || endptr == newval || + *endptr != '\0') { warnx("invalid unsigned integer '%s'%s", (char *)newval, line); return (1); @@ -326,7 +328,8 @@ parse(const char *string, int lineno) break; case CTLTYPE_LONG: longval = strtol(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') { + if (errno != 0 || endptr == newval || + *endptr != '\0') { warnx("invalid long integer '%s'%s", (char *)newval, line); return (1); @@ -336,7 +339,8 @@ parse(const char *string, int lineno) break; case CTLTYPE_ULONG: ulongval = strtoul(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') { + if (errno != 0 || endptr == newval || + *endptr != '\0') { warnx("invalid unsigned long integer" " '%s'%s", (char *)newval, line); return (1); @@ -348,7 +352,8 @@ parse(const char *string, int lineno) break; case CTLTYPE_S64: i64val = strtoimax(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') { + if (errno != 0 || endptr == newval || + *endptr != '\0') { warnx("invalid int64_t '%s'%s", (char *)newval, line); return (1); @@ -358,7 +363,8 @@ parse(const char *string, int lineno) break; case CTLTYPE_U64: u64val = strtoumax(newval, &endptr, 0); - if (endptr == newval || *endptr != '\0') { + if (errno != 0 || endptr == newval || + *endptr != '\0') { warnx("invalid uint64_t '%s'%s", (char *)newval, line); return (1); @@ -669,14 +675,16 @@ set_IK(const char *str, int *val) p = &str[len - 1]; if (*p == 'C' || *p == 'F') { temp = strtof(str, &endptr); - if (endptr == str || endptr != p) + if (errno != 0 || endptr == str || + endptr != p) return (0); if (*p == 'F') temp = (temp - 32) * 5 / 9; kelv = temp * 10 + 2732; } else { kelv = (int)strtol(str, &endptr, 10); - if (endptr == str || *endptr != '\0') + if (errno != 0 || endptr == str || + *endptr != '\0') return (0); } *val = kelv; From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 22:40:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1AE4B02; Thu, 25 Sep 2014 22:40:44 +0000 (UTC) Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [IPv6:2a00:1450:400c:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D905BAE; Thu, 25 Sep 2014 22:40:43 +0000 (UTC) Received: by mail-wg0-f43.google.com with SMTP id y10so8876972wgg.2 for ; Thu, 25 Sep 2014 15:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=SA5uociwHSyGMaGwnAIlO41qx3tnt5dvytvksFC69D8=; b=RzzRH1hOAd2UGRHpHZvuF1fy833kxj5l5CjaRuWcO3HzYbQSb9uAAEXcAESTSBOfi5 gUB9AagyU2I7BxzzmZVTJSZOKPAQF8vDuwVPQ6ojV9y0xDT22xtxid4bIWrLAYu9NEyx Xf5TTqO19lqoC5Igi25EEjPs2e0SlH6MM7dG2eM1m/LdtWiT4UNbLJD1AYfVxjmFOyBa 3gWbTqldHv7ND3o0DatsiemdSrASudWkK9gHXG6k63IxxOXmiyrZ6ge7DS16Y528ly6c SPsWg7olk1Rvp9QmxMEsw3NScW6sEFXD6uELp3I0vqIk+w8lNBTka7e2nJdZEqPzcrJ9 kuzg== X-Received: by 10.180.76.68 with SMTP id i4mr42650845wiw.64.1411684838953; Thu, 25 Sep 2014 15:40:38 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id ju1sm4177266wjc.1.2014.09.25.15.40.37 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 25 Sep 2014 15:40:38 -0700 (PDT) Date: Fri, 26 Sep 2014 00:40:35 +0200 From: Mateusz Guzik To: Xin LI Subject: Re: svn commit: r272144 - head/sbin/sysctl Message-ID: <20140925224035.GA6065@dft-labs.eu> References: <201409252237.s8PMbScl041679@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201409252237.s8PMbScl041679@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 22:40:45 -0000 On Thu, Sep 25, 2014 at 10:37:28PM +0000, Xin LI wrote: > Author: delphij > Date: Thu Sep 25 22:37:27 2014 > New Revision: 272144 > URL: http://svnweb.freebsd.org/changeset/base/272144 > > Log: > The strtol(3) family of functions would set errno when it hits one. > Check errno and handle it as invalid input. > But this requires explicitely setting errno to 0 before strto* call, otherwise you cannot know whether errno is meaningful when you test it. Also it looks like the code would use some deduplications with macros or something. > Obtained from: HardenedBSD > Submitted by: David CARLIER > MFC after: 2 weeks > > Modified: > head/sbin/sysctl/sysctl.c > > Modified: head/sbin/sysctl/sysctl.c > ============================================================================== > --- head/sbin/sysctl/sysctl.c Thu Sep 25 22:22:57 2014 (r272143) > +++ head/sbin/sysctl/sysctl.c Thu Sep 25 22:37:27 2014 (r272144) > @@ -305,7 +305,8 @@ parse(const char *string, int lineno) > } else { > intval = (int)strtol(newval, &endptr, > 0); > - if (endptr == newval || *endptr != '\0') { > + if (errno != 0 || endptr == newval || > + *endptr != '\0') { > warnx("invalid integer '%s'%s", > (char *)newval, line); > return (1); > @@ -316,7 +317,8 @@ parse(const char *string, int lineno) > break; > case CTLTYPE_UINT: > uintval = (int) strtoul(newval, &endptr, 0); > - if (endptr == newval || *endptr != '\0') { > + if (errno != 0 || endptr == newval || > + *endptr != '\0') { > warnx("invalid unsigned integer '%s'%s", > (char *)newval, line); > return (1); > @@ -326,7 +328,8 @@ parse(const char *string, int lineno) > break; > case CTLTYPE_LONG: > longval = strtol(newval, &endptr, 0); > - if (endptr == newval || *endptr != '\0') { > + if (errno != 0 || endptr == newval || > + *endptr != '\0') { > warnx("invalid long integer '%s'%s", > (char *)newval, line); > return (1); > @@ -336,7 +339,8 @@ parse(const char *string, int lineno) > break; > case CTLTYPE_ULONG: > ulongval = strtoul(newval, &endptr, 0); > - if (endptr == newval || *endptr != '\0') { > + if (errno != 0 || endptr == newval || > + *endptr != '\0') { > warnx("invalid unsigned long integer" > " '%s'%s", (char *)newval, line); > return (1); > @@ -348,7 +352,8 @@ parse(const char *string, int lineno) > break; > case CTLTYPE_S64: > i64val = strtoimax(newval, &endptr, 0); > - if (endptr == newval || *endptr != '\0') { > + if (errno != 0 || endptr == newval || > + *endptr != '\0') { > warnx("invalid int64_t '%s'%s", > (char *)newval, line); > return (1); > @@ -358,7 +363,8 @@ parse(const char *string, int lineno) > break; > case CTLTYPE_U64: > u64val = strtoumax(newval, &endptr, 0); > - if (endptr == newval || *endptr != '\0') { > + if (errno != 0 || endptr == newval || > + *endptr != '\0') { > warnx("invalid uint64_t '%s'%s", > (char *)newval, line); > return (1); > @@ -669,14 +675,16 @@ set_IK(const char *str, int *val) > p = &str[len - 1]; > if (*p == 'C' || *p == 'F') { > temp = strtof(str, &endptr); > - if (endptr == str || endptr != p) > + if (errno != 0 || endptr == str || > + endptr != p) > return (0); > if (*p == 'F') > temp = (temp - 32) * 5 / 9; > kelv = temp * 10 + 2732; > } else { > kelv = (int)strtol(str, &endptr, 10); > - if (endptr == str || *endptr != '\0') > + if (errno != 0 || endptr == str || > + *endptr != '\0') > return (0); > } > *val = kelv; > -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 22:47:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98EF9D17; Thu, 25 Sep 2014 22:47:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84E72C76; Thu, 25 Sep 2014 22:47:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PMlKTQ046313; Thu, 25 Sep 2014 22:47:20 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PMlKMM046312; Thu, 25 Sep 2014 22:47:20 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409252247.s8PMlKMM046312@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 25 Sep 2014 22:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272145 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 22:47:20 -0000 Author: delphij Date: Thu Sep 25 22:47:19 2014 New Revision: 272145 URL: http://svnweb.freebsd.org/changeset/base/272145 Log: Explicitly set errno to 0 before calling strto*. Suggested by: mjg MFC after: 2 weeks Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Thu Sep 25 22:37:27 2014 (r272144) +++ head/sbin/sysctl/sysctl.c Thu Sep 25 22:47:19 2014 (r272145) @@ -294,6 +294,8 @@ parse(const char *string, int lineno) } } + errno = 0; + switch (kind & CTLTYPE) { case CTLTYPE_INT: if (strcmp(fmt, "IK") == 0) { @@ -673,6 +675,7 @@ set_IK(const char *str, int *val) if ((len = strlen(str)) == 0) return (0); p = &str[len - 1]; + errno = 0; if (*p == 'C' || *p == 'F') { temp = strtof(str, &endptr); if (errno != 0 || endptr == str || From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 23:04:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7352F1E6; Thu, 25 Sep 2014 23:04:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5403FE5B; Thu, 25 Sep 2014 23:04:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PN4cID055265; Thu, 25 Sep 2014 23:04:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PN4cqd055264; Thu, 25 Sep 2014 23:04:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201409252304.s8PN4cqd055264@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 25 Sep 2014 23:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272146 - head/lib/libc/stdtime X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 23:04:38 -0000 Author: pfg Date: Thu Sep 25 23:04:37 2014 New Revision: 272146 URL: http://svnweb.freebsd.org/changeset/base/272146 Log: Revert r272122 The patch still needs to be more robust and it broke the build on MIPS so revert it for now while all the issues are fixed. Reported by: ache, davide PR: 137307 Modified: head/lib/libc/stdtime/strptime.c Modified: head/lib/libc/stdtime/strptime.c ============================================================================== --- head/lib/libc/stdtime/strptime.c Thu Sep 25 22:47:19 2014 (r272145) +++ head/lib/libc/stdtime/strptime.c Thu Sep 25 23:04:37 2014 (r272146) @@ -55,32 +55,10 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" #include "timelocal.h" -#include "tzfile.h" static char * _strptime(const char *, const char *, struct tm *, int *, locale_t); -#define asizeof(a) (sizeof(a) / sizeof((a)[0])) - -#define FLAG_NONE (1 << 0) -#define FLAG_YEAR (1 << 1) -#define FLAG_MONTH (1 << 2) -#define FLAG_YDAY (1 << 3) -#define FLAG_MDAY (1 << 4) -#define FLAG_WDAY (1 << 5) - -/* - * Calculate the week day of the first day of a year. Valid for - * the Gregorian calendar, which began Sept 14, 1752 in the UK - * and its colonies. Ref: - * http://en.wikipedia.org/wiki/Calculating_the_day_of_the_week/ - */ - -static int -first_wday_of(int year) -{ - return (((2 * (3 - (year / 100) % 4)) + (year % 100) + - ((year % 100) / 4) + (isleap(year) ? 6 : 0) + 1) % 7); -} +#define asizeof(a) (sizeof (a) / sizeof ((a)[0])) static char * _strptime(const char *buf, const char *fmt, struct tm *tm, int *GMTp, @@ -88,17 +66,9 @@ _strptime(const char *buf, const char *f { char c; const char *ptr; - int day_offset = -1, wday_offset; int i, len; - int flags; int Ealternative, Oalternative; - const struct lc_time_T *tptr = __get_current_time_locale(locale); - static int start_of_month[2][13] = { - {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}, - {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366} - }; - - flags = FLAG_NONE; + struct lc_time_T *tptr = __get_current_time_locale(locale); ptr = fmt; while (*ptr != 0) { @@ -149,9 +119,7 @@ label: if (i < 19) return (NULL); - tm->tm_year = i * 100 - TM_YEAR_BASE; - flags |= FLAG_YEAR; - + tm->tm_year = i * 100 - 1900; break; case 'c': @@ -229,8 +197,6 @@ label: return (NULL); tm->tm_yday = i - 1; - flags |= FLAG_YDAY; - break; case 'M': @@ -337,32 +303,7 @@ label: return (NULL); tm->tm_wday = i; - if (day_offset >= 0 && (i - day_offset) != 0) { - tm->tm_yday += i - day_offset; - i = 0; - while (tm->tm_yday >= - start_of_month[isleap(tm->tm_year + - TM_YEAR_BASE)][i]) - i++; - if (i > 12) - { - i = 1; - tm->tm_yday -= - start_of_month[isleap(tm->tm_year + - TM_YEAR_BASE)] - [12]; - tm->tm_year++; - } - tm->tm_mon = i - 1; - tm->tm_mday = tm->tm_yday - - start_of_month[isleap(tm->tm_year + - TM_YEAR_BASE)] - [i - 1] + 1; - } buf += len; - flags |= FLAG_YEAR | FLAG_MONTH | FLAG_YDAY | - FLAG_MDAY | FLAG_WDAY; - break; case 'U': @@ -372,8 +313,6 @@ label: * information present in the tm structure at this * point to calculate a real value, so just check the * range for now. - * We expect that the year has already been - * parsed. */ if (!isdigit_l((unsigned char)*buf, locale)) return (NULL); @@ -388,45 +327,6 @@ label: if (i > 53) return (NULL); - /* Week numbers are l-origin. So that we can always - * return the date of a Sunday (or Monday), treat week - * 0 as week 1. - */ - - if (i == 0) - i = 1; - - if (c == 'U') - day_offset = TM_SUNDAY; - else - day_offset = TM_MONDAY; - - /* Set the date to the first Sunday (or Monday) - * of the specified week of the year. - */ - - tm->tm_yday = (7 - first_wday_of(tm->tm_year + - TM_YEAR_BASE) + day_offset) % 7 + (i - 1) * 7; - i = 0; - while (tm->tm_yday >= - start_of_month[isleap(tm->tm_year + TM_YEAR_BASE)][i]) - i++; - if (i > 12) - { - i = 1; - tm->tm_yday -= - start_of_month[isleap(tm->tm_year + - TM_YEAR_BASE)][12]; - tm->tm_year++; - } - tm->tm_mon = i - 1; - tm->tm_mday = tm->tm_yday - - start_of_month[isleap(tm->tm_year + TM_YEAR_BASE)] - [i - 1] + 1; - tm->tm_wday = day_offset; - flags |= FLAG_YEAR | FLAG_MONTH | FLAG_YDAY | - FLAG_MDAY | FLAG_WDAY; - break; case 'w': @@ -438,7 +338,6 @@ label: return (NULL); tm->tm_wday = i; - flags != FLAG_WDAY; break; @@ -475,7 +374,6 @@ label: return (NULL); tm->tm_mday = i; - flags |= FLAG_MDAY; break; @@ -515,8 +413,6 @@ label: tm->tm_mon = i; buf += len; - flags |= FLAG_MONTH; - break; case 'm': @@ -534,7 +430,6 @@ label: return (NULL); tm->tm_mon = i - 1; - flags |= FLAG_MONTH; break; @@ -576,14 +471,13 @@ label: len--; } if (c == 'Y') - i -= TM_YEAR_BASE; + i -= 1900; if (c == 'y' && i < 69) i += 100; if (i < 0) return (NULL); tm->tm_year = i; - flags |= FLAG_YEAR; break; @@ -649,25 +543,10 @@ label: break; } } - - if (flags & (FLAG_YEAR | FLAG_MONTH)) { - if (!tm->tm_yday && (flags & FLAG_MDAY)) - tm->tm_yday = start_of_month[isleap(tm->tm_year - + TM_YEAR_BASE)][tm->tm_mon] + (tm->tm_mday - 1); - if (!tm->tm_wday) { - i = 0; - wday_offset = first_wday_of(tm->tm_year); - while (i++ <= tm->tm_yday) - if (wday_offset++ >= 6) - wday_offset = 0; - - tm->tm_wday = wday_offset; - } - } - return ((char *)buf); } + char * strptime_l(const char * __restrict buf, const char * __restrict fmt, struct tm * __restrict tm, locale_t loc) From owner-svn-src-all@FreeBSD.ORG Thu Sep 25 23:09:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0515D3AC; Thu, 25 Sep 2014 23:09:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3A8CE8C; Thu, 25 Sep 2014 23:09:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8PN9ZYB056029; Thu, 25 Sep 2014 23:09:35 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8PN9ZPm056028; Thu, 25 Sep 2014 23:09:35 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201409252309.s8PN9ZPm056028@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Thu, 25 Sep 2014 23:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272147 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2014 23:09:36 -0000 Author: grehan Date: Thu Sep 25 23:09:35 2014 New Revision: 272147 URL: http://svnweb.freebsd.org/changeset/base/272147 Log: MFC r272007 Correct display of bhyve SMBIOS UUIDs with dmidecode by bumping the version. The mixed little/big-endianness of SMBIOS UUIDs was clarified in v2.6 of the SMBIOS spec. dmidecode uses the reported version of SMBIOS to determine the layout and what to byte-swap. bhyve's SMBIOS reported as 2.4 though it implemented the 2.6-style of memory layout. This resulted in dmidecode reporting a different UUID than one passed in via the -U option. Fix by exporting a version of 2.6. Approved by: re (gjb) Modified: stable/10/usr.sbin/bhyve/smbiostbl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/smbiostbl.c ============================================================================== --- stable/10/usr.sbin/bhyve/smbiostbl.c Thu Sep 25 23:04:37 2014 (r272146) +++ stable/10/usr.sbin/bhyve/smbiostbl.c Thu Sep 25 23:09:35 2014 (r272147) @@ -737,7 +737,7 @@ smbios_ep_initializer(struct smbios_entr smbios_ep->eplen = 0x1F; assert(sizeof (struct smbios_entry_point) == smbios_ep->eplen); smbios_ep->major = 2; - smbios_ep->minor = 4; + smbios_ep->minor = 6; smbios_ep->revision = 0; memcpy(smbios_ep->ianchor, SMBIOS_ENTRY_IANCHOR, SMBIOS_ENTRY_IANCHORLEN); From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 00:00:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6301DA16; Fri, 26 Sep 2014 00:00:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E5C5612; Fri, 26 Sep 2014 00:00:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q00EwK079821; Fri, 26 Sep 2014 00:00:14 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q00Ew2079820; Fri, 26 Sep 2014 00:00:14 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409260000.s8Q00Ew2079820@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 26 Sep 2014 00:00:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272148 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 00:00:14 -0000 Author: gjb Date: Fri Sep 26 00:00:13 2014 New Revision: 272148 URL: http://svnweb.freebsd.org/changeset/base/272148 Log: Update stable/10 to -BETA3 as part of the 10.1-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/conf/newvers.sh Modified: stable/10/sys/conf/newvers.sh ============================================================================== --- stable/10/sys/conf/newvers.sh Thu Sep 25 23:09:35 2014 (r272147) +++ stable/10/sys/conf/newvers.sh Fri Sep 26 00:00:13 2014 (r272148) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.1" -BRANCH="BETA2" +BRANCH="BETA3" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 00:18:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3A04DD8 for ; Fri, 26 Sep 2014 00:18:19 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4C02780 for ; Fri, 26 Sep 2014 00:18:19 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q0IJZv067792 for ; Fri, 26 Sep 2014 00:18:19 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s8Q0IJxa067788 for svn-src-all@freebsd.org; Fri, 26 Sep 2014 00:18:19 GMT (envelope-from bdrewery) Received: (qmail 82550 invoked from network); 25 Sep 2014 19:18:18 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 25 Sep 2014 19:18:18 -0500 Message-ID: <5424B0C0.30202@FreeBSD.org> Date: Thu, 25 Sep 2014 19:18:08 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r271201 - head/sys/dev/ahci References: <201409061820.s86IKpnw042259@svn.freebsd.org> In-Reply-To: <201409061820.s86IKpnw042259@svn.freebsd.org> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1qFHmSm7rM8vwNwf0gOfSPHna9NkV33nH" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 00:18:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1qFHmSm7rM8vwNwf0gOfSPHna9NkV33nH Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable This drove me crazy for the past few days! https://lists.freebsd.org/pipermail/freebsd-current/2014-September/052215= =2Ehtml Not sure about the first trace there, but the others I encountered were due to this not being fixed yet. smh@ tracked the ordering down and then we found this. I couldn't try a newer build easily since my system would panic on just buildworld :) On 9/6/2014 1:20 PM, Warner Losh wrote: > Author: imp > Date: Sat Sep 6 18:20:50 2014 > New Revision: 271201 > URL: http://svnweb.freebsd.org/changeset/base/271201 >=20 > Log: > Restore order of interrupt setup. Minor problems can result by > setting up the interrupts too early: > =20 > Reviewed by: mav@ > Sponsored by: Netflix >=20 > Modified: > head/sys/dev/ahci/ahci.c > head/sys/dev/ahci/ahci_pci.c >=20 > Modified: head/sys/dev/ahci/ahci.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/dev/ahci/ahci.c Sat Sep 6 18:08:21 2014 (r271200) > +++ head/sys/dev/ahci/ahci.c Sat Sep 6 18:20:50 2014 (r271201) > @@ -229,6 +229,15 @@ ahci_attach(device_t dev) > =20 > ahci_ctlr_setup(dev); > =20 > + /* Setup interrupts. */ > + if (ahci_setup_interrupt(dev)) { > + bus_dma_tag_destroy(ctlr->dma_tag); > + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, > + ctlr->r_mem); > + rman_fini(&ctlr->sc_iomem); > + return ENXIO; > + } > + > i =3D 0; > for (u =3D ctlr->ichannels; u !=3D 0; u >>=3D 1) > i +=3D (u & 1); >=20 > Modified: head/sys/dev/ahci/ahci_pci.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/dev/ahci/ahci_pci.c Sat Sep 6 18:08:21 2014 (r271200) > +++ head/sys/dev/ahci/ahci_pci.c Sat Sep 6 18:20:50 2014 (r271201) > @@ -417,13 +417,6 @@ ahci_pci_attach(device_t dev) > ctlr->numirqs =3D 1; > } > =20 > - if (ahci_setup_interrupt(dev)) { > - if (ctlr->msi) > - pci_release_msi(dev); > - bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem);= > - return ENXIO; > - } > - > error =3D ahci_attach(dev); > if (error !=3D 0) > if (ctlr->msi) >=20 --=20 Regards, Bryan Drewery --1qFHmSm7rM8vwNwf0gOfSPHna9NkV33nH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJUJLDAAAoJEDXXcbtuRpfPJz4H/3XDSotjh2Tv6J7zPNfXVJ6U ZlOJG6lREpWl5LHAmybC8JUXU0tk1lNMZqvBkDI91qHn0s1dvaGhrje8vgvINSzT QjIuvNl3O4diseavNm3uE8T5a2vtWdaG658N1PlkDdD2jb8CGieBfvajck7L867R l1oqnJITCuHJ13Bp2QtaB3DjIXU+QsBkC15d4iQLfRzPLD0SeP4FT+JROE6s+SkB ZeRCMLgkJOr41V9qbUp4euXX44ThLXZe035GviR0R8CPEPxfMyiq/F2neWoIEy7V FdM2e/kGO+ubyE+2eAj5zwDMjT8Olm4IsvWaNSAw3+I/GFAZ/onZ1on2KybKyko= =MqTS -----END PGP SIGNATURE----- --1qFHmSm7rM8vwNwf0gOfSPHna9NkV33nH-- From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 00:19:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2FA0FB0; Fri, 26 Sep 2014 00:19:43 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 819EC797; Fri, 26 Sep 2014 00:19:43 +0000 (UTC) Received: from zeta.ixsystems.com (unknown [69.198.165.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id D3F6A15B80; Thu, 25 Sep 2014 17:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1411690782; x=1411705182; bh=WiLztFQpqIs679uW30g6tNHuPGt4c8rs3QM571ro2cE=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=uKb+urerGbrcWguSUXWgDtqxB/06gR2zoCcC8dSs5FjDIBBmqR67IhsQxClw5iJYy /IEMHSfqnqFiA94OLjRArwwjkNHAx+rqmZt4BKPoaChT0Qes1+QiMAqqkzS95PQtVR gHJyMX5h/vjnA6QycgOIITUQW1k2qRK7d0Q2nkg4= Message-ID: <5424B11E.4030909@delphij.net> Date: Thu, 25 Sep 2014 17:19:42 -0700 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Mateusz Guzik , Xin LI Subject: Re: svn commit: r272144 - head/sbin/sysctl References: <201409252237.s8PMbScl041679@svn.freebsd.org> <20140925224035.GA6065@dft-labs.eu> In-Reply-To: <20140925224035.GA6065@dft-labs.eu> Content-Type: multipart/mixed; boundary="------------040109080302010904010106" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 00:19:43 -0000 This is a multi-part message in MIME format. --------------040109080302010904010106 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 09/25/14 15:40, Mateusz Guzik wrote: > On Thu, Sep 25, 2014 at 10:37:28PM +0000, Xin LI wrote: >> Author: delphij Date: Thu Sep 25 22:37:27 2014 New Revision: >> 272144 URL: http://svnweb.freebsd.org/changeset/base/272144 >> >> Log: The strtol(3) family of functions would set errno when it >> hits one. Check errno and handle it as invalid input. >> > > But this requires explicitely setting errno to 0 before strto* > call, otherwise you cannot know whether errno is meaningful when > you test it. Fixed in r272145, good catch! > Also it looks like the code would use some deduplications with > macros or something. I think the code can use some refactor. Does the attached patch look good to you? Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0 iQIcBAEBCgAGBQJUJLEeAAoJEJW2GBstM+nsSD0P/3Oe4gzNc1AYy14cg8ewZ0nL w75gPr9rMABxMXk7tGut6qS+W1vTZ32g9rCpzE+7ra1A8kDZ9l+VkJbUwkN2nr/i udsMq+qQ1qB+dCsVJLm8Pjsh/g+AVlSxXdHrkD1u49XhANZQUGt9NBaO0ah84c5J vaZ+Sq7cR6fF2VrZDJ0MLxW8tHLgW6hIVORvyiohvOqhzBHOFihDEDcoUOamzFZI txqI2oxjuhGy+T1V4dVYso/PgYhhnFC4L9Lvx5E9EqUZrVzckPP1PYXiZiQR/i7H ZEV5RgxHOGXEYNVDZXoEQthE1iP3pzFhe/xNURzlUqZIwgPeJ6Q2xz+As/C0yXlT +LxmXdQ/zsQmRu5b2m7TvBjBp18znAR2c2mKbvHS3EX6UWEmUKwcb2CREm0AbnQL kFrLRsksJfxD1TCkfmqysOa6WSkvRQpJ4csZdKf9y5nZFh/yjdSnzJULLKphpbzr npc9ZYJ9m7bLj7OZF5UPwEr0JfTnRDn6VnMqKiUTgXpHk5Lpm7vm5WefdOWMyTmL nwtmU3SyaJdLBrWARY1ZyN0ENmzTrs3sjCyWvhwlAomYIVuahT1oCuaRYIDyzito mThiFbuRA+ufz6m8OcIXeiGLxkimdIHm68ZreNZlBHA/R/bH84vLiIN0HRNhgAOy bgc97yetD5PL8NhRC8G/ =PWTt -----END PGP SIGNATURE----- --------------040109080302010904010106 Content-Type: text/plain; charset=UTF-8; name="sysctl.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="sysctl.diff" SW5kZXg6IHN5c2N0bC5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5c2N0bC5jCShyZXZpc2lvbiAy NzIxNDUpCisrKyBzeXNjdGwuYwkod29ya2luZyBjb3B5KQpAQCAtNTcsNiArNTcsNyBAQCBz dGF0aWMgY29uc3QgY2hhciByY3NpZFtdID0KICNpbmNsdWRlIDxtYWNoaW5lL3BjL2Jpb3Mu aD4KICNlbmRpZgogCisjaW5jbHVkZSA8YXNzZXJ0Lmg+CiAjaW5jbHVkZSA8Y3R5cGUuaD4K ICNpbmNsdWRlIDxlcnIuaD4KICNpbmNsdWRlIDxlcnJuby5oPgpAQCAtODAsOCArODEsMzIg QEAgc3RhdGljIGludAlzaG93X3ZhcihpbnQgKiwgaW50KTsKIHN0YXRpYyBpbnQJc3lzY3Rs X2FsbChpbnQgKm9pZCwgaW50IGxlbik7CiBzdGF0aWMgaW50CW5hbWUyb2lkKGNvbnN0IGNo YXIgKiwgaW50ICopOwogCi1zdGF0aWMgaW50CXNldF9JSyhjb25zdCBjaGFyICosIGludCAq KTsKK3N0YXRpYyBpbnQJc3RySUt0b2koY29uc3QgY2hhciAqLCBjaGFyICoqKTsKIAorc3Rh dGljIGludCBjdGxfc2lnbltDVExUWVBFKzFdID0geworCVtDVExUWVBFX0lOVF0gPSAxLAor CVtDVExUWVBFX0xPTkddID0gMSwKKwlbQ1RMVFlQRV9TNjRdID0gMSwKK307CisKK3N0YXRp YyBpbnQgY3RsX3NpemVbQ1RMVFlQRSsxXSA9IHsKKwlbQ1RMVFlQRV9JTlRdID0gc2l6ZW9m KGludCksCisJW0NUTFRZUEVfVUlOVF0gPSBzaXplb2YodV9pbnQpLAorCVtDVExUWVBFX0xP TkddID0gc2l6ZW9mKGxvbmcpLAorCVtDVExUWVBFX1VMT05HXSA9IHNpemVvZih1X2xvbmcp LAorCVtDVExUWVBFX1M2NF0gPSBzaXplb2YoaW50NjRfdCksCisJW0NUTFRZUEVfVTY0XSA9 IHNpemVvZih1aW50NjRfdCksCit9OworCitzdGF0aWMgY29uc3QgY2hhciAqY3RsX3R5cGVu YW1lW0NUTFRZUEUrMV0gPSB7CisJW0NUTFRZUEVfSU5UXSA9ICJpbnRlZ2VyIiwKKwlbQ1RM VFlQRV9VSU5UXSA9ICJ1bnNpZ25lZCBpbnRlZ2VyIiwKKwlbQ1RMVFlQRV9MT05HXSA9ICJs b25nIGludGVnZXIiLAorCVtDVExUWVBFX1VMT05HXSA9ICJ1bnNpZ25lZCBsb25nIiwKKwlb Q1RMVFlQRV9TNjRdID0gImludDY0X3QiLAorCVtDVExUWVBFX1U2NF0gPSAidWludDY0X3Qi LAorfTsKKwogc3RhdGljIHZvaWQKIHVzYWdlKHZvaWQpCiB7CkBAIC0xOTEsNyArMjE2LDgg QEAgc3RhdGljIGludAogcGFyc2UoY29uc3QgY2hhciAqc3RyaW5nLCBpbnQgbGluZW5vKQog ewogCWludCBsZW4sIGksIGo7Ci0Jdm9pZCAqbmV3dmFsID0gMDsKKwljb25zdCB2b2lkICpu ZXd2YWwgPSBOVUxMOworCWNvbnN0IGNoYXIgKm5ld3ZhbHN0ciA9IE5VTEw7CiAJaW50IGlu dHZhbDsKIAl1bnNpZ25lZCBpbnQgdWludHZhbDsKIAlsb25nIGxvbmd2YWw7CkBAIC0yMzAs NyArMjU2LDcgQEAgcGFyc2UoY29uc3QgY2hhciAqc3RyaW5nLCBpbnQgbGluZW5vKQogCQkJ CWNwW3N0cmxlbihjcCkgLSAxXSA9ICdcMCc7CiAJCQljcCsrOwogCQl9Ci0JCW5ld3ZhbCA9 IGNwOworCQluZXd2YWxzdHIgPSBjcDsKIAkJbmV3c2l6ZSA9IHN0cmxlbihjcCk7CiAJfQog CWxlbiA9IG5hbWUyb2lkKGJ1ZnAsIG1pYik7CkBAIC0yNTQsNyArMjgwLDcgQEAgcGFyc2Uo Y29uc3QgY2hhciAqc3RyaW5nLCBpbnQgbGluZW5vKQogCQkJZXhpdCgxKTsKIAl9CiAKLQlp ZiAobmV3dmFsID09IE5VTEwgfHwgZGZsYWcpIHsKKwlpZiAobmV3dmFsc3RyID09IE5VTEwg fHwgZGZsYWcpIHsKIAkJaWYgKChraW5kICYgQ1RMVFlQRSkgPT0gQ1RMVFlQRV9OT0RFKSB7 CiAJCQlpZiAoZGZsYWcpIHsKIAkJCQlpID0gc2hvd192YXIobWliLCBsZW4pOwpAQCAtMjg4 LDEwICszMTQsMjIgQEAgcGFyc2UoY29uc3QgY2hhciAqc3RyaW5nLCBpbnQgbGluZW5vKQog CQkgICAgKGtpbmQgJiBDVExUWVBFKSA9PSBDVExUWVBFX1VMT05HIHx8CiAJCSAgICAoa2lu ZCAmIENUTFRZUEUpID09IENUTFRZUEVfUzY0IHx8CiAJCSAgICAoa2luZCAmIENUTFRZUEUp ID09IENUTFRZUEVfVTY0KSB7Ci0JCQlpZiAoc3RybGVuKG5ld3ZhbCkgPT0gMCkgeworCQkJ aWYgKHN0cmxlbihuZXd2YWxzdHIpID09IDApIHsKIAkJCQl3YXJueCgiZW1wdHkgbnVtZXJp YyB2YWx1ZSIpOwogCQkJCXJldHVybiAoMSk7CiAJCQl9CisJCX0gZWxzZSBpZiAoKGtpbmQg JiBDVExUWVBFKSAhPSBDVExUWVBFX1NUUklORykgeworCQkJLyoKKwkJCSAqIFRoZSBvbmx5 IGFjY2VwdGFibGUgdHlwZXMgYXJlOgorCQkJICogQ1RMVFlQRV9JTlQsIENUTFRZUEVfVUlO VCwKKwkJCSAqIENUTFRZUEVfTE9ORywgQ1RMVFlQRV9VTE9ORywKKwkJCSAqIENUTFRZUEVf UzY0LCBDVExUWVBFX1U2NCBhbmQKKwkJCSAqIENUTFRZUEVfU1RSSU5HLgorCQkJICovCisJ CQl3YXJueCgib2lkICclcycgaXMgdHlwZSAlZCwiCisJCQkJIiBjYW5ub3Qgc2V0IHRoYXQl cyIsIGJ1ZnAsCisJCQkJa2luZCAmIENUTFRZUEUsIGxpbmUpOworCQkJcmV0dXJuICgxKTsK IAkJfQogCiAJCWVycm5vID0gMDsKQEAgLTI5OCw5MSArMzM2LDUzIEBAIHBhcnNlKGNvbnN0 IGNoYXIgKnN0cmluZywgaW50IGxpbmVubykKIAogCQlzd2l0Y2ggKGtpbmQgJiBDVExUWVBF KSB7CiAJCQljYXNlIENUTFRZUEVfSU5UOgotCQkJCWlmIChzdHJjbXAoZm10LCAiSUsiKSA9 PSAwKSB7Ci0JCQkJCWlmICghc2V0X0lLKG5ld3ZhbCwgJmludHZhbCkpIHsKLQkJCQkJCXdh cm54KCJpbnZhbGlkIHZhbHVlICclcyclcyIsCi0JCQkJCQkgICAgKGNoYXIgKiluZXd2YWws IGxpbmUpOwotCQkJCQkJcmV0dXJuICgxKTsKLQkJCQkJfQotIAkJCQl9IGVsc2UgewotCQkJ CQlpbnR2YWwgPSAoaW50KXN0cnRvbChuZXd2YWwsICZlbmRwdHIsCisJCQkJaWYgKHN0cmNt cChmbXQsICJJSyIpID09IDApCisJCQkJCWludHZhbCA9IHN0cklLdG9pKG5ld3ZhbHN0ciwg JmVuZHB0cik7CisgCQkJCWVsc2UKKwkJCQkJaW50dmFsID0gKGludClzdHJ0b2wobmV3dmFs c3RyLCAmZW5kcHRyLAogCQkJCQkgICAgMCk7Ci0JCQkJCWlmIChlcnJubyAhPSAwIHx8IGVu ZHB0ciA9PSBuZXd2YWwgfHwKLQkJCQkJCSplbmRwdHIgIT0gJ1wwJykgewotCQkJCQkJd2Fy bngoImludmFsaWQgaW50ZWdlciAnJXMnJXMiLAotCQkJCQkJICAgIChjaGFyICopbmV3dmFs LCBsaW5lKTsKLQkJCQkJCXJldHVybiAoMSk7Ci0JCQkJCX0KLQkJCQl9CiAJCQkJbmV3dmFs ID0gJmludHZhbDsKIAkJCQluZXdzaXplID0gc2l6ZW9mKGludHZhbCk7CiAJCQkJYnJlYWs7 CiAJCQljYXNlIENUTFRZUEVfVUlOVDoKLQkJCQl1aW50dmFsID0gKGludCkgc3RydG91bChu ZXd2YWwsICZlbmRwdHIsIDApOwotCQkJCWlmIChlcnJubyAhPSAwIHx8IGVuZHB0ciA9PSBu ZXd2YWwgfHwKLQkJCQkJKmVuZHB0ciAhPSAnXDAnKSB7Ci0JCQkJCXdhcm54KCJpbnZhbGlk IHVuc2lnbmVkIGludGVnZXIgJyVzJyVzIiwKLQkJCQkJICAgIChjaGFyICopbmV3dmFsLCBs aW5lKTsKLQkJCQkJcmV0dXJuICgxKTsKLQkJCQl9CisJCQkJdWludHZhbCA9IChpbnQpIHN0 cnRvdWwobmV3dmFsc3RyLCAmZW5kcHRyLCAwKTsKIAkJCQluZXd2YWwgPSAmdWludHZhbDsK IAkJCQluZXdzaXplID0gc2l6ZW9mKHVpbnR2YWwpOwogCQkJCWJyZWFrOwogCQkJY2FzZSBD VExUWVBFX0xPTkc6Ci0JCQkJbG9uZ3ZhbCA9IHN0cnRvbChuZXd2YWwsICZlbmRwdHIsIDAp OwotCQkJCWlmIChlcnJubyAhPSAwIHx8IGVuZHB0ciA9PSBuZXd2YWwgfHwKLQkJCQkJKmVu ZHB0ciAhPSAnXDAnKSB7Ci0JCQkJCXdhcm54KCJpbnZhbGlkIGxvbmcgaW50ZWdlciAnJXMn JXMiLAotCQkJCQkgICAgKGNoYXIgKiluZXd2YWwsIGxpbmUpOwotCQkJCQlyZXR1cm4gKDEp OwotCQkJCX0KKwkJCQlsb25ndmFsID0gc3RydG9sKG5ld3ZhbHN0ciwgJmVuZHB0ciwgMCk7 CiAJCQkJbmV3dmFsID0gJmxvbmd2YWw7CiAJCQkJbmV3c2l6ZSA9IHNpemVvZihsb25ndmFs KTsKIAkJCQlicmVhazsKIAkJCWNhc2UgQ1RMVFlQRV9VTE9ORzoKLQkJCQl1bG9uZ3ZhbCA9 IHN0cnRvdWwobmV3dmFsLCAmZW5kcHRyLCAwKTsKLQkJCQlpZiAoZXJybm8gIT0gMCB8fCBl bmRwdHIgPT0gbmV3dmFsIHx8Ci0JCQkJCSplbmRwdHIgIT0gJ1wwJykgewotCQkJCQl3YXJu eCgiaW52YWxpZCB1bnNpZ25lZCBsb25nIGludGVnZXIiCi0JCQkJCSAgICAiICclcyclcyIs IChjaGFyICopbmV3dmFsLCBsaW5lKTsKLQkJCQkJcmV0dXJuICgxKTsKLQkJCQl9CisJCQkJ dWxvbmd2YWwgPSBzdHJ0b3VsKG5ld3ZhbHN0ciwgJmVuZHB0ciwgMCk7CiAJCQkJbmV3dmFs ID0gJnVsb25ndmFsOwogCQkJCW5ld3NpemUgPSBzaXplb2YodWxvbmd2YWwpOwogCQkJCWJy ZWFrOwogCQkJY2FzZSBDVExUWVBFX1NUUklORzoKKwkJCQluZXd2YWwgPSBuZXd2YWxzdHI7 CiAJCQkJYnJlYWs7CiAJCQljYXNlIENUTFRZUEVfUzY0OgotCQkJCWk2NHZhbCA9IHN0cnRv aW1heChuZXd2YWwsICZlbmRwdHIsIDApOwotCQkJCWlmIChlcnJubyAhPSAwIHx8IGVuZHB0 ciA9PSBuZXd2YWwgfHwKLQkJCQkJKmVuZHB0ciAhPSAnXDAnKSB7Ci0JCQkJCXdhcm54KCJp bnZhbGlkIGludDY0X3QgJyVzJyVzIiwKLQkJCQkJICAgIChjaGFyICopbmV3dmFsLCBsaW5l KTsKLQkJCQkJcmV0dXJuICgxKTsKLQkJCQl9CisJCQkJaTY0dmFsID0gc3RydG9pbWF4KG5l d3ZhbHN0ciwgJmVuZHB0ciwgMCk7CiAJCQkJbmV3dmFsID0gJmk2NHZhbDsKIAkJCQluZXdz aXplID0gc2l6ZW9mKGk2NHZhbCk7CiAJCQkJYnJlYWs7CiAJCQljYXNlIENUTFRZUEVfVTY0 OgotCQkJCXU2NHZhbCA9IHN0cnRvdW1heChuZXd2YWwsICZlbmRwdHIsIDApOwotCQkJCWlm IChlcnJubyAhPSAwIHx8IGVuZHB0ciA9PSBuZXd2YWwgfHwKLQkJCQkJKmVuZHB0ciAhPSAn XDAnKSB7Ci0JCQkJCXdhcm54KCJpbnZhbGlkIHVpbnQ2NF90ICclcyclcyIsCi0JCQkJCSAg ICAoY2hhciAqKW5ld3ZhbCwgbGluZSk7Ci0JCQkJCXJldHVybiAoMSk7Ci0JCQkJfQorCQkJ CXU2NHZhbCA9IHN0cnRvdW1heChuZXd2YWxzdHIsICZlbmRwdHIsIDApOwogCQkJCW5ld3Zh bCA9ICZ1NjR2YWw7CiAJCQkJbmV3c2l6ZSA9IHNpemVvZih1NjR2YWwpOwogCQkJCWJyZWFr OwotCQkJY2FzZSBDVExUWVBFX09QQVFVRToKLQkJCQkvKiBGQUxMVEhST1VHSCAqLwogCQkJ ZGVmYXVsdDoKLQkJCQl3YXJueCgib2lkICclcycgaXMgdHlwZSAlZCwiCi0JCQkJCSIgY2Fu bm90IHNldCB0aGF0JXMiLCBidWZwLAotCQkJCQlraW5kICYgQ1RMVFlQRSwgbGluZSk7CisJ CQkJLyogTk9UUkVBQ0hFRCAqLwogCQkJCXJldHVybiAoMSk7CiAJCX0KIAorCQlpZiAoZXJy bm8gIT0gMCB8fCBlbmRwdHIgPT0gbmV3dmFsc3RyIHx8ICplbmRwdHIgIT0gJ1wwJykgewor CQkJd2FybngoImludmFsaWQgJXMgJyVzJyVzIiwgY3RsX3R5cGVuYW1lW2tpbmQgJiBDVExU WVBFXSwKKwkJCSAgICBuZXd2YWxzdHIsIGxpbmUpOworCQkJcmV0dXJuICgxKTsKKwkJfQor CiAJCWkgPSBzaG93X3ZhcihtaWIsIGxlbik7CiAJCWlmIChzeXNjdGwobWliLCBsZW4sIDAs IDAsIG5ld3ZhbCwgbmV3c2l6ZSkgPT0gLTEpIHsKIAkJCWlmICghaSAmJiAhYmZsYWcpCkBA IC02NjUsMzMgKzY2NSwzNSBAQCBTX2Jpb3Nfc21hcF94YXR0cihzaXplX3QgbDIsIHZvaWQg KnApCiAjZW5kaWYKIAogc3RhdGljIGludAotc2V0X0lLKGNvbnN0IGNoYXIgKnN0ciwgaW50 ICp2YWwpCitzdHJJS3RvaShjb25zdCBjaGFyICpzdHIsIGNoYXIgKiplbmRwdHJwKQogewor CWludCBrZWx2OwogCWZsb2F0IHRlbXA7Ci0JaW50IGxlbiwga2VsdjsKKwlzaXplX3QgbGVu OwogCWNvbnN0IGNoYXIgKnA7Ci0JY2hhciAqZW5kcHRyOwogCi0JaWYgKChsZW4gPSBzdHJs ZW4oc3RyKSkgPT0gMCkKLQkJcmV0dXJuICgwKTsKKwlhc3NlcnQoZXJybm8gPT0gMCk7CisK KwlsZW4gPSBzdHJsZW4oc3RyKTsKKwkvKiBjYWxsZXIgYWxyZWFkeSBjaGVja2VkIHRoaXMg Ki8KKwlhc3NlcnQobGVuID4gMCk7CisKIAlwID0gJnN0cltsZW4gLSAxXTsKLQllcnJubyA9 IDA7CiAJaWYgKCpwID09ICdDJyB8fCAqcCA9PSAnRicpIHsKLQkJdGVtcCA9IHN0cnRvZihz dHIsICZlbmRwdHIpOwotCQlpZiAoZXJybm8gIT0gMCB8fCBlbmRwdHIgPT0gc3RyIHx8Ci0J CQllbmRwdHIgIT0gcCkKLQkJCXJldHVybiAoMCk7Ci0JCWlmICgqcCA9PSAnRicpCi0JCQl0 ZW1wID0gKHRlbXAgLSAzMikgKiA1IC8gOTsKLQkJa2VsdiA9IHRlbXAgKiAxMCArIDI3MzI7 CisJCXRlbXAgPSBzdHJ0b2Yoc3RyLCBlbmRwdHJwKTsKKwkJaWYgKCplbmRwdHJwICE9IHN0 ciAmJiAqZW5kcHRycCA9PSBwICYmIGVycm5vICE9IDApIHsKKwkJCWlmICgqcCA9PSAnRicp CisJCQkJdGVtcCA9ICh0ZW1wIC0gMzIpICogNSAvIDk7CisJCQlyZXR1cm4gKHRlbXAgKiAx MCArIDI3MzIpOworCQl9CiAJfSBlbHNlIHsKLQkJa2VsdiA9IChpbnQpc3RydG9sKHN0ciwg JmVuZHB0ciwgMTApOwotCQlpZiAoZXJybm8gIT0gMCB8fCBlbmRwdHIgPT0gc3RyIHx8Ci0J CQkqZW5kcHRyICE9ICdcMCcpCi0JCQlyZXR1cm4gKDApOworCQlrZWx2ID0gKGludClzdHJ0 b2woc3RyLCBlbmRwdHJwLCAxMCk7CisJCWlmICgqZW5kcHRycCAhPSBzdHIgJiYgKmVuZHB0 cnAgPT0gcCAmJiBlcnJubyAhPSAwKQorCQkJcmV0dXJuIChrZWx2KTsKIAl9Ci0JKnZhbCA9 IGtlbHY7Ci0JcmV0dXJuICgxKTsKKworCWVycm5vID0gRVJBTkdFOworCXJldHVybiAoMCk7 CiB9CiAKIC8qCkBAIC03NDYsMjEgKzc0OCw2IEBAIG9pZGZtdChpbnQgKm9pZCwgaW50IGxl biwgY2hhciAqZm10LCB1X2ludCAqa2luZCkKIAlyZXR1cm4gKDApOwogfQogCi1zdGF0aWMg aW50IGN0bF9zaWduW0NUTFRZUEUrMV0gPSB7Ci0JW0NUTFRZUEVfSU5UXSA9IDEsCi0JW0NU TFRZUEVfTE9OR10gPSAxLAotCVtDVExUWVBFX1M2NF0gPSAxLAotfTsKLQotc3RhdGljIGlu dCBjdGxfc2l6ZVtDVExUWVBFKzFdID0gewotCVtDVExUWVBFX0lOVF0gPSBzaXplb2YoaW50 KSwKLQlbQ1RMVFlQRV9VSU5UXSA9IHNpemVvZih1X2ludCksCi0JW0NUTFRZUEVfTE9OR10g PSBzaXplb2YobG9uZyksCi0JW0NUTFRZUEVfVUxPTkddID0gc2l6ZW9mKHVfbG9uZyksCi0J W0NUTFRZUEVfUzY0XSA9IHNpemVvZihpbnQ2NF90KSwKLQlbQ1RMVFlQRV9VNjRdID0gc2l6 ZW9mKGludDY0X3QpLAotfTsKLQogLyoKICAqIFRoaXMgZm9ybWF0cyBhbmQgb3V0cHV0cyB0 aGUgdmFsdWUgb2Ygb25lIHZhcmlhYmxlCiAgKgo= --------------040109080302010904010106 Content-Type: application/octet-stream; name="sysctl.diff.sig" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="sysctl.diff.sig" iQIcBAABCgAGBQJUJLEeAAoJEJW2GBstM+nsug8P/30rxWcBdXjmF5ok0GjEiW4+5qtkEFfN TNAFpaWAR0uXJTPZJ6pidMhXXe0XIsbgCH+ky8B7aGj+bPuPYzAvk2Hv9mHSA6KSYFRYQwd1 LrrGPTUZizQjP1kCvsFvrvU5wDThoyo+jIHz7PCaDG8hwdThUGMfU+2unIkpkQ33v0/UG5yj v2DNJDHe4byBdcw9Qo4HdGaOk+yfUeX+ELDaONNkvsCzPSPqbuCHWBEEyu8DDRBeAZXb6u/S 6b6DDaJH7nKaIa000Oqg0As+YYl57V2WVDt2P3m5EYyF5UgoXcfUvDOt4zNtWZb4CfvY5Eb6 KPcmAomi3dxUehqFrO6OmzumvD4mFhn90CKYyNJMfRBBdOn9H45lXpBCWRhJlXSHacX5Wv9T zPQCAqoxTlJOlTzms4zcJjV+mgiIg3FI2jmk39wgYtFLROOYRX9xYKsu7mychIV3rWnXKNbL 65d7tgViyYhBZR24CaWcxlzgpTOBR9+8J5FyGHVYi6mL13YSpBC1cbiUhZo0mBPR2tLoFLb1 MWnQNRSXAK1cF3a7RbhitutnlmD1Z3wli2yb/uQfu2l5uWpx5aJoNoQqtSGxU0Or/Ox6obvp TtWP+hqpPI8SghOCBRTQaOHVtu5Z40c315v4a4TcIyBqPgMzo3WQU2N5TEgJaoI4OeukFN1m nXhJ --------------040109080302010904010106-- From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 00:59:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1A4987A for ; Fri, 26 Sep 2014 00:59:16 +0000 (UTC) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F426B22 for ; Fri, 26 Sep 2014 00:59:16 +0000 (UTC) Received: by mail-pd0-f181.google.com with SMTP id r10so11836583pdi.40 for ; Thu, 25 Sep 2014 17:59:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=Akf4Sy21e3y5mH0YzrGZGdtd6REgj6dacXfH1NoJI6g=; b=hGDH2/KB49WwXIpun6TyJa9qf6ElVB4nw36VB5/iXj5AHwyV0RAMQT12lYLGg01vpy 7UWWiLIJCtcdHXFLN6k0z46ayo79a+yfZKTQMgGP/x4BP7maWLFalcRaYxb8nxAwQZCU MUedfyovNKwXTSn7aZQHV7haouuMvS+uSK8U4UcDnA3AHcJ5LIWaICvabLNTXzdiZvz8 2L9EcFv5sF/9xC3eCGsNyHVMwDaeGx9xARpx7uW6L8mx9CPMKOqeu2nQC7yM2AmQzW/g WphwrSsHBJP3nZdmrLGzTFcBt+pxew557b6ZdfGe/SE+fgKeGNH9NbRlnX4gttq1chdH m76g== X-Gm-Message-State: ALoCoQnWW9Vyk0MVDicaDYR49dX+ShPN/F20vLkGWPVQiuHlPSw6KJFc09wW4r2mYOTqDU2HTlL9 X-Received: by 10.68.137.98 with SMTP id qh2mr16133009pbb.164.1411693149265; Thu, 25 Sep 2014 17:59:09 -0700 (PDT) Received: from [172.20.12.175] ([69.63.206.125]) by mx.google.com with ESMTPSA id ny7sm3292174pab.38.2014.09.25.17.59.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Sep 2014 17:59:08 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_C1E7CDE3-4270-42BA-98F8-CE5AD0621E41"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r271201 - head/sys/dev/ahci From: Warner Losh In-Reply-To: <5424B0C0.30202@FreeBSD.org> Date: Thu, 25 Sep 2014 17:59:06 -0700 Message-Id: <4A1B4605-B3AE-4B8D-B039-AD1A86B561B8@bsdimp.com> References: <201409061820.s86IKpnw042259@svn.freebsd.org> <5424B0C0.30202@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 00:59:16 -0000 --Apple-Mail=_C1E7CDE3-4270-42BA-98F8-CE5AD0621E41 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hey Bryan, Sorry for the hassle. This didn=92t show up in the hardware I had, but = did show up in Mav=92s hardware. It was like this less than a day, I = thought=85 Warner On Sep 25, 2014, at 5:18 PM, Bryan Drewery wrote: > This drove me crazy for the past few days! >=20 > = https://lists.freebsd.org/pipermail/freebsd-current/2014-September/052215.= html >=20 > Not sure about the first trace there, but the others I encountered = were > due to this not being fixed yet. smh@ tracked the ordering down and = then > we found this. I couldn't try a newer build easily since my system = would > panic on just buildworld :) >=20 > On 9/6/2014 1:20 PM, Warner Losh wrote: >> Author: imp >> Date: Sat Sep 6 18:20:50 2014 >> New Revision: 271201 >> URL: http://svnweb.freebsd.org/changeset/base/271201 >>=20 >> Log: >> Restore order of interrupt setup. Minor problems can result by >> setting up the interrupts too early: >>=20 >> Reviewed by: mav@ >> Sponsored by: Netflix >>=20 >> Modified: >> head/sys/dev/ahci/ahci.c >> head/sys/dev/ahci/ahci_pci.c >>=20 >> Modified: head/sys/dev/ahci/ahci.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/dev/ahci/ahci.c Sat Sep 6 18:08:21 2014 = (r271200) >> +++ head/sys/dev/ahci/ahci.c Sat Sep 6 18:20:50 2014 = (r271201) >> @@ -229,6 +229,15 @@ ahci_attach(device_t dev) >>=20 >> ahci_ctlr_setup(dev); >>=20 >> + /* Setup interrupts. */ >> + if (ahci_setup_interrupt(dev)) { >> + bus_dma_tag_destroy(ctlr->dma_tag); >> + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, >> + ctlr->r_mem); >> + rman_fini(&ctlr->sc_iomem); >> + return ENXIO; >> + } >> + >> i =3D 0; >> for (u =3D ctlr->ichannels; u !=3D 0; u >>=3D 1) >> i +=3D (u & 1); >>=20 >> Modified: head/sys/dev/ahci/ahci_pci.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/dev/ahci/ahci_pci.c Sat Sep 6 18:08:21 2014 = (r271200) >> +++ head/sys/dev/ahci/ahci_pci.c Sat Sep 6 18:20:50 2014 = (r271201) >> @@ -417,13 +417,6 @@ ahci_pci_attach(device_t dev) >> ctlr->numirqs =3D 1; >> } >>=20 >> - if (ahci_setup_interrupt(dev)) { >> - if (ctlr->msi) >> - pci_release_msi(dev); >> - bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, = ctlr->r_mem); >> - return ENXIO; >> - } >> - >> error =3D ahci_attach(dev); >> if (error !=3D 0) >> if (ctlr->msi) >>=20 >=20 >=20 > --=20 > Regards, > Bryan Drewery >=20 --Apple-Mail=_C1E7CDE3-4270-42BA-98F8-CE5AD0621E41 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJUJLpaAAoJEGwc0Sh9sBEA/kQQAObnV59iDniCBt+Fx1T3RSCf /VvDsv56DmgtTNXLCsSoOviP2IfA/3Nww5MYmRi9CoKih8E6bXKfQrWxXoOe3zbt nlwubnXbgSQBgugv+OJFccT9M6KM/BeoPtwMzyg91rjnWF8SgMTn85CV+yH1WSgx PB3VwKDzp3eDr8bFZehmpZgQIoChjefSYjbFBiVcgsr84GoayjqZ5eSrJzMf8buP XijCp/tgolEA4HwqkAzJp8DNiwODbrNS7vxDQzvw3gT+dLV700KVpB7K2G4EVoyQ Nwmdm0OgUjiK0VNzqToH7DbN2IBiU6N8HCebBnTyGd2foXS8ErqcaD8aBnp9G754 oKkz9JWZkJdsIAVC45yS6wnp4houumR5G8913K1+2YAYLqsGsBoNonoCwmGDhft+ ix8CEVN8YECnsALeYenAH7+KU5oee0L7921wme6C0UAH55YtzFzGndG4r9ghJO0R YJATXXiX31NW2Gi5PD+PLzIuefmASootzw8yt63myHpKkggTiBfQTty9t3myZGkG q/7DliBzm9tdEQK75T5CkUvabiooBe5L/oZIHcUYGgUJqpSZTIq3nSA3YXcjpbs0 p7PBJBM1vfLtX5VvvBu7HKHJeDdb6d8Ap4ff2L4O18vPYgiNLPy/D8MUUDX7khI9 AsgLsN7TK+HAjoe+o5Ay =cqkH -----END PGP SIGNATURE----- --Apple-Mail=_C1E7CDE3-4270-42BA-98F8-CE5AD0621E41-- From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 01:01:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD47DB9B for ; Fri, 26 Sep 2014 01:01:52 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C49CC25 for ; Fri, 26 Sep 2014 01:01:52 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q11q9a081943 for ; Fri, 26 Sep 2014 01:01:52 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s8Q11q28081942 for svn-src-all@freebsd.org; Fri, 26 Sep 2014 01:01:52 GMT (envelope-from bdrewery) Received: (qmail 18114 invoked from network); 25 Sep 2014 20:01:46 -0500 Received: from unknown (HELO ?10.10.0.24?) (freebsd@shatow.net@10.10.0.24) by sweb.xzibition.com with ESMTPA; 25 Sep 2014 20:01:46 -0500 Message-ID: <5424BAF0.2000902@FreeBSD.org> Date: Thu, 25 Sep 2014 20:01:36 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Warner Losh Subject: Re: svn commit: r271201 - head/sys/dev/ahci References: <201409061820.s86IKpnw042259@svn.freebsd.org> <5424B0C0.30202@FreeBSD.org> <4A1B4605-B3AE-4B8D-B039-AD1A86B561B8@bsdimp.com> In-Reply-To: <4A1B4605-B3AE-4B8D-B039-AD1A86B561B8@bsdimp.com> OpenPGP: id=6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sexQDWoQKTtDpARPcdoD4bs9tWlXrtmR0" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 01:01:52 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sexQDWoQKTtDpARPcdoD4bs9tWlXrtmR0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 9/25/2014 7:59 PM, Warner Losh wrote: > Hey Bryan, >=20 > Sorry for the hassle. This didn=92t show up in the hardware I had, but = did show up in Mav=92s hardware. It was like this less than a day, I thou= ght=85 >=20 > Warner >=20 Yes only a day or two. I was just unlucky about it. Now I am able to get updated to latest head. >=20 > On Sep 25, 2014, at 5:18 PM, Bryan Drewery wrote= : >=20 >> This drove me crazy for the past few days! >> >> https://lists.freebsd.org/pipermail/freebsd-current/2014-September/052= 215.html >> >> Not sure about the first trace there, but the others I encountered wer= e >> due to this not being fixed yet. smh@ tracked the ordering down and th= en >> we found this. I couldn't try a newer build easily since my system wou= ld >> panic on just buildworld :) >> >> On 9/6/2014 1:20 PM, Warner Losh wrote: >>> Author: imp >>> Date: Sat Sep 6 18:20:50 2014 >>> New Revision: 271201 >>> URL: http://svnweb.freebsd.org/changeset/base/271201 >>> >>> Log: >>> Restore order of interrupt setup. Minor problems can result by >>> setting up the interrupts too early: >>> >>> Reviewed by: mav@ >>> Sponsored by: Netflix >>> >>> Modified: >>> head/sys/dev/ahci/ahci.c >>> head/sys/dev/ahci/ahci_pci.c >>> >>> Modified: head/sys/dev/ahci/ahci.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/dev/ahci/ahci.c Sat Sep 6 18:08:21 2014 (r271200) >>> +++ head/sys/dev/ahci/ahci.c Sat Sep 6 18:20:50 2014 (r271201) >>> @@ -229,6 +229,15 @@ ahci_attach(device_t dev) >>> >>> ahci_ctlr_setup(dev); >>> >>> + /* Setup interrupts. */ >>> + if (ahci_setup_interrupt(dev)) { >>> + bus_dma_tag_destroy(ctlr->dma_tag); >>> + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, >>> + ctlr->r_mem); >>> + rman_fini(&ctlr->sc_iomem); >>> + return ENXIO; >>> + } >>> + >>> i =3D 0; >>> for (u =3D ctlr->ichannels; u !=3D 0; u >>=3D 1) >>> i +=3D (u & 1); >>> >>> Modified: head/sys/dev/ahci/ahci_pci.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/dev/ahci/ahci_pci.c Sat Sep 6 18:08:21 2014 (r271200) >>> +++ head/sys/dev/ahci/ahci_pci.c Sat Sep 6 18:20:50 2014 (r271201) >>> @@ -417,13 +417,6 @@ ahci_pci_attach(device_t dev) >>> ctlr->numirqs =3D 1; >>> } >>> >>> - if (ahci_setup_interrupt(dev)) { >>> - if (ctlr->msi) >>> - pci_release_msi(dev); >>> - bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem= ); >>> - return ENXIO; >>> - } >>> - >>> error =3D ahci_attach(dev); >>> if (error !=3D 0) >>> if (ctlr->msi) >>> >> >> >> --=20 >> Regards, >> Bryan Drewery >> >=20 --=20 Regards, Bryan Drewery --sexQDWoQKTtDpARPcdoD4bs9tWlXrtmR0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJUJLrxAAoJEDXXcbtuRpfP6QkH/0Kg2rJdU4eKDIMVUa45fdRr tx2bHmsB6g3ka+E5L98uMoWxFOiRPSgqifEQYSyxkKn04n2hOarvyRLtmkNInAO6 bepmJAuWSva/K5W0F0wu9RgFqe+KI3284kopKmuG6cVVFS62n8MLy6rShmESe5Gv daVWbyPELbBZ8vfMBXWhOnfXv0ywzDKPZMrHTs+AOKd70KgCVUUVsG487ZGDOYT7 s9lLlcx/lTvg/fcr+KakaWtugvnKmqQV1Mbmmkt+gikQaw6IPXr/cUSQxKXlxCDc aBRocIugYryaDihnAX0YiDwZqljQRopP5mDnpciqtjHCPpZ82pd83O2IA0ERbCs= =32pZ -----END PGP SIGNATURE----- --sexQDWoQKTtDpARPcdoD4bs9tWlXrtmR0-- From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 01:03:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24214CC1; Fri, 26 Sep 2014 01:03:24 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4279AC52; Fri, 26 Sep 2014 01:03:23 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id hi2so84129wib.13 for ; Thu, 25 Sep 2014 18:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=MpvF8PB7DxhFbD7IZ1my7r37Cf5w0mYwDPIeH6JLayY=; b=fA75dnZjdABz5X6Sat/A/My/UTsmmyJTPR5v6Lpx9JhjdpBd5UBebCXm8BcAOnGjLc wtCyVAn82c8TLaW7arTrn+to0Gc0psjRcekfGL+3GqjgWq5y1FVCypfDXDoFVZPbUrgy ZJNkc2dF0gXB/JCGrXMGeFJhkcoewNNtlIfLppp6qLx/Hr5RrRo+qmx4JRGD2ad39IfH Yq1GIloCi2MTtu9ezvY9hffHUB12KWPNxyRxIcaA60atlf1fEO9b1SofeJt/UFhonup0 8g1XvJU8ve/ROqwrbFJ+no+79mfdUezGnChfOxOzaf1ulXQAceVsGpNGySRAite92cwA jetA== X-Received: by 10.194.89.67 with SMTP id bm3mr20652674wjb.80.1411693401439; Thu, 25 Sep 2014 18:03:21 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id ic7sm455466wid.11.2014.09.25.18.03.20 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 25 Sep 2014 18:03:20 -0700 (PDT) Date: Fri, 26 Sep 2014 03:03:18 +0200 From: Mateusz Guzik To: d@delphij.net Subject: Re: svn commit: r272144 - head/sbin/sysctl Message-ID: <20140926010317.GA21954@dft-labs.eu> References: <201409252237.s8PMbScl041679@svn.freebsd.org> <20140925224035.GA6065@dft-labs.eu> <5424B11E.4030909@delphij.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5424B11E.4030909@delphij.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, Xin LI X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 01:03:24 -0000 On Thu, Sep 25, 2014 at 05:19:42PM -0700, Xin Li wrote: > - if (newval == NULL || dflag) { > + if (newvalstr == NULL || dflag) { > if ((kind & CTLTYPE) == CTLTYPE_NODE) { > if (dflag) { > i = show_var(mib, len); > @@ -288,10 +314,22 @@ parse(const char *string, int lineno) > (kind & CTLTYPE) == CTLTYPE_ULONG || > (kind & CTLTYPE) == CTLTYPE_S64 || > (kind & CTLTYPE) == CTLTYPE_U64) { > - if (strlen(newval) == 0) { > + if (strlen(newvalstr) == 0) { > warnx("empty numeric value"); > return (1); > } > + } else if ((kind & CTLTYPE) != CTLTYPE_STRING) { > + /* > + * The only acceptable types are: > + * CTLTYPE_INT, CTLTYPE_UINT, > + * CTLTYPE_LONG, CTLTYPE_ULONG, > + * CTLTYPE_S64, CTLTYPE_U64 and > + * CTLTYPE_STRING. > + */ > + warnx("oid '%s' is type %d," > + " cannot set that%s", bufp, > + kind & CTLTYPE, line); > + return (1); > } I think this should be converted to switch, +/-: switch (kind & CTLTYPE) { case CTLTYPE_INT: case CTLTYPE_UINT: case CTLTYPE_LONG: case CTLTYPE_ULONG: case CTLTYPE_S64: case CTLTYPE_U64: if (strlen(newvalstr) == 0) { warnx("empty numeric value"); return (1); } break; case CTLTYPE_STRING: break; default: warnx("oid '%s' is type %d cannot set that%s", bufp, kind & CTLTYPE, line); return (1); } > > errno = 0; > @@ -298,91 +336,53 @@ parse(const char *string, int lineno) > > switch (kind & CTLTYPE) { > default: > - warnx("oid '%s' is type %d," > - " cannot set that%s", bufp, > - kind & CTLTYPE, line); > + /* NOTREACHED */ > return (1); This one should be removed or should call abort() or something since it should be impossible to get here. > } > > + if (errno != 0 || endptr == newvalstr || *endptr != '\0') { > + warnx("invalid %s '%s'%s", ctl_typename[kind & CTLTYPE], > + newvalstr, line); > + return (1); > + } > + So one thing a big fan of is the fact that some values are still assigned based on possibly bogus result. Some static analysis tool may object. But it's just a note. In general I think it's fine. > i = show_var(mib, len); > if (sysctl(mib, len, 0, 0, newval, newsize) == -1) { > if (!i && !bflag) > @@ -665,33 +665,35 @@ S_bios_smap_xattr(size_t l2, void *p) > #endif > -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 01:08:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE447FD2; Fri, 26 Sep 2014 01:08:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEB93CB0; Fri, 26 Sep 2014 01:08:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q18Z3V014884; Fri, 26 Sep 2014 01:08:35 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q18VCY014866; Fri, 26 Sep 2014 01:08:31 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409260108.s8Q18VCY014866@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 26 Sep 2014 01:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272149 - in stable/10: . contrib/hyperv etc/devd etc/mtree libexec libexec/hyperv share/mk sys/conf sys/dev/hyperv/include sys/dev/hyperv/utilities sys/modules/hyperv/utilities tools/b... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 01:08:36 -0000 Author: gjb Date: Fri Sep 26 01:08:31 2014 New Revision: 272149 URL: http://svnweb.freebsd.org/changeset/base/272149 Log: Revert r272128: Though this passes the buildworld test, this fails during installworld with: make[3]: "/releng/scripts-release/chroots/10/i386/release/etc/devd/Makefile" line 13: Malformed conditional (${MK_HYPERV} != "no") Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Deleted: stable/10/contrib/hyperv/ stable/10/etc/devd/hyperv.conf stable/10/libexec/hyperv/ stable/10/sys/dev/hyperv/utilities/hv_kvp.c stable/10/sys/dev/hyperv/utilities/unicode.h stable/10/tools/build/options/WITHOUT_HYPERV stable/10/tools/build/options/WITH_HYPERV stable/10/usr.sbin/hyperv/ Modified: stable/10/ObsoleteFiles.inc stable/10/etc/devd/Makefile stable/10/etc/mtree/BSD.usr.dist stable/10/etc/mtree/BSD.var.dist stable/10/libexec/Makefile stable/10/share/mk/bsd.own.mk stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/utilities/hv_kvp.h (contents, props changed) stable/10/sys/dev/hyperv/utilities/hv_util.c (contents, props changed) stable/10/sys/modules/hyperv/utilities/Makefile stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.sbin/Makefile.amd64 stable/10/usr.sbin/Makefile.i386 Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Fri Sep 26 00:00:13 2014 (r272148) +++ stable/10/ObsoleteFiles.inc Fri Sep 26 01:08:31 2014 (r272149) @@ -38,8 +38,6 @@ # xargs -n1 | sort | uniq -d; # done -# 20140925: hv_kvpd rc.d script removed in favor of devd configuration -OLD_FILES+=etc/rc.d/hv_kvpd # 20140814: libopie version bump OLD_LIBS+=usr/lib/libopie.so.7 OLD_LIBS+=usr/lib32/libopie.so.7 Modified: stable/10/etc/devd/Makefile ============================================================================== --- stable/10/etc/devd/Makefile Fri Sep 26 00:00:13 2014 (r272148) +++ stable/10/etc/devd/Makefile Fri Sep 26 01:08:31 2014 (r272149) @@ -10,10 +10,6 @@ FILES+= apple.conf FILES+= asus.conf .endif -.if ${MK_HYPERV} != "no" -FILES+= hyperv.conf -.endif - NO_OBJ= FILESDIR= /etc/devd FILESMODE= 644 Modified: stable/10/etc/mtree/BSD.usr.dist ============================================================================== --- stable/10/etc/mtree/BSD.usr.dist Fri Sep 26 00:00:13 2014 (r272148) +++ stable/10/etc/mtree/BSD.usr.dist Fri Sep 26 01:08:31 2014 (r272149) @@ -108,8 +108,6 @@ .. bsdinstall .. - hyperv - .. lpr ru .. Modified: stable/10/etc/mtree/BSD.var.dist ============================================================================== --- stable/10/etc/mtree/BSD.var.dist Fri Sep 26 00:00:13 2014 (r272148) +++ stable/10/etc/mtree/BSD.var.dist Fri Sep 26 01:08:31 2014 (r272149) @@ -42,8 +42,6 @@ .. freebsd-update mode=0700 .. - hyperv mode=0700 - .. ipf mode=0700 .. pkg Modified: stable/10/libexec/Makefile ============================================================================== --- stable/10/libexec/Makefile Fri Sep 26 00:00:13 2014 (r272148) +++ stable/10/libexec/Makefile Fri Sep 26 01:08:31 2014 (r272149) @@ -10,7 +10,6 @@ SUBDIR= ${_atf} \ fingerd \ ftpd \ getty \ - ${_hyperv} \ ${_mail.local} \ ${_mknetid} \ ${_pppoed} \ @@ -43,10 +42,6 @@ _atrun= atrun _comsat= comsat .endif -.if ${MK_HYPERV} != "no" -_hyperv= hyperv -.endif - .if ${MK_NIS} != "no" _mknetid= mknetid _ypxfr= ypxfr Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Fri Sep 26 00:00:13 2014 (r272148) +++ stable/10/share/mk/bsd.own.mk Fri Sep 26 01:08:31 2014 (r272149) @@ -438,12 +438,6 @@ __DEFAULT_YES_OPTIONS+=FDT .else __DEFAULT_NO_OPTIONS+=FDT .endif -# HyperV is only available for x86 and amd64. -.if ${__T} == "amd64" || ${__T} == "i386" -__DEFAULT_YES_OPTIONS+=HYPERV -.else -__DEFAULT_NO_OPTIONS+=HYPERV -.endif .undef __T # Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Fri Sep 26 00:00:13 2014 (r272148) +++ stable/10/sys/conf/files.amd64 Fri Sep 26 01:08:31 2014 (r272149) @@ -234,7 +234,6 @@ dev/hyperv/netvsc/hv_netvsc_drv_freebsd. dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv dev/hyperv/stordisengage/hv_ata_pci_disengage.c optional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv -dev/hyperv/utilities/hv_kvp.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hv_channel.c optional hyperv dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Fri Sep 26 00:00:13 2014 (r272148) +++ stable/10/sys/conf/files.i386 Fri Sep 26 01:08:31 2014 (r272149) @@ -227,7 +227,6 @@ dev/hyperv/netvsc/hv_netvsc_drv_freebsd. dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv dev/hyperv/stordisengage/hv_ata_pci_disengage.c optional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv -dev/hyperv/utilities/hv_kvp.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hv_channel.c optional hyperv dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Fri Sep 26 00:00:13 2014 (r272148) +++ stable/10/sys/dev/hyperv/include/hyperv.h Fri Sep 26 01:08:31 2014 (r272149) @@ -795,34 +795,5 @@ hv_get_phys_addr(void *virt) return (ret); } - -/** - * KVP related structures - * - */ -typedef struct hv_vmbus_service { - hv_guid guid; /* Hyper-V GUID */ - char *name; /* name of service */ - boolean_t enabled; /* service enabled */ - hv_work_queue *work_queue; /* background work queue */ - - /* - * function to initialize service - */ - int (*init)(struct hv_vmbus_service *); - - /* - * function to process Hyper-V messages - */ - void (*callback)(void *); -} hv_vmbus_service; - -extern uint8_t* receive_buffer[]; -extern hv_vmbus_service service_table[]; - -void hv_kvp_callback(void *context); -int hv_kvp_init(hv_vmbus_service *serv); -void hv_kvp_deinit(void); - #endif /* __HYPERV_H__ */ Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.h ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_kvp.h Fri Sep 26 00:00:13 2014 (r272148) +++ stable/10/sys/dev/hyperv/utilities/hv_kvp.h Fri Sep 26 01:08:31 2014 (r272149) @@ -1,5 +1,7 @@ /*- - * Copyright (c) 2014 Microsoft Corp. + * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2012 NetApp Inc. + * Copyright (c) 2012 Citrix Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,15 +24,14 @@ * 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 _KVP_H #define _KVP_H /* - * An implementation of HyperV key value pair (KVP) functionality for FreeBSD + * An implementation of HyperV key value pair (KVP) functionality for FreeBSD * */ @@ -53,15 +54,15 @@ /* * bytes, including any null terminators */ -#define HV_KVP_EXCHANGE_MAX_VALUE_SIZE (2048) +#define HV_KVP_EXCHANGE_MAX_VALUE_SIZE (2048) /* * Maximum key size - the registry limit for the length of an entry name * is 256 characters, including the null terminator */ -#define HV_KVP_EXCHANGE_MAX_KEY_SIZE (512) +#define HV_KVP_EXCHANGE_MAX_KEY_SIZE (512) /* * In FreeBSD, we implement the KVP functionality in two components: @@ -111,20 +112,30 @@ * (not supported), a NULL key string is returned. */ - + /* * Registry value types. */ -#define HV_REG_SZ 1 -#define HV_REG_U32 4 -#define HV_REG_U64 8 +#define HV_REG_SZ 1 +#define HV_REG_U32 4 +#define HV_REG_U64 8 + + +/* + * Daemon code not supporting IP injection (legacy daemon). + */ + +#define HV_KVP_OP_REGISTER 4 /* * Daemon code supporting IP injection. + * The KVP opcode field is used to communicate the + * registration information; so define a namespace that + * will be distinct from the host defined KVP opcode. */ -#define HV_KVP_OP_REGISTER 4 +#define KVP_OP_REGISTER1 100 enum hv_kvp_exchg_op { HV_KVP_OP_GET = 0, @@ -145,41 +156,41 @@ enum hv_kvp_exchg_pool { HV_KVP_POOL_COUNT /* Number of pools, must be last. */ }; - /* * Some Hyper-V status codes. */ -#define HV_KVP_S_OK 0x00000000 -#define HV_KVP_E_FAIL 0x80004005 -#define HV_KVP_S_CONT 0x80070103 -#define HV_ERROR_NOT_SUPPORTED 0x80070032 -#define HV_ERROR_MACHINE_LOCKED 0x800704F7 -#define HV_ERROR_DEVICE_NOT_CONNECTED 0x8007048F -#define HV_INVALIDARG 0x80070057 -#define HV_KVP_GUID_NOTFOUND 0x80041002 - -#define ADDR_FAMILY_NONE 0x00 -#define ADDR_FAMILY_IPV4 0x01 -#define ADDR_FAMILY_IPV6 0x02 - -#define MAX_ADAPTER_ID_SIZE 128 -#define MAX_IP_ADDR_SIZE 1024 -#define MAX_GATEWAY_SIZE 512 +#define HV_KVP_S_OK 0x00000000 +#define HV_KVP_E_FAIL 0x80004005 +#define HV_KVP_S_CONT 0x80070103 +#define HV_ERROR_NOT_SUPPORTED 0x80070032 +#define HV_ERROR_MACHINE_LOCKED 0x800704F7 +#define HV_ERROR_DEVICE_NOT_CONNECTED 0x8007048F +#define HV_INVALIDARG 0x80070057 +#define HV_KVP_GUID_NOTFOUND 0x80041002 + +#define ADDR_FAMILY_NONE 0x00 +#define ADDR_FAMILY_IPV4 0x01 +#define ADDR_FAMILY_IPV6 0x02 + +#define MAX_ADAPTER_ID_SIZE 128 +#define MAX_IP_ADDR_SIZE 1024 +#define MAX_GATEWAY_SIZE 512 struct hv_kvp_ipaddr_value { - uint16_t adapter_id[MAX_ADAPTER_ID_SIZE]; - uint8_t addr_family; - uint8_t dhcp_enabled; - uint16_t ip_addr[MAX_IP_ADDR_SIZE]; - uint16_t sub_net[MAX_IP_ADDR_SIZE]; - uint16_t gate_way[MAX_GATEWAY_SIZE]; - uint16_t dns_addr[MAX_IP_ADDR_SIZE]; -}__attribute__((packed)); + uint16_t adapter_id[MAX_ADAPTER_ID_SIZE]; + uint8_t addr_family; + uint8_t dhcp_enabled; + uint16_t ip_addr[MAX_IP_ADDR_SIZE]; + uint16_t sub_net[MAX_IP_ADDR_SIZE]; + uint16_t gate_way[MAX_GATEWAY_SIZE]; + uint16_t dns_addr[MAX_IP_ADDR_SIZE]; +} __attribute__((packed)); + struct hv_kvp_hdr { - uint8_t operation; - uint8_t pool; + uint8_t operation; + uint8_t pool; uint16_t pad; } __attribute__((packed)); @@ -187,9 +198,9 @@ struct hv_kvp_exchg_msg_value { uint32_t value_type; uint32_t key_size; uint32_t value_size; - uint8_t key[HV_KVP_EXCHANGE_MAX_KEY_SIZE]; + uint8_t key[HV_KVP_EXCHANGE_MAX_KEY_SIZE]; union { - uint8_t value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE]; + uint8_t value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE]; uint32_t value_u32; uint64_t value_u64; } msg_value; @@ -219,16 +230,16 @@ struct hv_kvp_register { struct hv_kvp_msg { union { - struct hv_kvp_hdr kvp_hdr; - uint32_t error; + struct hv_kvp_hdr kvp_hdr; + int error; } hdr; union { - struct hv_kvp_msg_get kvp_get; - struct hv_kvp_msg_set kvp_set; + struct hv_kvp_msg_get kvp_get; + struct hv_kvp_msg_set kvp_set; struct hv_kvp_msg_delete kvp_delete; struct hv_kvp_msg_enumerate kvp_enum_data; - struct hv_kvp_ipaddr_value kvp_ip_val; - struct hv_kvp_register kvp_register; + struct hv_kvp_ipaddr_value kvp_ip_val; + struct hv_kvp_register kvp_register; } body; } __attribute__((packed)); @@ -238,17 +249,38 @@ struct hv_kvp_ip_msg { struct hv_kvp_ipaddr_value kvp_ip_val; } __attribute__((packed)); +#define BSD_SOC_PATH "/etc/hyperv/socket" + +#define HV_SHUT_DOWN 0 +#define HV_TIME_SYNCH 1 +#define HV_HEART_BEAT 2 +#define HV_KVP 3 +#define HV_MAX_UTIL_SERVICES 4 + +#define HV_WLTIMEDELTA 116444736000000000L /* in 100ns unit */ +#define HV_ICTIMESYNCFLAG_PROBE 0 +#define HV_ICTIMESYNCFLAG_SYNC 1 +#define HV_ICTIMESYNCFLAG_SAMPLE 2 +#define HV_NANO_SEC_PER_SEC 1000000000 + +typedef struct hv_vmbus_service { + hv_guid guid; /* Hyper-V GUID */ + char* name; /* name of service */ + boolean_t enabled; /* service enabled */ + hv_work_queue* work_queue; /* background work queue */ + + // + // function to initialize service + // + int (*init)(struct hv_vmbus_service *); + + // + // function to process Hyper-V messages + // + void (*callback)(void *); +} hv_vmbus_service; -#define HV_SHUT_DOWN 0 -#define HV_TIME_SYNCH 1 -#define HV_HEART_BEAT 2 -#define HV_KVP 3 -#define HV_MAX_UTIL_SERVICES 4 - -#define HV_WLTIMEDELTA 116444736000000000L /* in 100ns unit */ -#define HV_ICTIMESYNCFLAG_PROBE 0 -#define HV_ICTIMESYNCFLAG_SYNC 1 -#define HV_ICTIMESYNCFLAG_SAMPLE 2 -#define HV_NANO_SEC_PER_SEC 1000000000 +extern uint8_t* receive_buffer[]; +extern hv_vmbus_service service_table[]; #endif /* _KVP_H */ Modified: stable/10/sys/dev/hyperv/utilities/hv_util.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_util.c Fri Sep 26 00:00:13 2014 (r272148) +++ stable/10/sys/dev/hyperv/utilities/hv_util.c Fri Sep 26 01:08:31 2014 (r272149) @@ -1,5 +1,7 @@ /*- - * Copyright (c) 2014 Microsoft Corp. + * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2012 NetApp Inc. + * Copyright (c) 2012 Citrix Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,11 +24,10 @@ * 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$ + */ */ -/* +/** * A common driver for all hyper-V util services. */ @@ -53,7 +54,7 @@ static void hv_timesync_cb(void *context static int hv_timesync_init(hv_vmbus_service *serv); -/* +/** * Note: GUID codes below are predefined by the host hypervisor * (Hyper-V and Azure)interface and required for correct operation. */ @@ -80,16 +81,7 @@ hv_vmbus_service service_table[] = { 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d}, .name = "Hyper-V Heartbeat Service\n", .enabled = TRUE, - .callback = hv_heartbeat_cb, - }, - - /* KVP (Key Value Pair) Service */ - { .guid.data = {0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, - 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6}, - .name = "Hyper-V KVP Service\n", - .enabled = TRUE, - .init = hv_kvp_init, - .callback = hv_kvp_callback, + .callback = hv_heartbeat_cb, }, }; @@ -99,8 +91,6 @@ hv_vmbus_service service_table[] = { */ uint8_t *receive_buffer[HV_MAX_UTIL_SERVICES]; -static boolean_t destroyed_kvp = FALSE; - struct hv_ictimesync_data { uint64_t parenttime; uint64_t childtime; @@ -154,7 +144,7 @@ hv_negotiate_version( static void hv_set_host_time(void *context) { - time_sync_data* time_msg = (time_sync_data*) context; + time_sync_data *time_msg = context; uint64_t hosttime = time_msg->data; struct timespec guest_ts, host_ts; uint64_t host_tns; @@ -264,12 +254,12 @@ hv_timesync_cb(void *context) static void hv_shutdown_cb(void *context) { - uint8_t* buf; + uint8_t* buf; hv_vmbus_channel* channel = context; - uint8_t execute_shutdown = 0; + uint8_t execute_shutdown = 0; hv_vmbus_icmsg_hdr* icmsghdrp; - uint32_t recv_len; - uint64_t request_id; + uint32_t recv_len; + uint64_t request_id; int ret; hv_vmbus_shutdown_msg_data* shutdown_msg; @@ -432,11 +422,6 @@ hv_util_detach(device_t dev) struct hv_vmbus_service* service; size_t receive_buffer_offset; - if (!destroyed_kvp) { - hv_kvp_deinit(); - destroyed_kvp = TRUE; - } - hv_dev = vmbus_get_devctx(dev); hv_vmbus_channel_close(hv_dev->channel); @@ -448,22 +433,21 @@ hv_util_detach(device_t dev) free(receive_buffer[receive_buffer_offset], M_DEVBUF); receive_buffer[receive_buffer_offset] = NULL; + return (0); } -static void -hv_util_init(void) +static void hv_util_init(void) { } -static int -hv_util_modevent(module_t mod, int event, void *arg) +static int hv_util_modevent(module_t mod, int event, void *arg) { switch (event) { case MOD_LOAD: break; case MOD_UNLOAD: - break; + break; default: break; } Modified: stable/10/sys/modules/hyperv/utilities/Makefile ============================================================================== --- stable/10/sys/modules/hyperv/utilities/Makefile Fri Sep 26 00:00:13 2014 (r272148) +++ stable/10/sys/modules/hyperv/utilities/Makefile Fri Sep 26 01:08:31 2014 (r272149) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../../dev/hyperv/utilities KMOD= hv_utils -SRCS= hv_util.c hv_kvp.c +SRCS= hv_util.c SRCS+= bus_if.h device_if.h CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/include \ Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri Sep 26 00:00:13 2014 (r272148) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri Sep 26 01:08:31 2014 (r272149) @@ -4670,11 +4670,3 @@ OLD_FILES+=usr/bin/svnserve OLD_FILES+=usr/bin/svnsync OLD_FILES+=usr/bin/svnversion .endif - -.if ${MK_HYPERV} == no -OLD_FILES+=etc/devd/hyperv.conf -OLD_FILES+=usr/libexec/hyperv/hv_set_ifconfig -OLD_FILES+=usr/libexec/hyperv/hv_get_dns_info -OLD_FILES+=usr/libexec/hyperv/hv_get_dhcp_info -OLD_FILES+=usr/sbin/hv_kvpd -.endif Modified: stable/10/usr.sbin/Makefile.amd64 ============================================================================== --- stable/10/usr.sbin/Makefile.amd64 Fri Sep 26 00:00:13 2014 (r272148) +++ stable/10/usr.sbin/Makefile.amd64 Fri Sep 26 01:08:31 2014 (r272149) @@ -18,9 +18,6 @@ SUBDIR+= boot0cfg SUBDIR+= btxld .endif SUBDIR+= cpucontrol -.if ${MK_HYPERV} != "no" -SUBDIR+= hyperv -.endif SUBDIR+= kgmon SUBDIR+= lptcontrol SUBDIR+= mount_smbfs Modified: stable/10/usr.sbin/Makefile.i386 ============================================================================== --- stable/10/usr.sbin/Makefile.i386 Fri Sep 26 00:00:13 2014 (r272148) +++ stable/10/usr.sbin/Makefile.i386 Fri Sep 26 01:08:31 2014 (r272149) @@ -9,9 +9,6 @@ SUBDIR+= asf SUBDIR+= btxld .endif SUBDIR+= cpucontrol -.if ${MK_HYPERV} != "no" -SUBDIR+= hyperv -.endif SUBDIR+= kgmon SUBDIR+= kgzip SUBDIR+= lptcontrol From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 01:14:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35D7424D; Fri, 26 Sep 2014 01:14:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0861AD6F; Fri, 26 Sep 2014 01:14:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q1EBtq019160; Fri, 26 Sep 2014 01:14:11 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q1EBKL019159; Fri, 26 Sep 2014 01:14:11 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409260114.s8Q1EBKL019159@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 26 Sep 2014 01:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272150 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 01:14:12 -0000 Author: gjb Date: Fri Sep 26 01:14:11 2014 New Revision: 272150 URL: http://svnweb.freebsd.org/changeset/base/272150 Log: Forced commit to reflect the real 10.1-BETA3 point. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/conf/newvers.sh Modified: stable/10/sys/conf/newvers.sh ============================================================================== From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 02:30:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F29321A6; Fri, 26 Sep 2014 02:30:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9B55896; Fri, 26 Sep 2014 02:30:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q2UoZV056089; Fri, 26 Sep 2014 02:30:50 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q2UmM6056069; Fri, 26 Sep 2014 02:30:48 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409260230.s8Q2UmM6056069@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 26 Sep 2014 02:30:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272151 - in stable/10: . contrib/hyperv etc/devd etc/mtree libexec libexec/hyperv share/mk sys/conf sys/dev/hyperv/include sys/dev/hyperv/utilities sys/modules/hyperv/utilities tools/b... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 02:30:51 -0000 Author: gjb Date: Fri Sep 26 02:30:47 2014 New Revision: 272151 URL: http://svnweb.freebsd.org/changeset/base/272151 Log: Revert r272149, which introduces obscure vestiges from the r272128 reversal. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Added: stable/10/contrib/hyperv/ - copied from r272148, stable/10/contrib/hyperv/ stable/10/etc/devd/hyperv.conf - copied unchanged from r272148, stable/10/etc/devd/hyperv.conf stable/10/libexec/hyperv/ - copied from r272148, stable/10/libexec/hyperv/ stable/10/sys/dev/hyperv/utilities/hv_kvp.c - copied unchanged from r272148, stable/10/sys/dev/hyperv/utilities/hv_kvp.c stable/10/sys/dev/hyperv/utilities/unicode.h - copied unchanged from r272148, stable/10/sys/dev/hyperv/utilities/unicode.h stable/10/tools/build/options/WITHOUT_HYPERV - copied unchanged from r272148, stable/10/tools/build/options/WITHOUT_HYPERV stable/10/tools/build/options/WITH_HYPERV - copied unchanged from r272148, stable/10/tools/build/options/WITH_HYPERV stable/10/usr.sbin/hyperv/ - copied from r272148, stable/10/usr.sbin/hyperv/ Modified: stable/10/ObsoleteFiles.inc stable/10/etc/devd/Makefile stable/10/etc/mtree/BSD.usr.dist stable/10/etc/mtree/BSD.var.dist stable/10/libexec/Makefile stable/10/share/mk/bsd.own.mk stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/utilities/hv_kvp.h (contents, props changed) stable/10/sys/dev/hyperv/utilities/hv_util.c (contents, props changed) stable/10/sys/modules/hyperv/utilities/Makefile stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.sbin/Makefile.amd64 stable/10/usr.sbin/Makefile.i386 Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Fri Sep 26 01:14:11 2014 (r272150) +++ stable/10/ObsoleteFiles.inc Fri Sep 26 02:30:47 2014 (r272151) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20140925: hv_kvpd rc.d script removed in favor of devd configuration +OLD_FILES+=etc/rc.d/hv_kvpd # 20140814: libopie version bump OLD_LIBS+=usr/lib/libopie.so.7 OLD_LIBS+=usr/lib32/libopie.so.7 Modified: stable/10/etc/devd/Makefile ============================================================================== --- stable/10/etc/devd/Makefile Fri Sep 26 01:14:11 2014 (r272150) +++ stable/10/etc/devd/Makefile Fri Sep 26 02:30:47 2014 (r272151) @@ -10,6 +10,10 @@ FILES+= apple.conf FILES+= asus.conf .endif +.if ${MK_HYPERV} != "no" +FILES+= hyperv.conf +.endif + NO_OBJ= FILESDIR= /etc/devd FILESMODE= 644 Copied: stable/10/etc/devd/hyperv.conf (from r272148, stable/10/etc/devd/hyperv.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/etc/devd/hyperv.conf Fri Sep 26 02:30:47 2014 (r272151, copy of r272148, stable/10/etc/devd/hyperv.conf) @@ -0,0 +1,19 @@ +# $FreeBSD$ +# +# Hyper-V specific events + +notify 10 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; + match "type" "CREATE"; + match "cdev" "hv_kvp_dev"; + action "/usr/sbin/hv_kvp_daemon"; +}; + +notify 10 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; + match "type" "DESTROY"; + match "cdev" "hv_kvp_dev"; + action "pkill -x hv_kvp_daemon"; +}; Modified: stable/10/etc/mtree/BSD.usr.dist ============================================================================== --- stable/10/etc/mtree/BSD.usr.dist Fri Sep 26 01:14:11 2014 (r272150) +++ stable/10/etc/mtree/BSD.usr.dist Fri Sep 26 02:30:47 2014 (r272151) @@ -108,6 +108,8 @@ .. bsdinstall .. + hyperv + .. lpr ru .. Modified: stable/10/etc/mtree/BSD.var.dist ============================================================================== --- stable/10/etc/mtree/BSD.var.dist Fri Sep 26 01:14:11 2014 (r272150) +++ stable/10/etc/mtree/BSD.var.dist Fri Sep 26 02:30:47 2014 (r272151) @@ -42,6 +42,8 @@ .. freebsd-update mode=0700 .. + hyperv mode=0700 + .. ipf mode=0700 .. pkg Modified: stable/10/libexec/Makefile ============================================================================== --- stable/10/libexec/Makefile Fri Sep 26 01:14:11 2014 (r272150) +++ stable/10/libexec/Makefile Fri Sep 26 02:30:47 2014 (r272151) @@ -10,6 +10,7 @@ SUBDIR= ${_atf} \ fingerd \ ftpd \ getty \ + ${_hyperv} \ ${_mail.local} \ ${_mknetid} \ ${_pppoed} \ @@ -42,6 +43,10 @@ _atrun= atrun _comsat= comsat .endif +.if ${MK_HYPERV} != "no" +_hyperv= hyperv +.endif + .if ${MK_NIS} != "no" _mknetid= mknetid _ypxfr= ypxfr Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Fri Sep 26 01:14:11 2014 (r272150) +++ stable/10/share/mk/bsd.own.mk Fri Sep 26 02:30:47 2014 (r272151) @@ -438,6 +438,12 @@ __DEFAULT_YES_OPTIONS+=FDT .else __DEFAULT_NO_OPTIONS+=FDT .endif +# HyperV is only available for x86 and amd64. +.if ${__T} == "amd64" || ${__T} == "i386" +__DEFAULT_YES_OPTIONS+=HYPERV +.else +__DEFAULT_NO_OPTIONS+=HYPERV +.endif .undef __T # Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Fri Sep 26 01:14:11 2014 (r272150) +++ stable/10/sys/conf/files.amd64 Fri Sep 26 02:30:47 2014 (r272151) @@ -234,6 +234,7 @@ dev/hyperv/netvsc/hv_netvsc_drv_freebsd. dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv dev/hyperv/stordisengage/hv_ata_pci_disengage.c optional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv +dev/hyperv/utilities/hv_kvp.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hv_channel.c optional hyperv dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Fri Sep 26 01:14:11 2014 (r272150) +++ stable/10/sys/conf/files.i386 Fri Sep 26 02:30:47 2014 (r272151) @@ -227,6 +227,7 @@ dev/hyperv/netvsc/hv_netvsc_drv_freebsd. dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv dev/hyperv/stordisengage/hv_ata_pci_disengage.c optional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv +dev/hyperv/utilities/hv_kvp.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hv_channel.c optional hyperv dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Fri Sep 26 01:14:11 2014 (r272150) +++ stable/10/sys/dev/hyperv/include/hyperv.h Fri Sep 26 02:30:47 2014 (r272151) @@ -795,5 +795,34 @@ hv_get_phys_addr(void *virt) return (ret); } + +/** + * KVP related structures + * + */ +typedef struct hv_vmbus_service { + hv_guid guid; /* Hyper-V GUID */ + char *name; /* name of service */ + boolean_t enabled; /* service enabled */ + hv_work_queue *work_queue; /* background work queue */ + + /* + * function to initialize service + */ + int (*init)(struct hv_vmbus_service *); + + /* + * function to process Hyper-V messages + */ + void (*callback)(void *); +} hv_vmbus_service; + +extern uint8_t* receive_buffer[]; +extern hv_vmbus_service service_table[]; + +void hv_kvp_callback(void *context); +int hv_kvp_init(hv_vmbus_service *serv); +void hv_kvp_deinit(void); + #endif /* __HYPERV_H__ */ Copied: stable/10/sys/dev/hyperv/utilities/hv_kvp.c (from r272148, stable/10/sys/dev/hyperv/utilities/hv_kvp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/hyperv/utilities/hv_kvp.c Fri Sep 26 02:30:47 2014 (r272151, copy of r272148, stable/10/sys/dev/hyperv/utilities/hv_kvp.c) @@ -0,0 +1,1001 @@ +/*- + * Copyright (c) 2014 Microsoft Corp. + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Author: Sainath Varanasi. + * Date: 4/2012 + * Email: bsdic@microsoft.com + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "unicode.h" +#include "hv_kvp.h" + +/* hv_kvp defines */ +#define BUFFERSIZE sizeof(struct hv_kvp_msg) +#define KVP_SUCCESS 0 +#define KVP_ERROR 1 +#define kvp_hdr hdr.kvp_hdr + +/* hv_kvp debug control */ +static int hv_kvp_log = 0; +SYSCTL_INT(_dev, OID_AUTO, hv_kvp_log, CTLFLAG_RW, &hv_kvp_log, 0, + "hv_kvp log"); + +#define hv_kvp_log_error(...) do { \ + if (hv_kvp_log > 0) \ + log(LOG_ERR, "hv_kvp: " __VA_ARGS__); \ +} while (0) + +#define hv_kvp_log_info(...) do { \ + if (hv_kvp_log > 1) \ + log(LOG_INFO, "hv_kvp: " __VA_ARGS__); \ +} while (0) + +/* character device prototypes */ +static d_open_t hv_kvp_dev_open; +static d_close_t hv_kvp_dev_close; +static d_read_t hv_kvp_dev_daemon_read; +static d_write_t hv_kvp_dev_daemon_write; +static d_poll_t hv_kvp_dev_daemon_poll; + +/* hv_kvp prototypes */ +static int hv_kvp_req_in_progress(void); +static void hv_kvp_transaction_init(uint32_t, hv_vmbus_channel *, uint64_t, uint8_t *); +static void hv_kvp_send_msg_to_daemon(void); +static void hv_kvp_process_request(void *context); + +/* hv_kvp character device structure */ +static struct cdevsw hv_kvp_cdevsw = +{ + .d_version = D_VERSION, + .d_open = hv_kvp_dev_open, + .d_close = hv_kvp_dev_close, + .d_read = hv_kvp_dev_daemon_read, + .d_write = hv_kvp_dev_daemon_write, + .d_poll = hv_kvp_dev_daemon_poll, + .d_name = "hv_kvp_dev", +}; +static struct cdev *hv_kvp_dev; +static struct hv_kvp_msg *hv_kvp_dev_buf; +struct proc *daemon_task; + +/* + * Global state to track and synchronize multiple + * KVP transaction requests from the host. + */ +static struct { + + /* Pre-allocated work item for queue */ + hv_work_item work_item; + + /* Unless specified the pending mutex should be + * used to alter the values of the following paramters: + * 1. req_in_progress + * 2. req_timed_out + * 3. pending_reqs. + */ + struct mtx pending_mutex; + + /* To track if transaction is active or not */ + boolean_t req_in_progress; + /* Tracks if daemon did not reply back in time */ + boolean_t req_timed_out; + /* Tracks if daemon is serving a request currently */ + boolean_t daemon_busy; + /* Count of KVP requests from Hyper-V. */ + uint64_t pending_reqs; + + + /* Length of host message */ + uint32_t host_msg_len; + + /* Pointer to channel */ + hv_vmbus_channel *channelp; + + /* Host message id */ + uint64_t host_msg_id; + + /* Current kvp message from the host */ + struct hv_kvp_msg *host_kvp_msg; + + /* Current kvp message for daemon */ + struct hv_kvp_msg daemon_kvp_msg; + + /* Rcv buffer for communicating with the host*/ + uint8_t *rcv_buf; + + /* Device semaphore to control communication */ + struct sema dev_sema; + + /* Indicates if daemon registered with driver */ + boolean_t register_done; + + /* Character device status */ + boolean_t dev_accessed; +} kvp_globals; + +/* global vars */ +MALLOC_DECLARE(M_HV_KVP_DEV_BUF); +MALLOC_DEFINE(M_HV_KVP_DEV_BUF, "hv_kvp_dev buffer", "buffer for hv_kvp_dev module"); + +/* + * hv_kvp low level functions + */ + +/* + * Check if kvp transaction is in progres + */ +static int +hv_kvp_req_in_progress(void) +{ + + return (kvp_globals.req_in_progress); +} + + +/* + * This routine is called whenever a message is received from the host + */ +static void +hv_kvp_transaction_init(uint32_t rcv_len, hv_vmbus_channel *rcv_channel, + uint64_t request_id, uint8_t *rcv_buf) +{ + + /* Store all the relevant message details in the global structure */ + /* Do not need to use mutex for req_in_progress here */ + kvp_globals.req_in_progress = true; + kvp_globals.host_msg_len = rcv_len; + kvp_globals.channelp = rcv_channel; + kvp_globals.host_msg_id = request_id; + kvp_globals.rcv_buf = rcv_buf; + kvp_globals.host_kvp_msg = (struct hv_kvp_msg *)&rcv_buf[ + sizeof(struct hv_vmbus_pipe_hdr) + + sizeof(struct hv_vmbus_icmsg_hdr)]; +} + + +/* + * hv_kvp - version neogtiation function + */ +static void +hv_kvp_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, + struct hv_vmbus_icmsg_negotiate *negop, + uint8_t *buf) +{ + int icframe_vercnt; + int icmsg_vercnt; + + icmsghdrp->icmsgsize = 0x10; + + negop = (struct hv_vmbus_icmsg_negotiate *)&buf[ + sizeof(struct hv_vmbus_pipe_hdr) + + sizeof(struct hv_vmbus_icmsg_hdr)]; + icframe_vercnt = negop->icframe_vercnt; + icmsg_vercnt = negop->icmsg_vercnt; + + /* + * Select the framework version number we will support + */ + if ((icframe_vercnt >= 2) && (negop->icversion_data[1].major == 3)) { + icframe_vercnt = 3; + if (icmsg_vercnt >= 2) + icmsg_vercnt = 4; + else + icmsg_vercnt = 3; + } else { + icframe_vercnt = 1; + icmsg_vercnt = 1; + } + + negop->icframe_vercnt = 1; + negop->icmsg_vercnt = 1; + negop->icversion_data[0].major = icframe_vercnt; + negop->icversion_data[0].minor = 0; + negop->icversion_data[1].major = icmsg_vercnt; + negop->icversion_data[1].minor = 0; +} + + +/* + * Convert ip related info in umsg from utf8 to utf16 and store in hmsg + */ +static int +hv_kvp_convert_utf8_ipinfo_to_utf16(struct hv_kvp_msg *umsg, + struct hv_kvp_ip_msg *host_ip_msg) +{ + int err_ip, err_subnet, err_gway, err_dns, err_adap; + int UNUSED_FLAG = 1; + + utf8_to_utf16((uint16_t *)host_ip_msg->kvp_ip_val.ip_addr, + MAX_IP_ADDR_SIZE, + (char *)umsg->body.kvp_ip_val.ip_addr, + strlen((char *)umsg->body.kvp_ip_val.ip_addr), + UNUSED_FLAG, + &err_ip); + utf8_to_utf16((uint16_t *)host_ip_msg->kvp_ip_val.sub_net, + MAX_IP_ADDR_SIZE, + (char *)umsg->body.kvp_ip_val.sub_net, + strlen((char *)umsg->body.kvp_ip_val.sub_net), + UNUSED_FLAG, + &err_subnet); + utf8_to_utf16((uint16_t *)host_ip_msg->kvp_ip_val.gate_way, + MAX_GATEWAY_SIZE, + (char *)umsg->body.kvp_ip_val.gate_way, + strlen((char *)umsg->body.kvp_ip_val.gate_way), + UNUSED_FLAG, + &err_gway); + utf8_to_utf16((uint16_t *)host_ip_msg->kvp_ip_val.dns_addr, + MAX_IP_ADDR_SIZE, + (char *)umsg->body.kvp_ip_val.dns_addr, + strlen((char *)umsg->body.kvp_ip_val.dns_addr), + UNUSED_FLAG, + &err_dns); + utf8_to_utf16((uint16_t *)host_ip_msg->kvp_ip_val.adapter_id, + MAX_IP_ADDR_SIZE, + (char *)umsg->body.kvp_ip_val.adapter_id, + strlen((char *)umsg->body.kvp_ip_val.adapter_id), + UNUSED_FLAG, + &err_adap); + + host_ip_msg->kvp_ip_val.dhcp_enabled = umsg->body.kvp_ip_val.dhcp_enabled; + host_ip_msg->kvp_ip_val.addr_family = umsg->body.kvp_ip_val.addr_family; + + return (err_ip | err_subnet | err_gway | err_dns | err_adap); +} + + +/* + * Convert ip related info in hmsg from utf16 to utf8 and store in umsg + */ +static int +hv_kvp_convert_utf16_ipinfo_to_utf8(struct hv_kvp_ip_msg *host_ip_msg, + struct hv_kvp_msg *umsg) +{ + int err_ip, err_subnet, err_gway, err_dns, err_adap; + int UNUSED_FLAG = 1; + int guid_index; + struct hv_device *hv_dev; /* GUID Data Structure */ + hn_softc_t *sc; /* hn softc structure */ + char if_name[4]; + unsigned char guid_instance[40]; + char *guid_data = NULL; + char buf[39]; + + struct guid_extract { + char a1[2]; + char a2[2]; + char a3[2]; + char a4[2]; + char b1[2]; + char b2[2]; + char c1[2]; + char c2[2]; + char d[4]; + char e[12]; + }; + + struct guid_extract *id; + device_t *devs; + int devcnt; + + /* IP Address */ + utf16_to_utf8((char *)umsg->body.kvp_ip_val.ip_addr, + MAX_IP_ADDR_SIZE, + (uint16_t *)host_ip_msg->kvp_ip_val.ip_addr, + MAX_IP_ADDR_SIZE, + UNUSED_FLAG, + &err_ip); + + /* Adapter ID : GUID */ + utf16_to_utf8((char *)umsg->body.kvp_ip_val.adapter_id, + MAX_ADAPTER_ID_SIZE, + (uint16_t *)host_ip_msg->kvp_ip_val.adapter_id, + MAX_ADAPTER_ID_SIZE, + UNUSED_FLAG, + &err_adap); + + if (devclass_get_devices(devclass_find("hn"), &devs, &devcnt) == 0) { + for (devcnt = devcnt - 1; devcnt >= 0; devcnt--) { + sc = device_get_softc(devs[devcnt]); + + /* Trying to find GUID of Network Device */ + hv_dev = sc->hn_dev_obj; + + for (guid_index = 0; guid_index < 16; guid_index++) { + sprintf(&guid_instance[guid_index * 2], "%02x", + hv_dev->device_id.data[guid_index]); + } + + guid_data = (char *)guid_instance; + id = (struct guid_extract *)guid_data; + snprintf(buf, sizeof(buf), "{%.2s%.2s%.2s%.2s-%.2s%.2s-%.2s%.2s-%.4s-%s}", + id->a4, id->a3, id->a2, id->a1, + id->b2, id->b1, id->c2, id->c1, id->d, id->e); + guid_data = NULL; + sprintf(if_name, "%s%d", "hn", device_get_unit(devs[devcnt])); + + if (strncmp(buf, (char *)umsg->body.kvp_ip_val.adapter_id, 39) == 0) { + strcpy((char *)umsg->body.kvp_ip_val.adapter_id, if_name); + break; + } + } + free(devs, M_TEMP); + } + + /* Address Family , DHCP , SUBNET, Gateway, DNS */ + umsg->kvp_hdr.operation = host_ip_msg->operation; + umsg->body.kvp_ip_val.addr_family = host_ip_msg->kvp_ip_val.addr_family; + umsg->body.kvp_ip_val.dhcp_enabled = host_ip_msg->kvp_ip_val.dhcp_enabled; + utf16_to_utf8((char *)umsg->body.kvp_ip_val.sub_net, MAX_IP_ADDR_SIZE, + (uint16_t *)host_ip_msg->kvp_ip_val.sub_net, + MAX_IP_ADDR_SIZE, + UNUSED_FLAG, + &err_subnet); + + utf16_to_utf8((char *)umsg->body.kvp_ip_val.gate_way, MAX_GATEWAY_SIZE, + (uint16_t *)host_ip_msg->kvp_ip_val.gate_way, + MAX_GATEWAY_SIZE, + UNUSED_FLAG, + &err_gway); + + utf16_to_utf8((char *)umsg->body.kvp_ip_val.dns_addr, MAX_IP_ADDR_SIZE, + (uint16_t *)host_ip_msg->kvp_ip_val.dns_addr, + MAX_IP_ADDR_SIZE, + UNUSED_FLAG, + &err_dns); + + return (err_ip | err_subnet | err_gway | err_dns | err_adap); +} + + +/* + * Prepare a user kvp msg based on host kvp msg (utf16 to utf8) + * Ensure utf16_utf8 takes care of the additional string terminating char!! + */ +static void +hv_kvp_convert_hostmsg_to_usermsg(void) +{ + int utf_err = 0; + uint32_t value_type; + struct hv_kvp_ip_msg *host_ip_msg = (struct hv_kvp_ip_msg *) + kvp_globals.host_kvp_msg; + + struct hv_kvp_msg *hmsg = kvp_globals.host_kvp_msg; + struct hv_kvp_msg *umsg = &kvp_globals.daemon_kvp_msg; + + memset(umsg, 0, sizeof(struct hv_kvp_msg)); + + umsg->kvp_hdr.operation = hmsg->kvp_hdr.operation; + umsg->kvp_hdr.pool = hmsg->kvp_hdr.pool; + + switch (umsg->kvp_hdr.operation) { + case HV_KVP_OP_SET_IP_INFO: + hv_kvp_convert_utf16_ipinfo_to_utf8(host_ip_msg, umsg); + break; + + case HV_KVP_OP_GET_IP_INFO: + utf16_to_utf8((char *)umsg->body.kvp_ip_val.adapter_id, + MAX_ADAPTER_ID_SIZE, + (uint16_t *)host_ip_msg->kvp_ip_val.adapter_id, + MAX_ADAPTER_ID_SIZE, 1, &utf_err); + + umsg->body.kvp_ip_val.addr_family = + host_ip_msg->kvp_ip_val.addr_family; + break; + + case HV_KVP_OP_SET: + value_type = hmsg->body.kvp_set.data.value_type; + + switch (value_type) { + case HV_REG_SZ: + umsg->body.kvp_set.data.value_size = + utf16_to_utf8( + (char *)umsg->body.kvp_set.data.msg_value.value, + HV_KVP_EXCHANGE_MAX_VALUE_SIZE - 1, + (uint16_t *)hmsg->body.kvp_set.data.msg_value.value, + hmsg->body.kvp_set.data.value_size, + 1, &utf_err); + /* utf8 encoding */ + umsg->body.kvp_set.data.value_size = + umsg->body.kvp_set.data.value_size / 2; + break; + + case HV_REG_U32: + umsg->body.kvp_set.data.value_size = + sprintf(umsg->body.kvp_set.data.msg_value.value, "%d", + hmsg->body.kvp_set.data.msg_value.value_u32) + 1; + break; + + case HV_REG_U64: + umsg->body.kvp_set.data.value_size = + sprintf(umsg->body.kvp_set.data.msg_value.value, "%llu", + (unsigned long long) + hmsg->body.kvp_set.data.msg_value.value_u64) + 1; + break; + } + + umsg->body.kvp_set.data.key_size = + utf16_to_utf8( + umsg->body.kvp_set.data.key, + HV_KVP_EXCHANGE_MAX_KEY_SIZE - 1, + (uint16_t *)hmsg->body.kvp_set.data.key, + hmsg->body.kvp_set.data.key_size, + 1, &utf_err); + + /* utf8 encoding */ + umsg->body.kvp_set.data.key_size = + umsg->body.kvp_set.data.key_size / 2; + break; + + case HV_KVP_OP_GET: + umsg->body.kvp_get.data.key_size = + utf16_to_utf8(umsg->body.kvp_get.data.key, + HV_KVP_EXCHANGE_MAX_KEY_SIZE - 1, + (uint16_t *)hmsg->body.kvp_get.data.key, + hmsg->body.kvp_get.data.key_size, + 1, &utf_err); + /* utf8 encoding */ + umsg->body.kvp_get.data.key_size = + umsg->body.kvp_get.data.key_size / 2; + break; + + case HV_KVP_OP_DELETE: + umsg->body.kvp_delete.key_size = + utf16_to_utf8(umsg->body.kvp_delete.key, + HV_KVP_EXCHANGE_MAX_KEY_SIZE - 1, + (uint16_t *)hmsg->body.kvp_delete.key, + hmsg->body.kvp_delete.key_size, + 1, &utf_err); + /* utf8 encoding */ + umsg->body.kvp_delete.key_size = + umsg->body.kvp_delete.key_size / 2; + break; + + case HV_KVP_OP_ENUMERATE: + umsg->body.kvp_enum_data.index = + hmsg->body.kvp_enum_data.index; + break; + + default: + hv_kvp_log_info("%s: daemon_kvp_msg: Invalid operation : %d\n", + __func__, umsg->kvp_hdr.operation); + } +} + + +/* + * Prepare a host kvp msg based on user kvp msg (utf8 to utf16) + */ +static int +hv_kvp_convert_usermsg_to_hostmsg(void) +{ + int hkey_len = 0, hvalue_len = 0, utf_err = 0; + struct hv_kvp_exchg_msg_value *host_exchg_data; + char *key_name, *value; + + struct hv_kvp_msg *umsg = &kvp_globals.daemon_kvp_msg; + struct hv_kvp_msg *hmsg = kvp_globals.host_kvp_msg; + struct hv_kvp_ip_msg *host_ip_msg = (struct hv_kvp_ip_msg *)hmsg; + + switch (hmsg->kvp_hdr.operation) { + case HV_KVP_OP_GET_IP_INFO: + return (hv_kvp_convert_utf8_ipinfo_to_utf16(umsg, host_ip_msg)); + + case HV_KVP_OP_SET_IP_INFO: + case HV_KVP_OP_SET: + case HV_KVP_OP_DELETE: + return (KVP_SUCCESS); + + case HV_KVP_OP_ENUMERATE: + host_exchg_data = &hmsg->body.kvp_enum_data.data; + key_name = umsg->body.kvp_enum_data.data.key; + hkey_len = utf8_to_utf16((uint16_t *)host_exchg_data->key, + ((HV_KVP_EXCHANGE_MAX_KEY_SIZE / 2) - 2), + key_name, strlen(key_name), + 1, &utf_err); + /* utf16 encoding */ + host_exchg_data->key_size = 2 * (hkey_len + 1); + value = umsg->body.kvp_enum_data.data.msg_value.value; + hvalue_len = utf8_to_utf16( + (uint16_t *)host_exchg_data->msg_value.value, + ((HV_KVP_EXCHANGE_MAX_VALUE_SIZE / 2) - 2), + value, strlen(value), + 1, &utf_err); + host_exchg_data->value_size = 2 * (hvalue_len + 1); + host_exchg_data->value_type = HV_REG_SZ; + + if ((hkey_len < 0) || (hvalue_len < 0)) + return (HV_KVP_E_FAIL); + + return (KVP_SUCCESS); + + case HV_KVP_OP_GET: + host_exchg_data = &hmsg->body.kvp_get.data; + value = umsg->body.kvp_get.data.msg_value.value; + hvalue_len = utf8_to_utf16( + (uint16_t *)host_exchg_data->msg_value.value, + ((HV_KVP_EXCHANGE_MAX_VALUE_SIZE / 2) - 2), + value, strlen(value), + 1, &utf_err); + /* Convert value size to uft16 */ + host_exchg_data->value_size = 2 * (hvalue_len + 1); + /* Use values by string */ + host_exchg_data->value_type = HV_REG_SZ; + + if ((hkey_len < 0) || (hvalue_len < 0)) + return (HV_KVP_E_FAIL); + + return (KVP_SUCCESS); + + default: + return (HV_KVP_E_FAIL); + } +} + + +/* + * Send the response back to the host. + */ +static void +hv_kvp_respond_host(int error) +{ + struct hv_vmbus_icmsg_hdr *hv_icmsg_hdrp; + + hv_icmsg_hdrp = (struct hv_vmbus_icmsg_hdr *) + &kvp_globals.rcv_buf[sizeof(struct hv_vmbus_pipe_hdr)]; + + if (error) + error = HV_KVP_E_FAIL; + + hv_icmsg_hdrp->status = error; + hv_icmsg_hdrp->icflags = HV_ICMSGHDRFLAG_TRANSACTION | HV_ICMSGHDRFLAG_RESPONSE; + + error = hv_vmbus_channel_send_packet(kvp_globals.channelp, + kvp_globals.rcv_buf, + kvp_globals.host_msg_len, kvp_globals.host_msg_id, + HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, 0); + + if (error) + hv_kvp_log_info("%s: hv_kvp_respond_host: sendpacket error:%d\n", + __func__, error); +} + + +/* + * This is the main kvp kernel process that interacts with both user daemon + * and the host + */ +static void +hv_kvp_send_msg_to_daemon(void) +{ + /* Prepare kvp_msg to be sent to user */ + hv_kvp_convert_hostmsg_to_usermsg(); + + /* Send the msg to user via function deamon_read - setting sema */ + sema_post(&kvp_globals.dev_sema); +} + + +/* + * Function to read the kvp request buffer from host + * and interact with daemon + */ +static void +hv_kvp_process_request(void *context) +{ + uint8_t *kvp_buf; + hv_vmbus_channel *channel = context; + uint32_t recvlen = 0; + uint64_t requestid; + struct hv_vmbus_icmsg_hdr *icmsghdrp; + int ret = 0; + uint64_t pending_cnt = 1; + + hv_kvp_log_info("%s: entering hv_kvp_process_request\n", __func__); + kvp_buf = receive_buffer[HV_KVP]; + ret = hv_vmbus_channel_recv_packet(channel, kvp_buf, 2 * PAGE_SIZE, + &recvlen, &requestid); + + /* + * We start counting only after the daemon registers + * and therefore there could be requests pending in + * the VMBus that are not reflected in pending_cnt. + * Therefore we continue reading as long as either of + * the below conditions is true. + */ + + while ((pending_cnt>0) || ((ret == 0) && (recvlen > 0))) { + + if ((ret == 0) && (recvlen>0)) { + + icmsghdrp = (struct hv_vmbus_icmsg_hdr *) + &kvp_buf[sizeof(struct hv_vmbus_pipe_hdr)]; + + hv_kvp_transaction_init(recvlen, channel, requestid, kvp_buf); + if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { + hv_kvp_negotiate_version(icmsghdrp, NULL, kvp_buf); + hv_kvp_respond_host(ret); + + /* + * It is ok to not acquire the mutex before setting + * req_in_progress here because negotiation is the + * first thing that happens and hence there is no + * chance of a race condition. + */ + + kvp_globals.req_in_progress = false; + hv_kvp_log_info("%s :version negotiated\n", __func__); + + } else { + if (!kvp_globals.daemon_busy) { + + hv_kvp_log_info("%s: issuing qury to daemon\n", __func__); + mtx_lock(&kvp_globals.pending_mutex); + kvp_globals.req_timed_out = false; + kvp_globals.daemon_busy = true; + mtx_unlock(&kvp_globals.pending_mutex); + + hv_kvp_send_msg_to_daemon(); + hv_kvp_log_info("%s: waiting for daemon\n", __func__); + } + + /* Wait 5 seconds for daemon to respond back */ + tsleep(&kvp_globals, 0, "kvpworkitem", 5 * hz); + hv_kvp_log_info("%s: came out of wait\n", __func__); + } + } + + mtx_lock(&kvp_globals.pending_mutex); + + /* Notice that once req_timed_out is set to true + * it will remain true until the next request is + * sent to the daemon. The response from daemon + * is forwarded to host only when this flag is + * false. + */ + kvp_globals.req_timed_out = true; + + /* + * Cancel request if so need be. + */ + if (hv_kvp_req_in_progress()) { + hv_kvp_log_info("%s: request was still active after wait so failing\n", __func__); + hv_kvp_respond_host(HV_KVP_E_FAIL); + kvp_globals.req_in_progress = false; + } + + /* + * Decrement pending request count and + */ + if (kvp_globals.pending_reqs>0) { + kvp_globals.pending_reqs = kvp_globals.pending_reqs - 1; + } + pending_cnt = kvp_globals.pending_reqs; + + mtx_unlock(&kvp_globals.pending_mutex); + + /* + * Try reading next buffer + */ + recvlen = 0; + ret = hv_vmbus_channel_recv_packet(channel, kvp_buf, 2 * PAGE_SIZE, + &recvlen, &requestid); + hv_kvp_log_info("%s: read: context %p, pending_cnt %ju ret =%d, recvlen=%d\n", + __func__, context, pending_cnt, ret, recvlen); + } +} + + +/* + * Callback routine that gets called whenever there is a message from host + */ +void +hv_kvp_callback(void *context) +{ + uint64_t pending_cnt = 0; + + if (kvp_globals.register_done == false) { + + kvp_globals.channelp = context; + } else { + + mtx_lock(&kvp_globals.pending_mutex); + kvp_globals.pending_reqs = kvp_globals.pending_reqs + 1; + pending_cnt = kvp_globals.pending_reqs; + mtx_unlock(&kvp_globals.pending_mutex); + if (pending_cnt == 1) { + hv_kvp_log_info("%s: Queuing work item\n", __func__); + hv_queue_work_item( + service_table[HV_KVP].work_queue, + hv_kvp_process_request, + context + ); + } + } +} + + +/* + * This function is called by the hv_kvp_init - + * creates character device hv_kvp_dev + * allocates memory to hv_kvp_dev_buf + * + */ +static int +hv_kvp_dev_init(void) +{ + int error = 0; + + /* initialize semaphore */ + sema_init(&kvp_globals.dev_sema, 0, "hv_kvp device semaphore"); + /* create character device */ + error = make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, + &hv_kvp_dev, + &hv_kvp_cdevsw, + 0, + UID_ROOT, + GID_WHEEL, + 0640, + "hv_kvp_dev"); + + if (error != 0) + return (error); + + /* + * Malloc with M_WAITOK flag will never fail. + */ + hv_kvp_dev_buf = malloc(sizeof(*hv_kvp_dev_buf), M_HV_KVP_DEV_BUF, M_WAITOK | + M_ZERO); + + return (0); +} + + +/* + * This function is called by the hv_kvp_deinit - + * destroy character device + */ +static void +hv_kvp_dev_destroy(void) +{ + + if (daemon_task != NULL) { + PROC_LOCK(daemon_task); + kern_psignal(daemon_task, SIGKILL); + PROC_UNLOCK(daemon_task); + } + + destroy_dev(hv_kvp_dev); + free(hv_kvp_dev_buf, M_HV_KVP_DEV_BUF); + return; +} + + +static int +hv_kvp_dev_open(struct cdev *dev, int oflags, int devtype, + struct thread *td) +{ + + hv_kvp_log_info("%s: Opened device \"hv_kvp_device\" successfully.\n", __func__); + if (kvp_globals.dev_accessed) + return (-EBUSY); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 03:04:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F29BBC81; Fri, 26 Sep 2014 03:04:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA5E5CA4; Fri, 26 Sep 2014 03:04:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q342Ff072370; Fri, 26 Sep 2014 03:04:02 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q33wG3072331; Fri, 26 Sep 2014 03:03:58 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409260303.s8Q33wG3072331@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 26 Sep 2014 03:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272152 - in stable/10: . contrib/hyperv etc/devd etc/mtree libexec libexec/hyperv share/mk sys/conf sys/dev/hyperv/include sys/dev/hyperv/utilities sys/modules/hyperv/utilities tools/b... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 03:04:03 -0000 Author: gjb Date: Fri Sep 26 03:03:58 2014 New Revision: 272152 URL: http://svnweb.freebsd.org/changeset/base/272152 Log: Properly revert r272128. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Deleted: stable/10/contrib/hyperv/ stable/10/etc/devd/hyperv.conf stable/10/libexec/hyperv/ stable/10/sys/dev/hyperv/utilities/hv_kvp.c stable/10/sys/dev/hyperv/utilities/unicode.h stable/10/tools/build/options/WITHOUT_HYPERV stable/10/tools/build/options/WITH_HYPERV stable/10/usr.sbin/hyperv/ Modified: stable/10/ObsoleteFiles.inc stable/10/etc/devd/Makefile stable/10/etc/mtree/BSD.usr.dist stable/10/etc/mtree/BSD.var.dist stable/10/libexec/Makefile stable/10/share/mk/bsd.own.mk stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/utilities/hv_kvp.h (contents, props changed) stable/10/sys/dev/hyperv/utilities/hv_util.c (contents, props changed) stable/10/sys/modules/hyperv/utilities/Makefile stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.sbin/Makefile.amd64 stable/10/usr.sbin/Makefile.i386 Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Fri Sep 26 02:30:47 2014 (r272151) +++ stable/10/ObsoleteFiles.inc Fri Sep 26 03:03:58 2014 (r272152) @@ -38,8 +38,6 @@ # xargs -n1 | sort | uniq -d; # done -# 20140925: hv_kvpd rc.d script removed in favor of devd configuration -OLD_FILES+=etc/rc.d/hv_kvpd # 20140814: libopie version bump OLD_LIBS+=usr/lib/libopie.so.7 OLD_LIBS+=usr/lib32/libopie.so.7 Modified: stable/10/etc/devd/Makefile ============================================================================== --- stable/10/etc/devd/Makefile Fri Sep 26 02:30:47 2014 (r272151) +++ stable/10/etc/devd/Makefile Fri Sep 26 03:03:58 2014 (r272152) @@ -10,10 +10,6 @@ FILES+= apple.conf FILES+= asus.conf .endif -.if ${MK_HYPERV} != "no" -FILES+= hyperv.conf -.endif - NO_OBJ= FILESDIR= /etc/devd FILESMODE= 644 Modified: stable/10/etc/mtree/BSD.usr.dist ============================================================================== --- stable/10/etc/mtree/BSD.usr.dist Fri Sep 26 02:30:47 2014 (r272151) +++ stable/10/etc/mtree/BSD.usr.dist Fri Sep 26 03:03:58 2014 (r272152) @@ -108,8 +108,6 @@ .. bsdinstall .. - hyperv - .. lpr ru .. Modified: stable/10/etc/mtree/BSD.var.dist ============================================================================== --- stable/10/etc/mtree/BSD.var.dist Fri Sep 26 02:30:47 2014 (r272151) +++ stable/10/etc/mtree/BSD.var.dist Fri Sep 26 03:03:58 2014 (r272152) @@ -42,8 +42,6 @@ .. freebsd-update mode=0700 .. - hyperv mode=0700 - .. ipf mode=0700 .. pkg Modified: stable/10/libexec/Makefile ============================================================================== --- stable/10/libexec/Makefile Fri Sep 26 02:30:47 2014 (r272151) +++ stable/10/libexec/Makefile Fri Sep 26 03:03:58 2014 (r272152) @@ -10,7 +10,6 @@ SUBDIR= ${_atf} \ fingerd \ ftpd \ getty \ - ${_hyperv} \ ${_mail.local} \ ${_mknetid} \ ${_pppoed} \ @@ -43,10 +42,6 @@ _atrun= atrun _comsat= comsat .endif -.if ${MK_HYPERV} != "no" -_hyperv= hyperv -.endif - .if ${MK_NIS} != "no" _mknetid= mknetid _ypxfr= ypxfr Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Fri Sep 26 02:30:47 2014 (r272151) +++ stable/10/share/mk/bsd.own.mk Fri Sep 26 03:03:58 2014 (r272152) @@ -438,12 +438,6 @@ __DEFAULT_YES_OPTIONS+=FDT .else __DEFAULT_NO_OPTIONS+=FDT .endif -# HyperV is only available for x86 and amd64. -.if ${__T} == "amd64" || ${__T} == "i386" -__DEFAULT_YES_OPTIONS+=HYPERV -.else -__DEFAULT_NO_OPTIONS+=HYPERV -.endif .undef __T # Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Fri Sep 26 02:30:47 2014 (r272151) +++ stable/10/sys/conf/files.amd64 Fri Sep 26 03:03:58 2014 (r272152) @@ -234,7 +234,6 @@ dev/hyperv/netvsc/hv_netvsc_drv_freebsd. dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv dev/hyperv/stordisengage/hv_ata_pci_disengage.c optional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv -dev/hyperv/utilities/hv_kvp.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hv_channel.c optional hyperv dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Fri Sep 26 02:30:47 2014 (r272151) +++ stable/10/sys/conf/files.i386 Fri Sep 26 03:03:58 2014 (r272152) @@ -227,7 +227,6 @@ dev/hyperv/netvsc/hv_netvsc_drv_freebsd. dev/hyperv/netvsc/hv_rndis_filter.c optional hyperv dev/hyperv/stordisengage/hv_ata_pci_disengage.c optional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c optional hyperv -dev/hyperv/utilities/hv_kvp.c optional hyperv dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hv_channel.c optional hyperv dev/hyperv/vmbus/hv_channel_mgmt.c optional hyperv Modified: stable/10/sys/dev/hyperv/include/hyperv.h ============================================================================== --- stable/10/sys/dev/hyperv/include/hyperv.h Fri Sep 26 02:30:47 2014 (r272151) +++ stable/10/sys/dev/hyperv/include/hyperv.h Fri Sep 26 03:03:58 2014 (r272152) @@ -795,34 +795,5 @@ hv_get_phys_addr(void *virt) return (ret); } - -/** - * KVP related structures - * - */ -typedef struct hv_vmbus_service { - hv_guid guid; /* Hyper-V GUID */ - char *name; /* name of service */ - boolean_t enabled; /* service enabled */ - hv_work_queue *work_queue; /* background work queue */ - - /* - * function to initialize service - */ - int (*init)(struct hv_vmbus_service *); - - /* - * function to process Hyper-V messages - */ - void (*callback)(void *); -} hv_vmbus_service; - -extern uint8_t* receive_buffer[]; -extern hv_vmbus_service service_table[]; - -void hv_kvp_callback(void *context); -int hv_kvp_init(hv_vmbus_service *serv); -void hv_kvp_deinit(void); - #endif /* __HYPERV_H__ */ Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.h ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_kvp.h Fri Sep 26 02:30:47 2014 (r272151) +++ stable/10/sys/dev/hyperv/utilities/hv_kvp.h Fri Sep 26 03:03:58 2014 (r272152) @@ -1,5 +1,7 @@ /*- - * Copyright (c) 2014 Microsoft Corp. + * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2012 NetApp Inc. + * Copyright (c) 2012 Citrix Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,15 +24,13 @@ * 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 _KVP_H #define _KVP_H /* - * An implementation of HyperV key value pair (KVP) functionality for FreeBSD + * An implementation of HyperV key value pair (KVP) functionality for FreeBSD * */ @@ -53,15 +53,15 @@ /* * bytes, including any null terminators */ -#define HV_KVP_EXCHANGE_MAX_VALUE_SIZE (2048) +#define HV_KVP_EXCHANGE_MAX_VALUE_SIZE (2048) /* * Maximum key size - the registry limit for the length of an entry name * is 256 characters, including the null terminator */ -#define HV_KVP_EXCHANGE_MAX_KEY_SIZE (512) +#define HV_KVP_EXCHANGE_MAX_KEY_SIZE (512) /* * In FreeBSD, we implement the KVP functionality in two components: @@ -111,20 +111,30 @@ * (not supported), a NULL key string is returned. */ - + /* * Registry value types. */ -#define HV_REG_SZ 1 -#define HV_REG_U32 4 -#define HV_REG_U64 8 +#define HV_REG_SZ 1 +#define HV_REG_U32 4 +#define HV_REG_U64 8 + + +/* + * Daemon code not supporting IP injection (legacy daemon). + */ + +#define HV_KVP_OP_REGISTER 4 /* * Daemon code supporting IP injection. + * The KVP opcode field is used to communicate the + * registration information; so define a namespace that + * will be distinct from the host defined KVP opcode. */ -#define HV_KVP_OP_REGISTER 4 +#define KVP_OP_REGISTER1 100 enum hv_kvp_exchg_op { HV_KVP_OP_GET = 0, @@ -145,41 +155,41 @@ enum hv_kvp_exchg_pool { HV_KVP_POOL_COUNT /* Number of pools, must be last. */ }; - /* * Some Hyper-V status codes. */ -#define HV_KVP_S_OK 0x00000000 -#define HV_KVP_E_FAIL 0x80004005 -#define HV_KVP_S_CONT 0x80070103 -#define HV_ERROR_NOT_SUPPORTED 0x80070032 -#define HV_ERROR_MACHINE_LOCKED 0x800704F7 -#define HV_ERROR_DEVICE_NOT_CONNECTED 0x8007048F -#define HV_INVALIDARG 0x80070057 -#define HV_KVP_GUID_NOTFOUND 0x80041002 - -#define ADDR_FAMILY_NONE 0x00 -#define ADDR_FAMILY_IPV4 0x01 -#define ADDR_FAMILY_IPV6 0x02 - -#define MAX_ADAPTER_ID_SIZE 128 -#define MAX_IP_ADDR_SIZE 1024 -#define MAX_GATEWAY_SIZE 512 +#define HV_KVP_S_OK 0x00000000 +#define HV_KVP_E_FAIL 0x80004005 +#define HV_KVP_S_CONT 0x80070103 +#define HV_ERROR_NOT_SUPPORTED 0x80070032 +#define HV_ERROR_MACHINE_LOCKED 0x800704F7 +#define HV_ERROR_DEVICE_NOT_CONNECTED 0x8007048F +#define HV_INVALIDARG 0x80070057 +#define HV_KVP_GUID_NOTFOUND 0x80041002 + +#define ADDR_FAMILY_NONE 0x00 +#define ADDR_FAMILY_IPV4 0x01 +#define ADDR_FAMILY_IPV6 0x02 + +#define MAX_ADAPTER_ID_SIZE 128 +#define MAX_IP_ADDR_SIZE 1024 +#define MAX_GATEWAY_SIZE 512 struct hv_kvp_ipaddr_value { - uint16_t adapter_id[MAX_ADAPTER_ID_SIZE]; - uint8_t addr_family; - uint8_t dhcp_enabled; - uint16_t ip_addr[MAX_IP_ADDR_SIZE]; - uint16_t sub_net[MAX_IP_ADDR_SIZE]; - uint16_t gate_way[MAX_GATEWAY_SIZE]; - uint16_t dns_addr[MAX_IP_ADDR_SIZE]; -}__attribute__((packed)); + uint16_t adapter_id[MAX_ADAPTER_ID_SIZE]; + uint8_t addr_family; + uint8_t dhcp_enabled; + uint16_t ip_addr[MAX_IP_ADDR_SIZE]; + uint16_t sub_net[MAX_IP_ADDR_SIZE]; + uint16_t gate_way[MAX_GATEWAY_SIZE]; + uint16_t dns_addr[MAX_IP_ADDR_SIZE]; +} __attribute__((packed)); + struct hv_kvp_hdr { - uint8_t operation; - uint8_t pool; + uint8_t operation; + uint8_t pool; uint16_t pad; } __attribute__((packed)); @@ -187,9 +197,9 @@ struct hv_kvp_exchg_msg_value { uint32_t value_type; uint32_t key_size; uint32_t value_size; - uint8_t key[HV_KVP_EXCHANGE_MAX_KEY_SIZE]; + uint8_t key[HV_KVP_EXCHANGE_MAX_KEY_SIZE]; union { - uint8_t value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE]; + uint8_t value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE]; uint32_t value_u32; uint64_t value_u64; } msg_value; @@ -219,16 +229,16 @@ struct hv_kvp_register { struct hv_kvp_msg { union { - struct hv_kvp_hdr kvp_hdr; - uint32_t error; + struct hv_kvp_hdr kvp_hdr; + int error; } hdr; union { - struct hv_kvp_msg_get kvp_get; - struct hv_kvp_msg_set kvp_set; + struct hv_kvp_msg_get kvp_get; + struct hv_kvp_msg_set kvp_set; struct hv_kvp_msg_delete kvp_delete; struct hv_kvp_msg_enumerate kvp_enum_data; - struct hv_kvp_ipaddr_value kvp_ip_val; - struct hv_kvp_register kvp_register; + struct hv_kvp_ipaddr_value kvp_ip_val; + struct hv_kvp_register kvp_register; } body; } __attribute__((packed)); @@ -238,17 +248,38 @@ struct hv_kvp_ip_msg { struct hv_kvp_ipaddr_value kvp_ip_val; } __attribute__((packed)); +#define BSD_SOC_PATH "/etc/hyperv/socket" + +#define HV_SHUT_DOWN 0 +#define HV_TIME_SYNCH 1 +#define HV_HEART_BEAT 2 +#define HV_KVP 3 +#define HV_MAX_UTIL_SERVICES 4 + +#define HV_WLTIMEDELTA 116444736000000000L /* in 100ns unit */ +#define HV_ICTIMESYNCFLAG_PROBE 0 +#define HV_ICTIMESYNCFLAG_SYNC 1 +#define HV_ICTIMESYNCFLAG_SAMPLE 2 +#define HV_NANO_SEC_PER_SEC 1000000000 + +typedef struct hv_vmbus_service { + hv_guid guid; /* Hyper-V GUID */ + char* name; /* name of service */ + boolean_t enabled; /* service enabled */ + hv_work_queue* work_queue; /* background work queue */ + + // + // function to initialize service + // + int (*init)(struct hv_vmbus_service *); + + // + // function to process Hyper-V messages + // + void (*callback)(void *); +} hv_vmbus_service; -#define HV_SHUT_DOWN 0 -#define HV_TIME_SYNCH 1 -#define HV_HEART_BEAT 2 -#define HV_KVP 3 -#define HV_MAX_UTIL_SERVICES 4 - -#define HV_WLTIMEDELTA 116444736000000000L /* in 100ns unit */ -#define HV_ICTIMESYNCFLAG_PROBE 0 -#define HV_ICTIMESYNCFLAG_SYNC 1 -#define HV_ICTIMESYNCFLAG_SAMPLE 2 -#define HV_NANO_SEC_PER_SEC 1000000000 +extern uint8_t* receive_buffer[]; +extern hv_vmbus_service service_table[]; #endif /* _KVP_H */ Modified: stable/10/sys/dev/hyperv/utilities/hv_util.c ============================================================================== --- stable/10/sys/dev/hyperv/utilities/hv_util.c Fri Sep 26 02:30:47 2014 (r272151) +++ stable/10/sys/dev/hyperv/utilities/hv_util.c Fri Sep 26 03:03:58 2014 (r272152) @@ -1,5 +1,7 @@ /*- - * Copyright (c) 2014 Microsoft Corp. + * Copyright (c) 2009-2012 Microsoft Corp. + * Copyright (c) 2012 NetApp Inc. + * Copyright (c) 2012 Citrix Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,11 +24,9 @@ * 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$ */ -/* +/** * A common driver for all hyper-V util services. */ @@ -53,7 +53,7 @@ static void hv_timesync_cb(void *context static int hv_timesync_init(hv_vmbus_service *serv); -/* +/** * Note: GUID codes below are predefined by the host hypervisor * (Hyper-V and Azure)interface and required for correct operation. */ @@ -80,16 +80,7 @@ hv_vmbus_service service_table[] = { 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d}, .name = "Hyper-V Heartbeat Service\n", .enabled = TRUE, - .callback = hv_heartbeat_cb, - }, - - /* KVP (Key Value Pair) Service */ - { .guid.data = {0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, - 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6}, - .name = "Hyper-V KVP Service\n", - .enabled = TRUE, - .init = hv_kvp_init, - .callback = hv_kvp_callback, + .callback = hv_heartbeat_cb, }, }; @@ -99,8 +90,6 @@ hv_vmbus_service service_table[] = { */ uint8_t *receive_buffer[HV_MAX_UTIL_SERVICES]; -static boolean_t destroyed_kvp = FALSE; - struct hv_ictimesync_data { uint64_t parenttime; uint64_t childtime; @@ -154,7 +143,7 @@ hv_negotiate_version( static void hv_set_host_time(void *context) { - time_sync_data* time_msg = (time_sync_data*) context; + time_sync_data *time_msg = context; uint64_t hosttime = time_msg->data; struct timespec guest_ts, host_ts; uint64_t host_tns; @@ -264,12 +253,12 @@ hv_timesync_cb(void *context) static void hv_shutdown_cb(void *context) { - uint8_t* buf; + uint8_t* buf; hv_vmbus_channel* channel = context; - uint8_t execute_shutdown = 0; + uint8_t execute_shutdown = 0; hv_vmbus_icmsg_hdr* icmsghdrp; - uint32_t recv_len; - uint64_t request_id; + uint32_t recv_len; + uint64_t request_id; int ret; hv_vmbus_shutdown_msg_data* shutdown_msg; @@ -432,11 +421,6 @@ hv_util_detach(device_t dev) struct hv_vmbus_service* service; size_t receive_buffer_offset; - if (!destroyed_kvp) { - hv_kvp_deinit(); - destroyed_kvp = TRUE; - } - hv_dev = vmbus_get_devctx(dev); hv_vmbus_channel_close(hv_dev->channel); @@ -448,22 +432,21 @@ hv_util_detach(device_t dev) free(receive_buffer[receive_buffer_offset], M_DEVBUF); receive_buffer[receive_buffer_offset] = NULL; + return (0); } -static void -hv_util_init(void) +static void hv_util_init(void) { } -static int -hv_util_modevent(module_t mod, int event, void *arg) +static int hv_util_modevent(module_t mod, int event, void *arg) { switch (event) { case MOD_LOAD: break; case MOD_UNLOAD: - break; + break; default: break; } Modified: stable/10/sys/modules/hyperv/utilities/Makefile ============================================================================== --- stable/10/sys/modules/hyperv/utilities/Makefile Fri Sep 26 02:30:47 2014 (r272151) +++ stable/10/sys/modules/hyperv/utilities/Makefile Fri Sep 26 03:03:58 2014 (r272152) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../../dev/hyperv/utilities KMOD= hv_utils -SRCS= hv_util.c hv_kvp.c +SRCS= hv_util.c SRCS+= bus_if.h device_if.h CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/include \ Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri Sep 26 02:30:47 2014 (r272151) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri Sep 26 03:03:58 2014 (r272152) @@ -4670,11 +4670,3 @@ OLD_FILES+=usr/bin/svnserve OLD_FILES+=usr/bin/svnsync OLD_FILES+=usr/bin/svnversion .endif - -.if ${MK_HYPERV} == no -OLD_FILES+=etc/devd/hyperv.conf -OLD_FILES+=usr/libexec/hyperv/hv_set_ifconfig -OLD_FILES+=usr/libexec/hyperv/hv_get_dns_info -OLD_FILES+=usr/libexec/hyperv/hv_get_dhcp_info -OLD_FILES+=usr/sbin/hv_kvpd -.endif Modified: stable/10/usr.sbin/Makefile.amd64 ============================================================================== --- stable/10/usr.sbin/Makefile.amd64 Fri Sep 26 02:30:47 2014 (r272151) +++ stable/10/usr.sbin/Makefile.amd64 Fri Sep 26 03:03:58 2014 (r272152) @@ -18,9 +18,6 @@ SUBDIR+= boot0cfg SUBDIR+= btxld .endif SUBDIR+= cpucontrol -.if ${MK_HYPERV} != "no" -SUBDIR+= hyperv -.endif SUBDIR+= kgmon SUBDIR+= lptcontrol SUBDIR+= mount_smbfs Modified: stable/10/usr.sbin/Makefile.i386 ============================================================================== --- stable/10/usr.sbin/Makefile.i386 Fri Sep 26 02:30:47 2014 (r272151) +++ stable/10/usr.sbin/Makefile.i386 Fri Sep 26 03:03:58 2014 (r272152) @@ -9,9 +9,6 @@ SUBDIR+= asf SUBDIR+= btxld .endif SUBDIR+= cpucontrol -.if ${MK_HYPERV} != "no" -SUBDIR+= hyperv -.endif SUBDIR+= kgmon SUBDIR+= kgzip SUBDIR+= lptcontrol From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 04:33:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4799C7B3; Fri, 26 Sep 2014 04:33:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 338026BF; Fri, 26 Sep 2014 04:33:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q4XSfV015110; Fri, 26 Sep 2014 04:33:28 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q4XSNi015109; Fri, 26 Sep 2014 04:33:28 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201409260433.s8Q4XSNi015109@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Fri, 26 Sep 2014 04:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272153 - head/lib/libthr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 04:33:28 -0000 Author: pluknet Date: Fri Sep 26 04:33:27 2014 New Revision: 272153 URL: http://svnweb.freebsd.org/changeset/base/272153 Log: Fix description of mutex acquisition. Reviewed by: kib X-MFC with: r272070 Sponsored by: Nginx, Inc. Modified: head/lib/libthr/libthr.3 Modified: head/lib/libthr/libthr.3 ============================================================================== --- head/lib/libthr/libthr.3 Fri Sep 26 03:03:58 2014 (r272152) +++ head/lib/libthr/libthr.3 Fri Sep 26 04:33:27 2014 (r272153) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2014 +.Dd September 26, 2014 .Dt LIBTHR 3 .Os .Sh NAME @@ -85,8 +85,14 @@ owning the lock. .Nm performs a contested mutex acquisition in three stages, each of which is more resource-consuming than the previous. +The first two stages are only applied for a mutex of +.Dv PTHREAD_MUTEX_ADAPTIVE_NP +type and +.Dv PTHREAD_PRIO_NONE +protocol (see +.Xr pthread_mutexattr 3 ) . .Pp -First, a spin loop +First, on SMP systems, a spin loop is performed, where the library attempts to acquire the lock by .Xr atomic 9 operations. From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 05:05:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C2C6BAA; Fri, 26 Sep 2014 05:05:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F093D966; Fri, 26 Sep 2014 05:05:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q55Y7o029195; Fri, 26 Sep 2014 05:05:34 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q55Y4M029194; Fri, 26 Sep 2014 05:05:34 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409260505.s8Q55Y4M029194@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 26 Sep 2014 05:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272154 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 05:05:35 -0000 Author: delphij Date: Fri Sep 26 05:05:34 2014 New Revision: 272154 URL: http://svnweb.freebsd.org/changeset/base/272154 Log: Refactor the code a little bit to reduce duplicated code. Reviewed by: mjg MFC after: 2 weeks Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Fri Sep 26 04:33:27 2014 (r272153) +++ head/sbin/sysctl/sysctl.c Fri Sep 26 05:05:34 2014 (r272154) @@ -57,6 +57,7 @@ static const char rcsid[] = #include #endif +#include #include #include #include @@ -80,7 +81,31 @@ static int show_var(int *, int); static int sysctl_all(int *oid, int len); static int name2oid(const char *, int *); -static int set_IK(const char *, int *); +static int strIKtoi(const char *, char **); + +static int ctl_sign[CTLTYPE+1] = { + [CTLTYPE_INT] = 1, + [CTLTYPE_LONG] = 1, + [CTLTYPE_S64] = 1, +}; + +static int ctl_size[CTLTYPE+1] = { + [CTLTYPE_INT] = sizeof(int), + [CTLTYPE_UINT] = sizeof(u_int), + [CTLTYPE_LONG] = sizeof(long), + [CTLTYPE_ULONG] = sizeof(u_long), + [CTLTYPE_S64] = sizeof(int64_t), + [CTLTYPE_U64] = sizeof(uint64_t), +}; + +static const char *ctl_typename[CTLTYPE+1] = { + [CTLTYPE_INT] = "integer", + [CTLTYPE_UINT] = "unsigned integer", + [CTLTYPE_LONG] = "long integer", + [CTLTYPE_ULONG] = "unsigned long", + [CTLTYPE_S64] = "int64_t", + [CTLTYPE_U64] = "uint64_t", +}; static void usage(void) @@ -191,7 +216,8 @@ static int parse(const char *string, int lineno) { int len, i, j; - void *newval = 0; + const void *newval; + const char *newvalstr = NULL; int intval; unsigned int uintval; long longval; @@ -200,7 +226,7 @@ parse(const char *string, int lineno) int64_t i64val; uint64_t u64val; int mib[CTL_MAXNAME]; - char *cp, *bufp, buf[BUFSIZ], *endptr, fmt[BUFSIZ], line[BUFSIZ]; + char *cp, *bufp, buf[BUFSIZ], *endptr = NULL, fmt[BUFSIZ], line[BUFSIZ]; u_int kind; if (lineno) @@ -230,7 +256,7 @@ parse(const char *string, int lineno) cp[strlen(cp) - 1] = '\0'; cp++; } - newval = cp; + newvalstr = cp; newsize = strlen(cp); } len = name2oid(bufp, mib); @@ -254,7 +280,7 @@ parse(const char *string, int lineno) exit(1); } - if (newval == NULL || dflag) { + if (newvalstr == NULL || dflag) { if ((kind & CTLTYPE) == CTLTYPE_NODE) { if (dflag) { i = show_var(mib, len); @@ -282,105 +308,77 @@ parse(const char *string, int lineno) return (1); } - if ((kind & CTLTYPE) == CTLTYPE_INT || - (kind & CTLTYPE) == CTLTYPE_UINT || - (kind & CTLTYPE) == CTLTYPE_LONG || - (kind & CTLTYPE) == CTLTYPE_ULONG || - (kind & CTLTYPE) == CTLTYPE_S64 || - (kind & CTLTYPE) == CTLTYPE_U64) { - if (strlen(newval) == 0) { + switch (kind & CTLTYPE) { + case CTLTYPE_INT: + case CTLTYPE_UINT: + case CTLTYPE_LONG: + case CTLTYPE_ULONG: + case CTLTYPE_S64: + case CTLTYPE_U64: + if (strlen(newvalstr) == 0) { warnx("empty numeric value"); return (1); } + /* FALLTHROUGH */ + case CTLTYPE_STRING: + break; + default: + warnx("oid '%s' is type %d," + " cannot set that%s", bufp, + kind & CTLTYPE, line); + return (1); } errno = 0; switch (kind & CTLTYPE) { case CTLTYPE_INT: - if (strcmp(fmt, "IK") == 0) { - if (!set_IK(newval, &intval)) { - warnx("invalid value '%s'%s", - (char *)newval, line); - return (1); - } - } else { - intval = (int)strtol(newval, &endptr, + if (strcmp(fmt, "IK") == 0) + intval = strIKtoi(newvalstr, &endptr); + else + intval = (int)strtol(newvalstr, &endptr, 0); - if (errno != 0 || endptr == newval || - *endptr != '\0') { - warnx("invalid integer '%s'%s", - (char *)newval, line); - return (1); - } - } newval = &intval; newsize = sizeof(intval); break; case CTLTYPE_UINT: - uintval = (int) strtoul(newval, &endptr, 0); - if (errno != 0 || endptr == newval || - *endptr != '\0') { - warnx("invalid unsigned integer '%s'%s", - (char *)newval, line); - return (1); - } + uintval = (int) strtoul(newvalstr, &endptr, 0); newval = &uintval; newsize = sizeof(uintval); break; case CTLTYPE_LONG: - longval = strtol(newval, &endptr, 0); - if (errno != 0 || endptr == newval || - *endptr != '\0') { - warnx("invalid long integer '%s'%s", - (char *)newval, line); - return (1); - } + longval = strtol(newvalstr, &endptr, 0); newval = &longval; newsize = sizeof(longval); break; case CTLTYPE_ULONG: - ulongval = strtoul(newval, &endptr, 0); - if (errno != 0 || endptr == newval || - *endptr != '\0') { - warnx("invalid unsigned long integer" - " '%s'%s", (char *)newval, line); - return (1); - } + ulongval = strtoul(newvalstr, &endptr, 0); newval = &ulongval; newsize = sizeof(ulongval); break; case CTLTYPE_STRING: + newval = newvalstr; break; case CTLTYPE_S64: - i64val = strtoimax(newval, &endptr, 0); - if (errno != 0 || endptr == newval || - *endptr != '\0') { - warnx("invalid int64_t '%s'%s", - (char *)newval, line); - return (1); - } + i64val = strtoimax(newvalstr, &endptr, 0); newval = &i64val; newsize = sizeof(i64val); break; case CTLTYPE_U64: - u64val = strtoumax(newval, &endptr, 0); - if (errno != 0 || endptr == newval || - *endptr != '\0') { - warnx("invalid uint64_t '%s'%s", - (char *)newval, line); - return (1); - } + u64val = strtoumax(newvalstr, &endptr, 0); newval = &u64val; newsize = sizeof(u64val); break; - case CTLTYPE_OPAQUE: - /* FALLTHROUGH */ default: - warnx("oid '%s' is type %d," - " cannot set that%s", bufp, - kind & CTLTYPE, line); - return (1); + /* NOTREACHED */ + abort(); + } + + if (errno != 0 || endptr == newvalstr || + (endptr != NULL && *endptr != '\0')) { + warnx("invalid %s '%s'%s", ctl_typename[kind & CTLTYPE], + newvalstr, line); + return (1); } i = show_var(mib, len); @@ -665,33 +663,35 @@ S_bios_smap_xattr(size_t l2, void *p) #endif static int -set_IK(const char *str, int *val) +strIKtoi(const char *str, char **endptrp) { + int kelv; float temp; - int len, kelv; + size_t len; const char *p; - char *endptr; - if ((len = strlen(str)) == 0) - return (0); + assert(errno == 0); + + len = strlen(str); + /* caller already checked this */ + assert(len > 0); + p = &str[len - 1]; - errno = 0; if (*p == 'C' || *p == 'F') { - temp = strtof(str, &endptr); - if (errno != 0 || endptr == str || - endptr != p) - return (0); - if (*p == 'F') - temp = (temp - 32) * 5 / 9; - kelv = temp * 10 + 2732; + temp = strtof(str, endptrp); + if (*endptrp != str && *endptrp == p && errno != 0) { + if (*p == 'F') + temp = (temp - 32) * 5 / 9; + return (temp * 10 + 2732); + } } else { - kelv = (int)strtol(str, &endptr, 10); - if (errno != 0 || endptr == str || - *endptr != '\0') - return (0); + kelv = (int)strtol(str, endptrp, 10); + if (*endptrp != str && *endptrp == p && errno != 0) + return (kelv); } - *val = kelv; - return (1); + + errno = ERANGE; + return (0); } /* @@ -746,21 +746,6 @@ oidfmt(int *oid, int len, char *fmt, u_i return (0); } -static int ctl_sign[CTLTYPE+1] = { - [CTLTYPE_INT] = 1, - [CTLTYPE_LONG] = 1, - [CTLTYPE_S64] = 1, -}; - -static int ctl_size[CTLTYPE+1] = { - [CTLTYPE_INT] = sizeof(int), - [CTLTYPE_UINT] = sizeof(u_int), - [CTLTYPE_LONG] = sizeof(long), - [CTLTYPE_ULONG] = sizeof(u_long), - [CTLTYPE_S64] = sizeof(int64_t), - [CTLTYPE_U64] = sizeof(int64_t), -}; - /* * This formats and outputs the value of one variable * From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 05:49:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DEAD585; Fri, 26 Sep 2014 05:49:17 +0000 (UTC) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8D76FD07; Fri, 26 Sep 2014 05:49:16 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 486BC3C483B; Fri, 26 Sep 2014 15:27:01 +1000 (EST) Date: Fri, 26 Sep 2014 15:26:55 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: d@delphij.net Subject: Re: svn commit: r272144 - head/sbin/sysctl In-Reply-To: <5424B11E.4030909@delphij.net> Message-ID: <20140926132358.T2195@besplex.bde.org> References: <201409252237.s8PMbScl041679@svn.freebsd.org> <20140925224035.GA6065@dft-labs.eu> <5424B11E.4030909@delphij.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=sm4ObCWsq2HNPPFzBHsA:9 a=0fvtrBFKhmiNAYHY:21 a=U1WInAASgpy1UqlK:21 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Mateusz Guzik , Xin LI , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 05:49:17 -0000 On Thu, 25 Sep 2014, Xin Li wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 09/25/14 15:40, Mateusz Guzik wrote: >> On Thu, Sep 25, 2014 at 10:37:28PM +0000, Xin LI wrote: >>> Author: delphij Date: Thu Sep 25 22:37:27 2014 New Revision: >>> 272144 URL: http://svnweb.freebsd.org/changeset/base/272144 >>> >>> Log: The strtol(3) family of functions would set errno when it >>> hits one. Check errno and handle it as invalid input. >> >> But this requires explicitely setting errno to 0 before strto* >> call, otherwise you cannot know whether errno is meaningful when >> you test it. Yes, it has error #3 of 1-10 for programming the strto*() family. (I made up the #3, and 10 is as high as I can count.) At least the following errors were already present: - clobbering the return value by assigning it to a variable of a wrong type. This causes implementation-defined behaviour. It prevents some types of range checking and some types of error reporting. - using a cast to possibly break possible compiler warnings about truncation from the previous bug - for CTLTYPE_UINT, using the wrong bogus cast (to int instead of u_int) to possibly not even break the compiler warnings, but to break the value on exotic arches - no range checking at all. I think you just added some, but with a bad error message. Input that is out of bounds is a little different from general invalid input. - for CTLTYPE_UINT, also using misformatting (space after cast) in the wrong bogus cast - verboseness. Despite the missing error handling, the code is large. Before the switch statement, there is a silly special check for all the numeric types. This checks for empty strings using a slow method of strlen() instead of checking if the first character is NUL (perhaps the compiler can optimize this). Leading whitespace is stripped before this, so this finds a few more errors than empty strings. But all this does is print "empty numeric value" of the less specific "invalid integer ''%s" when the string is empty. (Here %s prints the variable 'line'. It looks like an output formatting error to append it unquoted to the quoted string newval, but I couldn't find an example where 'line' is nonempty. The special cases is removed in my version. I didn't fix the other errors. The following error was not present: - saying in error messages that invalid input is "illegal". sysctl.c has worse style bugs than the verboseness. The case statement containing most of the strto*() statements is misindented. This gives verboseness and style bugs like splitting error messages strings colaterally, although not long lines. >> Also it looks like the code would use some deduplications with >> macros or something. > > I think the code can use some refactor. Does the attached patch look > good to you? No, it looks bad. % Index: sysctl.c % =================================================================== % --- sysctl.c (revision 272145) % +++ sysctl.c (working copy) % @@ -57,6 +57,7 @@ static const char rcsid[] = % #include % #endif % % +#include The necessary error handling is ugly enough. % #include % #include % #include % @@ -80,8 +81,32 @@ static int show_var(int *, int); % static int sysctl_all(int *oid, int len); % static int name2oid(const char *, int *); % % -static int set_IK(const char *, int *); % +static int strIKtoi(const char *, char **); % % +static int ctl_sign[CTLTYPE+1] = { % + [CTLTYPE_INT] = 1, % + [CTLTYPE_LONG] = 1, % + [CTLTYPE_S64] = 1, % +}; % + % +static int ctl_size[CTLTYPE+1] = { % + [CTLTYPE_INT] = sizeof(int), % + [CTLTYPE_UINT] = sizeof(u_int), % + [CTLTYPE_LONG] = sizeof(long), % + [CTLTYPE_ULONG] = sizeof(u_long), % + [CTLTYPE_S64] = sizeof(int64_t), % + [CTLTYPE_U64] = sizeof(uint64_t), % +}; % + % +static const char *ctl_typename[CTLTYPE+1] = { % + [CTLTYPE_INT] = "integer", % + [CTLTYPE_UINT] = "unsigned integer", % + [CTLTYPE_LONG] = "long integer", % + [CTLTYPE_ULONG] = "unsigned long", % + [CTLTYPE_S64] = "int64_t", % + [CTLTYPE_U64] = "uint64_t", % +}; % + % static void % usage(void) % { Takes about the same amount of code as before, and is harder to read. Loses some context-dependent error messages. Add tables to restore those and it might be larger than before. The old code could use goto to common error handling code if to reduce duplication in a different ugly way. % @@ -288,10 +314,22 @@ parse(const char *string, int lineno) % (kind & CTLTYPE) == CTLTYPE_ULONG || % (kind & CTLTYPE) == CTLTYPE_S64 || % (kind & CTLTYPE) == CTLTYPE_U64) { % - if (strlen(newval) == 0) { % + if (strlen(newvalstr) == 0) { % warnx("empty numeric value"); % return (1); % } Just remove this. % + } else if ((kind & CTLTYPE) != CTLTYPE_STRING) { % + /* % + * The only acceptable types are: % + * CTLTYPE_INT, CTLTYPE_UINT, % + * CTLTYPE_LONG, CTLTYPE_ULONG, % + * CTLTYPE_S64, CTLTYPE_U64 and % + * CTLTYPE_STRING. % + */ % + warnx("oid '%s' is type %d," % + " cannot set that%s", bufp, % + kind & CTLTYPE, line); % + " cannot set that%s", bufp, % + return (1); % } Don't increase it. This adds (actually moves) the following style bugs: - obfuscating a string by splitting it - splitting a string that doesn't even require splitting to fit in 80 columns - non-KNF indentation in the splitting. % % errno = 0; Extra blank line before and after this. % @@ -298,91 +336,53 @@ parse(const char *string, int lineno) % % switch (kind & CTLTYPE) { % case CTLTYPE_INT: The case statement is still misindented. This gives lots of ugly line splitting (most actually needed) below. % - if (strcmp(fmt, "IK") == 0) { % - if (!set_IK(newval, &intval)) { % - warnx("invalid value '%s'%s", % - (char *)newval, line); % - return (1); % - } % - } else { % - intval = (int)strtol(newval, &endptr, % + if (strcmp(fmt, "IK") == 0) % + intval = strIKtoi(newvalstr, &endptr); % + else % + intval = (int)strtol(newvalstr, &endptr, % 0); The style here is not too bad. % - if (errno != 0 || endptr == newval || % - *endptr != '\0') { % - warnx("invalid integer '%s'%s", % - (char *)newval, line); % - return (1); % - } % - } All integer values should be parsed using strtoumax(). The range checking that needs to be added to this is only slightly more complicated that the range checking that is needed using special strto*(), except for CTLTYPE_LONG and CTLTYPE_ULONG where strtol() and strtoul() match the type exactly. Conversion from uintmax_t to a signed type is a little more complicated. % newval = &intval; % newsize = sizeof(intval); % break; % case CTLTYPE_UINT: % - uintval = (int) strtoul(newval, &endptr, 0); % - if (errno != 0 || endptr == newval || % - *endptr != '\0') { % - warnx("invalid unsigned integer '%s'%s", % - (char *)newval, line); % - return (1); % - } % + uintval = (int) strtoul(newvalstr, &endptr, 0); The bogus casts and style bugs in them remain. Correct code in all cases begins with something like: uintmxval = strtoumax(newvalstr, &endptr, 0); I don't see how to do range checking on this cleanly except by using special code for every case. In this case, it is something like: if (uintmxval > UINT_MAX) errno = ERANGE; uintval = (u_int)uintmaxval; /* unused if ERANGE */ Then continue as before. Not too bad. Printing a specific error message with the range for this cased would take more work. The signed cases also need to detect and put back the sign. % newval = &uintval; % newsize = sizeof(uintval); % break; This needs some specific code, but there was already a table of sizes, so the newsize initialization in it can be moved out of the switch. But I prefer a simple switch. The size table (ctl_size[]) just allows avoiding 1 line in each statement of the corresponding switch for output, at the cost of a more complicated and unusally structured switch. % ... % - case CTLTYPE_OPAQUE: % - /* FALLTHROUGH */ % default: % - warnx("oid '%s' is type %d," % - " cannot set that%s", bufp, % - kind & CTLTYPE, line); % + /* NOTREACHED */ % return (1); This was better placed in where it was. It needed a verbose comment even less then. % } % Style bug (extra blank line to detach the error handling). % + if (errno != 0 || endptr == newvalstr || *endptr != '\0') { % + warnx("invalid %s '%s'%s", ctl_typename[kind & CTLTYPE], % + newvalstr, line); % + return (1); % + } Printing the typename is not very useful except in the case of a range error. Then the user can use it to decrypt the rest of the message from "invalid" to "range error" after looking up or know the range of the variable type. That type is an implementation detail but it is not obvious what it is. % + % i = show_var(mib, len); % if (sysctl(mib, len, 0, 0, newval, newsize) == -1) { % if (!i && !bflag) % @@ -665,33 +665,35 @@ S_bios_smap_xattr(size_t l2, void *p) % #endif % % static int % -set_IK(const char *str, int *val) % +strIKtoi(const char *str, char **endptrp) % { % + int kelv; % float temp; % - int len, kelv; % + size_t len; % const char *p; % - char *endptr; % % - if ((len = strlen(str)) == 0) % - return (0); % + assert(errno == 0); Silly. It's easier to set it again than check it. % + Style bug (extra blank line). % + len = strlen(str); % + /* caller already checked this */ Style bugs (comment capitalization and punctuation). % + assert(len > 0); The caller shouldn't have checked this. % + % p = &str[len - 1]; Was sloppy. I would parse the number and check for a suffix later. Perhaps there is a problem with the F suffix being part of a float-precision number. % - errno = 0; % if (*p == 'C' || *p == 'F') { % - temp = strtof(str, &endptr); % - if (errno != 0 || endptr == str || % - endptr != p) % - return (0); % - if (*p == 'F') % - temp = (temp - 32) * 5 / 9; % - kelv = temp * 10 + 2732; % + temp = strtof(str, endptrp); strtof() and the calculations using its value require different and larger range checking than the integer functions. This was mostly missing. % + if (*endptrp != str && *endptrp == p && errno != 0) { strtof() can return NaN or HUGE_VALF on errors. It then sets errno. The previous version added the missing errno check. % + if (*p == 'F') % + temp = (temp - 32) * 5 / 9; Overflow still occurs for bad input. So does underflow and total loss of precision. Garbage values below 0 degrees Kelvin are accepted and turned into worse garbage. It seems reasonable to disallow values that are below 0 in Kelvin or above the boiling point of Silicon. This gives a simple sanity check. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 07:01:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1256DF82; Fri, 26 Sep 2014 07:01:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1F816BB; Fri, 26 Sep 2014 07:01:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q71ROI083417; Fri, 26 Sep 2014 07:01:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q71RK5083416; Fri, 26 Sep 2014 07:01:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201409260701.s8Q71RK5083416@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 26 Sep 2014 07:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272157 - head/cddl/contrib/opensolaris/cmd/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 07:01:28 -0000 Author: markj Date: Fri Sep 26 07:01:27 2014 New Revision: 272157 URL: http://svnweb.freebsd.org/changeset/base/272157 Log: Fix the description of the -h option. Reported by: swills MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Fri Sep 26 06:41:33 2014 (r272156) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 Fri Sep 26 07:01:27 2014 (r272157) @@ -277,6 +277,19 @@ Generate a header file containing macros specified provider definitions. This option should be used to generate a header file that is included by other source files for later use with the +.Fl G +option. +If the +.Fl o +option is present, the header file is saved using the pathname specified as the +argument for that option. +If the +.Fl o +option is not present and the DTrace program is contained within a file whose +name is +.Ar filename.d , +then the header file is saved using the name +.Ar filename.h . .It Fl H Print the pathnames of included files when invoking .Xr cpp 1 @@ -289,20 +302,6 @@ option to each .Xr cpp 1 invocation, causing it to display the list of pathnames, one for each line, to standard error. -.Fl G -option. -If the -.Fl o -option -is present, the header file is saved using the pathname specified as the -argument for that option. -If the -.Fl o -option is not present and the DTrace program is contained with a file whose -name is -.Ar filename.d , -then the header file is saved using the name -.Ar filename.h . .It Fl i Ar probe-id Op Oo Ar predicate Oc Ar action Specify probe identifier .Ar ( probe-id ) From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 07:12:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3EBF7CA; Fri, 26 Sep 2014 07:12:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F11E8DE; Fri, 26 Sep 2014 07:12:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q7CgCM088879; Fri, 26 Sep 2014 07:12:42 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q7Cf8g088875; Fri, 26 Sep 2014 07:12:41 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409260712.s8Q7Cf8g088875@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 26 Sep 2014 07:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272158 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 07:12:42 -0000 Author: glebius Date: Fri Sep 26 07:12:40 2014 New Revision: 272158 URL: http://svnweb.freebsd.org/changeset/base/272158 Log: Make lagg protocols detach methods returning void. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/ieee8023ad_lacp.c head/sys/net/ieee8023ad_lacp.h head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Fri Sep 26 07:01:27 2014 (r272157) +++ head/sys/net/ieee8023ad_lacp.c Fri Sep 26 07:12:40 2014 (r272158) @@ -822,7 +822,7 @@ lacp_attach(struct lagg_softc *sc) return (0); } -int +void lacp_detach(struct lagg_softc *sc) { struct lacp_softc *lsc = LACP_SOFTC(sc); @@ -838,7 +838,6 @@ lacp_detach(struct lagg_softc *sc) LACP_LOCK_DESTROY(lsc); free(lsc, M_DEVBUF); - return (0); } void Modified: head/sys/net/ieee8023ad_lacp.h ============================================================================== --- head/sys/net/ieee8023ad_lacp.h Fri Sep 26 07:01:27 2014 (r272157) +++ head/sys/net/ieee8023ad_lacp.h Fri Sep 26 07:12:40 2014 (r272158) @@ -283,7 +283,7 @@ struct lacp_softc { struct mbuf *lacp_input(struct lagg_port *, struct mbuf *); struct lagg_port *lacp_select_tx_port(struct lagg_softc *, struct mbuf *); int lacp_attach(struct lagg_softc *); -int lacp_detach(struct lagg_softc *); +void lacp_detach(struct lagg_softc *); void lacp_init(struct lagg_softc *); void lacp_stop(struct lagg_softc *); int lacp_port_create(struct lagg_port *); Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri Sep 26 07:01:27 2014 (r272157) +++ head/sys/net/if_lagg.c Fri Sep 26 07:12:40 2014 (r272158) @@ -126,21 +126,19 @@ static int lagg_sysctl_active(SYSCTL_HAN /* Simple round robin */ static int lagg_rr_attach(struct lagg_softc *); -static int lagg_rr_detach(struct lagg_softc *); static int lagg_rr_start(struct lagg_softc *, struct mbuf *); static struct mbuf *lagg_rr_input(struct lagg_softc *, struct lagg_port *, struct mbuf *); /* Active failover */ static int lagg_fail_attach(struct lagg_softc *); -static int lagg_fail_detach(struct lagg_softc *); static int lagg_fail_start(struct lagg_softc *, struct mbuf *); static struct mbuf *lagg_fail_input(struct lagg_softc *, struct lagg_port *, struct mbuf *); /* Loadbalancing */ static int lagg_lb_attach(struct lagg_softc *); -static int lagg_lb_detach(struct lagg_softc *); +static void lagg_lb_detach(struct lagg_softc *); static int lagg_lb_port_create(struct lagg_port *); static void lagg_lb_port_destroy(struct lagg_port *); static int lagg_lb_start(struct lagg_softc *, struct mbuf *); @@ -150,14 +148,13 @@ static int lagg_lb_porttable(struct lagg /* Broadcast */ static int lagg_bcast_attach(struct lagg_softc *); -static int lagg_bcast_detach(struct lagg_softc *); static int lagg_bcast_start(struct lagg_softc *, struct mbuf *); static struct mbuf *lagg_bcast_input(struct lagg_softc *, struct lagg_port *, struct mbuf *); /* 802.3ad LACP */ static int lagg_lacp_attach(struct lagg_softc *); -static int lagg_lacp_detach(struct lagg_softc *); +static void lagg_lacp_detach(struct lagg_softc *); static int lagg_lacp_start(struct lagg_softc *, struct mbuf *); static struct mbuf *lagg_lacp_input(struct lagg_softc *, struct lagg_port *, struct mbuf *); @@ -1042,7 +1039,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd if (sc->sc_proto != LAGG_PROTO_NONE) { /* Reset protocol first in case detach unlocks */ sc->sc_proto = LAGG_PROTO_NONE; - error = sc->sc_detach(sc); + if (sc->sc_detach != NULL) + sc->sc_detach(sc); sc->sc_detach = NULL; sc->sc_start = NULL; sc->sc_input = NULL; @@ -1674,9 +1672,9 @@ lagg_enqueue(struct ifnet *ifp, struct m static int lagg_rr_attach(struct lagg_softc *sc) { - sc->sc_detach = lagg_rr_detach; sc->sc_start = lagg_rr_start; sc->sc_input = lagg_rr_input; + sc->sc_detach = NULL;; sc->sc_port_create = NULL; sc->sc_capabilities = IFCAP_LAGG_FULLDUPLEX; sc->sc_seq = 0; @@ -1685,12 +1683,6 @@ lagg_rr_attach(struct lagg_softc *sc) } static int -lagg_rr_detach(struct lagg_softc *sc) -{ - return (0); -} - -static int lagg_rr_start(struct lagg_softc *sc, struct mbuf *m) { struct lagg_port *lp; @@ -1733,12 +1725,12 @@ lagg_rr_input(struct lagg_softc *sc, str static int lagg_bcast_attach(struct lagg_softc *sc) { - sc->sc_detach = lagg_bcast_detach; sc->sc_start = lagg_bcast_start; sc->sc_input = lagg_bcast_input; sc->sc_port_create = NULL; sc->sc_port_destroy = NULL; sc->sc_linkstate = NULL; + sc->sc_detach = NULL; sc->sc_req = NULL; sc->sc_portreq = NULL; @@ -1746,12 +1738,6 @@ lagg_bcast_attach(struct lagg_softc *sc) } static int -lagg_bcast_detach(struct lagg_softc *sc) -{ - return (0); -} - -static int lagg_bcast_start(struct lagg_softc *sc, struct mbuf *m) { int active_ports = 0; @@ -1818,22 +1804,16 @@ lagg_bcast_input(struct lagg_softc *sc, static int lagg_fail_attach(struct lagg_softc *sc) { - sc->sc_detach = lagg_fail_detach; sc->sc_start = lagg_fail_start; sc->sc_input = lagg_fail_input; sc->sc_port_create = NULL; sc->sc_port_destroy = NULL; + sc->sc_detach = NULL; return (0); } static int -lagg_fail_detach(struct lagg_softc *sc) -{ - return (0); -} - -static int lagg_fail_start(struct lagg_softc *sc, struct mbuf *m) { struct lagg_port *lp; @@ -1905,13 +1885,14 @@ lagg_lb_attach(struct lagg_softc *sc) return (0); } -static int +static void lagg_lb_detach(struct lagg_softc *sc) { - struct lagg_lb *lb = (struct lagg_lb *)sc->sc_psc; + struct lagg_lb *lb; + + lb = (struct lagg_lb *)sc->sc_psc; if (lb != NULL) free(lb, M_DEVBUF); - return (0); } static int @@ -2020,21 +2001,18 @@ lagg_lacp_attach(struct lagg_softc *sc) return (error); } -static int +static void lagg_lacp_detach(struct lagg_softc *sc) { struct lagg_port *lp; - int error; SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) lacp_port_destroy(lp); /* unlocking is safe here */ LAGG_WUNLOCK(sc); - error = lacp_detach(sc); + lacp_detach(sc); LAGG_WLOCK(sc); - - return (error); } static void Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Fri Sep 26 07:01:27 2014 (r272157) +++ head/sys/net/if_lagg.h Fri Sep 26 07:12:40 2014 (r272158) @@ -216,7 +216,7 @@ struct lagg_softc { the lladdr on */ /* lagg protocol callbacks */ - int (*sc_detach)(struct lagg_softc *); + void (*sc_detach)(struct lagg_softc *); int (*sc_start)(struct lagg_softc *, struct mbuf *); struct mbuf *(*sc_input)(struct lagg_softc *, struct lagg_port *, struct mbuf *); From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 08:12:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9240D07; Fri, 26 Sep 2014 08:12:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4BFEFAD; Fri, 26 Sep 2014 08:12:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q8CDM3017588; Fri, 26 Sep 2014 08:12:13 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q8CDUR017587; Fri, 26 Sep 2014 08:12:13 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409260812.s8Q8CDUR017587@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 26 Sep 2014 08:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272159 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 08:12:13 -0000 Author: glebius Date: Fri Sep 26 08:12:12 2014 New Revision: 272159 URL: http://svnweb.freebsd.org/changeset/base/272159 Log: Make lagg protos a enum. Modified: head/sys/net/if_lagg.h Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Fri Sep 26 07:12:40 2014 (r272158) +++ head/sys/net/if_lagg.h Fri Sep 26 08:12:12 2014 (r272159) @@ -47,18 +47,20 @@ "\05DISTRIBUTING\06DISABLED" /* Supported lagg PROTOs */ -#define LAGG_PROTO_NONE 0 /* no lagg protocol defined */ -#define LAGG_PROTO_ROUNDROBIN 1 /* simple round robin */ -#define LAGG_PROTO_FAILOVER 2 /* active failover */ -#define LAGG_PROTO_LOADBALANCE 3 /* loadbalance */ -#define LAGG_PROTO_LACP 4 /* 802.3ad lacp */ -#define LAGG_PROTO_ETHERCHANNEL 5 /* Cisco FEC */ -#define LAGG_PROTO_BROADCAST 6 /* broadcast */ -#define LAGG_PROTO_MAX 7 +typedef enum { + LAGG_PROTO_NONE = 0, /* no lagg protocol defined */ + LAGG_PROTO_ROUNDROBIN, /* simple round robin */ + LAGG_PROTO_FAILOVER, /* active failover */ + LAGG_PROTO_LOADBALANCE, /* loadbalance */ + LAGG_PROTO_LACP, /* 802.3ad lacp */ + LAGG_PROTO_ETHERCHANNEL,/* Cisco FEC */ + LAGG_PROTO_BROADCAST, /* broadcast */ + LAGG_PROTO_MAX, +} lagg_proto; struct lagg_protos { const char *lpr_name; - int lpr_proto; + lagg_proto lpr_proto; }; #define LAGG_PROTO_DEFAULT LAGG_PROTO_FAILOVER From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 08:16:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 065F3EC2; Fri, 26 Sep 2014 08:16:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD50AFDF; Fri, 26 Sep 2014 08:16:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q8GRdo018196; Fri, 26 Sep 2014 08:16:27 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q8GR5g018193; Fri, 26 Sep 2014 08:16:27 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201409260816.s8Q8GR5g018193@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Fri, 26 Sep 2014 08:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272160 - in head/sys/dev/usb: . net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 08:16:28 -0000 Author: gavin Date: Fri Sep 26 08:16:26 2014 New Revision: 272160 URL: http://svnweb.freebsd.org/changeset/base/272160 Log: Add new (untested) device IDs to smsc(4) MFC after: 1 week Modified: head/sys/dev/usb/net/if_smsc.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Fri Sep 26 08:12:12 2014 (r272159) +++ head/sys/dev/usb/net/if_smsc.c Fri Sep 26 08:16:26 2014 (r272160) @@ -123,7 +123,24 @@ SYSCTL_INT(_hw_usb_smsc, OID_AUTO, debug */ static const struct usb_device_id smsc_devs[] = { #define SMSC_DEV(p,i) { USB_VPI(USB_VENDOR_SMC2, USB_PRODUCT_SMC2_##p, i) } + SMSC_DEV(LAN89530_ETH, 0), + SMSC_DEV(LAN9500_ETH, 0), + SMSC_DEV(LAN9500_ETH_2, 0), + SMSC_DEV(LAN9500A_ETH, 0), + SMSC_DEV(LAN9500A_ETH_2, 0), + SMSC_DEV(LAN9505_ETH, 0), + SMSC_DEV(LAN9505A_ETH, 0), SMSC_DEV(LAN9514_ETH, 0), + SMSC_DEV(LAN9514_ETH_2, 0), + SMSC_DEV(LAN9530_ETH, 0), + SMSC_DEV(LAN9730_ETH, 0), + SMSC_DEV(LAN9500_SAL10, 0), + SMSC_DEV(LAN9505_SAL10, 0), + SMSC_DEV(LAN9500A_SAL10, 0), + SMSC_DEV(LAN9505A_SAL10, 0), + SMSC_DEV(LAN9514_SAL10, 0), + SMSC_DEV(LAN9500A_HAL, 0), + SMSC_DEV(LAN9505A_HAL, 0), #undef SMSC_DEV }; Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Sep 26 08:12:12 2014 (r272159) +++ head/sys/dev/usb/usbdevs Fri Sep 26 08:16:26 2014 (r272160) @@ -4135,6 +4135,23 @@ product SMC 2862WG 0xee13 EZ Connect Wi product SMC2 2020HUB 0x2020 USB Hub product SMC2 2514HUB 0x2514 USB Hub product SMC3 2662WUSB 0xa002 2662W-AR Wireless +product SMC2 LAN9500_ETH 0x9500 USB/Ethernet +product SMC2 LAN9505_ETH 0x9505 USB/Ethernet +product SMC2 LAN9530_ETH 0x9530 USB/Ethernet +product SMC2 LAN9730_ETH 0x9730 USB/Ethernet +product SMC2 LAN9500_SAL10 0x9900 USB/Ethernet +product SMC2 LAN9505_SAL10 0x9901 USB/Ethernet +product SMC2 LAN9500A_SAL10 0x9902 USB/Ethernet +product SMC2 LAN9505A_SAL10 0x9903 USB/Ethernet +product SMC2 LAN9514_SAL10 0x9904 USB/Ethernet +product SMC2 LAN9500A_HAL 0x9905 USB/Ethernet +product SMC2 LAN9505A_HAL 0x9906 USB/Ethernet +product SMC2 LAN9500_ETH_2 0x9907 USB/Ethernet +product SMC2 LAN9500A_ETH_2 0x9908 USB/Ethernet +product SMC2 LAN9514_ETH_2 0x9909 USB/Ethernet +product SMC2 LAN9500A_ETH 0x9e00 USB/Ethernet +product SMC2 LAN9505A_ETH 0x9e01 USB/Ethernet +product SMC2 LAN89530_ETH 0x9e08 USB/Ethernet product SMC2 LAN9514_ETH 0xec00 USB/Ethernet /* SOHOware products */ From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 08:42:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D4A269F; Fri, 26 Sep 2014 08:42:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D578347; Fri, 26 Sep 2014 08:42:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q8gYKN031813; Fri, 26 Sep 2014 08:42:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q8gXWZ031807; Fri, 26 Sep 2014 08:42:33 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409260842.s8Q8gXWZ031807@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 26 Sep 2014 08:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272161 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 08:42:34 -0000 Author: glebius Date: Fri Sep 26 08:42:32 2014 New Revision: 272161 URL: http://svnweb.freebsd.org/changeset/base/272161 Log: - When reconfiguring protocol on a lagg, first set it to LAGG_PROTO_NONE, then drop lock, run the attach routines, and then set it to specific proto. This removes tons of WITNESS warnings. - Make lagg protocol attach handlers not failing and allocate memory with M_WAITOK. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/ieee8023ad_lacp.c head/sys/net/ieee8023ad_lacp.h head/sys/net/if_lagg.c Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Fri Sep 26 08:16:26 2014 (r272160) +++ head/sys/net/ieee8023ad_lacp.c Fri Sep 26 08:42:32 2014 (r272161) @@ -783,16 +783,13 @@ lacp_attach_sysctl_debug(struct lacp_sof "Bitmap of if_dunit entries to drop TX frames for"); } -int +void lacp_attach(struct lagg_softc *sc) { struct lacp_softc *lsc; struct sysctl_oid *oid; - lsc = malloc(sizeof(struct lacp_softc), - M_DEVBUF, M_NOWAIT|M_ZERO); - if (lsc == NULL) - return (ENOMEM); + lsc = malloc(sizeof(struct lacp_softc), M_DEVBUF, M_WAITOK | M_ZERO); sc->sc_psc = (caddr_t)lsc; lsc->lsc_softc = sc; @@ -818,21 +815,18 @@ lacp_attach(struct lagg_softc *sc) /* if the lagg is already up then do the same */ if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) lacp_init(sc); - - return (0); } void -lacp_detach(struct lagg_softc *sc) +lacp_detach(void *psc) { - struct lacp_softc *lsc = LACP_SOFTC(sc); + struct lacp_softc *lsc = (struct lacp_softc *)psc; KASSERT(TAILQ_EMPTY(&lsc->lsc_aggregators), ("aggregators still active")); KASSERT(lsc->lsc_active_aggregator == NULL, ("aggregator still attached")); - sc->sc_psc = NULL; callout_drain(&lsc->lsc_transit_callout); callout_drain(&lsc->lsc_callout); Modified: head/sys/net/ieee8023ad_lacp.h ============================================================================== --- head/sys/net/ieee8023ad_lacp.h Fri Sep 26 08:16:26 2014 (r272160) +++ head/sys/net/ieee8023ad_lacp.h Fri Sep 26 08:42:32 2014 (r272161) @@ -282,8 +282,8 @@ struct lacp_softc { struct mbuf *lacp_input(struct lagg_port *, struct mbuf *); struct lagg_port *lacp_select_tx_port(struct lagg_softc *, struct mbuf *); -int lacp_attach(struct lagg_softc *); -void lacp_detach(struct lagg_softc *); +void lacp_attach(struct lagg_softc *); +void lacp_detach(void *); void lacp_init(struct lagg_softc *); void lacp_stop(struct lagg_softc *); int lacp_port_create(struct lagg_port *); Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri Sep 26 08:16:26 2014 (r272160) +++ head/sys/net/if_lagg.c Fri Sep 26 08:42:32 2014 (r272161) @@ -125,19 +125,19 @@ static const void *lagg_gethdr(struct mb static int lagg_sysctl_active(SYSCTL_HANDLER_ARGS); /* Simple round robin */ -static int lagg_rr_attach(struct lagg_softc *); +static void lagg_rr_attach(struct lagg_softc *); static int lagg_rr_start(struct lagg_softc *, struct mbuf *); static struct mbuf *lagg_rr_input(struct lagg_softc *, struct lagg_port *, struct mbuf *); /* Active failover */ -static int lagg_fail_attach(struct lagg_softc *); +static void lagg_fail_attach(struct lagg_softc *); static int lagg_fail_start(struct lagg_softc *, struct mbuf *); static struct mbuf *lagg_fail_input(struct lagg_softc *, struct lagg_port *, struct mbuf *); /* Loadbalancing */ -static int lagg_lb_attach(struct lagg_softc *); +static void lagg_lb_attach(struct lagg_softc *); static void lagg_lb_detach(struct lagg_softc *); static int lagg_lb_port_create(struct lagg_port *); static void lagg_lb_port_destroy(struct lagg_port *); @@ -147,13 +147,13 @@ static struct mbuf *lagg_lb_input(struct static int lagg_lb_porttable(struct lagg_softc *, struct lagg_port *); /* Broadcast */ -static int lagg_bcast_attach(struct lagg_softc *); +static void lagg_bcast_attach(struct lagg_softc *); static int lagg_bcast_start(struct lagg_softc *, struct mbuf *); static struct mbuf *lagg_bcast_input(struct lagg_softc *, struct lagg_port *, struct mbuf *); /* 802.3ad LACP */ -static int lagg_lacp_attach(struct lagg_softc *); +static void lagg_lacp_attach(struct lagg_softc *); static void lagg_lacp_detach(struct lagg_softc *); static int lagg_lacp_start(struct lagg_softc *, struct mbuf *); static struct mbuf *lagg_lacp_input(struct lagg_softc *, struct lagg_port *, @@ -163,16 +163,16 @@ static void lagg_lacp_lladdr(struct lagg static void lagg_callout(void *); /* lagg protocol table */ -static const struct { - int ti_proto; - int (*ti_attach)(struct lagg_softc *); +static const struct lagg_proto { + lagg_proto ti_proto; + void (*ti_attach)(struct lagg_softc *); } lagg_protos[] = { { LAGG_PROTO_ROUNDROBIN, lagg_rr_attach }, - { LAGG_PROTO_FAILOVER, lagg_fail_attach }, + { LAGG_PROTO_FAILOVER, lagg_fail_attach }, { LAGG_PROTO_LOADBALANCE, lagg_lb_attach }, { LAGG_PROTO_ETHERCHANNEL, lagg_lb_attach }, { LAGG_PROTO_LACP, lagg_lacp_attach }, - { LAGG_PROTO_BROADCAST, lagg_bcast_attach }, + { LAGG_PROTO_BROADCAST, lagg_bcast_attach }, { LAGG_PROTO_NONE, NULL } }; @@ -281,10 +281,10 @@ lagg_clone_create(struct if_clone *ifc, { struct lagg_softc *sc; struct ifnet *ifp; - int i, error = 0; static const u_char eaddr[6]; /* 00:00:00:00:00:00 */ struct sysctl_oid *oid; char num[14]; /* sufficient for 32 bits */ + int i; sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO); ifp = sc->sc_ifp = if_alloc(IFT_ETHER); @@ -328,11 +328,7 @@ lagg_clone_create(struct if_clone *ifc, for (i = 0; lagg_protos[i].ti_proto != LAGG_PROTO_NONE; i++) { if (lagg_protos[i].ti_proto == LAGG_PROTO_DEFAULT) { sc->sc_proto = lagg_protos[i].ti_proto; - if ((error = lagg_protos[i].ti_attach(sc)) != 0) { - if_free(ifp); - free(sc, M_DEVBUF); - return (error); - } + lagg_protos[i].ti_attach(sc); break; } } @@ -403,8 +399,8 @@ lagg_clone_destroy(struct ifnet *ifp) /* Unhook the aggregation protocol */ if (sc->sc_detach != NULL) (*sc->sc_detach)(sc); - - LAGG_WUNLOCK(sc); + else + LAGG_WUNLOCK(sc); sysctl_ctx_free(&sc->ctx); ifmedia_removeall(&sc->sc_media); @@ -984,6 +980,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd struct lagg_reqflags *rf = (struct lagg_reqflags *)data; struct ifreq *ifr = (struct ifreq *)data; struct lagg_port *lp; + const struct lagg_proto *proto; struct ifnet *tpif; struct thread *td = curthread; char *buf, *outbuf; @@ -1031,51 +1028,32 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd error = priv_check(td, PRIV_NET_LAGG); if (error) break; - if (ra->ra_proto >= LAGG_PROTO_MAX) { + for (proto = lagg_protos; proto->ti_proto != LAGG_PROTO_NONE; + proto++) { + if (proto->ti_proto == ra->ra_proto) { + if (sc->sc_ifflags & IFF_DEBUG) + printf("%s: using proto %u\n", + sc->sc_ifname, proto->ti_proto); + break; + } + } + if (proto->ti_proto == LAGG_PROTO_NONE) { error = EPROTONOSUPPORT; break; } + /* Set to LAGG_PROTO_NONE during the attach. */ LAGG_WLOCK(sc); if (sc->sc_proto != LAGG_PROTO_NONE) { - /* Reset protocol first in case detach unlocks */ sc->sc_proto = LAGG_PROTO_NONE; if (sc->sc_detach != NULL) sc->sc_detach(sc); - sc->sc_detach = NULL; - sc->sc_start = NULL; - sc->sc_input = NULL; - sc->sc_port_create = NULL; - sc->sc_port_destroy = NULL; - sc->sc_linkstate = NULL; - sc->sc_init = NULL; - sc->sc_stop = NULL; - sc->sc_lladdr = NULL; - sc->sc_req = NULL; - sc->sc_portreq = NULL; - } else if (sc->sc_input != NULL) { - /* Still detaching */ - error = EBUSY; - } - if (error != 0) { - LAGG_WUNLOCK(sc); - break; - } - for (int i = 0; i < (sizeof(lagg_protos) / - sizeof(lagg_protos[0])); i++) { - if (lagg_protos[i].ti_proto == ra->ra_proto) { - if (sc->sc_ifflags & IFF_DEBUG) - printf("%s: using proto %u\n", - sc->sc_ifname, - lagg_protos[i].ti_proto); - sc->sc_proto = lagg_protos[i].ti_proto; - if (sc->sc_proto != LAGG_PROTO_NONE) - error = lagg_protos[i].ti_attach(sc); + else LAGG_WUNLOCK(sc); - return (error); - } } + proto->ti_attach(sc); + LAGG_WLOCK(sc); + sc->sc_proto = proto->ti_proto; LAGG_WUNLOCK(sc); - error = EPROTONOSUPPORT; break; case SIOCGLAGGFLAGS: rf->rf_flags = sc->sc_flags; @@ -1668,8 +1646,7 @@ lagg_enqueue(struct ifnet *ifp, struct m /* * Simple round robin aggregation */ - -static int +static void lagg_rr_attach(struct lagg_softc *sc) { sc->sc_start = lagg_rr_start; @@ -1678,8 +1655,6 @@ lagg_rr_attach(struct lagg_softc *sc) sc->sc_port_create = NULL; sc->sc_capabilities = IFCAP_LAGG_FULLDUPLEX; sc->sc_seq = 0; - - return (0); } static int @@ -1721,8 +1696,7 @@ lagg_rr_input(struct lagg_softc *sc, str /* * Broadcast mode */ - -static int +static void lagg_bcast_attach(struct lagg_softc *sc) { sc->sc_start = lagg_bcast_start; @@ -1733,8 +1707,6 @@ lagg_bcast_attach(struct lagg_softc *sc) sc->sc_detach = NULL; sc->sc_req = NULL; sc->sc_portreq = NULL; - - return (0); } static int @@ -1800,8 +1772,7 @@ lagg_bcast_input(struct lagg_softc *sc, /* * Active failover */ - -static int +static void lagg_fail_attach(struct lagg_softc *sc) { sc->sc_start = lagg_fail_start; @@ -1809,8 +1780,6 @@ lagg_fail_attach(struct lagg_softc *sc) sc->sc_port_create = NULL; sc->sc_port_destroy = NULL; sc->sc_detach = NULL; - - return (0); } static int @@ -1858,16 +1827,13 @@ lagg_fail_input(struct lagg_softc *sc, s /* * Loadbalancing */ - -static int +static void lagg_lb_attach(struct lagg_softc *sc) { struct lagg_port *lp; struct lagg_lb *lb; - if ((lb = (struct lagg_lb *)malloc(sizeof(struct lagg_lb), - M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL) - return (ENOMEM); + lb = malloc(sizeof(struct lagg_lb), M_DEVBUF, M_WAITOK | M_ZERO); sc->sc_detach = lagg_lb_detach; sc->sc_start = lagg_lb_start; @@ -1881,8 +1847,6 @@ lagg_lb_attach(struct lagg_softc *sc) SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) lagg_lb_port_create(lp); - - return (0); } static void @@ -1891,6 +1855,7 @@ lagg_lb_detach(struct lagg_softc *sc) struct lagg_lb *lb; lb = (struct lagg_lb *)sc->sc_psc; + LAGG_WUNLOCK(sc); if (lb != NULL) free(lb, M_DEVBUF); } @@ -1972,12 +1937,10 @@ lagg_lb_input(struct lagg_softc *sc, str /* * 802.3ad LACP */ - -static int +static void lagg_lacp_attach(struct lagg_softc *sc) { struct lagg_port *lp; - int error; sc->sc_detach = lagg_lacp_detach; sc->sc_port_create = lacp_port_create; @@ -1991,28 +1954,26 @@ lagg_lacp_attach(struct lagg_softc *sc) sc->sc_req = lacp_req; sc->sc_portreq = lacp_portreq; - error = lacp_attach(sc); - if (error) - return (error); + lacp_attach(sc); SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) lacp_port_create(lp); - - return (error); } static void lagg_lacp_detach(struct lagg_softc *sc) { struct lagg_port *lp; + void *psc; SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) lacp_port_destroy(lp); - /* unlocking is safe here */ + psc = sc->sc_psc; + sc->sc_psc = NULL; LAGG_WUNLOCK(sc); - lacp_detach(sc); - LAGG_WLOCK(sc); + + lacp_detach(psc); } static void From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 09:05:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EEA9D69; Fri, 26 Sep 2014 09:05:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0ABC07ED; Fri, 26 Sep 2014 09:05:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q95tOQ041960; Fri, 26 Sep 2014 09:05:55 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q95tjP041959; Fri, 26 Sep 2014 09:05:55 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409260905.s8Q95tjP041959@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Fri, 26 Sep 2014 09:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272162 - head/sys/x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 09:05:56 -0000 Author: royger Date: Fri Sep 26 09:05:55 2014 New Revision: 272162 URL: http://svnweb.freebsd.org/changeset/base/272162 Log: xen: add proper copyright attribution Noted by: jmallett Modified: head/sys/x86/xen/pv.c Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Fri Sep 26 08:42:32 2014 (r272161) +++ head/sys/x86/xen/pv.c Fri Sep 26 09:05:55 2014 (r272162) @@ -1,6 +1,7 @@ /* * Copyright (c) 2004 Christian Limpach. * Copyright (c) 2004-2006,2008 Kip Macy + * Copyright (c) 2008 The NetBSD Foundation, Inc. * Copyright (c) 2013 Roger Pau Monné * All rights reserved. * From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 09:07:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6D9CA3; Fri, 26 Sep 2014 09:07:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7D9481C; Fri, 26 Sep 2014 09:07:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q974re043040; Fri, 26 Sep 2014 09:07:04 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q973rv043031; Fri, 26 Sep 2014 09:07:03 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201409260907.s8Q973rv043031@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 26 Sep 2014 09:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272163 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 09:07:05 -0000 Author: kevlo Date: Fri Sep 26 09:07:02 2014 New Revision: 272163 URL: http://svnweb.freebsd.org/changeset/base/272163 Log: Fix typos. Modified: head/sys/arm/at91/at91rm92reg.h head/sys/arm/at91/at91sam9260reg.h head/sys/arm/at91/at91sam9g20reg.h head/sys/arm/at91/at91sam9g45reg.h head/sys/arm/at91/at91sam9x5reg.h Modified: head/sys/arm/at91/at91rm92reg.h ============================================================================== --- head/sys/arm/at91/at91rm92reg.h Fri Sep 26 09:05:55 2014 (r272162) +++ head/sys/arm/at91/at91rm92reg.h Fri Sep 26 09:07:02 2014 (r272163) @@ -124,7 +124,7 @@ * 9: USART 3 * 10: MMC Interface * 11: USB device port - * 12: Two-wirte interface + * 12: Two-wire interface * 13: SPI * 14: SSC * 15: SSC @@ -134,7 +134,7 @@ * 19: Timer Counter 2 * 20: Timer Counter 3 * 21: Timer Counter 4 - * 22: Timer Counter 6 + * 22: Timer Counter 5 * 23: USB Host port * 24: Ethernet * 25: AIC Modified: head/sys/arm/at91/at91sam9260reg.h ============================================================================== --- head/sys/arm/at91/at91sam9260reg.h Fri Sep 26 09:05:55 2014 (r272162) +++ head/sys/arm/at91/at91sam9260reg.h Fri Sep 26 09:07:02 2014 (r272163) @@ -164,7 +164,7 @@ * 8: USART 2 * 9: MMC Interface * 10: USB device port - * 11: Two-wirte interface + * 11: Two-wire interface * 12: SPI 0 * 13: SPI 1 * 14: SSC Modified: head/sys/arm/at91/at91sam9g20reg.h ============================================================================== --- head/sys/arm/at91/at91sam9g20reg.h Fri Sep 26 09:05:55 2014 (r272162) +++ head/sys/arm/at91/at91sam9g20reg.h Fri Sep 26 09:07:02 2014 (r272163) @@ -165,7 +165,7 @@ * 8: USART 2 * 9: MMC Interface * 10: USB device port - * 11: Two-wirte interface + * 11: Two-wire interface * 12: SPI 0 * 13: SPI 1 * 14: SSC Modified: head/sys/arm/at91/at91sam9g45reg.h ============================================================================== --- head/sys/arm/at91/at91sam9g45reg.h Fri Sep 26 09:05:55 2014 (r272162) +++ head/sys/arm/at91/at91sam9g45reg.h Fri Sep 26 09:07:02 2014 (r272163) @@ -142,13 +142,13 @@ * 9: USART 2 * 10: USART 3 * 11: Multimedia Card interface 0 - * 12: Two-wirte interface 0 - * 13: Two-wirte interface 1 + * 12: Two-wire interface 0 + * 13: Two-wire interface 1 * 14: SPI 0 * 15: SPI 1 * 16: SSC 0 - * 17: SSC 0 - * 18: Timer Counter 0, 2, 3, 4, 5 + * 17: SSC 1 + * 18: Timer Counter 0, 1, 2, 3, 4, 5 * 19: PWM * 20: Touch Screen ADC * 21: DMA Modified: head/sys/arm/at91/at91sam9x5reg.h ============================================================================== --- head/sys/arm/at91/at91sam9x5reg.h Fri Sep 26 09:05:55 2014 (r272162) +++ head/sys/arm/at91/at91sam9x5reg.h Fri Sep 26 09:07:02 2014 (r272163) @@ -151,9 +151,9 @@ * 6: USART 1 * 7: USART 2 * 8: USART 3 - * 9: Two-wirte interface - * 10: Two-wirte interface - * 11: Two-wirte interface + * 9: Two-wire interface + * 10: Two-wire interface + * 11: Two-wire interface * 12: HSMCI Interface * 13: SPI 0 * 14: SPI 1 From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 09:08:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FB84203; Fri, 26 Sep 2014 09:08:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B304829; Fri, 26 Sep 2014 09:08:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q98A1s043234; Fri, 26 Sep 2014 09:08:10 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q98Arg043233; Fri, 26 Sep 2014 09:08:10 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201409260908.s8Q98Arg043233@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 26 Sep 2014 09:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272164 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 09:08:10 -0000 Author: kevlo Date: Fri Sep 26 09:08:09 2014 New Revision: 272164 URL: http://svnweb.freebsd.org/changeset/base/272164 Log: Fix the size of AT91SAM9260_PIT_SIZE. Modified: head/sys/arm/at91/at91sam9260reg.h Modified: head/sys/arm/at91/at91sam9260reg.h ============================================================================== --- head/sys/arm/at91/at91sam9260reg.h Fri Sep 26 09:07:02 2014 (r272163) +++ head/sys/arm/at91/at91sam9260reg.h Fri Sep 26 09:08:09 2014 (r272164) @@ -231,7 +231,7 @@ #define AT91SAM9260_WDT_SIZE 0x10 #define AT91SAM9260_PIT_BASE 0xffffd30 -#define AT91SAM9260_PIT_SIZE 10 +#define AT91SAM9260_PIT_SIZE 0x10 #define AT91SAM9260_SMC_BASE 0xfffec00 #define AT91SAM9260_SMC_SIZE 0x200 From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 09:19:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 959D5584; Fri, 26 Sep 2014 09:19:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80AB392C; Fri, 26 Sep 2014 09:19:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q9JCRT048897; Fri, 26 Sep 2014 09:19:12 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q9JCAE048895; Fri, 26 Sep 2014 09:19:12 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201409260919.s8Q9JCAE048895@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Fri, 26 Sep 2014 09:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272165 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 09:19:12 -0000 Author: gavin Date: Fri Sep 26 09:19:11 2014 New Revision: 272165 URL: http://svnweb.freebsd.org/changeset/base/272165 Log: Add very basic outline man page for smsc(4). MFC after: 6 days Added: head/share/man/man4/smsc.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Sep 26 09:08:09 2014 (r272164) +++ head/share/man/man4/Makefile Fri Sep 26 09:19:11 2014 (r272165) @@ -439,6 +439,7 @@ MAN= aac.4 \ smb.4 \ smbus.4 \ smp.4 \ + smsc.4 \ sn.4 \ snd_ad1816.4 \ snd_als4000.4 \ Added: head/share/man/man4/smsc.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/smsc.4 Fri Sep 26 09:19:11 2014 (r272165) @@ -0,0 +1,89 @@ +.\" Copyright (c) 2014 Gavin Atkinson +.\" 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. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 26, 2014 +.Dt SMSC 4 +.Os +.Sh NAME +.Nm smsc +.Nd "USB SMSC LAN9xxx Fast Ethernet driver" +.Sh SYNOPSIS +To load the driver as a module at boot time, place the +following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_smsc_load="YES" +.Ed +.Pp +Alternatively, to compile this driver into the kernel, place the +following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device uhci" +.Cd "device ohci" +.Cd "device usb" +.Cd "device smsc" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for USB Fast Ethernet adapters based +on the SMSC LAN9xxx chipsets. +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The following devices are supported by the +.Nm +driver: +.Pp +.Bl -bullet -compact +.It +SMSC LAN9500, LAN9500A, LAN9505 and LAN9505A based Ethernet adapters +.It +SMSC LAN89530, LAN9530 and LAN9730 based Ethernet adapters +.It +SMSC LAN951x Ethernet adapters with integrated USB hub +.El +.Sh SEE ALSO +.Xr arp 4 , +.Xr intro 4 , +.Xr netintro 4 , +.Xr usb 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Ben Gray Aq Mt bgray@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 09:40:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17DFCC2A; Fri, 26 Sep 2014 09:40:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01AF5C30; Fri, 26 Sep 2014 09:40:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q9enDT061403; Fri, 26 Sep 2014 09:40:49 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q9emgu061397; Fri, 26 Sep 2014 09:40:48 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201409260940.s8Q9emgu061397@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Fri, 26 Sep 2014 09:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272166 - in head/games: factor primes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 09:40:50 -0000 Author: cperciva Date: Fri Sep 26 09:40:48 2014 New Revision: 272166 URL: http://svnweb.freebsd.org/changeset/base/272166 Log: Correctly enumerate primes between 4295098369 and 3825123056546413050. Prior to this commit, primes(6) relied solely on sieving with primes up to 65537, with the effect that composite numbers which are the product of two non-16-bit primes would be incorrectly identified as prime. For example, # primes 1099511627800 1099511627820 would output 1099511627803 1099511627807 1099511627813 when in fact only the first of those values is prime. This commit adds strong pseudoprime tests to validate the candidates which pass the initial sieving stage, using bases of 2, 3, 5, 7, 11, 13, 17, 19, and 23. Thanks to papers from C. Pomerance, J.L. Selfridge, and S.S. Wagstaff, Jr.; G. Jaeschke; and Y. Jiang and Y. Deng, we know that the smallest value which passes these tests is 3825123056546413051. At present we do not know how many strong pseudoprime tests are required to prove primality for values larger than 3825123056546413050, so we force primes(6) to stop at that point. Reviewed by: jmg Relnotes: primes(6) now correctly enumerates primes up to 3825123056546413050 MFC after: 7 days Sponsored by: EuroBSDCon devsummit Added: head/games/primes/spsp.c (contents, props changed) Modified: head/games/factor/factor.6 head/games/primes/Makefile head/games/primes/primes.c head/games/primes/primes.h Modified: head/games/factor/factor.6 ============================================================================== --- head/games/factor/factor.6 Fri Sep 26 09:19:11 2014 (r272165) +++ head/games/factor/factor.6 Fri Sep 26 09:40:48 2014 (r272166) @@ -90,7 +90,7 @@ value must not be greater than the maxim The default and maximum value of .Ar stop is 4294967295 on 32-bit architectures -and 18446744073709551615 on 64-bit ones. +and 3825123056546413050 on 64-bit ones. .Pp When the .Nm primes @@ -120,3 +120,9 @@ cannot handle the factor list, .Nm primes will not get you a world record. +.Pp +.Nm primes +is unable to list primes between 3825123056546413050 and 18446744073709551615 +since it relies on strong pseudoprime tests after sieving, and nobody has +proven how many strong pseudoprime tests are required to prove primality for +integers larger than 3825123056546413050. Modified: head/games/primes/Makefile ============================================================================== --- head/games/primes/Makefile Fri Sep 26 09:19:11 2014 (r272165) +++ head/games/primes/Makefile Fri Sep 26 09:40:48 2014 (r272166) @@ -2,7 +2,7 @@ # $FreeBSD$ PROG= primes -SRCS= pattern.c pr_tbl.c primes.c +SRCS= pattern.c pr_tbl.c primes.c spsp.c MAN= DPADD= ${LIBM} LDADD= -lm Modified: head/games/primes/primes.c ============================================================================== --- head/games/primes/primes.c Fri Sep 26 09:19:11 2014 (r272165) +++ head/games/primes/primes.c Fri Sep 26 09:40:48 2014 (r272166) @@ -111,7 +111,7 @@ main(int argc, char *argv[]) argv += optind; start = 0; - stop = BIG; + stop = (sizeof(ubig) > 4) ? SPSPMAX : BIG; /* * Convert low and high args. Strtoul(3) sets errno to @@ -138,6 +138,8 @@ main(int argc, char *argv[]) err(1, "%s", argv[1]); if (*p != '\0') errx(1, "%s: illegal numeric format.", argv[1]); + if ((uint64_t)stop > SPSPMAX) + errx(1, "%s: stop value too large.", argv[1]); break; case 1: /* Start on the command line. */ @@ -304,6 +306,10 @@ primes(ubig start, ubig stop) */ for (q = table; q < tab_lim; ++q, start+=2) { if (*q) { + if ((uint64_t)start > SIEVEMAX) { + if (!isprime(start)) + continue; + } printf(hflag ? "0x%lx\n" : "%lu\n", start); } } Modified: head/games/primes/primes.h ============================================================================== --- head/games/primes/primes.h Fri Sep 26 09:19:11 2014 (r272165) +++ head/games/primes/primes.h Fri Sep 26 09:40:48 2014 (r272166) @@ -57,6 +57,9 @@ typedef unsigned long ubig; /* must be extern const ubig prime[]; extern const ubig *const pr_limit; /* largest prime in the prime array */ +/* Maximum size sieving alone can handle. */ +#define SIEVEMAX 4295098368ULL + /* * To avoid excessive sieves for small factors, we use the table below to * setup our sieve blocks. Each element represents an odd number starting @@ -64,3 +67,9 @@ extern const ubig *const pr_limit; /* la */ extern const char pattern[]; extern const size_t pattern_size; /* length of pattern array */ + +/* Test for primality using strong pseudoprime tests. */ +int isprime(ubig); + +/* Maximum value which the SPSP code can handle. */ +#define SPSPMAX 3825123056546413050ULL Added: head/games/primes/spsp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/primes/spsp.c Fri Sep 26 09:40:48 2014 (r272166) @@ -0,0 +1,181 @@ +/*- + * Copyright (c) 2014 Colin Percival + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include "primes.h" + +/* Return a * b % n, where 0 <= a, b < 2^63, 0 < n < 2^63. */ +static uint64_t +mulmod(uint64_t a, uint64_t b, uint64_t n) +{ + uint64_t x = 0; + + while (b != 0) { + if (b & 1) + x = (x + a) % n; + a = (a + a) % n; + b >>= 1; + } + + return (x); +} + +/* Return a^r % n, where 0 <= a < 2^63, 0 < n < 2^63. */ +static uint64_t +powmod(uint64_t a, uint64_t r, uint64_t n) +{ + uint64_t x = 1; + + while (r != 0) { + if (r & 1) + x = mulmod(a, x, n); + a = mulmod(a, a, n); + r >>= 1; + } + + return (x); +} + +/* Return non-zero if n is a strong pseudoprime to base p. */ +static int +spsp(uint64_t n, uint64_t p) +{ + uint64_t x; + uint64_t r = n - 1; + int k = 0; + + /* Compute n - 1 = 2^k * r. */ + while ((r & 1) == 0) { + k++; + r >>= 1; + } + + /* Compute x = p^r mod n. If x = 1, n is a p-spsp. */ + x = powmod(p, r, n); + if (x == 1) + return (1); + + /* Compute x^(2^i) for 0 <= i < n. If any are -1, n is a p-spsp. */ + while (k > 0) { + if (x == n - 1) + return (1); + x = powmod(x, 2, n); + k--; + } + + /* Not a p-spsp. */ + return (0); +} + +/* Test for primality using strong pseudoprime tests. */ +int +isprime(ubig _n) +{ + uint64_t n = _n; + + /* + * Values from: + * C. Pomerance, J.L. Selfridge, and S.S. Wagstaff, Jr., + * The pseudoprimes to 25 * 10^9, Math. Comp. 35(151):1003-1026, 1980. + */ + + /* No SPSPs to base 2 less than 2047. */ + if (!spsp(n, 2)) + return (0); + if (n < 2047ULL) + return (1); + + /* No SPSPs to bases 2,3 less than 1373653. */ + if (!spsp(n, 3)) + return (0); + if (n < 1373653ULL) + return (1); + + /* No SPSPs to bases 2,3,5 less than 25326001. */ + if (!spsp(n, 5)) + return (0); + if (n < 25326001ULL) + return (1); + + /* No SPSPs to bases 2,3,5,7 less than 3215031751. */ + if (!spsp(n, 7)) + return (0); + if (n < 3215031751ULL) + return (1); + + /* + * Values from: + * G. Jaeschke, On strong pseudoprimes to several bases, + * Math. Comp. 61(204):915-926, 1993. + */ + + /* No SPSPs to bases 2,3,5,7,11 less than 2152302898747. */ + if (!spsp(n, 11)) + return (0); + if (n < 2152302898747ULL) + return (1); + + /* No SPSPs to bases 2,3,5,7,11,13 less than 3474749660383. */ + if (!spsp(n, 13)) + return (0); + if (n < 3474749660383ULL) + return (1); + + /* No SPSPs to bases 2,3,5,7,11,13,17 less than 341550071728321. */ + if (!spsp(n, 17)) + return (0); + if (n < 341550071728321ULL) + return (1); + + /* No SPSPs to bases 2,3,5,7,11,13,17,19 less than 341550071728321. */ + if (!spsp(n, 19)) + return (0); + if (n < 341550071728321ULL) + return (1); + + /* + * Value from: + * Y. Jiang and Y. Deng, Strong pseudoprimes to the first eight prime + * bases, Math. Comp. 83(290):2915-2924, 2014. + */ + + /* No SPSPs to bases 2..23 less than 3825123056546413051. */ + if (!spsp(n, 23)) + return (0); + if (n < 3825123056546413051) + return (1); + + /* We can't handle values larger than this. */ + assert(n <= SPSPMAX); + + /* UNREACHABLE */ + return (0); +} From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 09:52:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C123BF29; Fri, 26 Sep 2014 09:52:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9275FDA8; Fri, 26 Sep 2014 09:52:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q9qeBN067824; Fri, 26 Sep 2014 09:52:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q9qeJ6067823; Fri, 26 Sep 2014 09:52:40 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201409260952.s8Q9qeJ6067823@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 26 Sep 2014 09:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272167 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 09:52:40 -0000 Author: gjb Date: Fri Sep 26 09:52:39 2014 New Revision: 272167 URL: http://svnweb.freebsd.org/changeset/base/272167 Log: Forced commit to mark the real 10.1-BETA3 point, after r272152. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/conf/newvers.sh Modified: stable/10/sys/conf/newvers.sh ============================================================================== From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 09:54:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68851F9; Fri, 26 Sep 2014 09:54:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5422CDC1; Fri, 26 Sep 2014 09:54:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8Q9swT8068157; Fri, 26 Sep 2014 09:54:58 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8Q9sw1f068156; Fri, 26 Sep 2014 09:54:58 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201409260954.s8Q9sw1f068156@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Fri, 26 Sep 2014 09:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272168 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 09:54:58 -0000 Author: gavin Date: Fri Sep 26 09:54:57 2014 New Revision: 272168 URL: http://svnweb.freebsd.org/changeset/base/272168 Log: Add MLINKS for if_ipheth(4) and if_smsc(4). Submitted by: brueffer MFC after: 6 days Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Sep 26 09:52:39 2014 (r272167) +++ head/share/man/man4/Makefile Fri Sep 26 09:54:57 2014 (r272168) @@ -660,6 +660,7 @@ MLINKS+=ip.4 rawip.4 MLINKS+=ipfirewall.4 ipaccounting.4 \ ipfirewall.4 ipacct.4 \ ipfirewall.4 ipfw.4 +MLINKS+=ipheth.4 if_ipheth.4 MLINKS+=ipw.4 if_ipw.4 MLINKS+=iwi.4 if_iwi.4 MLINKS+=iwn.4 if_iwn.4 @@ -714,6 +715,7 @@ MLINKS+=sge.4 if_sge.4 MLINKS+=sis.4 if_sis.4 MLINKS+=sk.4 if_sk.4 MLINKS+=smp.4 SMP.4 +MLINKS+=smsc.4 if_smsc.4 MLINKS+=sn.4 if_sn.4 MLINKS+=snd_envy24.4 snd_ak452x.4 MLINKS+=snd_sbc.4 snd_sb16.4 \ From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 10:47:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11D18E2F; Fri, 26 Sep 2014 10:47:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0949654; Fri, 26 Sep 2014 10:47:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QAlvuV092242; Fri, 26 Sep 2014 10:47:57 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QAlvNG092241; Fri, 26 Sep 2014 10:47:57 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409261047.s8QAlvNG092241@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 26 Sep 2014 10:47:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272169 - head/sys/dev/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 10:47:58 -0000 Author: glebius Date: Fri Sep 26 10:47:57 2014 New Revision: 272169 URL: http://svnweb.freebsd.org/changeset/base/272169 Log: - Mechanically convert to if_inc_counter() the rest of counters. - Do not set if_collisions on interrupt, read them in ti_get_counter(). - Add missing bus_dmamap_sync(BUS_DMASYNC_PREREAD) in ti_ioctl2(). [1] Submitted by: mav [1] Modified: head/sys/dev/ti/if_ti.c Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Fri Sep 26 09:54:57 2014 (r272168) +++ head/sys/dev/ti/if_ti.c Fri Sep 26 10:47:57 2014 (r272169) @@ -184,13 +184,13 @@ static int ti_detach(device_t); static void ti_txeof(struct ti_softc *); static void ti_rxeof(struct ti_softc *); -static void ti_stats_update(struct ti_softc *); static int ti_encap(struct ti_softc *, struct mbuf **); static void ti_intr(void *); static void ti_start(struct ifnet *); static void ti_start_locked(struct ifnet *); static int ti_ioctl(struct ifnet *, u_long, caddr_t); +static uint64_t ti_get_counter(struct ifnet *, ift_counter); static void ti_init(void *); static void ti_init_locked(void *); static void ti_init2(struct ti_softc *); @@ -959,8 +959,6 @@ ti_handle_events(struct ti_softc *sc) ti_init2(sc); break; case TI_EV_STATS_UPDATED: - ti_stats_update(sc); - break; case TI_EV_RESET_JUMBO_RING: case TI_EV_MCAST_UPDATED: /* Who cares. */ @@ -2505,6 +2503,7 @@ ti_attach(device_t dev) ifp->if_ioctl = ti_ioctl; ifp->if_start = ti_start; ifp->if_init = ti_init; + ifp->if_get_counter = ti_get_counter; ifp->if_baudrate = IF_Gbps(1UL); ifp->if_snd.ifq_drv_maxlen = TI_TX_RING_CNT - 1; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); @@ -2803,12 +2802,12 @@ ti_rxeof(struct ti_softc *sc) m = sc->ti_cdata.ti_rx_jumbo_chain[rxidx]; #ifndef TI_SF_BUF_JUMBO if (cur_rx->ti_flags & TI_BDFLAG_ERROR) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); ti_discard_jumbo(sc, rxidx); continue; } if (ti_newbuf_jumbo(sc, rxidx, NULL) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); ti_discard_jumbo(sc, rxidx); continue; } @@ -2820,12 +2819,12 @@ ti_rxeof(struct ti_softc *sc) BUS_DMASYNC_POSTREAD); bus_dmamap_unload(sc->ti_cdata.ti_rx_jumbo_tag, map); if (cur_rx->ti_flags & TI_BDFLAG_ERROR) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); ti_newbuf_jumbo(sc, sc->ti_jumbo, m); continue; } if (ti_newbuf_jumbo(sc, sc->ti_jumbo, NULL) == ENOBUFS) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); ti_newbuf_jumbo(sc, sc->ti_jumbo, m); continue; } @@ -2842,12 +2841,12 @@ ti_rxeof(struct ti_softc *sc) TI_INC(sc->ti_mini, TI_MINI_RX_RING_CNT); m = sc->ti_cdata.ti_rx_mini_chain[rxidx]; if (cur_rx->ti_flags & TI_BDFLAG_ERROR) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); ti_discard_mini(sc, rxidx); continue; } if (ti_newbuf_mini(sc, rxidx) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); ti_discard_mini(sc, rxidx); continue; } @@ -2857,12 +2856,12 @@ ti_rxeof(struct ti_softc *sc) TI_INC(sc->ti_std, TI_STD_RX_RING_CNT); m = sc->ti_cdata.ti_rx_std_chain[rxidx]; if (cur_rx->ti_flags & TI_BDFLAG_ERROR) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); ti_discard_std(sc, rxidx); continue; } if (ti_newbuf_std(sc, rxidx) != 0) { - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); ti_discard_std(sc, rxidx); continue; } @@ -2870,7 +2869,7 @@ ti_rxeof(struct ti_softc *sc) } m->m_pkthdr.len = ti_len; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = ifp; if (ifp->if_capenable & IFCAP_RXCSUM) { @@ -2961,7 +2960,7 @@ ti_txeof(struct ti_softc *sc) BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->ti_cdata.ti_tx_tag, txd->tx_dmamap); - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); m_freem(txd->tx_m); txd->tx_m = NULL; STAILQ_REMOVE_HEAD(&sc->ti_cdata.ti_txbusyq, tx_q); @@ -3016,27 +3015,35 @@ ti_intr(void *xsc) TI_UNLOCK(sc); } -static void -ti_stats_update(struct ti_softc *sc) +static uint64_t +ti_get_counter(struct ifnet *ifp, ift_counter cnt) { - struct ifnet *ifp; - struct ti_stats *s; - - ifp = sc->ti_ifp; - if (sc->ti_stat_ticks == 0) - return; - bus_dmamap_sync(sc->ti_cdata.ti_gib_tag, sc->ti_cdata.ti_gib_map, - BUS_DMASYNC_POSTREAD); + switch (cnt) { + case IFCOUNTER_COLLISIONS: + { + struct ti_softc *sc; + struct ti_stats *s; + uint64_t rv; - s = &sc->ti_rdata.ti_info->ti_stats; - ifp->if_collisions += (s->dot3StatsSingleCollisionFrames + - s->dot3StatsMultipleCollisionFrames + - s->dot3StatsExcessiveCollisions + s->dot3StatsLateCollisions) - - ifp->if_collisions; + sc = if_getsoftc(ifp); + s = &sc->ti_rdata.ti_info->ti_stats; - bus_dmamap_sync(sc->ti_cdata.ti_gib_tag, sc->ti_cdata.ti_gib_map, - BUS_DMASYNC_PREREAD); + TI_LOCK(sc); + bus_dmamap_sync(sc->ti_cdata.ti_gib_tag, + sc->ti_cdata.ti_gib_map, BUS_DMASYNC_POSTREAD); + rv = s->dot3StatsSingleCollisionFrames + + s->dot3StatsMultipleCollisionFrames + + s->dot3StatsExcessiveCollisions + + s->dot3StatsLateCollisions; + bus_dmamap_sync(sc->ti_cdata.ti_gib_tag, + sc->ti_cdata.ti_gib_map, BUS_DMASYNC_PREREAD); + TI_UNLOCK(sc); + return (rv); + } + default: + return (if_get_counter_default(ifp, cnt)); + } } /* @@ -3662,6 +3669,8 @@ ti_ioctl2(struct cdev *dev, u_long cmd, sc->ti_cdata.ti_gib_map, BUS_DMASYNC_POSTREAD); bcopy(&sc->ti_rdata.ti_info->ti_stats, outstats, sizeof(struct ti_stats)); + bus_dmamap_sync(sc->ti_cdata.ti_gib_tag, + sc->ti_cdata.ti_gib_map, BUS_DMASYNC_PREREAD); TI_UNLOCK(sc); break; } @@ -3917,7 +3926,7 @@ ti_watchdog(void *arg) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ti_init_locked(sc); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } /* From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 11:01:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87C74179; Fri, 26 Sep 2014 11:01:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B538852; Fri, 26 Sep 2014 11:01:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QB1545098956; Fri, 26 Sep 2014 11:01:05 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QB14O0098954; Fri, 26 Sep 2014 11:01:04 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409261101.s8QB14O0098954@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 26 Sep 2014 11:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272170 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 11:01:05 -0000 Author: glebius Date: Fri Sep 26 11:01:04 2014 New Revision: 272170 URL: http://svnweb.freebsd.org/changeset/base/272170 Log: - Provide lagg_proto_attach(), lagg_proto_detach(). - Make detach a protocol method in lagg_protos. - Simplify code to lookup protocols. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri Sep 26 10:47:57 2014 (r272169) +++ head/sys/net/if_lagg.c Fri Sep 26 11:01:04 2014 (r272170) @@ -164,16 +164,39 @@ static void lagg_callout(void *); /* lagg protocol table */ static const struct lagg_proto { - lagg_proto ti_proto; - void (*ti_attach)(struct lagg_softc *); + lagg_proto pr_num; + void (*pr_attach)(struct lagg_softc *); + void (*pr_detach)(struct lagg_softc *); } lagg_protos[] = { - { LAGG_PROTO_ROUNDROBIN, lagg_rr_attach }, - { LAGG_PROTO_FAILOVER, lagg_fail_attach }, - { LAGG_PROTO_LOADBALANCE, lagg_lb_attach }, - { LAGG_PROTO_ETHERCHANNEL, lagg_lb_attach }, - { LAGG_PROTO_LACP, lagg_lacp_attach }, - { LAGG_PROTO_BROADCAST, lagg_bcast_attach }, - { LAGG_PROTO_NONE, NULL } + { + .pr_num = LAGG_PROTO_NONE + }, + { + .pr_num = LAGG_PROTO_ROUNDROBIN, + .pr_attach = lagg_rr_attach, + }, + { + .pr_num = LAGG_PROTO_FAILOVER, + .pr_attach = lagg_fail_attach, + }, + { + .pr_num = LAGG_PROTO_LOADBALANCE, + .pr_attach = lagg_lb_attach, + .pr_detach = lagg_lb_detach, + }, + { + .pr_num = LAGG_PROTO_LACP, + .pr_attach = lagg_lacp_attach, + .pr_detach = lagg_lacp_detach, + }, + { + .pr_num = LAGG_PROTO_ETHERCHANNEL, + .pr_attach = lagg_lb_attach, + }, + { + .pr_num = LAGG_PROTO_BROADCAST, + .pr_attach = lagg_bcast_attach, + }, }; SYSCTL_DECL(_net_link); @@ -232,6 +255,36 @@ static moduledata_t lagg_mod = { DECLARE_MODULE(if_lagg, lagg_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); MODULE_VERSION(if_lagg, 1); +static void +lagg_proto_attach(struct lagg_softc *sc, lagg_proto pr) +{ + + KASSERT(sc->sc_proto == LAGG_PROTO_NONE, ("%s: sc %p has proto", + __func__, sc)); + + if (sc->sc_ifflags & IFF_DEBUG) + if_printf(sc->sc_ifp, "using proto %u\n", pr); + + lagg_protos[pr].pr_attach(sc); + sc->sc_proto = pr; +} + +static void +lagg_proto_detach(struct lagg_softc *sc) +{ + lagg_proto pr; + + LAGG_WLOCK_ASSERT(sc); + + pr = sc->sc_proto; + sc->sc_proto = LAGG_PROTO_NONE; + + if (lagg_protos[pr].pr_detach != NULL) + lagg_protos[pr].pr_detach(sc); + else + LAGG_WUNLOCK(sc); +} + /* * This routine is run via an vlan * config EVENT @@ -284,7 +337,6 @@ lagg_clone_create(struct if_clone *ifc, static const u_char eaddr[6]; /* 00:00:00:00:00:00 */ struct sysctl_oid *oid; char num[14]; /* sufficient for 32 bits */ - int i; sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO); ifp = sc->sc_ifp = if_alloc(IFT_ETHER); @@ -324,14 +376,8 @@ lagg_clone_create(struct if_clone *ifc, /* Hash all layers by default */ sc->sc_flags = LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4; - sc->sc_proto = LAGG_PROTO_NONE; - for (i = 0; lagg_protos[i].ti_proto != LAGG_PROTO_NONE; i++) { - if (lagg_protos[i].ti_proto == LAGG_PROTO_DEFAULT) { - sc->sc_proto = lagg_protos[i].ti_proto; - lagg_protos[i].ti_attach(sc); - break; - } - } + lagg_proto_attach(sc, LAGG_PROTO_DEFAULT); + LAGG_LOCK_INIT(sc); LAGG_CALLOUT_LOCK_INIT(sc); SLIST_INIT(&sc->sc_ports); @@ -397,10 +443,7 @@ lagg_clone_destroy(struct ifnet *ifp) while ((lp = SLIST_FIRST(&sc->sc_ports)) != NULL) lagg_port_destroy(lp, 1); /* Unhook the aggregation protocol */ - if (sc->sc_detach != NULL) - (*sc->sc_detach)(sc); - else - LAGG_WUNLOCK(sc); + lagg_proto_detach(sc); sysctl_ctx_free(&sc->ctx); ifmedia_removeall(&sc->sc_media); @@ -980,7 +1023,6 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd struct lagg_reqflags *rf = (struct lagg_reqflags *)data; struct ifreq *ifr = (struct ifreq *)data; struct lagg_port *lp; - const struct lagg_proto *proto; struct ifnet *tpif; struct thread *td = curthread; char *buf, *outbuf; @@ -1028,32 +1070,14 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd error = priv_check(td, PRIV_NET_LAGG); if (error) break; - for (proto = lagg_protos; proto->ti_proto != LAGG_PROTO_NONE; - proto++) { - if (proto->ti_proto == ra->ra_proto) { - if (sc->sc_ifflags & IFF_DEBUG) - printf("%s: using proto %u\n", - sc->sc_ifname, proto->ti_proto); - break; - } - } - if (proto->ti_proto == LAGG_PROTO_NONE) { + if (ra->ra_proto < 1 || ra->ra_proto >= LAGG_PROTO_MAX) { error = EPROTONOSUPPORT; break; } - /* Set to LAGG_PROTO_NONE during the attach. */ - LAGG_WLOCK(sc); - if (sc->sc_proto != LAGG_PROTO_NONE) { - sc->sc_proto = LAGG_PROTO_NONE; - if (sc->sc_detach != NULL) - sc->sc_detach(sc); - else - LAGG_WUNLOCK(sc); - } - proto->ti_attach(sc); + LAGG_WLOCK(sc); - sc->sc_proto = proto->ti_proto; - LAGG_WUNLOCK(sc); + lagg_proto_detach(sc); + lagg_proto_attach(sc, ra->ra_proto); break; case SIOCGLAGGFLAGS: rf->rf_flags = sc->sc_flags; @@ -1651,7 +1675,6 @@ lagg_rr_attach(struct lagg_softc *sc) { sc->sc_start = lagg_rr_start; sc->sc_input = lagg_rr_input; - sc->sc_detach = NULL;; sc->sc_port_create = NULL; sc->sc_capabilities = IFCAP_LAGG_FULLDUPLEX; sc->sc_seq = 0; @@ -1704,7 +1727,6 @@ lagg_bcast_attach(struct lagg_softc *sc) sc->sc_port_create = NULL; sc->sc_port_destroy = NULL; sc->sc_linkstate = NULL; - sc->sc_detach = NULL; sc->sc_req = NULL; sc->sc_portreq = NULL; } @@ -1779,7 +1801,6 @@ lagg_fail_attach(struct lagg_softc *sc) sc->sc_input = lagg_fail_input; sc->sc_port_create = NULL; sc->sc_port_destroy = NULL; - sc->sc_detach = NULL; } static int @@ -1835,7 +1856,6 @@ lagg_lb_attach(struct lagg_softc *sc) lb = malloc(sizeof(struct lagg_lb), M_DEVBUF, M_WAITOK | M_ZERO); - sc->sc_detach = lagg_lb_detach; sc->sc_start = lagg_lb_start; sc->sc_input = lagg_lb_input; sc->sc_port_create = lagg_lb_port_create; @@ -1942,7 +1962,6 @@ lagg_lacp_attach(struct lagg_softc *sc) { struct lagg_port *lp; - sc->sc_detach = lagg_lacp_detach; sc->sc_port_create = lacp_port_create; sc->sc_port_destroy = lacp_port_destroy; sc->sc_linkstate = lacp_linkstate; Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Fri Sep 26 10:47:57 2014 (r272169) +++ head/sys/net/if_lagg.h Fri Sep 26 11:01:04 2014 (r272170) @@ -218,7 +218,6 @@ struct lagg_softc { the lladdr on */ /* lagg protocol callbacks */ - void (*sc_detach)(struct lagg_softc *); int (*sc_start)(struct lagg_softc *, struct mbuf *); struct mbuf *(*sc_input)(struct lagg_softc *, struct lagg_port *, struct mbuf *); From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 11:13:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A62D954E; Fri, 26 Sep 2014 11:13:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 910729CD; Fri, 26 Sep 2014 11:13:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QBDKg7005992; Fri, 26 Sep 2014 11:13:20 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QBDK4r005990; Fri, 26 Sep 2014 11:13:20 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201409261113.s8QBDK4r005990@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Fri, 26 Sep 2014 11:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272171 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 11:13:20 -0000 Author: pluknet Date: Fri Sep 26 11:13:19 2014 New Revision: 272171 URL: http://svnweb.freebsd.org/changeset/base/272171 Log: Add smsc(4) to the list of drivers use the miibus interface. X-MFC with: r272165 Sponsored by: Nginx, Inc. Modified: head/share/man/man4/miibus.4 head/share/man/man4/smsc.4 Modified: head/share/man/man4/miibus.4 ============================================================================== --- head/share/man/man4/miibus.4 Fri Sep 26 11:01:04 2014 (r272170) +++ head/share/man/man4/miibus.4 Fri Sep 26 11:13:19 2014 (r272171) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2011 +.Dd September 26, 2014 .Dt MIIBUS 4 .Os .Sh NAME @@ -103,6 +103,8 @@ Silicon Integrated Systems SiS190/191 Et Silicon Integrated Systems SiS 900/SiS 7016 .It Xr sk 4 SysKonnect SK-984x and SK-982x Gigabit Ethernet +.It Xr smsc 4 +SMSC LAN9xxx USB Fast Ethernet .It Xr ste 4 Sundance ST201 (D-Link DFE-550TX) .It Xr stge 4 @@ -166,6 +168,7 @@ but as a result are not well behaved new .Xr sge 4 , .Xr sis 4 , .Xr sk 4 , +.Xr smsc 4 , .Xr ste 4 , .Xr stge 4 , .Xr tl 4 , Modified: head/share/man/man4/smsc.4 ============================================================================== --- head/share/man/man4/smsc.4 Fri Sep 26 11:01:04 2014 (r272170) +++ head/share/man/man4/smsc.4 Fri Sep 26 11:13:19 2014 (r272171) @@ -47,6 +47,7 @@ following lines in your kernel configura .Cd "device uhci" .Cd "device ohci" .Cd "device usb" +.Cd "device miibus" .Cd "device smsc" .Ed .Sh DESCRIPTION @@ -73,6 +74,7 @@ SMSC LAN951x Ethernet adapters with inte .Sh SEE ALSO .Xr arp 4 , .Xr intro 4 , +.Xr miibus 4 , .Xr netintro 4 , .Xr usb 4 , .Xr ifconfig 8 From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 11:22:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 458A47D1; Fri, 26 Sep 2014 11:22:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 307CEAE4; Fri, 26 Sep 2014 11:22:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QBMXbV010574; Fri, 26 Sep 2014 11:22:33 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QBMXuh010573; Fri, 26 Sep 2014 11:22:33 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201409261122.s8QBMXuh010573@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Fri, 26 Sep 2014 11:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272172 - head/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 11:22:33 -0000 Author: brueffer Date: Fri Sep 26 11:22:32 2014 New Revision: 272172 URL: http://svnweb.freebsd.org/changeset/base/272172 Log: Add smsc(4) to the hardware notes. Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Sep 26 11:13:19 2014 (r272171) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Sep 26 11:22:32 2014 (r272172) @@ -885,6 +885,8 @@ &hwlist.sk; + &hwlist.smsc; + &hwlist.sn; &hwlist.snc; From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 11:38:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0930133; Fri, 26 Sep 2014 11:38:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BF9FC5B; Fri, 26 Sep 2014 11:38:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QBcBIe016424; Fri, 26 Sep 2014 11:38:11 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QBcBZd016423; Fri, 26 Sep 2014 11:38:11 GMT (envelope-from des@FreeBSD.org) Message-Id: <201409261138.s8QBcBZd016423@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Fri, 26 Sep 2014 11:38:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272173 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 11:38:11 -0000 Author: des Date: Fri Sep 26 11:38:10 2014 New Revision: 272173 URL: http://svnweb.freebsd.org/changeset/base/272173 Log: Add a line to the post-installation configuration dialog to enable the local_unbound service. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/services Modified: head/usr.sbin/bsdinstall/scripts/services ============================================================================== --- head/usr.sbin/bsdinstall/scripts/services Fri Sep 26 11:22:32 2014 (r272172) +++ head/usr.sbin/bsdinstall/scripts/services Fri Sep 26 11:38:10 2014 (r272173) @@ -43,6 +43,7 @@ DAEMONS=$( dialog --backtitle "FreeBSD I --title "System Configuration" --nocancel --separate-output \ --checklist "Choose the services you would like to be started at boot:" \ 0 0 0 \ + local_unbound "Local caching validating resolver" ${local_unbound:-off} \ sshd "Secure shell daemon" ${sshd_enable:-off} \ moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ ntpd "Synchronize system and network time" ${ntpd_enable:-off} \ From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 11:48:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9F0E6A6; Fri, 26 Sep 2014 11:48:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B514CD6F; Fri, 26 Sep 2014 11:48:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QBmT5C021259; Fri, 26 Sep 2014 11:48:29 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QBmTKk021258; Fri, 26 Sep 2014 11:48:29 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201409261148.s8QBmTKk021258@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 26 Sep 2014 11:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272174 - head/usr.bin/man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 11:48:29 -0000 Author: allanjude (doc committer) Date: Fri Sep 26 11:48:29 2014 New Revision: 272174 URL: http://svnweb.freebsd.org/changeset/base/272174 Log: Replace the macros used in the previous man(1) commit with literal text, because the macros seem to be specific to groff, and do not render in mandoc Approved by: bcr (mentor) Sponsored by: ScaleEngine Inc. Modified: head/usr.bin/man/man.1 Modified: head/usr.bin/man/man.1 ============================================================================== --- head/usr.bin/man/man.1 Fri Sep 26 11:38:10 2014 (r272173) +++ head/usr.bin/man/man.1 Fri Sep 26 11:48:29 2014 (r272174) @@ -61,23 +61,23 @@ restricts the search to the specific sec The sections of the manual are: .Bl -enum -offset indent -compact .It -\*[volume-operating-system] \*[volume-ds-1] +.Fx General Commands Manual .It -\*[volume-operating-system] \*[volume-ds-2] +.Fx System Calls Manual .It -\*[volume-operating-system] \*[volume-ds-3] +.Fx Library Functions Manual .It -\*[volume-operating-system] \*[volume-ds-4] +.Fx Kernel Interfaces Manual .It -\*[volume-operating-system] \*[volume-ds-5] +.Fx File Formats Manual .It -\*[volume-operating-system] \*[volume-ds-6] +.Fx Games Manual .It -\*[volume-operating-system] \*[volume-ds-7] +.Fx Miscellaneous Information Manual .It -\*[volume-operating-system] \*[volume-ds-8] +.Fx System Manager's Manual .It -\*[volume-operating-system] \*[volume-ds-9] +.Fx Kernel Developer's Manual .El .Pp Options that From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 12:36:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F25E366; Fri, 26 Sep 2014 12:36:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5984732F; Fri, 26 Sep 2014 12:36:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QCa0Lh044901; Fri, 26 Sep 2014 12:36:00 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QCZxJB044890; Fri, 26 Sep 2014 12:35:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409261235.s8QCZxJB044890@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 26 Sep 2014 12:35:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272175 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 12:36:00 -0000 Author: glebius Date: Fri Sep 26 12:35:58 2014 New Revision: 272175 URL: http://svnweb.freebsd.org/changeset/base/272175 Log: - Whitespace. - Remove caddr_t. Modified: head/sys/net/ieee8023ad_lacp.c head/sys/net/ieee8023ad_lacp.h head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Fri Sep 26 11:48:29 2014 (r272174) +++ head/sys/net/ieee8023ad_lacp.c Fri Sep 26 12:35:58 2014 (r272175) @@ -300,7 +300,7 @@ lacp_pdu_input(struct lacp_port *lp, str goto bad; } - if (lacp_debug > 0) { + if (lacp_debug > 0) { lacp_dprintf(lp, "lacpdu receive\n"); lacp_dump_lacpdu(du); } @@ -538,7 +538,7 @@ lacp_port_create(struct lagg_port *lgp) return (ENOMEM); LACP_LOCK(lsc); - lgp->lp_psc = (caddr_t)lp; + lgp->lp_psc = lp; lp->lp_ifp = ifp; lp->lp_lagg = lgp; lp->lp_lsc = lsc; @@ -585,7 +585,7 @@ lacp_port_destroy(struct lagg_port *lgp) } void -lacp_req(struct lagg_softc *sc, caddr_t data) +lacp_req(struct lagg_softc *sc, void *data) { struct lacp_opreq *req = (struct lacp_opreq *)data; struct lacp_softc *lsc = LACP_SOFTC(sc); @@ -593,7 +593,7 @@ lacp_req(struct lagg_softc *sc, caddr_t bzero(req, sizeof(struct lacp_opreq)); - /* + /* * If the LACP softc is NULL, return with the opreq structure full of * zeros. It is normal for the softc to be NULL while the lagg is * being destroyed. @@ -624,7 +624,7 @@ lacp_req(struct lagg_softc *sc, caddr_t } void -lacp_portreq(struct lagg_port *lgp, caddr_t data) +lacp_portreq(struct lagg_port *lgp, void *data) { struct lacp_opreq *req = (struct lacp_opreq *)data; struct lacp_port *lp = LACP_PORT(lgp); @@ -791,7 +791,7 @@ lacp_attach(struct lagg_softc *sc) lsc = malloc(sizeof(struct lacp_softc), M_DEVBUF, M_WAITOK | M_ZERO); - sc->sc_psc = (caddr_t)lsc; + sc->sc_psc = lsc; lsc->lsc_softc = sc; lsc->lsc_hashkey = arc4random(); @@ -986,13 +986,13 @@ lacp_select_active_aggregator(struct lac lacp_format_lagid_aggregator(la, buf, sizeof(buf)), speed, la->la_nports)); - /* This aggregator is chosen if - * the partner has a better system priority - * or, the total aggregated speed is higher - * or, it is already the chosen aggregator + /* + * This aggregator is chosen if the partner has a better + * system priority or, the total aggregated speed is higher + * or, it is already the chosen aggregator */ if ((best_la != NULL && LACP_SYS_PRI(la->la_partner) < - LACP_SYS_PRI(best_la->la_partner)) || + LACP_SYS_PRI(best_la->la_partner)) || speed > best_speed || (speed == best_speed && la == lsc->lsc_active_aggregator)) { Modified: head/sys/net/ieee8023ad_lacp.h ============================================================================== --- head/sys/net/ieee8023ad_lacp.h Fri Sep 26 11:48:29 2014 (r272174) +++ head/sys/net/ieee8023ad_lacp.h Fri Sep 26 12:35:58 2014 (r272175) @@ -289,8 +289,8 @@ void lacp_stop(struct lagg_softc *); int lacp_port_create(struct lagg_port *); void lacp_port_destroy(struct lagg_port *); void lacp_linkstate(struct lagg_port *); -void lacp_req(struct lagg_softc *, caddr_t); -void lacp_portreq(struct lagg_port *, caddr_t); +void lacp_req(struct lagg_softc *, void *); +void lacp_portreq(struct lagg_port *, void *); static __inline int lacp_isactive(struct lagg_port *lgp) Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri Sep 26 11:48:29 2014 (r272174) +++ head/sys/net/if_lagg.c Fri Sep 26 12:35:58 2014 (r272175) @@ -150,7 +150,7 @@ static int lagg_lb_porttable(struct lagg static void lagg_bcast_attach(struct lagg_softc *); static int lagg_bcast_start(struct lagg_softc *, struct mbuf *); static struct mbuf *lagg_bcast_input(struct lagg_softc *, struct lagg_port *, - struct mbuf *); + struct mbuf *); /* 802.3ad LACP */ static void lagg_lacp_attach(struct lagg_softc *); @@ -277,7 +277,7 @@ lagg_proto_detach(struct lagg_softc *sc) LAGG_WLOCK_ASSERT(sc); pr = sc->sc_proto; - sc->sc_proto = LAGG_PROTO_NONE; + sc->sc_proto = LAGG_PROTO_NONE; if (lagg_protos[pr].pr_detach != NULL) lagg_protos[pr].pr_detach(sc); @@ -292,19 +292,19 @@ lagg_proto_detach(struct lagg_softc *sc) static void lagg_register_vlan(void *arg, struct ifnet *ifp, u_int16_t vtag) { - struct lagg_softc *sc = ifp->if_softc; - struct lagg_port *lp; - struct rm_priotracker tracker; - - if (ifp->if_softc != arg) /* Not our event */ - return; - - LAGG_RLOCK(sc, &tracker); - if (!SLIST_EMPTY(&sc->sc_ports)) { - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) - EVENTHANDLER_INVOKE(vlan_config, lp->lp_ifp, vtag); - } - LAGG_RUNLOCK(sc, &tracker); + struct lagg_softc *sc = ifp->if_softc; + struct lagg_port *lp; + struct rm_priotracker tracker; + + if (ifp->if_softc != arg) /* Not our event */ + return; + + LAGG_RLOCK(sc, &tracker); + if (!SLIST_EMPTY(&sc->sc_ports)) { + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + EVENTHANDLER_INVOKE(vlan_config, lp->lp_ifp, vtag); + } + LAGG_RUNLOCK(sc, &tracker); } /* @@ -314,19 +314,19 @@ lagg_register_vlan(void *arg, struct ifn static void lagg_unregister_vlan(void *arg, struct ifnet *ifp, u_int16_t vtag) { - struct lagg_softc *sc = ifp->if_softc; - struct lagg_port *lp; - struct rm_priotracker tracker; - - if (ifp->if_softc != arg) /* Not our event */ - return; - - LAGG_RLOCK(sc, &tracker); - if (!SLIST_EMPTY(&sc->sc_ports)) { - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) - EVENTHANDLER_INVOKE(vlan_unconfig, lp->lp_ifp, vtag); - } - LAGG_RUNLOCK(sc, &tracker); + struct lagg_softc *sc = ifp->if_softc; + struct lagg_port *lp; + struct rm_priotracker tracker; + + if (ifp->if_softc != arg) /* Not our event */ + return; + + LAGG_RLOCK(sc, &tracker); + if (!SLIST_EMPTY(&sc->sc_ports)) { + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + EVENTHANDLER_INVOKE(vlan_unconfig, lp->lp_ifp, vtag); + } + LAGG_RUNLOCK(sc, &tracker); } static int @@ -943,7 +943,7 @@ lagg_port2req(struct lagg_port *lp, stru rp->rp_prio = lp->lp_prio; rp->rp_flags = lp->lp_flags; if (sc->sc_portreq != NULL) - (*sc->sc_portreq)(lp, (caddr_t)&rp->rp_psc); + (*sc->sc_portreq)(lp, &rp->rp_psc); /* Add protocol specific flags */ switch (sc->sc_proto) { @@ -957,7 +957,7 @@ lagg_port2req(struct lagg_port *lp, stru case LAGG_PROTO_ROUNDROBIN: case LAGG_PROTO_LOADBALANCE: case LAGG_PROTO_ETHERCHANNEL: - case LAGG_PROTO_BROADCAST: + case LAGG_PROTO_BROADCAST: if (LAGG_PORTACTIVE(lp)) rp->rp_flags |= LAGG_PORT_ACTIVE; break; @@ -1045,7 +1045,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd LAGG_RLOCK(sc, &tracker); ra->ra_proto = sc->sc_proto; if (sc->sc_req != NULL) - (*sc->sc_req)(sc, (caddr_t)&ra->ra_psc); + (*sc->sc_req)(sc, &ra->ra_psc); count = 0; buf = outbuf; @@ -1262,7 +1262,7 @@ lagg_ether_cmdmulti(struct lagg_port *lp /* Handle a ref counted flag that should be set on the lagg port as well */ static int lagg_setflag(struct lagg_port *lp, int flag, int status, - int (*func)(struct ifnet *, int)) + int (*func)(struct ifnet *, int)) { struct lagg_softc *sc = lp->lp_softc; struct ifnet *scifp = sc->sc_ifp; @@ -1444,7 +1444,7 @@ lagg_linkstate(struct lagg_softc *sc) case LAGG_PROTO_ROUNDROBIN: case LAGG_PROTO_LOADBALANCE: case LAGG_PROTO_ETHERCHANNEL: - case LAGG_PROTO_BROADCAST: + case LAGG_PROTO_BROADCAST: speed = 0; SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) speed += lp->lp_ifp->if_baudrate; @@ -1722,73 +1722,71 @@ lagg_rr_input(struct lagg_softc *sc, str static void lagg_bcast_attach(struct lagg_softc *sc) { - sc->sc_start = lagg_bcast_start; - sc->sc_input = lagg_bcast_input; - sc->sc_port_create = NULL; - sc->sc_port_destroy = NULL; - sc->sc_linkstate = NULL; - sc->sc_req = NULL; - sc->sc_portreq = NULL; + sc->sc_start = lagg_bcast_start; + sc->sc_input = lagg_bcast_input; + sc->sc_port_create = NULL; + sc->sc_port_destroy = NULL; + sc->sc_linkstate = NULL; + sc->sc_req = NULL; + sc->sc_portreq = NULL; } static int lagg_bcast_start(struct lagg_softc *sc, struct mbuf *m) { - int active_ports = 0; - int errors = 0; - int ret; - struct lagg_port *lp, *last = NULL; - struct mbuf *m0; - - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { - if (!LAGG_PORTACTIVE(lp)) - continue; - - active_ports++; - - if (last != NULL) { - m0 = m_copym(m, 0, M_COPYALL, - M_NOWAIT); - if (m0 == NULL) { - ret = ENOBUFS; - errors++; - break; - } - - ret = lagg_enqueue(last->lp_ifp, m0); - if (ret != 0) - errors++; - } - last = lp; - } - if (last == NULL) { - m_freem(m); - return (ENOENT); - } - if ((last = lagg_link_active(sc, last)) == NULL) { - m_freem(m); - return (ENETDOWN); - } - - ret = lagg_enqueue(last->lp_ifp, m); - if (ret != 0) - errors++; + int active_ports = 0; + int errors = 0; + int ret; + struct lagg_port *lp, *last = NULL; + struct mbuf *m0; - if (errors == 0) - return (ret); + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + if (!LAGG_PORTACTIVE(lp)) + continue; + + active_ports++; + + if (last != NULL) { + m0 = m_copym(m, 0, M_COPYALL, M_NOWAIT); + if (m0 == NULL) { + ret = ENOBUFS; + errors++; + break; + } - return (0); + ret = lagg_enqueue(last->lp_ifp, m0); + if (ret != 0) + errors++; + } + last = lp; + } + if (last == NULL) { + m_freem(m); + return (ENOENT); + } + if ((last = lagg_link_active(sc, last)) == NULL) { + m_freem(m); + return (ENETDOWN); + } + + ret = lagg_enqueue(last->lp_ifp, m); + if (ret != 0) + errors++; + + if (errors == 0) + return (ret); + + return (0); } static struct mbuf* -lagg_bcast_input(struct lagg_softc *sc, struct lagg_port *lp, - struct mbuf *m) +lagg_bcast_input(struct lagg_softc *sc, struct lagg_port *lp, struct mbuf *m) { - struct ifnet *ifp = sc->sc_ifp; + struct ifnet *ifp = sc->sc_ifp; - /* Just pass in the packet to our lagg device */ - m->m_pkthdr.rcvif = ifp; - return (m); + /* Just pass in the packet to our lagg device */ + m->m_pkthdr.rcvif = ifp; + return (m); } /* @@ -1863,7 +1861,7 @@ lagg_lb_attach(struct lagg_softc *sc) sc->sc_capabilities = IFCAP_LAGG_FULLDUPLEX; lb->lb_key = arc4random(); - sc->sc_psc = (caddr_t)lb; + sc->sc_psc = lb; SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) lagg_lb_port_create(lp); Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Fri Sep 26 11:48:29 2014 (r272174) +++ head/sys/net/if_lagg.h Fri Sep 26 12:35:58 2014 (r272175) @@ -201,7 +201,7 @@ struct lagg_softc { * events */ struct lagg_port *sc_primary; /* primary port */ struct ifmedia sc_media; /* media config */ - caddr_t sc_psc; /* protocol data */ + void *sc_psc; /* protocol data */ uint32_t sc_seq; /* sequence counter */ uint32_t sc_flags; @@ -227,8 +227,8 @@ struct lagg_softc { void (*sc_init)(struct lagg_softc *); void (*sc_stop)(struct lagg_softc *); void (*sc_lladdr)(struct lagg_softc *); - void (*sc_req)(struct lagg_softc *, caddr_t); - void (*sc_portreq)(struct lagg_port *, caddr_t); + void (*sc_req)(struct lagg_softc *, void *); + void (*sc_portreq)(struct lagg_port *, void *); eventhandler_tag vlan_attach; eventhandler_tag vlan_detach; struct callout sc_callout; @@ -248,7 +248,7 @@ struct lagg_port { uint32_t lp_flags; /* port flags */ int lp_ifflags; /* saved ifp flags */ void *lh_cookie; /* if state hook */ - caddr_t lp_psc; /* protocol data */ + void *lp_psc; /* protocol data */ int lp_detaching; /* ifnet is detaching */ SLIST_HEAD(__mclhd, lagg_mc) lp_mc_head; /* multicast addresses */ From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 12:42:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B091741; Fri, 26 Sep 2014 12:42:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66A75648; Fri, 26 Sep 2014 12:42:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QCg7XU049085; Fri, 26 Sep 2014 12:42:07 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QCg7Ax049084; Fri, 26 Sep 2014 12:42:07 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201409261242.s8QCg7Ax049084@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 26 Sep 2014 12:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272176 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 12:42:07 -0000 Author: ae Date: Fri Sep 26 12:42:06 2014 New Revision: 272176 URL: http://svnweb.freebsd.org/changeset/base/272176 Log: Keep list of lagg ports sorted by if_index. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri Sep 26 12:35:58 2014 (r272175) +++ head/sys/net/if_lagg.c Fri Sep 26 12:42:06 2014 (r272176) @@ -601,7 +601,7 @@ static int lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp) { struct lagg_softc *sc_ptr; - struct lagg_port *lp; + struct lagg_port *lp, *tlp; int error = 0; LAGG_WLOCK_ASSERT(sc); @@ -708,8 +708,18 @@ lagg_port_create(struct lagg_softc *sc, lagg_port_lladdr(lp, IF_LLADDR(sc->sc_ifp)); } - /* Insert into the list of ports */ - SLIST_INSERT_HEAD(&sc->sc_ports, lp, lp_entries); + /* Insert into the list of ports. Keep ports sorted by if_index. */ + SLIST_FOREACH(tlp, &sc->sc_ports, lp_entries) { + if (tlp->lp_ifp->if_index < ifp->if_index && ( + SLIST_NEXT(tlp, lp_entries) == NULL || + SLIST_NEXT(tlp, lp_entries)->lp_ifp->if_index < + ifp->if_index)) + break; + } + if (tlp != NULL) + SLIST_INSERT_AFTER(tlp, lp, lp_entries); + else + SLIST_INSERT_HEAD(&sc->sc_ports, lp, lp_entries); sc->sc_count++; /* Update lagg capabilities */ From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 12:48:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A6E79A9; Fri, 26 Sep 2014 12:48:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BDE0696; Fri, 26 Sep 2014 12:48:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QCmtcS049973; Fri, 26 Sep 2014 12:48:55 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QCmtKQ049972; Fri, 26 Sep 2014 12:48:55 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201409261248.s8QCmtKQ049972@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Fri, 26 Sep 2014 12:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272177 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 12:48:55 -0000 Author: jmg Date: Fri Sep 26 12:48:54 2014 New Revision: 272177 URL: http://svnweb.freebsd.org/changeset/base/272177 Log: drop unnecessary ifdef IPSEC's. This file is only compiled when IPSEC is defined... Differential Revision: D839 Reviewed by: bz, glebius, gnn Sponsered by: EuroBSDCon DevSummit Modified: head/sys/netinet/ip_ipsec.c Modified: head/sys/netinet/ip_ipsec.c ============================================================================== --- head/sys/netinet/ip_ipsec.c Fri Sep 26 12:42:06 2014 (r272176) +++ head/sys/netinet/ip_ipsec.c Fri Sep 26 12:48:54 2014 (r272177) @@ -63,15 +63,12 @@ __FBSDID("$FreeBSD$"); #include -#ifdef IPSEC #include #include #include -#endif /*IPSEC*/ extern struct protosw inetsw[]; -#ifdef IPSEC #ifdef IPSEC_FILTERTUNNEL static VNET_DEFINE(int, ip4_ipsec_filtertunnel) = 1; #else @@ -83,7 +80,6 @@ SYSCTL_DECL(_net_inet_ipsec); SYSCTL_VNET_INT(_net_inet_ipsec, OID_AUTO, filtertunnel, CTLFLAG_RW, &VNET_NAME(ip4_ipsec_filtertunnel), 0, "If set filter packets from an IPsec tunnel."); -#endif /* IPSEC */ /* * Check if we have to jump over firewall processing for this packet. @@ -93,7 +89,6 @@ SYSCTL_VNET_INT(_net_inet_ipsec, OID_AUT int ip_ipsec_filtertunnel(struct mbuf *m) { -#ifdef IPSEC /* * Bypass packet filtering for packets previously handled by IPsec. @@ -101,7 +96,6 @@ ip_ipsec_filtertunnel(struct mbuf *m) if (!V_ip4_ipsec_filtertunnel && m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL) return 1; -#endif return 0; } @@ -114,7 +108,6 @@ ip_ipsec_filtertunnel(struct mbuf *m) int ip_ipsec_fwd(struct mbuf *m) { -#ifdef IPSEC struct m_tag *mtag; struct tdb_ident *tdbi; struct secpolicy *sp; @@ -143,7 +136,6 @@ ip_ipsec_fwd(struct mbuf *m) IPSTAT_INC(ips_cantforward); return 1; } -#endif /* IPSEC */ return 0; } @@ -157,7 +149,6 @@ ip_ipsec_fwd(struct mbuf *m) int ip_ipsec_input(struct mbuf *m) { -#ifdef IPSEC struct ip *ip = mtod(m, struct ip *); struct m_tag *mtag; struct tdb_ident *tdbi; @@ -198,7 +189,6 @@ ip_ipsec_input(struct mbuf *m) if (error) return 1; } -#endif /* IPSEC */ return 0; } @@ -256,7 +246,6 @@ ip_ipsec_mtu(struct mbuf *m, int mtu) int ip_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error) { -#ifdef IPSEC struct secpolicy *sp = NULL; struct tdb_ident *tdbi; struct m_tag *mtag; @@ -388,6 +377,4 @@ bad: if (sp != NULL) KEY_FREESP(&sp); return 1; -#endif /* IPSEC */ - return 0; } From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 12:54:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 111BABE2; Fri, 26 Sep 2014 12:54:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF50B7B2; Fri, 26 Sep 2014 12:54:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QCsP5M054149; Fri, 26 Sep 2014 12:54:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QCsPe4054147; Fri, 26 Sep 2014 12:54:25 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409261254.s8QCsPe4054147@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 26 Sep 2014 12:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272178 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 12:54:26 -0000 Author: glebius Date: Fri Sep 26 12:54:24 2014 New Revision: 272178 URL: http://svnweb.freebsd.org/changeset/base/272178 Log: Make all lagg protocol methods live in lagg_protos, not in softc. All interfaces of a same protocol, use the same methods. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri Sep 26 12:48:54 2014 (r272177) +++ head/sys/net/if_lagg.c Fri Sep 26 12:54:24 2014 (r272178) @@ -131,7 +131,6 @@ static struct mbuf *lagg_rr_input(struct struct mbuf *); /* Active failover */ -static void lagg_fail_attach(struct lagg_softc *); static int lagg_fail_start(struct lagg_softc *, struct mbuf *); static struct mbuf *lagg_fail_input(struct lagg_softc *, struct lagg_port *, struct mbuf *); @@ -147,7 +146,6 @@ static struct mbuf *lagg_lb_input(struct static int lagg_lb_porttable(struct lagg_softc *, struct lagg_port *); /* Broadcast */ -static void lagg_bcast_attach(struct lagg_softc *); static int lagg_bcast_start(struct lagg_softc *, struct mbuf *); static struct mbuf *lagg_bcast_input(struct lagg_softc *, struct lagg_port *, struct mbuf *); @@ -167,6 +165,17 @@ static const struct lagg_proto { lagg_proto pr_num; void (*pr_attach)(struct lagg_softc *); void (*pr_detach)(struct lagg_softc *); + int (*pr_start)(struct lagg_softc *, struct mbuf *); + struct mbuf * (*pr_input)(struct lagg_softc *, struct lagg_port *, + struct mbuf *); + int (*pr_addport)(struct lagg_port *); + void (*pr_delport)(struct lagg_port *); + void (*pr_linkstate)(struct lagg_port *); + void (*pr_init)(struct lagg_softc *); + void (*pr_stop)(struct lagg_softc *); + void (*pr_lladdr)(struct lagg_softc *); + void (*pr_request)(struct lagg_softc *, void *); + void (*pr_portreq)(struct lagg_port *, void *); } lagg_protos[] = { { .pr_num = LAGG_PROTO_NONE @@ -174,28 +183,49 @@ static const struct lagg_proto { { .pr_num = LAGG_PROTO_ROUNDROBIN, .pr_attach = lagg_rr_attach, + .pr_start = lagg_rr_start, + .pr_input = lagg_rr_input, }, { .pr_num = LAGG_PROTO_FAILOVER, - .pr_attach = lagg_fail_attach, + .pr_start = lagg_fail_start, + .pr_input = lagg_fail_input, }, { .pr_num = LAGG_PROTO_LOADBALANCE, .pr_attach = lagg_lb_attach, .pr_detach = lagg_lb_detach, + .pr_start = lagg_lb_start, + .pr_input = lagg_lb_input, + .pr_addport = lagg_lb_port_create, + .pr_delport = lagg_lb_port_destroy, }, { .pr_num = LAGG_PROTO_LACP, .pr_attach = lagg_lacp_attach, .pr_detach = lagg_lacp_detach, + .pr_start = lagg_lacp_start, + .pr_input = lagg_lacp_input, + .pr_addport = lacp_port_create, + .pr_delport = lacp_port_destroy, + .pr_linkstate = lacp_linkstate, + .pr_init = lacp_init, + .pr_stop = lacp_stop, + .pr_lladdr = lagg_lacp_lladdr, + .pr_request = lacp_req, + .pr_portreq = lacp_portreq, }, { .pr_num = LAGG_PROTO_ETHERCHANNEL, .pr_attach = lagg_lb_attach, + .pr_detach = lagg_lb_detach, + .pr_start = lagg_lb_start, + .pr_input = lagg_lb_input, }, { .pr_num = LAGG_PROTO_BROADCAST, - .pr_attach = lagg_bcast_attach, + .pr_start = lagg_bcast_start, + .pr_input = lagg_bcast_input, }, }; @@ -265,7 +295,8 @@ lagg_proto_attach(struct lagg_softc *sc, if (sc->sc_ifflags & IFF_DEBUG) if_printf(sc->sc_ifp, "using proto %u\n", pr); - lagg_protos[pr].pr_attach(sc); + if (lagg_protos[pr].pr_attach != NULL) + lagg_protos[pr].pr_attach(sc); sc->sc_proto = pr; } @@ -285,6 +316,86 @@ lagg_proto_detach(struct lagg_softc *sc) LAGG_WUNLOCK(sc); } +static int +lagg_proto_start(struct lagg_softc *sc, struct mbuf *m) +{ + + return (lagg_protos[sc->sc_proto].pr_start(sc, m)); +} + +static struct mbuf * +lagg_proto_input(struct lagg_softc *sc, struct lagg_port *lp, struct mbuf *m) +{ + + return (lagg_protos[sc->sc_proto].pr_input(sc, lp, m)); +} + +static int +lagg_proto_addport(struct lagg_softc *sc, struct lagg_port *lp) +{ + + if (lagg_protos[sc->sc_proto].pr_addport == NULL) + return (0); + else + return (lagg_protos[sc->sc_proto].pr_addport(lp)); +} + +static void +lagg_proto_delport(struct lagg_softc *sc, struct lagg_port *lp) +{ + + if (lagg_protos[sc->sc_proto].pr_delport != NULL) + lagg_protos[sc->sc_proto].pr_delport(lp); +} + +static void +lagg_proto_linkstate(struct lagg_softc *sc, struct lagg_port *lp) +{ + + if (lagg_protos[sc->sc_proto].pr_linkstate != NULL) + lagg_protos[sc->sc_proto].pr_linkstate(lp); +} + +static void +lagg_proto_init(struct lagg_softc *sc) +{ + + if (lagg_protos[sc->sc_proto].pr_init != NULL) + lagg_protos[sc->sc_proto].pr_init(sc); +} + +static void +lagg_proto_stop(struct lagg_softc *sc) +{ + + if (lagg_protos[sc->sc_proto].pr_stop != NULL) + lagg_protos[sc->sc_proto].pr_stop(sc); +} + +static void +lagg_proto_lladdr(struct lagg_softc *sc) +{ + + if (lagg_protos[sc->sc_proto].pr_lladdr != NULL) + lagg_protos[sc->sc_proto].pr_lladdr(sc); +} + +static void +lagg_proto_request(struct lagg_softc *sc, void *v) +{ + + if (lagg_protos[sc->sc_proto].pr_request != NULL) + lagg_protos[sc->sc_proto].pr_request(sc, v); +} + +static void +lagg_proto_portreq(struct lagg_softc *sc, struct lagg_port *lp, void *v) +{ + + if (lagg_protos[sc->sc_proto].pr_portreq != NULL) + lagg_protos[sc->sc_proto].pr_portreq(lp, v); +} + /* * This routine is run via an vlan * config EVENT @@ -479,8 +590,7 @@ lagg_lladdr(struct lagg_softc *sc, uint8 bcopy(lladdr, IF_LLADDR(ifp), ETHER_ADDR_LEN); /* Let the protocol know the MAC has changed */ - if (sc->sc_lladdr != NULL) - (*sc->sc_lladdr)(sc); + lagg_proto_lladdr(sc); EVENTHANDLER_INVOKE(iflladdr_event, ifp); } @@ -602,7 +712,7 @@ lagg_port_create(struct lagg_softc *sc, { struct lagg_softc *sc_ptr; struct lagg_port *lp, *tlp; - int error = 0; + int error; LAGG_WLOCK_ASSERT(sc); @@ -730,15 +840,13 @@ lagg_port_create(struct lagg_softc *sc, lagg_ether_cmdmulti(lp, 1); lagg_setflags(lp, 1); - if (sc->sc_port_create != NULL) - error = (*sc->sc_port_create)(lp); - if (error) { - /* remove the port again, without calling sc_port_destroy */ + if ((error = lagg_proto_addport(sc, lp)) != 0) { + /* Remove the port, without calling pr_delport. */ lagg_port_destroy(lp, 0); return (error); } - return (error); + return (0); } #ifdef LAGG_PORT_STACKING @@ -763,7 +871,7 @@ lagg_port_checkstacking(struct lagg_soft #endif static int -lagg_port_destroy(struct lagg_port *lp, int runpd) +lagg_port_destroy(struct lagg_port *lp, int rundelport) { struct lagg_softc *sc = lp->lp_softc; struct lagg_port *lp_ptr; @@ -772,8 +880,8 @@ lagg_port_destroy(struct lagg_port *lp, LAGG_WLOCK_ASSERT(sc); - if (runpd && sc->sc_port_destroy != NULL) - (*sc->sc_port_destroy)(lp); + if (rundelport) + lagg_proto_delport(sc, lp); /* * Remove multicast addresses and interface flags from this port and @@ -952,8 +1060,7 @@ lagg_port2req(struct lagg_port *lp, stru strlcpy(rp->rp_portname, lp->lp_ifp->if_xname, sizeof(rp->rp_portname)); rp->rp_prio = lp->lp_prio; rp->rp_flags = lp->lp_flags; - if (sc->sc_portreq != NULL) - (*sc->sc_portreq)(lp, &rp->rp_psc); + lagg_proto_portreq(sc, lp, &rp->rp_psc); /* Add protocol specific flags */ switch (sc->sc_proto) { @@ -1002,8 +1109,7 @@ lagg_init(void *xsc) SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) lagg_port_lladdr(lp, IF_LLADDR(ifp)); - if (sc->sc_init != NULL) - (*sc->sc_init)(sc); + lagg_proto_init(sc); LAGG_WUNLOCK(sc); } @@ -1020,8 +1126,7 @@ lagg_stop(struct lagg_softc *sc) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - if (sc->sc_stop != NULL) - (*sc->sc_stop)(sc); + lagg_proto_stop(sc); } static int @@ -1054,9 +1159,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd LAGG_RLOCK(sc, &tracker); ra->ra_proto = sc->sc_proto; - if (sc->sc_req != NULL) - (*sc->sc_req)(sc, &ra->ra_psc); - + lagg_proto_request(sc, &ra->ra_psc); count = 0; buf = outbuf; len = min(ra->ra_size, buflen); @@ -1343,7 +1446,7 @@ lagg_transmit(struct ifnet *ifp, struct ETHER_BPF_MTAP(ifp, m); - error = (*sc->sc_start)(sc, m); + error = lagg_proto_start(sc, m); LAGG_RUNLOCK(sc, &tracker); if (error == 0) { @@ -1383,7 +1486,7 @@ lagg_input(struct ifnet *ifp, struct mbu ETHER_BPF_MTAP(scifp, m); - m = (*sc->sc_input)(sc, lp, m); + m = lagg_proto_input(sc, lp, m); if (m != NULL) { counter_u64_add(sc->sc_ipackets, 1); @@ -1479,8 +1582,7 @@ lagg_port_state(struct ifnet *ifp, int s LAGG_WLOCK(sc); lagg_linkstate(sc); - if (sc->sc_linkstate != NULL) - (*sc->sc_linkstate)(lp); + lagg_proto_linkstate(sc, lp); LAGG_WUNLOCK(sc); } @@ -1683,9 +1785,6 @@ lagg_enqueue(struct ifnet *ifp, struct m static void lagg_rr_attach(struct lagg_softc *sc) { - sc->sc_start = lagg_rr_start; - sc->sc_input = lagg_rr_input; - sc->sc_port_create = NULL; sc->sc_capabilities = IFCAP_LAGG_FULLDUPLEX; sc->sc_seq = 0; } @@ -1729,18 +1828,6 @@ lagg_rr_input(struct lagg_softc *sc, str /* * Broadcast mode */ -static void -lagg_bcast_attach(struct lagg_softc *sc) -{ - sc->sc_start = lagg_bcast_start; - sc->sc_input = lagg_bcast_input; - sc->sc_port_create = NULL; - sc->sc_port_destroy = NULL; - sc->sc_linkstate = NULL; - sc->sc_req = NULL; - sc->sc_portreq = NULL; -} - static int lagg_bcast_start(struct lagg_softc *sc, struct mbuf *m) { @@ -1802,15 +1889,6 @@ lagg_bcast_input(struct lagg_softc *sc, /* * Active failover */ -static void -lagg_fail_attach(struct lagg_softc *sc) -{ - sc->sc_start = lagg_fail_start; - sc->sc_input = lagg_fail_input; - sc->sc_port_create = NULL; - sc->sc_port_destroy = NULL; -} - static int lagg_fail_start(struct lagg_softc *sc, struct mbuf *m) { @@ -1864,10 +1942,6 @@ lagg_lb_attach(struct lagg_softc *sc) lb = malloc(sizeof(struct lagg_lb), M_DEVBUF, M_WAITOK | M_ZERO); - sc->sc_start = lagg_lb_start; - sc->sc_input = lagg_lb_input; - sc->sc_port_create = lagg_lb_port_create; - sc->sc_port_destroy = lagg_lb_port_destroy; sc->sc_capabilities = IFCAP_LAGG_FULLDUPLEX; lb->lb_key = arc4random(); @@ -1970,19 +2044,7 @@ lagg_lacp_attach(struct lagg_softc *sc) { struct lagg_port *lp; - sc->sc_port_create = lacp_port_create; - sc->sc_port_destroy = lacp_port_destroy; - sc->sc_linkstate = lacp_linkstate; - sc->sc_start = lagg_lacp_start; - sc->sc_input = lagg_lacp_input; - sc->sc_init = lacp_init; - sc->sc_stop = lacp_stop; - sc->sc_lladdr = lagg_lacp_lladdr; - sc->sc_req = lacp_req; - sc->sc_portreq = lacp_portreq; - lacp_attach(sc); - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) lacp_port_create(lp); } Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Fri Sep 26 12:48:54 2014 (r272177) +++ head/sys/net/if_lagg.h Fri Sep 26 12:54:24 2014 (r272178) @@ -216,19 +216,6 @@ struct lagg_softc { struct task sc_lladdr_task; SLIST_HEAD(__llqhd, lagg_llq) sc_llq_head; /* interfaces to program the lladdr on */ - - /* lagg protocol callbacks */ - int (*sc_start)(struct lagg_softc *, struct mbuf *); - struct mbuf *(*sc_input)(struct lagg_softc *, struct lagg_port *, - struct mbuf *); - int (*sc_port_create)(struct lagg_port *); - void (*sc_port_destroy)(struct lagg_port *); - void (*sc_linkstate)(struct lagg_port *); - void (*sc_init)(struct lagg_softc *); - void (*sc_stop)(struct lagg_softc *); - void (*sc_lladdr)(struct lagg_softc *); - void (*sc_req)(struct lagg_softc *, void *); - void (*sc_portreq)(struct lagg_port *, void *); eventhandler_tag vlan_attach; eventhandler_tag vlan_detach; struct callout sc_callout; From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 13:02:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 394D2FA; Fri, 26 Sep 2014 13:02:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09F2B8D1; Fri, 26 Sep 2014 13:02:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QD2Uhm058743; Fri, 26 Sep 2014 13:02:30 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QD2UT2058740; Fri, 26 Sep 2014 13:02:30 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409261302.s8QD2UT2058740@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 26 Sep 2014 13:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272179 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 13:02:31 -0000 Author: glebius Date: Fri Sep 26 13:02:29 2014 New Revision: 272179 URL: http://svnweb.freebsd.org/changeset/base/272179 Log: Remove macros that hide access to struct ifnet fields. Modified: head/sys/net/ieee8023ad_lacp.c head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Fri Sep 26 12:54:24 2014 (r272178) +++ head/sys/net/ieee8023ad_lacp.c Fri Sep 26 13:02:29 2014 (r272179) @@ -528,7 +528,8 @@ lacp_port_create(struct lagg_port *lgp) LLADDR(&sdl), ETHER_ADDR_LEN); error = if_addmulti(ifp, (struct sockaddr *)&sdl, &rifma); if (error) { - printf("%s: ADDMULTI failed on %s\n", __func__, lgp->lp_ifname); + printf("%s: ADDMULTI failed on %s\n", __func__, + lgp->lp_ifp->if_xname); return (error); } Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri Sep 26 12:54:24 2014 (r272178) +++ head/sys/net/if_lagg.c Fri Sep 26 13:02:29 2014 (r272179) @@ -1541,7 +1541,7 @@ lagg_linkstate(struct lagg_softc *sc) /* Our link is considered up if at least one of our ports is active */ SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { - if (lp->lp_link_state == LINK_STATE_UP) { + if (lp->lp_ifp->if_link_state == LINK_STATE_UP) { new_link = LINK_STATE_UP; break; } @@ -1977,7 +1977,7 @@ lagg_lb_porttable(struct lagg_softc *sc, return (EINVAL); if (sc->sc_ifflags & IFF_DEBUG) printf("%s: port %s at index %d\n", - sc->sc_ifname, lp_next->lp_ifname, i); + sc->sc_ifname, lp_next->lp_ifp->if_xname, i); lb->lb_ports[i++] = lp_next; } Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Fri Sep 26 12:54:24 2014 (r272178) +++ head/sys/net/if_lagg.h Fri Sep 26 13:02:29 2014 (r272179) @@ -146,11 +146,8 @@ struct lagg_reqflags { * Internal kernel part */ -#define lp_ifname lp_ifp->if_xname /* interface name */ -#define lp_link_state lp_ifp->if_link_state /* link state */ - #define LAGG_PORTACTIVE(_tp) ( \ - ((_tp)->lp_link_state == LINK_STATE_UP) && \ + ((_tp)->lp_ifp->if_link_state == LINK_STATE_UP) && \ ((_tp)->lp_ifp->if_flags & IFF_UP) \ ) From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 13:12:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55FC451C; Fri, 26 Sep 2014 13:12:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40D3A9D6; Fri, 26 Sep 2014 13:12:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QDC1VZ063477; Fri, 26 Sep 2014 13:12:01 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QDC1cM063476; Fri, 26 Sep 2014 13:12:01 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201409261312.s8QDC1cM063476@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Fri, 26 Sep 2014 13:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272180 - head/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 13:12:01 -0000 Author: gavin Date: Fri Sep 26 13:12:00 2014 New Revision: 272180 URL: http://svnweb.freebsd.org/changeset/base/272180 Log: Add ipheth(4) to the hardware notes. MFC after: 6 days Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Sep 26 13:02:29 2014 (r272179) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Sep 26 13:12:00 2014 (r272180) @@ -837,6 +837,8 @@ &hwlist.igb; + &hwlist.ipheth; + &hwlist.ixgb; &hwlist.ixgbe; From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 15:16:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E86583E5; Fri, 26 Sep 2014 15:16:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3B90A2E; Fri, 26 Sep 2014 15:16:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QFGrCM020487; Fri, 26 Sep 2014 15:16:53 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QFGrgk020486; Fri, 26 Sep 2014 15:16:53 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409261516.s8QFGrgk020486@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 26 Sep 2014 15:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272181 - head/sys/powerpc/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 15:16:54 -0000 Author: ian Date: Fri Sep 26 15:16:53 2014 New Revision: 272181 URL: http://svnweb.freebsd.org/changeset/base/272181 Log: Fix a paste-o commited in r272109: we need to get the interrupts for the child node, not the parent node. Pointed out by: jhibbits@ Modified: head/sys/powerpc/ofw/ofw_pcibus.c Modified: head/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcibus.c Fri Sep 26 13:12:00 2014 (r272180) +++ head/sys/powerpc/ofw/ofw_pcibus.c Fri Sep 26 15:16:53 2014 (r272181) @@ -201,7 +201,7 @@ ofw_pcibus_enum_devtree(device_t dev, u_ * resource list. */ if (dinfo->opd_dinfo.cfg.intpin == 0) - ofw_bus_intr_to_rl(dev, node, &dinfo->opd_dinfo.resources); + ofw_bus_intr_to_rl(dev, child, &dinfo->opd_dinfo.resources); } } From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 18:37:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F016F4C; Fri, 26 Sep 2014 18:37:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AC9F278; Fri, 26 Sep 2014 18:37:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QIbo9Q013639; Fri, 26 Sep 2014 18:37:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QIboUl013638; Fri, 26 Sep 2014 18:37:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409261837.s8QIboUl013638@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 26 Sep 2014 18:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272182 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 18:37:50 -0000 Author: jhb Date: Fri Sep 26 18:37:49 2014 New Revision: 272182 URL: http://svnweb.freebsd.org/changeset/base/272182 Log: Don't panic if a resource is allocated twice. Instead, print a warning and fail the allocation request. Allocations of "reserved" resources such as PCI BARs already fail the request instead of panic'ing in this case. MFC after: 1 week Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Fri Sep 26 15:16:53 2014 (r272181) +++ head/sys/kern/subr_bus.c Fri Sep 26 18:37:49 2014 (r272182) @@ -3302,7 +3302,10 @@ resource_list_alloc(struct resource_list rle->flags |= RLE_ALLOCATED; return (rle->res); } - panic("resource_list_alloc: resource entry is busy"); + device_printf(bus, + "resource entry %#x type %d for child %s is busy\n", *rid, + type, device_get_nameunit(child)); + return (NULL); } if (isdefault) { From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 18:53:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCC59562; Fri, 26 Sep 2014 18:53:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9545682; Fri, 26 Sep 2014 18:53:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QIr0nl022504; Fri, 26 Sep 2014 18:53:00 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QIr0gi022503; Fri, 26 Sep 2014 18:53:00 GMT (envelope-from np@FreeBSD.org) Message-Id: <201409261853.s8QIr0gi022503@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 26 Sep 2014 18:53:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272183 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 18:53:01 -0000 Author: np Date: Fri Sep 26 18:53:00 2014 New Revision: 272183 URL: http://svnweb.freebsd.org/changeset/base/272183 Log: Make sure the adapter's management queue and the event queue are available before any uppper layer driver (TOE, iWARP, or iSCSI) registers with the base cxgbe(4) driver. Submitted by: Hariprasad at chelsio dot com Reviewed by: np@ Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Sep 26 18:37:49 2014 (r272182) +++ head/sys/dev/cxgbe/t4_main.c Fri Sep 26 18:53:00 2014 (r272183) @@ -8283,6 +8283,12 @@ t4_activate_uld(struct adapter *sc, int SLIST_FOREACH(ui, &t4_uld_list, link) { if (ui->uld_id == id) { + if (!(sc->flags & FULL_INIT_DONE)) { + rc = adapter_full_init(sc); + if (rc != 0) + goto done; + } + rc = ui->activate(sc); if (rc == 0) ui->refcount++; From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 19:13:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2CCD8D7; Fri, 26 Sep 2014 19:13:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3ED18F6; Fri, 26 Sep 2014 19:13:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QJDELg031970; Fri, 26 Sep 2014 19:13:14 GMT (envelope-from thomas@FreeBSD.org) Received: (from thomas@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QJDEne031969; Fri, 26 Sep 2014 19:13:14 GMT (envelope-from thomas@FreeBSD.org) Message-Id: <201409261913.s8QJDEne031969@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: thomas set sender to thomas@FreeBSD.org using -f From: Thomas Quinot Date: Fri, 26 Sep 2014 19:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r272184 - stable/9/tools/tools/nanobsd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 19:13:14 -0000 Author: thomas Date: Fri Sep 26 19:13:13 2014 New Revision: 272184 URL: http://svnweb.freebsd.org/changeset/base/272184 Log: MFC rev. 258705 to stable/9: Define NANO_MAKE (single threaded MAKE) and use it for installworld, installkernel, and distribution. Required in order to fix regression introduced by MFC rev. 265894 for kern/162736, since that change depends on this one. PR: 193808 Modified: stable/9/tools/tools/nanobsd/nanobsd.sh Modified: stable/9/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- stable/9/tools/tools/nanobsd/nanobsd.sh Fri Sep 26 18:53:00 2014 (r272183) +++ stable/9/tools/tools/nanobsd/nanobsd.sh Fri Sep 26 19:13:13 2014 (r272184) @@ -57,7 +57,8 @@ NANO_PACKAGE_LIST="*" # default is ${NANO_OBJ} #NANO_DISKIMGDIR="" -# Parallel Make +# Make & parallel Make +NANO_MAKE="make" NANO_PMAKE="make -j 3" # The default name for any image we create. @@ -254,7 +255,7 @@ install_world ( ) ( cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} \ - ${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} installworld \ + ${NANO_MAKE} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} installworld \ DESTDIR=${NANO_WORLDDIR} \ > ${NANO_OBJ}/_.iw 2>&1 chflags -R noschg ${NANO_WORLDDIR} @@ -267,7 +268,7 @@ install_etc ( ) ( cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} \ - ${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} distribution \ + ${NANO_MAKE} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} distribution \ DESTDIR=${NANO_WORLDDIR} \ > ${NANO_OBJ}/_.etc 2>&1 # make.conf doesn't get created by default, but some ports need it @@ -886,6 +887,7 @@ fi if $do_clean ; then true else + NANO_MAKE="${NANO_MAKE} -DNO_CLEAN" NANO_PMAKE="${NANO_PMAKE} -DNO_CLEAN" fi @@ -905,6 +907,7 @@ export NANO_DRIVE export NANO_HEADS export NANO_IMAGES export NANO_IMGNAME +export NANO_MAKE export NANO_MAKE_CONF_BUILD export NANO_MAKE_CONF_INSTALL export NANO_MEDIASIZE From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 19:48:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7B9924B; Fri, 26 Sep 2014 19:48:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3AAC2A; Fri, 26 Sep 2014 19:48:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QJmmHb046669; Fri, 26 Sep 2014 19:48:48 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QJmmmk046664; Fri, 26 Sep 2014 19:48:48 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201409261948.s8QJmmmk046664@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 26 Sep 2014 19:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272185 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 19:48:48 -0000 Author: mjg Date: Fri Sep 26 19:48:47 2014 New Revision: 272185 URL: http://svnweb.freebsd.org/changeset/base/272185 Log: Make do_dup() static and move relevant macros to kern_descrip.c No functional changes. Modified: head/sys/kern/kern_descrip.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Sep 26 19:13:13 2014 (r272184) +++ head/sys/kern/kern_descrip.c Fri Sep 26 19:48:47 2014 (r272185) @@ -101,6 +101,8 @@ static uma_zone_t file_zone; static int closefp(struct filedesc *fdp, int fd, struct file *fp, struct thread *td, int holdleaders); +static int do_dup(struct thread *td, int flags, int old, int new, + register_t *retval); static int fd_first_free(struct filedesc *fdp, int low, int size); static int fd_last_used(struct filedesc *fdp, int size); static void fdgrowtable(struct filedesc *fdp, int nfd); @@ -109,6 +111,11 @@ static void fdunused(struct filedesc *fd static void fdused(struct filedesc *fdp, int fd); static int getmaxfd(struct proc *p); +/* Flags for do_dup() */ +#define DUP_FIXED 0x1 /* Force fixed allocation. */ +#define DUP_FCNTL 0x2 /* fcntl()-style errors. */ +#define DUP_CLOEXEC 0x4 /* Atomically set FD_CLOEXEC. */ + /* * Each process has: * @@ -785,7 +792,7 @@ getmaxfd(struct proc *p) /* * Common code for dup, dup2, fcntl(F_DUPFD) and fcntl(F_DUP2FD). */ -int +static int do_dup(struct thread *td, int flags, int old, int new, register_t *retval) { Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Fri Sep 26 19:13:13 2014 (r272184) +++ head/sys/sys/filedesc.h Fri Sep 26 19:48:47 2014 (r272185) @@ -109,11 +109,6 @@ struct filedesc_to_leader { #ifdef _KERNEL -/* Flags for do_dup() */ -#define DUP_FIXED 0x1 /* Force fixed allocation. */ -#define DUP_FCNTL 0x2 /* fcntl()-style errors. */ -#define DUP_CLOEXEC 0x4 /* Atomically set FD_CLOEXEC. */ - /* Lock a file descriptor table. */ #define FILEDESC_LOCK_INIT(fdp) sx_init(&(fdp)->fd_sx, "filedesc structure") #define FILEDESC_LOCK_DESTROY(fdp) sx_destroy(&(fdp)->fd_sx) @@ -137,8 +132,6 @@ void filecaps_move(struct filecaps *src, void filecaps_free(struct filecaps *fcaps); int closef(struct file *fp, struct thread *td); -int do_dup(struct thread *td, int flags, int old, int new, - register_t *retval); int dupfdopen(struct thread *td, struct filedesc *fdp, int dfd, int mode, int openerror, int *indxp); int falloc(struct thread *td, struct file **resultfp, int *resultfd, From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 20:05:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F066A82; Fri, 26 Sep 2014 20:05:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A7E1E41; Fri, 26 Sep 2014 20:05:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QK5UmE055934; Fri, 26 Sep 2014 20:05:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QK5TjD055931; Fri, 26 Sep 2014 20:05:29 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201409262005.s8QK5TjD055931@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 26 Sep 2014 20:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272187 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 20:05:30 -0000 Author: mjg Date: Fri Sep 26 20:05:28 2014 New Revision: 272187 URL: http://svnweb.freebsd.org/changeset/base/272187 Log: MFC r270993: Fix up proc_realparent to always return correct process. Prior to the change it would always return initproc for non-traced processes. This fixes a regression in inferior(). Approved by: re (marius) Modified: stable/10/sys/kern/kern_descrip.c stable/10/sys/kern/vfs_vnops.c stable/10/sys/sys/file.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Fri Sep 26 19:56:52 2014 (r272186) +++ stable/10/sys/kern/kern_descrip.c Fri Sep 26 20:05:28 2014 (r272187) @@ -477,7 +477,6 @@ kern_fcntl(struct thread *td, int fd, in struct vnode *vp; cap_rights_t rights; int error, flg, tmp; - u_int old, new; uint64_t bsize; off_t foffset; @@ -761,26 +760,24 @@ kern_fcntl(struct thread *td, int fd, in error = EBADF; break; } + vp = fp->f_vnode; + /* + * Exclusive lock synchronizes against f_seqcount reads and + * writes in sequential_heuristic(). + */ + error = vn_lock(vp, LK_EXCLUSIVE); + if (error != 0) { + fdrop(fp, td); + break; + } if (arg >= 0) { - vp = fp->f_vnode; - error = vn_lock(vp, LK_SHARED); - if (error != 0) { - fdrop(fp, td); - break; - } bsize = fp->f_vnode->v_mount->mnt_stat.f_iosize; - VOP_UNLOCK(vp, 0); fp->f_seqcount = (arg + bsize - 1) / bsize; - do { - new = old = fp->f_flag; - new |= FRDAHEAD; - } while (!atomic_cmpset_rel_int(&fp->f_flag, old, new)); + atomic_set_int(&fp->f_flag, FRDAHEAD); } else { - do { - new = old = fp->f_flag; - new &= ~FRDAHEAD; - } while (!atomic_cmpset_rel_int(&fp->f_flag, old, new)); + atomic_clear_int(&fp->f_flag, FRDAHEAD); } + VOP_UNLOCK(vp, 0); fdrop(fp, td); break; Modified: stable/10/sys/kern/vfs_vnops.c ============================================================================== --- stable/10/sys/kern/vfs_vnops.c Fri Sep 26 19:56:52 2014 (r272186) +++ stable/10/sys/kern/vfs_vnops.c Fri Sep 26 20:05:28 2014 (r272187) @@ -438,7 +438,8 @@ static int sequential_heuristic(struct uio *uio, struct file *fp) { - if (atomic_load_acq_int(&(fp->f_flag)) & FRDAHEAD) + ASSERT_VOP_LOCKED(fp->f_vnode, __func__); + if (fp->f_flag & FRDAHEAD) return (fp->f_seqcount << IO_SEQSHIFT); /* Modified: stable/10/sys/sys/file.h ============================================================================== --- stable/10/sys/sys/file.h Fri Sep 26 19:56:52 2014 (r272186) +++ stable/10/sys/sys/file.h Fri Sep 26 20:05:28 2014 (r272187) @@ -139,6 +139,7 @@ struct fileops { * * Below is the list of locks that protects members in struct file. * + * (a) f_vnode lock required (shared allows both reads and writes) * (f) protected with mtx_lock(mtx_pool_find(fp)) * (d) cdevpriv_mtx * none not locked @@ -164,7 +165,7 @@ struct file { /* * DTYPE_VNODE specific fields. */ - int f_seqcount; /* Count of sequential accesses. */ + int f_seqcount; /* (a) Count of sequential accesses. */ off_t f_nextoff; /* next expected read/write offset. */ union { struct cdev_privdata *fvn_cdevpriv; From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 20:24:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A34F5DC; Fri, 26 Sep 2014 20:24:20 +0000 (UTC) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 741B5FB; Fri, 26 Sep 2014 20:24:19 +0000 (UTC) Received: by mail-wi0-f182.google.com with SMTP id d1so201920wiv.9 for ; Fri, 26 Sep 2014 13:24:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=eKTClaiMhfBMBfGtuHetbANAbPHjXrpDqutPbxEh75Y=; b=VJIr78kQ9M5XT5CG5rCxPERMZok/wx7/MxT2DgXkP+NPBWzO2HtOBIb0ygqVzcGQ+M acHezuEAWU9HOedErCzNHh12bDN/e5idKTRdN3GrYxa/xABFflHi0rDfYUhS+Etk022I SUtVoAQGnFvc/6yti+9tgr/fKxUuI10G7Q7A/Q/lTH+RSQWCncAdb9rASAeQTGra8QH3 RH25lqy08I0ExtHruK/2oGmo4mfhhT5EbTiy7N7fgqr4lH1mErgA64F0+jc4fNt91Bd7 O07hLskYuZ03MYvkWYwwAHsNjhhpXrhMl3AYu9odN5ZNxzK+GPLOpqNeIIfIOTe2MVsL aWhQ== X-Received: by 10.194.187.241 with SMTP id fv17mr26911352wjc.13.1411763057763; Fri, 26 Sep 2014 13:24:17 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id fo6sm3379415wic.3.2014.09.26.13.24.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 26 Sep 2014 13:24:16 -0700 (PDT) Date: Fri, 26 Sep 2014 22:24:14 +0200 From: Mateusz Guzik To: Mateusz Guzik Subject: Re: svn commit: r272187 - in stable/10/sys: kern sys Message-ID: <20140926202414.GB21954@dft-labs.eu> References: <201409262005.s8QK5TjD055931@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201409262005.s8QK5TjD055931@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 20:24:20 -0000 On Fri, Sep 26, 2014 at 08:05:29PM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Fri Sep 26 20:05:28 2014 > New Revision: 272187 > URL: http://svnweb.freebsd.org/changeset/base/272187 > > Log: > MFC r270993: > > Fix up proc_realparent to always return correct process. > > Prior to the change it would always return initproc for non-traced processes. > > This fixes a regression in inferior(). > > Approved by: re (marius) > Oops.. this is r270648. Still approvied by re (marius). > Modified: > stable/10/sys/kern/kern_descrip.c > stable/10/sys/kern/vfs_vnops.c > stable/10/sys/sys/file.h > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sys/kern/kern_descrip.c > ============================================================================== > --- stable/10/sys/kern/kern_descrip.c Fri Sep 26 19:56:52 2014 (r272186) > +++ stable/10/sys/kern/kern_descrip.c Fri Sep 26 20:05:28 2014 (r272187) > @@ -477,7 +477,6 @@ kern_fcntl(struct thread *td, int fd, in > struct vnode *vp; > cap_rights_t rights; > int error, flg, tmp; > - u_int old, new; > uint64_t bsize; > off_t foffset; > > @@ -761,26 +760,24 @@ kern_fcntl(struct thread *td, int fd, in > error = EBADF; > break; > } > + vp = fp->f_vnode; > + /* > + * Exclusive lock synchronizes against f_seqcount reads and > + * writes in sequential_heuristic(). > + */ > + error = vn_lock(vp, LK_EXCLUSIVE); > + if (error != 0) { > + fdrop(fp, td); > + break; > + } > if (arg >= 0) { > - vp = fp->f_vnode; > - error = vn_lock(vp, LK_SHARED); > - if (error != 0) { > - fdrop(fp, td); > - break; > - } > bsize = fp->f_vnode->v_mount->mnt_stat.f_iosize; > - VOP_UNLOCK(vp, 0); > fp->f_seqcount = (arg + bsize - 1) / bsize; > - do { > - new = old = fp->f_flag; > - new |= FRDAHEAD; > - } while (!atomic_cmpset_rel_int(&fp->f_flag, old, new)); > + atomic_set_int(&fp->f_flag, FRDAHEAD); > } else { > - do { > - new = old = fp->f_flag; > - new &= ~FRDAHEAD; > - } while (!atomic_cmpset_rel_int(&fp->f_flag, old, new)); > + atomic_clear_int(&fp->f_flag, FRDAHEAD); > } > + VOP_UNLOCK(vp, 0); > fdrop(fp, td); > break; > > > Modified: stable/10/sys/kern/vfs_vnops.c > ============================================================================== > --- stable/10/sys/kern/vfs_vnops.c Fri Sep 26 19:56:52 2014 (r272186) > +++ stable/10/sys/kern/vfs_vnops.c Fri Sep 26 20:05:28 2014 (r272187) > @@ -438,7 +438,8 @@ static int > sequential_heuristic(struct uio *uio, struct file *fp) > { > > - if (atomic_load_acq_int(&(fp->f_flag)) & FRDAHEAD) > + ASSERT_VOP_LOCKED(fp->f_vnode, __func__); > + if (fp->f_flag & FRDAHEAD) > return (fp->f_seqcount << IO_SEQSHIFT); > > /* > > Modified: stable/10/sys/sys/file.h > ============================================================================== > --- stable/10/sys/sys/file.h Fri Sep 26 19:56:52 2014 (r272186) > +++ stable/10/sys/sys/file.h Fri Sep 26 20:05:28 2014 (r272187) > @@ -139,6 +139,7 @@ struct fileops { > * > * Below is the list of locks that protects members in struct file. > * > + * (a) f_vnode lock required (shared allows both reads and writes) > * (f) protected with mtx_lock(mtx_pool_find(fp)) > * (d) cdevpriv_mtx > * none not locked > @@ -164,7 +165,7 @@ struct file { > /* > * DTYPE_VNODE specific fields. > */ > - int f_seqcount; /* Count of sequential accesses. */ > + int f_seqcount; /* (a) Count of sequential accesses. */ > off_t f_nextoff; /* next expected read/write offset. */ > union { > struct cdev_privdata *fvn_cdevpriv; > -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 21:14:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45325BE1; Fri, 26 Sep 2014 21:14:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EBCF99F; Fri, 26 Sep 2014 21:14:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QLErrC090186; Fri, 26 Sep 2014 21:14:53 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QLEr5L090185; Fri, 26 Sep 2014 21:14:53 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201409262114.s8QLEr5L090185@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 26 Sep 2014 21:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r272188 - svnadmin/hooks/scripts X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 21:14:53 -0000 Author: bdrewery Date: Fri Sep 26 21:14:52 2014 New Revision: 272188 URL: http://svnweb.freebsd.org/changeset/base/272188 Log: Use SSL for svnweb URL Modified: svnadmin/hooks/scripts/notify_bz.sh Modified: svnadmin/hooks/scripts/notify_bz.sh ============================================================================== --- svnadmin/hooks/scripts/notify_bz.sh Fri Sep 26 20:05:28 2014 (r272187) +++ svnadmin/hooks/scripts/notify_bz.sh Fri Sep 26 21:14:52 2014 (r272188) @@ -32,7 +32,7 @@ for pr in $PRS; do echo "Author: $WHO" echo "Date: $(date)" echo "New revision: $REV" - echo "URL: http://svnweb.freebsd.org/changeset/base/$REV" + echo "URL: https://svnweb.freebsd.org/changeset/base/$REV" echo "" echo "Log:" svnlook log "$REPO" -r "$REV" | sed -e 's/^/ /' From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 21:46:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3DBC5D9; Fri, 26 Sep 2014 21:46:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FD30CC9; Fri, 26 Sep 2014 21:46:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QLkXJ3006260; Fri, 26 Sep 2014 21:46:33 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QLkXMU006259; Fri, 26 Sep 2014 21:46:33 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409262146.s8QLkXMU006259@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 26 Sep 2014 21:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272189 - head/cddl/lib/libzfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 21:46:33 -0000 Author: delphij Date: Fri Sep 26 21:46:32 2014 New Revision: 272189 URL: http://svnweb.freebsd.org/changeset/base/272189 Log: Add libuutil to dependency list. Noticed by: sef MFC after: 3 days Modified: head/cddl/lib/libzfs/Makefile Modified: head/cddl/lib/libzfs/Makefile ============================================================================== --- head/cddl/lib/libzfs/Makefile Fri Sep 26 21:14:52 2014 (r272188) +++ head/cddl/lib/libzfs/Makefile Fri Sep 26 21:46:32 2014 (r272189) @@ -7,8 +7,8 @@ LIB= zfs DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} ${LIBNVPAIR} \ - ${LIBAVL} ${LIBZFS_CORE} -LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair -lavl -lzfs_core + ${LIBUUTIL} ${LIBAVL} ${LIBZFS_CORE} +LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair -luutil -lavl -lzfs_core SRCS= deviceid.c \ fsshare.c \ From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 22:21:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A98E6C3F; Fri, 26 Sep 2014 22:21:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94E48A3; Fri, 26 Sep 2014 22:21:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QML38o025289; Fri, 26 Sep 2014 22:21:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QML3kq025288; Fri, 26 Sep 2014 22:21:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201409262221.s8QML3kq025288@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 26 Sep 2014 22:21:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272190 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 22:21:03 -0000 Author: np Date: Fri Sep 26 22:21:02 2014 New Revision: 272190 URL: http://svnweb.freebsd.org/changeset/base/272190 Log: cxgbe(4): explicitly set various if_hw_tso* values. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Sep 26 21:46:32 2014 (r272189) +++ head/sys/dev/cxgbe/t4_main.c Fri Sep 26 22:21:02 2014 (r272190) @@ -1083,6 +1083,10 @@ cxgbe_attach(device_t dev) ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO | CSUM_UDP_IPV6 | CSUM_TCP_IPV6; + ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS; + ifp->if_hw_tsomaxsegsize = 65536; + /* Initialize ifmedia for this port */ ifmedia_init(&pi->media, IFM_IMASK, cxgbe_media_change, cxgbe_media_status); From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 22:54:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2132052A; Fri, 26 Sep 2014 22:54:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD2E614; Fri, 26 Sep 2014 22:54:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QMsB0S039669; Fri, 26 Sep 2014 22:54:11 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QMsBnx039667; Fri, 26 Sep 2014 22:54:11 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201409262254.s8QMsBnx039667@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 26 Sep 2014 22:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272191 - stable/10/usr.sbin/sysrc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 22:54:12 -0000 Author: dteske Date: Fri Sep 26 22:54:10 2014 New Revision: 272191 URL: http://svnweb.freebsd.org/changeset/base/272191 Log: MFC revisions 268860, 268863: r268860: Minor enhancements, bug fixes, and man-page adjustments. r268863: Bump .Dd in manual Reported by: lme Approved by: re (gjb) Modified: stable/10/usr.sbin/sysrc/sysrc stable/10/usr.sbin/sysrc/sysrc.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/sysrc/sysrc ============================================================================== --- stable/10/usr.sbin/sysrc/sysrc Fri Sep 26 22:21:02 2014 (r272190) +++ stable/10/usr.sbin/sysrc/sysrc Fri Sep 26 22:54:10 2014 (r272191) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2010-2013 Devin Teske +# Copyright (c) 2010-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -40,7 +40,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" # # Version information # -SYSRC_VERSION="6.0 Nov-07,2013" +SYSRC_VERSION="6.1 Jul-18,2014" # # Options @@ -102,7 +102,7 @@ help() f_err "$optfmt" "-A" \ "Dump a list of all configuration variables (incl. defaults)." f_err "$optfmt" "-c" \ - "Check. Return success if no changes needed, else error." + "Check. Return success if set or no changes, else error." f_err "$optfmt" "-d" \ "Print a description of the given variable." f_err "$optfmt" "-D" \ @@ -134,7 +134,7 @@ help() f_err "$optfmt" "-N" \ "Show only variable names, not their values." f_err "$optfmt" "-q" \ - "Quiet. Ignore previous \`-v' and/or SYSRC_VERBOSE." + "Quiet. Disable verbose and hide certain errors." f_err "$optfmt" "-R dir" \ "Operate within the root directory \`dir' rather than \`/'." f_err "$optfmt" "-v" \ @@ -152,8 +152,6 @@ help() "Override default rc_conf_files (even if set to NULL)." f_err "$envfmt" "RC_DEFAULTS" \ "Location of \`/etc/defaults/rc.conf' file." - f_err "$envfmt" "SYSRC_VERBOSE" \ - "Default verbosity. Set to non-NULL to enable." die } @@ -527,7 +525,7 @@ fi # # Process command-line arguments # -costatus=$SUCCESS +status=$SUCCESS while [ $# -gt 0 ]; do NAME="${1%%=*}" @@ -558,7 +556,7 @@ while [ $# -gt 0 ]; do # desire to set some value # if [ "$DELETE" ]; then - f_sysrc_delete "$NAME" + f_sysrc_delete "$NAME" || status=$FAILURE shift 1 continue fi @@ -568,10 +566,23 @@ while [ $# -gt 0 ]; do # if [ "$CHECK_ONLY" ]; then if ! IGNORED=$( f_sysrc_get "$NAME?" ); then - costatus=$FAILURE - else - value=$( f_sysrc_get "$NAME" ) - [ "$value" = "${1#*=}" ] || costatus=$FAILURE + status=$FAILURE + [ "$SYSRC_VERBOSE" ] && + echo "$NAME: not currently set" + shift 1 + continue + fi + value=$( f_sysrc_get "$NAME" ) + if [ "$value" != "${1#*=}" ]; then + status=$FAILURE + if [ "$SYSRC_VERBOSE" ]; then + echo -n "$( f_sysrc_find "$NAME" ): " + echo -n "$NAME: would change from " + echo "\`$value' to \`${1#*=}'" + fi + elif [ "$SYSRC_VERBOSE" ]; then + echo -n "$( f_sysrc_find "$NAME" ): " + echo "$NAME: already set to \`$value'" fi shift 1 continue @@ -604,10 +615,10 @@ while [ $# -gt 0 ]; do ;; *) if ! IGNORED=$( f_sysrc_get "$NAME?" ); then - [ "$IGNORE_UNKNOWNS" ] || + [ "$IGNORE_UNKNOWNS" -o "$QUIET" ] || echo "$pgm: unknown variable '$NAME'" shift 1 - costatus=$FAILURE + status=$FAILURE continue fi @@ -631,7 +642,7 @@ while [ $# -gt 0 ]; do # If `-x' or `-X' is passed, delete the variable # if [ "$DELETE" ]; then - f_sysrc_delete "$NAME" + f_sysrc_delete "$NAME" || status=$FAILURE shift 1 continue fi @@ -667,7 +678,7 @@ while [ $# -gt 0 ]; do shift 1 done -[ ! "$CHECK_ONLY" ] || exit $costatus +exit $status # $SUCCESS unless error occurred with either `-c' or `-x' ################################################################################ # END Modified: stable/10/usr.sbin/sysrc/sysrc.8 ============================================================================== --- stable/10/usr.sbin/sysrc/sysrc.8 Fri Sep 26 22:21:02 2014 (r272190) +++ stable/10/usr.sbin/sysrc/sysrc.8 Fri Sep 26 22:54:10 2014 (r272191) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2013 Devin Teske +.\" Copyright (c) 2011-2014 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Nov 20, 2013 +.Dd Jul 18, 2014 .Dt SYSRC 8 .Os .Sh NAME @@ -58,11 +58,14 @@ Dump a list of all non-default configura Dump a list of all configuration variables .Pq incl. defaults . .It Fl c -Check if the value will change when assigning a new value. +Check only. +For querying, return success if all requested variables are set +.Pq even if NULL , +otherwise return error status. +For assignments, return success if no changes are required, otherwise failure. If verbose .Pq see Dq Fl v -prints a message stating whether a change would occur. -Exits with success if no change is necessary, else returns error status. +prints a message stating whether variables are set and/or changes are required. .It Fl d Print a description of the given variable. .It Fl D @@ -108,14 +111,12 @@ Show only variable values, not their nam Show only variable names, not their values. .It Fl q Quiet. -Ignore previous occurrences of -.Fl v -flag. +Disable verbose and hide certain errors. .It Fl R Ar dir Operate within the root directory -.Pq Sq Ar dir +.Sq Ar dir rather than -.Pq Sq / . +.Sq / . .It Fl v Verbose. Print the pathname of the specific @@ -127,13 +128,13 @@ Print version information to stdout and Remove variable(s) from specified file(s). .El .Pp -This utility works similar to +This utility has a similar syntax to .Xr sysctl 8 . It shares the `-e' and `-n' options .Pq detailed above and also has the same .Ql name[=value] -syntax for querying/setting configuration options. +syntax for making queries/assignments. .Pp However, while .Xr sysctl 8 @@ -304,5 +305,5 @@ utility first appeared in .An Devin Teske Aq dteske@FreeBSD.org .Sh THANKS TO Brandon Gooch, Garrett Cooper, Julian Elischer, Pawel Jakub Dawidek, -Cyrille Lefevre, Ross West, Stefan Esser, Marco Steinbach, and Jilles Tjoelker -for suggestions and help. +Cyrille Lefevre, Ross West, Stefan Esser, Marco Steinbach, Jilles Tjoelker, +Allan Jude, and Lars Engels for suggestions, help, and testing. From owner-svn-src-all@FreeBSD.ORG Fri Sep 26 23:01:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82AD3705; Fri, 26 Sep 2014 23:01:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 627EE65F; Fri, 26 Sep 2014 23:01:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8QN1SRb041949; Fri, 26 Sep 2014 23:01:28 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8QN1RfF041945; Fri, 26 Sep 2014 23:01:27 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201409262301.s8QN1RfF041945@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 26 Sep 2014 23:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272192 - stable/10/usr.sbin/pw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 23:01:28 -0000 Author: dteske Date: Fri Sep 26 23:01:27 2014 New Revision: 272192 URL: http://svnweb.freebsd.org/changeset/base/272192 Log: MFC revisions 262864-262865, 263114, 267970: r262864: Stop pw(8) from segfaulting when given certain input (julian) r262865: Part 2 of bug 187310 (julian) r263114: Fix pw(8) edge-case deletion of group "username" on userdel r267970: Fix infinite-loop during deletion of users from groups PR: 187310, 169471, 191427 Submitted by: Voradesh Yenbut, Alexander Pyhalov, Kim Shrier Obtained from: bug Approved by: re (gjb) Modified: stable/10/usr.sbin/pw/pw_group.c stable/10/usr.sbin/pw/pw_user.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pw/pw_group.c ============================================================================== --- stable/10/usr.sbin/pw/pw_group.c Fri Sep 26 22:54:10 2014 (r272191) +++ stable/10/usr.sbin/pw/pw_group.c Fri Sep 26 23:01:27 2014 (r272192) @@ -227,10 +227,12 @@ pw_group(struct userconf * cnf, int mode else if (arg->ch == 'm') { int k = 0; - while (grp->gr_mem[k] != NULL) { - if (extendarray(&members, &grmembers, i + 2) != -1) - members[i++] = grp->gr_mem[k]; - k++; + if (grp->gr_mem != NULL) { + while (grp->gr_mem[k] != NULL) { + if (extendarray(&members, &grmembers, i + 2) != -1) + members[i++] = grp->gr_mem[k]; + k++; + } } } @@ -311,6 +313,9 @@ delete_members(char ***members, int *grm int k; struct passwd *pwd; + if (grp->gr_mem == NULL) + return; + k = 0; while (grp->gr_mem[k] != NULL) { matchFound = false; @@ -415,8 +420,10 @@ print_group(struct group * grp, int pret printf("Group Name: %-15s #%lu\n" " Members: ", grp->gr_name, (long) grp->gr_gid); - for (i = 0; grp->gr_mem[i]; i++) - printf("%s%s", i ? "," : "", grp->gr_mem[i]); + if (grp->gr_mem != NULL) { + for (i = 0; grp->gr_mem[i]; i++) + printf("%s%s", i ? "," : "", grp->gr_mem[i]); + } fputs("\n\n", stdout); } return EXIT_SUCCESS; Modified: stable/10/usr.sbin/pw/pw_user.c ============================================================================== --- stable/10/usr.sbin/pw/pw_user.c Fri Sep 26 22:54:10 2014 (r272191) +++ stable/10/usr.sbin/pw/pw_user.c Fri Sep 26 23:01:27 2014 (r272192) @@ -380,6 +380,8 @@ pw_user(struct userconf * cnf, int mode, char file[MAXPATHLEN]; char home[MAXPATHLEN]; uid_t uid = pwd->pw_uid; + struct group *gr; + char grname[LOGNAMESIZE]; if (strcmp(pwd->pw_name, "root") == 0) errx(EX_DATAERR, "cannot remove user 'root'"); @@ -406,6 +408,11 @@ pw_user(struct userconf * cnf, int mode, */ sprintf(file, "%s/%s", _PATH_MAILDIR, pwd->pw_name); strlcpy(home, pwd->pw_dir, sizeof(home)); + gr = GETGRGID(pwd->pw_gid); + if (gr != NULL) + strlcpy(grname, gr->gr_name, LOGNAMESIZE); + else + grname[0] = '\0'; rc = delpwent(pwd); if (rc == -1) @@ -425,19 +432,22 @@ pw_user(struct userconf * cnf, int mode, } grp = GETGRNAM(a_name->val); - if (grp != NULL && *grp->gr_mem == NULL) + if (grp != NULL && + (grp->gr_mem == NULL || *grp->gr_mem == NULL) && + strcmp(a_name->val, grname) == 0) delgrent(GETGRNAM(a_name->val)); SETGRENT(); while ((grp = GETGRENT()) != NULL) { - int i; + int i, j; char group[MAXLOGNAME]; - for (i = 0; grp->gr_mem[i] != NULL; i++) { - if (!strcmp(grp->gr_mem[i], a_name->val)) { - while (grp->gr_mem[i] != NULL) { - grp->gr_mem[i] = grp->gr_mem[i+1]; - } - strlcpy(group, grp->gr_name, MAXLOGNAME); - chggrent(group, grp); + if (grp->gr_mem != NULL) { + for (i = 0; grp->gr_mem[i] != NULL; i++) { + if (!strcmp(grp->gr_mem[i], a_name->val)) { + for (j = i; grp->gr_mem[j] != NULL; j++) + grp->gr_mem[j] = grp->gr_mem[j+1]; + strlcpy(group, grp->gr_name, MAXLOGNAME); + chggrent(group, grp); + } } } } @@ -908,7 +918,8 @@ pw_gidpolicy(struct userconf * cnf, stru errx(EX_NOUSER, "group `%s' is not defined", a_gid->val); } gid = grp->gr_gid; - } else if ((grp = GETGRNAM(nam)) != NULL && grp->gr_mem[0] == NULL) { + } else if ((grp = GETGRNAM(nam)) != NULL && + (grp->gr_mem == NULL || grp->gr_mem[0] == NULL)) { gid = grp->gr_gid; /* Already created? Use it anyway... */ } else { struct cargs grpargs; @@ -1182,14 +1193,16 @@ print_user(struct passwd * pwd, int pret while ((grp=GETGRENT()) != NULL) { int i = 0; - while (grp->gr_mem[i] != NULL) - { - if (strcmp(grp->gr_mem[i], pwd->pw_name)==0) + if (grp->gr_mem != NULL) { + while (grp->gr_mem[i] != NULL) { - printf(j++ == 0 ? " Groups: %s" : ",%s", grp->gr_name); - break; + if (strcmp(grp->gr_mem[i], pwd->pw_name)==0) + { + printf(j++ == 0 ? " Groups: %s" : ",%s", grp->gr_name); + break; + } + ++i; } - ++i; } } ENDGRENT(); From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 01:15:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 447ED3D8; Sat, 27 Sep 2014 01:15:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F352234; Sat, 27 Sep 2014 01:15:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R1FPaK005866; Sat, 27 Sep 2014 01:15:25 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R1FPVP005865; Sat, 27 Sep 2014 01:15:25 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201409270115.s8R1FPVP005865@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Sat, 27 Sep 2014 01:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272193 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 01:15:25 -0000 Author: grehan Date: Sat Sep 27 01:15:24 2014 New Revision: 272193 URL: http://svnweb.freebsd.org/changeset/base/272193 Log: Allow the PIC's IMR register to be read before ICW initialisation. As of git submit e179f6914152eca9, the Linux kernel does a simple probe of the PIC by writing a pattern to the IMR and then reading it back, prior to the init sequence of ICW words. The bhyve PIC emulation wasn't allowing the IMR to be read until the ICW sequence was complete. This limitation isn't required so relax the test. With this change, Linux kernels 3.15-rc2 and later won't hang on boot when calibrating the local APIC. Reviewed by: tychon MFC after: 3 days Modified: head/sys/amd64/vmm/io/vatpic.c Modified: head/sys/amd64/vmm/io/vatpic.c ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Fri Sep 26 23:01:27 2014 (r272192) +++ head/sys/amd64/vmm/io/vatpic.c Sat Sep 27 01:15:24 2014 (r272193) @@ -606,20 +606,19 @@ vatpic_write(struct vatpic *vatpic, stru VATPIC_LOCK(vatpic); if (port & ICU_IMR_OFFSET) { - if (atpic->ready) { + switch (atpic->icw_num) { + case 2: + error = vatpic_icw2(vatpic, atpic, val); + break; + case 3: + error = vatpic_icw3(vatpic, atpic, val); + break; + case 4: + error = vatpic_icw4(vatpic, atpic, val); + break; + default: error = vatpic_ocw1(vatpic, atpic, val); - } else { - switch (atpic->icw_num) { - case 2: - error = vatpic_icw2(vatpic, atpic, val); - break; - case 3: - error = vatpic_icw3(vatpic, atpic, val); - break; - case 4: - error = vatpic_icw4(vatpic, atpic, val); - break; - } + break; } } else { if (val & (1 << 4)) From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 01:39:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A16D27D9; Sat, 27 Sep 2014 01:39:44 +0000 (UTC) Received: from mail-la0-x229.google.com (mail-la0-x229.google.com [IPv6:2a00:1450:4010:c03::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99194630; Sat, 27 Sep 2014 01:39:43 +0000 (UTC) Received: by mail-la0-f41.google.com with SMTP id pn19so87444lab.0 for ; Fri, 26 Sep 2014 18:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=gg/jmHIUOQ18zdAJOT9Lf0auJ7TM6zB7ElpNL6jvTIA=; b=UimNWL/snSusUKNUynjgvN7ulSUfLabnDBBwL7tLmMxCioStqb7VfKVKetMk8Kni0C WrqLgMp20N5MrWQQIYE0kfHuUHUsW8DjIpTTfrjo5vxJ72NI0L3E6Mp2ab1EDJBn1hOF 7Xo0xiLF+OaHhAi8cvr0zwX9S+l36FIoCmF1wMfuUjHO0NlPv18Fsn0njEXsZ4ozSMxA nglnPVqaVvdtRZLNptvyA6W4lsZirZYmohQudr+AeQSgqb+f7cnnp2daNIrlut+SqTxP 2aFzmMJE+Pl/ERZsux2mikLsYm7yYC42kluwPKCVVyUFNemarJ1M8m8/PMwuh6or73vG +XHA== MIME-Version: 1.0 X-Received: by 10.112.144.228 with SMTP id sp4mr23168994lbb.54.1411781981487; Fri, 26 Sep 2014 18:39:41 -0700 (PDT) Received: by 10.25.42.146 with HTTP; Fri, 26 Sep 2014 18:39:41 -0700 (PDT) In-Reply-To: <201409262146.s8QLkXMU006259@svn.freebsd.org> References: <201409262146.s8QLkXMU006259@svn.freebsd.org> Date: Fri, 26 Sep 2014 18:39:41 -0700 Message-ID: Subject: Re: svn commit: r272189 - head/cddl/lib/libzfs From: NGie Cooper To: Xin LI Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 01:39:44 -0000 On Fri, Sep 26, 2014 at 2:46 PM, Xin LI wrote: > Author: delphij > Date: Fri Sep 26 21:46:32 2014 > New Revision: 272189 > URL: http://svnweb.freebsd.org/changeset/base/272189 > > Log: > Add libuutil to dependency list. I think this broke the build: --- cddl/lib__L --- /usr/obj: cannot find -luutil cc: error: linker command failed with exit code 1 (use -v to see invocation) *** [libzfs.so.2] Error code 1 From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 01:50:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F255A61; Sat, 27 Sep 2014 01:50:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49391751; Sat, 27 Sep 2014 01:50:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R1o4Zq020745; Sat, 27 Sep 2014 01:50:04 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R1o4oa020744; Sat, 27 Sep 2014 01:50:04 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201409270150.s8R1o4oa020744@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sat, 27 Sep 2014 01:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272194 - stable/10/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 01:50:04 -0000 Author: dteske Date: Sat Sep 27 01:50:03 2014 New Revision: 272194 URL: http://svnweb.freebsd.org/changeset/base/272194 Log: MFC revisions 271553, 271567: r271553: Rename choices in partitioning method dialog (nwhitehorn) r271567: ZFS support isn't actually experimental anymore (nwhitehorn) Approved by: re (gjb) Modified: stable/10/usr.sbin/bsdinstall/scripts/auto Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/auto Sat Sep 27 01:15:24 2014 (r272193) +++ stable/10/usr.sbin/bsdinstall/scripts/auto Sat Sep 27 01:50:03 2014 (r272194) @@ -107,14 +107,14 @@ rm -f $PATH_FSTAB touch $PATH_FSTAB PMODES="\ -Guided \"Partitioning Tool (Recommended for Beginners)\" \ -Manual \"Manually Configure Partitions (Expert)\" \ +\"Auto (UFS)\" \"Guided Disk Setup\" \ +Manual \"Manual Disk Setup (experts)\" \ Shell \"Open a shell and partition by hand\"" CURARCH=$( uname -m ) case $CURARCH in amd64|i386) # Booting ZFS Supported - PMODES="$PMODES ZFS \"Automatic Root-on-ZFS (Experimental)\"" + PMODES="$PMODES \"Auto (ZFS)\" \"Guided Root-on-ZFS\"" ;; *) # Booting ZFS Unspported ;; @@ -128,7 +128,7 @@ PARTMODE=`echo $PMODES | xargs dialog -- exec 3>&- case "$PARTMODE" in -"Guided") # Guided +"Auto (UFS)") # Guided bsdinstall autopart || error "Partitioning error" bsdinstall mount || error "Failed to mount filesystem" ;; @@ -146,7 +146,7 @@ case "$PARTMODE" in fi bsdinstall mount || error "Failed to mount filesystem" ;; -"ZFS") # ZFS +"Auto (ZFS)") # ZFS bsdinstall zfsboot || error "ZFS setup failed" bsdinstall mount || error "Failed to mount filesystem" ;; From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 02:15:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 294DFFF1; Sat, 27 Sep 2014 02:15:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1274299A; Sat, 27 Sep 2014 02:15:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R2Fjod034389; Sat, 27 Sep 2014 02:15:45 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R2FjaF034388; Sat, 27 Sep 2014 02:15:45 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201409270215.s8R2FjaF034388@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Sat, 27 Sep 2014 02:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272196 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 02:15:46 -0000 Author: kevlo Date: Sat Sep 27 02:15:45 2014 New Revision: 272196 URL: http://svnweb.freebsd.org/changeset/base/272196 Log: Remove a bogus AIC. Reviewed by: imp Modified: head/sys/arm/at91/at91rm9200.c Modified: head/sys/arm/at91/at91rm9200.c ============================================================================== --- head/sys/arm/at91/at91rm9200.c Sat Sep 27 02:04:58 2014 (r272195) +++ head/sys/arm/at91/at91rm9200.c Sat Sep 27 02:15:45 2014 (r272196) @@ -105,7 +105,7 @@ static const uint32_t at91_pio_base[] = static const struct cpu_devs at91_devs[] = { - DEVICE("at91_aic", AIC, 0), + DEVICE("at91_aic", AIC, 0), DEVICE("at91_pmc", PMC, 0), DEVICE("at91_st", ST, 0), DEVICE("at91_pio", PIOA, 0), @@ -128,7 +128,6 @@ static const struct cpu_devs at91_devs[] DEVICE("uart", USART1, 2), DEVICE("uart", USART2, 3), DEVICE("uart", USART3, 4), - DEVICE("at91_aic", AIC, 0), DEVICE("at91_mc", MC, 0), DEVICE("at91_tc", TC0, 0), DEVICE("at91_tc", TC1, 1), From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 03:43:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7467997A; Sat, 27 Sep 2014 03:43:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E79F1A9; Sat, 27 Sep 2014 03:43:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R3hojf076436; Sat, 27 Sep 2014 03:43:50 GMT (envelope-from neel@FreeBSD.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R3hovW076435; Sat, 27 Sep 2014 03:43:50 GMT (envelope-from neel@FreeBSD.org) Message-Id: <201409270343.s8R3hovW076435@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: neel set sender to neel@FreeBSD.org using -f From: Neel Natu Date: Sat, 27 Sep 2014 03:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272197 - head/usr.sbin/bhyvectl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 03:43:50 -0000 Author: neel Date: Sat Sep 27 03:43:49 2014 New Revision: 272197 URL: http://svnweb.freebsd.org/changeset/base/272197 Log: After r271635 mmap(2) requires either MAP_PRIVATE or MAP_SHARED for non-anonymous mappings. This gets 'bhyvectl --get-all' working again. Reported by: Anish Gupta (akgupt3@gmail.com) Modified: head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- head/usr.sbin/bhyvectl/bhyvectl.c Sat Sep 27 02:15:45 2014 (r272196) +++ head/usr.sbin/bhyvectl/bhyvectl.c Sat Sep 27 03:43:49 2014 (r272197) @@ -309,7 +309,7 @@ dump_vmcs_msr_bitmap(int vcpu, u_long ad if (fd < 0) goto done; - bitmap = mmap(NULL, PAGE_SIZE, PROT_READ, 0, fd, addr); + bitmap = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, fd, addr); if (bitmap == MAP_FAILED) goto done; From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 04:53:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21E1E9FB; Sat, 27 Sep 2014 04:53:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CC41AB0; Sat, 27 Sep 2014 04:53:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R4rpm4010519; Sat, 27 Sep 2014 04:53:51 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R4rptI010517; Sat, 27 Sep 2014 04:53:51 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409270453.s8R4rptI010517@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sat, 27 Sep 2014 04:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272198 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 04:53:52 -0000 Author: marcel Date: Sat Sep 27 04:53:51 2014 New Revision: 272198 URL: http://svnweb.freebsd.org/changeset/base/272198 Log: Add 3 long options for getting information about mkimg itself: --version print the version of mkimg and also whether it's 64- or 32-bit. --formats list the supported output formats separated by space. --schemes list the supported partitioning schemes separated by space. Inspired by a patch from: gjb@ MFC after: 1 week Relnotes: yes Modified: head/usr.bin/mkimg/Makefile head/usr.bin/mkimg/mkimg.c Modified: head/usr.bin/mkimg/Makefile ============================================================================== --- head/usr.bin/mkimg/Makefile Sat Sep 27 03:43:49 2014 (r272197) +++ head/usr.bin/mkimg/Makefile Sat Sep 27 04:53:51 2014 (r272198) @@ -6,6 +6,8 @@ PROG= mkimg SRCS= format.c image.c mkimg.c scheme.c MAN= mkimg.1 +MKIMG_VERSION=20140926 +CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION} CFLAGS+=-DSPARSE_WRITE # List of formats to support Modified: head/usr.bin/mkimg/mkimg.c ============================================================================== --- head/usr.bin/mkimg/mkimg.c Sat Sep 27 03:43:49 2014 (r272197) +++ head/usr.bin/mkimg/mkimg.c Sat Sep 27 04:53:51 2014 (r272198) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -48,6 +49,17 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" +#define LONGOPT_FORMATS 0x01000001 +#define LONGOPT_SCHEMES 0x01000002 +#define LONGOPT_VERSION 0x01000003 + +static struct option longopts[] = { + { "formats", no_argument, NULL, LONGOPT_FORMATS }, + { "schemes", no_argument, NULL, LONGOPT_SCHEMES }, + { "version", no_argument, NULL, LONGOPT_VERSION }, + { NULL, 0, NULL, 0 } +}; + struct partlisthead partlist = STAILQ_HEAD_INITIALIZER(partlist); u_int nparts = 0; @@ -61,10 +73,69 @@ u_int secsz = 512; u_int blksz = 0; static void -usage(const char *why) +print_formats(int usage) { struct mkimg_format *f, **f_iter; + const char *sep; + + if (usage) { + fprintf(stderr, "\n formats:\n"); + SET_FOREACH(f_iter, formats) { + f = *f_iter; + fprintf(stderr, "\t%s\t- %s\n", f->name, + f->description); + } + } else { + sep = ""; + SET_FOREACH(f_iter, formats) { + f = *f_iter; + printf("%s%s", sep, f->name); + sep = " "; + } + putchar('\n'); + } +} + +static void +print_schemes(int usage) +{ struct mkimg_scheme *s, **s_iter; + const char *sep; + + if (usage) { + fprintf(stderr, "\n schemes:\n"); + SET_FOREACH(s_iter, schemes) { + s = *s_iter; + fprintf(stderr, "\t%s\t- %s\n", s->name, + s->description); + } + } else { + sep = ""; + SET_FOREACH(s_iter, schemes) { + s = *s_iter; + printf("%s%s", sep, s->name); + sep = " "; + } + putchar('\n'); + } +} + +static void +print_version(void) +{ + u_int width; + +#ifdef __LP64__ + width = 64; +#else + width = 32; +#endif + printf("mkimg %u (%u-bit)\n", MKIMG_VERSION, width); +} + +static void +usage(const char *why) +{ warnx("error: %s", why); fprintf(stderr, "\nusage: %s \n", getprogname()); @@ -82,17 +153,8 @@ usage(const char *why) fprintf(stderr, "\t-S \t- logical sector size\n"); fprintf(stderr, "\t-T \t- number of tracks to simulate\n"); - fprintf(stderr, "\n formats:\n"); - SET_FOREACH(f_iter, formats) { - f = *f_iter; - fprintf(stderr, "\t%s\t- %s\n", f->name, f->description); - } - - fprintf(stderr, "\n schemes:\n"); - SET_FOREACH(s_iter, schemes) { - s = *s_iter; - fprintf(stderr, "\t%s\t- %s\n", s->name, s->description); - } + print_formats(1); + print_schemes(1); fprintf(stderr, "\n partition specification:\n"); fprintf(stderr, "\t[/]::\t- empty partition of given " @@ -366,7 +428,8 @@ main(int argc, char *argv[]) bcfd = -1; outfd = 1; /* Write to stdout by default */ - while ((c = getopt(argc, argv, "b:f:o:p:s:vyH:P:S:T:")) != -1) { + while ((c = getopt_long(argc, argv, "b:f:o:p:s:vyH:P:S:T:", + longopts, NULL)) != -1) { switch (c) { case 'b': /* BOOT CODE */ if (bcfd != -1) @@ -432,6 +495,18 @@ main(int argc, char *argv[]) if (error) errc(EX_DATAERR, error, "track size"); break; + case LONGOPT_FORMATS: + print_formats(0); + exit(EX_OK); + /*NOTREACHED*/ + case LONGOPT_SCHEMES: + print_schemes(0); + exit(EX_OK); + /*NOTREACHED*/ + case LONGOPT_VERSION: + print_version(); + exit(EX_OK); + /*NOTREACHED*/ default: usage("unknown option"); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 05:14:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08D7CD56; Sat, 27 Sep 2014 05:14:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8BEEC3F; Sat, 27 Sep 2014 05:14:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R5E2Jt020156; Sat, 27 Sep 2014 05:14:02 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R5E27L020155; Sat, 27 Sep 2014 05:14:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201409270514.s8R5E27L020155@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 27 Sep 2014 05:14:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272199 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 05:14:03 -0000 Author: adrian Date: Sat Sep 27 05:14:02 2014 New Revision: 272199 URL: http://svnweb.freebsd.org/changeset/base/272199 Log: Remove an un-needed bit of pre-processor work - it all lives inside #ifdef RSS. Modified: head/sys/netinet/ip_input.c Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Sat Sep 27 04:53:51 2014 (r272198) +++ head/sys/netinet/ip_input.c Sat Sep 27 05:14:02 2014 (r272199) @@ -1222,9 +1222,7 @@ found: M_HASHTYPE_SET(m, rss_type); m->m_flags |= M_FLOWID; } -#endif -#ifdef RSS /* * Queue/dispatch for reprocessing. * From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 05:50:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 085AA4B7; Sat, 27 Sep 2014 05:50:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E876BEC6; Sat, 27 Sep 2014 05:50:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R5oVAG036366; Sat, 27 Sep 2014 05:50:31 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R5oV9e036364; Sat, 27 Sep 2014 05:50:31 GMT (envelope-from np@FreeBSD.org) Message-Id: <201409270550.s8R5oV9e036364@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 27 Sep 2014 05:50:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272200 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 05:50:32 -0000 Author: np Date: Sat Sep 27 05:50:31 2014 New Revision: 272200 URL: http://svnweb.freebsd.org/changeset/base/272200 Log: cxgbe(4): implement if_get_counter. Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sat Sep 27 05:14:02 2014 (r272199) +++ head/sys/dev/cxgbe/adapter.h Sat Sep 27 05:50:31 2014 (r272200) @@ -268,7 +268,10 @@ struct port_info { int linkdnrc; struct link_config link_cfg; - struct port_stats stats; + + struct timeval last_refreshed; + struct port_stats stats; + u_int tnl_cong_drops; eventhandler_tag vlan_c; @@ -790,6 +793,8 @@ struct adapter { TAILQ_HEAD(, sge_fl) sfl; struct callout sfl_callout; + struct mtx regwin_lock; /* for indirect reads and memory windows */ + an_handler_t an_handler __aligned(CACHE_LINE_SIZE); fw_msg_handler_t fw_msg_handler[5]; /* NUM_FW6_TYPES */ cpl_handler_t cpl_handler[0xef]; /* NUM_CPL_CMDS */ Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Sep 27 05:14:02 2014 (r272199) +++ head/sys/dev/cxgbe/t4_main.c Sat Sep 27 05:50:31 2014 (r272200) @@ -151,6 +151,7 @@ static void cxgbe_init(void *); static int cxgbe_ioctl(struct ifnet *, unsigned long, caddr_t); static int cxgbe_transmit(struct ifnet *, struct mbuf *); static void cxgbe_qflush(struct ifnet *); +static uint64_t cxgbe_get_counter(struct ifnet *, ift_counter); static int cxgbe_media_change(struct ifnet *); static void cxgbe_media_status(struct ifnet *, struct ifmediareq *); @@ -386,6 +387,7 @@ static int t4_free_irq(struct adapter *, static void reg_block_dump(struct adapter *, uint8_t *, unsigned int, unsigned int); static void t4_get_regs(struct adapter *, struct t4_regdump *, uint8_t *); +static void cxgbe_refresh_stats(struct adapter *, struct port_info *); static void cxgbe_tick(void *); static void cxgbe_vlan_config(void *, struct ifnet *, uint16_t); static int cpl_not_handled(struct sge_iq *, const struct rss_header *, @@ -609,6 +611,8 @@ t4_attach(device_t dev) TAILQ_INIT(&sc->sfl); callout_init(&sc->sfl_callout, CALLOUT_MPSAFE); + mtx_init(&sc->regwin_lock, "register and memory window", 0, MTX_DEF); + rc = map_bars_0_and_4(sc); if (rc != 0) goto done; /* error message displayed already */ @@ -1024,6 +1028,8 @@ t4_detach(device_t dev) mtx_destroy(&sc->sfl_lock); if (mtx_initialized(&sc->ifp_lock)) mtx_destroy(&sc->ifp_lock); + if (mtx_initialized(&sc->regwin_lock)) + mtx_destroy(&sc->regwin_lock); bzero(sc, sizeof(*sc)); @@ -1073,6 +1079,7 @@ cxgbe_attach(device_t dev) ifp->if_ioctl = cxgbe_ioctl; ifp->if_transmit = cxgbe_transmit; ifp->if_qflush = cxgbe_qflush; + ifp->if_get_counter = cxgbe_get_counter; ifp->if_capabilities = T4_CAP; #ifdef TCP_OFFLOAD @@ -1504,6 +1511,67 @@ cxgbe_qflush(struct ifnet *ifp) if_qflush(ifp); } +static uint64_t +cxgbe_get_counter(struct ifnet *ifp, ift_counter c) +{ + struct port_info *pi = ifp->if_softc; + struct adapter *sc = pi->adapter; + struct port_stats *s = &pi->stats; + + cxgbe_refresh_stats(sc, pi); + + switch (c) { + case IFCOUNTER_IPACKETS: + return (s->rx_frames - s->rx_pause); + + case IFCOUNTER_IERRORS: + return (s->rx_jabber + s->rx_runt + s->rx_too_long + + s->rx_fcs_err + s->rx_len_err); + + case IFCOUNTER_OPACKETS: + return (s->tx_frames - s->tx_pause); + + case IFCOUNTER_OERRORS: + return (s->tx_error_frames); + + case IFCOUNTER_IBYTES: + return (s->rx_octets - s->rx_pause * 64); + + case IFCOUNTER_OBYTES: + return (s->tx_octets - s->tx_pause * 64); + + case IFCOUNTER_IMCASTS: + return (s->rx_mcast_frames - s->rx_pause); + + case IFCOUNTER_OMCASTS: + return (s->tx_mcast_frames - s->tx_pause); + + case IFCOUNTER_IQDROPS: + return (s->rx_ovflow0 + s->rx_ovflow1 + s->rx_ovflow2 + + s->rx_ovflow3 + s->rx_trunc0 + s->rx_trunc1 + s->rx_trunc2 + + s->rx_trunc3 + pi->tnl_cong_drops); + + case IFCOUNTER_OQDROPS: { + uint64_t drops; + + drops = s->tx_drop; + if (pi->flags & PORT_INIT_DONE) { + int i; + struct sge_txq *txq; + + for_each_txq(pi, i, txq) + drops += txq->br->br_drops; + } + + return (drops); + + } + + default: + return (if_get_counter_default(ifp, c)); + } +} + static int cxgbe_media_change(struct ifnet *ifp) { @@ -4277,14 +4345,39 @@ t4_get_regs(struct adapter *sc, struct t } static void +cxgbe_refresh_stats(struct adapter *sc, struct port_info *pi) +{ + int i; + u_int v, tnl_cong_drops; + struct timeval tv; + const struct timeval interval = {0, 250000}; /* 250ms */ + + getmicrotime(&tv); + timevalsub(&tv, &interval); + if (timevalcmp(&tv, &pi->last_refreshed, <)) + return; + + tnl_cong_drops = 0; + t4_get_port_stats(sc, pi->tx_chan, &pi->stats); + for (i = 0; i < NCHAN; i++) { + if (pi->rx_chan_map & (1 << i)) { + mtx_lock(&sc->regwin_lock); + t4_read_indirect(sc, A_TP_MIB_INDEX, A_TP_MIB_DATA, &v, + 1, A_TP_MIB_TNL_CNG_DROP_0 + i); + mtx_unlock(&sc->regwin_lock); + tnl_cong_drops += v; + } + } + pi->tnl_cong_drops = tnl_cong_drops; + getmicrotime(&pi->last_refreshed); +} + +static void cxgbe_tick(void *arg) { struct port_info *pi = arg; struct adapter *sc = pi->adapter; struct ifnet *ifp = pi->ifp; - struct sge_txq *txq; - int i, drops; - struct port_stats *s = &pi->stats; PORT_LOCK(pi); if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { @@ -4292,39 +4385,7 @@ cxgbe_tick(void *arg) return; /* without scheduling another callout */ } - t4_get_port_stats(sc, pi->tx_chan, s); - - ifp->if_opackets = s->tx_frames - s->tx_pause; - ifp->if_ipackets = s->rx_frames - s->rx_pause; - ifp->if_obytes = s->tx_octets - s->tx_pause * 64; - ifp->if_ibytes = s->rx_octets - s->rx_pause * 64; - ifp->if_omcasts = s->tx_mcast_frames - s->tx_pause; - ifp->if_imcasts = s->rx_mcast_frames - s->rx_pause; - ifp->if_iqdrops = s->rx_ovflow0 + s->rx_ovflow1 + s->rx_ovflow2 + - s->rx_ovflow3 + s->rx_trunc0 + s->rx_trunc1 + s->rx_trunc2 + - s->rx_trunc3; - for (i = 0; i < 4; i++) { - if (pi->rx_chan_map & (1 << i)) { - uint32_t v; - - /* - * XXX: indirect reads from the same ADDR/DATA pair can - * race with each other. - */ - t4_read_indirect(sc, A_TP_MIB_INDEX, A_TP_MIB_DATA, &v, - 1, A_TP_MIB_TNL_CNG_DROP_0 + i); - ifp->if_iqdrops += v; - } - } - - drops = s->tx_drop; - for_each_txq(pi, i, txq) - drops += txq->br->br_drops; - ifp->if_oqdrops = drops; - - ifp->if_oerrors = s->tx_error_frames; - ifp->if_ierrors = s->rx_jabber + s->rx_runt + s->rx_too_long + - s->rx_fcs_err + s->rx_len_err; + cxgbe_refresh_stats(sc, pi); callout_schedule(&pi->tick, hz); PORT_UNLOCK(pi); From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 07:04:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0AE754AC; Sat, 27 Sep 2014 07:04:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E98BB842; Sat, 27 Sep 2014 07:04:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R74De3074246; Sat, 27 Sep 2014 07:04:13 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R74Ddr074239; Sat, 27 Sep 2014 07:04:13 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201409270704.s8R74Ddr074239@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 27 Sep 2014 07:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272201 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 07:04:14 -0000 Author: melifaro Date: Sat Sep 27 07:04:12 2014 New Revision: 272201 URL: http://svnweb.freebsd.org/changeset/base/272201 Log: * Split tcp_signature_compute() into 2 pieces: - tcp_get_sav() - SADB key lookup - tcp_signature_do_compute() - actual computation * Fix TCP signature case for listening socket: do not assume EVERY connection coming to socket with TCP_SIGNATURE set to be md5 signed regardless of SADB key existance for particular address. This fixes the case for routing software having _some_ BGP sessions secured by md5. * Simplify TCP_SIGNATURE handling in tcp_input() MFC after: 2 weeks Modified: head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sat Sep 27 05:50:31 2014 (r272200) +++ head/sys/netinet/tcp_subr.c Sat Sep 27 07:04:12 2014 (r272201) @@ -1928,55 +1928,20 @@ tcp_signature_apply(void *fstate, void * } /* - * Compute TCP-MD5 hash of a TCP segment. (RFC2385) - * - * Parameters: - * m pointer to head of mbuf chain - * _unused - * len length of TCP segment data, excluding options - * optlen length of TCP segment options - * buf pointer to storage for computed MD5 digest - * direction direction of flow (IPSEC_DIR_INBOUND or OUTBOUND) - * - * We do this over ip, tcphdr, segment data, and the key in the SADB. - * When called from tcp_input(), we can be sure that th_sum has been - * zeroed out and verified already. - * - * Return 0 if successful, otherwise return -1. - * * XXX The key is retrieved from the system's PF_KEY SADB, by keying a * search with the destination IP address, and a 'magic SPI' to be * determined by the application. This is hardcoded elsewhere to 1179 - * right now. Another branch of this code exists which uses the SPD to - * specify per-application flows but it is unstable. - */ -int -tcp_signature_compute(struct mbuf *m, int _unused, int len, int optlen, - u_char *buf, u_int direction) +*/ +struct secasvar * +tcp_get_sav(struct mbuf *m, u_int direction) { union sockaddr_union dst; -#ifdef INET - struct ippseudo ippseudo; -#endif - MD5_CTX ctx; - int doff; - struct ip *ip; -#ifdef INET - struct ipovly *ipovly; -#endif struct secasvar *sav; - struct tcphdr *th; + struct ip *ip; #ifdef INET6 struct ip6_hdr *ip6; - struct in6_addr in6; char ip6buf[INET6_ADDRSTRLEN]; - uint32_t plen; - uint16_t nhdr; #endif - u_short savecsum; - - KASSERT(m != NULL, ("NULL mbuf chain")); - KASSERT(buf != NULL, ("NULL signature pointer")); /* Extract the destination from the IP header in the mbuf. */ bzero(&dst, sizeof(union sockaddr_union)); @@ -2003,7 +1968,7 @@ tcp_signature_compute(struct mbuf *m, in break; #endif default: - return (EINVAL); + return (NULL); /* NOTREACHED */ break; } @@ -2018,9 +1983,61 @@ tcp_signature_compute(struct mbuf *m, in ip6_sprintf(ip6buf, &dst.sin6.sin6_addr) : #endif "(unsupported)")); - return (EINVAL); } + return (sav); +} + +/* + * Compute TCP-MD5 hash of a TCP segment. (RFC2385) + * + * Parameters: + * m pointer to head of mbuf chain + * len length of TCP segment data, excluding options + * optlen length of TCP segment options + * buf pointer to storage for computed MD5 digest + * sav pointer to security assosiation + * + * We do this over ip, tcphdr, segment data, and the key in the SADB. + * When called from tcp_input(), we can be sure that th_sum has been + * zeroed out and verified already. + * + * Releases reference to SADB key before return. + * + * Return 0 if successful, otherwise return -1. + * + */ +int +tcp_signature_do_compute(struct mbuf *m, int len, int optlen, + u_char *buf, struct secasvar *sav) +{ +#ifdef INET + struct ippseudo ippseudo; +#endif + MD5_CTX ctx; + int doff; + struct ip *ip; +#ifdef INET + struct ipovly *ipovly; +#endif + struct tcphdr *th; +#ifdef INET6 + struct ip6_hdr *ip6; + struct in6_addr in6; + uint32_t plen; + uint16_t nhdr; +#endif + u_short savecsum; + + KASSERT(m != NULL, ("NULL mbuf chain")); + KASSERT(buf != NULL, ("NULL signature pointer")); + + /* Extract the destination from the IP header in the mbuf. */ + ip = mtod(m, struct ip *); +#ifdef INET6 + ip6 = NULL; /* Make the compiler happy. */ +#endif + MD5Init(&ctx); /* * Step 1: Update MD5 hash with IP(v6) pseudo-header. @@ -2077,7 +2094,7 @@ tcp_signature_compute(struct mbuf *m, in break; #endif default: - return (EINVAL); + return (-1); /* NOTREACHED */ break; } @@ -2111,6 +2128,23 @@ tcp_signature_compute(struct mbuf *m, in } /* + * Compute TCP-MD5 hash of a TCP segment. (RFC2385) + * + * Return 0 if successful, otherwise return -1. + */ +int +tcp_signature_compute(struct mbuf *m, int _unused, int len, int optlen, + u_char *buf, u_int direction) +{ + struct secasvar *sav; + + if ((sav = tcp_get_sav(m, direction)) == NULL) + return (-1); + + return (tcp_signature_do_compute(m, len, optlen, buf, sav)); +} + +/* * Verify the TCP-MD5 hash of a TCP segment. (RFC2385) * * Parameters: Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sat Sep 27 05:50:31 2014 (r272200) +++ head/sys/netinet/tcp_syncache.c Sat Sep 27 07:04:12 2014 (r272201) @@ -122,7 +122,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, static void syncache_drop(struct syncache *, struct syncache_head *); static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); -static int syncache_respond(struct syncache *); +static int syncache_respond(struct syncache *, struct syncache_head *, int); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, @@ -467,7 +467,7 @@ syncache_timer(void *xsch) free(s, M_TCPLOG); } - (void) syncache_respond(sc); + syncache_respond(sc, sch, 1); TCPSTAT_INC(tcps_sc_retransmitted); syncache_timeout(sc, sch, 0); } @@ -1213,7 +1213,7 @@ syncache_add(struct in_conninfo *inc, st s, __func__); free(s, M_TCPLOG); } - if (syncache_respond(sc) == 0) { + if (syncache_respond(sc, sch, 1) == 0) { sc->sc_rxmits = 0; syncache_timeout(sc, sch, 1); TCPSTAT_INC(tcps_sndacks); @@ -1325,11 +1325,9 @@ syncache_add(struct in_conninfo *inc, st } #ifdef TCP_SIGNATURE /* - * If listening socket requested TCP digests, and received SYN + * If listening socket requested TCP digests, OR received SYN * contains the option, flag this in the syncache so that * syncache_respond() will do the right thing with the SYN+ACK. - * XXX: Currently we always record the option by default and will - * attempt to use it in syncache_respond(). */ if (to->to_flags & TOF_SIGNATURE || ltflags & TF_SIGNATURE) sc->sc_flags |= SCF_SIGNATURE; @@ -1359,7 +1357,7 @@ syncache_add(struct in_conninfo *inc, st /* * Do a standard 3-way handshake. */ - if (syncache_respond(sc) == 0) { + if (syncache_respond(sc, sch, 0) == 0) { if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs) syncache_free(sc); else if (sc != &scs) @@ -1387,7 +1385,7 @@ done: } static int -syncache_respond(struct syncache *sc) +syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked) { struct ip *ip = NULL; struct mbuf *m; @@ -1398,6 +1396,9 @@ syncache_respond(struct syncache *sc) #ifdef INET6 struct ip6_hdr *ip6 = NULL; #endif +#ifdef TCP_SIGNATURE + struct secasvar *sav; +#endif hlen = #ifdef INET6 @@ -1508,8 +1509,29 @@ syncache_respond(struct syncache *sc) if (sc->sc_flags & SCF_SACK) to.to_flags |= TOF_SACKPERM; #ifdef TCP_SIGNATURE - if (sc->sc_flags & SCF_SIGNATURE) - to.to_flags |= TOF_SIGNATURE; + sav = NULL; + if (sc->sc_flags & SCF_SIGNATURE) { + sav = tcp_get_sav(m, IPSEC_DIR_OUTBOUND); + if (sav != NULL) + to.to_flags |= TOF_SIGNATURE; + else { + + /* + * We've got SCF_SIGNATURE flag + * inherited from listening socket, + * but to SADB key for given source + * address. Assume signature is not + * required and remove signature flag + * instead of silently dropping + * connection. + */ + if (locked == 0) + SCH_LOCK(sch); + sc->sc_flags &= ~SCF_SIGNATURE; + if (locked == 0) + SCH_UNLOCK(sch); + } + } #endif optlen = tcp_addoptions(&to, (u_char *)(th + 1)); @@ -1520,8 +1542,8 @@ syncache_respond(struct syncache *sc) #ifdef TCP_SIGNATURE if (sc->sc_flags & SCF_SIGNATURE) - tcp_signature_compute(m, 0, 0, optlen, - to.to_signature, IPSEC_DIR_OUTBOUND); + tcp_signature_do_compute(m, 0, optlen, + to.to_signature, sav); #endif #ifdef INET6 if (sc->sc_inc.inc_flags & INC_ISIPV6) Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sat Sep 27 05:50:31 2014 (r272200) +++ head/sys/netinet/tcp_var.h Sat Sep 27 07:04:12 2014 (r272201) @@ -685,9 +685,15 @@ int tcp_twcheck(struct inpcb *, struct struct mbuf *, int); void tcp_setpersist(struct tcpcb *); #ifdef TCP_SIGNATURE +struct secasvar; +struct secasvar *tcp_get_sav(struct mbuf *, u_int); +int tcp_signature_do_compute(struct mbuf *, int, int, u_char *, + struct secasvar *); int tcp_signature_compute(struct mbuf *, int, int, int, u_char *, u_int); int tcp_signature_verify(struct mbuf *, int, int, int, struct tcpopt *, struct tcphdr *, u_int); +int tcp_signature_check(struct mbuf *m, int off0, int tlen, int optlen, + struct tcpopt *to, struct tcphdr *th, u_int tcpbflag); #endif void tcp_slowtimo(void); struct tcptemp * From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 07:54:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BAD1BCB; Sat, 27 Sep 2014 07:54:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27094C14; Sat, 27 Sep 2014 07:54:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R7sS3g097565; Sat, 27 Sep 2014 07:54:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R7sSrL097564; Sat, 27 Sep 2014 07:54:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409270754.s8R7sSrL097564@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 27 Sep 2014 07:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272202 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 07:54:28 -0000 Author: kib Date: Sat Sep 27 07:54:27 2014 New Revision: 272202 URL: http://svnweb.freebsd.org/changeset/base/272202 Log: MFC r272036: Avoid calling vm_map_pmap_enter() for the MADV_WILLNEED on the wired entry, the pages must be already mapped. Approved by: re (gjb) Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Sat Sep 27 07:04:12 2014 (r272201) +++ stable/10/sys/vm/vm_map.c Sat Sep 27 07:54:27 2014 (r272202) @@ -2209,7 +2209,14 @@ vm_map_madvise( vm_object_madvise(current->object.vm_object, pstart, pend, behav); - if (behav == MADV_WILLNEED) { + + /* + * Pre-populate paging structures in the + * WILLNEED case. For wired entries, the + * paging structures are already populated. + */ + if (behav == MADV_WILLNEED && + current->wired_count == 0) { vm_map_pmap_enter(map, useStart, current->protection, From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 08:14:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE3DFEE1; Sat, 27 Sep 2014 08:14:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDEE8D8B; Sat, 27 Sep 2014 08:14:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R8EGR2007335; Sat, 27 Sep 2014 08:14:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R8EFOB007327; Sat, 27 Sep 2014 08:14:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409270814.s8R8EFOB007327@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 27 Sep 2014 08:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272203 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 08:14:17 -0000 Author: mav Date: Sat Sep 27 08:14:15 2014 New Revision: 272203 URL: http://svnweb.freebsd.org/changeset/base/272203 Log: MFC r272040: When reporting some major UNIT ATTENTION condition, like POWER ON OCCURRED or I_T NEXUS LOSS, clear all minor UAs for the LUN, redundant in this case. All SAM specifications tell that target MAY do it, but libiscsi initiator seems require it to be done, terminating connection with error if some more UAs happen to be reported during iSCSI connection. Approved by: re (gjb) Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_error.c stable/10/sys/cam/ctl/ctl_error.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Sep 27 07:54:27 2014 (r272202) +++ stable/10/sys/cam/ctl/ctl.c Sat Sep 27 08:14:15 2014 (r272203) @@ -9684,13 +9684,10 @@ ctl_request_sense(struct ctl_scsiio *cts if (lun->pending_ua[initidx] != CTL_UA_NONE) { ctl_ua_type ua_type; - ua_type = ctl_build_ua(lun->pending_ua[initidx], + ua_type = ctl_build_ua(&lun->pending_ua[initidx], sense_ptr, sense_format); - if (ua_type != CTL_UA_NONE) { + if (ua_type != CTL_UA_NONE) have_error = 1; - /* We're reporting this UA, so clear it */ - lun->pending_ua[initidx] &= ~ua_type; - } } mtx_unlock(&lun->lun_lock); @@ -11604,8 +11601,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct if ((entry->flags & CTL_CMD_FLAG_NO_SENSE) == 0) { ctl_ua_type ua_type; - ua_type = lun->pending_ua[initidx]; - if (ua_type != CTL_UA_NONE) { + if (lun->pending_ua[initidx] != CTL_UA_NONE) { scsi_sense_data_type sense_format; if (lun != NULL) @@ -11615,14 +11611,13 @@ ctl_scsiio_precheck(struct ctl_softc *ct else sense_format = SSD_TYPE_FIXED; - ua_type = ctl_build_ua(ua_type, &ctsio->sense_data, - sense_format); + ua_type = ctl_build_ua(&lun->pending_ua[initidx], + &ctsio->sense_data, sense_format); if (ua_type != CTL_UA_NONE) { ctsio->scsi_status = SCSI_STATUS_CHECK_COND; ctsio->io_hdr.status = CTL_SCSI_ERROR | CTL_AUTOSENSE; ctsio->sense_len = SSD_FULL_SIZE; - lun->pending_ua[initidx] &= ~ua_type; mtx_unlock(&lun->lun_lock); ctl_done((union ctl_io *)ctsio); return (retval); Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Sat Sep 27 07:54:27 2014 (r272202) +++ stable/10/sys/cam/ctl/ctl.h Sat Sep 27 08:14:15 2014 (r272203) @@ -119,7 +119,7 @@ typedef enum { CTL_UA_I_T_NEXUS_LOSS = 0x0008, CTL_UA_LUN_RESET = 0x0010, CTL_UA_LUN_CHANGE = 0x0020, - CTL_UA_MODE_CHANGE = 0x0030, + CTL_UA_MODE_CHANGE = 0x0040, CTL_UA_LOG_CHANGE = 0x0080, CTL_UA_LVD = 0x0100, CTL_UA_SE = 0x0200, Modified: stable/10/sys/cam/ctl/ctl_error.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_error.c Sat Sep 27 07:54:27 2014 (r272202) +++ stable/10/sys/cam/ctl/ctl_error.c Sat Sep 27 08:14:15 2014 (r272203) @@ -367,44 +367,42 @@ ctl_set_ua(struct ctl_scsiio *ctsio, int } ctl_ua_type -ctl_build_ua(ctl_ua_type ua_type, struct scsi_sense_data *sense, +ctl_build_ua(ctl_ua_type *ua_type, struct scsi_sense_data *sense, scsi_sense_data_type sense_format) { - ctl_ua_type ua_to_build; - int i, asc, ascq; + ctl_ua_type ua_to_build, ua_to_clear; + int asc, ascq; - if (ua_type == CTL_UA_NONE) - return (ua_type); + if (*ua_type == CTL_UA_NONE) + return (CTL_UA_NONE); - ua_to_build = CTL_UA_NONE; - - for (i = 0; i < (sizeof(ua_type) * 8); i++) { - if (ua_type & (1 << i)) { - ua_to_build = 1 << i; - break; - } - } + ua_to_build = (1 << (ffs(*ua_type) - 1)); + ua_to_clear = ua_to_build; switch (ua_to_build) { case CTL_UA_POWERON: /* 29h/01h POWER ON OCCURRED */ asc = 0x29; ascq = 0x01; + ua_to_clear = ~0; break; case CTL_UA_BUS_RESET: /* 29h/02h SCSI BUS RESET OCCURRED */ asc = 0x29; ascq = 0x02; + ua_to_clear = ~0; break; case CTL_UA_TARG_RESET: /* 29h/03h BUS DEVICE RESET FUNCTION OCCURRED*/ asc = 0x29; ascq = 0x03; + ua_to_clear = ~0; break; case CTL_UA_I_T_NEXUS_LOSS: /* 29h/07h I_T NEXUS LOSS OCCURRED */ asc = 0x29; ascq = 0x07; + ua_to_clear = ~0; break; case CTL_UA_LUN_RESET: /* 29h/00h POWER ON, RESET, OR BUS DEVICE RESET OCCURRED */ @@ -466,9 +464,7 @@ ctl_build_ua(ctl_ua_type ua_type, struct ascq = 0x09; break; default: - ua_to_build = CTL_UA_NONE; - return (ua_to_build); - break; /* NOTREACHED */ + panic("ctl_build_ua: Unknown UA %x", ua_to_build); } ctl_set_sense_data(sense, @@ -480,6 +476,9 @@ ctl_build_ua(ctl_ua_type ua_type, struct ascq, SSD_ELEM_NONE); + /* We're reporting this UA, so clear it */ + *ua_type &= ~ua_to_clear; + return (ua_to_build); } Modified: stable/10/sys/cam/ctl/ctl_error.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_error.h Sat Sep 27 07:54:27 2014 (r272202) +++ stable/10/sys/cam/ctl/ctl_error.h Sat Sep 27 08:14:15 2014 (r272203) @@ -55,7 +55,7 @@ void ctl_sense_to_desc(struct scsi_sense void ctl_sense_to_fixed(struct scsi_sense_data_desc *sense_src, struct scsi_sense_data_fixed *sense_dest); void ctl_set_ua(struct ctl_scsiio *ctsio, int asc, int ascq); -ctl_ua_type ctl_build_ua(ctl_ua_type ua_type, struct scsi_sense_data *sense, +ctl_ua_type ctl_build_ua(ctl_ua_type *ua_type, struct scsi_sense_data *sense, scsi_sense_data_type sense_format); void ctl_set_overlapped_cmd(struct ctl_scsiio *ctsio); void ctl_set_overlapped_tag(struct ctl_scsiio *ctsio, uint8_t tag); From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 08:33:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED1A865B; Sat, 27 Sep 2014 08:33:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7C64F43; Sat, 27 Sep 2014 08:33:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R8XojU017298; Sat, 27 Sep 2014 08:33:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R8XoCk017297; Sat, 27 Sep 2014 08:33:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409270833.s8R8XoCk017297@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 27 Sep 2014 08:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272204 - stable/10/sys/compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 08:33:51 -0000 Author: mav Date: Sat Sep 27 08:33:50 2014 New Revision: 272204 URL: http://svnweb.freebsd.org/changeset/base/272204 Log: MFC r272059: Remake Linux' SOUND_MIXER_INFO IOCTL as a wrapper around new FreeBSD's one. Submitted by: Dmitry Luhtionov Approved by: re (kib) Modified: stable/10/sys/compat/linux/linux_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.c Sat Sep 27 08:14:15 2014 (r272203) +++ stable/10/sys/compat/linux/linux_ioctl.c Sat Sep 27 08:33:50 2014 (r272204) @@ -1698,13 +1698,6 @@ linux_ioctl_vfat(struct thread *td, stru * Sound related ioctls */ -struct linux_mixer_info { - char id[16]; - char name[32]; - int modify_counter; - int fillers[10]; -}; - struct linux_old_mixer_info { char id[16]; char name[32]; @@ -1792,12 +1785,8 @@ linux_ioctl_sound(struct thread *td, str /* Key on encoded length */ switch ((args->cmd >> 16) & 0x1fff) { case 0x005c: { /* SOUND_MIXER_INFO */ - struct linux_mixer_info info; - bzero(&info, sizeof(info)); - strncpy(info.id, "OSS", sizeof(info.id) - 1); - strncpy(info.name, "FreeBSD OSS Mixer", sizeof(info.name) - 1); - copyout(&info, (void *)args->arg, sizeof(info)); - return (0); + args->cmd = SOUND_MIXER_INFO; + return (sys_ioctl(td, (struct ioctl_args *)args)); } case 0x0030: { /* SOUND_OLD_MIXER_INFO */ struct linux_old_mixer_info info; From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 08:35:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 967B9892; Sat, 27 Sep 2014 08:35:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8167FF56; Sat, 27 Sep 2014 08:35:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R8ZOQd017777; Sat, 27 Sep 2014 08:35:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R8ZOlb017776; Sat, 27 Sep 2014 08:35:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409270835.s8R8ZOlb017776@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 27 Sep 2014 08:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r272205 - stable/9/sys/compat/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 08:35:24 -0000 Author: mav Date: Sat Sep 27 08:35:23 2014 New Revision: 272205 URL: http://svnweb.freebsd.org/changeset/base/272205 Log: MFC r272059: Remake Linux' SOUND_MIXER_INFO IOCTL as a wrapper around new FreeBSD's one. Submitted by: Dmitry Luhtionov Modified: stable/9/sys/compat/linux/linux_ioctl.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/9/sys/compat/linux/linux_ioctl.c Sat Sep 27 08:33:50 2014 (r272204) +++ stable/9/sys/compat/linux/linux_ioctl.c Sat Sep 27 08:35:23 2014 (r272205) @@ -1665,13 +1665,6 @@ linux_ioctl_vfat(struct thread *td, stru * Sound related ioctls */ -struct linux_mixer_info { - char id[16]; - char name[32]; - int modify_counter; - int fillers[10]; -}; - struct linux_old_mixer_info { char id[16]; char name[32]; @@ -1759,12 +1752,8 @@ linux_ioctl_sound(struct thread *td, str /* Key on encoded length */ switch ((args->cmd >> 16) & 0x1fff) { case 0x005c: { /* SOUND_MIXER_INFO */ - struct linux_mixer_info info; - bzero(&info, sizeof(info)); - strncpy(info.id, "OSS", sizeof(info.id) - 1); - strncpy(info.name, "FreeBSD OSS Mixer", sizeof(info.name) - 1); - copyout(&info, (void *)args->arg, sizeof(info)); - return (0); + args->cmd = SOUND_MIXER_INFO; + return (sys_ioctl(td, (struct ioctl_args *)args)); } case 0x0030: { /* SOUND_OLD_MIXER_INFO */ struct linux_old_mixer_info info; From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 08:59:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A53A6C; Sat, 27 Sep 2014 08:59:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A2621DD; Sat, 27 Sep 2014 08:59:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R8xhch028116; Sat, 27 Sep 2014 08:59:43 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R8xhdr028111; Sat, 27 Sep 2014 08:59:43 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201409270859.s8R8xhdr028111@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sat, 27 Sep 2014 08:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272206 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 08:59:44 -0000 Author: sbruno Date: Sat Sep 27 08:59:43 2014 New Revision: 272206 URL: http://svnweb.freebsd.org/changeset/base/272206 Log: Add kernel support for the TP-LINK MR3020 Atheros MIPS 24k router. AR9331 based system. Phabric: https://reviews.freebsd.org/D780 Reviewed by: adrian Added: head/sys/mips/conf/TP-MR3020 (contents, props changed) head/sys/mips/conf/TP-MR3020.hints (contents, props changed) Added: head/sys/mips/conf/TP-MR3020 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/TP-MR3020 Sat Sep 27 08:59:43 2014 (r272206) @@ -0,0 +1,65 @@ +# +# TP Link MR3020 - an AR9331 based SoC wifi device. +# +# This is for the 32 RAM/4 flash part. There is little to no +# chance that this will ever boot FreeBSD directly from the 3.5MB +# of flash. The kernel can fit into the space, but userland is just +# too big even when stripped down to its limits. +# +# * AR9331 SoC +# * 32MB RAM +# * 4MB flash +# * Integrated 1x1 2GHz wifi and 10/100 bridge +# * USB powered +# * USB storage +# +# $FreeBSD$ +# + +# Include the default AR933x parameters +include "AR933X_BASE" + +ident TP-MR3020 + +# Override hints with board values +hints "TP-MR3020.hints" + +# Board memory - 32MB +options AR71XX_REALMEM=(32*1024*1024) + +# i2c GPIO bus +device gpioiic +device iicbb +device iicbus +device iic + +# Options required for miiproxy and mdiobus +options ARGE_MDIO # Export an MDIO bus separate from arge +device miiproxy # MDIO bus <-> MII PHY rendezvous + +device etherswitch +device arswitch + +# Enable the uboot environment stuff rather then the +# redboot stuff. +options AR71XX_ENV_UBOOT + +# uzip - to boot natively from flash +device geom_uncompress + +# Used for the static uboot partition map +device geom_map + +# Boot off of the rootfs, as defined in the geom_map setup. +# Probably, this should be a USB device as the memory available +# compressed rootfs is simply too small for FreeBSD +#options ROOTDEVNAME=\"ufs:map/rootfs.uncompress\" + +# Boot off of a uboot tftp ramdisk kernel image. Because the flash +# on this unit is so small, this is the only way to do dev work. +# For full deployment, you will *have* to use a usb storage device +# as a rootfs and use the flash to hold the kernel only. +options MD_ROOT # md device usable as a potential root device +options MD_ROOT_SIZE=10240 +makeoptions MFS_IMAGE=/tftpboot/mfsroot-tl-mr3020.img.ulzma +options ROOTDEVNAME=\"ufs:md0.uncompress\" Added: head/sys/mips/conf/TP-MR3020.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/TP-MR3020.hints Sat Sep 27 08:59:43 2014 (r272206) @@ -0,0 +1,101 @@ +# +# This file adds to the values in AR933X_BASE.hints +# +# $FreeBSD$ + +# mdiobus on arge1 +hint.argemdio.0.at="nexus0" +hint.argemdio.0.maddr=0x1a000000 +hint.argemdio.0.msize=0x1000 +hint.argemdio.0.order=0 + +# There's no need to set the ar933x GMAC configuration bits. +# This just creates a switch instance and correctly uses it. + +# Embedded Atheros Switch +hint.arswitch.0.at="mdio0" + +# XXX this should really say it's an AR933x switch, as there +# are some vlan specific differences here! +hint.arswitch.0.is_7240=1 +hint.arswitch.0.numphys=4 +hint.arswitch.0.phy4cpu=1 # phy 4 is a "CPU" separate PHY +hint.arswitch.0.is_rgmii=0 +hint.arswitch.0.is_gmii=1 # arge1 <-> switch PHY is GMII + +# arge0 - MII, autoneg, phy(4) +hint.arge.0.phymask=0x10 # PHY4 +hint.arge.0.mdio=mdioproxy1 # .. off of the switch mdiobus + +# arge1 - GMII, 1000/full +hint.arge.1.phymask=0x0 # No directly mapped PHYs +hint.arge.1.media=1000 +hint.arge.1.fduplex=1 + +# Where the ART is - last 64k in the flash +# 0x9fff1000 ? +hint.ath.0.eepromaddr=0x1fff0000 +hint.ath.0.eepromsize=16384 + +# The board 16MiB flash layout in uboot env: +# +# 256k(u-boot),64k(u-boot-env),2752k(rootfs),896k(uImage),64k(NVRAM),64k(ART) + +# However, it boots from 0x9f050000, which is the front of the flsah! +# Thus the kernel/rootfs are switched around. + +# 256KB +hint.map.0.at="flash/spi0" +hint.map.0.start=0x00000000 +hint.map.0.end=0x00040000 +hint.map.0.name="uboot" +hint.map.0.readonly=1 + +# 64KB +hint.map.1.at="flash/spi0" +hint.map.1.start=0x00040000 +hint.map.1.end=0x00050000 +hint.map.1.name="uboot-env" +hint.map.1.readonly=0 + +# 2752KB +hint.map.2.at="flash/spi0" +hint.map.2.start=0x00050000 +hint.map.2.end="search:0x00100000:0x10000:.!/bin/sh" +hint.map.2.name="kernel" +hint.map.2.readonly=0 + +# 896KB +hint.map.3.at="flash/spi0" +hint.map.3.start="search:0x00100000:0x10000:.!/bin/sh" +hint.map.3.end=0x003e0000 +hint.map.3.name="rootfs" +hint.map.3.readonly=0 + +# 64K NVRAM +hint.map.4.at="flash/spi0" +hint.map.4.start=0x003e0000 +hint.map.4.end=0x003f0000 +hint.map.4.name="cfg" +hint.map.4.readonly=0 + +# 64K ART +hint.map.5.at="flash/spi0" +hint.map.5.start=0x003f0000 +hint.map.5.end=0x00400000 +hint.map.5.name="art" +hint.map.5.readonly=1 + +# GPIO specific configuration block + +# Don't flip on anything that isn't already enabled. +# This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're +# not used here. +hint.gpio.0.function_set=0x00000000 +hint.gpio.0.function_clear=0x00000000 + +# These are the GPIO LEDs and buttons which can be software controlled. +#hint.gpio.0.pinmask=0x001c02ae +#hint.gpio.0.pinmask=0x00001803 + +# XXX TODO: the button and LEDs! From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 09:00:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBBD62A0; Sat, 27 Sep 2014 09:00:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D65071E8; Sat, 27 Sep 2014 09:00:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R90d1A029073; Sat, 27 Sep 2014 09:00:39 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R90dWl029070; Sat, 27 Sep 2014 09:00:39 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201409270900.s8R90dWl029070@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sat, 27 Sep 2014 09:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272207 - in head/games: factor primes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 09:00:40 -0000 Author: cperciva Date: Sat Sep 27 09:00:38 2014 New Revision: 272207 URL: http://svnweb.freebsd.org/changeset/base/272207 Log: Switch primes(6) from using unsigned long to using uint64_t. This fixes 'limited range of type' warnings about comparisons on 32-bit systems, and allows 32-bit systems to compute the full range of primes. Modified: head/games/factor/factor.6 head/games/primes/primes.c head/games/primes/primes.h Modified: head/games/factor/factor.6 ============================================================================== --- head/games/factor/factor.6 Sat Sep 27 08:59:43 2014 (r272206) +++ head/games/factor/factor.6 Sat Sep 27 09:00:38 2014 (r272207) @@ -89,8 +89,7 @@ The value must not be greater than the maximum. The default and maximum value of .Ar stop -is 4294967295 on 32-bit architectures -and 3825123056546413050 on 64-bit ones. +is 3825123056546413050. .Pp When the .Nm primes Modified: head/games/primes/primes.c ============================================================================== --- head/games/primes/primes.c Sat Sep 27 08:59:43 2014 (r272206) +++ head/games/primes/primes.c Sat Sep 27 09:00:38 2014 (r272207) @@ -64,6 +64,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -111,10 +112,10 @@ main(int argc, char *argv[]) argv += optind; start = 0; - stop = (sizeof(ubig) > 4) ? SPSPMAX : BIG; + stop = SPSPMAX; /* - * Convert low and high args. Strtoul(3) sets errno to + * Convert low and high args. Strtoumax(3) sets errno to * ERANGE if the number is too large, but, if there's * a leading minus sign it returns the negation of the * result of the conversion, which we'd rather disallow. @@ -126,19 +127,19 @@ main(int argc, char *argv[]) errx(1, "negative numbers aren't permitted."); errno = 0; - start = strtoul(argv[0], &p, 0); + start = strtoumax(argv[0], &p, 0); if (errno) err(1, "%s", argv[0]); if (*p != '\0') errx(1, "%s: illegal numeric format.", argv[0]); errno = 0; - stop = strtoul(argv[1], &p, 0); + stop = strtoumax(argv[1], &p, 0); if (errno) err(1, "%s", argv[1]); if (*p != '\0') errx(1, "%s: illegal numeric format.", argv[1]); - if ((uint64_t)stop > SPSPMAX) + if (stop > SPSPMAX) errx(1, "%s: stop value too large.", argv[1]); break; case 1: @@ -147,7 +148,7 @@ main(int argc, char *argv[]) errx(1, "negative numbers aren't permitted."); errno = 0; - start = strtoul(argv[0], &p, 0); + start = strtoumax(argv[0], &p, 0); if (errno) err(1, "%s", argv[0]); if (*p != '\0') @@ -188,7 +189,7 @@ read_num_buf(void) if (*p == '-') errx(1, "negative numbers aren't permitted."); errno = 0; - val = strtoul(buf, &p, 0); + val = strtoumax(buf, &p, 0); if (errno) err(1, "%s", buf); if (*p != '\n') @@ -243,7 +244,7 @@ primes(ubig start, ubig stop) for (p = &prime[0], factor = prime[0]; factor < stop && p <= pr_limit; factor = *(++p)) { if (factor >= start) { - printf(hflag ? "0x%lx\n" : "%lu\n", factor); + printf(hflag ? "%" PRIx64 "\n" : "%" PRIu64 "\n", factor); } } /* return early if we are done */ @@ -306,11 +307,11 @@ primes(ubig start, ubig stop) */ for (q = table; q < tab_lim; ++q, start+=2) { if (*q) { - if ((uint64_t)start > SIEVEMAX) { + if (start > SIEVEMAX) { if (!isprime(start)) continue; } - printf(hflag ? "0x%lx\n" : "%lu\n", start); + printf(hflag ? "%" PRIx64 "\n" : "%" PRIu64 "\n", start); } } } Modified: head/games/primes/primes.h ============================================================================== --- head/games/primes/primes.h Sat Sep 27 08:59:43 2014 (r272206) +++ head/games/primes/primes.h Sat Sep 27 09:00:38 2014 (r272207) @@ -41,8 +41,10 @@ * chongo /\oo/\ */ +#include + /* ubig is the type that holds a large unsigned value */ -typedef unsigned long ubig; /* must be >=32 bit unsigned value */ +typedef uint64_t ubig; /* must be >=32 bit unsigned value */ #define BIG ULONG_MAX /* largest value will sieve */ /* bytes in sieve table (must be > 3*5*7*11) */ From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 09:39:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E13A89D; Sat, 27 Sep 2014 09:39:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 799AC7C8; Sat, 27 Sep 2014 09:39:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R9dKi6047659; Sat, 27 Sep 2014 09:39:20 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R9dK7b047658; Sat, 27 Sep 2014 09:39:20 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201409270939.s8R9dK7b047658@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 27 Sep 2014 09:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272208 - head/cddl/lib/libzfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 09:39:20 -0000 Author: delphij Date: Sat Sep 27 09:39:19 2014 New Revision: 272208 URL: http://svnweb.freebsd.org/changeset/base/272208 Log: Revert r272189, the committed version was an old version and breaks build. Pointy hat to: delphij Modified: head/cddl/lib/libzfs/Makefile Modified: head/cddl/lib/libzfs/Makefile ============================================================================== --- head/cddl/lib/libzfs/Makefile Sat Sep 27 09:00:38 2014 (r272207) +++ head/cddl/lib/libzfs/Makefile Sat Sep 27 09:39:19 2014 (r272208) @@ -7,8 +7,8 @@ LIB= zfs DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} ${LIBNVPAIR} \ - ${LIBUUTIL} ${LIBAVL} ${LIBZFS_CORE} -LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair -luutil -lavl -lzfs_core + ${LIBAVL} ${LIBZFS_CORE} +LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair -lavl -lzfs_core SRCS= deviceid.c \ fsshare.c \ From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 09:57:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37214B3D; Sat, 27 Sep 2014 09:57:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1238694D; Sat, 27 Sep 2014 09:57:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8R9vYcj056989; Sat, 27 Sep 2014 09:57:34 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8R9vYrw056987; Sat, 27 Sep 2014 09:57:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201409270957.s8R9vYrw056987@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 27 Sep 2014 09:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272209 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 09:57:35 -0000 Author: andrew Date: Sat Sep 27 09:57:34 2014 New Revision: 272209 URL: http://svnweb.freebsd.org/changeset/base/272209 Log: Add machine/sysreg.h to simplify accessing the system control coprocessor registers and use it in the ARMv7 CPU functions. The sysreg.h file has been checked by hand, however it may contain errors with the comments on when a register was first introduced. The ARMv7 cpu functions have been checked by compiling both the previous and this version and comparing the md5 of the object files. Submitted by: Svatopluk Kraus Submitted by: Michal Meloun Reviewed by: ian, rpaulo Differential Revision: https://reviews.freebsd.org/D795 Added: head/sys/arm/include/sysreg.h (contents, props changed) Modified: head/sys/arm/arm/cpufunc_asm_armv7.S Modified: head/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv7.S Sat Sep 27 09:39:19 2014 (r272208) +++ head/sys/arm/arm/cpufunc_asm_armv7.S Sat Sep 27 09:57:34 2014 (r272209) @@ -33,6 +33,8 @@ #include __FBSDID("$FreeBSD$"); +#include + .cpu cortex-a8 .Lcoherency_level: @@ -70,12 +72,12 @@ ENTRY(armv7_setttb) dsb orr r0, r0, #PT_ATTR - mcr p15, 0, r0, c2, c0, 0 /* Translation Table Base Register 0 (TTBR0) */ + mcr CP15_TTBR0(r0) isb #ifdef SMP - mcr p15, 0, r0, c8, c3, 0 /* invalidate I+D TLBs Inner Shareable*/ + mcr CP15_TLBIALLIS #else - mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */ + mcr CP15_TLBIALL #endif dsb isb @@ -85,11 +87,11 @@ END(armv7_setttb) ENTRY(armv7_tlb_flushID) dsb #ifdef SMP - mcr p15, 0, r0, c8, c3, 0 /* flush Unified TLB all entries Inner Shareable */ - mcr p15, 0, r0, c7, c1, 6 /* flush BTB Inner Shareable */ + mcr CP15_TLBIALLIS + mcr CP15_BPIALLIS #else - mcr p15, 0, r0, c8, c7, 0 /* flush Unified TLB all entries */ - mcr p15, 0, r0, c7, c5, 6 /* flush BTB */ + mcr CP15_TLBIALL + mcr CP15_BPIALL #endif dsb isb @@ -100,11 +102,11 @@ ENTRY(armv7_tlb_flushID_SE) ldr r1, .Lpage_mask bic r0, r0, r1 #ifdef SMP - mcr p15, 0, r0, c8, c3, 3 /* flush Unified TLB single entry Inner Shareable */ - mcr p15, 0, r0, c7, c1, 6 /* flush BTB Inner Shareable */ + mcr CP15_TLBIMVAAIS(r0) + mcr CP15_BPIALLIS #else - mcr p15, 0, r0, c8, c7, 1 /* flush Unified TLB single entry */ - mcr p15, 0, r0, c7, c5, 6 /* flush BTB */ + mcr CP15_TLBIMVA(r0) + mcr CP15_BPIALL #endif dsb isb @@ -149,7 +151,7 @@ Loop3: orr r6, r6, r7, lsl r2 /* Clean and invalidate data cache by way/index */ - mcr p15, 0, r6, c7, c14, 2 + mcr CP15_DCCISW(r6) subs r9, r9, #1 bge Loop3 subs r7, r7, #1 @@ -168,9 +170,9 @@ ENTRY(armv7_idcache_wbinv_all) stmdb sp!, {lr} bl armv7_dcache_wbinv_all #ifdef SMP - mcr p15, 0, r0, c7, c1, 0 /* Invalidate all I caches to PoU (ICIALLUIS) */ + mcr CP15_ICIALLUIS #else - mcr p15, 0, r0, c7, c5, 0 /* Invalidate all I caches to PoU (ICIALLU) */ + mcr CP15_ICIALLU #endif dsb isb @@ -191,7 +193,7 @@ ENTRY(armv7_dcache_wb_range) add r1, r1, r2 bic r0, r0, r3 .Larmv7_wb_next: - mcr p15, 0, r0, c7, c10, 1 /* Clean D cache SE with VA */ + mcr CP15_DCCMVAC(r0) add r0, r0, ip subs r1, r1, ip bhi .Larmv7_wb_next @@ -206,7 +208,7 @@ ENTRY(armv7_dcache_wbinv_range) add r1, r1, r2 bic r0, r0, r3 .Larmv7_wbinv_next: - mcr p15, 0, r0, c7, c14, 1 /* Purge D cache SE with VA */ + mcr CP15_DCCIMVAC(r0) add r0, r0, ip subs r1, r1, ip bhi .Larmv7_wbinv_next @@ -225,7 +227,7 @@ ENTRY(armv7_dcache_inv_range) add r1, r1, r2 bic r0, r0, r3 .Larmv7_inv_next: - mcr p15, 0, r0, c7, c6, 1 /* Invalidate D cache SE with VA */ + mcr CP15_DCIMVAC(r0) add r0, r0, ip subs r1, r1, ip bhi .Larmv7_inv_next @@ -240,8 +242,8 @@ ENTRY(armv7_idcache_wbinv_range) add r1, r1, r2 bic r0, r0, r3 .Larmv7_id_wbinv_next: - mcr p15, 0, r0, c7, c5, 1 /* Invalidate I cache SE with VA */ - mcr p15, 0, r0, c7, c14, 1 /* Purge D cache SE with VA */ + mcr CP15_ICIMVAU(r0) + mcr CP15_DCCIMVAC(r0) add r0, r0, ip subs r1, r1, ip bhi .Larmv7_id_wbinv_next @@ -252,9 +254,9 @@ END(armv7_idcache_wbinv_range) ENTRY_NP(armv7_icache_sync_all) #ifdef SMP - mcr p15, 0, r0, c7, c1, 0 /* Invalidate all I cache to PoU Inner Shareable */ + mcr CP15_ICIALLUIS #else - mcr p15, 0, r0, c7, c5, 0 /* Invalidate all I cache to PoU (ICIALLU) */ + mcr CP15_ICIALLU #endif isb /* instruction synchronization barrier */ dsb /* data synchronization barrier */ @@ -264,8 +266,8 @@ END(armv7_icache_sync_all) ENTRY_NP(armv7_icache_sync_range) ldr ip, .Larmv7_line_size .Larmv7_sync_next: - mcr p15, 0, r0, c7, c5, 1 /* Invalidate I cache SE with VA */ - mcr p15, 0, r0, c7, c10, 1 /* Clean D cache SE with VA */ + mcr CP15_ICIMVAU(r0) + mcr CP15_DCCMVAC(r0) add r0, r0, ip subs r1, r1, ip bhi .Larmv7_sync_next @@ -283,13 +285,13 @@ END(armv7_cpu_sleep) ENTRY(armv7_context_switch) dsb orr r0, r0, #PT_ATTR - - mcr p15, 0, r0, c2, c0, 0 /* set the new TTB */ + + mcr CP15_TTBR0(r0) isb #ifdef SMP - mcr p15, 0, r0, c8, c3, 0 /* and flush the I+D tlbs Inner Sharable */ + mcr CP15_TLBIALLIS #else - mcr p15, 0, r0, c8, c7, 0 /* and flush the I+D tlbs */ + mcr CP15_TLBIALL #endif dsb isb @@ -309,12 +311,12 @@ ENTRY(armv7_sev) END(armv7_sev) ENTRY(armv7_auxctrl) - mrc p15, 0, r2, c1, c0, 1 + mrc CP15_ACTLR(r2) bic r3, r2, r0 /* Clear bits */ eor r3, r3, r1 /* XOR bits */ teq r2, r3 - mcrne p15, 0, r3, c1, c0, 1 + mcrne CP15_ACTLR(r3) mov r0, r2 RET END(armv7_auxctrl) @@ -325,8 +327,8 @@ END(armv7_auxctrl) */ ENTRY(armv7_idcache_inv_all) mov r0, #0 - mcr p15, 2, r0, c0, c0, 0 @ set cache level to L1 - mrc p15, 1, r0, c0, c0, 0 @ read CCSIDR + mcr CP15_CSSELR(r0) @ set cache level to L1 + mrc CP15_CCSIDR(r0) ubfx r2, r0, #13, #15 @ get num sets - 1 from CCSIDR ubfx r3, r0, #3, #10 @ get numways - 1 from CCSIDR @@ -345,7 +347,7 @@ ENTRY(armv7_idcache_inv_all) mov r2, ip @ r2 now contains set way decr /* r3 = ways/sets, r2 = way decr, r1 = set decr, r0 and ip are free */ -1: mcr p15, 0, r3, c7, c6, 2 @ invalidate line +1: mcr CP15_DCISW(r3) @ invalidate line movs r0, r3 @ get current way/set beq 2f @ at 0 means we are done. movs r0, r0, lsl #10 @ clear way bits leaving only set bits @@ -355,7 +357,7 @@ ENTRY(armv7_idcache_inv_all) 2: dsb @ wait for stores to finish mov r0, #0 @ and ... - mcr p15, 0, r0, c7, c5, 0 @ invalidate instruction+branch cache + mcr CP15_ICIALLU @ invalidate instruction+branch cache isb @ instruction sync barrier bx lr @ return END(armv7_idcache_inv_all) Added: head/sys/arm/include/sysreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/include/sysreg.h Sat Sep 27 09:57:34 2014 (r272209) @@ -0,0 +1,230 @@ +/*- + * Copyright 2014 Svatopluk Kraus + * Copyright 2014 Michal Meloun + * 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$ + */ + +/* + * Macros to make working with the System Control Registers simpler. + */ + +#ifndef MACHINE_SYSREG_H +#define MACHINE_SYSREG_H + +/* + * CP15 C0 registers + */ +#define CP15_MIDR(rr) p15, 0, rr, c0, c0, 0 /* Main ID Register */ +#define CP15_CTR(rr) p15, 0, rr, c0, c0, 1 /* Cache Type Register */ +#define CP15_TCMTR(rr) p15, 0, rr, c0, c0, 2 /* TCM Type Register */ +#define CP15_TLBTR(rr) p15, 0, rr, c0, c0, 3 /* TLB Type Register */ +#define CP15_MPIDR(rr) p15, 0, rr, c0, c0, 5 /* Multiprocessor Affinity Register */ +#define CP15_REVIDR(rr) p15, 0, rr, c0, c0, 6 /* Revision ID Register */ + +#define CP15_ID_PFR0(rr) p15, 0, rr, c0, c1, 0 /* Processor Feature Register 0 */ +#define CP15_ID_PFR1(rr) p15, 0, rr, c0, c1, 1 /* Processor Feature Register 1 */ +#define CP15_ID_DFR0(rr) p15, 0, rr, c0, c1, 2 /* Debug Feature Register 0 */ +#define CP15_ID_AFR0(rr) p15, 0, rr, c0, c1, 3 /* Auxiliary Feature Register 0 */ +#define CP15_ID_MMFR0(rr) p15, 0, rr, c0, c1, 4 /* Memory Model Feature Register 0 */ +#define CP15_ID_MMFR1(rr) p15, 0, rr, c0, c1, 5 /* Memory Model Feature Register 1 */ +#define CP15_ID_MMFR2(rr) p15, 0, rr, c0, c1, 6 /* Memory Model Feature Register 2 */ +#define CP15_ID_MMFR3(rr) p15, 0, rr, c0, c1, 7 /* Memory Model Feature Register 3 */ + +#define CP15_ID_ISAR0(rr) p15, 0, rr, c0, c2, 0 /* Instruction Set Attribute Register 0 */ +#define CP15_ID_ISAR1(rr) p15, 0, rr, c0, c2, 1 /* Instruction Set Attribute Register 1 */ +#define CP15_ID_ISAR2(rr) p15, 0, rr, c0, c2, 2 /* Instruction Set Attribute Register 2 */ +#define CP15_ID_ISAR3(rr) p15, 0, rr, c0, c2, 3 /* Instruction Set Attribute Register 3 */ +#define CP15_ID_ISAR4(rr) p15, 0, rr, c0, c2, 4 /* Instruction Set Attribute Register 4 */ +#define CP15_ID_ISAR5(rr) p15, 0, rr, c0, c2, 5 /* Instruction Set Attribute Register 5 */ + +#define CP15_CCSIDR(rr) p15, 1, rr, c0, c0, 0 /* Cache Size ID Registers */ +#define CP15_CLIDR(rr) p15, 1, rr, c0, c0, 1 /* Cache Level ID Register */ +#define CP15_AIDR(rr) p15, 1, rr, c0, c0, 7 /* Auxiliary ID Register */ + +#define CP15_CSSELR(rr) p15, 2, rr, c0, c0, 0 /* Cache Size Selection Register */ + +/* + * CP15 C1 registers + */ +#define CP15_SCTLR(rr) p15, 0, rr, c1, c0, 0 /* System Control Register */ +#define CP15_ACTLR(rr) p15, 0, rr, c1, c0, 1 /* IMPLEMENTATION DEFINED Auxiliary Control Register */ +#define CP15_CPACR(rr) p15, 0, rr, c1, c0, 2 /* Coprocessor Access Control Register */ + +#define CP15_SCR(rr) p15, 0, rr, c1, c1, 0 /* Secure Configuration Register */ +#define CP15_SDER(rr) p15, 0, rr, c1, c1, 1 /* Secure Debug Enable Register */ +#define CP15_NSACR(rr) p15, 0, rr, c1, c1, 2 /* Non-Secure Access Control Register */ + +/* + * CP15 C2 registers + */ +#define CP15_TTBR0(rr) p15, 0, rr, c2, c0, 0 /* Translation Table Base Register 0 */ +#define CP15_TTBR1(rr) p15, 0, rr, c2, c0, 1 /* Translation Table Base Register 1 */ +#define CP15_TTBCR(rr) p15, 0, rr, c2, c0, 2 /* Translation Table Base Control Register */ + +/* + * CP15 C3 registers + */ +#define CP15_DACR(rr) p15, 0, rr, c3, c0, 0 /* Domain Access Control Register */ + +/* + * CP15 C5 registers + */ +#define CP15_DFSR(rr) p15, 0, rr, c5, c0, 0 /* Data Fault Status Register */ + +#if __ARM_ARCH >= 6 +/* From ARMv6: */ +#define CP15_IFSR(rr) p15, 0, rr, c5, c0, 1 /* Instruction Fault Status Register */ +/* From ARMv7: */ +#define CP15_ADFSR(rr) p15, 0, rr, c5, c1, 0 /* Auxiliary Data Fault Status Register */ +#define CP15_AIFSR(rr) p15, 0, rr, c5, c1, 1 /* Auxiliary Instruction Fault Status Register */ +#endif + + +/* + * CP15 C6 registers + */ +#define CP15_DFAR(rr) p15, 0, rr, c6, c0, 0 /* Data Fault Address Register */ + +#if __ARM_ARCH >= 6 +/* From ARMv6k: */ +#define CP15_IFAR(rr) p15, 0, rr, c6, c0, 2 /* Instruction Fault Address Register */ +#endif + +/* + * CP15 C7 registers + */ +#if __ARM_ARCH >= 6 +/* From ARMv7: */ +#define CP15_ICIALLUIS p15, 0, r0, c7, c1, 0 /* Instruction cache invalidate all PoU, IS */ +#define CP15_BPIALLIS p15, 0, r0, c7, c1, 6 /* Branch predictor invalidate all IS */ +#endif + +#define CP15_PAR p15, 0, r0, c7, c4, 0 /* Physical Address Register */ + +#define CP15_ICIALLU p15, 0, r0, c7, c5, 0 /* Instruction cache invalidate all PoU */ +#define CP15_ICIMVAU(rr) p15, 0, rr, c7, c5, 1 /* Instruction cache invalidate */ +#if __ARM_ARCH >= 6 +/* Deprecated in ARMv7 */ +#define CP15_CP15ISB p15, 0, r0, c7, c5, 4 /* ISB */ +#endif +#define CP15_BPIALL p15, 0, r0, c7, c5, 6 /* Branch predictor invalidate all */ +#define CP15_BPIMVA p15, 0, rr, c7, c5, 7 /* Branch predictor invalidate by MVA */ + +#if __ARM_ARCH >= 6 +/* Only ARMv6: */ +#define CP15_DCIALL p15, 0, r0, c7, c6, 0 /* Data cache invalidate all */ +#endif +#define CP15_DCIMVAC(rr) p15, 0, rr, c7, c6, 1 /* Data cache invalidate by MVA PoC */ +#define CP15_DCISW(rr) p15, 0, rr, c7, c6, 2 /* Data cache invalidate by set/way */ + +#define CP15_ATS1CPR(rr) p15, 0, rr, c7, c8, 0 /* Stage 1 Current state PL1 read */ +#define CP15_ATS1CPW(rr) p15, 0, rr, c7, c8, 1 /* Stage 1 Current state PL1 write */ +#define CP15_ATS1CUR(rr) p15, 0, rr, c7, c8, 2 /* Stage 1 Current state unprivileged read */ +#define CP15_ATS1CUW(rr) p15, 0, rr, c7, c8, 3 /* Stage 1 Current state unprivileged write */ + +#if __ARM_ARCH >= 6 +/* From ARMv7: */ +#define CP15_ATS12NSOPR(rr) p15, 0, rr, c7, c8, 4 /* Stages 1 and 2 Non-secure only PL1 read */ +#define CP15_ATS12NSOPW(rr) p15, 0, rr, c7, c8, 5 /* Stages 1 and 2 Non-secure only PL1 write */ +#define CP15_ATS12NSOUR(rr) p15, 0, rr, c7, c8, 6 /* Stages 1 and 2 Non-secure only unprivileged read */ +#define CP15_ATS12NSOUW(rr) p15, 0, rr, c7, c8, 7 /* Stages 1 and 2 Non-secure only unprivileged write */ +#endif + +#if __ARM_ARCH >= 6 +/* Only ARMv6: */ +#define CP15_DCCALL p15, 0, r0, c7, c10, 0 /* Data cache clean all */ +#endif +#define CP15_DCCMVAC(rr) p15, 0, rr, c7, c10, 1 /* Data cache clean by MVA PoC */ +#define CP15_DCCSW(rr) p15, 0, rr, c7, c10, 2 /* Data cache clean by set/way */ +#if __ARM_ARCH >= 6 +/* Only ARMv6: */ +#define CP15_CP15DSB p15, 0, r0, c7, c10, 4 /* DSB */ +#define CP15_CP15DMB p15, 0, r0, c7, c10, 5 /* DMB */ +#endif + +#if __ARM_ARCH >= 6 +/* From ARMv7: */ +#define CP15_DCCMVAU(rr) p15, 0, rr, c7, c11, 1 /* Data cache clean by MVA PoU */ +#endif + +#if __ARM_ARCH >= 6 +/* Only ARMv6: */ +#define CP15_DCCIALL p15, 0, r0, c7, c14, 0 /* Data cache clean and invalidate all */ +#endif +#define CP15_DCCIMVAC(rr) p15, 0, rr, c7, c14, 1 /* Data cache clean and invalidate by MVA PoC */ +#define CP15_DCCISW(rr) p15, 0, rr, c7, c14, 2 /* Data cache clean and invalidate by set/way */ + +/* + * CP15 C8 registers + */ +#if __ARM_ARCH >= 6 +/* From ARMv7: */ +#define CP15_TLBIALLIS p15, 0, r0, c8, c3, 0 /* Invalidate entire unified TLB IS */ +#define CP15_TLBIMVAIS(rr) p15, 0, rr, c8, c3, 1 /* Invalidate unified TLB by MVA IS */ +#define CP15_TLBIASIDIS(rr) p15, 0, rr, c8, c3, 2 /* Invalidate unified TLB by ASID IS */ +#define CP15_TLBIMVAAIS(rr) p15, 0, rr, c8, c3, 3 /* Invalidate unified TLB by MVA, all ASID IS */ +#endif + +#define CP15_TLBIALL p15, 0, r0, c8, c7, 0 /* Invalidate entire unified TLB */ +#define CP15_TLBIMVA(rr) p15, 0, rr, c8, c7, 1 /* Invalidate unified TLB by MVA */ +#define CP15_TLBIASID(rr) p15, 0, rr, c8, c7, 2 /* Invalidate unified TLB by ASID */ + +#if __ARM_ARCH >= 6 +/* From ARMv6: */ +#define CP15_TLBIMVAA(rr) p15, 0, rr, c8, c7, 3 /* Invalidate unified TLB by MVA, all ASID */ +#endif + +/* + * CP15 C10 registers + */ +/* Without LPAE this is PRRR, with LPAE it's MAIR0 */ +#define CP15_PRRR(rr) p15, 0, rr, c10, c2, 0 /* Primary Region Remap Register */ +#define CP15_MAIR0(rr) p15, 0, rr, c10, c2, 0 /* Memory Attribute Indirection Register 0 */ +/* Without LPAE this is NMRR, with LPAE it's MAIR1 */ +#define CP15_NMRR(rr) p15, 0, rr, c10, c2, 1 /* Normal Memory Remap Register */ +#define CP15_MAIR1(rr) p15, 0, rr, c10, c2, 1 /* Memory Attribute Indirection Register 1 */ + +#define CP15_AMAIR0(rr) p15, 0, rr, c10, c3, 0 /* Auxiliary Memory Attribute Indirection Register 0 */ +#define CP15_AMAIR1(rr) p15, 0, rr, c10, c3, 1 /* Auxiliary Memory Attribute Indirection Register 1 */ + +/* + * CP15 C12 registers + */ +#define CP15_VBAR(rr) p15, 0, rr, c12, c0, 0 /* Vector Base Address Register */ +#define CP15_MVBAR(rr) p15, 0, rr, c12, c0, 1 /* Monitor Vector Base Address Register */ + +#define CP15_ISR(rr) p15, 0, rr, c12, c1, 0 /* Interrupt Status Register */ + +/* + * CP15 C13 registers + */ +#define CP15_FCSEIDR(rr) p15, 0, rr, c13, c0, 0 /* FCSE Process ID Register */ +#define CP15_CONTEXTIDR(rr) p15, 0, rr, c13, c0, 1 /* Context ID Register */ +#define CP15_TPIDRURW(rr) p15, 0, rr, c13, c0, 2 /* User Read/Write Thread ID Register */ +#define CP15_TPIDRURO(rr) p15, 0, rr, c13, c0, 3 /* User Read-Only Thread ID Register */ +#define CP15_TPIDRPRW(rr) p15, 0, rr, c13, c0, 4 /* PL1 only Thread ID Register */ + +#endif /* !MACHINE_SYSREG_H */ From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 10:57:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCD244C6; Sat, 27 Sep 2014 10:57:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7C9BE19; Sat, 27 Sep 2014 10:57:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RAvYJv086339; Sat, 27 Sep 2014 10:57:34 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RAvYdF086338; Sat, 27 Sep 2014 10:57:34 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201409271057.s8RAvYdF086338@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sat, 27 Sep 2014 10:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272210 - head/games/factor X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 10:57:35 -0000 Author: sbruno Date: Sat Sep 27 10:57:34 2014 New Revision: 272210 URL: http://svnweb.freebsd.org/changeset/base/272210 Log: Update factor for changes to types in primes, which is a dependency. Fixes build-fail on mips32 introduced at 272207. Modified: head/games/factor/factor.c Modified: head/games/factor/factor.c ============================================================================== --- head/games/factor/factor.c Sat Sep 27 09:57:34 2014 (r272209) +++ head/games/factor/factor.c Sat Sep 27 10:57:34 2014 (r272210) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -227,7 +228,7 @@ pr_fact(BIGNUM *val) /* Divide factor out until none are left. */ do { - printf(hflag ? " 0x%lx" : " %lu", *fact); + printf(hflag ? " 0x%" PRIx64 "" : " %" PRIu64 "", *fact); BN_div_word(val, (BN_ULONG)*fact); } while (BN_mod_word(val, (BN_ULONG)*fact) == 0); From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 11:04:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07EA278E; Sat, 27 Sep 2014 11:04:39 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DB22EDD; Sat, 27 Sep 2014 11:04:36 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8RB4Rvv052307 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 27 Sep 2014 15:04:27 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8RB4RJn052306; Sat, 27 Sep 2014 15:04:27 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 27 Sep 2014 15:04:27 +0400 From: Gleb Smirnoff To: Navdeep Parhar Subject: Re: svn commit: r272200 - head/sys/dev/cxgbe Message-ID: <20140927110427.GN884@FreeBSD.org> References: <201409270550.s8R5oV9e036364@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409270550.s8R5oV9e036364@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 11:04:39 -0000 On Sat, Sep 27, 2014 at 05:50:31AM +0000, Navdeep Parhar wrote: N> Author: np N> Date: Sat Sep 27 05:50:31 2014 N> New Revision: 272200 N> URL: http://svnweb.freebsd.org/changeset/base/272200 N> N> Log: N> cxgbe(4): implement if_get_counter. Thanks a lot, Navdeep! -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 12:55:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D027AE5; Sat, 27 Sep 2014 12:55:32 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 049EFB1D; Sat, 27 Sep 2014 12:55:32 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 69DEEB93C; Sat, 27 Sep 2014 08:55:30 -0400 (EDT) From: John Baldwin To: Colin Percival Subject: Re: svn commit: r272207 - in head/games: factor primes Date: Sat, 27 Sep 2014 08:52:33 -0400 Message-ID: <1576403.4iOOFWFkUs@ralph.baldwin.cx> User-Agent: KMail/4.12.5 (FreeBSD/10.1-BETA2; KDE/4.12.5; amd64; ; ) In-Reply-To: <201409270900.s8R90dWl029070@svn.freebsd.org> References: <201409270900.s8R90dWl029070@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 27 Sep 2014 08:55:30 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 12:55:32 -0000 On Saturday, September 27, 2014 09:00:39 AM Colin Percival wrote: > Author: cperciva > Date: Sat Sep 27 09:00:38 2014 > New Revision: 272207 > URL: http://svnweb.freebsd.org/changeset/base/272207 > > Log: > Switch primes(6) from using unsigned long to using uint64_t. This fixes > 'limited range of type' warnings about comparisons on 32-bit systems, and > allows 32-bit systems to compute the full range of primes. > > Modified: > head/games/factor/factor.6 > head/games/primes/primes.c > head/games/primes/primes.h > > Modified: head/games/primes/primes.h > ============================================================================ > == --- head/games/primes/primes.h Sat Sep 27 08:59:43 2014 (r272206) > +++ head/games/primes/primes.h Sat Sep 27 09:00:38 2014 (r272207) > @@ -41,8 +41,10 @@ > * chongo /\oo/\ > */ > > +#include > + > /* ubig is the type that holds a large unsigned value */ > -typedef unsigned long ubig; /* must be >=32 bit unsigned value */ > +typedef uint64_t ubig; /* must be >=32 bit unsigned value */ > #define BIG ULONG_MAX /* largest value will sieve */ Should this be UINT64_MAX (or however that is spelled) instead of ULONG_MAX now? (or is it even still used? I know your change removed its use in at least one place.) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 13:00:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 954FEDD3 for ; Sat, 27 Sep 2014 13:00:54 +0000 (UTC) Received: from o1.l99.sendgrid.net (o1.l99.sendgrid.net [198.37.153.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52DFDB62 for ; Sat, 27 Sep 2014 13:00:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=EyoMcjgPSr7SAdz58Bcmip3NE7A=; b=dJZQHdZ2NtBSJSBXmz 71fCXWlO00Xv5wv3tu49KGMUhLbKWy+fZaKxPeRbsZQS5B2ExTfNseITw89c47ZV FXNlWMT3ZT8n1IGW2nIs7e/dRBvkOTC/mf/cr6/XXmNqcD92tY8YubJv1aRV0LxL nd+UdRlpUgoo/t7S5jlzpGok8= Received: by mf173.sendgrid.net with SMTP id mf173.20664.5426B4FB3 2014-09-27 13:00:43.316659092 +0000 UTC Received: from mail.tarsnap.com (unknown [10.100.60.97]) by ismtpd-020.iad1.sendgrid.net (SG) with ESMTP id 148b732f547.1a12.720da2 for ; Sat, 27 Sep 2014 13:00:43 +0000 (GMT) Received: (qmail 24773 invoked from network); 27 Sep 2014 13:00:42 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 27 Sep 2014 13:00:42 -0000 Received: (qmail 13999 invoked from network); 27 Sep 2014 13:00:28 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 27 Sep 2014 13:00:28 -0000 Message-ID: <5426B4EC.9040102@freebsd.org> Date: Sat, 27 Sep 2014 06:00:28 -0700 From: Colin Percival User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r272207 - in head/games: factor primes References: <201409270900.s8R90dWl029070@svn.freebsd.org> <1576403.4iOOFWFkUs@ralph.baldwin.cx> In-Reply-To: <1576403.4iOOFWFkUs@ralph.baldwin.cx> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SG-EID: A6W2xSVPHetogaU8rnzccWwgBYtN+QvIzXyjfe/10PGv3fbB8yO0hMPsYZk8oQgEXQnCCzq2pA76c/a23zhi5oO2QeF0sjKvInkSJTq3Up8hhqld9JAhYqBtM4c4116Y9TFRUeK0I4Bm5xqX7b4O/UL5uvFKkK0EfY4OqqrYZg0= Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 13:00:54 -0000 On 09/27/14 05:52, John Baldwin wrote: > On Saturday, September 27, 2014 09:00:39 AM Colin Percival wrote: >> #define BIG ULONG_MAX /* largest value will sieve */ > > Should this be UINT64_MAX (or however that is spelled) instead of ULONG_MAX > now? (or is it even still used? I know your change removed its use in at > least one place.) It's not used any more. I was resisting the urge to spend time going through and removing ancient history (which is why I kept ubig instead of changing it to uint64_t everywhere). -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 13:48:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 933FA58C; Sat, 27 Sep 2014 13:48:01 +0000 (UTC) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 44EF5F4D; Sat, 27 Sep 2014 13:48:00 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id DC37525D3A92; Sat, 27 Sep 2014 13:47:49 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id F36CBC7706D; Sat, 27 Sep 2014 13:47:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id yfb_BHVtZKbJ; Sat, 27 Sep 2014 13:47:47 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 76F3FC7706C; Sat, 27 Sep 2014 13:47:46 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r272206 - head/sys/mips/conf From: "Bjoern A. Zeeb" In-Reply-To: <201409270859.s8R8xhdr028111@svn.freebsd.org> Date: Sat, 27 Sep 2014 13:47:41 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <37736BB2-FB9A-4A12-A8DE-6E2626818AF0@FreeBSD.org> References: <201409270859.s8R8xhdr028111@svn.freebsd.org> To: Sean Bruno X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 13:48:01 -0000 On 27 Sep 2014, at 08:59 , Sean Bruno wrote: > Author: sbruno > Date: Sat Sep 27 08:59:43 2014 > New Revision: 272206 > URL: http://svnweb.freebsd.org/changeset/base/272206 >=20 > Log: > Add kernel support for the TP-LINK MR3020 Atheros MIPS 24k router. >=20 > AR9331 based system. >=20 > Phabric: https://reviews.freebsd.org/D780 > Reviewed by: adrian >=20 > Added: > head/sys/mips/conf/TP-MR3020 (contents, props changed) > head/sys/mips/conf/TP-MR3020.hints (contents, props changed) >=20 > Added: head/sys/mips/conf/TP-MR3020 =85 > +makeoptions MFS_IMAGE=3D/tftpboot/mfsroot-tl-mr3020.img.ulzma bmake: don't know how to make /tftpboot/mfsroot-tl-mr3020.img.ulzma = (continuing) bmake: stopped in = /storage/head/obj/mips.mips/scratch/tmp/bz/head.svn/sys/TP-MR3020 Either fix this (which is probably better) or make sure universe doesn=92t= build it. =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 13:57:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63C53713; Sat, 27 Sep 2014 13:57:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DB7A67; Sat, 27 Sep 2014 13:57:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RDvnWh072152; Sat, 27 Sep 2014 13:57:49 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RDvmTC072149; Sat, 27 Sep 2014 13:57:48 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201409271357.s8RDvmTC072149@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 27 Sep 2014 13:57:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272211 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 13:57:49 -0000 Author: melifaro Date: Sat Sep 27 13:57:48 2014 New Revision: 272211 URL: http://svnweb.freebsd.org/changeset/base/272211 Log: Use underlying ports counters to get lagg statistics instead of per-packet accounting. This introduce user-visible changes like aggregating error counters. Reviewed by: asomers (prev.version), glebius CR: D781 MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sys/net/if_lagg.c head/sys/net/if_lagg.h head/sys/net/if_var.h Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Sat Sep 27 10:57:34 2014 (r272210) +++ head/sys/net/if_lagg.c Sat Sep 27 13:57:48 2014 (r272211) @@ -115,6 +115,7 @@ static int lagg_ether_cmdmulti(struct la static int lagg_setflag(struct lagg_port *, int, int, int (*func)(struct ifnet *, int)); static int lagg_setflags(struct lagg_port *, int status); +static uint64_t lagg_get_counter(struct ifnet *ifp, ift_counter cnt); static int lagg_transmit(struct ifnet *, struct mbuf *); static void lagg_qflush(struct ifnet *); static int lagg_media_change(struct ifnet *); @@ -158,8 +159,6 @@ static struct mbuf *lagg_lacp_input(stru struct mbuf *); static void lagg_lacp_lladdr(struct lagg_softc *); -static void lagg_callout(void *); - /* lagg protocol table */ static const struct lagg_proto { lagg_proto pr_num; @@ -456,11 +455,6 @@ lagg_clone_create(struct if_clone *ifc, return (ENOSPC); } - sc->sc_ipackets = counter_u64_alloc(M_WAITOK); - sc->sc_opackets = counter_u64_alloc(M_WAITOK); - sc->sc_ibytes = counter_u64_alloc(M_WAITOK); - sc->sc_obytes = counter_u64_alloc(M_WAITOK); - sysctl_ctx_init(&sc->ctx); snprintf(num, sizeof(num), "%u", unit); sc->use_flowid = def_use_flowid; @@ -490,16 +484,9 @@ lagg_clone_create(struct if_clone *ifc, lagg_proto_attach(sc, LAGG_PROTO_DEFAULT); LAGG_LOCK_INIT(sc); - LAGG_CALLOUT_LOCK_INIT(sc); SLIST_INIT(&sc->sc_ports); TASK_INIT(&sc->sc_lladdr_task, 0, lagg_port_setlladdr, sc); - /* - * This uses the callout lock rather than the rmlock; one can't - * hold said rmlock during SWI. - */ - callout_init_mtx(&sc->sc_callout, &sc->sc_call_mtx, 0); - /* Initialise pseudo media types */ ifmedia_init(&sc->sc_media, 0, lagg_media_change, lagg_media_status); @@ -512,6 +499,7 @@ lagg_clone_create(struct if_clone *ifc, ifp->if_qflush = lagg_qflush; ifp->if_init = lagg_init; ifp->if_ioctl = lagg_ioctl; + ifp->if_get_counter = lagg_get_counter; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; @@ -531,8 +519,6 @@ lagg_clone_create(struct if_clone *ifc, SLIST_INSERT_HEAD(&lagg_list, sc, sc_entries); mtx_unlock(&lagg_list_mtx); - callout_reset(&sc->sc_callout, hz, lagg_callout, sc); - return (0); } @@ -561,22 +547,12 @@ lagg_clone_destroy(struct ifnet *ifp) ether_ifdetach(ifp); if_free(ifp); - /* This grabs sc_callout_mtx, serialising it correctly */ - callout_drain(&sc->sc_callout); - - /* At this point it's drained; we can free this */ - counter_u64_free(sc->sc_ipackets); - counter_u64_free(sc->sc_opackets); - counter_u64_free(sc->sc_ibytes); - counter_u64_free(sc->sc_obytes); - mtx_lock(&lagg_list_mtx); SLIST_REMOVE(&lagg_list, sc, lagg_softc, sc_entries); mtx_unlock(&lagg_list_mtx); taskqueue_drain(taskqueue_swi, &sc->sc_lladdr_task); LAGG_LOCK_DESTROY(sc); - LAGG_CALLOUT_LOCK_DESTROY(sc); free(sc, M_DEVBUF); } @@ -712,7 +688,8 @@ lagg_port_create(struct lagg_softc *sc, { struct lagg_softc *sc_ptr; struct lagg_port *lp, *tlp; - int error; + int error, i; + uint64_t *pval; LAGG_WLOCK_ASSERT(sc); @@ -836,6 +813,10 @@ lagg_port_create(struct lagg_softc *sc, lagg_capabilities(sc); lagg_linkstate(sc); + /* Read port counters */ + pval = lp->port_counters.val; + for (i = IFCOUNTER_IPACKETS; i <= IFCOUNTER_LAST; i++, pval++) + *pval = ifp->if_get_counter(ifp, i); /* Add multicast addresses and interface flags to this port */ lagg_ether_cmdmulti(lp, 1); lagg_setflags(lp, 1); @@ -877,6 +858,8 @@ lagg_port_destroy(struct lagg_port *lp, struct lagg_port *lp_ptr; struct lagg_llq *llq; struct ifnet *ifp = lp->lp_ifp; + uint64_t *pval, vdiff; + int i; LAGG_WLOCK_ASSERT(sc); @@ -899,6 +882,13 @@ lagg_port_destroy(struct lagg_port *lp, ifp->if_output = lp->lp_output; ifp->if_lagg = NULL; + /* Update detached port counters */ + pval = lp->port_counters.val; + for (i = IFCOUNTER_IPACKETS; i <= IFCOUNTER_LAST; i++, pval++) { + vdiff = ifp->if_get_counter(ifp, i) - *pval; + sc->detached_counters.val[i - 1] += vdiff; + } + /* Finally, remove the port from the lagg */ SLIST_REMOVE(&sc->sc_ports, lp, lagg_port, lp_entries); sc->sc_count--; @@ -1012,6 +1002,61 @@ fallback: } /* + * Requests counter @cnt data. + * + * Counter value is calculated the following way: + * 1) for each port, sum difference between current and "initial" measurements. + * 2) add lagg logical interface counters. + * 3) add data from detached_counters array. + * + * We also do the following things on ports attach/detach: + * 1) On port attach we store all counters it has into port_counter array. + * 2) On port detach we add the different between "initial" and + * current counters data to detached_counters array. + */ +static uint64_t +lagg_get_counter(struct ifnet *ifp, ift_counter cnt) +{ + struct lagg_softc *sc; + struct lagg_port *lp; + struct ifnet *lpifp; + struct rm_priotracker tracker; + uint64_t newval, oldval, vsum; + + if (cnt <= 0 || cnt > IFCOUNTER_LAST) + return (if_get_counter_default(ifp, cnt)); + + sc = (struct lagg_softc *)ifp->if_softc; + LAGG_RLOCK(sc, &tracker); + + vsum = 0; + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + /* Saved attached value */ + oldval = lp->port_counters.val[cnt - 1]; + /* current value */ + lpifp = lp->lp_ifp; + newval = lpifp->if_get_counter(lpifp, cnt); + /* Calculate diff and save new */ + vsum += newval - oldval; + } + + /* + * Add counter data which might be added by upper + * layer protocols operating on logical interface. + */ + vsum += if_get_counter_default(ifp, cnt); + + /* + * Add counter data from detached ports counters + */ + vsum += sc->detached_counters.val[cnt - 1]; + + LAGG_RUNLOCK(sc, &tracker); + + return (vsum); +} + +/* * For direct output to child ports. */ static int @@ -1449,11 +1494,7 @@ lagg_transmit(struct ifnet *ifp, struct error = lagg_proto_start(sc, m); LAGG_RUNLOCK(sc, &tracker); - if (error == 0) { - counter_u64_add(sc->sc_opackets, 1); - counter_u64_add(sc->sc_obytes, len); - ifp->if_omcasts += mcast; - } else + if (error != 0) ifp->if_oerrors++; return (error); @@ -1489,9 +1530,6 @@ lagg_input(struct ifnet *ifp, struct mbu m = lagg_proto_input(sc, lp, m); if (m != NULL) { - counter_u64_add(sc->sc_ipackets, 1); - counter_u64_add(sc->sc_ibytes, m->m_pkthdr.len); - if (scifp->if_flags & IFF_MONITOR) { m_freem(m); m = NULL; @@ -2124,16 +2162,3 @@ lagg_lacp_input(struct lagg_softc *sc, s return (m); } -static void -lagg_callout(void *arg) -{ - struct lagg_softc *sc = (struct lagg_softc *)arg; - struct ifnet *ifp = sc->sc_ifp; - - ifp->if_ipackets = counter_u64_fetch(sc->sc_ipackets); - ifp->if_opackets = counter_u64_fetch(sc->sc_opackets); - ifp->if_ibytes = counter_u64_fetch(sc->sc_ibytes); - ifp->if_obytes = counter_u64_fetch(sc->sc_obytes); - - callout_reset(&sc->sc_callout, hz, lagg_callout, sc); -} Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Sat Sep 27 10:57:34 2014 (r272210) +++ head/sys/net/if_lagg.h Sat Sep 27 13:57:48 2014 (r272211) @@ -140,8 +140,6 @@ struct lagg_reqflags { #ifdef _KERNEL -#include - /* * Internal kernel part */ @@ -187,10 +185,13 @@ struct lagg_llq { SLIST_ENTRY(lagg_llq) llq_entries; }; +struct lagg_counters { + uint64_t val[IFCOUNTER_LAST]; +}; + struct lagg_softc { struct ifnet *sc_ifp; /* virtual interface */ struct rmlock sc_mtx; - struct mtx sc_call_mtx; int sc_proto; /* lagg protocol */ u_int sc_count; /* number of ports */ u_int sc_active; /* active port count */ @@ -202,11 +203,6 @@ struct lagg_softc { uint32_t sc_seq; /* sequence counter */ uint32_t sc_flags; - counter_u64_t sc_ipackets; - counter_u64_t sc_opackets; - counter_u64_t sc_ibytes; - counter_u64_t sc_obytes; - SLIST_HEAD(__tplhd, lagg_port) sc_ports; /* list of interfaces */ SLIST_ENTRY(lagg_softc) sc_entries; @@ -220,6 +216,7 @@ struct lagg_softc { struct sysctl_oid *sc_oid; /* sysctl tree oid */ int use_flowid; /* use M_FLOWID */ int flowid_shift; /* shift the flowid */ + struct lagg_counters detached_counters; /* detached ports sum */ }; struct lagg_port { @@ -241,6 +238,7 @@ struct lagg_port { int (*lp_ioctl)(struct ifnet *, u_long, caddr_t); int (*lp_output)(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); + struct lagg_counters port_counters; /* ifp counters copy */ SLIST_ENTRY(lagg_port) lp_entries; }; @@ -254,11 +252,6 @@ struct lagg_port { #define LAGG_RLOCK_ASSERT(_sc) rm_assert(&(_sc)->sc_mtx, RA_RLOCKED) #define LAGG_WLOCK_ASSERT(_sc) rm_assert(&(_sc)->sc_mtx, RA_WLOCKED) -#define LAGG_CALLOUT_LOCK_INIT(_sc) \ - mtx_init(&(_sc)->sc_call_mtx, "if_lagg callout mutex", NULL,\ - MTX_DEF) -#define LAGG_CALLOUT_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_call_mtx) - extern struct mbuf *(*lagg_input_p)(struct ifnet *, struct mbuf *); extern void (*lagg_linkstate_p)(struct ifnet *, int ); Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sat Sep 27 10:57:34 2014 (r272210) +++ head/sys/net/if_var.h Sat Sep 27 13:57:48 2014 (r272211) @@ -109,6 +109,7 @@ typedef enum { IFCOUNTER_OQDROPS, IFCOUNTER_NOPROTO, } ift_counter; +#define IFCOUNTER_LAST IFCOUNTER_NOPROTO typedef struct ifnet * if_t; From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 14:39:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EB684D1; Sat, 27 Sep 2014 14:39:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39D13656; Sat, 27 Sep 2014 14:39:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8REd1F6091635; Sat, 27 Sep 2014 14:39:01 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8REd1ZK091634; Sat, 27 Sep 2014 14:39:01 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201409271439.s8REd1ZK091634@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Sat, 27 Sep 2014 14:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272213 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 14:39:01 -0000 Author: kevlo Date: Sat Sep 27 14:39:00 2014 New Revision: 272213 URL: http://svnweb.freebsd.org/changeset/base/272213 Log: Fix the definitioin of AT91SAM9G45_IRQ_PIOE and rename it to AT91SAM9G45_IRQ_PIODE. According to the data sheet, both PIOD and PIOE use the same IRQ. While here remove duplicate definitions. Modified: head/sys/arm/at91/at91sam9g45reg.h Modified: head/sys/arm/at91/at91sam9g45reg.h ============================================================================== --- head/sys/arm/at91/at91sam9g45reg.h Sat Sep 27 14:24:43 2014 (r272212) +++ head/sys/arm/at91/at91sam9g45reg.h Sat Sep 27 14:39:00 2014 (r272213) @@ -168,8 +168,8 @@ #define AT91SAM9G45_IRQ_PIOA 2 #define AT91SAM9G45_IRQ_PIOB 3 #define AT91SAM9G45_IRQ_PIOC 4 -#define AT91SAM9G45_IRQ_PIOD 5 -#define AT91SAM9G45_IRQ_PIOE 6 +#define AT91SAM9G45_IRQ_PIODE 5 +#define AT91SAM9G45_IRQ_TRNG 6 #define AT91SAM9G45_IRQ_USART0 7 #define AT91SAM9G45_IRQ_USART1 8 #define AT91SAM9G45_IRQ_USART2 9 @@ -202,6 +202,8 @@ #define AT91SAM9G45_IRQ_WDT AT91SAM9G45_IRQ_SYSTEM #define AT91SAM9G45_IRQ_PIT AT91SAM9G45_IRQ_SYSTEM #define AT91SAM9G45_IRQ_RSTC AT91SAM9G45_IRQ_SYSTEM +#define AT91SAM9G45_IRQ_PIOD AT91SAM9G45_IRQ_PIODE +#define AT91SAM9G45_IRQ_PIOE AT91SAM9G45_IRQ_PIODE #define AT91SAM9G45_IRQ_OHCI AT91SAM9G45_IRQ_UHP #define AT91SAM9G45_IRQ_TC0 AT91SAM9G45_IRQ_TC0_TC5 #define AT91SAM9G45_IRQ_TC1 AT91SAM9G45_IRQ_TC0_TC5 @@ -225,9 +227,6 @@ #define AT91SAM9G45_SMC_BASE 0xfffe800 #define AT91SAM9G45_SMC_SIZE 0x200 -#define AT91SAM9G45_PMC_BASE 0xffffc00 -#define AT91SAM9G45_PMC_SIZE 0x100 - #define AT91SAM9G45_HSMCI0_BASE 0xff80000 #define AT91SAM9G45_HSMCI0_SIZE 0x4000 From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 16:50:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 558D3615; Sat, 27 Sep 2014 16:50:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 347D32EC; Sat, 27 Sep 2014 16:50:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RGoMNU053557; Sat, 27 Sep 2014 16:50:22 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RGoLHS053554; Sat, 27 Sep 2014 16:50:21 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201409271650.s8RGoLHS053554@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sat, 27 Sep 2014 16:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272214 - in head/sys: boot/i386/libfirewire dev/firewire X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 16:50:22 -0000 Author: kan Date: Sat Sep 27 16:50:21 2014 New Revision: 272214 URL: http://svnweb.freebsd.org/changeset/base/272214 Log: Remove obsolete compatibility glue and improve firewire code readability. Commit my version of style(9) pass over the firewire code. Now that other people have started changing the code carrying this is as a local patch is not longer a viable option. MFC after: 1 month Modified: head/sys/boot/i386/libfirewire/fwohcireg.h head/sys/dev/firewire/firewire.c head/sys/dev/firewire/firewire.h head/sys/dev/firewire/firewire_phy.h head/sys/dev/firewire/firewirereg.h head/sys/dev/firewire/fwcrom.c head/sys/dev/firewire/fwdev.c head/sys/dev/firewire/fwdma.c head/sys/dev/firewire/fwdma.h head/sys/dev/firewire/fwmem.c head/sys/dev/firewire/fwohci.c head/sys/dev/firewire/fwohci_pci.c head/sys/dev/firewire/fwohcireg.h head/sys/dev/firewire/fwohcivar.h head/sys/dev/firewire/iec68113.h head/sys/dev/firewire/if_fwe.c head/sys/dev/firewire/if_fwip.c head/sys/dev/firewire/sbp.c head/sys/dev/firewire/sbp.h head/sys/dev/firewire/sbp_targ.c Modified: head/sys/boot/i386/libfirewire/fwohcireg.h ============================================================================== --- head/sys/boot/i386/libfirewire/fwohcireg.h Sat Sep 27 14:39:00 2014 (r272213) +++ head/sys/boot/i386/libfirewire/fwohcireg.h Sat Sep 27 16:50:21 2014 (r272214) @@ -235,7 +235,7 @@ struct ohci_registers { fwohcireg_t config_rom; /* config ROM map 0x34 */ fwohcireg_t post_wr_lo; /* post write addr lo 0x38 */ fwohcireg_t post_wr_hi; /* post write addr hi 0x3c */ - fwohcireg_t vender; /* vender ID 0x40 */ + fwohcireg_t vendor; /* vendor ID 0x40 */ fwohcireg_t dummy1[3]; /* dummy 0x44-0x4c */ fwohcireg_t hcc_cntl_set; /* HCC control set 0x50 */ fwohcireg_t hcc_cntl_clr; /* HCC control clr 0x54 */ Modified: head/sys/dev/firewire/firewire.c ============================================================================== --- head/sys/dev/firewire/firewire.c Sat Sep 27 14:39:00 2014 (r272213) +++ head/sys/dev/firewire/firewire.c Sat Sep 27 16:50:21 2014 (r272214) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include - #include /* used by smbus and newbus */ #include @@ -65,7 +64,7 @@ struct crom_src_buf { struct crom_chunk hw; }; -int firewire_debug=0, try_bmr=1, hold_count=0; +int firewire_debug = 0, try_bmr = 1, hold_count = 0; SYSCTL_INT(_debug, OID_AUTO, firewire_debug, CTLFLAG_RW, &firewire_debug, 0, "FireWire driver debug flag"); SYSCTL_NODE(_hw, OID_AUTO, firewire, CTLFLAG_RD, 0, "FireWire Subsystem"); @@ -81,19 +80,19 @@ MALLOC_DEFINE(M_FWXFER, "fw_xfer", "XFER devclass_t firewire_devclass; -static void firewire_identify (driver_t *, device_t); -static int firewire_probe (device_t); -static int firewire_attach (device_t); -static int firewire_detach (device_t); -static int firewire_resume (device_t); +static void firewire_identify(driver_t *, device_t); +static int firewire_probe(device_t); +static int firewire_attach(device_t); +static int firewire_detach(device_t); +static int firewire_resume(device_t); static void firewire_xfer_timeout(void *, int); static device_t firewire_add_child(device_t, u_int, const char *, int); -static void fw_try_bmr (void *); -static void fw_try_bmr_callback (struct fw_xfer *); -static void fw_asystart (struct fw_xfer *); -static int fw_get_tlabel (struct firewire_comm *, struct fw_xfer *); -static void fw_bus_probe (struct firewire_comm *); -static void fw_attach_dev (struct firewire_comm *); +static void fw_try_bmr(void *); +static void fw_try_bmr_callback(struct fw_xfer *); +static void fw_asystart(struct fw_xfer *); +static int fw_get_tlabel(struct firewire_comm *, struct fw_xfer *); +static void fw_bus_probe(void *); +static void fw_attach_dev(struct firewire_comm *); static void fw_bus_probe_thread(void *); #ifdef FW_VMACCESS static void fw_vmaccess (struct fw_xfer *); @@ -116,6 +115,7 @@ static device_method_t firewire_methods[ DEVMETHOD_END }; + char *linkspeed[] = { "S100", "S200", "S400", "S800", "S1600", "S3200", "undef", "undef" @@ -174,8 +174,10 @@ fw_noderesolve_eui64(struct firewire_com FW_GUNLOCK(fc); splx(s); - if(fwdev == NULL) return NULL; - if(fwdev->status == FWDEVINVAL) return NULL; + if (fwdev == NULL) + return NULL; + if (fwdev->status == FWDEVINVAL) + return NULL; return fwdev; } @@ -192,8 +194,9 @@ fw_asyreq(struct firewire_comm *fc, int int tcode; struct tcode_info *info; - if(xfer == NULL) return EINVAL; - if(xfer->hand == NULL){ + if (xfer == NULL) + return EINVAL; + if (xfer->hand == NULL) { printf("hand == NULL\n"); return EINVAL; } @@ -231,17 +234,17 @@ fw_asyreq(struct firewire_comm *fc, int len = fp->mode.rresb.len; else len = 0; - if (len != xfer->send.pay_len){ + if (len != xfer->send.pay_len) { printf("len(%d) != send.pay_len(%d) %s(%x)\n", len, xfer->send.pay_len, tcode_str[tcode], tcode); - return EINVAL; + return EINVAL; } - if(xferq->start == NULL){ + if (xferq->start == NULL) { printf("xferq->start == NULL\n"); return EINVAL; } - if(!(xferq->queued < xferq->maxq)){ + if (!(xferq->queued < xferq->maxq)) { device_printf(fc->bdev, "Discard a packet (queued=%d)\n", xferq->queued); return EAGAIN; @@ -260,6 +263,7 @@ fw_asyreq(struct firewire_comm *fc, int fw_asystart(xfer); return err; } + /* * Wakeup blocked process. */ @@ -283,8 +287,8 @@ fw_xferwait(struct fw_xfer *xfer) int err = 0; mtx_lock(lock); - if ((xfer->flag & FWXF_WAKE) == 0) - err = msleep((void *)xfer, lock, PWAIT|PCATCH, "fw_xferwait", 0); + while ((xfer->flag & FWXF_WAKE) == 0) + err = msleep(xfer, lock, PWAIT|PCATCH, "fw_xferwait", 0); mtx_unlock(lock); return (err); @@ -298,13 +302,14 @@ fw_asystart(struct fw_xfer *xfer) { struct firewire_comm *fc = xfer->fc; int s; + s = splfw(); /* Protect from interrupt/timeout */ FW_GLOCK(fc); xfer->flag = FWXF_INQ; STAILQ_INSERT_TAIL(&xfer->q->q, xfer, link); #if 0 - xfer->q->queued ++; + xfer->q->queued++; #endif FW_GUNLOCK(fc); splx(s); @@ -346,7 +351,7 @@ firewire_xfer_timeout(void *arg, int pen s = splfw(); mtx_lock(&fc->tlabel_lock); - for (i = 0; i < 0x40; i ++) { + for (i = 0; i < 0x40; i++) { while ((xfer = STAILQ_FIRST(&fc->tlabels[i])) != NULL) { if ((xfer->flag & FWXF_SENT) == 0) /* not sent yet */ @@ -355,8 +360,8 @@ firewire_xfer_timeout(void *arg, int pen /* the rests are newer than this */ break; device_printf(fc->bdev, - "split transaction timeout: " - "tl=0x%x flag=0x%02x\n", i, xfer->flag); + "split transaction timeout: tl=0x%x flag=0x%02x\n", + i, xfer->flag); fw_dump_hdr(&xfer->send.hdr, "send"); xfer->resp = ETIMEDOUT; xfer->tl = -1; @@ -369,7 +374,7 @@ firewire_xfer_timeout(void *arg, int pen fc->timeout(fc); STAILQ_FOREACH_SAFE(xfer, &xfer_timeout, tlabel, txfer) - xfer->hand(xfer); + xfer->hand(xfer); } #define WATCHDOG_HZ 10 @@ -379,7 +384,7 @@ firewire_watchdog(void *arg) struct firewire_comm *fc; static int watchdog_clock = 0; - fc = (struct firewire_comm *)arg; + fc = arg; /* * At boot stage, the device interrupt is disabled and @@ -389,10 +394,10 @@ firewire_watchdog(void *arg) if (watchdog_clock > WATCHDOG_HZ * 15) taskqueue_enqueue(fc->taskqueue, &fc->task_timeout); else - watchdog_clock ++; + watchdog_clock++; callout_reset(&fc->timeout_callout, hz / WATCHDOG_HZ, - (void *)firewire_watchdog, (void *)fc); + firewire_watchdog, fc); } /* @@ -406,35 +411,36 @@ firewire_attach(device_t dev) device_t pa = device_get_parent(dev); struct firewire_comm *fc; - fc = (struct firewire_comm *)device_get_softc(pa); + fc = device_get_softc(pa); sc->fc = fc; fc->status = FWBUSNOTREADY; unit = device_get_unit(dev); - if( fc->nisodma > FWMAXNDMA) fc->nisodma = FWMAXNDMA; + if (fc->nisodma > FWMAXNDMA) + fc->nisodma = FWMAXNDMA; fwdev_makedev(sc); - fc->crom_src_buf = (struct crom_src_buf *)malloc( - sizeof(struct crom_src_buf), - M_FW, M_NOWAIT | M_ZERO); + fc->crom_src_buf = malloc(sizeof(struct crom_src_buf), + M_FW, M_NOWAIT | M_ZERO); if (fc->crom_src_buf == NULL) { - device_printf(fc->dev, "%s: Malloc Failure crom src buff\n", __func__); + device_printf(fc->dev, + "%s: unable to allocate crom src buffer\n", __func__); return ENOMEM; } - fc->topology_map = (struct fw_topology_map *)malloc( - sizeof(struct fw_topology_map), - M_FW, M_NOWAIT | M_ZERO); + fc->topology_map = malloc(sizeof(struct fw_topology_map), + M_FW, M_NOWAIT | M_ZERO); if (fc->topology_map == NULL) { - device_printf(fc->dev, "%s: Malloc Failure topology map\n", __func__); + device_printf(fc->dev, "%s: unable to allocate topology map\n", + __func__); free(fc->crom_src_buf, M_FW); return ENOMEM; } - fc->speed_map = (struct fw_speed_map *)malloc( - sizeof(struct fw_speed_map), - M_FW, M_NOWAIT | M_ZERO); + fc->speed_map = malloc(sizeof(struct fw_speed_map), + M_FW, M_NOWAIT | M_ZERO); if (fc->speed_map == NULL) { - device_printf(fc->dev, "%s: Malloc Failure speed map\n", __func__); + device_printf(fc->dev, "%s: unable to allocate speed map\n", + __func__); free(fc->crom_src_buf, M_FW); free(fc->topology_map, M_FW); return ENOMEM; @@ -445,14 +451,14 @@ firewire_attach(device_t dev) CALLOUT_INIT(&fc->timeout_callout); CALLOUT_INIT(&fc->bmr_callout); CALLOUT_INIT(&fc->busprobe_callout); - TASK_INIT(&fc->task_timeout, 0, firewire_xfer_timeout, (void *)fc); + TASK_INIT(&fc->task_timeout, 0, firewire_xfer_timeout, fc); callout_reset(&sc->fc->timeout_callout, hz, - (void *)firewire_watchdog, (void *)sc->fc); + firewire_watchdog, sc->fc); /* create thread */ - kproc_create(fw_bus_probe_thread, (void *)fc, &fc->probe_thread, - 0, 0, "fw%d_probe", unit); + kproc_create(fw_bus_probe_thread, fc, &fc->probe_thread, + 0, 0, "fw%d_probe", unit); /* Locate our children */ bus_generic_probe(dev); @@ -475,10 +481,10 @@ firewire_attach(device_t dev) static device_t firewire_add_child(device_t dev, u_int order, const char *name, int unit) { - device_t child; + device_t child; struct firewire_softc *sc; - sc = (struct firewire_softc *)device_get_softc(dev); + sc = device_get_softc(dev); child = device_add_child(dev, name, unit); if (child) { device_set_ivars(child, sc->fc); @@ -493,16 +499,16 @@ firewire_resume(device_t dev) { struct firewire_softc *sc; - sc = (struct firewire_softc *)device_get_softc(dev); + sc = device_get_softc(dev); sc->fc->status = FWBUSNOTREADY; - + bus_generic_resume(dev); - return(0); + return (0); } /* - * Dettach it. + * Detach it. */ static int firewire_detach(device_t dev) @@ -512,7 +518,7 @@ firewire_detach(device_t dev) struct fw_device *fwdev, *fwdev_next; int err; - sc = (struct firewire_softc *)device_get_softc(dev); + sc = device_get_softc(dev); fc = sc->fc; mtx_lock(&fc->wait_lock); fc->status = FWBUSDETACH; @@ -521,7 +527,7 @@ firewire_detach(device_t dev) printf("firewire probe thread didn't die\n"); mtx_unlock(&fc->wait_lock); - if (fc->arq !=0 && fc->arq->maxq > 0) + if (fc->arq != 0 && fc->arq->maxq > 0) fw_drain_txq(fc); if ((err = fwdev_destroydev(sc)) != 0) @@ -536,7 +542,7 @@ firewire_detach(device_t dev) /* XXX xfer_free and untimeout on all xfers */ for (fwdev = STAILQ_FIRST(&fc->devices); fwdev != NULL; - fwdev = fwdev_next) { + fwdev = fwdev_next) { fwdev_next = STAILQ_NEXT(fwdev, link); free(fwdev, M_FW); } @@ -546,7 +552,7 @@ firewire_detach(device_t dev) mtx_destroy(&fc->tlabel_lock); mtx_destroy(&fc->wait_lock); - return(0); + return (0); } static void @@ -557,7 +563,7 @@ fw_xferq_drain(struct fw_xferq *xferq) while ((xfer = STAILQ_FIRST(&xferq->q)) != NULL) { STAILQ_REMOVE_HEAD(&xferq->q, link); #if 0 - xferq->queued --; + xferq->queued--; #endif xfer->resp = EAGAIN; xfer->flag = FWXF_SENTERR; @@ -577,12 +583,12 @@ fw_drain_txq(struct firewire_comm *fc) FW_GLOCK(fc); fw_xferq_drain(fc->atq); fw_xferq_drain(fc->ats); - for(i = 0; i < fc->nisodma; i++) + for (i = 0; i < fc->nisodma; i++) fw_xferq_drain(fc->it[i]); FW_GUNLOCK(fc); mtx_lock(&fc->tlabel_lock); - for (i = 0; i < 0x40; i ++) + for (i = 0; i < 0x40; i++) while ((xfer = STAILQ_FIRST(&fc->tlabels[i])) != NULL) { if (firewire_debug) printf("tl=%d flag=%d\n", i, xfer->flag); @@ -594,7 +600,7 @@ fw_drain_txq(struct firewire_comm *fc) mtx_unlock(&fc->tlabel_lock); STAILQ_FOREACH_SAFE(xfer, &xfer_drain, tlabel, txfer) - xfer->hand(xfer); + xfer->hand(xfer); } static void @@ -603,7 +609,7 @@ fw_reset_csr(struct firewire_comm *fc) int i; CSRARC(fc, STATE_CLEAR) - = 1 << 23 | 0 << 17 | 1 << 16 | 1 << 15 | 1 << 14 ; + = 1 << 23 | 0 << 17 | 1 << 16 | 1 << 15 | 1 << 14; CSRARC(fc, STATE_SET) = CSRARC(fc, STATE_CLEAR); CSRARC(fc, NODE_IDS) = 0x3f; @@ -612,10 +618,10 @@ fw_reset_csr(struct firewire_comm *fc) fc->max_node = -1; - for(i = 2; i < 0x100/4 - 2 ; i++){ + for (i = 2; i < 0x100 / 4 - 2; i++) { CSRARC(fc, SPED_MAP + i * 4) = 0; } - CSRARC(fc, STATE_CLEAR) = 1 << 23 | 0 << 17 | 1 << 16 | 1 << 15 | 1 << 14 ; + CSRARC(fc, STATE_CLEAR) = 1 << 23 | 0 << 17 | 1 << 16 | 1 << 15 | 1 << 14; CSRARC(fc, STATE_SET) = CSRARC(fc, STATE_CLEAR); CSRARC(fc, RESET_START) = 0; CSRARC(fc, SPLIT_TIMEOUT_HI) = 0; @@ -631,14 +637,14 @@ fw_reset_csr(struct firewire_comm *fc) CSRARC(fc, CONF_ROM) = 0x04 << 24; CSRARC(fc, CONF_ROM + 4) = 0x31333934; /* means strings 1394 */ CSRARC(fc, CONF_ROM + 8) = 1 << 31 | 1 << 30 | 1 << 29 | - 1 << 28 | 0xff << 16 | 0x09 << 8; + 1 << 28 | 0xff << 16 | 0x09 << 8; CSRARC(fc, CONF_ROM + 0xc) = 0; -/* DV depend CSRs see blue book */ - CSRARC(fc, oPCR) &= ~DV_BROADCAST_ON; - CSRARC(fc, iPCR) &= ~DV_BROADCAST_ON; + /* DV depend CSRs see blue book */ + CSRARC(fc, oPCR) &= ~DV_BROADCAST_ON; + CSRARC(fc, iPCR) &= ~DV_BROADCAST_ON; - CSRARC(fc, STATE_CLEAR) &= ~(1 << 23 | 1 << 15 | 1 << 14 ); + CSRARC(fc, STATE_CLEAR) &= ~(1 << 23 | 1 << 15 | 1 << 14); CSRARC(fc, STATE_SET) = CSRARC(fc, STATE_CLEAR); } @@ -694,13 +700,8 @@ fw_reset_crom(struct firewire_comm *fc) crom_add_entry(root, CSRKEY_NCAP, 0x0083c0); /* XXX */ /* private company_id */ crom_add_entry(root, CSRKEY_VENDOR, CSRVAL_VENDOR_PRIVATE); -#ifdef __DragonFly__ - crom_add_simple_text(src, root, &buf->vendor, "DragonFly Project"); - crom_add_entry(root, CSRKEY_HW, __DragonFly_cc_version); -#else crom_add_simple_text(src, root, &buf->vendor, "FreeBSD Project"); crom_add_entry(root, CSRKEY_HW, __FreeBSD_version); -#endif mtx_lock(&prison0.pr_mtx); crom_add_simple_text(src, root, &buf->hw, prison0.pr_hostname); mtx_unlock(&prison0.pr_mtx); @@ -731,8 +732,8 @@ fw_busreset(struct firewire_comm *fc, ui fw_reset_crom(fc); if (device_get_children(fc->bdev, &devlistp, &devcnt) == 0) { - for( i = 0 ; i < devcnt ; i++) - if (device_get_state(devlistp[i]) >= DS_ATTACHED) { + for (i = 0; i < devcnt; i++) + if (device_get_state(devlistp[i]) >= DS_ATTACHED) { fdc = device_get_softc(devlistp[i]); if (fdc->post_busreset != NULL) fdc->post_busreset(fdc); @@ -741,31 +742,30 @@ fw_busreset(struct firewire_comm *fc, ui } src = &fc->crom_src_buf->src; - /* - * If the old config rom needs to be overwritten, - * bump the businfo.generation indicator to - * indicate that we need to be reprobed - * See 1394a-2000 8.3.2.5.4 for more details. - * generation starts at 2 and rolls over at 0xF - * back to 2. - * - * A generation of 0 indicates a device - * that is not 1394a-2000 compliant. - * A generation of 1 indicates a device that - * does not change it's Bus Info Block or - * Configuration ROM. - */ + /* + * If the old config rom needs to be overwritten, + * bump the businfo.generation indicator to + * indicate that we need to be reprobed + * See 1394a-2000 8.3.2.5.4 for more details. + * generation starts at 2 and rolls over at 0xF + * back to 2. + * + * A generation of 0 indicates a device + * that is not 1394a-2000 compliant. + * A generation of 1 indicates a device that + * does not change it's Bus Info Block or + * Configuration ROM. + */ #define FW_MAX_GENERATION 0xF newrom = malloc(CROMSIZE, M_FW, M_NOWAIT | M_ZERO); src = &fc->crom_src_buf->src; crom_load(src, newrom, CROMSIZE); if (bcmp(newrom, fc->config_rom, CROMSIZE) != 0) { - if ( src->businfo.generation++ > FW_MAX_GENERATION ) + if (src->businfo.generation++ > FW_MAX_GENERATION) src->businfo.generation = FW_GENERATION_CHANGEABLE; - bcopy(newrom, (void *)fc->config_rom, CROMSIZE); + bcopy(newrom, fc->config_rom, CROMSIZE); } free(newrom, M_FW); - } /* Call once after reboot */ @@ -795,7 +795,7 @@ void fw_init(struct firewire_comm *fc) STAILQ_INIT(&fc->atq->q); STAILQ_INIT(&fc->ats->q); - for( i = 0 ; i < fc->nisodma ; i ++ ){ + for (i = 0; i < fc->nisodma; i++) { fc->it[i]->queued = 0; fc->ir[i]->queued = 0; @@ -817,7 +817,7 @@ void fw_init(struct firewire_comm *fc) fc->atq->maxq = FWMAXQUEUE; fc->ats->maxq = FWMAXQUEUE; - for( i = 0 ; i < fc->nisodma ; i++){ + for (i = 0; i < fc->nisodma; i++) { fc->ir[i]->maxq = FWMAXQUEUE; fc->it[i]->maxq = FWMAXQUEUE; } @@ -829,9 +829,9 @@ void fw_init(struct firewire_comm *fc) STAILQ_INIT(&fc->devices); -/* Initialize Async handlers */ + /* Initialize Async handlers */ STAILQ_INIT(&fc->binds); - for( i = 0 ; i < 0x40 ; i++){ + for (i = 0; i < 0x40; i++) { STAILQ_INIT(&fc->tlabels[i]); } @@ -839,14 +839,14 @@ void fw_init(struct firewire_comm *fc) #if 0 CSRARC(fc, oMPR) = 0x3fff0001; /* # output channel = 1 */ CSRARC(fc, oPCR) = 0x8000007a; - for(i = 4 ; i < 0x7c/4 ; i+=4){ - CSRARC(fc, i + oPCR) = 0x8000007a; + for (i = 4; i < 0x7c/4; i += 4) { + CSRARC(fc, i + oPCR) = 0x8000007a; } - + CSRARC(fc, iMPR) = 0x00ff0001; /* # input channel = 1 */ CSRARC(fc, iPCR) = 0x803f0000; - for(i = 4 ; i < 0x7c/4 ; i+=4){ - CSRARC(fc, i + iPCR) = 0x0; + for (i = 4; i < 0x7c/4; i += 4) { + CSRARC(fc, i + iPCR) = 0x0; } #endif @@ -854,10 +854,11 @@ void fw_init(struct firewire_comm *fc) #ifdef FW_VMACCESS xfer = fw_xfer_alloc(); - if(xfer == NULL) return; + if (xfer == NULL) + return; - fwb = (struct fw_bind *)malloc(sizeof (struct fw_bind), M_FW, M_NOWAIT); - if(fwb == NULL){ + fwb = malloc(sizeof(struct fw_bind), M_FW, M_NOWAIT); + if (fwb == NULL) { fw_xfer_free(xfer); return; } @@ -873,8 +874,8 @@ void fw_init(struct firewire_comm *fc) #endif } -#define BIND_CMP(addr, fwb) (((addr) < (fwb)->start)?-1:\ - ((fwb)->end < (addr))?1:0) +#define BIND_CMP(addr, fwb) (((addr) < (fwb)->start)? -1 : \ + ((fwb)->end < (addr)) ? 1 : 0) /* * To lookup bound process from IEEE1394 address. @@ -893,7 +894,7 @@ fw_bindlookup(struct firewire_comm *fc, break; } FW_GUNLOCK(fc); - return(r); + return (r); } /* @@ -978,7 +979,7 @@ fw_xferlist_add(struct fw_xferlist *q, s for (i = 0; i < n; i++) { xfer = fw_xfer_alloc_buf(type, slen, rlen); if (xfer == NULL) - return (n); + return (i); xfer->fc = fc; xfer->sc = sc; xfer->hand = hand; @@ -995,10 +996,10 @@ fw_xferlist_remove(struct fw_xferlist *q struct fw_xfer *xfer, *next; for (xfer = STAILQ_FIRST(q); xfer != NULL; xfer = next) { - next = STAILQ_NEXT(xfer, link); - fw_xfer_free_buf(xfer); - } - STAILQ_INIT(q); + next = STAILQ_NEXT(xfer, link); + fw_xfer_free_buf(xfer); + } + STAILQ_INIT(q); } /* * dump packet header @@ -1031,7 +1032,7 @@ fw_tl_free(struct firewire_comm *fc, str } /* make sure the label is allocated */ STAILQ_FOREACH(txfer, &fc->tlabels[xfer->tl], tlabel) - if(txfer == xfer) + if (txfer == xfer) break; if (txfer == NULL) { printf("%s: the xfer is not in the queue " @@ -1064,7 +1065,7 @@ fw_tl2xfer(struct firewire_comm *fc, int mtx_lock(&fc->tlabel_lock); STAILQ_FOREACH(xfer, &fc->tlabels[tlabel], tlabel) - if(xfer->send.hdr.mode.hdr.dst == node) { + if (xfer->send.hdr.mode.hdr.dst == node) { mtx_unlock(&fc->tlabel_lock); splx(s); KASSERT(xfer->tl == tlabel, @@ -1075,18 +1076,18 @@ fw_tl2xfer(struct firewire_comm *fc, int printf("%s: invalid response tcode " "(0x%x for 0x%x)\n", __FUNCTION__, tcode, req); - return(NULL); + return (NULL); } - + if (firewire_debug > 2) printf("fw_tl2xfer: found tl=%d\n", tlabel); - return(xfer); + return (xfer); } mtx_unlock(&fc->tlabel_lock); if (firewire_debug > 1) printf("fw_tl2xfer: not found tl=%d\n", tlabel); splx(s); - return(NULL); + return (NULL); } /* @@ -1113,14 +1114,14 @@ fw_xfer_alloc_buf(struct malloc_type *ty xfer = fw_xfer_alloc(type); if (xfer == NULL) - return(NULL); + return (NULL); xfer->send.pay_len = send_len; xfer->recv.pay_len = recv_len; if (send_len > 0) { xfer->send.payload = malloc(send_len, type, M_NOWAIT | M_ZERO); if (xfer->send.payload == NULL) { fw_xfer_free(xfer); - return(NULL); + return (NULL); } } if (recv_len > 0) { @@ -1129,10 +1130,10 @@ fw_xfer_alloc_buf(struct malloc_type *ty if (xfer->send.payload != NULL) free(xfer->send.payload, type); fw_xfer_free(xfer); - return(NULL); + return (NULL); } } - return(xfer); + return (xfer); } /* @@ -1154,18 +1155,19 @@ fw_xfer_done(struct fw_xfer *xfer) } void -fw_xfer_unload(struct fw_xfer* xfer) +fw_xfer_unload(struct fw_xfer *xfer) { int s; - if(xfer == NULL ) return; - if(xfer->flag & FWXF_INQ){ + if (xfer == NULL) + return; + if (xfer->flag & FWXF_INQ) { printf("fw_xfer_free FWXF_INQ\n"); s = splfw(); FW_GLOCK(xfer->fc); STAILQ_REMOVE(&xfer->q->q, xfer, fw_xfer, link); #if 0 - xfer->q->queued --; + xfer->q->queued--; #endif FW_GUNLOCK(xfer->fc); splx(s); @@ -1177,7 +1179,7 @@ fw_xfer_unload(struct fw_xfer* xfer) */ fw_tl_free(xfer->fc, xfer); #if 1 - if(xfer->flag & FWXF_START) + if (xfer->flag & FWXF_START) /* * This could happen if: * 1. We call fwohci_arcv() before fwohci_txd(). @@ -1189,28 +1191,27 @@ fw_xfer_unload(struct fw_xfer* xfer) xfer->flag = FWXF_INIT; xfer->resp = 0; } + /* - * To free IEEE1394 XFER structure. + * To free IEEE1394 XFER structure. */ void -fw_xfer_free_buf( struct fw_xfer* xfer) +fw_xfer_free_buf(struct fw_xfer *xfer) { if (xfer == NULL) { printf("%s: xfer == NULL\n", __func__); return; } fw_xfer_unload(xfer); - if(xfer->send.payload != NULL){ + if (xfer->send.payload != NULL) free(xfer->send.payload, xfer->malloc); - } - if(xfer->recv.payload != NULL){ + if (xfer->recv.payload != NULL) free(xfer->recv.payload, xfer->malloc); - } free(xfer, xfer->malloc); } void -fw_xfer_free( struct fw_xfer* xfer) +fw_xfer_free(struct fw_xfer *xfer) { if (xfer == NULL) { printf("%s: xfer == NULL\n", __func__); @@ -1231,7 +1232,7 @@ fw_asy_callback_free(struct fw_xfer *xfe } /* - * To configure PHY. + * To configure PHY. */ static void fw_phy_config(struct firewire_comm *fc, int root_node, int gap_count) @@ -1250,9 +1251,9 @@ fw_phy_config(struct firewire_comm *fc, fp = &xfer->send.hdr; fp->mode.ld[1] = 0; if (root_node >= 0) - fp->mode.ld[1] |= (root_node & 0x3f) << 24 | 1 << 23; + fp->mode.ld[1] |= (1 << 23) | (root_node & 0x3f) << 24; if (gap_count >= 0) - fp->mode.ld[1] |= 1 << 22 | (gap_count & 0x3f) << 16; + fp->mode.ld[1] |= (1 << 22) | (gap_count & 0x3f) << 16; fp->mode.ld[2] = ~fp->mode.ld[1]; /* XXX Dangerous, how to pass PHY packet to device driver */ fp->mode.common.tcode |= FWTCODE_PHY; @@ -1264,113 +1265,107 @@ fw_phy_config(struct firewire_comm *fc, } /* - * Dump self ID. + * Dump self ID. */ static void fw_print_sid(uint32_t sid) { union fw_self_id *s; s = (union fw_self_id *) &sid; - if ( s->p0.sequel ) { - if ( s->p1.sequence_num == FW_SELF_ID_PAGE0 ) { + if (s->p0.sequel) { + if (s->p1.sequence_num == FW_SELF_ID_PAGE0) { printf("node:%d p3:%d p4:%d p5:%d p6:%d p7:%d" - "p8:%d p9:%d p10:%d\n", - s->p1.phy_id, s->p1.port3, s->p1.port4, - s->p1.port5, s->p1.port6, s->p1.port7, - s->p1.port8, s->p1.port9, s->p1.port10); - } else if (s->p2.sequence_num == FW_SELF_ID_PAGE1 ){ + "p8:%d p9:%d p10:%d\n", + s->p1.phy_id, s->p1.port3, s->p1.port4, + s->p1.port5, s->p1.port6, s->p1.port7, + s->p1.port8, s->p1.port9, s->p1.port10); + } else if (s->p2.sequence_num == FW_SELF_ID_PAGE1) { printf("node:%d p11:%d p12:%d p13:%d p14:%d p15:%d\n", - s->p2.phy_id, s->p2.port11, s->p2.port12, - s->p2.port13, s->p2.port14, s->p2.port15); + s->p2.phy_id, s->p2.port11, s->p2.port12, + s->p2.port13, s->p2.port14, s->p2.port15); } else { printf("node:%d Unknown Self ID Page number %d\n", - s->p1.phy_id, s->p1.sequence_num); + s->p1.phy_id, s->p1.sequence_num); } } else { printf("node:%d link:%d gap:%d spd:%d con:%d pwr:%d" - " p0:%d p1:%d p2:%d i:%d m:%d\n", - s->p0.phy_id, s->p0.link_active, s->p0.gap_count, - s->p0.phy_speed, s->p0.contender, - s->p0.power_class, s->p0.port0, s->p0.port1, - s->p0.port2, s->p0.initiated_reset, s->p0.more_packets); + " p0:%d p1:%d p2:%d i:%d m:%d\n", + s->p0.phy_id, s->p0.link_active, s->p0.gap_count, + s->p0.phy_speed, s->p0.contender, + s->p0.power_class, s->p0.port0, s->p0.port1, + s->p0.port2, s->p0.initiated_reset, s->p0.more_packets); } } /* - * To receive self ID. + * To receive self ID. */ -void fw_sidrcv(struct firewire_comm* fc, uint32_t *sid, u_int len) +void fw_sidrcv(struct firewire_comm *fc, uint32_t *sid, u_int len) { uint32_t *p; union fw_self_id *self_id; u_int i, j, node, c_port = 0, i_branch = 0; - fc->sid_cnt = len /(sizeof(uint32_t) * 2); + fc->sid_cnt = len / (sizeof(uint32_t) * 2); fc->max_node = fc->nodeid & 0x3f; CSRARC(fc, NODE_IDS) = ((uint32_t)fc->nodeid) << 16; fc->status = FWBUSCYMELECT; fc->topology_map->crc_len = 2; - fc->topology_map->generation ++; + fc->topology_map->generation++; fc->topology_map->self_id_count = 0; - fc->topology_map->node_count = 0; - fc->speed_map->generation ++; - fc->speed_map->crc_len = 1 + (64*64 + 3) / 4; + fc->topology_map->node_count= 0; + fc->speed_map->generation++; + fc->speed_map->crc_len = 1 + (64 * 64 + 3) / 4; self_id = &fc->topology_map->self_id[0]; - for(i = 0; i < fc->sid_cnt; i ++){ + for (i = 0; i < fc->sid_cnt; i++) { if (sid[1] != ~sid[0]) { - device_printf(fc->bdev, "%s: ERROR invalid self-id packet\n", - __func__); + device_printf(fc->bdev, + "%s: ERROR invalid self-id packet\n", __func__); sid += 2; continue; } *self_id = *((union fw_self_id *)sid); fc->topology_map->crc_len++; - if(self_id->p0.sequel == 0){ - fc->topology_map->node_count ++; + if (self_id->p0.sequel == 0) { + fc->topology_map->node_count++; c_port = 0; if (firewire_debug) fw_print_sid(sid[0]); node = self_id->p0.phy_id; - if(fc->max_node < node){ + if (fc->max_node < node) fc->max_node = self_id->p0.phy_id; - } /* XXX I'm not sure this is the right speed_map */ - fc->speed_map->speed[node][node] - = self_id->p0.phy_speed; - for (j = 0; j < node; j ++) { - fc->speed_map->speed[j][node] - = fc->speed_map->speed[node][j] - = min(fc->speed_map->speed[j][j], - self_id->p0.phy_speed); + fc->speed_map->speed[node][node] = + self_id->p0.phy_speed; + for (j = 0; j < node; j++) { + fc->speed_map->speed[j][node] = + fc->speed_map->speed[node][j] = + min(fc->speed_map->speed[j][j], + self_id->p0.phy_speed); } if ((fc->irm == -1 || self_id->p0.phy_id > fc->irm) && - (self_id->p0.link_active && self_id->p0.contender)) { + (self_id->p0.link_active && self_id->p0.contender)) fc->irm = self_id->p0.phy_id; - } - if(self_id->p0.port0 >= 0x2){ + if (self_id->p0.port0 >= 0x2) c_port++; - } - if(self_id->p0.port1 >= 0x2){ + if (self_id->p0.port1 >= 0x2) c_port++; - } - if(self_id->p0.port2 >= 0x2){ + if (self_id->p0.port2 >= 0x2) c_port++; - } } - if(c_port > 2){ + if (c_port > 2) i_branch += (c_port - 2); - } sid += 2; self_id++; - fc->topology_map->self_id_count ++; + fc->topology_map->self_id_count++; } /* CRC */ fc->topology_map->crc = fw_crc16( - (uint32_t *)&fc->topology_map->generation, - fc->topology_map->crc_len * 4); + (uint32_t *)&fc->topology_map->generation, + fc->topology_map->crc_len * 4); fc->speed_map->crc = fw_crc16( - (uint32_t *)&fc->speed_map->generation, - fc->speed_map->crc_len * 4); + (uint32_t *)&fc->speed_map->generation, + fc->speed_map->crc_len * 4); /* byteswap and copy to CSR */ p = (uint32_t *)fc->topology_map; for (i = 0; i <= fc->topology_map->crc_len; i++) @@ -1379,14 +1374,13 @@ void fw_sidrcv(struct firewire_comm* fc, CSRARC(fc, SPED_MAP) = htonl(*p++); CSRARC(fc, SPED_MAP + 4) = htonl(*p++); /* don't byte-swap uint8_t array */ - bcopy(p, &CSRARC(fc, SPED_MAP + 8), (fc->speed_map->crc_len - 1)*4); + bcopy(p, &CSRARC(fc, SPED_MAP + 8), (fc->speed_map->crc_len - 1) * 4); fc->max_hop = fc->max_node - i_branch; device_printf(fc->bdev, "%d nodes, maxhop <= %d %s irm(%d) %s\n", - fc->max_node + 1, fc->max_hop, - (fc->irm == -1) ? "Not IRM capable" : "cable IRM", - fc->irm, - (fc->irm == fc->nodeid) ? " (me) " : ""); + fc->max_node + 1, fc->max_hop, + (fc->irm == -1) ? "Not IRM capable" : "cable IRM", + fc->irm, (fc->irm == fc->nodeid) ? " (me) " : ""); if (try_bmr && (fc->irm != -1) && (CSRARC(fc, BUS_MGR_ID) == 0x3f)) { if (fc->irm == fc->nodeid) { @@ -1395,26 +1389,27 @@ void fw_sidrcv(struct firewire_comm* fc, fw_bmr(fc); } else { fc->status = FWBUSMGRELECT; - callout_reset(&fc->bmr_callout, hz/8, - (void *)fw_try_bmr, (void *)fc); + callout_reset(&fc->bmr_callout, hz / 8, + fw_try_bmr, fc); } } else fc->status = FWBUSMGRDONE; - callout_reset(&fc->busprobe_callout, hz/4, - (void *)fw_bus_probe, (void *)fc); + callout_reset(&fc->busprobe_callout, hz / 4, fw_bus_probe, fc); } /* - * To probe devices on the IEEE1394 bus. + * To probe devices on the IEEE1394 bus. */ static void -fw_bus_probe(struct firewire_comm *fc) +fw_bus_probe(void *arg) { - int s; + struct firewire_comm *fc; struct fw_device *fwdev; + int s; s = splfw(); + fc = arg; fc->status = FWBUSEXPLORE; /* Invalidate all devices, just after bus reset. */ @@ -1438,7 +1433,7 @@ fw_bus_probe(struct firewire_comm *fc) } splx(s); - wakeup((void *)fc); + wakeup(fc); } static int @@ -1449,10 +1444,9 @@ fw_explore_read_quads(struct fw_device * uint32_t tmp; int i, error; - for (i = 0; i < length; i ++, offset += sizeof(uint32_t)) { - xfer = fwmem_read_quad(fwdev, NULL, -1, - 0xffff, 0xf0000000 | offset, (void *)&tmp, - fw_xferwake); + for (i = 0; i < length; i++, offset += sizeof(uint32_t)) { + xfer = fwmem_read_quad(fwdev, NULL, -1, 0xffff, + 0xf0000000 | offset, &tmp, fw_xferwake); if (xfer == NULL) return (-1); fw_xferwait(xfer); @@ -1476,14 +1470,14 @@ fw_explore_csrblock(struct fw_device *fw struct csrdirectory *dir; struct csrreg *reg; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 16:50:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DA046EC; Sat, 27 Sep 2014 16:50:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59ABD2EE; Sat, 27 Sep 2014 16:50:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RGoP98053607; Sat, 27 Sep 2014 16:50:25 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RGoPuP053606; Sat, 27 Sep 2014 16:50:25 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201409271650.s8RGoPuP053606@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sat, 27 Sep 2014 16:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272215 - head/sys/dev/firewire X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 16:50:25 -0000 Author: kan Date: Sat Sep 27 16:50:24 2014 New Revision: 272215 URL: http://svnweb.freebsd.org/changeset/base/272215 Log: Do not pass whole descriptor block size as align to fwdma_malloc_multiseg Do not pass wrong alignment value to fwdma_malloc_multiseg and ultimately to contigalloc. In addition to being wrong, this causes insta-panic in certain cases due to safety assertion - the alignment is required to be the power of two and the value we calculate here seldom is. MFC after: 1 month Modified: head/sys/dev/firewire/fwohci.c Modified: head/sys/dev/firewire/fwohci.c ============================================================================== --- head/sys/dev/firewire/fwohci.c Sat Sep 27 16:50:21 2014 (r272214) +++ head/sys/dev/firewire/fwohci.c Sat Sep 27 16:50:24 2014 (r272215) @@ -1253,7 +1253,7 @@ fwohci_db_init(struct fwohci_softc *sc, } #define DB_SIZE(x) (sizeof(struct fwohcidb) * (x)->ndesc) - dbch->am = fwdma_malloc_multiseg(&sc->fc, DB_SIZE(dbch), + dbch->am = fwdma_malloc_multiseg(&sc->fc, sizeof(struct fwohcidb), DB_SIZE(dbch), dbch->ndb, BUS_DMA_WAITOK); if (dbch->am == NULL) { printf("fwohci_db_init: fwdma_malloc_multiseg failed\n"); From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 17:11:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 253CEB9F; Sat, 27 Sep 2014 17:11:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10F437A2; Sat, 27 Sep 2014 17:11:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RHBp5B065729; Sat, 27 Sep 2014 17:11:51 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RHBp6g065728; Sat, 27 Sep 2014 17:11:51 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201409271711.s8RHBp6g065728@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 27 Sep 2014 17:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272216 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 17:11:52 -0000 Author: bz Date: Sat Sep 27 17:11:51 2014 New Revision: 272216 URL: http://svnweb.freebsd.org/changeset/base/272216 Log: Disable the makeoption with MFS_IMAGE= set as we don't ship that file and it thus breaks the default build. You can still use various other ways (tools) to embedd the image after the kernel build. Modified: head/sys/mips/conf/TP-MR3020 Modified: head/sys/mips/conf/TP-MR3020 ============================================================================== --- head/sys/mips/conf/TP-MR3020 Sat Sep 27 16:50:24 2014 (r272215) +++ head/sys/mips/conf/TP-MR3020 Sat Sep 27 17:11:51 2014 (r272216) @@ -61,5 +61,5 @@ device geom_map # as a rootfs and use the flash to hold the kernel only. options MD_ROOT # md device usable as a potential root device options MD_ROOT_SIZE=10240 -makeoptions MFS_IMAGE=/tftpboot/mfsroot-tl-mr3020.img.ulzma +#makeoptions MFS_IMAGE=/tftpboot/mfsroot-tl-mr3020.img.ulzma options ROOTDEVNAME=\"ufs:md0.uncompress\" From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 17:58:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0ACDD5F4; Sat, 27 Sep 2014 17:58:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEC5BB76; Sat, 27 Sep 2014 17:58:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RHw4uP087000; Sat, 27 Sep 2014 17:58:04 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RHw42u086997; Sat, 27 Sep 2014 17:58:04 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201409271758.s8RHw42u086997@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Sat, 27 Sep 2014 17:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272217 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 17:58:05 -0000 Author: marcel Date: Sat Sep 27 17:58:03 2014 New Revision: 272217 URL: http://svnweb.freebsd.org/changeset/base/272217 Log: Update the usage message and the man page to account for the new long options. Bump the version number to 20140927. While here, use explicit fputc() calls to skip a line in the output. This to avoid having to hunt for extra '\n' characters in the printf format strings. MFC after: 1 week Relnotes: yes Modified: head/usr.bin/mkimg/Makefile head/usr.bin/mkimg/mkimg.1 head/usr.bin/mkimg/mkimg.c Modified: head/usr.bin/mkimg/Makefile ============================================================================== --- head/usr.bin/mkimg/Makefile Sat Sep 27 17:11:51 2014 (r272216) +++ head/usr.bin/mkimg/Makefile Sat Sep 27 17:58:03 2014 (r272217) @@ -6,7 +6,7 @@ PROG= mkimg SRCS= format.c image.c mkimg.c scheme.c MAN= mkimg.1 -MKIMG_VERSION=20140926 +MKIMG_VERSION=20140927 CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION} CFLAGS+=-DSPARSE_WRITE Modified: head/usr.bin/mkimg/mkimg.1 ============================================================================== --- head/usr.bin/mkimg/mkimg.1 Sat Sep 27 17:11:51 2014 (r272216) +++ head/usr.bin/mkimg/mkimg.1 Sat Sep 27 17:58:03 2014 (r272217) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 12, 2014 +.Dd September 27, 2014 .Dt MKIMG 1 .Os .Sh NAME @@ -44,6 +44,8 @@ .Fl s Ar scheme .Fl p Ar partition .Op Fl p Ar partition ... +.Nm +.Ar --formats | --schemes | --version .Sh DESCRIPTION The .Nm @@ -122,10 +124,32 @@ utility will generate predictable values .Nm utility will create images that are identical. .Pp -For a complete list of supported partitioning schemes or supported output -format, or for a detailed description of how to specify partitions, run the +A set of long options exist to query about the +.Nm +utilty itself. +Options in this set should be given by themselves because the +.Nm +utility exits immediately after providing the requested information. +The version of the +.Nm +utility is printed when the +.Ar --version +option is given. +The list of supported output formats is printed when the +.Ar --formats +option is given and the list of supported partitioning schemes is printed +when the +.Ar --schemes +option is given. +Both the format and scheme lists a space-separated lists for easy handling +in scripts. +.Pp +For a more descriptive list of supported partitioning schemes or supported +output format, or for a detailed description of how to specify partitions, +run the .Nm utility without any arguments. +This will print a usage message with all the necessary details. .Sh ENVIRONMENT .Bl -tag -width "TMPDIR" -compact .It Ev TMPDIR Modified: head/usr.bin/mkimg/mkimg.c ============================================================================== --- head/usr.bin/mkimg/mkimg.c Sat Sep 27 17:11:51 2014 (r272216) +++ head/usr.bin/mkimg/mkimg.c Sat Sep 27 17:58:03 2014 (r272217) @@ -79,7 +79,7 @@ print_formats(int usage) const char *sep; if (usage) { - fprintf(stderr, "\n formats:\n"); + fprintf(stderr, " formats:\n"); SET_FOREACH(f_iter, formats) { f = *f_iter; fprintf(stderr, "\t%s\t- %s\n", f->name, @@ -103,7 +103,7 @@ print_schemes(int usage) const char *sep; if (usage) { - fprintf(stderr, "\n schemes:\n"); + fprintf(stderr, " schemes:\n"); SET_FOREACH(s_iter, schemes) { s = *s_iter; fprintf(stderr, "\t%s\t- %s\n", s->name, @@ -138,9 +138,14 @@ usage(const char *why) { warnx("error: %s", why); - fprintf(stderr, "\nusage: %s \n", getprogname()); + fputc('\n', stderr); + fprintf(stderr, "usage: %s \n", getprogname()); fprintf(stderr, " options:\n"); + fprintf(stderr, "\t--formats\t- list image formats\n"); + fprintf(stderr, "\t--schemes\t- list partition schemes\n"); + fprintf(stderr, "\t--version\t- show version information\n"); + fputc('\n', stderr); fprintf(stderr, "\t-b \t- file containing boot code\n"); fprintf(stderr, "\t-f \n"); fprintf(stderr, "\t-o \t- file to write image into\n"); @@ -152,11 +157,12 @@ usage(const char *why) fprintf(stderr, "\t-P \t- physical sector size\n"); fprintf(stderr, "\t-S \t- logical sector size\n"); fprintf(stderr, "\t-T \t- number of tracks to simulate\n"); - + fputc('\n', stderr); print_formats(1); + fputc('\n', stderr); print_schemes(1); - - fprintf(stderr, "\n partition specification:\n"); + fputc('\n', stderr); + fprintf(stderr, " partition specification:\n"); fprintf(stderr, "\t[/]::\t- empty partition of given " "size\n"); fprintf(stderr, "\t[/]:=\t- partition content and size " From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 18:08:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB39388A; Sat, 27 Sep 2014 18:08:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95890C5F; Sat, 27 Sep 2014 18:08:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RI8elZ091932; Sat, 27 Sep 2014 18:08:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RI8eY7091929; Sat, 27 Sep 2014 18:08:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409271808.s8RI8eY7091929@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 27 Sep 2014 18:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272218 - in stable/10/sys/dev/usb: . serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 18:08:40 -0000 Author: hselasky Date: Sat Sep 27 18:08:39 2014 New Revision: 272218 URL: http://svnweb.freebsd.org/changeset/base/272218 Log: MFC r271874: Add new USB IDs. PR: 193775 Approved by: re, gjb Modified: stable/10/sys/dev/usb/serial/u3g.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/10/sys/dev/usb/serial/u3g.c Sat Sep 27 17:58:03 2014 (r272217) +++ stable/10/sys/dev/usb/serial/u3g.c Sat Sep 27 18:08:39 2014 (r272218) @@ -250,6 +250,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(DLINK3, DWM652, 0), U3G_DEV(HP, EV2200, 0), U3G_DEV(HP, HS2300, 0), + U3G_DEV(HP, UN2420_QDL, 0), + U3G_DEV(HP, UN2420, 0), U3G_DEV(HUAWEI, E1401, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1402, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1403, U3GINIT_HUAWEI), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Sat Sep 27 17:58:03 2014 (r272217) +++ stable/10/sys/dev/usb/usbdevs Sat Sep 27 18:08:39 2014 (r272218) @@ -2224,6 +2224,8 @@ product HP 3300C 0x0205 ScanJet 3300C product HP CDW8200 0x0207 CD-Writer Plus 8200e product HP MMKEYB 0x020c Multimedia keyboard product HP 1220C 0x0212 DeskJet 1220C +product HP UN2420_QDL 0x241d UN2420 QDL Firmware Loader +product HP UN2420 0x251d UN2420 WWAN/GPS Module product HP 810C 0x0304 DeskJet 810C/812C product HP 4300C 0x0305 Scanjet 4300C product HP CDW4E 0x0307 CD-Writer+ CD-4e From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 18:10:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62CB2A1D; Sat, 27 Sep 2014 18:10:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D315C81; Sat, 27 Sep 2014 18:10:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RIArT8095357; Sat, 27 Sep 2014 18:10:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RIAqxC095355; Sat, 27 Sep 2014 18:10:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409271810.s8RIAqxC095355@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 27 Sep 2014 18:10:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r272219 - in stable/9/sys/dev/usb: . serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 18:10:53 -0000 Author: hselasky Date: Sat Sep 27 18:10:52 2014 New Revision: 272219 URL: http://svnweb.freebsd.org/changeset/base/272219 Log: MFC r271874: Add new USB IDs. PR: 193775 Modified: stable/9/sys/dev/usb/serial/u3g.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/9/sys/dev/usb/serial/u3g.c Sat Sep 27 18:08:39 2014 (r272218) +++ stable/9/sys/dev/usb/serial/u3g.c Sat Sep 27 18:10:52 2014 (r272219) @@ -250,6 +250,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(DLINK3, DWM652, 0), U3G_DEV(HP, EV2200, 0), U3G_DEV(HP, HS2300, 0), + U3G_DEV(HP, UN2420_QDL, 0), + U3G_DEV(HP, UN2420, 0), U3G_DEV(HUAWEI, E1401, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1402, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1403, U3GINIT_HUAWEI), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Sat Sep 27 18:08:39 2014 (r272218) +++ stable/9/sys/dev/usb/usbdevs Sat Sep 27 18:10:52 2014 (r272219) @@ -2220,6 +2220,8 @@ product HP 3300C 0x0205 ScanJet 3300C product HP CDW8200 0x0207 CD-Writer Plus 8200e product HP MMKEYB 0x020c Multimedia keyboard product HP 1220C 0x0212 DeskJet 1220C +product HP UN2420_QDL 0x241d UN2420 QDL Firmware Loader +product HP UN2420 0x251d UN2420 WWAN/GPS Module product HP 810C 0x0304 DeskJet 810C/812C product HP 4300C 0x0305 Scanjet 4300C product HP CDW4E 0x0307 CD-Writer+ CD-4e From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 18:12:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4068BAF; Sat, 27 Sep 2014 18:12:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF009D22; Sat, 27 Sep 2014 18:12:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RIC6ba096122; Sat, 27 Sep 2014 18:12:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RIC638096120; Sat, 27 Sep 2014 18:12:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201409271812.s8RIC638096120@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 27 Sep 2014 18:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r272220 - in stable/8/sys/dev/usb: . serial X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 18:12:06 -0000 Author: hselasky Date: Sat Sep 27 18:12:05 2014 New Revision: 272220 URL: http://svnweb.freebsd.org/changeset/base/272220 Log: MFC r271874: Add new USB IDs. PR: 193775 Modified: stable/8/sys/dev/usb/serial/u3g.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Sat Sep 27 18:10:52 2014 (r272219) +++ stable/8/sys/dev/usb/serial/u3g.c Sat Sep 27 18:12:05 2014 (r272220) @@ -246,6 +246,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(DLINK3, DWM652, 0), U3G_DEV(HP, EV2200, 0), U3G_DEV(HP, HS2300, 0), + U3G_DEV(HP, UN2420_QDL, 0), + U3G_DEV(HP, UN2420, 0), U3G_DEV(HUAWEI, E1401, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1402, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1403, U3GINIT_HUAWEI), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Sat Sep 27 18:10:52 2014 (r272219) +++ stable/8/sys/dev/usb/usbdevs Sat Sep 27 18:12:05 2014 (r272220) @@ -2219,6 +2219,8 @@ product HP 3300C 0x0205 ScanJet 3300C product HP CDW8200 0x0207 CD-Writer Plus 8200e product HP MMKEYB 0x020c Multimedia keyboard product HP 1220C 0x0212 DeskJet 1220C +product HP UN2420_QDL 0x241d UN2420 QDL Firmware Loader +product HP UN2420 0x251d UN2420 WWAN/GPS Module product HP 810C 0x0304 DeskJet 810C/812C product HP 4300C 0x0305 Scanjet 4300C product HP CDW4E 0x0307 CD-Writer+ CD-4e From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 18:20:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18B37E2B; Sat, 27 Sep 2014 18:20:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03C74D75; Sat, 27 Sep 2014 18:20:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RIKj7W000265; Sat, 27 Sep 2014 18:20:45 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RIKjxC000264; Sat, 27 Sep 2014 18:20:45 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409271820.s8RIKjxC000264@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Sat, 27 Sep 2014 18:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272221 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 18:20:46 -0000 Author: smh Date: Sat Sep 27 18:20:45 2014 New Revision: 272221 URL: http://svnweb.freebsd.org/changeset/base/272221 Log: MFC r272071: Fix ticks wrap issue of lowmem test in vm_pageout_scan Approved by: re (kib) Sponsored by: Multiplay Modified: stable/10/sys/vm/vm_pageout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_pageout.c ============================================================================== --- stable/10/sys/vm/vm_pageout.c Sat Sep 27 18:12:05 2014 (r272220) +++ stable/10/sys/vm/vm_pageout.c Sat Sep 27 18:20:45 2014 (r272221) @@ -921,7 +921,7 @@ vm_pageout_scan(struct vm_domain *vmd, i * some. We rate limit to avoid thrashing. */ if (vmd == &vm_dom[0] && pass > 0 && - lowmem_ticks + (lowmem_period * hz) < ticks) { + (ticks - lowmem_ticks) / hz >= lowmem_period) { /* * Decrease registered cache sizes. */ From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 18:35:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C3A640C; Sat, 27 Sep 2014 18:35:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27A43F0B; Sat, 27 Sep 2014 18:35:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RIZI8H006555; Sat, 27 Sep 2014 18:35:18 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RIZHoQ006549; Sat, 27 Sep 2014 18:35:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201409271835.s8RIZHoQ006549@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 27 Sep 2014 18:35:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272222 - head/sys/dev/cxgb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 18:35:18 -0000 Author: np Date: Sat Sep 27 18:35:16 2014 New Revision: 272222 URL: http://svnweb.freebsd.org/changeset/base/272222 Log: cxgb(4): implement if_get_counter. Modified: head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgb/cxgb_sge.c Modified: head/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- head/sys/dev/cxgb/cxgb_adapter.h Sat Sep 27 18:20:45 2014 (r272221) +++ head/sys/dev/cxgb/cxgb_adapter.h Sat Sep 27 18:35:16 2014 (r272222) @@ -97,6 +97,7 @@ struct port_info { const struct port_type_info *port_type; struct cphy phy; struct cmac mac; + struct timeval last_refreshed; struct link_config link_config; struct ifmedia media; struct mtx lock; @@ -575,4 +576,5 @@ void cxgb_tx_watchdog(void *arg); int cxgb_transmit(struct ifnet *ifp, struct mbuf *m); void cxgb_qflush(struct ifnet *ifp); void t3_iterate(void (*)(struct adapter *, void *), void *); +void cxgb_refresh_stats(struct port_info *); #endif Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Sat Sep 27 18:20:45 2014 (r272221) +++ head/sys/dev/cxgb/cxgb_main.c Sat Sep 27 18:35:16 2014 (r272222) @@ -96,6 +96,7 @@ static int cxgb_media_change(struct ifne static int cxgb_ifm_type(int); static void cxgb_build_medialist(struct port_info *); static void cxgb_media_status(struct ifnet *, struct ifmediareq *); +static uint64_t cxgb_get_counter(struct ifnet *, ift_counter); static int setup_sge_qsets(adapter_t *); static void cxgb_async_intr(void *); static void cxgb_tick_handler(void *, int); @@ -1022,6 +1023,7 @@ cxgb_port_attach(device_t dev) ifp->if_ioctl = cxgb_ioctl; ifp->if_transmit = cxgb_transmit; ifp->if_qflush = cxgb_qflush; + ifp->if_get_counter = cxgb_get_counter; ifp->if_capabilities = CXGB_CAP; #ifdef TCP_OFFLOAD @@ -2189,6 +2191,71 @@ cxgb_media_status(struct ifnet *ifp, str speed)); } +static uint64_t +cxgb_get_counter(struct ifnet *ifp, ift_counter c) +{ + struct port_info *pi = ifp->if_softc; + struct adapter *sc = pi->adapter; + struct cmac *mac = &pi->mac; + struct mac_stats *mstats = &mac->stats; + + cxgb_refresh_stats(pi); + + switch (c) { + case IFCOUNTER_IPACKETS: + return (mstats->rx_frames); + + case IFCOUNTER_IERRORS: + return (mstats->rx_jabber + mstats->rx_data_errs + + mstats->rx_sequence_errs + mstats->rx_runt + + mstats->rx_too_long + mstats->rx_mac_internal_errs + + mstats->rx_short + mstats->rx_fcs_errs); + + case IFCOUNTER_OPACKETS: + return (mstats->tx_frames); + + case IFCOUNTER_OERRORS: + return (mstats->tx_excess_collisions + mstats->tx_underrun + + mstats->tx_len_errs + mstats->tx_mac_internal_errs + + mstats->tx_excess_deferral + mstats->tx_fcs_errs); + + case IFCOUNTER_COLLISIONS: + return (mstats->tx_total_collisions); + + case IFCOUNTER_IBYTES: + return (mstats->rx_octets); + + case IFCOUNTER_OBYTES: + return (mstats->tx_octets); + + case IFCOUNTER_IMCASTS: + return (mstats->rx_mcast_frames); + + case IFCOUNTER_OMCASTS: + return (mstats->tx_mcast_frames); + + case IFCOUNTER_IQDROPS: + return (mstats->rx_cong_drops); + + case IFCOUNTER_OQDROPS: { + int i; + uint64_t drops; + + drops = 0; + if (sc->flags & FULL_INIT_DONE) { + for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++) + drops += sc->sge.qs[i].txq[TXQ_ETH].txq_mr->br_drops; + } + + return (drops); + + } + + default: + return (if_get_counter_default(ifp, c)); + } +} + static void cxgb_async_intr(void *data) { @@ -2289,6 +2356,23 @@ cxgb_tick(void *arg) callout_reset(&sc->cxgb_tick_ch, hz, cxgb_tick, sc); } +void +cxgb_refresh_stats(struct port_info *pi) +{ + struct timeval tv; + const struct timeval interval = {0, 250000}; /* 250ms */ + + getmicrotime(&tv); + timevalsub(&tv, &interval); + if (timevalcmp(&tv, &pi->last_refreshed, <)) + return; + + PORT_LOCK(pi); + t3_mac_update_stats(&pi->mac); + PORT_UNLOCK(pi); + getmicrotime(&pi->last_refreshed); +} + static void cxgb_tick_handler(void *arg, int count) { @@ -2333,48 +2417,12 @@ cxgb_tick_handler(void *arg, int count) for (i = 0; i < sc->params.nports; i++) { struct port_info *pi = &sc->port[i]; - struct ifnet *ifp = pi->ifp; struct cmac *mac = &pi->mac; - struct mac_stats *mstats = &mac->stats; - int drops, j; if (!isset(&sc->open_device_map, pi->port_id)) continue; - PORT_LOCK(pi); - t3_mac_update_stats(mac); - PORT_UNLOCK(pi); - - ifp->if_opackets = mstats->tx_frames; - ifp->if_ipackets = mstats->rx_frames; - ifp->if_obytes = mstats->tx_octets; - ifp->if_ibytes = mstats->rx_octets; - ifp->if_omcasts = mstats->tx_mcast_frames; - ifp->if_imcasts = mstats->rx_mcast_frames; - ifp->if_collisions = mstats->tx_total_collisions; - ifp->if_iqdrops = mstats->rx_cong_drops; - - drops = 0; - for (j = pi->first_qset; j < pi->first_qset + pi->nqsets; j++) - drops += sc->sge.qs[j].txq[TXQ_ETH].txq_mr->br_drops; - ifp->if_oqdrops = drops; - - ifp->if_oerrors = - mstats->tx_excess_collisions + - mstats->tx_underrun + - mstats->tx_len_errs + - mstats->tx_mac_internal_errs + - mstats->tx_excess_deferral + - mstats->tx_fcs_errs; - ifp->if_ierrors = - mstats->rx_jabber + - mstats->rx_data_errs + - mstats->rx_sequence_errs + - mstats->rx_runt + - mstats->rx_too_long + - mstats->rx_mac_internal_errs + - mstats->rx_short + - mstats->rx_fcs_errs; + cxgb_refresh_stats(pi); if (mac->multiport) continue; Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Sat Sep 27 18:20:45 2014 (r272221) +++ head/sys/dev/cxgb/cxgb_sge.c Sat Sep 27 18:35:16 2014 (r272222) @@ -3410,10 +3410,8 @@ sysctl_handle_macstat(SYSCTL_HANDLER_ARG if (!p) return (EINVAL); + cxgb_refresh_stats(p); parg = (uint64_t *) ((uint8_t *)&p->mac.stats + arg2); - PORT_LOCK(p); - t3_mac_update_stats(&p->mac); - PORT_UNLOCK(p); return (sysctl_handle_64(oidp, parg, 0, req)); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 19:14:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27018430; Sat, 27 Sep 2014 19:14:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8F3B6C8; Sat, 27 Sep 2014 19:14:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RJEMcc025487; Sat, 27 Sep 2014 19:14:22 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RJEMaE025486; Sat, 27 Sep 2014 19:14:22 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201409271914.s8RJEMaE025486@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Sat, 27 Sep 2014 19:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272223 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 19:14:23 -0000 Author: smh Date: Sat Sep 27 19:14:22 2014 New Revision: 272223 URL: http://svnweb.freebsd.org/changeset/base/272223 Log: Use a local STAILQ for unlocked done CCB processing in ahci direct mode Previously it was possible for issues e.g. use after free, to result from processing the done queue while not holding the channel lock. While this should never happen in practice, unexpected code flows which result in two threads processing from the same queue may be possible. We now use a local STAILQ to prevent this ever being an issue. Sponsored by: Multiplay Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sat Sep 27 18:35:16 2014 (r272222) +++ head/sys/dev/ahci/ahci.c Sat Sep 27 19:14:22 2014 (r272223) @@ -1126,6 +1126,7 @@ ahci_ch_intr_direct(void *arg) struct ahci_channel *ch = (struct ahci_channel *)arg; struct ccb_hdr *ccb_h; uint32_t istatus; + STAILQ_HEAD(, ccb_hdr) tmp_doneq = STAILQ_HEAD_INITIALIZER(tmp_doneq); /* Read interrupt statuses. */ istatus = ATA_INL(ch->r_mem, AHCI_P_IS); @@ -1136,9 +1137,14 @@ ahci_ch_intr_direct(void *arg) ch->batch = 1; ahci_ch_intr_main(ch, istatus); ch->batch = 0; + /* + * Prevent the possibility of issues caused by processing the queue + * while unlocked below by moving the contents to a local queue. + */ + STAILQ_CONCAT(&tmp_doneq, &ch->doneq); mtx_unlock(&ch->mtx); - while ((ccb_h = STAILQ_FIRST(&ch->doneq)) != NULL) { - STAILQ_REMOVE_HEAD(&ch->doneq, sim_links.stqe); + while ((ccb_h = STAILQ_FIRST(&tmp_doneq)) != NULL) { + STAILQ_REMOVE_HEAD(&tmp_doneq, sim_links.stqe); xpt_done_direct((union ccb *)ccb_h); } } From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 20:08:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93B7D425; Sat, 27 Sep 2014 20:08:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FC11C08; Sat, 27 Sep 2014 20:08:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RK8ZIE049714; Sat, 27 Sep 2014 20:08:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RK8Z81049713; Sat, 27 Sep 2014 20:08:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201409272008.s8RK8Z81049713@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 27 Sep 2014 20:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272224 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 20:08:35 -0000 Author: mav Date: Sat Sep 27 20:08:34 2014 New Revision: 272224 URL: http://svnweb.freebsd.org/changeset/base/272224 Log: Fix page length reported for Block Limits VPD page. Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Sep 27 19:14:22 2014 (r272223) +++ head/sys/cam/ctl/ctl.c Sat Sep 27 20:08:34 2014 (r272224) @@ -10285,7 +10285,7 @@ ctl_inquiry_evpd_block_limits(struct ctl bl_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; bl_ptr->page_code = SVPD_BLOCK_LIMITS; - scsi_ulto2b(sizeof(*bl_ptr), bl_ptr->page_length); + scsi_ulto2b(sizeof(*bl_ptr) - 4, bl_ptr->page_length); bl_ptr->max_cmp_write_len = 0xff; scsi_ulto4b(0xffffffff, bl_ptr->max_txfer_len); if (lun != NULL) { From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 20:22:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85332831; Sat, 27 Sep 2014 20:22:07 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 088EADB1; Sat, 27 Sep 2014 20:22:06 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8RKM2h9054372 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 28 Sep 2014 00:22:02 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8RKM2kc054371; Sun, 28 Sep 2014 00:22:02 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 28 Sep 2014 00:22:02 +0400 From: Gleb Smirnoff To: Navdeep Parhar Subject: Re: svn commit: r272222 - head/sys/dev/cxgb Message-ID: <20140927202202.GR884@FreeBSD.org> References: <201409271835.s8RIZHoQ006549@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409271835.s8RIZHoQ006549@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 20:22:07 -0000 On Sat, Sep 27, 2014 at 06:35:17PM +0000, Navdeep Parhar wrote: N> Author: np N> Date: Sat Sep 27 18:35:16 2014 N> New Revision: 272222 N> URL: http://svnweb.freebsd.org/changeset/base/272222 N> N> Log: N> cxgb(4): implement if_get_counter. Thanks a lot again :) -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 20:39:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33745EA2; Sat, 27 Sep 2014 20:39:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14155ED2; Sat, 27 Sep 2014 20:39:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RKdPOi064333; Sat, 27 Sep 2014 20:39:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RKdPsA064329; Sat, 27 Sep 2014 20:39:25 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409272039.s8RKdPsA064329@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 27 Sep 2014 20:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272225 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 20:39:26 -0000 Author: glebius Date: Sat Sep 27 20:39:24 2014 New Revision: 272225 URL: http://svnweb.freebsd.org/changeset/base/272225 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Sat Sep 27 20:08:34 2014 (r272224) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Sat Sep 27 20:39:24 2014 (r272225) @@ -510,7 +510,7 @@ void ipoib_cm_handle_rx_wc(struct ipoib_ ipoib_dbg(priv, "cm recv error " "(status=%d, wrid=%d vend_err %x)\n", wc->status, wr_id, wc->vendor_err); - ++dev->if_ierrors; + if_inc_counter(dev, IFCOUNTER_IERRORS, 1); if (has_srq) goto repost; else { @@ -542,7 +542,7 @@ void ipoib_cm_handle_rx_wc(struct ipoib_ * this packet and reuse the old buffer. */ ipoib_dbg(priv, "failed to allocate receive buffer %d\n", wr_id); - ++dev->if_ierrors; + if_inc_counter(dev, IFCOUNTER_IERRORS, 1); memcpy(&rx_ring[wr_id], &saverx, sizeof(saverx)); goto repost; } @@ -554,8 +554,8 @@ void ipoib_cm_handle_rx_wc(struct ipoib_ ipoib_dma_mb(priv, mb, wc->byte_len); - ++dev->if_ipackets; - dev->if_ibytes += mb->m_pkthdr.len; + if_inc_counter(dev, IFCOUNTER_IPACKETS, 1); + if_inc_counter(dev, IFCOUNTER_IBYTES, mb->m_pkthdr.len); mb->m_pkthdr.rcvif = dev; proto = *mtod(mb, uint16_t *); @@ -615,7 +615,7 @@ void ipoib_cm_send(struct ipoib_dev_priv if (unlikely(mb->m_pkthdr.len > tx->mtu)) { ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n", mb->m_pkthdr.len, tx->mtu); - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); ipoib_cm_mb_too_long(priv, mb, IPOIB_CM_MTU(tx->mtu)); return; } @@ -635,7 +635,7 @@ void ipoib_cm_send(struct ipoib_dev_priv tx_req->mb = mb; if (unlikely(ipoib_dma_map_tx(priv->ca, (struct ipoib_tx_buf *)tx_req, priv->cm.num_frags))) { - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); if (tx_req->mb) m_freem(tx_req->mb); return; @@ -643,7 +643,7 @@ void ipoib_cm_send(struct ipoib_dev_priv if (unlikely(post_send(priv, tx, tx_req, tx->tx_head & (ipoib_sendq_size - 1)))) { ipoib_warn(priv, "post_send failed\n"); - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); ipoib_dma_unmap_tx(priv->ca, (struct ipoib_tx_buf *)tx_req); m_freem(mb); } else { @@ -681,7 +681,7 @@ void ipoib_cm_handle_tx_wc(struct ipoib_ ipoib_dma_unmap_tx(priv->ca, (struct ipoib_tx_buf *)tx_req); /* FIXME: is this right? Shouldn't we only increment on success? */ - ++dev->if_opackets; + if_inc_counter(dev, IFCOUNTER_OPACKETS, 1); m_freem(tx_req->mb); Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Sat Sep 27 20:08:34 2014 (r272224) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Sat Sep 27 20:39:24 2014 (r272225) @@ -250,8 +250,8 @@ ipoib_ib_handle_rx_wc(struct ipoib_dev_p ipoib_dma_unmap_rx(priv, &saverx); ipoib_dma_mb(priv, mb, wc->byte_len); - ++dev->if_ipackets; - dev->if_ibytes += mb->m_pkthdr.len; + if_inc_counter(dev, IFCOUNTER_IPACKETS, 1); + if_inc_counter(dev, IFCOUNTER_IBYTES, mb->m_pkthdr.len); mb->m_pkthdr.rcvif = dev; m_adj(mb, sizeof(struct ib_grh) - INFINIBAND_ALEN); eh = mtod(mb, struct ipoib_header *); @@ -344,7 +344,7 @@ static void ipoib_ib_handle_tx_wc(struct ipoib_dma_unmap_tx(priv->ca, tx_req); - ++dev->if_opackets; + if_inc_counter(dev, IFCOUNTER_OPACKETS, 1); m_freem(tx_req->mb); @@ -487,7 +487,7 @@ ipoib_send(struct ipoib_dev_priv *priv, phead = mtod(mb, void *); if (mb->m_len < hlen) { ipoib_warn(priv, "linear data too small\n"); - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); m_freem(mb); return; } @@ -496,7 +496,7 @@ ipoib_send(struct ipoib_dev_priv *priv, if (unlikely(mb->m_pkthdr.len - IPOIB_ENCAP_LEN > priv->mcast_mtu)) { ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n", mb->m_pkthdr.len, priv->mcast_mtu); - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); ipoib_cm_mb_too_long(priv, mb, priv->mcast_mtu); return; } @@ -517,7 +517,7 @@ ipoib_send(struct ipoib_dev_priv *priv, tx_req = &priv->tx_ring[priv->tx_head & (ipoib_sendq_size - 1)]; tx_req->mb = mb; if (unlikely(ipoib_dma_map_tx(priv->ca, tx_req, IPOIB_UD_TX_SG))) { - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); if (tx_req->mb) m_freem(tx_req->mb); return; @@ -539,7 +539,7 @@ ipoib_send(struct ipoib_dev_priv *priv, priv->tx_head & (ipoib_sendq_size - 1), address->ah, qpn, tx_req, phead, hlen))) { ipoib_warn(priv, "post_send failed\n"); - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); --priv->tx_outstanding; ipoib_dma_unmap_tx(priv->ca, tx_req); m_freem(mb); Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Sat Sep 27 20:08:34 2014 (r272224) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Sat Sep 27 20:39:24 2014 (r272225) @@ -665,7 +665,7 @@ ipoib_unicast_send(struct mbuf *mb, stru } else __path_add(priv, path); } else { - ++priv->dev->if_oerrors; + if_inc_counter(priv->dev, IFCOUNTER_OERRORS, 1); m_freem(mb); } @@ -680,7 +680,7 @@ ipoib_unicast_send(struct mbuf *mb, stru path->queue.ifq_len < IPOIB_MAX_PATH_REC_QUEUE) { _IF_ENQUEUE(&path->queue, mb); } else { - ++priv->dev->if_oerrors; + if_inc_counter(priv->dev, IFCOUNTER_OERRORS, 1); m_freem(mb); } } Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c Sat Sep 27 20:08:34 2014 (r272224) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c Sat Sep 27 20:39:24 2014 (r272225) @@ -70,7 +70,7 @@ static void ipoib_mcast_free(struct ipoi tx_dropped = mcast->pkt_queue.ifq_len; _IF_DRAIN(&mcast->pkt_queue); /* XXX Locking. */ - dev->if_oerrors += tx_dropped; + if_inc_counter(dev, IFCOUNTER_OERRORS, tx_dropped); kfree(mcast); } @@ -255,7 +255,7 @@ ipoib_mcast_sendonly_join_complete(int s mcast->mcmember.mgid.raw, ":", status); /* Flush out any queued packets */ - priv->dev->if_oerrors += mcast->pkt_queue.ifq_len; + if_inc_counter(priv->dev, IFCOUNTER_OERRORS, mcast->pkt_queue.ifq_len); _IF_DRAIN(&mcast->pkt_queue); /* Clear the busy flag so we try again */ @@ -617,7 +617,7 @@ ipoib_mcast_send(struct ipoib_dev_priv * if (!test_bit(IPOIB_FLAG_OPER_UP, &priv->flags) || !priv->broadcast || !test_bit(IPOIB_MCAST_FLAG_ATTACHED, &priv->broadcast->flags)) { - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); m_freem(mb); return; } @@ -632,7 +632,7 @@ ipoib_mcast_send(struct ipoib_dev_priv * if (!mcast) { ipoib_warn(priv, "unable to allocate memory for " "multicast structure\n"); - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); m_freem(mb); goto out; } @@ -647,7 +647,7 @@ ipoib_mcast_send(struct ipoib_dev_priv * if (mcast->pkt_queue.ifq_len < IPOIB_MAX_MCAST_QUEUE) { _IF_ENQUEUE(&mcast->pkt_queue, mb); } else { - ++dev->if_oerrors; + if_inc_counter(dev, IFCOUNTER_OERRORS, 1); m_freem(mb); } From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 20:41:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0815FFE; Sat, 27 Sep 2014 20:41:52 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7402AF6B; Sat, 27 Sep 2014 20:41:52 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8RKfo6T054422 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 28 Sep 2014 00:41:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8RKfo30054421; Sun, 28 Sep 2014 00:41:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 28 Sep 2014 00:41:50 +0400 From: Gleb Smirnoff To: "Alexander V. Chernikov" Subject: Re: svn commit: r272211 - head/sys/net Message-ID: <20140927204150.GS884@FreeBSD.org> References: <201409271357.s8RDvmTC072149@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409271357.s8RDvmTC072149@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 20:41:53 -0000 On Sat, Sep 27, 2014 at 01:57:48PM +0000, Alexander V. Chernikov wrote: A> Author: melifaro A> Date: Sat Sep 27 13:57:48 2014 A> New Revision: 272211 A> URL: http://svnweb.freebsd.org/changeset/base/272211 A> A> Log: A> Use underlying ports counters to get lagg statistics instead of A> per-packet accounting. A> This introduce user-visible changes like aggregating error counters. A> A> Reviewed by: asomers (prev.version), glebius A> CR: D781 A> MFC after: 2 weeks A> Sponsored by: Yandex LLC Btw, lagg_transmit() still contains two ifp->if_oerrors++. Can you look at them? It seems to me that the second one would account an error already accounted by port interface. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 20:43:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE94E1CE; Sat, 27 Sep 2014 20:43:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAC48F76; Sat, 27 Sep 2014 20:43:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RKh2V6068195; Sat, 27 Sep 2014 20:43:02 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RKh2JD068194; Sat, 27 Sep 2014 20:43:02 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409272043.s8RKh2JD068194@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 27 Sep 2014 20:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272226 - head/sys/dev/dwc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 20:43:02 -0000 Author: glebius Date: Sat Sep 27 20:43:01 2014 New Revision: 272226 URL: http://svnweb.freebsd.org/changeset/base/272226 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/dev/dwc/if_dwc.c Modified: head/sys/dev/dwc/if_dwc.c ============================================================================== --- head/sys/dev/dwc/if_dwc.c Sat Sep 27 20:39:24 2014 (r272225) +++ head/sys/dev/dwc/if_dwc.c Sat Sep 27 20:43:01 2014 (r272226) @@ -799,7 +799,7 @@ dwc_rxfinish_locked(struct dwc_softc *sc m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = len; m->m_len = len; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); DWC_UNLOCK(sc); (*ifp->if_input)(ifp, m); From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 20:54:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D542F7EB; Sat, 27 Sep 2014 20:54:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5979F3; Sat, 27 Sep 2014 20:54:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RKsxpN073537; Sat, 27 Sep 2014 20:54:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RKswiw073529; Sat, 27 Sep 2014 20:54:58 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409272054.s8RKswiw073529@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 27 Sep 2014 20:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272227 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 20:54:59 -0000 Author: glebius Date: Sat Sep 27 20:54:57 2014 New Revision: 272227 URL: http://svnweb.freebsd.org/changeset/base/272227 Log: Convert driver to if_get_counter method. Submitted by: rstone Reviewed by: Eric Joyner Modified: head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_txrx.c head/sys/dev/ixl/ixlvc.c Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Sat Sep 27 20:43:01 2014 (r272226) +++ head/sys/dev/ixl/if_ixl.c Sat Sep 27 20:54:57 2014 (r272227) @@ -2275,6 +2275,10 @@ ixl_setup_interface(device_t dev, struct ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ixl_ioctl; +#if __FreeBSD_version >= 1100000 + if_setgetcounterfn(ifp, ixl_get_counter); +#endif + ifp->if_transmit = ixl_mq_start; ifp->if_qflush = ixl_qflush; @@ -3700,7 +3704,6 @@ ixl_update_stats_counters(struct ixl_pf { struct i40e_hw *hw = &pf->hw; struct ixl_vsi *vsi = &pf->vsi; - struct ifnet *ifp = vsi->ifp; struct i40e_hw_port_stats *nsd = &pf->stats; struct i40e_hw_port_stats *osd = &pf->stats_offsets; @@ -3893,7 +3896,7 @@ ixl_update_stats_counters(struct ixl_pf /* OS statistics */ // ERJ - these are per-port, update all vsis? - ifp->if_ierrors = nsd->crc_errors + nsd->illegal_bytes; + IXL_SET_IERRORS(vsi, nsd->crc_errors + nsd->illegal_bytes); } /* @@ -4027,13 +4030,16 @@ void ixl_update_eth_stats(struct ixl_vsi { struct ixl_pf *pf = (struct ixl_pf *)vsi->back; struct i40e_hw *hw = &pf->hw; - struct ifnet *ifp = vsi->ifp; struct i40e_eth_stats *es; struct i40e_eth_stats *oes; + int i; + uint64_t tx_discards; + struct i40e_hw_port_stats *nsd; u16 stat_idx = vsi->info.stat_counter_idx; es = &vsi->eth_stats; oes = &vsi->eth_stats_offsets; + nsd = &pf->stats; /* Gather up the stats that the hw collects */ ixl_stat_update32(hw, I40E_GLV_TEPC(stat_idx), @@ -4078,22 +4084,27 @@ void ixl_update_eth_stats(struct ixl_vsi &oes->tx_broadcast, &es->tx_broadcast); vsi->stat_offsets_loaded = true; + tx_discards = es->tx_discards + nsd->tx_dropped_link_down; + for (i = 0; i < vsi->num_queues; i++) + tx_discards += vsi->queues[i].txr.br->br_drops; + /* Update ifnet stats */ - ifp->if_ipackets = es->rx_unicast + + IXL_SET_IPACKETS(vsi, es->rx_unicast + es->rx_multicast + - es->rx_broadcast; - ifp->if_opackets = es->tx_unicast + + es->rx_broadcast); + IXL_SET_OPACKETS(vsi, es->tx_unicast + es->tx_multicast + - es->tx_broadcast; - ifp->if_ibytes = es->rx_bytes; - ifp->if_obytes = es->tx_bytes; - ifp->if_imcasts = es->rx_multicast; - ifp->if_omcasts = es->tx_multicast; - - ifp->if_oerrors = es->tx_errors; - ifp->if_iqdrops = es->rx_discards; - ifp->if_noproto = es->rx_unknown_protocol; - ifp->if_collisions = 0; + es->tx_broadcast); + IXL_SET_IBYTES(vsi, es->rx_bytes); + IXL_SET_OBYTES(vsi, es->tx_bytes); + IXL_SET_IMCASTS(vsi, es->rx_multicast); + IXL_SET_OMCASTS(vsi, es->tx_multicast); + + IXL_SET_OERRORS(vsi, es->tx_errors); + IXL_SET_IQDROPS(vsi, es->rx_discards + nsd->eth.rx_discards); + IXL_SET_OQDROPS(vsi, tx_discards); + IXL_SET_NOPROTO(vsi, es->rx_unknown_protocol); + IXL_SET_COLLISIONS(vsi, 0); } /** Modified: head/sys/dev/ixl/if_ixlv.c ============================================================================== --- head/sys/dev/ixl/if_ixlv.c Sat Sep 27 20:43:01 2014 (r272226) +++ head/sys/dev/ixl/if_ixlv.c Sat Sep 27 20:54:57 2014 (r272227) @@ -1355,6 +1355,10 @@ ixlv_setup_interface(device_t dev, struc ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ixlv_ioctl; +#if __FreeBSD_version >= 1100000 + if_setgetcounterfn(ifp, ixl_get_counter); +#endif + ifp->if_transmit = ixl_mq_start; ifp->if_qflush = ixl_qflush; Modified: head/sys/dev/ixl/ixl.h ============================================================================== --- head/sys/dev/ixl/ixl.h Sat Sep 27 20:43:01 2014 (r272226) +++ head/sys/dev/ixl/ixl.h Sat Sep 27 20:54:57 2014 (r272227) @@ -264,6 +264,35 @@ #define IXL_RX_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) #define IXL_RX_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->mtx) +#if __FreeBSD_version >= 1100000 +#define IXL_SET_IPACKETS(vsi, count) (vsi)->ipackets = (count) +#define IXL_SET_IERRORS(vsi, count) (vsi)->ierrors = (count) +#define IXL_SET_OPACKETS(vsi, count) (vsi)->opackets = (count) +#define IXL_SET_OERRORS(vsi, count) (vsi)->oerrors = (count) +#define IXL_SET_COLLISIONS(vsi, count) /* Do nothing; collisions is always 0. */ +#define IXL_SET_IBYTES(vsi, count) (vsi)->ibytes = (count) +#define IXL_SET_OBYTES(vsi, count) (vsi)->obytes = (count) +#define IXL_SET_IMCASTS(vsi, count) (vsi)->imcasts = (count) +#define IXL_SET_OMCASTS(vsi, count) (vsi)->omcasts = (count) +#define IXL_SET_IQDROPS(vsi, count) (vsi)->iqdrops = (count) +#define IXL_SET_OQDROPS(vsi, count) (vsi)->iqdrops = (count) +#define IXL_SET_NOPROTO(vsi, count) (vsi)->noproto = (count) +#else +#define IXL_SET_IPACKETS(vsi, count) (vsi)->ifp->if_ipackets = (count) +#define IXL_SET_IERRORS(vsi, count) (vsi)->ifp->if_ierrors = (count) +#define IXL_SET_OPACKETS(vsi, count) (vsi)->ifp->if_opackets = (count) +#define IXL_SET_OERRORS(vsi, count) (vsi)->ifp->if_oerrors = (count) +#define IXL_SET_COLLISIONS(vsi, count) (vsi)->ifp->if_collisions = (count) +#define IXL_SET_IBYTES(vsi, count) (vsi)->ifp->if_ibytes = (count) +#define IXL_SET_OBYTES(vsi, count) (vsi)->ifp->if_obytes = (count) +#define IXL_SET_IMCASTS(vsi, count) (vsi)->ifp->if_imcasts = (count) +#define IXL_SET_OMCASTS(vsi, count) (vsi)->ifp->if_omcasts = (count) +#define IXL_SET_IQDROPS(vsi, count) (vsi)->ifp->if_iqdrops = (count) +#define IXL_SET_OQDROPS(vsi, odrops) (vsi)->ifp->if_snd.ifq_drops = (odrops) +#define IXL_SET_NOPROTO(vsi, count) (vsi)->noproto = (count) +#endif + + /* ***************************************************************************** * vendor_info_array @@ -447,6 +476,17 @@ struct ixl_vsi { struct i40e_eth_stats eth_stats; struct i40e_eth_stats eth_stats_offsets; bool stat_offsets_loaded; + u64 ipackets; + u64 ierrors; + u64 opackets; + u64 oerrors; + u64 ibytes; + u64 obytes; + u64 imcasts; + u64 omcasts; + u64 iqdrops; + u64 oqdrops; + u64 noproto; /* Driver statistics */ u64 hw_filters_del; @@ -554,5 +594,8 @@ void ixl_free_que_rx(struct ixl_queue *) #ifdef IXL_FDIR void ixl_atr(struct ixl_queue *, struct tcphdr *, int); #endif +#if __FreeBSD_version >= 1100000 +uint64_t ixl_get_counter(if_t ifp, ift_counter cnt); +#endif #endif /* _IXL_H_ */ Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Sat Sep 27 20:43:01 2014 (r272226) +++ head/sys/dev/ixl/ixl_txrx.c Sat Sep 27 20:54:57 2014 (r272227) @@ -783,8 +783,6 @@ ixl_get_tx_head(struct ixl_queue *que) bool ixl_txeof(struct ixl_queue *que) { - struct ixl_vsi *vsi = que->vsi; - struct ifnet *ifp = vsi->ifp; struct tx_ring *txr = &que->txr; u32 first, last, head, done, processed; struct ixl_tx_buf *buf; @@ -857,7 +855,6 @@ ixl_txeof(struct ixl_queue *que) tx_desc = &txr->base[first]; } ++txr->packets; - ++ifp->if_opackets; /* See if there is more work now */ last = buf->eop_index; if (last != -1) { @@ -1420,7 +1417,6 @@ ixl_rxeof(struct ixl_queue *que, int cou ** error results. */ if (eop && (error & (1 << I40E_RX_DESC_ERROR_RXE_SHIFT))) { - ifp->if_ierrors++; rxr->discarded++; ixl_rx_discard(rxr, i); goto next_desc; @@ -1529,7 +1525,6 @@ ixl_rxeof(struct ixl_queue *que, int cou if (eop) { sendmp->m_pkthdr.rcvif = ifp; /* gather stats */ - ifp->if_ipackets++; rxr->rx_packets++; rxr->rx_bytes += sendmp->m_pkthdr.len; /* capture data for dynamic ITR adjustment */ @@ -1625,3 +1620,43 @@ ixl_rx_checksum(struct mbuf * mp, u32 st } return; } + +#if __FreeBSD_version >= 1100000 +uint64_t +ixl_get_counter(if_t ifp, ift_counter cnt) +{ + struct ixl_vsi *vsi; + + vsi = if_getsoftc(ifp); + + switch (cnt) { + case IFCOUNTER_IPACKETS: + return (vsi->ipackets); + case IFCOUNTER_IERRORS: + return (vsi->ierrors); + case IFCOUNTER_OPACKETS: + return (vsi->opackets); + case IFCOUNTER_OERRORS: + return (vsi->oerrors); + case IFCOUNTER_COLLISIONS: + /* Collisions are by standard impossible in 40G/10G Ethernet */ + return (0); + case IFCOUNTER_IBYTES: + return (vsi->ibytes); + case IFCOUNTER_OBYTES: + return (vsi->obytes); + case IFCOUNTER_IMCASTS: + return (vsi->imcasts); + case IFCOUNTER_OMCASTS: + return (vsi->omcasts); + case IFCOUNTER_IQDROPS: + return (vsi->iqdrops); + case IFCOUNTER_OQDROPS: + return (vsi->oqdrops); + case IFCOUNTER_NOPROTO: + return (vsi->noproto); + default: + return (if_get_counter_default(ifp, cnt)); + } +} +#endif Modified: head/sys/dev/ixl/ixlvc.c ============================================================================== --- head/sys/dev/ixl/ixlvc.c Sat Sep 27 20:43:01 2014 (r272226) +++ head/sys/dev/ixl/ixlvc.c Sat Sep 27 20:54:57 2014 (r272227) @@ -837,22 +837,33 @@ ixlv_request_stats(struct ixlv_sc *sc) void ixlv_update_stats_counters(struct ixlv_sc *sc, struct i40e_eth_stats *es) { - struct ifnet *ifp = sc->vsi.ifp; + struct ixl_vsi *vsi; + uint64_t tx_discards; + int i; + + vsi = &sc->vsi; + + tx_discards = es->tx_discards; + for (i = 0; i < sc->vsi.num_queues; i++) + tx_discards += sc->vsi.queues[i].txr.br->br_drops; - ifp->if_ipackets = es->rx_unicast + + /* Update ifnet stats */ + IXL_SET_IPACKETS(vsi, es->rx_unicast + es->rx_multicast + - es->rx_broadcast; - ifp->if_opackets = es->tx_unicast + + es->rx_broadcast); + IXL_SET_OPACKETS(vsi, es->tx_unicast + es->tx_multicast + - es->tx_broadcast; - ifp->if_ibytes = es->rx_bytes; - ifp->if_obytes = es->tx_bytes; - ifp->if_imcasts = es->rx_multicast; - ifp->if_omcasts = es->tx_multicast; - - ifp->if_oerrors = es->tx_errors; - ifp->if_iqdrops = es->rx_discards; - ifp->if_noproto = es->rx_unknown_protocol; + es->tx_broadcast); + IXL_SET_IBYTES(vsi, es->rx_bytes); + IXL_SET_OBYTES(vsi, es->tx_bytes); + IXL_SET_IMCASTS(vsi, es->rx_multicast); + IXL_SET_OMCASTS(vsi, es->tx_multicast); + + IXL_SET_OERRORS(vsi, es->tx_errors); + IXL_SET_IQDROPS(vsi, es->rx_discards); + IXL_SET_OQDROPS(vsi, tx_discards); + IXL_SET_NOPROTO(vsi, es->rx_unknown_protocol); + IXL_SET_COLLISIONS(vsi, 0); sc->vsi.eth_stats = *es; } From owner-svn-src-all@FreeBSD.ORG Sat Sep 27 23:57:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51F2DA77; Sat, 27 Sep 2014 23:57:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32E30280; Sat, 27 Sep 2014 23:57:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RNvQNk058269; Sat, 27 Sep 2014 23:57:26 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RNvM8S058250; Sat, 27 Sep 2014 23:57:22 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201409272357.s8RNvM8S058250@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sat, 27 Sep 2014 23:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272230 - in stable/10/usr.sbin/bsdconfig: dot dot/include examples include share share/media share/packages X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 23:57:26 -0000 Author: dteske Date: Sat Sep 27 23:57:21 2014 New Revision: 272230 URL: http://svnweb.freebsd.org/changeset/base/272230 Log: MFC revisions 268999, 269027, 269351-269352, 269354, 269460, 270283, 270505, 270954, and 270989: r268999: Add new bsdconfig example scripts; remove obsolete ones r269027: Update bsdconfig dot module; fixes and enhancements r269351: Add setvar() for non-FreeBSD platforms using bash as /bin/sh r269352: Fix syntax error when run under bash r269354: Update setvar() function introduced in r269351 r269460: Update f_xdialog_info() in bsdconfig's dialog.subr include r270283: Add `-A' flag to pkg-install(8) when installing dependencies r270505: Optimize f_which() to be slightly faster still (common.subr) r270954: Update f_dialog_init() for safer getopts usage (dialog.subr) r270989: Fix for previously mentioned r270954 Approved by: re (gjb) Added: stable/10/usr.sbin/bsdconfig/examples/add_some_packages.sh - copied unchanged from r268999, head/usr.sbin/bsdconfig/examples/add_some_packages.sh stable/10/usr.sbin/bsdconfig/share/packages/musthavepkg.subr - copied unchanged from r268999, head/usr.sbin/bsdconfig/share/packages/musthavepkg.subr Deleted: stable/10/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh Modified: stable/10/usr.sbin/bsdconfig/dot/dot stable/10/usr.sbin/bsdconfig/dot/include/messages.subr stable/10/usr.sbin/bsdconfig/examples/Makefile stable/10/usr.sbin/bsdconfig/examples/browse_packages_http.sh stable/10/usr.sbin/bsdconfig/include/messages.subr stable/10/usr.sbin/bsdconfig/share/common.subr stable/10/usr.sbin/bsdconfig/share/dialog.subr stable/10/usr.sbin/bsdconfig/share/media/http.subr stable/10/usr.sbin/bsdconfig/share/media/httpproxy.subr stable/10/usr.sbin/bsdconfig/share/packages/Makefile stable/10/usr.sbin/bsdconfig/share/packages/index.subr (contents, props changed) stable/10/usr.sbin/bsdconfig/share/packages/packages.subr (contents, props changed) Directory Properties: stable/10/ (props changed) stable/10/usr.sbin/bsdconfig/share/packages/categories.subr (props changed) Modified: stable/10/usr.sbin/bsdconfig/dot/dot ============================================================================== --- stable/10/usr.sbin/bsdconfig/dot/dot Sat Sep 27 22:15:50 2014 (r272229) +++ stable/10/usr.sbin/bsdconfig/dot/dot Sat Sep 27 23:57:21 2014 (r272230) @@ -249,6 +249,7 @@ if [ "$SHOW_INCLUDES" ]; then $menu_program_list \ $submenu_program_list \ $cmd_program_list \ + $BSDCFG_SHARE/script.subr \ ; do [ -e "$file" ] && echo $file done | sort -u @@ -299,12 +300,6 @@ if [ "$SHOW_INCLUDES" ]; then fi # -# Add script.subr to includes if it exists -# -[ -f $BSDCFG_SHARE/script.subr ] && - include_file_list="$include_file_list script.subr" - -# # Start the directional-graph (digraph) output # printf 'strict digraph "" { // Empty name to prevent SVG Auto-Tooltip\n' @@ -352,7 +347,7 @@ printf '\tnode [\n' printf '\t\tfontname = "Times-Roman",\n' printf '\t\tfontsize = 12,\n' printf '\t\twidth = 2.5, // arbitrary minimum width for all nodes\n' -printf '\t\tfixedsize, // turn minimum width into exact width\n' +printf '\t\tfixedsize = true, // turn minimum width into exact width\n' printf '\t];\n' # @@ -546,34 +541,36 @@ printf '\t\tbgcolor = "%s";\n' "$bgcolor printf '\t\tlabel = "bsdconfig(8)";\n' printf '\t\ttooltip = "bsdconfig(8)";\n' print_node "bsdconfig" +end_nodelist if [ "$SHOW_INCLUDES" ]; then - printf '\t\tsubgraph "cluster_includes" {\n' - printf '\t\t\tbgcolor = "%s";\n' "$bgcolor_includes" - printf '\t\t\tlabel = "%s";\n' "$msg_includes" - for include_file in $include_file_list; do echo $include_file - done | awk -v bgcolor="$bgcolor_bsdconfig" ' - BEGIN { created = 0 } - function end_subgraph() { printf "\t\t\t};\n" } - ( $0 !~ "/" ) { - if ( ! created ) - { - printf "\t\t\tsubgraph \"%s\" {\n", - "cluster_bsdconfig_includes" - printf "\t\t\t\tbgcolor = \"%s\";\n", bgcolor - printf "\t\t\t\tlabel = \"bsdconfig\";\n" - created++ + done | awk \ + -v bgcolor="$bgcolor_bsdconfig" \ + -v msg_subroutines="$msg_subroutines" \ + ' + BEGIN { created = 0 } + function end_subgraph() { printf "\t};\n" } + ( $0 !~ "/" ) { + if ( ! created ) + { + printf "\tsubgraph \"%s\" {\n", + "cluster_bsdconfig_includes" + printf "\t\tbgcolor = \"%s\";\n", bgcolor + printf "\t\tlabel = \"bsdconfig %s\";\n", + msg_subroutines + created++ + } + printf "\t\t\"%s\";\n", $1 } - printf "\t\t\t\t\"%s\";\n", $1 - } - END { created && end_subgraph() }' + END { created && end_subgraph() } + ' # END-QUOTE for include_file in $include_file_list; do echo $include_file - done | awk ' + done | awk -v msg_subroutines="$msg_subroutines" ' BEGIN { created = 0 } - function end_subgraph() { printf "\t\t\t};\n" } + function end_subgraph() { printf "\t};\n" } ( $0 ~ "/" ) { include_dir_tmp = $1 sub("/[^/]*$", "", include_dir_tmp) @@ -588,20 +585,18 @@ if [ "$SHOW_INCLUDES" ]; then if ( ! created ) { include_dir = include_dir_tmp - printf "\t\t\tsubgraph \"cluster_%s_includes\" {\n", + printf "\tsubgraph \"cluster_%s_includes\" {\n", include_dir - printf "\t\t\t\tbgcolor = \"white\";\n" - printf "\t\t\t\tlabel = \"%s\";\n", include_dir + printf "\t\tbgcolor = \"thistle\";\n" + printf "\t\tlabel = \"%s %s\";\n", include_dir, + msg_subroutines created++ } - printf "\t\t\t\t\"%s\";\n", $1 + printf "\t\t\"%s\";\n", $1 } END { created && end_subgraph() }' - - printf '\t\t};\n' fi -end_nodelist for INDEX in */INDEX; do menu_title= menu_help= @@ -676,7 +671,7 @@ for INDEX in */INDEX; do end_nodelist done -printf '\n};\n' +printf '\n}\n' ################################################################################ # END Modified: stable/10/usr.sbin/bsdconfig/dot/include/messages.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/dot/include/messages.subr Sat Sep 27 22:15:50 2014 (r272229) +++ stable/10/usr.sbin/bsdconfig/dot/include/messages.subr Sat Sep 27 23:57:21 2014 (r272230) @@ -28,3 +28,4 @@ msg_graph_label_with_command="bsdconfig( msg_graph_label_with_command_and_date="bsdconfig(8)\\\ndot(1) output generated by \`\`%s'' on\\\n%s" msg_includes="Includes" msg_shortcuts="Shortcuts" +msg_subroutines="Subroutines" Modified: stable/10/usr.sbin/bsdconfig/examples/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/examples/Makefile Sat Sep 27 22:15:50 2014 (r272229) +++ stable/10/usr.sbin/bsdconfig/examples/Makefile Sat Sep 27 23:57:21 2014 (r272230) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/examples/bsdconfig -FILES= browse_packages_ftp.sh browse_packages_http.sh bsdconfigrc +FILES= add_some_packages.sh browse_packages_http.sh bsdconfigrc beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Copied: stable/10/usr.sbin/bsdconfig/examples/add_some_packages.sh (from r268999, head/usr.sbin/bsdconfig/examples/add_some_packages.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bsdconfig/examples/add_some_packages.sh Sat Sep 27 23:57:21 2014 (r272230, copy of r268999, head/usr.sbin/bsdconfig/examples/add_some_packages.sh) @@ -0,0 +1,13 @@ +#!/bin/sh +# $FreeBSD$ +# +# This sample installs a short list of packages from the main HTTP site. +# +[ "$_SCRIPT_SUBR" ] || . /usr/share/bsdconfig/script.subr || exit 1 +nonInteractive=1 +_httpPath=http://pkg.freebsd.org +mediaSetHTTP +mediaOpen +for package in wget bash rsync; do + packageAdd +done Modified: stable/10/usr.sbin/bsdconfig/examples/browse_packages_http.sh ============================================================================== --- stable/10/usr.sbin/bsdconfig/examples/browse_packages_http.sh Sat Sep 27 22:15:50 2014 (r272229) +++ stable/10/usr.sbin/bsdconfig/examples/browse_packages_http.sh Sat Sep 27 23:57:21 2014 (r272230) @@ -1,25 +1,32 @@ #!/bin/sh # $FreeBSD$ # -# This sample downloads the package INDEX file from HTTP to /tmp (if it doesn't -# already exist) and then displays the package configuration/management screen -# using the local INDEX file (results in faster browsing of packages from-start -# since the INDEX can be loaded from local media). +# This sample downloads the package digests.txz and packagesite.txz files from +# HTTP to /tmp (if they don't already exist) and then displays the package +# configuration/management screen using the local files (resulting in faster +# browsing of packages from-start since digests.txz/packagesite.txz can be +# loaded from local media). # -# NOTE: Packages cannot be installed unless staged to /tmp/packages/All +# NOTE: Packages cannot be installed unless staged to +# /tmp/packages/$PKG_ABI/All # -. /usr/share/bsdconfig/script.subr +[ "$_SCRIPT_SUBR" ] || . /usr/share/bsdconfig/script.subr || exit 1 nonInteractive=1 +f_musthavepkg_init # Make sure we have a usable pkg(8) with $PKG_ABI TMPDIR=/tmp -if [ ! -e "$TMPDIR/packages/INDEX" ]; then - [ -d "$TMPDIR/packages" ] || mkdir -p "$TMPDIR/packages" || exit 1 - _httpPath=http://ftp.freebsd.org - # For older releases, use http://ftp-archive.freebsd.org - mediaSetHTTP - mediaOpen - f_show_info "Downloading packages/INDEX from\n %s" "$_httpPath" - f_device_get device_media packages/INDEX > $TMPDIR/packages/INDEX -fi +PKGDIR=$TMPDIR/packages/$PKG_ABI +[ -d "$PKGDIR" ] || mkdir -p "$PKGDIR" || exit 1 +for file in digests.txz packagesite.txz; do + [ -s "$PKGDIR/$file" ] && continue + if [ ! "$HTTP_INITIALIZED" ]; then + _httpPath=http://pkg.freebsd.org + mediaSetHTTP + mediaOpen + fi + f_show_info "Downloading %s from\n %s" "$file" "$_httpPath" + f_device_get device_media "/$PKG_ABI/latest/$file" > $PKGDIR/$file || + exit 1 +done _directoryPath=$TMPDIR mediaSetDirectory configPackages Modified: stable/10/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/include/messages.subr Sat Sep 27 22:15:50 2014 (r272229) +++ stable/10/usr.sbin/bsdconfig/include/messages.subr Sat Sep 27 23:57:21 2014 (r272230) @@ -57,6 +57,7 @@ msg_back="Back" msg_becoming_root_via_sudo="Becoming root via sudo(8)..." msg_benchmarks_desc="Utilities for measuring system performance." msg_biology_desc="Software related to biology." +msg_bootstrapping_pkg="Bootstrapping pkg(8)..." msg_brazil="Brazil" msg_building_package_menus="Building package menu(s)..." msg_cad_desc="Computer Aided Design utilities." @@ -142,8 +143,6 @@ msg_generating_index_from_pkg_database=" msg_geography_desc="Geography-related software." msg_german_desc="Ported software for Germanic countries." msg_germany="Germany" -msg_getting_package_categories_via_pkg_rquery="Getting package categories via pkg-rquery(8)..." -msg_getting_package_dependencies_via_pkg_rquery="Getting package dependencies via pkg-rquery(8)\n(this can take a while)..." msg_gnome_desc="Components of the Gnome Desktop environment." msg_gnustep_desc="Software for GNUstep desktop environment." msg_graphics_desc="Graphics libraries and utilities." @@ -219,6 +218,7 @@ msg_misc_desc="Miscellaneous utilities." msg_missing_ftp_host_or_directory="Missing FTP host or directory specification. FTP media not initialized." msg_multimedia_desc="Multimedia software." msg_must_be_root_to_execute="%s: must be root to execute" +msg_must_have_pkg_to_execute="%s: must have pkg(8) to execute" msg_must_specify_a_host_name_of_some_sort="Must specify a host name of some sort!" msg_name_server="Name server" msg_net_desc="Networking utilities." @@ -274,6 +274,7 @@ msg_perl5_desc="Utilities/modules for th msg_permission_denied="%s: %s: Permission denied" msg_pkg_delete_failed="Warning: pkg-delete(8) of %s failed.\n Run with debugging for details." msg_pkg_install_apparently_did_not_like_the_package="pkg-install(8) apparently did not like the %s package." +msg_pkg_not_yet_installed_install_now="pkg(8) not yet installed. Install now?" msg_plan9_desc="Software from the Plan9 operating system." msg_please_check_the_url_and_try_again="No such directory: %s\nplease check the URL and try again.\n" msg_please_enter_password="Please enter your password for sudo(8):" @@ -376,15 +377,13 @@ msg_unable_to_get_proper_ftp_path="Unabl msg_unable_to_initialize_media_type_for_package_extract="Unable to initialize media type for package extract." msg_unable_to_make_directory_mountpoint="Unable to make %s directory mountpoint for %s!" msg_unable_to_open="Unable to open %s" -msg_unable_to_pkg_rquery_package_categories="Unable to pkg-rquery(8) package categories!" -msg_unable_to_pkg_rquery_package_dependencies="Unable to pkg-rquery(8) package dependencies!" msg_unable_to_update_pkg_from_selected_media="Unable to update pkg(8) from selected media." msg_uninstall="Uninstall" msg_uninstall_desc="Mark this package for deletion" msg_uninstalling_package_waiting_for_pkg_delete="Uninstalling %s package - waiting for pkg-delete(8)" msg_unknown="unknown" msg_unknown_user="Unknown user: %s" -msg_url_was_not_found="%s was not found, maybe directory or release-version are wrong?" +msg_url_was_not_found="%s was not found,\nmaybe directory or release-version are wrong?" msg_usa="USA" msg_usage="Usage" msg_usb="USB" Modified: stable/10/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/common.subr Sat Sep 27 22:15:50 2014 (r272229) +++ stable/10/usr.sbin/bsdconfig/share/common.subr Sat Sep 27 23:57:21 2014 (r272230) @@ -62,12 +62,6 @@ export UNAME_S="$( uname -s )" # Operati export UNAME_P="$( uname -p )" # Processor Architecture (i.e. i386) export UNAME_M="$( uname -m )" # Machine platform (i.e. i386) export UNAME_R="$( uname -r )" # Release Level (i.e. X.Y-RELEASE) -if [ ! "${PKG_ABI+set}" ]; then - export PKG_ABI="$( - ASSUME_ALWAYS_YES=1 pkg -vv 2> /dev/null | - awk '$1=="ABI"{print $3;exit}' - )" -fi # # Default behavior is to call f_debug_init() automatically when loaded. @@ -226,6 +220,36 @@ f_have() f_quietly type "$@" } +# setvar $var_to_set [$value] +# +# Implement setvar for shells unlike FreeBSD sh(1). +# +if ! f_have setvar; then +setvar() +{ + [ $# -gt 0 ] || return $SUCCESS + local __setvar_var_to_set="$1" __setvar_right="$2" __setvar_left= + case $# in + 1) unset "$__setvar_var_to_set" + return $? ;; + 2) : fall through ;; + *) f_err "setvar: too many arguments\n" + return $FAILURE + esac + case "$__setvar_var_to_set" in *[!0-9A-Za-z_]*) + f_err "setvar: %s: bad variable name\n" "$__setvar_var_to_set" + return 2 + esac + while case "$__setvar_r" in *\'*) : ;; *) false ; esac + do + __setvar_left="$__setvar_left${__setvar_right%%\'*}'\\''" + __setvar_right="${__setvar_right#*\'}" + done + __setvar_left="$__setvar_left${__setvar_right#*\'}" + eval "$__setvar_var_to_set='$__setvar_left'" +} +fi + # f_which $anything [$var_to_set] # # A fast built-in replacement for syntaxes such as foo=$( which bar ). In a @@ -239,10 +263,10 @@ f_which() { local __name="$1" __var_to_set="$2" case "$__name" in */*|'') return $FAILURE; esac - local __p IFS=":" __found= + local __p __exec IFS=":" __found= for __p in $PATH; do - local __exec="$__p/$__name" - [ -f "$__exec" -a -x "$__exec" ] && __found=1 && break + __exec="$__p/$__name" + [ -f "$__exec" -a -x "$__exec" ] && __found=1 break done if [ "$__found" ]; then if [ "$__var_to_set" ]; then Modified: stable/10/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/dialog.subr Sat Sep 27 22:15:50 2014 (r272229) +++ stable/10/usr.sbin/bsdconfig/share/dialog.subr Sat Sep 27 23:57:21 2014 (r272230) @@ -1557,12 +1557,22 @@ f_dialog_info() # EOF. This implies that you must execute this either as an rvalue to a pipe, # lvalue to indirection or in a sub-shell that provides data on stdin. # +# To open an Xdialog(1) infobox that does not disappear until expeclitly dis- +# missed, use the following: +# +# f_xdialog_info "$info_text" < /dev/tty & +# pid=$! +# # Perform some lengthy actions +# kill $pid +# +# NB: Check $USE_XDIALOG if you need to support both dialog(1) and Xdialog(1). +# f_xdialog_info() { local info_text="$*" height width f_dialog_infobox_size height width \ "$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$info_text" - $DIALOG \ + exec $DIALOG \ --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ --no-close --no-buttons \ @@ -2099,9 +2109,14 @@ f_dialog_init() # # Process stored command-line arguments # + # NB: Using backticks instead of $(...) for portability since Linux + # bash(1) balks at the right parentheses encountered in the case- + # statement (incorrectly interpreting it as the close of $(...)). + # f_dprintf "f_dialog_init: ARGV=[%s] GETOPTS_STDARGS=[%s]" \ "$ARGV" "$GETOPTS_STDARGS" - SECURE=$( set -- $ARGV + SECURE=`set -- $ARGV + OPTIND=1 while getopts \ "$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" \ flag > /dev/null; do @@ -2109,8 +2124,9 @@ f_dialog_init() S) echo 1 ;; esac done - ) - USE_XDIALOG=$( set -- $ARGV + ` # END-BACKTICK + USE_XDIALOG=`set -- $ARGV + OPTIND=1 while getopts \ "$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" \ flag > /dev/null; do @@ -2118,7 +2134,7 @@ f_dialog_init() S|X) echo 1 ;; esac done - ) + ` # END-BACKTICK f_dprintf "f_dialog_init: SECURE=[%s] USE_XDIALOG=[%s]" \ "$SECURE" "$USE_XDIALOG" Modified: stable/10/usr.sbin/bsdconfig/share/media/http.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/media/http.subr Sat Sep 27 22:15:50 2014 (r272229) +++ stable/10/usr.sbin/bsdconfig/share/media/http.subr Sat Sep 27 23:57:21 2014 (r272230) @@ -515,10 +515,7 @@ f_media_init_http() fi esac - if [ $http_found -eq $SUCCESS ]; then - HTTP_INITIALIZED=YES - break - fi + [ $http_found -eq $SUCCESS ] && HTTP_INITIALIZED=YES break f_getvar $VAR_HTTP_PATH http_path f_show_msg "$msg_please_check_the_url_and_try_again" \ @@ -668,7 +665,7 @@ f_media_get_http() 44) f_show_msg "$msg_url_was_not_found" "$url" ;; 4) f_show_msg "$msg_client_error" ;; *) f_show_msg "$msg_error_when_requesting_url" "$url" ;; - esac + esac 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD return $FAILURE } Modified: stable/10/usr.sbin/bsdconfig/share/media/httpproxy.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/media/httpproxy.subr Sat Sep 27 22:15:50 2014 (r272229) +++ stable/10/usr.sbin/bsdconfig/share/media/httpproxy.subr Sat Sep 27 23:57:21 2014 (r272230) @@ -452,7 +452,7 @@ f_media_get_http_proxy() 44) f_show_msg "$msg_url_was_not_found" "$url" ;; 4) f_show_msg "$msg_client_error" ;; *) f_show_msg "$msg_error_when_requesting_url" "$url" ;; - esac + esac 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD return $FAILURE } Modified: stable/10/usr.sbin/bsdconfig/share/packages/Makefile ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/packages/Makefile Sat Sep 27 22:15:50 2014 (r272229) +++ stable/10/usr.sbin/bsdconfig/share/packages/Makefile Sat Sep 27 23:57:21 2014 (r272230) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig/packages -FILES= categories.subr index.subr packages.subr +FILES= categories.subr index.subr musthavepkg.subr packages.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: stable/10/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/packages/index.subr Sat Sep 27 22:15:50 2014 (r272229) +++ stable/10/usr.sbin/bsdconfig/share/packages/index.subr Sat Sep 27 23:57:21 2014 (r272230) @@ -33,6 +33,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" f_dprintf "%s: loading includes..." packages/index.subr f_include $BSDCFG_SHARE/device.subr f_include $BSDCFG_SHARE/media/common.subr +f_include $BSDCFG_SHARE/packages/musthavepkg.subr f_include $BSDCFG_SHARE/strings.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" @@ -53,27 +54,6 @@ SQLITE_REPO="/var/db/pkg/repo-packagesit # PACKAGES_INDEX_CACHEFILE="/var/run/bsdconfig/packages_INDEX.cache" -# -# INDEX format for FreeBSD-6.0 or higher: -# -# package|port-origin|install-prefix|comment|port-desc-file|maintainer| -# categories|build-deps|run-deps|www-site|reserve|reserve|reserve|disc -# -INDEX_FORMAT="%n-%v" # package -INDEX_FORMAT="$INDEX_FORMAT|/usr/ports/%o" # port-origin -INDEX_FORMAT="$INDEX_FORMAT|%p" # install-prefix -INDEX_FORMAT="$INDEX_FORMAT|%c" # comment -INDEX_FORMAT="$INDEX_FORMAT|/usr/ports/%o/pkg-descr" # port-desc-file -INDEX_FORMAT="$INDEX_FORMAT|%m" # maintainer -INDEX_FORMAT="$INDEX_FORMAT|@CATEGORIES@" # place-holder -INDEX_FORMAT="$INDEX_FORMAT|" # build-deps -INDEX_FORMAT="$INDEX_FORMAT|@RUNDEPS@" # place-holder -INDEX_FORMAT="$INDEX_FORMAT|%w" # www-site -INDEX_FORMAT="$INDEX_FORMAT|" # reserved -INDEX_FORMAT="$INDEX_FORMAT|" # reserved -INDEX_FORMAT="$INDEX_FORMAT|" # reserved -INDEX_FORMAT="$INDEX_FORMAT|" # disc - ############################################################ FUNCTIONS # f_index_initialize [$var_to_set] @@ -87,13 +67,16 @@ INDEX_FORMAT="$INDEX_FORMAT|" # disc f_index_initialize() { local __funcname=f_index_initialize - local __var_to_set="${2:-PACKAGE_INDEX}" + local __var_to_set="${1:-PACKAGE_INDEX}" [ "$_INDEX_INITTED" ] && return $SUCCESS # Got any media? f_media_verify || return $FAILURE + # Make sure we have a usable pkg(8) with $PKG_ABI + f_musthavepkg_init + # Does it move when you kick it? f_device_init device_media || return $FAILURE @@ -126,9 +109,10 @@ f_index_initialize() __site="file://$MOUNTPOINT/packages/$PKG_ABI" esac - export PACKAGESITE="$__site" - f_dprintf "PACKAGESITE=[%s]" "$PACKAGESITE" - if ! f_eval_catch $__funcname pkg "pkg update"; then + f_dprintf "PACKAGESITE=[%s]" "$__site" + if ! f_eval_catch $__funcname pkg \ + 'PACKAGESITE="%s" pkg update' "$__site" + then f_show_err "$msg_unable_to_update_pkg_from_selected_media" f_device_shutdown device_media return $FAILURE @@ -195,53 +179,8 @@ f_index_initialize() # If we reach this point, we need to generate the data from scratch # - f_show_info "$msg_getting_package_categories_via_pkg_rquery" - if ! eval "$( pkg rquery "%n-%v %C" | awk ' - { categories[$1] = categories[$1] " " $2 } - END { - for (package in categories) - { - cats = categories[package] - sub(/^ /, "", cats) - gsub(/[^[:alnum:]_]/, "_", package) - printf "local _%s_categories=\"%s\";\n", package, cats - } - }' )"; then - f_show_err "$msg_unable_to_pkg_rquery_package_dependencies" - f_device_shutdown device_media - return $FAILURE - fi - - f_show_info "$msg_getting_package_dependencies_via_pkg_rquery" - if ! eval "$( pkg rquery "%n-%v %dn-%dv" | awk ' - { rundeps[$1] = rundeps[$1] " " $2 } - END { - for (package in rundeps) - { - deps = rundeps[package] - sub(/^ /, "", deps) - gsub(/[^[:alnum:]_]/, "_", package) - printf "local _%s_rundeps=\"%s\";\n", package, deps - } - }' )"; then - f_show_err "$msg_unable_to_pkg_rquery_package_dependencies" - f_device_shutdown device_media - return $FAILURE - fi - f_show_info "$msg_generating_index_from_pkg_database" - eval "$__var_to_set"='$( pkg rquery "$INDEX_FORMAT" | - while read LINE; do - package="${LINE%%|*}"; - f_str2varname "$package" varpkg; - eval f_replaceall \"\$LINE\" \"\|@CATEGORIES@\|\" \ - \"\|\$_${varpkg}_categories\|\" LINE - eval f_replaceall \"\$LINE\" \"\|@RUNDEPS@\|\" \ - \"\|\$_${varpkg}_rundeps\|\" LINE - echo "$LINE" - done - )' # always returns true (status of last item in pipe-chain) - eval "$__var_to_set"='$( debug= f_getvar "$__var_to_set" | sort )' + eval "$__var_to_set"='$( pkg rquery -I | sort )' # # Attempt to create the persistant on-disk cache Copied: stable/10/usr.sbin/bsdconfig/share/packages/musthavepkg.subr (from r268999, head/usr.sbin/bsdconfig/share/packages/musthavepkg.subr) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bsdconfig/share/packages/musthavepkg.subr Sat Sep 27 23:57:21 2014 (r272230, copy of r268999, head/usr.sbin/bsdconfig/share/packages/musthavepkg.subr) @@ -0,0 +1,87 @@ +if [ ! "$_PACKAGES_MUSTHAVEPKG_SUBR" ]; then _PACKAGES_MUSTHAVEPKG_SUBR=1 +# +# Copyright (c) 2014 Devin Teske +# 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$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." packages/musthavepkg.subr +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr + +############################################################ FUNCTIONS + +# f_musthavepkg_init +# +# Validate pkg(8) is installed and set $PKG_ABI global if not already set. +# Returns success unless pkg(8) is not installed and user refuses to install +# it (upon prompt when running interactively). +# +f_musthavepkg_init() +{ + local funcname=f_musthavepkg_init + local pkg_abi_awk='$1~/^ABI/{print $NF; exit}' + + if [ "$PKG_ABI" ]; then # Already set + f_dprintf "PKG_ABI=[%s]" "$PKG_ABI" + export PKG_ABI + f_quietly pkg -N -vv # return status (pkg(8) functional?) + return $? + fi + + # Attempt to get PKG_ABI without prematurely bootstrapping pkg(8) + if f_eval_catch -k PKG_ABI $funcname pkg \ + "pkg -N -vv | awk '%s'" "$pkg_abi_awk" + then + f_dprintf "PKG_ABI=[%s]" "$PKG_ABI" + export PKG_ABI + return $SUCCESS + fi + + # pkg(8) not yet bootstrapped; ask for permission unless nonInteractive + f_dialog_yesno "$msg_pkg_not_yet_installed_install_now" || + f_die 1 "$msg_must_have_pkg_to_execute" "$pgm" + + f_mustberoot_init # Have to be root to install pkg(8) + + # Bootstrap pkg(8) + f_dialog_info "$msg_bootstrapping_pkg" + f_eval_catch -k PKG_ABI $funcname pkg \ + "ASSUME_ALWAYS_YES=1 pkg -vv | awk '%s'" "$pkg_abi_awk" || + f_die 1 "$msg_must_have_pkg_to_execute" "$pgm" + + f_dprintf "PKG_ABI=[%s]" "$PKG_ABI" + export PKG_ABI + return $SUCCESS +} + +############################################################ MAIN + +f_dprintf "%s: Successfully loaded." packages/musthavepkg.subr + +fi # ! $_PACKAGES_MUSTHAVEPKG_SUBR Modified: stable/10/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/packages/packages.subr Sat Sep 27 22:15:50 2014 (r272229) +++ stable/10/usr.sbin/bsdconfig/share/packages/packages.subr Sat Sep 27 23:57:21 2014 (r272230) @@ -36,6 +36,7 @@ f_include $BSDCFG_SHARE/device.subr f_include $BSDCFG_SHARE/media/common.subr f_include $BSDCFG_SHARE/packages/categories.subr f_include $BSDCFG_SHARE/packages/index.subr +f_include $BSDCFG_SHARE/packages/musthavepkg.subr f_include $BSDCFG_SHARE/strings.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" @@ -662,7 +663,7 @@ f_package_review() f_package_config() { # Did we get an INDEX? - f_index_initialize packages/INDEX || return $FAILURE + f_index_initialize || return $FAILURE # Creates following variables (indirectly via f_index_read()) # CATEGORY_MENU_LIST _categories_{varpkg} _rundeps_{varpkg} # PACKAGE_CATEGORIES _npkgs @@ -839,7 +840,7 @@ f_package_add() { # Verify and initialize device media if-defined f_media_verify && f_device_init device_media && - f_index_initialize packages/INDEX + f_index_initialize } || return $FAILURE # Now we have (indirectly via f_index_read()): @@ -946,6 +947,8 @@ f_package_extract() local device="$1" name="$2" depended="$3" local devname= + f_musthavepkg_init # Make sure we have a usable pkg(8) with $PKG_ABI + $device get name devname f_dprintf "$funcname: device=[%s] name=[%s] depended=[%s]" \ "$devname" "$name" "$depended" @@ -1026,9 +1029,11 @@ f_package_extract() # Request the package be added via pkg-install(8) if f_debugging; then - f_eval_catch $funcname pkg 'pkg -d install -y "%s"' "$name" + f_eval_catch $funcname pkg \ + 'pkg -d install -${depended:+A}y "%s"' "$name" else - f_eval_catch $funcname pkg 'pkg install -y "%s"' "$name" + f_eval_catch $funcname pkg \ + 'pkg install -${depended:+A}y "%s"' "$name" fi if [ $? -ne $SUCCESS ]; then $alert "$msg_pkg_install_apparently_did_not_like_the_package" \ @@ -1065,7 +1070,7 @@ f_package_delete() { # Verify and initialize device media if-defined f_media_verify && f_device_init device_media && - f_index_initialize packages/INDEX + f_index_initialize } || return $FAILURE # Now we have (indirectly via f_index_read()):