From owner-svn-src-head@freebsd.org Sun Feb 12 00:52:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41D20CCEA74; Sun, 12 Feb 2017 00:52:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECF8B1B91; Sun, 12 Feb 2017 00:52:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1C0qNwJ064275; Sun, 12 Feb 2017 00:52:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1C0qMTl064272; Sun, 12 Feb 2017 00:52:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201702120052.v1C0qMTl064272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 12 Feb 2017 00:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313674 - in head/sys: arm/freescale/imx 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 00:52:24 -0000 Author: ian Date: Sun Feb 12 00:52:22 2017 New Revision: 313674 URL: https://svnweb.freebsd.org/changeset/base/313674 Log: Enable usb low and full speed devices connected to the imx6 root hubs. This enables the PHY circuitry for UTMI+ level 2 and 3, and sets the flag to tell the ehci code that the root hub has a transaction translator in it. For imx6 we can use the standard ehci_get_port_speed_portsc() function to find out what speed device is connected to the port. Modified: head/sys/arm/freescale/imx/imx6_usbphy.c head/sys/dev/usb/controller/ehci_imx.c Modified: head/sys/arm/freescale/imx/imx6_usbphy.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_usbphy.c Sat Feb 11 23:45:50 2017 (r313673) +++ head/sys/arm/freescale/imx/imx6_usbphy.c Sun Feb 12 00:52:22 2017 (r313674) @@ -143,6 +143,10 @@ usbphy_attach(device_t dev) bus_write_4(sc->mem_res, CTRL_SET_REG, CTRL_SFTRST); bus_write_4(sc->mem_res, CTRL_CLR_REG, CTRL_SFTRST | CTRL_CLKGATE); + /* Set UTMI+ level 2+3 bits to enable low and full speed devices. */ + bus_write_4(sc->mem_res, CTRL_SET_REG, + CTRL_ENUTMILEVEL2 | CTRL_ENUTMILEVEL3); + /* Power up: clear all bits in the powerdown register. */ bus_write_4(sc->mem_res, PWD_REG, 0); Modified: head/sys/dev/usb/controller/ehci_imx.c ============================================================================== --- head/sys/dev/usb/controller/ehci_imx.c Sat Feb 11 23:45:50 2017 (r313673) +++ head/sys/dev/usb/controller/ehci_imx.c Sun Feb 12 00:52:22 2017 (r313674) @@ -298,8 +298,9 @@ imx_ehci_attach(device_t dev) * Set flags that affect ehci_init() behavior, and hook our post-reset * code into the standard controller code. */ - esc->sc_flags |= EHCI_SCFLG_NORESTERM; + esc->sc_flags |= EHCI_SCFLG_NORESTERM | EHCI_SCFLG_TT; esc->sc_vendor_post_reset = imx_ehci_post_reset; + esc->sc_vendor_get_port_speed = ehci_get_port_speed_portsc; err = ehci_init(esc); if (err != 0) { From owner-svn-src-head@freebsd.org Sun Feb 12 06:56:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A921CDCE22; Sun, 12 Feb 2017 06:56:36 +0000 (UTC) (envelope-from eri@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFD1E10FE; Sun, 12 Feb 2017 06:56:35 +0000 (UTC) (envelope-from eri@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1C6uYhg008967; Sun, 12 Feb 2017 06:56:34 GMT (envelope-from eri@FreeBSD.org) Received: (from eri@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1C6uXp1008956; Sun, 12 Feb 2017 06:56:33 GMT (envelope-from eri@FreeBSD.org) Message-Id: <201702120656.v1C6uXp1008956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eri set sender to eri@FreeBSD.org using -f From: =?UTF-8?Q?Ermal_Lu=c3=a7i?= Date: Sun, 12 Feb 2017 06:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313675 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 06:56:36 -0000 Author: eri Date: Sun Feb 12 06:56:33 2017 New Revision: 313675 URL: https://svnweb.freebsd.org/changeset/base/313675 Log: Committed without approval from mentor. Reported by: gnn Modified: head/sys/netinet/in.h head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_output.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/in6.h head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_pcb.h head/sys/netinet6/ip6_output.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Sun Feb 12 00:52:22 2017 (r313674) +++ head/sys/netinet/in.h Sun Feb 12 06:56:33 2017 (r313675) @@ -433,8 +433,6 @@ __END_DECLS #define IP_BINDANY 24 /* bool: allow bind to any address */ #define IP_BINDMULTI 25 /* bool: allow multiple listeners on a tuple */ #define IP_RSS_LISTEN_BUCKET 26 /* int; set RSS listen bucket */ -#define IP_ORIGDSTADDR 27 /* bool: receive IP dst addr/port w/dgram */ -#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR /* * Options for controlling the firewall and dummynet. Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Sun Feb 12 00:52:22 2017 (r313674) +++ head/sys/netinet/in_pcb.c Sun Feb 12 06:56:33 2017 (r313675) @@ -2492,10 +2492,6 @@ db_print_inpflags(int inp_flags) db_printf("%sINP_RECVDSTADDR", comma ? ", " : ""); comma = 1; } - if (inp_flags & INP_ORIGDSTADDR) { - db_printf("%sINP_ORIGDSTADDR", comma ? ", " : ""); - comma = 1; - } if (inp_flags & INP_HDRINCL) { db_printf("%sINP_HDRINCL", comma ? ", " : ""); comma = 1; Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Sun Feb 12 00:52:22 2017 (r313674) +++ head/sys/netinet/in_pcb.h Sun Feb 12 06:56:33 2017 (r313675) @@ -618,7 +618,6 @@ short inp_so_options(const struct inpcb #define INP_RECVFLOWID 0x00000100 /* populate recv datagram with flow info */ #define INP_RECVRSSBUCKETID 0x00000200 /* populate recv datagram with bucket id */ #define INP_RATE_LIMIT_CHANGED 0x00000400 /* rate limit needs attention */ -#define INP_ORIGDSTADDR 0x00000800 /* receive IP dst address/port */ /* * Flags passed to in_pcblookup*() functions. Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Sun Feb 12 00:52:22 2017 (r313674) +++ head/sys/netinet/ip_output.c Sun Feb 12 06:56:33 2017 (r313675) @@ -1065,7 +1065,6 @@ ip_ctloutput(struct socket *so, struct s case IP_MINTTL: case IP_RECVOPTS: case IP_RECVRETOPTS: - case IP_ORIGDSTADDR: case IP_RECVDSTADDR: case IP_RECVTTL: case IP_RECVIF: @@ -1127,10 +1126,6 @@ ip_ctloutput(struct socket *so, struct s OPTSET(INP_RECVDSTADDR); break; - case IP_ORIGDSTADDR: - OPTSET2(INP_ORIGDSTADDR, optval); - break; - case IP_RECVTTL: OPTSET(INP_RECVTTL); break; @@ -1263,7 +1258,6 @@ ip_ctloutput(struct socket *so, struct s case IP_MINTTL: case IP_RECVOPTS: case IP_RECVRETOPTS: - case IP_ORIGDSTADDR: case IP_RECVDSTADDR: case IP_RECVTTL: case IP_RECVIF: @@ -1309,10 +1303,6 @@ ip_ctloutput(struct socket *so, struct s optval = OPTBIT(INP_RECVDSTADDR); break; - case IP_ORIGDSTADDR: - optval = OPTBIT2(INP_ORIGDSTADDR); - break; - case IP_RECVTTL: optval = OPTBIT(INP_RECVTTL); break; Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Sun Feb 12 00:52:22 2017 (r313674) +++ head/sys/netinet/udp_usrreq.c Sun Feb 12 06:56:33 2017 (r313675) @@ -304,7 +304,7 @@ udp_append(struct inpcb *inp, struct ip { struct sockaddr *append_sa; struct socket *so; - struct mbuf *tmpopts, *opts = NULL; + struct mbuf *opts = NULL; #ifdef INET6 struct sockaddr_in6 udp_in6; #endif @@ -319,7 +319,7 @@ udp_append(struct inpcb *inp, struct ip if (up->u_tun_func != NULL) { in_pcbref(inp); INP_RUNLOCK(inp); - (*up->u_tun_func)(n, off, inp, (struct sockaddr *)&udp_in[0], + (*up->u_tun_func)(n, off, inp, (struct sockaddr *)udp_in, up->u_tun_ctx); INP_RLOCK(inp); return (in_pcbrele_rlocked(inp)); @@ -355,27 +355,16 @@ udp_append(struct inpcb *inp, struct ip #endif /* INET6 */ ip_savecontrol(inp, &opts, ip, n); } - if (inp->inp_vflag & INP_IPV4 && inp->inp_flags2 & INP_ORIGDSTADDR) { - tmpopts = sbcreatecontrol((caddr_t)&udp_in[1], - sizeof(struct sockaddr_in), IP_ORIGDSTADDR, IPPROTO_IP); - if (tmpopts) { - if (opts) { - tmpopts->m_next = opts; - opts = tmpopts; - } else - opts = tmpopts; - } - } #ifdef INET6 if (inp->inp_vflag & INP_IPV6) { bzero(&udp_in6, sizeof(udp_in6)); udp_in6.sin6_len = sizeof(udp_in6); udp_in6.sin6_family = AF_INET6; - in6_sin_2_v4mapsin6(&udp_in[0], &udp_in6); + in6_sin_2_v4mapsin6(udp_in, &udp_in6); append_sa = (struct sockaddr *)&udp_in6; } else #endif /* INET6 */ - append_sa = (struct sockaddr *)&udp_in[0]; + append_sa = (struct sockaddr *)udp_in; m_adj(n, off); so = inp->inp_socket; @@ -401,7 +390,7 @@ udp_input(struct mbuf **mp, int *offp, i uint16_t len, ip_len; struct inpcbinfo *pcbinfo; struct ip save_ip; - struct sockaddr_in udpin[2]; + struct sockaddr_in udp_in; struct mbuf *m; struct m_tag *fwd_tag; int cscov_partial, iphlen; @@ -446,16 +435,11 @@ udp_input(struct mbuf **mp, int *offp, i * Construct sockaddr format source address. Stuff source address * and datagram in user buffer. */ - bzero(&udpin[0], sizeof(struct sockaddr_in)); - udpin[0].sin_len = sizeof(struct sockaddr_in); - udpin[0].sin_family = AF_INET; - udpin[0].sin_port = uh->uh_sport; - udpin[0].sin_addr = ip->ip_src; - bzero(&udpin[1], sizeof(struct sockaddr_in)); - udpin[1].sin_len = sizeof(struct sockaddr_in); - udpin[1].sin_family = AF_INET; - udpin[1].sin_port = uh->uh_dport; - udpin[1].sin_addr = ip->ip_dst; + bzero(&udp_in, sizeof(udp_in)); + udp_in.sin_len = sizeof(udp_in); + udp_in.sin_family = AF_INET; + udp_in.sin_port = uh->uh_sport; + udp_in.sin_addr = ip->ip_src; /* * Make mbuf data length reflect UDP length. If not enough data to @@ -584,7 +568,7 @@ udp_input(struct mbuf **mp, int *offp, i blocked = imo_multi_filter(imo, ifp, (struct sockaddr *)&group, - (struct sockaddr *)&udpin[0]); + (struct sockaddr *)&udp_in); if (blocked != MCAST_PASS) { if (blocked == MCAST_NOTGMEMBER) IPSTAT_INC(ips_notmember); @@ -603,7 +587,7 @@ udp_input(struct mbuf **mp, int *offp, i UDP_PROBE(receive, NULL, last, ip, last, uh); if (udp_append(last, ip, n, iphlen, - udpin)) { + &udp_in)) { goto inp_lost; } } @@ -636,7 +620,7 @@ udp_input(struct mbuf **mp, int *offp, i goto badunlocked; } UDP_PROBE(receive, NULL, last, ip, last, uh); - if (udp_append(last, ip, m, iphlen, udpin) == 0) + if (udp_append(last, ip, m, iphlen, &udp_in) == 0) INP_RUNLOCK(last); inp_lost: INP_INFO_RUNLOCK(pcbinfo); @@ -726,7 +710,7 @@ udp_input(struct mbuf **mp, int *offp, i } UDP_PROBE(receive, NULL, inp, ip, inp, uh); - if (udp_append(inp, ip, m, iphlen, udpin) == 0) + if (udp_append(inp, ip, m, iphlen, &udp_in) == 0) INP_RUNLOCK(inp); return (IPPROTO_DONE); Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Sun Feb 12 00:52:22 2017 (r313674) +++ head/sys/netinet6/in6.h Sun Feb 12 06:56:33 2017 (r313675) @@ -497,9 +497,6 @@ struct route_in6 { #define IPV6_RECVFLOWID 70 /* bool; receive IP6 flowid/flowtype w/ datagram */ #define IPV6_RECVRSSBUCKETID 71 /* bool; receive IP6 RSS bucket id w/ datagram */ -#define IPV6_ORIGDSTADDR 72 /* bool: allow getting dstaddr /port info */ -#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR - /* * The following option is private; do not use it from user applications. * It is deliberately defined to the same value as IP_MSFILTER. Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Sun Feb 12 00:52:22 2017 (r313674) +++ head/sys/netinet6/in6_pcb.c Sun Feb 12 06:56:33 2017 (r313675) @@ -1267,7 +1267,7 @@ in6_pcblookup_mbuf(struct inpcbinfo *pcb } void -init_sin6(struct sockaddr_in6 *sin6, struct mbuf *m, int srcordst) +init_sin6(struct sockaddr_in6 *sin6, struct mbuf *m) { struct ip6_hdr *ip; @@ -1275,7 +1275,7 @@ init_sin6(struct sockaddr_in6 *sin6, str bzero(sin6, sizeof(*sin6)); sin6->sin6_len = sizeof(*sin6); sin6->sin6_family = AF_INET6; - sin6->sin6_addr = srcordst ? ip->ip6_dst : ip->ip6_src; + sin6->sin6_addr = ip->ip6_src; (void)sa6_recoverscope(sin6); /* XXX: should catch errors... */ Modified: head/sys/netinet6/in6_pcb.h ============================================================================== --- head/sys/netinet6/in6_pcb.h Sun Feb 12 00:52:22 2017 (r313674) +++ head/sys/netinet6/in6_pcb.h Sun Feb 12 06:56:33 2017 (r313675) @@ -113,7 +113,7 @@ int in6_mapped_sockaddr(struct socket *s int in6_mapped_peeraddr(struct socket *so, struct sockaddr **nam); int in6_selecthlim(struct in6pcb *, struct ifnet *); int in6_pcbsetport(struct in6_addr *, struct inpcb *, struct ucred *); -void init_sin6(struct sockaddr_in6 *sin6, struct mbuf *m, int); +void init_sin6(struct sockaddr_in6 *sin6, struct mbuf *m); #endif /* _KERNEL */ #endif /* !_NETINET6_IN6_PCB_H_ */ Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sun Feb 12 00:52:22 2017 (r313674) +++ head/sys/netinet6/ip6_output.c Sun Feb 12 06:56:33 2017 (r313675) @@ -1545,7 +1545,6 @@ ip6_ctloutput(struct socket *so, struct #endif case IPV6_V6ONLY: case IPV6_AUTOFLOWLABEL: - case IPV6_ORIGDSTADDR: case IPV6_BINDANY: case IPV6_BINDMULTI: #ifdef RSS @@ -1731,9 +1730,6 @@ do { \ OPTSET(IN6P_AUTOFLOWLABEL); break; - case IPV6_ORIGDSTADDR: - OPTSET2(INP_ORIGDSTADDR, optval); - break; case IPV6_BINDANY: OPTSET(INP_BINDANY); break; @@ -2022,10 +2018,6 @@ do { \ optval = OPTBIT(IN6P_AUTOFLOWLABEL); break; - case IPV6_ORIGDSTADDR: - optval = OPTBIT2(INP_ORIGDSTADDR); - break; - case IPV6_BINDANY: optval = OPTBIT(INP_BINDANY); break; Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Sun Feb 12 00:52:22 2017 (r313674) +++ head/sys/netinet6/raw_ip6.c Sun Feb 12 06:56:33 2017 (r313675) @@ -166,7 +166,7 @@ rip6_input(struct mbuf **mp, int *offp, RIP6STAT_INC(rip6s_ipackets); - init_sin6(&fromsa, m, 0); /* general init */ + init_sin6(&fromsa, m); /* general init */ ifp = m->m_pkthdr.rcvif; Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Sun Feb 12 00:52:22 2017 (r313674) +++ head/sys/netinet6/udp6_usrreq.c Sun Feb 12 06:56:33 2017 (r313675) @@ -137,7 +137,7 @@ udp6_append(struct inpcb *inp, struct mb struct sockaddr_in6 *fromsa) { struct socket *so; - struct mbuf *opts = NULL, *tmp_opts; + struct mbuf *opts; struct udpcb *up; INP_LOCK_ASSERT(inp); @@ -149,7 +149,7 @@ udp6_append(struct inpcb *inp, struct mb if (up->u_tun_func != NULL) { in_pcbref(inp); INP_RUNLOCK(inp); - (*up->u_tun_func)(n, off, inp, (struct sockaddr *)&fromsa[0], + (*up->u_tun_func)(n, off, inp, (struct sockaddr *)fromsa, up->u_tun_ctx); INP_RLOCK(inp); return (in_pcbrele_rlocked(inp)); @@ -173,23 +173,11 @@ udp6_append(struct inpcb *inp, struct mb if (inp->inp_flags & INP_CONTROLOPTS || inp->inp_socket->so_options & SO_TIMESTAMP) ip6_savecontrol(inp, n, &opts); - if (inp->inp_vflag & INP_IPV6 && inp->inp_flags2 & INP_ORIGDSTADDR) { - tmp_opts = sbcreatecontrol((caddr_t)&fromsa[1], - sizeof(struct sockaddr_in6), IP_ORIGDSTADDR, IPPROTO_IPV6); - if (tmp_opts) { - if (opts) { - tmp_opts->m_next = opts; - opts = tmp_opts; - } else - opts = tmp_opts; - } - - } m_adj(n, off + sizeof(struct udphdr)); so = inp->inp_socket; SOCKBUF_LOCK(&so->so_rcv); - if (sbappendaddr_locked(&so->so_rcv, (struct sockaddr *)&fromsa[0], n, + if (sbappendaddr_locked(&so->so_rcv, (struct sockaddr *)fromsa, n, opts) == 0) { SOCKBUF_UNLOCK(&so->so_rcv); m_freem(n); @@ -214,7 +202,7 @@ udp6_input(struct mbuf **mp, int *offp, int off = *offp; int cscov_partial; int plen, ulen; - struct sockaddr_in6 fromsa[2]; + struct sockaddr_in6 fromsa; struct m_tag *fwd_tag; uint16_t uh_sum; uint8_t nxt; @@ -289,10 +277,8 @@ udp6_input(struct mbuf **mp, int *offp, /* * Construct sockaddr format source address. */ - init_sin6(&fromsa[0], m, 0); - fromsa[0].sin6_port = uh->uh_sport; - init_sin6(&fromsa[1], m, 1); - fromsa[1].sin6_port = uh->uh_dport; + init_sin6(&fromsa, m); + fromsa.sin6_port = uh->uh_sport; pcbinfo = udp_get_inpcbinfo(nxt); if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { @@ -363,7 +349,7 @@ udp6_input(struct mbuf **mp, int *offp, blocked = im6o_mc_filter(imo, ifp, (struct sockaddr *)&mcaddr, - (struct sockaddr *)&fromsa[0]); + (struct sockaddr *)&fromsa); if (blocked != MCAST_PASS) { if (blocked == MCAST_NOTGMEMBER) IP6STAT_INC(ip6s_notmember); @@ -384,7 +370,7 @@ udp6_input(struct mbuf **mp, int *offp, INP_RLOCK(last); UDP_PROBE(receive, NULL, last, ip6, last, uh); - if (udp6_append(last, n, off, fromsa)) + if (udp6_append(last, n, off, &fromsa)) goto inp_lost; INP_RUNLOCK(last); } @@ -416,7 +402,7 @@ udp6_input(struct mbuf **mp, int *offp, INP_RLOCK(last); INP_INFO_RUNLOCK(pcbinfo); UDP_PROBE(receive, NULL, last, ip6, last, uh); - if (udp6_append(last, m, off, fromsa) == 0) + if (udp6_append(last, m, off, &fromsa) == 0) INP_RUNLOCK(last); inp_lost: return (IPPROTO_DONE); @@ -496,7 +482,7 @@ udp6_input(struct mbuf **mp, int *offp, } } UDP_PROBE(receive, NULL, inp, ip6, inp, uh); - if (udp6_append(inp, m, off, fromsa) == 0) + if (udp6_append(inp, m, off, &fromsa) == 0) INP_RUNLOCK(inp); return (IPPROTO_DONE); From owner-svn-src-head@freebsd.org Sun Feb 12 07:09:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 159D2CDC130; Sun, 12 Feb 2017 07:09:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF8331912; Sun, 12 Feb 2017 07:09:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1C79EJS013241; Sun, 12 Feb 2017 07:09:14 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1C79E9W013240; Sun, 12 Feb 2017 07:09:14 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201702120709.v1C79E9W013240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 12 Feb 2017 07:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313678 - head/contrib/libpcap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 07:09:16 -0000 Author: delphij Date: Sun Feb 12 07:09:14 2017 New Revision: 313678 URL: https://svnweb.freebsd.org/changeset/base/313678 Log: Fixup mergeinfo. Modified: Directory Properties: head/contrib/libpcap/ (props changed) From owner-svn-src-head@freebsd.org Sun Feb 12 08:36:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 615BECDA78A; Sun, 12 Feb 2017 08:36:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BCC6CEA; Sun, 12 Feb 2017 08:36:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1C8andH051557; Sun, 12 Feb 2017 08:36:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1C8amG0051544; Sun, 12 Feb 2017 08:36:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702120836.v1C8amG0051544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 12 Feb 2017 08:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313679 - in head/usr.bin/svn: . svn svnadmin svnbench svndumpfilter svnfsfs svnlook svnmucc svnrdump svnserve svnsync svnversion X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 08:36:50 -0000 Author: ngie Date: Sun Feb 12 08:36:47 2017 New Revision: 313679 URL: https://svnweb.freebsd.org/changeset/base/313679 Log: Use SRCTOP/OBJTOP relative paths where possible; use :H manipulation in lieu of ../ elsewhere This simplifies pathing in make/displayed output MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/usr.bin/svn/Makefile.inc head/usr.bin/svn/svn/Makefile head/usr.bin/svn/svnadmin/Makefile head/usr.bin/svn/svnbench/Makefile head/usr.bin/svn/svndumpfilter/Makefile head/usr.bin/svn/svnfsfs/Makefile head/usr.bin/svn/svnlook/Makefile head/usr.bin/svn/svnmucc/Makefile head/usr.bin/svn/svnrdump/Makefile head/usr.bin/svn/svnserve/Makefile head/usr.bin/svn/svnsync/Makefile head/usr.bin/svn/svnversion/Makefile Modified: head/usr.bin/svn/Makefile.inc ============================================================================== --- head/usr.bin/svn/Makefile.inc Sun Feb 12 07:09:14 2017 (r313678) +++ head/usr.bin/svn/Makefile.inc Sun Feb 12 08:36:47 2017 (r313679) @@ -12,33 +12,31 @@ PACKAGE= svn .if !defined(SVNDIR) -SVNDIR= ${.CURDIR}/../../../contrib/subversion/subversion -APRU= ${.CURDIR}/../../../contrib/apr-util -APR= ${.CURDIR}/../../../contrib/apr +SVNDIR= ${SRCTOP}/contrib/subversion/subversion +APRU= ${SRCTOP}/contrib/apr-util +APR= ${SRCTOP}/contrib/apr WARNS?= 0 # definitely not warns friendly -.if exists(${.CURDIR}/../../Makefile.inc) -.include "${.CURDIR}/../../Makefile.inc" -.endif +.sinclude "${.CURDIR:H:H}/Makefile.inc" -LIBAPRDIR= ${.OBJDIR}/../lib/libapr -LIBAPR_UTILDIR= ${.OBJDIR}/../lib/libapr_util -LIBSERFDIR= ${.OBJDIR}/../lib/libserf - -LIBSVN_CLIENTDIR= ${.OBJDIR}/../lib/libsvn_client -LIBSVN_DELTADIR= ${.OBJDIR}/../lib/libsvn_delta -LIBSVN_DIFFDIR= ${.OBJDIR}/../lib/libsvn_diff -LIBSVN_FSDIR= ${.OBJDIR}/../lib/libsvn_fs -LIBSVN_FS_FSDIR= ${.OBJDIR}/../lib/libsvn_fs_fs -LIBSVN_FS_UTILDIR= ${.OBJDIR}/../lib/libsvn_fs_util -LIBSVN_FS_XDIR= ${.OBJDIR}/../lib/libsvn_fs_x -LIBSVN_RADIR= ${.OBJDIR}/../lib/libsvn_ra -LIBSVN_RA_LOCALDIR= ${.OBJDIR}/../lib/libsvn_ra_local -LIBSVN_RA_SVNDIR= ${.OBJDIR}/../lib/libsvn_ra_svn -LIBSVN_RA_SERFDIR= ${.OBJDIR}/../lib/libsvn_ra_serf -LIBSVN_REPOSDIR= ${.OBJDIR}/../lib/libsvn_repos -LIBSVN_SUBRDIR= ${.OBJDIR}/../lib/libsvn_subr -LIBSVN_WCDIR= ${.OBJDIR}/../lib/libsvn_wc +LIBAPRDIR= ${.OBJDIR:H}/lib/libapr +LIBAPR_UTILDIR= ${.OBJDIR:H}/lib/libapr_util +LIBSERFDIR= ${.OBJDIR:H}/lib/libserf + +LIBSVN_CLIENTDIR= ${.OBJDIR:H}/lib/libsvn_client +LIBSVN_DELTADIR= ${.OBJDIR:H}/lib/libsvn_delta +LIBSVN_DIFFDIR= ${.OBJDIR:H}/lib/libsvn_diff +LIBSVN_FSDIR= ${.OBJDIR:H}/lib/libsvn_fs +LIBSVN_FS_FSDIR= ${.OBJDIR:H}/lib/libsvn_fs_fs +LIBSVN_FS_UTILDIR= ${.OBJDIR:H}/lib/libsvn_fs_util +LIBSVN_FS_XDIR= ${.OBJDIR:H}/lib/libsvn_fs_x +LIBSVN_RADIR= ${.OBJDIR:H}/lib/libsvn_ra +LIBSVN_RA_LOCALDIR= ${.OBJDIR:H}/lib/libsvn_ra_local +LIBSVN_RA_SVNDIR= ${.OBJDIR:H}/lib/libsvn_ra_svn +LIBSVN_RA_SERFDIR= ${.OBJDIR:H}/lib/libsvn_ra_serf +LIBSVN_REPOSDIR= ${.OBJDIR:H}/lib/libsvn_repos +LIBSVN_SUBRDIR= ${.OBJDIR:H}/lib/libsvn_subr +LIBSVN_WCDIR= ${.OBJDIR:H}/lib/libsvn_wc LIBAPR= ${LIBAPRDIR}/libapr.a LIBAPR_UTIL= ${LIBAPR_UTILDIR}/libapr-util.a Modified: head/usr.bin/svn/svn/Makefile ============================================================================== --- head/usr.bin/svn/svn/Makefile Sun Feb 12 07:09:14 2017 (r313678) +++ head/usr.bin/svn/svn/Makefile Sun Feb 12 08:36:47 2017 (r313679) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svn @@ -17,11 +17,11 @@ SRCS= add-cmd.c auth-cmd.c blame-cmd.c c resolved-cmd.c revert-cmd.c status-cmd.c similarity.c status.c \ svn.c switch-cmd.c unlock-cmd.c update-cmd.c upgrade-cmd.c util.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: head/usr.bin/svn/svnadmin/Makefile ============================================================================== --- head/usr.bin/svn/svnadmin/Makefile Sun Feb 12 07:09:14 2017 (r313678) +++ head/usr.bin/svn/svnadmin/Makefile Sun Feb 12 08:36:47 2017 (r313679) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnadmin @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}admin SRCS= svnadmin.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: head/usr.bin/svn/svnbench/Makefile ============================================================================== --- head/usr.bin/svn/svnbench/Makefile Sun Feb 12 07:09:14 2017 (r313678) +++ head/usr.bin/svn/svnbench/Makefile Sun Feb 12 08:36:47 2017 (r313679) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnbench @@ -11,11 +11,11 @@ PROG= svn${SVNLITE}bench SRCS= help-cmd.c notify.c null-blame-cmd.c null-export-cmd.c \ null-info-cmd.c null-list-cmd.c null-log-cmd.c svnbench.c util.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: head/usr.bin/svn/svndumpfilter/Makefile ============================================================================== --- head/usr.bin/svn/svndumpfilter/Makefile Sun Feb 12 07:09:14 2017 (r313678) +++ head/usr.bin/svn/svndumpfilter/Makefile Sun Feb 12 08:36:47 2017 (r313679) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svndumpfilter @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}dumpfilter SRCS= svndumpfilter.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: head/usr.bin/svn/svnfsfs/Makefile ============================================================================== --- head/usr.bin/svn/svnfsfs/Makefile Sun Feb 12 07:09:14 2017 (r313678) +++ head/usr.bin/svn/svnfsfs/Makefile Sun Feb 12 08:36:47 2017 (r313679) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnfsfs @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}fsfs SRCS= dump-index-cmd.c load-index-cmd.c stats-cmd.c svnfsfs.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: head/usr.bin/svn/svnlook/Makefile ============================================================================== --- head/usr.bin/svn/svnlook/Makefile Sun Feb 12 07:09:14 2017 (r313678) +++ head/usr.bin/svn/svnlook/Makefile Sun Feb 12 08:36:47 2017 (r313679) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnlook @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}look SRCS= svnlook.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: head/usr.bin/svn/svnmucc/Makefile ============================================================================== --- head/usr.bin/svn/svnmucc/Makefile Sun Feb 12 07:09:14 2017 (r313678) +++ head/usr.bin/svn/svnmucc/Makefile Sun Feb 12 08:36:47 2017 (r313679) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnmucc @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}mucc SRCS= svnmucc.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: head/usr.bin/svn/svnrdump/Makefile ============================================================================== --- head/usr.bin/svn/svnrdump/Makefile Sun Feb 12 07:09:14 2017 (r313678) +++ head/usr.bin/svn/svnrdump/Makefile Sun Feb 12 08:36:47 2017 (r313679) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnrdump @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}rdump SRCS= dump_editor.c load_editor.c svnrdump.c util.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: head/usr.bin/svn/svnserve/Makefile ============================================================================== --- head/usr.bin/svn/svnserve/Makefile Sun Feb 12 07:09:14 2017 (r313678) +++ head/usr.bin/svn/svnserve/Makefile Sun Feb 12 08:36:47 2017 (r313679) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnserve @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}serve SRCS= cyrus_auth.c log-escape.c logger.c serve.c svnserve.c winservice.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: head/usr.bin/svn/svnsync/Makefile ============================================================================== --- head/usr.bin/svn/svnsync/Makefile Sun Feb 12 07:09:14 2017 (r313678) +++ head/usr.bin/svn/svnsync/Makefile Sun Feb 12 08:36:47 2017 (r313679) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnsync @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}sync SRCS= svnsync.c sync.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include Modified: head/usr.bin/svn/svnversion/Makefile ============================================================================== --- head/usr.bin/svn/svnversion/Makefile Sun Feb 12 07:09:14 2017 (r313678) +++ head/usr.bin/svn/svnversion/Makefile Sun Feb 12 08:36:47 2017 (r313679) @@ -2,7 +2,7 @@ MAN= -.include "${.CURDIR}/../Makefile.inc" +.include "${.CURDIR:H}/Makefile.inc" .PATH: ${SVNDIR}/svnversion @@ -10,11 +10,11 @@ PROG= svn${SVNLITE}version SRCS= svnversion.c -CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR}/.. \ - -I${.CURDIR}/../lib/libapr \ +CFLAGS+=-I${SVNDIR}/include -I${SVNDIR} -I${.CURDIR:H} \ + -I${.CURDIR:H}/lib/libapr \ -I${APR}/include/arch/unix \ -I${APR}/include \ - -I${.CURDIR}/../lib/libapr_util \ + -I${.CURDIR:H}/lib/libapr_util \ -I${APRU}/include/private \ -I${APRU}/include From owner-svn-src-head@freebsd.org Sun Feb 12 09:49:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C49E7CDCD62; Sun, 12 Feb 2017 09:49:45 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9244C173B; Sun, 12 Feb 2017 09:49:45 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1C9niOV080171; Sun, 12 Feb 2017 09:49:44 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1C9ni48080168; Sun, 12 Feb 2017 09:49:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702120949.v1C9ni48080168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 12 Feb 2017 09:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313683 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 09:49:45 -0000 Author: mjg Date: Sun Feb 12 09:49:44 2017 New Revision: 313683 URL: https://svnweb.freebsd.org/changeset/base/313683 Log: lockmgr: implement fast path The main lockmgr routine takes 8 arguments which makes it impossible to tail-call it by the intermediate vop_stdlock/unlock routines. The routine itself starts with an if-forest and reads from the lock itself several times. This slows things down both single- and multi-threaded. With the patch single-threaded fstats go 4% up and multithreaded up to ~27%. Note that there is still a lot of room for improvement. Reviewed by: kib Tested by: pho Modified: head/sys/kern/kern_lock.c head/sys/kern/vfs_default.c head/sys/sys/lockmgr.h Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Sun Feb 12 09:27:34 2017 (r313682) +++ head/sys/kern/kern_lock.c Sun Feb 12 09:49:44 2017 (r313683) @@ -168,6 +168,72 @@ SYSCTL_UINT(_debug_lockmgr, OID_AUTO, re SYSCTL_UINT(_debug_lockmgr, OID_AUTO, loops, CTLFLAG_RW, &alk_loops, 0, ""); #endif +static bool __always_inline lockmgr_slock_try(struct lock *lk, uintptr_t *xp, + int flags); +static bool __always_inline lockmgr_sunlock_try(struct lock *lk, uintptr_t x); + +static void +lockmgr_note_shared_acquire(struct lock *lk, int contested, + uint64_t waittime, const char *file, int line, int flags) +{ + + lock_profile_obtain_lock_success(&lk->lock_object, contested, waittime, + file, line); + LOCK_LOG_LOCK("SLOCK", &lk->lock_object, 0, 0, file, line); + WITNESS_LOCK(&lk->lock_object, LK_TRYWIT(flags), file, line); + TD_LOCKS_INC(curthread); + TD_SLOCKS_INC(curthread); + STACK_SAVE(lk); +} + +static void +lockmgr_note_shared_release(struct lock *lk, const char *file, int line) +{ + + lock_profile_release_lock(&lk->lock_object); + WITNESS_UNLOCK(&lk->lock_object, 0, file, line); + LOCK_LOG_LOCK("SUNLOCK", &lk->lock_object, 0, 0, file, line); + TD_LOCKS_DEC(curthread); + TD_SLOCKS_DEC(curthread); +} + +static void +lockmgr_note_exclusive_acquire(struct lock *lk, int contested, + uint64_t waittime, const char *file, int line, int flags) +{ + + lock_profile_obtain_lock_success(&lk->lock_object, contested, waittime, + file, line); + LOCK_LOG_LOCK("XLOCK", &lk->lock_object, 0, lk->lk_recurse, file, line); + WITNESS_LOCK(&lk->lock_object, LOP_EXCLUSIVE | LK_TRYWIT(flags), file, + line); + TD_LOCKS_INC(curthread); + STACK_SAVE(lk); +} + +static void +lockmgr_note_exclusive_release(struct lock *lk, const char *file, int line) +{ + + lock_profile_release_lock(&lk->lock_object); + LOCK_LOG_LOCK("XUNLOCK", &lk->lock_object, 0, lk->lk_recurse, file, + line); + WITNESS_UNLOCK(&lk->lock_object, LOP_EXCLUSIVE, file, line); + TD_LOCKS_DEC(curthread); +} + +static void +lockmgr_note_exclusive_upgrade(struct lock *lk, const char *file, int line, + int flags) +{ + + LOCK_LOG_LOCK("XUPGRADE", &lk->lock_object, 0, 0, file, + line); + WITNESS_UPGRADE(&lk->lock_object, LOP_EXCLUSIVE | + LK_TRYWIT(flags), file, line); + TD_SLOCKS_DEC(curthread); +} + static __inline struct thread * lockmgr_xholder(const struct lock *lk) { @@ -234,35 +300,11 @@ wakeupshlk(struct lock *lk, const char * u_int realexslp; int queue, wakeup_swapper; - WITNESS_UNLOCK(&lk->lock_object, 0, file, line); - LOCK_LOG_LOCK("SUNLOCK", &lk->lock_object, 0, 0, file, line); - wakeup_swapper = 0; for (;;) { x = lk->lk_lock; - - /* - * If there is more than one shared lock held, just drop one - * and return. - */ - if (LK_SHARERS(x) > 1) { - if (atomic_cmpset_rel_ptr(&lk->lk_lock, x, - x - LK_ONE_SHARER)) - break; - continue; - } - - /* - * If there are not waiters on the exclusive queue, drop the - * lock quickly. - */ - if ((x & LK_ALL_WAITERS) == 0) { - MPASS((x & ~LK_EXCLUSIVE_SPINNERS) == - LK_SHARERS_LOCK(1)); - if (atomic_cmpset_rel_ptr(&lk->lk_lock, x, LK_UNLOCKED)) - break; - continue; - } + if (lockmgr_sunlock_try(lk, x)) + break; /* * We should have a sharer with waiters, so enter the hard @@ -332,9 +374,7 @@ wakeupshlk(struct lock *lk, const char * break; } - lock_profile_release_lock(&lk->lock_object); - TD_LOCKS_DEC(curthread); - TD_SLOCKS_DEC(curthread); + lockmgr_note_shared_release(lk, file, line); return (wakeup_swapper); } @@ -448,6 +488,165 @@ lockdestroy(struct lock *lk) lock_destroy(&lk->lock_object); } +static bool __always_inline +lockmgr_slock_try(struct lock *lk, uintptr_t *xp, int flags) +{ + + /* + * If no other thread has an exclusive lock, or + * no exclusive waiter is present, bump the count of + * sharers. Since we have to preserve the state of + * waiters, if we fail to acquire the shared lock + * loop back and retry. + */ + *xp = lk->lk_lock; + while (LK_CAN_SHARE(*xp, flags)) { + if (atomic_fcmpset_acq_ptr(&lk->lk_lock, xp, + *xp + LK_ONE_SHARER)) { + return (true); + } + } + return (false); +} + +static bool __always_inline +lockmgr_sunlock_try(struct lock *lk, uintptr_t x) +{ + + for (;;) { + /* + * If there is more than one shared lock held, just drop one + * and return. + */ + if (LK_SHARERS(x) > 1) { + if (atomic_fcmpset_rel_ptr(&lk->lk_lock, &x, + x - LK_ONE_SHARER)) + return (true); + continue; + } + + /* + * If there are not waiters on the exclusive queue, drop the + * lock quickly. + */ + if ((x & LK_ALL_WAITERS) == 0) { + MPASS((x & ~LK_EXCLUSIVE_SPINNERS) == + LK_SHARERS_LOCK(1)); + if (atomic_fcmpset_rel_ptr(&lk->lk_lock, &x, + LK_UNLOCKED)) + return (true); + continue; + } + break; + } + return (false); +} + +int +lockmgr_lock_fast_path(struct lock *lk, u_int flags, struct lock_object *ilk, + const char *file, int line) +{ + struct lock_class *class; + uintptr_t x, v, tid; + u_int op; + bool locked; + + op = flags & LK_TYPE_MASK; + locked = false; + switch (op) { + case LK_SHARED: + if (LK_CAN_WITNESS(flags)) + WITNESS_CHECKORDER(&lk->lock_object, LOP_NEWORDER, + file, line, flags & LK_INTERLOCK ? ilk : NULL); + if (__predict_false(lk->lock_object.lo_flags & LK_NOSHARE)) + break; + if (lockmgr_slock_try(lk, &x, flags)) { + lockmgr_note_shared_acquire(lk, 0, 0, + file, line, flags); + locked = true; + } + break; + case LK_EXCLUSIVE: + if (LK_CAN_WITNESS(flags)) + WITNESS_CHECKORDER(&lk->lock_object, LOP_NEWORDER | + LOP_EXCLUSIVE, file, line, flags & LK_INTERLOCK ? + ilk : NULL); + tid = (uintptr_t)curthread; + if (lk->lk_lock == LK_UNLOCKED && + atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, tid)) { + lockmgr_note_exclusive_acquire(lk, 0, 0, file, line, + flags); + locked = true; + } + break; + case LK_UPGRADE: + case LK_TRYUPGRADE: + _lockmgr_assert(lk, KA_SLOCKED, file, line); + tid = (uintptr_t)curthread; + v = lk->lk_lock; + x = v & LK_ALL_WAITERS; + v &= LK_EXCLUSIVE_SPINNERS; + if (atomic_cmpset_ptr(&lk->lk_lock, LK_SHARERS_LOCK(1) | x | v, + tid | x)) { + lockmgr_note_exclusive_upgrade(lk, file, line, flags); + locked = true; + } + break; + default: + break; + } + if (__predict_true(locked)) { + if (__predict_false(flags & LK_INTERLOCK)) { + class = LOCK_CLASS(ilk); + class->lc_unlock(ilk); + } + return (0); + } else { + return (__lockmgr_args(lk, flags, ilk, LK_WMESG_DEFAULT, + LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, file, line)); + } +} + +int +lockmgr_unlock_fast_path(struct lock *lk, u_int flags, struct lock_object *ilk) +{ + struct lock_class *class; + uintptr_t x, tid; + bool unlocked; + const char *file; + int line; + + file = __FILE__; + line = __LINE__; + + _lockmgr_assert(lk, KA_LOCKED, file, line); + unlocked = false; + x = lk->lk_lock; + if (__predict_true(x & LK_SHARE) != 0) { + if (lockmgr_sunlock_try(lk, x)) { + lockmgr_note_shared_release(lk, file, line); + unlocked = true; + } + } else { + tid = (uintptr_t)curthread; + if (!lockmgr_recursed(lk) && + atomic_cmpset_rel_ptr(&lk->lk_lock, tid, LK_UNLOCKED)) { + lockmgr_note_exclusive_release(lk, file, line); + unlocked = true; + } + } + if (__predict_true(unlocked)) { + if (__predict_false(flags & LK_INTERLOCK)) { + class = LOCK_CLASS(ilk); + class->lc_unlock(ilk); + } + return (0); + } else { + return (__lockmgr_args(lk, flags | LK_RELEASE, ilk, LK_WMESG_DEFAULT, + LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, LOCK_FILE, LOCK_LINE)); + } +} + int __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, const char *wmesg, int pri, int timo, const char *file, int line) @@ -518,21 +717,8 @@ __lockmgr_args(struct lock *lk, u_int fl WITNESS_CHECKORDER(&lk->lock_object, LOP_NEWORDER, file, line, flags & LK_INTERLOCK ? ilk : NULL); for (;;) { - x = lk->lk_lock; - - /* - * If no other thread has an exclusive lock, or - * no exclusive waiter is present, bump the count of - * sharers. Since we have to preserve the state of - * waiters, if we fail to acquire the shared lock - * loop back and retry. - */ - if (LK_CAN_SHARE(x, flags)) { - if (atomic_cmpset_acq_ptr(&lk->lk_lock, x, - x + LK_ONE_SHARER)) - break; - continue; - } + if (lockmgr_slock_try(lk, &x, flags)) + break; #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif @@ -697,15 +883,13 @@ __lockmgr_args(struct lock *lk, u_int fl __func__, lk); } if (error == 0) { - lock_profile_obtain_lock_success(&lk->lock_object, - contested, waittime, file, line); - LOCK_LOG_LOCK("SLOCK", &lk->lock_object, 0, 0, file, - line); - WITNESS_LOCK(&lk->lock_object, LK_TRYWIT(flags), file, - line); - TD_LOCKS_INC(curthread); - TD_SLOCKS_INC(curthread); - STACK_SAVE(lk); +#ifdef LOCK_PROFILING + lockmgr_note_shared_acquire(lk, contested, waittime, + file, line, flags); +#else + lockmgr_note_shared_acquire(lk, 0, 0, file, line, + flags); +#endif } break; case LK_UPGRADE: @@ -968,14 +1152,13 @@ __lockmgr_args(struct lock *lk, u_int fl __func__, lk); } if (error == 0) { - lock_profile_obtain_lock_success(&lk->lock_object, - contested, waittime, file, line); - LOCK_LOG_LOCK("XLOCK", &lk->lock_object, 0, - lk->lk_recurse, file, line); - WITNESS_LOCK(&lk->lock_object, LOP_EXCLUSIVE | - LK_TRYWIT(flags), file, line); - TD_LOCKS_INC(curthread); - STACK_SAVE(lk); +#ifdef LOCK_PROFILING + lockmgr_note_exclusive_acquire(lk, contested, waittime, + file, line, flags); +#else + lockmgr_note_exclusive_acquire(lk, 0, 0, file, line, + flags); +#endif } break; case LK_DOWNGRADE: Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Sun Feb 12 09:27:34 2017 (r313682) +++ head/sys/kern/vfs_default.c Sun Feb 12 09:49:44 2017 (r313683) @@ -520,10 +520,11 @@ vop_stdlock(ap) } */ *ap; { struct vnode *vp = ap->a_vp; + struct mtx *ilk; - return (_lockmgr_args(vp->v_vnlock, ap->a_flags, VI_MTX(vp), - LK_WMESG_DEFAULT, LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, ap->a_file, - ap->a_line)); + ilk = VI_MTX(vp); + return (lockmgr_lock_fast_path(vp->v_vnlock, ap->a_flags, + (ilk != NULL) ? &ilk->lock_object : NULL, ap->a_file, ap->a_line)); } /* See above. */ @@ -535,8 +536,11 @@ vop_stdunlock(ap) } */ *ap; { struct vnode *vp = ap->a_vp; + struct mtx *ilk; - return (lockmgr(vp->v_vnlock, ap->a_flags | LK_RELEASE, VI_MTX(vp))); + ilk = VI_MTX(vp); + return (lockmgr_unlock_fast_path(vp->v_vnlock, ap->a_flags, + (ilk != NULL) ? &ilk->lock_object : NULL)); } /* See above. */ Modified: head/sys/sys/lockmgr.h ============================================================================== --- head/sys/sys/lockmgr.h Sun Feb 12 09:27:34 2017 (r313682) +++ head/sys/sys/lockmgr.h Sun Feb 12 09:49:44 2017 (r313683) @@ -68,6 +68,10 @@ struct thread; */ int __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, const char *wmesg, int prio, int timo, const char *file, int line); +int lockmgr_lock_fast_path(struct lock *lk, u_int flags, + struct lock_object *ilk, const char *file, int line); +int lockmgr_unlock_fast_path(struct lock *lk, u_int flags, + struct lock_object *ilk); #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) void _lockmgr_assert(const struct lock *lk, int what, const char *file, int line); #endif From owner-svn-src-head@freebsd.org Sun Feb 12 11:10:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AED4CCDC00A; Sun, 12 Feb 2017 11:10:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 895F913D6; Sun, 12 Feb 2017 11:10:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 5F1EE7D17; Sun, 12 Feb 2017 11:10:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Sun, 12 Feb 2017 11:10:45 +0000 From: Glen Barber To: Ermal =?iso-8859-1?Q?Lu=E7i?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313675 - in head/sys: netinet netinet6 Message-ID: <20170212111045.GC13738@FreeBSD.org> References: <201702120656.v1C6uXp1008956@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NU0Ex4SbNnrxsi6C" Content-Disposition: inline In-Reply-To: <201702120656.v1C6uXp1008956@repo.freebsd.org> X-Operating-System: FreeBSD 11.0-STABLE amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer X-Spidey-Sense: Uh oh, Peter logged in User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 11:10:49 -0000 --NU0Ex4SbNnrxsi6C Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 12, 2017 at 06:56:33AM +0000, Ermal Lu=E7i wrote: > Author: eri > Date: Sun Feb 12 06:56:33 2017 > New Revision: 313675 > URL: https://svnweb.freebsd.org/changeset/base/313675 >=20 > Log: > Committed without approval from mentor. > =20 > Reported by: gnn >=20 What exactly does this mean? Glen --NU0Ex4SbNnrxsi6C Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYoEK1AAoJEAMUWKVHj+KToGwP/01xu2yi8bgavHadvNWxqkO1 LFD+h/N2uwG7tbNkjxx4lylXYIyg6GgSbK5iogBttPMH9B+a+a7OawLNl43uyacD ds63zV7K+s3xrQqolPuIBf2jR9dBBrBQqSjrcuyeVN/nfTNq4jGGwJCPfS8Ntu3V eA2XCubwNYuqWY691wPoF45EqRDzeT5WEPnKyglRqnjyaOMWAWrzqes4QEvixYWE EcWKi5XE5URZN+hT6+GTIZpdMP6kLPyjZJAd+hybkFTTDc+veBifbbso4pR0d2E6 4cCFDEDFjyZ6SziZQPDShnjYfQZtS68YZNeiaVJmsmLFi8rMGIBcIgjQYOpPx8XX W6EG50pfQT+tBo2wbseLQrRVAeaDxusmLKKIHXomwj2I8OH4kWIt9tbe0l7X9Ipb zbzMzfy+S8eWObam0ydvvJvG1OJrmkJtG7U29ppN1LOZK3o7kJ6K2Rh/XXwKEjpw GJmcYrAkQW0n7UoSQITzUjEoVcNnmD8UvB/hMIH1Yfn9g9sD8dSuxuWCRNlnISsk aQoXtV9R8J/YzdZTAjbD4K3npKAWBLtdTOcNubXuczW7m6EWzmwGoXtLOWtU/3Ju xBZh/25YuGK2PV0aMp/Uus1MZSEL94GpGWC2/nBTcpminZir6vw4eLHKMI5GLlc5 JAQ2BaaKOmarLFNhTjN/ =MdAc -----END PGP SIGNATURE----- --NU0Ex4SbNnrxsi6C-- From owner-svn-src-head@freebsd.org Sun Feb 12 15:22:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29100CDCFA7; Sun, 12 Feb 2017 15:22:52 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE5941F96; Sun, 12 Feb 2017 15:22:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1CFMp8Q017698; Sun, 12 Feb 2017 15:22:51 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1CFMp0S017697; Sun, 12 Feb 2017 15:22:51 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201702121522.v1CFMp0S017697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 12 Feb 2017 15:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313684 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 15:22:52 -0000 Author: dchagin Date: Sun Feb 12 15:22:50 2017 New Revision: 313684 URL: https://svnweb.freebsd.org/changeset/base/313684 Log: Fix r313284. Members of the syscall argument structures are padded to a word size. So, for COMPAT_LINUX32 we should convert user supplied system call arguments which is 32-bit in that case to the array of register_t. Reported by: Oleg V. Nauman MFC after: 1 week Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sun Feb 12 09:49:44 2017 (r313683) +++ head/sys/compat/linux/linux_socket.c Sun Feb 12 15:22:50 2017 (r313684) @@ -1683,39 +1683,45 @@ linux_getsockopt(struct thread *td, stru #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) /* Argument list sizes for linux_socketcall */ - -#define LINUX_AL(x) ((x) * sizeof(l_ulong)) - -static const unsigned char lxs_args[] = { - LINUX_AL(0) /* unused*/, LINUX_AL(3) /* socket */, - LINUX_AL(3) /* bind */, LINUX_AL(3) /* connect */, - LINUX_AL(2) /* listen */, LINUX_AL(3) /* accept */, - LINUX_AL(3) /* getsockname */, LINUX_AL(3) /* getpeername */, - LINUX_AL(4) /* socketpair */, LINUX_AL(4) /* send */, - LINUX_AL(4) /* recv */, LINUX_AL(6) /* sendto */, - LINUX_AL(6) /* recvfrom */, LINUX_AL(2) /* shutdown */, - LINUX_AL(5) /* setsockopt */, LINUX_AL(5) /* getsockopt */, - LINUX_AL(3) /* sendmsg */, LINUX_AL(3) /* recvmsg */, - LINUX_AL(4) /* accept4 */, LINUX_AL(5) /* recvmmsg */, - LINUX_AL(4) /* sendmmsg */ +static const unsigned char lxs_args_cnt[] = { + 0 /* unused*/, 3 /* socket */, + 3 /* bind */, 3 /* connect */, + 2 /* listen */, 3 /* accept */, + 3 /* getsockname */, 3 /* getpeername */, + 4 /* socketpair */, 4 /* send */, + 4 /* recv */, 6 /* sendto */, + 6 /* recvfrom */, 2 /* shutdown */, + 5 /* setsockopt */, 5 /* getsockopt */, + 3 /* sendmsg */, 3 /* recvmsg */, + 4 /* accept4 */, 5 /* recvmmsg */, + 4 /* sendmmsg */ }; - -#define LINUX_AL_SIZE (nitems(lxs_args) - 1) +#define LINUX_ARGS_CNT (nitems(lxs_args_cnt) - 1) +#define LINUX_ARG_SIZE(x) (lxs_args_cnt[x] * sizeof(l_ulong)) int linux_socketcall(struct thread *td, struct linux_socketcall_args *args) { l_ulong a[6]; +#if defined(__amd64__) && defined(COMPAT_LINUX32) + register_t l_args[6]; +#endif void *arg; int error; - if (args->what < LINUX_SOCKET || args->what > LINUX_AL_SIZE) + if (args->what < LINUX_SOCKET || args->what > LINUX_ARGS_CNT) return (EINVAL); - error = copyin(PTRIN(args->args), a, lxs_args[args->what]); - if (error) + error = copyin(PTRIN(args->args), a, LINUX_ARG_SIZE(args->what)); + if (error != 0) return (error); +#if defined(__amd64__) && defined(COMPAT_LINUX32) + for (int i = 0; i < lxs_args_cnt[args->what]; ++i) + l_args[i] = a[i]; + arg = l_args; +#else arg = a; +#endif switch (args->what) { case LINUX_SOCKET: return (linux_socket(td, arg)); From owner-svn-src-head@freebsd.org Sun Feb 12 15:42:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55744CDB3F2; Sun, 12 Feb 2017 15:42:06 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:c:538::198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07FC71673; Sun, 12 Feb 2017 15:42:05 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from mfilter15-d.gandi.net (mfilter15-d.gandi.net [217.70.178.143]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 4F3D1FB886; Sun, 12 Feb 2017 16:42:03 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter15-d.gandi.net Received: from relay6-d.mail.gandi.net ([IPv6:::ffff:217.70.183.198]) by mfilter15-d.gandi.net (mfilter15-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id Mfv9Ns1a40s1; Sun, 12 Feb 2017 16:42:01 +0100 (CET) X-Originating-IP: 108.29.111.63 Received: from [172.16.19.1] (pool-108-29-111-63.nycmny.fios.verizon.net [108.29.111.63]) (Authenticated sender: gnn@neville-neil.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id A74CCFB881; Sun, 12 Feb 2017 16:42:00 +0100 (CET) From: "George Neville-Neil" To: "Glen Barber" Cc: "Ermal =?utf-8?q?Lu=C3=A7i?=" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313675 - in head/sys: netinet netinet6 Date: Sun, 12 Feb 2017 10:41:58 -0500 Message-ID: <53D3A92C-6C64-4C0C-A5E6-B659BFA139BF@neville-neil.com> In-Reply-To: <20170212111045.GC13738@FreeBSD.org> References: <201702120656.v1C6uXp1008956@repo.freebsd.org> <20170212111045.GC13738@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_399D2B93-4FB8-4736-9FAB-586EA5CE5549_="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Mailer: MailMate (1.9.6r5344) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 15:42:06 -0000 This is an OpenPGP/MIME signed message (RFC 3156 and 4880). --=_MailMate_399D2B93-4FB8-4736-9FAB-586EA5CE5549_= Content-Type: text/plain; charset=utf-8; markup=markdown Content-Transfer-Encoding: quoted-printable On 12 Feb 2017, at 6:10, Glen Barber wrote: > On Sun, Feb 12, 2017 at 06:56:33AM +0000, Ermal Lu=C3=A7i wrote: >> Author: eri >> Date: Sun Feb 12 06:56:33 2017 >> New Revision: 313675 >> URL: https://svnweb.freebsd.org/changeset/base/313675 >> >> Log: >> Committed without approval from mentor. >> >> Reported by: gnn >> > > What exactly does this mean? > Ermal took the Acceptance on reviews.freebsd.org by Adrian as an implicit= "go ahead" to commit to the tree. The issue is that he's still under me= ntorship, by me, and had not gotten an approval or had an Approved by: li= ne. I asked him to revert the change himself. We're working out a few more issues in the review now. Best, George --=_MailMate_399D2B93-4FB8-4736-9FAB-586EA5CE5549_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAliggkcACgkQYdh2wUQKM9LuOgCfbTTUz83s0WuLQLvudd+UvnPr NfUAmwWaYVBc8oPnsEmZe8mK2sKuyLGe =ixfM -----END PGP SIGNATURE----- --=_MailMate_399D2B93-4FB8-4736-9FAB-586EA5CE5549_=-- From owner-svn-src-head@freebsd.org Sun Feb 12 16:12:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6A08CDC0BF; Sun, 12 Feb 2017 16:12:37 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C6701A26; Sun, 12 Feb 2017 16:12:36 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id cwlJc10SBVQuxcwlKcxbA5; Sun, 12 Feb 2017 09:12:30 -0700 X-Authority-Analysis: v=2.2 cv=BNTDlBYG c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=n2v9WMKugxEA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=v4_F-3648YwVUwcGbGEA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id E4025A02; Sun, 12 Feb 2017 08:12:28 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v1CGCS29009649; Sun, 12 Feb 2017 08:12:28 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201702121612.v1CGCS29009649@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: =?UTF-8?Q?Ermal_Lu=c3=a7i?= cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313675 - in head/sys: netinet netinet6 In-Reply-To: Message from =?UTF-8?Q?Ermal_Lu=c3=a7i?= of "Sun, 12 Feb 2017 06:56:33 +0000." <201702120656.v1C6uXp1008956@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 12 Feb 2017 08:12:28 -0800 X-CMAE-Envelope: MS4wfAaxqX3s6o4Fzx6H8UsdN0goaLpKPFg3m++n8dA4QKqObOqs6XHAV7GmQJN//nEe6+vzHfbfEREpvNxHxjSJd6ZvmWA1Un9I9A17JfwE2FKpRtUUKtRf GpuIQWbLy2L/zdLJKTjunWH5tyKb5XBAb7mhZ0+rk1mQ54OSHyRLFzhzF4QQcyWx/2yj/YC3hcl97nsvD2VIifSbKeiBZlpgKTJ7/iGSpJi2VqlOg759BLCn FQEN5rme8PcoXx3sA6/guN7pOEBGcXbxZl5hQ8xrRRUTGMUEf21L6sQgdLUGhU/I X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 16:12:37 -0000 In message <201702120656.v1C6uXp1008956@repo.freebsd.org>, =?UTF-8?Q?Ermal_Lu=c 3=a7i?= writes: > Author: eri > Date: Sun Feb 12 06:56:33 2017 > New Revision: 313675 > URL: https://svnweb.freebsd.org/changeset/base/313675 > > Log: > Committed without approval from mentor. This commit log message is objectionable and totally inappropriate. Revision numbers please? Providing the revision numbers after the fact doesn't completely address my objection to the incompleteness of this commit log message because the commit log is now incomplete for all posterity. The revision numbers are missing from the commit log and anyone going through the history of the affected sources (I do that a lot) has no clue, except to try to piece together what was backed out and search for replies to commit email to provide a complete picture of what was done. Vital information is missing from the commit log. Searching for answers to these questions is time consuming and incomplete documentation is inconsiderate and disrespectful of those who follow on figure out what and why. Looking up mentor/mentee relationships, one can safely assume that your mentor requested the backout. This too should have been documented in the commit log message, e.g. "(mentor)". At the very least revision numbers should be documented in a follow up eamil. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sun Feb 12 16:24:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27A87CDC438; Sun, 12 Feb 2017 16:24:36 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C6277106E; Sun, 12 Feb 2017 16:24:35 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id cwwtc13huVQuxcwwucxclj; Sun, 12 Feb 2017 09:24:29 -0700 X-Authority-Analysis: v=2.2 cv=BNTDlBYG c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=n2v9WMKugxEA:10 a=bwMe9klDAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=RZfAgueiB8sD2i_sQvcA:9 a=CjuIK1q_8ugA:10 a=JhGllAdGin1EU15OQ7Be:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 533FDA20; Sun, 12 Feb 2017 08:24:27 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v1CGOQGr009733; Sun, 12 Feb 2017 08:24:26 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201702121624.v1CGOQGr009733@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: "George Neville-Neil" cc: "Glen Barber" , "Ermal =?utf-8?q?Lu=C3=A7i?=" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313675 - in head/sys: netinet netinet6 In-Reply-To: Message from "George Neville-Neil" of "Sun, 12 Feb 2017 10:41:58 -0500." <53D3A92C-6C64-4C0C-A5E6-B659BFA139BF@neville-neil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 12 Feb 2017 08:24:26 -0800 X-CMAE-Envelope: MS4wfEl+ruQT3f5zZpwgsnC5faR2Xps9umD6cnHtOKH0yZRhluWo5xsNTrgUm5JnPZi1yeCTEus4nbh4kRg4EEmExEnjvq7HsB9uk5ngONjYzgLnGhueF1tz TOC7g1WRGtNgd5LbvfIoFbJuMru1RML/6S1sH96lfk0Pcx0VfTQ4XZMBNwK6j5jkeJmYHAaePXkq3nSE6hWyoh+k4jHAfm8Tlo3mQcoVZje47C57LpoBPiXz N41JanCtCRfhO2tjOv2EtKAXTj4hfe16shzdGgai4cYjmwFQ+t1dL3g8SmMNl/qDvaWrr2+QPpEZ+hR85ZM4f4Cs/cYpesBt9XyV5ItiGYg= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 16:24:36 -0000 In message <53D3A92C-6C64-4C0C-A5E6-B659BFA139BF@neville-neil.com>, "George Nev ille-Neil" writes: > This is an OpenPGP/MIME signed message (RFC 3156 and 4880). > > --=_MailMate_399D2B93-4FB8-4736-9FAB-586EA5CE5549_= > Content-Type: text/plain; charset=utf-8; markup=markdown > Content-Transfer-Encoding: quoted-printable > > > > On 12 Feb 2017, at 6:10, Glen Barber wrote: > > > On Sun, Feb 12, 2017 at 06:56:33AM +0000, Ermal Lu=C3=A7i wrote: > >> Author: eri > >> Date: Sun Feb 12 06:56:33 2017 > >> New Revision: 313675 > >> URL: https://svnweb.freebsd.org/changeset/base/313675 > >> > >> Log: > >> Committed without approval from mentor. > >> > >> Reported by: gnn > >> > > > > What exactly does this mean? > > > > Ermal took the Acceptance on reviews.freebsd.org by Adrian as an implicit= > "go ahead" to commit to the tree. The issue is that he's still under me= > ntorship, by me, and had not gotten an approval or had an Approved by: li= > ne. I asked him to revert the change himself. > > We're working out a few more issues in the review now. I didn't read this when I hit send on my email. Hopefully nobody takes offense. I was upset and still am. I still think that the revision numbers of any backout should have been documented in the commit log. Something we could do, as is expected by re@ for commits during a freeze, is metees also let their mentors know of what the contents of commit log messages will be. I think commit log messages discussing the what, why and rationale are as important as the code itself. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sun Feb 12 18:33:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5529CCDC835; Sun, 12 Feb 2017 18:33:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 173D11DF8; Sun, 12 Feb 2017 18:33:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id C75263E8B; Sun, 12 Feb 2017 18:33:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Sun, 12 Feb 2017 18:33:27 +0000 From: Glen Barber To: Cy Schubert Cc: George Neville-Neil , Ermal =?iso-8859-1?Q?Lu=E7i?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313675 - in head/sys: netinet netinet6 Message-ID: <20170212183327.GA2002@FreeBSD.org> References: <53D3A92C-6C64-4C0C-A5E6-B659BFA139BF@neville-neil.com> <201702121624.v1CGOQGr009733@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline In-Reply-To: <201702121624.v1CGOQGr009733@slippy.cwsent.com> X-Operating-System: FreeBSD 11.0-STABLE amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer X-Spidey-Sense: Uh oh, Peter logged in User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 18:33:33 -0000 --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 12, 2017 at 08:24:26AM -0800, Cy Schubert wrote: > In message <53D3A92C-6C64-4C0C-A5E6-B659BFA139BF@neville-neil.com>, "Geor= ge Neville-Neil" writes: > > This is an OpenPGP/MIME signed message (RFC 3156 and 4880). > > On 12 Feb 2017, at 6:10, Glen Barber wrote: > > > On Sun, Feb 12, 2017 at 06:56:33AM +0000, Ermal Lu=3DC3=3DA7i wrote: > > >> Author: eri > > >> Date: Sun Feb 12 06:56:33 2017 > > >> New Revision: 313675 > > >> URL: https://svnweb.freebsd.org/changeset/base/313675 > > >> > > >> Log: > > >> Committed without approval from mentor. > > >> > > >> Reported by: gnn > > >> > > > > > > What exactly does this mean? > > > > >=20 > > Ermal took the Acceptance on reviews.freebsd.org by Adrian as an implic= it > > "go ahead" to commit to the tree. The issue is that he's still under > > mentorship, by me, and had not gotten an approval or had an Approved by: > > line. I asked him to revert the change himself. > >=20 > > We're working out a few more issues in the review now. >=20 > I didn't read this when I hit send on my email. Hopefully nobody takes=20 > offense. I was upset and still am. >=20 > I still think that the revision numbers of any backout should have been= =20 > documented in the commit log. >=20 I absolutely agree, and was the key meaning behind my "what exactly does this mean?" reply. The commit log, as-is, provides nothing useful to the reader. > Something we could do, as is expected by re@ for commits during a freeze,= =20 > is metees also let their mentors know of what the contents of commit log= =20 > messages will be. I think commit log messages discussing the what, why an= d=20 > rationale are as important as the code itself. >=20 I thought this was standard practice. But if not, I would agree that both code changes and the commit log should be both approved by the mentor. Just my $0.02 USD. Glen --GvXjxJ+pjyke8COw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYoKp3AAoJEAMUWKVHj+KT3r4QAIdk1B4dmyWp3GzCMPCA4FE6 3U/ZXHb/lh8TublcxTQNmDwp4qejb7BbKcJh8cxSGZTfDnpMfLOzwuGIAQlcx2+/ Vu3vEbrOILjFTHyIZqgdCJNVVffvm6C74SZwejkB4IoFZtvF95uKO2NFzysdQekA FMFshSxtBTU0R5gjfk3TaXy7xalk5ySiGkCHZMTmpbRjtlUHn7qTAxPUWIKgTH0l YreV1Pjke0xybfd2w3zKNmVJ8MNOzeuCvx1vVgjtaEEexxi5AEY764vZ8CXae8qg CFNKX0UO4FzBs5hxxt3wWe04jcAKwRx6cgJ467GPO65gkOZdu8dnKWDODuYaEqrp hKqhYQUK4I9YI5i8wW3bqaSTU3kGYQxUqlHT3tbd5HvKTUOIVnCGCl9yZ3mpOg3d gDnmoNq8AnsxE24IgRmbcjQEUeST1RKPG8J9qOtIpU0P4oOJMBC+vh5YkqQG9tMi PaXNDYSA2PQY/FBmYyalTMPQLDPmNIjjAEwBqukDxyMMPUvvuHgHaLZLIQO4wlAR 3/nfjyb6xLxJsG12yD8kQVmGYC8v5c2RczqTeGneDm30MCKzCqxKHslabjLOdlzm pC5q30seZrYgUX2jL+hdqV3I/473FbaQBMkiVSG2B6pwjI/hP4GIxq+GGvTiZH6T 13ey0qQbFK6N8NqeaxyM =gnIr -----END PGP SIGNATURE----- --GvXjxJ+pjyke8COw-- From owner-svn-src-head@freebsd.org Sun Feb 12 19:41:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D24FCCDCA83; Sun, 12 Feb 2017 19:41:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87A871DBE; Sun, 12 Feb 2017 19:41:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1CJexnS020503; Sun, 12 Feb 2017 19:40:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1CJex2v020501; Sun, 12 Feb 2017 19:40:59 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702121940.v1CJex2v020501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 12 Feb 2017 19:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313686 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 19:41:00 -0000 Author: avg Date: Sun Feb 12 19:40:59 2017 New Revision: 313686 URL: https://svnweb.freebsd.org/changeset/base/313686 Log: check remaining space in zfs implementations of vptocnp PR: 216939 Submitted by: Iouri V. Ivliev MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sun Feb 12 18:52:01 2017 (r313685) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sun Feb 12 19:40:59 2017 (r313686) @@ -1604,16 +1604,21 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc } if (sep == NULL) { mutex_exit(&sdp->sd_lock); - error = ENOENT; + error = SET_ERROR(ENOENT); } else { size_t len; len = strlen(sep->se_name); - *ap->a_buflen -= len; - bcopy(sep->se_name, ap->a_buf + *ap->a_buflen, len); - mutex_exit(&sdp->sd_lock); - vref(dvp); - *ap->a_vpp = dvp; + if (*ap->a_buflen < len) { + mutex_exit(&sdp->sd_lock); + error = SET_ERROR(ENOMEM); + } else { + *ap->a_buflen -= len; + bcopy(sep->se_name, ap->a_buf + *ap->a_buflen, len); + mutex_exit(&sdp->sd_lock); + vref(dvp); + *ap->a_vpp = dvp; + } } VN_RELE(dvp); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Feb 12 18:52:01 2017 (r313685) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Feb 12 19:40:59 2017 (r313686) @@ -5939,6 +5939,10 @@ zfs_vptocnp(struct vop_vptocnp_args *ap) error = zfs_znode_parent_and_name(zp, &dzp, name); if (error == 0) { len = strlen(name); + if (*ap->a_buflen < len) + error = SET_ERROR(ENOMEM); + } + if (error == 0) { *ap->a_buflen -= len; bcopy(name, ap->a_buf + *ap->a_buflen, len); *ap->a_vpp = ZTOV(dzp); From owner-svn-src-head@freebsd.org Sun Feb 12 19:45:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DF18CDCDA8; Sun, 12 Feb 2017 19:45:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AD95127C; Sun, 12 Feb 2017 19:45:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1CJjUf9024636; Sun, 12 Feb 2017 19:45:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1CJjUbw024635; Sun, 12 Feb 2017 19:45:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702121945.v1CJjUbw024635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 12 Feb 2017 19:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313687 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 19:45:31 -0000 Author: avg Date: Sun Feb 12 19:45:30 2017 New Revision: 313687 URL: https://svnweb.freebsd.org/changeset/base/313687 Log: remove l2_padding_needed statistic from zfs arc It became obsolete when the Compressed ARC support was committed. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Feb 12 19:40:59 2017 (r313686) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Feb 12 19:45:30 2017 (r313687) @@ -711,7 +711,6 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_size; kstat_named_t arcstat_l2_asize; kstat_named_t arcstat_l2_hdr_size; - kstat_named_t arcstat_l2_padding_needed; kstat_named_t arcstat_l2_write_trylock_fail; kstat_named_t arcstat_l2_write_passed_headroom; kstat_named_t arcstat_l2_write_spa_mismatch; @@ -809,7 +808,6 @@ static arc_stats_t arc_stats = { { "l2_size", KSTAT_DATA_UINT64 }, { "l2_asize", KSTAT_DATA_UINT64 }, { "l2_hdr_size", KSTAT_DATA_UINT64 }, - { "l2_padding_needed", KSTAT_DATA_UINT64 }, { "l2_write_trylock_fail", KSTAT_DATA_UINT64 }, { "l2_write_passed_headroom", KSTAT_DATA_UINT64 }, { "l2_write_spa_mismatch", KSTAT_DATA_UINT64 }, From owner-svn-src-head@freebsd.org Sun Feb 12 20:54:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC268CDC186; Sun, 12 Feb 2017 20:54:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 793851534; Sun, 12 Feb 2017 20:54:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1CKsVjt053582; Sun, 12 Feb 2017 20:54:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1CKsVXK053581; Sun, 12 Feb 2017 20:54:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702122054.v1CKsVXK053581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 12 Feb 2017 20:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313688 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 20:54:32 -0000 Author: kib Date: Sun Feb 12 20:54:31 2017 New Revision: 313688 URL: https://svnweb.freebsd.org/changeset/base/313688 Log: Switch copyout_map() to use vm_mmap_object() instead of vm_mmap(). This is both a microoptimization and a move of the consumer to more commonly used vm function. Suggested and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/subr_uio.c Modified: head/sys/kern/subr_uio.c ============================================================================== --- head/sys/kern/subr_uio.c Sun Feb 12 19:45:30 2017 (r313687) +++ head/sys/kern/subr_uio.c Sun Feb 12 20:54:31 2017 (r313688) @@ -468,10 +468,11 @@ copyout_map(struct thread *td, vm_offset /* round size up to page boundary */ size = (vm_size_t)round_page(sz); - - error = vm_mmap(&vms->vm_map, addr, size, VM_PROT_READ | VM_PROT_WRITE, - VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, OBJT_DEFAULT, NULL, 0); - + if (size == 0) + return (EINVAL); + error = vm_mmap_object(&vms->vm_map, addr, size, VM_PROT_READ | + VM_PROT_WRITE, VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, NULL, 0, + FALSE, td); return (error); } From owner-svn-src-head@freebsd.org Sun Feb 12 21:05:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F315CCDCA38; Sun, 12 Feb 2017 21:05:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B233213B7; Sun, 12 Feb 2017 21:05:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1CL5i6B057662; Sun, 12 Feb 2017 21:05:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1CL5iV4057656; Sun, 12 Feb 2017 21:05:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702122105.v1CL5iV4057656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 12 Feb 2017 21:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313690 - in head: lib/libc/sys sys/kern 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 21:05:46 -0000 Author: kib Date: Sun Feb 12 21:05:44 2017 New Revision: 313690 URL: https://svnweb.freebsd.org/changeset/base/313690 Log: Consistently handle negative or wrapping offsets in the mmap(2) syscalls. For regular files and posix shared memory, POSIX requires that [offset, offset + size) range is legitimate. At the maping time, check that offset is not negative. Allowing negative offsets might expose the data that filesystem put into vm_object for internal use, esp. due to OFF_TO_IDX() signess treatment. Fault handler verifies that the mapped range is valid, assuming that mmap(2) checked that arithmetic gives no undefined results. For device mappings, leave the semantic of negative offsets to the driver. Correct object page index calculation to not erronously propagate sign. In either case, disallow overflow of offset + size. Update mmap(2) man page to explain the requirement of the range validity, and behaviour when the range becomes invalid after mapping. Reported and tested by: royger (previous version) Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/lib/libc/sys/mmap.2 head/sys/kern/uipc_shm.c head/sys/kern/vfs_vnops.c head/sys/vm/device_pager.c head/sys/vm/sg_pager.c head/sys/vm/vm_object.h Modified: head/lib/libc/sys/mmap.2 ============================================================================== --- head/lib/libc/sys/mmap.2 Sun Feb 12 21:00:12 2017 (r313689) +++ head/lib/libc/sys/mmap.2 Sun Feb 12 21:05:44 2017 (r313690) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd November 25, 2016 +.Dd February 4, 2017 .Dt MMAP 2 .Os .Sh NAME @@ -53,11 +53,37 @@ starting at byte offset .Fa offset . If .Fa len -is not a multiple of the pagesize, the mapped region may extend past the +is not a multiple of the page size, the mapped region may extend past the specified range. Any such extension beyond the end of the mapped object will be zero-filled. .Pp If +.Fa fd +references a regular file or a shared memory object, the range of +bytes starting at +.Fa offset +and continuing for +.Fa len +bytes must be legitimate for the possible (not necessarily +current) offsets in the object. +In particular, the +.Fa offset +value cannot be negative. +If the object is truncated and the process later accesses a pages that +is wholly within the truncated region, the access is aborted and a +.Dv SIGBUS +signal is delivered to the process. +.Pp +If +.Fa fd +references a device file, the interpretation of the +.Fa offset +value is device specific and defined by the device driver. +The virtual memory subsystem does not impose any restrictitions on the +.Fa offset +value in this case, passing it unchanged to the driver. +.Pp +If .Fa addr is non-zero, it is used as a hint to the system. (As a convenience to the system, the actual address of the region may differ @@ -157,7 +183,7 @@ If .Dv MAP_FIXED is specified, .Fa addr -must be a multiple of the pagesize. +must be a multiple of the page size. If .Dv MAP_EXCL is not specified, a successful @@ -361,6 +387,12 @@ The argument is not a valid open file descriptor. .It Bq Er EINVAL +An invalid (negative) value was passed in the +.Fa offset +argument, when +.Fa fd +referenced a regular file or shared memory. +.It Bq Er EINVAL An invalid value was passed in the .Fa prot argument. Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Sun Feb 12 21:00:12 2017 (r313689) +++ head/sys/kern/uipc_shm.c Sun Feb 12 21:05:44 2017 (r313690) @@ -891,20 +891,20 @@ shm_mmap(struct file *fp, vm_map_t map, return (EACCES); maxprot &= cap_maxprot; + /* See comment in vn_mmap(). */ + if ( +#ifdef _LP64 + objsize > OFF_MAX || +#endif + foff < 0 || foff > OFF_MAX - objsize) + return (EINVAL); + #ifdef MAC error = mac_posixshm_check_mmap(td->td_ucred, shmfd, prot, flags); if (error != 0) return (error); #endif - /* - * XXXRW: This validation is probably insufficient, and subject to - * sign errors. It should be fixed. - */ - if (foff >= shmfd->shm_size || - foff + objsize > round_page(shmfd->shm_size)) - return (EINVAL); - mtx_lock(&shm_timestamp_lock); vfs_timestamp(&shmfd->shm_atime); mtx_unlock(&shm_timestamp_lock); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sun Feb 12 21:00:12 2017 (r313689) +++ head/sys/kern/vfs_vnops.c Sun Feb 12 21:05:44 2017 (r313690) @@ -2455,6 +2455,24 @@ vn_mmap(struct file *fp, vm_map_t map, v } maxprot &= cap_maxprot; + /* + * For regular files and shared memory, POSIX requires that + * the value of foff be a legitimate offset within the data + * object. In particular, negative offsets are invalid. + * Blocking negative offsets and overflows here avoids + * possible wraparound or user-level access into reserved + * ranges of the data object later. In contrast, POSIX does + * not dictate how offsets are used by device drivers, so in + * the case of a device mapping a negative offset is passed + * on. + */ + if ( +#ifdef _LP64 + size > OFF_MAX || +#endif + foff < 0 || foff > OFF_MAX - size) + return (EINVAL); + writecounted = FALSE; error = vm_mmap_vnode(td, size, prot, &maxprot, &flags, vp, &foff, &object, &writecounted); Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Sun Feb 12 21:00:12 2017 (r313689) +++ head/sys/vm/device_pager.c Sun Feb 12 21:05:44 2017 (r313690) @@ -139,8 +139,18 @@ cdev_pager_allocate(void *handle, enum o if (foff & PAGE_MASK) return (NULL); + /* + * Treat the mmap(2) file offset as an unsigned value for a + * device mapping. This, in effect, allows a user to pass all + * possible off_t values as the mapping cookie to the driver. At + * this point, we know that both foff and size are a multiple + * of the page size. Do a check to avoid wrap. + */ size = round_page(size); - pindex = OFF_TO_IDX(foff + size); + pindex = UOFF_TO_IDX(foff) + UOFF_TO_IDX(size); + if (pindex > OBJ_MAX_SIZE || pindex < UOFF_TO_IDX(foff) || + pindex < UOFF_TO_IDX(size)) + return (NULL); if (ops->cdev_pg_ctor(handle, size, prot, foff, cred, &color) != 0) return (NULL); Modified: head/sys/vm/sg_pager.c ============================================================================== --- head/sys/vm/sg_pager.c Sun Feb 12 21:00:12 2017 (r313689) +++ head/sys/vm/sg_pager.c Sun Feb 12 21:05:44 2017 (r313690) @@ -96,8 +96,9 @@ sg_pager_alloc(void *handle, vm_ooffset_ * to map beyond that. */ size = round_page(size); - pindex = OFF_TO_IDX(foff + size); - if (pindex > npages) + pindex = UOFF_TO_IDX(foff) + UOFF_TO_IDX(size); + if (pindex > npages || pindex < UOFF_TO_IDX(foff) || + pindex < UOFF_TO_IDX(size)) return (NULL); /* Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Sun Feb 12 21:00:12 2017 (r313689) +++ head/sys/vm/vm_object.h Sun Feb 12 21:05:44 2017 (r313690) @@ -183,8 +183,23 @@ struct vm_object { #define OBJ_DISCONNECTWNT 0x4000 /* disconnect from vnode wanted */ #define OBJ_TMPFS 0x8000 /* has tmpfs vnode allocated */ +/* + * Helpers to perform conversion between vm_object page indexes and offsets. + * IDX_TO_OFF() converts an index into an offset. + * OFF_TO_IDX() converts an offset into an index. Since offsets are signed + * by default, the sign propagation in OFF_TO_IDX(), when applied to + * negative offsets, is intentional and returns a vm_object page index + * that cannot be created by a userspace mapping. + * UOFF_TO_IDX() treats the offset as an unsigned value and converts it + * into an index accordingly. Use it only when the full range of offset + * values are allowed. Currently, this only applies to device mappings. + * OBJ_MAX_SIZE specifies the maximum page index corresponding to the + * maximum unsigned offset. + */ #define IDX_TO_OFF(idx) (((vm_ooffset_t)(idx)) << PAGE_SHIFT) #define OFF_TO_IDX(off) ((vm_pindex_t)(((vm_ooffset_t)(off)) >> PAGE_SHIFT)) +#define UOFF_TO_IDX(off) (((vm_pindex_t)(off)) >> PAGE_SHIFT) +#define OBJ_MAX_SIZE (UOFF_TO_IDX(UINT64_MAX) + 1) #ifdef _KERNEL From owner-svn-src-head@freebsd.org Sun Feb 12 23:06:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0757CDCE11; Sun, 12 Feb 2017 23:06:42 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 723C11A44; Sun, 12 Feb 2017 23:06:42 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1CN6fHh006949; Sun, 12 Feb 2017 23:06:41 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1CN6fvB006948; Sun, 12 Feb 2017 23:06:41 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201702122306.v1CN6fvB006948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sun, 12 Feb 2017 23:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313691 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2017 23:06:42 -0000 Author: sbruno Date: Sun Feb 12 23:06:41 2017 New Revision: 313691 URL: https://svnweb.freebsd.org/changeset/base/313691 Log: Only trigger em_local_timer on queue index 0. This was causing continuous em_local_timer() executions during normal operation and was very likely to cause a lock up on igb(4) devices. Submitted by: Matt Macy (mmacy@nextbsd.org) Reported by: jtl Reviewed by: gallatin Sponsored by: Limelight Networks & Netflix Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Sun Feb 12 21:05:44 2017 (r313690) +++ head/sys/dev/e1000/if_em.c Sun Feb 12 23:06:41 2017 (r313691) @@ -1625,6 +1625,11 @@ em_if_timer(if_ctx_t ctx, uint16_t qid) int i; int trigger = 0; + if (qid != 0) { + /* XXX all this stuff is per-adapter */ + return; + } + em_if_update_admin_status(ctx); em_update_stats_counters(adapter); From owner-svn-src-head@freebsd.org Mon Feb 13 00:39:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56D8FCD9663; Mon, 13 Feb 2017 00:39:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26859F58; Mon, 13 Feb 2017 00:39:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1D0dhdZ043948; Mon, 13 Feb 2017 00:39:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1D0dhMn043947; Mon, 13 Feb 2017 00:39:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702130039.v1D0dhMn043947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 13 Feb 2017 00:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313692 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 00:39:44 -0000 Author: kib Date: Mon Feb 13 00:39:43 2017 New Revision: 313692 URL: https://svnweb.freebsd.org/changeset/base/313692 Log: Style: wrap long line. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Feb 12 23:06:41 2017 (r313691) +++ head/sys/compat/freebsd32/freebsd32_misc.c Mon Feb 13 00:39:43 2017 (r313692) @@ -477,7 +477,8 @@ freebsd32_mmap(struct thread *td, struct #ifdef COMPAT_FREEBSD6 int -freebsd6_freebsd32_mmap(struct thread *td, struct freebsd6_freebsd32_mmap_args *uap) +freebsd6_freebsd32_mmap(struct thread *td, + struct freebsd6_freebsd32_mmap_args *uap) { struct freebsd32_mmap_args ap; From owner-svn-src-head@freebsd.org Mon Feb 13 00:40:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3E6CCD985E; Mon, 13 Feb 2017 00:40:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC0821121; Mon, 13 Feb 2017 00:40:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1D0etlI044785; Mon, 13 Feb 2017 00:40:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1D0etba044784; Mon, 13 Feb 2017 00:40:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702130040.v1D0etba044784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 13 Feb 2017 00:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313693 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 00:40:57 -0000 Author: kib Date: Mon Feb 13 00:40:55 2017 New Revision: 313693 URL: https://svnweb.freebsd.org/changeset/base/313693 Log: Remove MPSAFE and ARGUSED annotations, ANSI-fy syscall handlers. Discussed with: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Feb 13 00:39:43 2017 (r313692) +++ head/sys/vm/vm_mmap.c Mon Feb 13 00:40:55 2017 (r313693) @@ -107,14 +107,8 @@ struct sbrk_args { }; #endif -/* - * MPSAFE - */ -/* ARGSUSED */ int -sys_sbrk(td, uap) - struct thread *td; - struct sbrk_args *uap; +sys_sbrk(struct thread *td, struct sbrk_args *uap) { /* Not yet implemented */ return (EOPNOTSUPP); @@ -126,14 +120,8 @@ struct sstk_args { }; #endif -/* - * MPSAFE - */ -/* ARGSUSED */ int -sys_sstk(td, uap) - struct thread *td; - struct sstk_args *uap; +sys_sstk(struct thread *td, struct sstk_args *uap) { /* Not yet implemented */ return (EOPNOTSUPP); @@ -147,11 +135,9 @@ struct getpagesize_args { #endif int -ogetpagesize(td, uap) - struct thread *td; - struct getpagesize_args *uap; +ogetpagesize(struct thread *td, struct getpagesize_args *uap) { - /* MP SAFE */ + td->td_retval[0] = PAGE_SIZE; return (0); } @@ -183,9 +169,6 @@ struct mmap_args { }; #endif -/* - * MPSAFE - */ int sys_mmap(struct thread *td, struct mmap_args *uap) { @@ -448,9 +431,6 @@ struct msync_args { int flags; }; #endif -/* - * MPSAFE - */ int sys_msync(struct thread *td, struct msync_args *uap) { @@ -503,9 +483,6 @@ struct munmap_args { size_t len; }; #endif -/* - * MPSAFE - */ int sys_munmap(struct thread *td, struct munmap_args *uap) { @@ -588,9 +565,6 @@ struct mprotect_args { int prot; }; #endif -/* - * MPSAFE - */ int sys_mprotect(struct thread *td, struct mprotect_args *uap) { @@ -632,13 +606,8 @@ struct minherit_args { int inherit; }; #endif -/* - * MPSAFE - */ int -sys_minherit(td, uap) - struct thread *td; - struct minherit_args *uap; +sys_minherit(struct thread *td, struct minherit_args *uap) { vm_offset_t addr; vm_size_t size, pageoff; @@ -673,13 +642,8 @@ struct madvise_args { }; #endif -/* - * MPSAFE - */ int -sys_madvise(td, uap) - struct thread *td; - struct madvise_args *uap; +sys_madvise(struct thread *td, struct madvise_args *uap) { return (kern_vm_madvise(td, (vm_offset_t)uap->addr, uap->len, @@ -738,13 +702,8 @@ struct mincore_args { }; #endif -/* - * MPSAFE - */ int -sys_mincore(td, uap) - struct thread *td; - struct mincore_args *uap; +sys_mincore(struct thread *td, struct mincore_args *uap) { vm_offset_t addr, first_addr; vm_offset_t end, cend; @@ -994,13 +953,8 @@ struct mlock_args { size_t len; }; #endif -/* - * MPSAFE - */ int -sys_mlock(td, uap) - struct thread *td; - struct mlock_args *uap; +sys_mlock(struct thread *td, struct mlock_args *uap) { return (vm_mlock(td->td_proc, td->td_ucred, uap->addr, uap->len)); @@ -1066,13 +1020,8 @@ struct mlockall_args { }; #endif -/* - * MPSAFE - */ int -sys_mlockall(td, uap) - struct thread *td; - struct mlockall_args *uap; +sys_mlockall(struct thread *td, struct mlockall_args *uap) { vm_map_t map; int error; @@ -1143,13 +1092,8 @@ struct munlockall_args { }; #endif -/* - * MPSAFE - */ int -sys_munlockall(td, uap) - struct thread *td; - struct munlockall_args *uap; +sys_munlockall(struct thread *td, struct munlockall_args *uap) { vm_map_t map; int error; @@ -1184,9 +1128,6 @@ struct munlock_args { size_t len; }; #endif -/* - * MPSAFE - */ int sys_munlock(struct thread *td, struct munlock_args *uap) { @@ -1340,8 +1281,6 @@ done: /* * vm_mmap_cdev() * - * MPSAFE - * * Helper function for vm_mmap. Perform sanity check specific for mmap * operations on cdevs. */ From owner-svn-src-head@freebsd.org Mon Feb 13 02:15:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7C8CCDBB77; Mon, 13 Feb 2017 02:15:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9264F150B; Mon, 13 Feb 2017 02:15:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1D2FujJ084685; Mon, 13 Feb 2017 02:15:56 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1D2Fujl084684; Mon, 13 Feb 2017 02:15:56 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201702130215.v1D2Fujl084684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 13 Feb 2017 02:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313694 - head/sys/dev/iwi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 02:15:57 -0000 Author: avos Date: Mon Feb 13 02:15:56 2017 New Revision: 313694 URL: https://svnweb.freebsd.org/changeset/base/313694 Log: iwi: add 12-14 2GHz channels into channel list. Return full channel list via iwi_getradiocaps() method (ieee80211_init_channels() was replaced with iwi_getradiocaps() to be consistent with other drivers). PR: 216923 Submitted and tested by: ds@ukrhub.net (original patch) MFC after: 5 days Modified: head/sys/dev/iwi/if_iwi.c Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Mon Feb 13 00:40:55 2017 (r313693) +++ head/sys/dev/iwi/if_iwi.c Mon Feb 13 02:15:56 2017 (r313694) @@ -130,6 +130,15 @@ static const struct iwi_ident iwi_ident_ { 0, 0, NULL } }; +static const uint8_t def_chan_2ghz[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; +static const uint8_t def_chan_5ghz_band1[] = + { 36, 40, 44, 48, 52, 56, 60, 64 }; +static const uint8_t def_chan_5ghz_band2[] = + { 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140 }; +static const uint8_t def_chan_5ghz_band3[] = + { 149, 153, 157, 161, 165 }; + static struct ieee80211vap *iwi_vap_create(struct ieee80211com *, const char [IFNAMSIZ], int, enum ieee80211_opmode, int, const uint8_t [IEEE80211_ADDR_LEN], @@ -204,6 +213,9 @@ static void iwi_radio_off(void *, int); static void iwi_sysctlattach(struct iwi_softc *); static void iwi_led_event(struct iwi_softc *, int); static void iwi_ledattach(struct iwi_softc *); +static void iwi_collect_bands(struct ieee80211com *, uint8_t [], size_t); +static void iwi_getradiocaps(struct ieee80211com *, int, int *, + struct ieee80211_channel []); static int iwi_probe(device_t); static int iwi_attach(device_t); @@ -271,7 +283,6 @@ iwi_attach(device_t dev) struct iwi_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint16_t val; - uint8_t bands[IEEE80211_MODE_BYTES]; int i, error; sc->sc_dev = dev; @@ -374,12 +385,8 @@ iwi_attach(device_t dev) ic->ic_macaddr[4] = val & 0xff; ic->ic_macaddr[5] = val >> 8; - memset(bands, 0, sizeof(bands)); - setbit(bands, IEEE80211_MODE_11B); - setbit(bands, IEEE80211_MODE_11G); - if (pci_get_device(dev) >= 0x4223) - setbit(bands, IEEE80211_MODE_11A); - ieee80211_init_channels(ic, NULL, bands); + iwi_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, + ic->ic_channels); ieee80211_ifattach(ic); /* override default methods */ @@ -399,6 +406,7 @@ iwi_attach(device_t dev) ic->ic_ioctl = iwi_ioctl; ic->ic_transmit = iwi_transmit; ic->ic_parent = iwi_parent; + ic->ic_getradiocaps = iwi_getradiocaps; ieee80211_radiotap_attach(ic, &sc->sc_txtap.wt_ihdr, sizeof(sc->sc_txtap), @@ -3569,3 +3577,40 @@ iwi_scan_end(struct ieee80211com *ic) iwi_cmd(sc, IWI_CMD_ABORT_SCAN, NULL, 0); IWI_UNLOCK(sc); } + +static void +iwi_collect_bands(struct ieee80211com *ic, uint8_t bands[], size_t bands_sz) +{ + struct iwi_softc *sc = ic->ic_softc; + device_t dev = sc->sc_dev; + + memset(bands, 0, bands_sz); + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + if (pci_get_device(dev) >= 0x4223) + setbit(bands, IEEE80211_MODE_11A); +} + +static void +iwi_getradiocaps(struct ieee80211com *ic, + int maxchans, int *nchans, struct ieee80211_channel chans[]) +{ + uint8_t bands[IEEE80211_MODE_BYTES]; + + iwi_collect_bands(ic, bands, sizeof(bands)); + *nchans = 0; + if (isset(bands, IEEE80211_MODE_11B) || isset(bands, IEEE80211_MODE_11G)) + ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + def_chan_2ghz, nitems(def_chan_2ghz), bands, 0); + if (isset(bands, IEEE80211_MODE_11A)) { + ieee80211_add_channel_list_5ghz(chans, maxchans, nchans, + def_chan_5ghz_band1, nitems(def_chan_5ghz_band1), + bands, 0); + ieee80211_add_channel_list_5ghz(chans, maxchans, nchans, + def_chan_5ghz_band2, nitems(def_chan_5ghz_band2), + bands, 0); + ieee80211_add_channel_list_5ghz(chans, maxchans, nchans, + def_chan_5ghz_band3, nitems(def_chan_5ghz_band3), + bands, 0); + } +} From owner-svn-src-head@freebsd.org Mon Feb 13 08:23:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD95FCDC6E7; Mon, 13 Feb 2017 08:23:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C7F919A3; Mon, 13 Feb 2017 08:23:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1D8Necm036014; Mon, 13 Feb 2017 08:23:40 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1D8NdN1036002; Mon, 13 Feb 2017 08:23:39 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201702130823.v1D8NdN1036002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 13 Feb 2017 08:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313695 - in head: contrib/libpcap contrib/libpcap/bpf/net contrib/libpcap/config contrib/libpcap/lbl contrib/libpcap/missing contrib/libpcap/pcap contrib/libpcap/tests lib/libpcap sbin... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 08:23:42 -0000 Author: delphij Date: Mon Feb 13 08:23:39 2017 New Revision: 313695 URL: https://svnweb.freebsd.org/changeset/base/313695 Log: MFV r313676: libpcap 1.8.1 MFC after: 1 month Added: head/contrib/libpcap/config/ - copied from r313676, vendor/libpcap/dist/config/ head/contrib/libpcap/configure.ac - copied unchanged from r313676, vendor/libpcap/dist/configure.ac head/contrib/libpcap/extract.h - copied unchanged from r313676, vendor/libpcap/dist/extract.h head/contrib/libpcap/fad-helpers.c - copied unchanged from r313676, vendor/libpcap/dist/fad-helpers.c head/contrib/libpcap/gen_version_c.sh - copied unchanged from r313676, vendor/libpcap/dist/gen_version_c.sh head/contrib/libpcap/gen_version_header.sh - copied unchanged from r313676, vendor/libpcap/dist/gen_version_header.sh head/contrib/libpcap/lbl/os-aix7.h - copied unchanged from r313676, vendor/libpcap/dist/lbl/os-aix7.h head/contrib/libpcap/missing/getopt.c - copied unchanged from r313676, vendor/libpcap/dist/missing/getopt.c head/contrib/libpcap/missing/getopt.h - copied unchanged from r313676, vendor/libpcap/dist/missing/getopt.h head/contrib/libpcap/missing/strtok_r.c - copied unchanged from r313676, vendor/libpcap/dist/missing/strtok_r.c head/contrib/libpcap/missing/win_snprintf.c - copied unchanged from r313676, vendor/libpcap/dist/missing/win_snprintf.c head/contrib/libpcap/nametoaddr.h - copied unchanged from r313676, vendor/libpcap/dist/nametoaddr.h head/contrib/libpcap/pcap-new.c - copied unchanged from r313676, vendor/libpcap/dist/pcap-new.c head/contrib/libpcap/pcap-rpcap.c - copied unchanged from r313676, vendor/libpcap/dist/pcap-rpcap.c head/contrib/libpcap/pcap-rpcap.h - copied unchanged from r313676, vendor/libpcap/dist/pcap-rpcap.h head/contrib/libpcap/pcap-tc.c - copied unchanged from r313676, vendor/libpcap/dist/pcap-tc.c head/contrib/libpcap/pcap-tc.h - copied unchanged from r313676, vendor/libpcap/dist/pcap-tc.h head/contrib/libpcap/pcap/can_socketcan.h - copied unchanged from r313676, vendor/libpcap/dist/pcap/can_socketcan.h head/contrib/libpcap/pcap/dlt.h - copied unchanged from r313676, vendor/libpcap/dist/pcap/dlt.h head/contrib/libpcap/pcap/export-defs.h - copied unchanged from r313676, vendor/libpcap/dist/pcap/export-defs.h head/contrib/libpcap/pcap_version.h.in - copied unchanged from r313676, vendor/libpcap/dist/pcap_version.h.in head/contrib/libpcap/portability.h - copied unchanged from r313676, vendor/libpcap/dist/portability.h head/contrib/libpcap/remote-ext.h - copied unchanged from r313676, vendor/libpcap/dist/remote-ext.h head/contrib/libpcap/sockutils.c - copied unchanged from r313676, vendor/libpcap/dist/sockutils.c head/contrib/libpcap/sockutils.h - copied unchanged from r313676, vendor/libpcap/dist/sockutils.h head/contrib/libpcap/tests/can_set_rfmon_test.c - copied unchanged from r313676, vendor/libpcap/dist/tests/can_set_rfmon_test.c head/sys/net/dlt.h - copied, changed from r313694, head/sys/net/bpf.h Deleted: head/contrib/libpcap/configure.in head/contrib/libpcap/fad-sita.c head/contrib/libpcap/pcap-can-linux.c head/contrib/libpcap/pcap-can-linux.h head/contrib/libpcap/pcap-canusb-linux.c head/contrib/libpcap/pcap-canusb-linux.h head/contrib/libpcap/runlex.sh Modified: head/contrib/libpcap/CHANGES head/contrib/libpcap/CREDITS head/contrib/libpcap/INSTALL.txt head/contrib/libpcap/LICENSE head/contrib/libpcap/Makefile-devel-adds head/contrib/libpcap/Makefile.in head/contrib/libpcap/README head/contrib/libpcap/TODO head/contrib/libpcap/VERSION head/contrib/libpcap/bpf/net/bpf_filter.c head/contrib/libpcap/bpf_dump.c head/contrib/libpcap/bpf_image.c head/contrib/libpcap/config.guess head/contrib/libpcap/config.h.in head/contrib/libpcap/config.sub head/contrib/libpcap/configure head/contrib/libpcap/dlpisubs.c head/contrib/libpcap/etherent.c head/contrib/libpcap/ethertype.h head/contrib/libpcap/fad-getad.c head/contrib/libpcap/fad-gifc.c head/contrib/libpcap/fad-glifc.c head/contrib/libpcap/gencode.c head/contrib/libpcap/gencode.h head/contrib/libpcap/grammar.y head/contrib/libpcap/inet.c head/contrib/libpcap/install-sh head/contrib/libpcap/lbl/os-osf4.h head/contrib/libpcap/lbl/os-osf5.h head/contrib/libpcap/lbl/os-solaris2.h head/contrib/libpcap/lbl/os-sunos4.h head/contrib/libpcap/lbl/os-ultrix4.h head/contrib/libpcap/missing/snprintf.c head/contrib/libpcap/mkdep head/contrib/libpcap/nametoaddr.c head/contrib/libpcap/optimize.c head/contrib/libpcap/pcap-bpf.c head/contrib/libpcap/pcap-bpf.h head/contrib/libpcap/pcap-bt-linux.c head/contrib/libpcap/pcap-bt-linux.h head/contrib/libpcap/pcap-bt-monitor-linux.c head/contrib/libpcap/pcap-common.c head/contrib/libpcap/pcap-config.1 head/contrib/libpcap/pcap-dag.c head/contrib/libpcap/pcap-dag.h head/contrib/libpcap/pcap-dbus.c head/contrib/libpcap/pcap-dlpi.c head/contrib/libpcap/pcap-dos.c head/contrib/libpcap/pcap-dos.h head/contrib/libpcap/pcap-filter.manmisc.in head/contrib/libpcap/pcap-int.h head/contrib/libpcap/pcap-libdlpi.c head/contrib/libpcap/pcap-linktype.manmisc.in head/contrib/libpcap/pcap-linux.c head/contrib/libpcap/pcap-netfilter-linux.c head/contrib/libpcap/pcap-netfilter-linux.h head/contrib/libpcap/pcap-nit.c head/contrib/libpcap/pcap-null.c head/contrib/libpcap/pcap-pf.c head/contrib/libpcap/pcap-savefile.manfile.in head/contrib/libpcap/pcap-septel.c head/contrib/libpcap/pcap-sita.c head/contrib/libpcap/pcap-snf.c head/contrib/libpcap/pcap-snit.c head/contrib/libpcap/pcap-snoop.c head/contrib/libpcap/pcap-stdinc.h head/contrib/libpcap/pcap-tstamp.manmisc.in head/contrib/libpcap/pcap-usb-linux.c head/contrib/libpcap/pcap-usb-linux.h head/contrib/libpcap/pcap-win32.c head/contrib/libpcap/pcap.3pcap.in head/contrib/libpcap/pcap.c head/contrib/libpcap/pcap/bluetooth.h head/contrib/libpcap/pcap/bpf.h head/contrib/libpcap/pcap/namedb.h head/contrib/libpcap/pcap/nflog.h head/contrib/libpcap/pcap/pcap.h head/contrib/libpcap/pcap/sll.h head/contrib/libpcap/pcap/usb.h head/contrib/libpcap/pcap_activate.3pcap head/contrib/libpcap/pcap_breakloop.3pcap head/contrib/libpcap/pcap_can_set_rfmon.3pcap head/contrib/libpcap/pcap_close.3pcap head/contrib/libpcap/pcap_compile.3pcap.in head/contrib/libpcap/pcap_create.3pcap head/contrib/libpcap/pcap_datalink.3pcap.in head/contrib/libpcap/pcap_datalink_name_to_val.3pcap head/contrib/libpcap/pcap_datalink_val_to_name.3pcap head/contrib/libpcap/pcap_dump.3pcap head/contrib/libpcap/pcap_dump_close.3pcap head/contrib/libpcap/pcap_dump_file.3pcap head/contrib/libpcap/pcap_dump_flush.3pcap head/contrib/libpcap/pcap_dump_ftell.3pcap head/contrib/libpcap/pcap_dump_open.3pcap.in head/contrib/libpcap/pcap_file.3pcap head/contrib/libpcap/pcap_fileno.3pcap head/contrib/libpcap/pcap_findalldevs.3pcap head/contrib/libpcap/pcap_freecode.3pcap head/contrib/libpcap/pcap_get_selectable_fd.3pcap head/contrib/libpcap/pcap_get_tstamp_precision.3pcap.in head/contrib/libpcap/pcap_geterr.3pcap head/contrib/libpcap/pcap_inject.3pcap head/contrib/libpcap/pcap_is_swapped.3pcap head/contrib/libpcap/pcap_lib_version.3pcap head/contrib/libpcap/pcap_list_datalinks.3pcap.in head/contrib/libpcap/pcap_list_tstamp_types.3pcap.in head/contrib/libpcap/pcap_lookupdev.3pcap head/contrib/libpcap/pcap_lookupnet.3pcap head/contrib/libpcap/pcap_loop.3pcap head/contrib/libpcap/pcap_major_version.3pcap head/contrib/libpcap/pcap_next_ex.3pcap head/contrib/libpcap/pcap_offline_filter.3pcap head/contrib/libpcap/pcap_open_dead.3pcap.in head/contrib/libpcap/pcap_open_live.3pcap head/contrib/libpcap/pcap_open_offline.3pcap.in head/contrib/libpcap/pcap_set_buffer_size.3pcap head/contrib/libpcap/pcap_set_datalink.3pcap head/contrib/libpcap/pcap_set_immediate_mode.3pcap head/contrib/libpcap/pcap_set_promisc.3pcap head/contrib/libpcap/pcap_set_rfmon.3pcap head/contrib/libpcap/pcap_set_snaplen.3pcap head/contrib/libpcap/pcap_set_timeout.3pcap head/contrib/libpcap/pcap_set_tstamp_precision.3pcap.in head/contrib/libpcap/pcap_set_tstamp_type.3pcap.in head/contrib/libpcap/pcap_setdirection.3pcap head/contrib/libpcap/pcap_setfilter.3pcap head/contrib/libpcap/pcap_setnonblock.3pcap head/contrib/libpcap/pcap_snapshot.3pcap head/contrib/libpcap/pcap_stats.3pcap head/contrib/libpcap/pcap_statustostr.3pcap head/contrib/libpcap/pcap_strerror.3pcap head/contrib/libpcap/pcap_tstamp_type_name_to_val.3pcap head/contrib/libpcap/pcap_tstamp_type_val_to_name.3pcap head/contrib/libpcap/savefile.c head/contrib/libpcap/scanner.l head/contrib/libpcap/sf-pcap-ng.c head/contrib/libpcap/sf-pcap.c head/contrib/libpcap/tests/capturetest.c head/contrib/libpcap/tests/filtertest.c head/contrib/libpcap/tests/findalldevstest.c head/contrib/libpcap/tests/opentest.c head/contrib/libpcap/tests/reactivatetest.c head/contrib/libpcap/tests/selpolltest.c head/contrib/libpcap/tests/valgrindtest.c head/lib/libpcap/Makefile head/lib/libpcap/config.h head/lib/libpcap/pcap-netmap.c head/sbin/pflogd/Makefile head/sys/net/bpf.h head/usr.sbin/ipfwpcap/Makefile Directory Properties: head/contrib/libpcap/ (props changed) Modified: head/contrib/libpcap/CHANGES ============================================================================== --- head/contrib/libpcap/CHANGES Mon Feb 13 02:15:56 2017 (r313694) +++ head/contrib/libpcap/CHANGES Mon Feb 13 08:23:39 2017 (r313695) @@ -1,5 +1,80 @@ +Tuesday, Oct. 25, 2016 mcr@sandelman.ca + Summary for 1.8.1 libpcap release + Add a target in Makefile.in for Exuberant Ctags use: 'extags'. + Rename configure.in to configure.ac: autoconf 2.59 + Clean up the name-to-DLT mapping table. + Add some newer DLT_ values: IPMI_HPM_2,ZWAVE_R1_R2,ZWAVE_R3,WATTSTOPPER_DLM,ISO_14443,RDS + Clarify what the return values are for both success and failure. + Many changes to build on windows + Check for the "break the loop" condition in the inner loop for TPACKET_V3. + Fix handling of packet count in the TPACKET_V3 inner loop: GitHub issue #493. + Filter out duplicate looped back CAN frames. + Fix the handling of loopback filters for IPv6 packets. + Add a link-layer header type for RDS (IEC 62106) groups. + Use different intermediate folders for x86 and x64 builds on Windows. + On Linux, handle all CAN captures with pcap-linux.c, in cooked mode. + Removes the need for the "host-endian" link-layer header type. + Compile with '-Wused-but-marked-unused' in devel mode if supported + Have separate DLTs for big-endian and host-endian SocketCAN headers. + Reflect version.h being renamed to pcap_version.h. + Require that version.h be generated: all build procedures we support generate version.h (autoconf, CMake, MSVC)! + Properly check for sock_recv() errors. + Re-impose some of Winsock's limitations on sock_recv(). + Replace sprintf() with pcap_snprintf(). + Fix signature of pcap_stats_ex_remote(). + Initial cmake support for remote packet capture. + Have rpcap_remoteact_getsock() return a SOCKET and supply an "is active" flag. + Clean up {DAG, Septel, Myricom SNF}-only builds. + Do UTF-16-to-ASCII conversion into the right place. + pcap_create_interface() needs the interface name on Linux. + Clean up hardware time stamp support: the "any" device does not support any time stamp types. + Add support for capturing on FreeBSD usbusN interfaces. + Add a LINKTYPE/DLT_ value for FreeBSD USB. + Go back to using PCAP_API on Windows. + CMake support + Add TurboCap support from WinPcap. + Recognize 802.1ad nested VLAN tag in vlan filter. + +Thursday Sep. 3, 2015 guy@alum.mit.edu + Summary for 1.7.5 libpcap release + Man page cleanups. + Add some allocation failure checks. + Fix a number of Linux/ucLinux configure/build issues. + Fix some memory leaks. + Recognize 802.1ad nested VLAN tag in vlan filter. + Fix building Bluetooth Linux Monitor support with BlueZ 5.1+ + +Saturday Jun. 27, 2015 mcr@sandelman.ca + Summary for 1.7.4 libpcap release + Include fix for GitHub issue #424 -- out of tree builds. + +Friday Apr. 10, 2015 guy@alum.mit.edu + Summary for 1.7.3 libpcap release + Work around a Linux bonding driver bug. + +Thursday Feb. 12, 2015 guy@alum.mit.edu/mcr@sandelman.ca + Summary for 1.7.2 libpcap release + Support for filtering Geneve encapsulated packets. + Generalize encapsulation handling, fixing some bugs. + Don't add null addresses to address lists. + Add pcap_dump_open_append() to open for appending. + Fix the swapping of isochronous descriptors in Linux USB. + Attempt to handle TPACKET_V1 with 32-bit userland and 64-bit kernel. + +Wednesday Nov. 12, 2014 guy@alum.mit.edu/mcr@sandelman.ca + Summary for 1.7.0 libpcap release + Fix handling of zones for BPF on Solaris + new DLT for ZWAVE + clarifications for read timeouts. + Use BPF extensions in compiled filters, fixing VLAN filters + some fixes to compilation without stdint.h + EBUSY can now be returned by SNFv3 code. + Fix the range checks in BPF loads + Various DAG fixes. + Various Linux fixes. + Monday Aug. 12, 2014 guy@alum.mit.edu - Summary for 1.6.2 tcpdump release + Summary for 1.6.2 libpcap release Don't crash on filters testing a non-existent link-layer type field. Fix sending in non-blocking mode on Linux with memory-mapped @@ -8,12 +83,12 @@ Monday Aug. 12, 2014 guy@alum.mit.edu machines. Saturday Jul. 19, 2014 mcr@sandelman.ca - Summary for 1.6.1 tcpdump release + Summary for 1.6.1 libpcap release some fixes for the any device - changes for how --enable-XXX works + changes for how --enable-XXX (--enable-sniffing, --enable-can) works Wednesday Jul. 2, 2014 mcr@sandelman.ca - Summary for 1.6.0 tcpdump release + Summary for 1.6.0 libpcap release Don't support D-Bus sniffing on OS X fixes for byte order issues with NFLOG captures Handle using cooked mode for DLT_NETLINK in activate_new(). Modified: head/contrib/libpcap/CREDITS ============================================================================== --- head/contrib/libpcap/CREDITS Mon Feb 13 02:15:56 2017 (r313694) +++ head/contrib/libpcap/CREDITS Mon Feb 13 08:23:39 2017 (r313695) @@ -2,11 +2,12 @@ This file lists people who have contribu The current maintainers: Bill Fenner - Denis Ovsienko + Denis Ovsienko Fulvio Risso Guy Harris Hannes Gredler Michael Richardson + Francois-Xavier Le Bail Additional people who have contributed patches: @@ -45,7 +46,7 @@ Additional people who have contributed p David Young Dean Gaudet dhruv - Don Ebright + Don Ebright Dug Song Dustin Spicuzza dzejarczech @@ -83,6 +84,7 @@ Additional people who have contributed p Jefferson Ogata Jesper Dangaard Brouer Jesper Peterson + Jesse Gross Jiri Slaby Joerg Mayer John Bankier @@ -105,6 +107,7 @@ Additional people who have contributed p Mansour Behabadi Marcus Felipe Pereira Mark C. Brown + Mark Johnston Mark Pizzolato Markus Mayer Martin Husemann Modified: head/contrib/libpcap/INSTALL.txt ============================================================================== --- head/contrib/libpcap/INSTALL.txt Mon Feb 13 02:15:56 2017 (r313694) +++ head/contrib/libpcap/INSTALL.txt Mon Feb 13 08:23:39 2017 (r313695) @@ -16,7 +16,7 @@ does support packet capture but libpcap particular type. (If you have HP-UX, see below.) If your system uses a packet capture not supported by libpcap, please send us patches; don't forget to include an autoconf fragment suitable for use in -configure.in. +configure.ac. It is possible to override the default packet capture type, although the circumstance where this works are limited. For example if you have @@ -31,40 +31,22 @@ You will need an ANSI C compiler to buil will abort if your compiler is not ANSI compliant. If this happens, use the generally available GNU C compiler (GCC). -If you use flex, you must use version 2.4.6 or higher. The configure -script automatically detects the version of flex and will not use it -unless it is new enough. You can use "flex -V" to see what version you -have (unless it's really old). The current version of flex is available -at flex.sourceforge.net and often comes packaged by means of the OS. -As of this writing, the current version is 2.5.37. - -If you use bison, you must use flex (and visa versa). The configure -script automatically falls back to lex and yacc if both flex and bison -are not found. - -Sometimes the stock C compiler does not interact well with flex and -bison. The list of problems includes undefined references for alloca. -You can get around this by installing gcc or manually disabling flex -and bison with: - - ./configure --without-flex --without-bison - -If your system only has AT&T lex, this is okay unless your libpcap -program uses other lex/yacc generated code. (Although it's possible to -map the yy* identifiers with a script, we use flex and bison so we -don't feel this is necessary.) - -Some systems support the Berkeley Packet Filter natively; for example -out of the box OSF and BSD/OS have bpf. If your system does not support -bpf, you will need to pick up: - - ftp://ftp.ee.lbl.gov/bpf-*.tar.Z - -Note well: you MUST have kernel source for your operating system in -order to install bpf. An exception is SunOS 4; the bpf distribution -includes replacement kernel objects for some of the standard SunOS 4 -network device drivers. See the bpf INSTALL document for more -information. +You will need either Flex 2.5.31 or later, or a version of Lex +compatible with it (if any exist), to build libpcap. The configure +script will abort if there isn't any such program. If you have an older +version of Flex, or don't have a compatible version of Lex, the current +version of flex is available at flex.sourceforge.net. + +You will need either Bison, Berkeley YACC, or a version of YACC +compatible with them (if any exist), to build libpcap. The configure +script will abort if there isn't any such program. If you don't have +any such program, the current version of Bison can be found at +http://ftp.gnu.org/gnu/bison/ and the current version of Berkeley YACC +can be found at http://invisible-island.net/byacc/. + +Sometimes the stock C compiler does not interact well with Flex and +Bison. The list of problems includes undefined references for alloca. +You can get around this by installing GCC. If you use Solaris, there is a bug with bufmod(7) that is fixed in Solaris 2.3.2 (aka SunOS 5.3.2). Setting a snapshot length with the @@ -178,14 +160,14 @@ packet timestamps aren't very good. Thi handling of the timestamp in the kernel. Note well: there is rumoured to be a version of tcpdump floating around -called 3.0.3 that includes libpcap and is supposed to support Linux. +called 3.0.3 that includes libpcap and is supposed to support Linux. You should be advised that neither the Network Research Group at LBNL -nor the Tcpdump Group ever generated a release with this version number. +nor the Tcpdump Group ever generated a release with this version number. The LBNL Network Research Group notes with interest that a standard cracker trick to get people to install trojans is to distribute bogus -packages that have a version number higher than the current release. +packages that have a version number higher than the current release. They also noted with annoyance that 90% of the Linux related bug reports -they got are due to changes made to unofficial versions of their page. +they got are due to changes made to unofficial versions of their page. If you are having trouble but aren't using a version that came from tcpdump.org, please try that before submitting a bug report! @@ -239,11 +221,11 @@ the libpcap 0.6.2 source release, so thi build without changes on UnixWare 7. If linking tcpdump fails with "Undefined: _alloca" when using bison on -a Sun4, your version of bison is broken. In any case version 1.16 or +a Sun4, your version of Bison is broken. In any case version 1.16 or higher is recommended (1.14 is known to cause problems 1.16 is known to work). Either pick up a current version from: - ftp://ftp.gnu.org/pub/gnu/bison + http://ftp.gnu.org/gnu/bison/ or hack around it by inserting the lines: @@ -289,6 +271,7 @@ FILES CHANGES - description of differences between releases ChmodBPF/* - Mac OS X startup item to set ownership and permissions on /dev/bpf* +CMakeLists.txt - CMake file CREDITS - people that have helped libpcap along INSTALL.txt - this file LICENSE - the license under which tcpdump is distributed @@ -317,7 +300,7 @@ config.guess - autoconf support config.h.in - autoconf input config.sub - autoconf support configure - configure script (run this first) -configure.in - configure script source +configure.ac - configure script source dlpisubs.c - DLPI-related functions for pcap-dlpi.c and pcap-libdlpi.c dlpisubs.h - DLPI-related function declarations etherent.c - /etc/ethers support routines @@ -325,9 +308,6 @@ ethertype.h - Ethernet protocol types an fad-getad.c - pcap_findalldevs() for systems with getifaddrs() fad-gifc.c - pcap_findalldevs() for systems with only SIOCGIFLIST fad-glifc.c - pcap_findalldevs() for systems with SIOCGLIFCONF -fad-null.c - pcap_findalldevs() for systems without capture support -fad-sita.c - pcap_findalldevs() for systems with SITA support -fad-win32.c - pcap_findalldevs() for WinPcap filtertest.c - test program for BPF compiler findalldevstest.c - test program for pcap_findalldevs() gencode.c - BPF code generation routines @@ -345,7 +325,6 @@ nametoaddr.c - hostname to address routi nlpid.h - OSI network layer protocol identifier definitions net - symlink to bpf/net optimize.c - BPF optimization routines -packaging - packaging information for building libpcap RPMs pcap/bluetooth.h - public definition of DLT_BLUETOOTH_HCI_H4_WITH_PHDR header pcap/bpf.h - BPF definitions pcap/namedb.h - public libpcap name database definitions @@ -389,7 +368,6 @@ pcap_*.3pcap - manual entries for librar pcap-filter.4 - manual entry for filter syntax pcap-linktype.4 - manual entry for link-layer header types ppp.h - Point to Point Protocol definitions -runlex.sh - wrapper for Lex/Flex savefile.c - offline support scanner.l - filter string scanner sunatmpos.h - definitions for SunATM capturing Modified: head/contrib/libpcap/LICENSE ============================================================================== --- head/contrib/libpcap/LICENSE Mon Feb 13 02:15:56 2017 (r313694) +++ head/contrib/libpcap/LICENSE Mon Feb 13 08:23:39 2017 (r313695) @@ -1,9 +1,9 @@ License: BSD - + 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 @@ -13,7 +13,7 @@ are met: 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Modified: head/contrib/libpcap/Makefile-devel-adds ============================================================================== --- head/contrib/libpcap/Makefile-devel-adds Mon Feb 13 02:15:56 2017 (r313694) +++ head/contrib/libpcap/Makefile-devel-adds Mon Feb 13 08:23:39 2017 (r313695) @@ -2,12 +2,12 @@ # Auto-regenerate configure script or Makefile when things change. # From autoconf.info . Works best with GNU Make. # -${srcdir}/configure: configure.in aclocal.m4 +${srcdir}/configure: configure.ac aclocal.m4 cd ${srcdir} && autoconf # autoheader might not change config.h.in, so touch a stamp file. ${srcdir}/config.h.in: ${srcdir}/stamp-h.in -${srcdir}/stamp-h.in: configure.in aclocal.m4 +${srcdir}/stamp-h.in: configure.ac aclocal.m4 cd ${srcdir} && autoheader echo timestamp > ${srcdir}/stamp-h.in Modified: head/contrib/libpcap/Makefile.in ============================================================================== --- head/contrib/libpcap/Makefile.in Mon Feb 13 02:15:56 2017 (r313694) +++ head/contrib/libpcap/Makefile.in Mon Feb 13 08:23:39 2017 (r313695) @@ -49,12 +49,13 @@ LN_S = @LN_S@ MKDEP = @MKDEP@ CCOPT = @V_CCOPT@ INCLS = -I. @V_INCLS@ -DEFS = @DEFS@ @V_DEFS@ +DEFS = -DBUILDING_PCAP @DEFS@ @V_DEFS@ ADDLOBJS = @ADDLOBJS@ ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@ LIBS = @LIBS@ -CFLAGS = @CFLAGS@ -LDFLAGS = @LDFLAGS@ +CROSSFLAGS= +CFLAGS = @CFLAGS@ ${CROSSFLAGS} +LDFLAGS = @LDFLAGS@ ${CROSSFLAGS} DYEXT = @DYEXT@ V_RPATH_OPT = @V_RPATH_OPT@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@ @@ -68,13 +69,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ RANLIB = @RANLIB@ -# -# Flex and bison allow you to specify the prefixes of the global symbols -# used by the generated parser. This allows programs to use lex/yacc -# and link against libpcap. If you don't have flex or bison, get them. -# -LEX = @V_LEX@ -YACC = @V_YACC@ +LEX = @LEX@ +YACC = @YACC@ # Explicitly define compilation rule since SunOS 4's make doesn't like gcc. # Also, gcc does not remove the .o before forking 'as', which can be a @@ -83,11 +79,11 @@ YACC = @V_YACC@ @rm -f $@ $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c -PSRC = pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @BT_MONITOR_SRC@ @CAN_SRC@ @NETFILTER_SRC@ @CANUSB_SRC@ @DBUS_SRC@ -FSRC = fad-@V_FINDALLDEVS@.c +PSRC = pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @BT_MONITOR_SRC@ @NETFILTER_SRC@ @DBUS_SRC@ +FSRC = @V_FINDALLDEVS@ SSRC = @SSRC@ -CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c etherent.c \ - savefile.c sf-pcap.c sf-pcap-ng.c pcap-common.c \ +CSRC = pcap.c inet.c fad-helpers.c gencode.c optimize.c nametoaddr.c \ + etherent.c savefile.c sf-pcap.c sf-pcap-ng.c pcap-common.c \ bpf_image.c bpf_dump.c GENSRC = scanner.c grammar.c bpf_filter.c version.c LIBOBJS = @LIBOBJS@ @@ -103,6 +99,9 @@ PUBHDR = \ pcap-namedb.h \ pcap/bpf.h \ pcap/bluetooth.h \ + pcap/can_socketcan.h \ + pcap/dlt.h \ + pcap/export-defs.h \ pcap/ipnet.h \ pcap/namedb.h \ pcap/nflog.h \ @@ -115,37 +114,43 @@ HDR = $(PUBHDR) \ arcnet.h \ atmuni31.h \ ethertype.h \ + extract.h \ gencode.h \ ieee80211.h \ llc.h \ + nametoaddr.h \ nlpid.h \ pcap-common.h \ pcap-int.h \ pcap-stdinc.h \ + portability.h \ ppp.h \ sf-pcap.h \ sf-pcap-ng.h \ sunatmpos.h TESTS = \ + @VALGRINDTEST@ \ capturetest \ + can_set_rfmon_test \ filtertest \ findalldevstest \ opentest \ - selpolltest \ - valgrindtest + reactivatetest \ + selpolltest TESTS_SRC = \ + tests/valgrindtest.c \ tests/capturetest.c \ + tests/can_set_rfmon_test.c \ tests/filtertest.c \ tests/findalldevstest.c \ tests/opentest.c \ tests/reactivatetest.c \ - tests/selpolltest.c \ - tests/valgrindtest.c + tests/selpolltest.c GENHDR = \ - scanner.h tokdefs.h version.h + scanner.h grammar.h pcap_version.h TAGFILES = \ $(SRC) $(HDR) @@ -231,6 +236,8 @@ EXTRA_DIST = \ ChmodBPF/ChmodBPF \ ChmodBPF/StartupParameters.plist \ CREDITS \ + CMakeLists.txt \ + GenVersion.bat \ INSTALL.txt \ LICENSE \ Makefile.in \ @@ -253,29 +260,37 @@ EXTRA_DIST = \ aclocal.m4 \ bpf/net/bpf_filter.c \ chmod_bpf \ + cmakeconfig.h.in \ + cmake/preconfigure.cmake \ + config/have_siocglifconf.c \ config.guess \ config.h.in \ config.sub \ configure \ - configure.in \ + configure.ac \ dlpisubs.c \ dlpisubs.h \ fad-getad.c \ fad-gifc.c \ fad-glifc.c \ - fad-null.c \ - fad-sita.c \ - fad-win32.c \ + fad-helpers.c \ + gen_version_c.sh \ + gen_version_header.sh \ grammar.y \ install-sh \ lbl/os-aix4.h \ + lbl/os-aix7.h \ lbl/os-hpux11.h \ lbl/os-osf4.h \ lbl/os-osf5.h \ lbl/os-solaris2.h \ lbl/os-sunos4.h \ lbl/os-ultrix4.h \ + missing/getopt.c \ + missing/getopt.h \ missing/snprintf.c \ + missing/strtok_r.c \ + missing/win_snprintf.c \ mkdep \ msdos/bin2c.c \ msdos/common.dj \ @@ -291,16 +306,11 @@ EXTRA_DIST = \ msdos/pktdrvr.h \ msdos/readme.dos \ org.tcpdump.chmod_bpf.plist \ - packaging/pcap.spec.in \ pcap-bpf.c \ pcap-bt-linux.c \ pcap-bt-linux.h \ pcap-bt-monitor-linux.c \ pcap-bt-monitor-linux.h \ - pcap-can-linux.c \ - pcap-can-linux.h \ - pcap-canusb-linux.c \ - pcap-canusb-linux.h \ pcap-config.in \ pcap-dag.c \ pcap-dag.h \ @@ -314,11 +324,14 @@ EXTRA_DIST = \ pcap-libdlpi.c \ pcap-linux.c \ pcap-namedb.h \ + pcap-new.c \ pcap-netfilter-linux.c \ pcap-netfilter-linux.h \ pcap-nit.c \ pcap-null.c \ pcap-pf.c \ + pcap-rpcap.c \ + pcap-rpcap.h \ pcap-septel.c \ pcap-septel.h \ pcap-sita.h \ @@ -328,34 +341,22 @@ EXTRA_DIST = \ pcap-snf.h \ pcap-snit.c \ pcap-snoop.c \ + pcap-tc.c \ + pcap-tc.h \ pcap-usb-linux.c \ pcap-usb-linux.h \ pcap-win32.c \ - runlex.sh \ + remote-ext.h \ + sockutils.c \ + sockutils.h \ scanner.l \ + tests/CMakeLists.txt \ + pcap_version.h.in \ Win32/Include/Gnuc.h \ - Win32/Include/addrinfo.h \ - Win32/Include/bittypes.h \ - Win32/Include/cdecl_ext.h \ - Win32/Include/inetprivate.h \ - Win32/Include/ip6_misc.h \ - Win32/Include/sockstorage.h \ - Win32/Include/arpa/nameser.h \ Win32/Include/net/if.h \ - Win32/Include/net/netdb.h \ - Win32/Include/net/paths.h \ - Win32/Prj/libpcap.dsp \ - Win32/Prj/libpcap.dsw \ - Win32/Src/ffs.c \ - Win32/Src/gai_strerror.c \ - Win32/Src/getaddrinfo.c \ - Win32/Src/getnetbynm.c \ - Win32/Src/getnetent.c \ - Win32/Src/getopt.c \ - Win32/Src/getservent.c \ - Win32/Src/inet_aton.c \ - Win32/Src/inet_net.c \ - Win32/Src/inet_pton.c + Win32/Prj/wpcap.sln \ + Win32/Prj/wpcap.vcxproj \ + Win32/Prj/wpcap.vcxproj.filters all: libpcap.a shared pcap-config @@ -443,24 +444,33 @@ libpcap.shareda: $(OBJ) libpcap.none: scanner.c: $(srcdir)/scanner.l - @rm -f $@ - $(srcdir)/runlex.sh $(LEX) -o$@ $< + $(LEX) -P pcap_ --header-file=scanner.h --nounput -o scanner.c $< +scanner.h: scanner.c +## Recover from the removal of $@ + @if test -f $@; then :; else \ + rm -f scanner.c; \ + $(MAKE) $(MAKEFLAGS) scanner.c; \ + fi -scanner.o: scanner.c tokdefs.h +scanner.o: scanner.c grammar.h $(CC) $(FULL_CFLAGS) -c scanner.c -pcap.o: version.h +pcap.o: pcap_version.h -tokdefs.h: grammar.c grammar.c: $(srcdir)/grammar.y - @rm -f grammar.c tokdefs.h - $(YACC) -d $< - mv y.tab.c grammar.c - mv y.tab.h tokdefs.h + $(YACC) -p pcap_ -o grammar.c -d $< +grammar.h: grammar.c +## Recover from the removal of $@ + @if test -f $@; then :; else \ + rm -f grammar.c; \ + $(MAKE) $(MAKEFLAGS) grammar.c; \ + fi grammar.o: grammar.c - @rm -f $@ - $(CC) $(FULL_CFLAGS) -Dyylval=pcap_lval -c grammar.c + $(CC) $(FULL_CFLAGS) -c grammar.c + +gencode.o: $(srcdir)/gencode.c grammar.h scanner.h + $(CC) $(FULL_CFLAGS) -c $(srcdir)/gencode.c version.o: version.c $(CC) $(FULL_CFLAGS) -c version.c @@ -468,32 +478,21 @@ version.o: version.c snprintf.o: $(srcdir)/missing/snprintf.c $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c -version.c: $(srcdir)/VERSION +strtok_r.o: $(srcdir)/missing/strtok_r.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strtok_r.c + +version.c: $(srcdir)/VERSION $(srcdir)/gen_version_c.sh + # + # Older programs import this if they want to show the + # libpcap version number, rather than calling + # pcap_lib_version(), so we need to export it. + # @rm -f $@ - if grep GIT ${srcdir}/VERSION >/dev/null; then \ - read ver <${srcdir}/VERSION; \ - echo $$ver | tr -d '\012'; \ - date +_%Y_%m_%d; \ - else \ - cat ${srcdir}/VERSION; \ - fi | sed -e 's/.*/char pcap_version[] = "&";/' > $@ - -# -# NOTE: this really is supposed to be static; importing a string -# from a shared library does not work very well on many -# versions of UNIX (Solaris, Linux, and the BSDs, for example), -# so we make the version string static and return it from -# a function, which does work. -# -version.h: $(srcdir)/VERSION + $(srcdir)/gen_version_c.sh $(srcdir)/VERSION $@ + +pcap_version.h: $(srcdir)/VERSION $(srcdir)/pcap_version.h.in $(srcdir)/gen_version_header.sh @rm -f $@ - if grep GIT ${srcdir}/VERSION >/dev/null; then \ - read ver <${srcdir}/VERSION; \ - echo $$ver | tr -d '\012'; \ - date +_%Y_%m_%d; \ - else \ - cat ${srcdir}/VERSION; \ - fi | sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' > $@ + $(srcdir)/gen_version_header.sh $(srcdir)/VERSION $(srcdir)/pcap_version.h.in $@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filter.c rm -f bpf_filter.c @@ -530,6 +529,9 @@ tests: $(TESTS) capturetest: tests/capturetest.c libpcap.a $(CC) $(FULL_CFLAGS) -I. -L. -o capturetest $(srcdir)/tests/capturetest.c libpcap.a $(LIBS) +can_set_rfmon_test: tests/can_set_rfmon_test.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o can_set_rfmon_test $(srcdir)/tests/can_set_rfmon_test.c libpcap.a $(LIBS) + filtertest: tests/filtertest.c libpcap.a $(CC) $(FULL_CFLAGS) -I. -L. -o filtertest $(srcdir)/tests/filtertest.c libpcap.a $(LIBS) @@ -539,6 +541,9 @@ findalldevstest: tests/findalldevstest.c opentest: tests/opentest.c libpcap.a $(CC) $(FULL_CFLAGS) -I. -L. -o opentest $(srcdir)/tests/opentest.c libpcap.a $(LIBS) +reactivatetest: tests/reactivatetest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o reactivatetest $(srcdir)/tests/reactivatetest.c libpcap.a $(LIBS) + selpolltest: tests/selpolltest.c libpcap.a $(CC) $(FULL_CFLAGS) -I. -L. -o selpolltest $(srcdir)/tests/selpolltest.c libpcap.a $(LIBS) @@ -728,13 +733,12 @@ distclean: clean rm -f $(MAN3PCAP_EXPAND:.in=) $(MANFILE:.in=) $(MANMISC:.in=) rm -rf autom4te.cache +extags: $(TAGFILES) + ctags $(TAGFILES) + tags: $(TAGFILES) ctags -wtd $(TAGFILES) -packaging/pcap.spec: packaging/pcap.spec.in VERSION - RPMVERSION=`cat VERSION | sed s/-.*//g`; \ - sed -e s/@VERSION@/$$RPMVERSION/ -e s/@NAME@/libpcap-`cat VERSION`/ $< > $@ - releasetar: @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \ mkdir $$name; \ Modified: head/contrib/libpcap/README ============================================================================== --- head/contrib/libpcap/README Mon Feb 13 02:15:56 2017 (r313694) +++ head/contrib/libpcap/README Mon Feb 13 08:23:39 2017 (r313695) @@ -76,15 +76,15 @@ information on configuring that option. Note to Linux distributions and *BSD systems that include libpcap: -There's now a rule to make a shared library, which should work on Linux +There's now a rule to make a shared library, which should work on Linux and *BSD, among other platforms. -It sets the soname of the library to "libpcap.so.1"; this is what it -should be, *NOT* libpcap.so.1.x or libpcap.so.1.x.y or something such as +It sets the soname of the library to "libpcap.so.1"; this is what it +should be, *NOT* libpcap.so.1.x or libpcap.so.1.x.y or something such as that. -We've been maintaining binary compatibility between libpcap releases for -quite a while; there's no reason to tie a binary linked with libpcap to +We've been maintaining binary compatibility between libpcap releases for +quite a while; there's no reason to tie a binary linked with libpcap to a particular release of libpcap. Problems, bugs, questions, desirable enhancements, etc. should be sent Modified: head/contrib/libpcap/TODO ============================================================================== --- head/contrib/libpcap/TODO Mon Feb 13 02:15:56 2017 (r313694) +++ head/contrib/libpcap/TODO Mon Feb 13 08:23:39 2017 (r313695) @@ -6,11 +6,11 @@ Important stuff (to be done before the n General -- configure should not be in Git. Most open source projects have an - autogen.sh script to run autoconf etc. after checkout. I think we - should stick to the standard. +- configure should not be in Git. Most open source projects have an + autogen.sh script to run autoconf etc. after checkout. I think we + should stick to the standard. -- The source files should be better documented. There is no official +- The source files should be better documented. There is no official design guideline for what is done where. There should be a common coding style (okay, you can guess that by looking at the code) and a guide for what needs to be documented. @@ -18,7 +18,7 @@ General Less urgent items ----------------- -- Better documentation and cleanup of the interface. I am seeing a few +- Better documentation and cleanup of the interface. I am seeing a few problems at the first glance which needs fixing: + pcap_lookupnet makes little to no sense with protocols != IPv4 + not very well suited for interactive programs (think ethereal). There Modified: head/contrib/libpcap/VERSION ============================================================================== --- head/contrib/libpcap/VERSION Mon Feb 13 02:15:56 2017 (r313694) +++ head/contrib/libpcap/VERSION Mon Feb 13 08:23:39 2017 (r313695) @@ -1 +1 @@ -1.6.2 +1.8.1 Modified: head/contrib/libpcap/bpf/net/bpf_filter.c ============================================================================== --- head/contrib/libpcap/bpf/net/bpf_filter.c Mon Feb 13 02:15:56 2017 (r313694) +++ head/contrib/libpcap/bpf/net/bpf_filter.c Mon Feb 13 08:23:39 2017 (r313695) @@ -42,11 +42,11 @@ #include "config.h" #endif -#ifdef WIN32 +#ifdef _WIN32 #include -#else /* WIN32 */ +#else /* _WIN32 */ #if HAVE_INTTYPES_H #include @@ -73,7 +73,7 @@ # define MLEN(m) ((m)->m_len) #endif /* defined(__hpux) || SOLARIS */ -#endif /* WIN32 */ +#endif /* _WIN32 */ #include @@ -99,7 +99,7 @@ #endif #ifndef LBL_ALIGN -#ifndef WIN32 +#ifndef _WIN32 #include #endif @@ -195,23 +195,41 @@ m_xhalf(m, k, err) } #endif +#ifdef __linux__ +#include +#include +#include +#endif + +enum { + BPF_S_ANC_NONE, + BPF_S_ANC_VLAN_TAG, + BPF_S_ANC_VLAN_TAG_PRESENT, +}; + /* * Execute the filter program starting at pc on the packet p * wirelen is the length of the original packet * buflen is the amount of data present + * aux_data is auxiliary data, currently used only when interpreting + * filters intended for the Linux kernel in cases where the kernel + * rejects the filter; it contains VLAN tag information * For the kernel, p is assumed to be a pointer to an mbuf if buflen is 0, * in all other cases, p is a pointer to a buffer and buflen is its size. + * + * Thanks to Ani Sinha for providing initial implementation */ u_int -bpf_filter(pc, p, wirelen, buflen) +bpf_filter_with_aux_data(pc, p, wirelen, buflen, aux_data) register const struct bpf_insn *pc; register const u_char *p; u_int wirelen; register u_int buflen; + register const struct bpf_aux_data *aux_data; { register u_int32 A, X; - register int k; - int32 mem[BPF_MEMWORDS]; + register bpf_u_int32 k; + u_int32 mem[BPF_MEMWORDS]; #if defined(KERNEL) || defined(_KERNEL) struct mbuf *m, *n; int merr, len; @@ -250,7 +268,7 @@ bpf_filter(pc, p, wirelen, buflen) case BPF_LD|BPF_W|BPF_ABS: k = pc->k; - if (k + sizeof(int32) > buflen) { + if (k > buflen || sizeof(int32_t) > buflen - k) { #if defined(KERNEL) || defined(_KERNEL) if (m == NULL) return 0; @@ -267,7 +285,7 @@ bpf_filter(pc, p, wirelen, buflen) case BPF_LD|BPF_H|BPF_ABS: k = pc->k; - if (k + sizeof(short) > buflen) { + if (k > buflen || sizeof(int16_t) > buflen - k) { #if defined(KERNEL) || defined(_KERNEL) if (m == NULL) return 0; @@ -283,22 +301,50 @@ bpf_filter(pc, p, wirelen, buflen) continue; case BPF_LD|BPF_B|BPF_ABS: - k = pc->k; - if (k >= buflen) { -#if defined(KERNEL) || defined(_KERNEL) - if (m == NULL) - return 0; - n = m; - MINDEX(len, n, k); - A = mtod(n, u_char *)[k]; - continue; -#else - return 0; + { +#if defined(SKF_AD_VLAN_TAG) && defined(SKF_AD_VLAN_TAG_PRESENT) + int code = BPF_S_ANC_NONE; +#define ANCILLARY(CODE) case SKF_AD_OFF + SKF_AD_##CODE: \ + code = BPF_S_ANC_##CODE; \ + if (!aux_data) \ + return 0; \ + break; + + switch (pc->k) { + ANCILLARY(VLAN_TAG); + ANCILLARY(VLAN_TAG_PRESENT); + default : +#endif + k = pc->k; + if (k >= buflen) { +#if defined(KERNEL) || defined(_KERNEL) + if (m == NULL) + return 0; + n = m; + MINDEX(len, n, k); + A = mtod(n, u_char *)[k]; + continue; +#else + return 0; +#endif + } + A = p[k]; +#if defined(SKF_AD_VLAN_TAG) && defined(SKF_AD_VLAN_TAG_PRESENT) + } + switch (code) { + case BPF_S_ANC_VLAN_TAG: + if (aux_data) + A = aux_data->vlan_tag; + break; + + case BPF_S_ANC_VLAN_TAG_PRESENT: + if (aux_data) + A = aux_data->vlan_tag_present; + break; + } #endif + continue; } - A = p[k]; - continue; - case BPF_LD|BPF_W|BPF_LEN: A = wirelen; continue; @@ -309,7 +355,8 @@ bpf_filter(pc, p, wirelen, buflen) case BPF_LD|BPF_W|BPF_IND: k = X + pc->k; - if (k + sizeof(int32) > buflen) { + if (pc->k > buflen || X > buflen - pc->k || + sizeof(int32_t) > buflen - k) { #if defined(KERNEL) || defined(_KERNEL) if (m == NULL) return 0; @@ -326,7 +373,8 @@ bpf_filter(pc, p, wirelen, buflen) case BPF_LD|BPF_H|BPF_IND: k = X + pc->k; - if (k + sizeof(short) > buflen) { + if (X > buflen || pc->k > buflen - X || + sizeof(int16_t) > buflen - k) { #if defined(KERNEL) || defined(_KERNEL) if (m == NULL) return 0; @@ -343,7 +391,7 @@ bpf_filter(pc, p, wirelen, buflen) case BPF_LD|BPF_B|BPF_IND: k = X + pc->k; - if (k >= buflen) { + if (pc->k >= buflen || X >= buflen - pc->k) { #if defined(KERNEL) || defined(_KERNEL) if (m == NULL) return 0; @@ -531,7 +579,12 @@ bpf_filter(pc, p, wirelen, buflen) continue; case BPF_ALU|BPF_NEG: - A = -A; + /* + * Most BPF arithmetic is unsigned, but negation + * can't be unsigned; throw some casts to + * specify what we're trying to do. + */ + A = (u_int32)(-(int32)A); continue; case BPF_MISC|BPF_TAX: @@ -545,6 +598,17 @@ bpf_filter(pc, p, wirelen, buflen) } } +u_int +bpf_filter(pc, p, wirelen, buflen) + register const struct bpf_insn *pc; + register const u_char *p; + u_int wirelen; + register u_int buflen; +{ + return bpf_filter_with_aux_data(pc, p, wirelen, buflen, NULL); +} + + /* * Return true if the 'fcode' is a valid filter program. * The constraints are that each jump be forward and to a valid @@ -574,7 +638,7 @@ bpf_validate(f, len) return 0; #endif - for (i = 0; i < len; ++i) { + for (i = 0; i < (u_int)len; ++i) { p = &f[i]; switch (BPF_CLASS(p->code)) { /* @@ -675,7 +739,7 @@ bpf_validate(f, len) #if defined(KERNEL) || defined(_KERNEL) if (from + p->k < from || from + p->k >= len) #else - if (from + p->k >= len) + if (from + p->k >= (u_int)len) #endif return 0; break; @@ -683,7 +747,7 @@ bpf_validate(f, len) case BPF_JGT: case BPF_JGE: case BPF_JSET: - if (from + p->jt >= len || from + p->jf >= len) + if (from + p->jt >= (u_int)len || from + p->jf >= (u_int)len) return 0; break; default: Modified: head/contrib/libpcap/bpf_dump.c ============================================================================== --- head/contrib/libpcap/bpf_dump.c Mon Feb 13 02:15:56 2017 (r313694) +++ head/contrib/libpcap/bpf_dump.c Mon Feb 13 08:23:39 2017 (r313695) @@ -51,7 +51,10 @@ bpf_dump(const struct bpf_program *p, in for (i = 0; i < n; ++insn, ++i) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Feb 13 09:04:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78ECDCDD3C3; Mon, 13 Feb 2017 09:04:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 330FDD7C; Mon, 13 Feb 2017 09:04:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1D94dqa052300; Mon, 13 Feb 2017 09:04:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1D94c2t052291; Mon, 13 Feb 2017 09:04:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702130904.v1D94c2t052291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 13 Feb 2017 09:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313696 - in head/sys: compat/cloudabi compat/freebsd32 compat/linux kern 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 09:04:40 -0000 Author: kib Date: Mon Feb 13 09:04:38 2017 New Revision: 313696 URL: https://svnweb.freebsd.org/changeset/base/313696 Log: Rework r313352. Rename kern_vm_* functions to kern_*. Move the prototypes to syscallsubr.h. Also change Mach VM types to uintptr_t/size_t as needed, to avoid headers pollution. Requested by: alc, jhb Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D9535 Modified: head/sys/compat/cloudabi/cloudabi_mem.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_mmap.c head/sys/kern/vfs_aio.c head/sys/sys/syscallsubr.h head/sys/vm/vm_extern.h head/sys/vm/vm_mmap.c Modified: head/sys/compat/cloudabi/cloudabi_mem.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_mem.c Mon Feb 13 08:23:39 2017 (r313695) +++ head/sys/compat/cloudabi/cloudabi_mem.c Mon Feb 13 09:04:38 2017 (r313696) @@ -29,8 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include #include - -#include +#include #include @@ -86,16 +85,16 @@ cloudabi_sys_mem_advise(struct thread *t return (EINVAL); } - return (kern_vm_madvise(td, (vm_offset_t)uap->mapping, - uap->mapping_len, behav)); + return (kern_madvise(td, (uintptr_t)uap->mapping, uap->mapping_len, + behav)); } int cloudabi_sys_mem_lock(struct thread *td, struct cloudabi_sys_mem_lock_args *uap) { - return (vm_mlock(td->td_proc, td->td_ucred, uap->mapping, - uap->mapping_len)); + return (kern_mlock(td->td_proc, td->td_ucred, + __DECONST(uintptr_t, uap->mapping), uap->mapping_len)); } int @@ -119,8 +118,8 @@ cloudabi_sys_mem_map(struct thread *td, if (error != 0) return (error); - return (kern_vm_mmap(td, (vm_offset_t)uap->addr, uap->len, prot, - flags, uap->fd, uap->off)); + return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, flags, + uap->fd, uap->off)); } int @@ -134,8 +133,8 @@ cloudabi_sys_mem_protect(struct thread * if (error != 0) return (error); - return (kern_vm_mprotect(td, (vm_offset_t)uap->mapping, - uap->mapping_len, prot)); + return (kern_mprotect(td, (uintptr_t)uap->mapping, uap->mapping_len, + prot)); } int @@ -157,8 +156,8 @@ cloudabi_sys_mem_sync(struct thread *td, if ((uap->flags & CLOUDABI_MS_INVALIDATE) != 0) flags |= MS_INVALIDATE; - return (kern_vm_msync(td, (vm_offset_t)uap->mapping, - uap->mapping_len, flags)); + return (kern_msync(td, (uintptr_t)uap->mapping, uap->mapping_len, + flags)); } int @@ -166,7 +165,8 @@ cloudabi_sys_mem_unlock(struct thread *t struct cloudabi_sys_mem_unlock_args *uap) { - return (kern_vm_munlock(td, (vm_offset_t)uap->mapping, uap->mapping_len)); + return (kern_munlock(td, __DECONST(uintptr_t, uap->mapping), + uap->mapping_len)); } int @@ -174,5 +174,5 @@ cloudabi_sys_mem_unmap(struct thread *td struct cloudabi_sys_mem_unmap_args *uap) { - return (kern_vm_munmap(td, (vm_offset_t)uap->mapping, uap->mapping_len)); + return (kern_munmap(td, (uintptr_t)uap->mapping, uap->mapping_len)); } Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Mon Feb 13 08:23:39 2017 (r313695) +++ head/sys/compat/freebsd32/freebsd32_misc.c Mon Feb 13 09:04:38 2017 (r313696) @@ -456,8 +456,8 @@ freebsd32_mprotect(struct thread *td, st if (i386_read_exec && (prot & PROT_READ) != 0) prot |= PROT_EXEC; #endif - return (kern_vm_mprotect(td, (vm_offset_t)PTRIN(uap->addr), - uap->len, prot)); + return (kern_mprotect(td, (uintptr_t)PTRIN(uap->addr), uap->len, + prot)); } int @@ -471,7 +471,7 @@ freebsd32_mmap(struct thread *td, struct prot |= PROT_EXEC; #endif - return (kern_vm_mmap(td, (vm_offset_t)uap->addr, uap->len, prot, + return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, uap->flags, uap->fd, PAIR32TO64(off_t, uap->pos))); } @@ -480,17 +480,16 @@ int freebsd6_freebsd32_mmap(struct thread *td, struct freebsd6_freebsd32_mmap_args *uap) { - struct freebsd32_mmap_args ap; + int prot; - ap.addr = uap->addr; - ap.len = uap->len; - ap.prot = uap->prot; - ap.flags = uap->flags; - ap.fd = uap->fd; - ap.pos1 = uap->pos1; - ap.pos2 = uap->pos2; + prot = uap->prot; +#if defined(__amd64__) + if (i386_read_exec && (prot & PROT_READ)) + prot |= PROT_EXEC; +#endif - return (freebsd32_mmap(td, &ap)); + return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, + uap->flags, uap->fd, PAIR32TO64(off_t, uap->pos))); } #endif Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Mon Feb 13 08:23:39 2017 (r313695) +++ head/sys/compat/linux/linux_misc.c Mon Feb 13 09:04:38 2017 (r313696) @@ -623,7 +623,7 @@ linux_mremap(struct thread *td, struct l if (args->new_len < args->old_len) { addr = args->addr + args->new_len; len = args->old_len - args->new_len; - error = kern_vm_munmap(td, addr, len); + error = kern_munmap(td, addr, len); } td->td_retval[0] = error ? 0 : (uintptr_t)args->addr; @@ -638,7 +638,7 @@ int linux_msync(struct thread *td, struct linux_msync_args *args) { - return (kern_vm_msync(td, args->addr, args->len, + return (kern_msync(td, args->addr, args->len, args->fl & ~LINUX_MS_SYNC)); } Modified: head/sys/compat/linux/linux_mmap.c ============================================================================== --- head/sys/compat/linux/linux_mmap.c Mon Feb 13 08:23:39 2017 (r313695) +++ head/sys/compat/linux/linux_mmap.c Mon Feb 13 09:04:38 2017 (r313696) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -202,7 +203,7 @@ linux_mmap_common(struct thread *td, uin } } - error = kern_vm_mmap(td, addr, len, prot, bsd_flags, fd, pos); + error = kern_mmap(td, addr, len, prot, bsd_flags, fd, pos); LINUX_CTR2(mmap2, "return: %d (%p)", error, td->td_retval[0]); @@ -216,7 +217,7 @@ linux_mprotect_common(struct thread *td, #if defined(__amd64__) linux_fixup_prot(td, &prot); #endif - return (kern_vm_mprotect(td, addr, len, prot)); + return (kern_mprotect(td, addr, len, prot)); } #if defined(__amd64__) Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Mon Feb 13 08:23:39 2017 (r313695) +++ head/sys/kern/vfs_aio.c Mon Feb 13 09:04:38 2017 (r313696) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -858,12 +859,9 @@ aio_process_mlock(struct kaiocb *job) ("%s: opcode %d", __func__, job->uaiocb.aio_lio_opcode)); aio_switch_vmspace(job); - error = vm_mlock(job->userproc, job->cred, - __DEVOLATILE(void *, cb->aio_buf), cb->aio_nbytes); - if (error) - aio_complete(job, -1, error); - else - aio_complete(job, 0, 0); + error = kern_mlock(job->userproc, job->cred, + __DEVOLATILE(uintptr_t, cb->aio_buf), cb->aio_nbytes); + aio_complete(job, error != 0 ? -1 : 0, error); } static void Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Mon Feb 13 08:23:39 2017 (r313695) +++ head/sys/sys/syscallsubr.h Mon Feb 13 09:04:38 2017 (r313696) @@ -149,15 +149,24 @@ int kern_listen(struct thread *td, int s int kern_lseek(struct thread *td, int fd, off_t offset, int whence); int kern_lutimes(struct thread *td, char *path, enum uio_seg pathseg, struct timeval *tptr, enum uio_seg tptrseg); +int kern_madvise(struct thread *td, uintptr_t addr, size_t len, int behav); int kern_mkdirat(struct thread *td, int fd, char *path, enum uio_seg segflg, int mode); int kern_mkfifoat(struct thread *td, int fd, char *path, enum uio_seg pathseg, int mode); int kern_mknodat(struct thread *td, int fd, char *path, enum uio_seg pathseg, int mode, int dev); +int kern_mlock(struct proc *proc, struct ucred *cred, uintptr_t addr, + size_t len); +int kern_mmap(struct thread *td, uintptr_t addr, size_t size, int prot, + int flags, int fd, off_t pos); +int kern_mprotect(struct thread *td, uintptr_t addr, size_t size, int prot); int kern_msgctl(struct thread *, int, int, struct msqid_ds *); int kern_msgsnd(struct thread *, int, const void *, size_t, int, long); int kern_msgrcv(struct thread *, int, void *, size_t, long, int, long *); +int kern_msync(struct thread *td, uintptr_t addr, size_t size, int flags); +int kern_munlock(struct thread *td, uintptr_t addr, size_t size); +int kern_munmap(struct thread *td, uintptr_t addr, size_t size); int kern_nanosleep(struct thread *td, struct timespec *rqt, struct timespec *rmt); int kern_ogetdirentries(struct thread *td, struct ogetdirentries_args *uap, Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Mon Feb 13 08:23:39 2017 (r313695) +++ head/sys/vm/vm_extern.h Mon Feb 13 09:04:38 2017 (r313696) @@ -71,16 +71,6 @@ void kmem_init(vm_offset_t, vm_offset_t) void kmem_init_zero_region(void); void kmeminit(void); -int kern_vm_mmap(struct thread *td, vm_offset_t addr, vm_size_t size, - int prot, int flags, int fd, off_t pos); -int kern_vm_mprotect(struct thread *td, vm_offset_t addr, vm_size_t size, - vm_prot_t prot); -int kern_vm_msync(struct thread *td, vm_offset_t addr, vm_size_t size, - int flags); -int kern_vm_munlock(struct thread *td, vm_offset_t addr, vm_size_t size); -int kern_vm_munmap(struct thread *td, vm_offset_t addr, vm_size_t size); -int kern_vm_madvise(struct thread *td, vm_offset_t addr, vm_size_t len, - int behav); void swapout_procs(int); int kernacc(void *, int, int); int useracc(void *, int, int); @@ -124,6 +114,5 @@ struct sf_buf *vm_imgact_map_page(vm_obj void vm_imgact_unmap_page(struct sf_buf *sf); void vm_thread_dispose(struct thread *td); int vm_thread_new(struct thread *td, int pages); -int vm_mlock(struct proc *, struct ucred *, const void *, size_t); #endif /* _KERNEL */ #endif /* !_VM_EXTERN_H_ */ Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon Feb 13 08:23:39 2017 (r313695) +++ head/sys/vm/vm_mmap.c Mon Feb 13 09:04:38 2017 (r313696) @@ -173,23 +173,26 @@ int sys_mmap(struct thread *td, struct mmap_args *uap) { - return (kern_vm_mmap(td, (vm_offset_t)uap->addr, uap->len, - uap->prot, uap->flags, uap->fd, uap->pos)); + return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, uap->prot, + uap->flags, uap->fd, uap->pos)); } int -kern_vm_mmap(struct thread *td, vm_offset_t addr, vm_size_t size, - int prot, int flags, int fd, off_t pos) +kern_mmap(struct thread *td, uintptr_t addr0, size_t size, int prot, int flags, + int fd, off_t pos) { + struct vmspace *vms; struct file *fp; + vm_offset_t addr; vm_size_t pageoff; vm_prot_t cap_maxprot; int align, error; - struct vmspace *vms = td->td_proc->p_vmspace; cap_rights_t rights; + vms = td->td_proc->p_vmspace; fp = NULL; AUDIT_ARG_FD(fd); + addr = addr0; /* * Ignore old flags that used to be defined but did not do anything. @@ -363,8 +366,8 @@ int freebsd6_mmap(struct thread *td, struct freebsd6_mmap_args *uap) { - return (kern_vm_mmap(td, (vm_offset_t)uap->addr, uap->len, - uap->prot, uap->flags, uap->fd, uap->pos)); + return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, uap->prot, + uap->flags, uap->fd, uap->pos)); } #endif @@ -418,8 +421,8 @@ ommap(struct thread *td, struct ommap_ar flags |= MAP_PRIVATE; if (uap->flags & OMAP_FIXED) flags |= MAP_FIXED; - return (kern_vm_mmap(td, (vm_offset_t)uap->addr, uap->len, - prot, flags, uap->fd, uap->pos)); + return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, flags, + uap->fd, uap->pos)); } #endif /* COMPAT_43 */ @@ -435,17 +438,18 @@ int sys_msync(struct thread *td, struct msync_args *uap) { - return (kern_vm_msync(td, (vm_offset_t)uap->addr, uap->len, - uap->flags)); + return (kern_msync(td, (uintptr_t)uap->addr, uap->len, uap->flags)); } int -kern_vm_msync(struct thread *td, vm_offset_t addr, vm_size_t size, int flags) +kern_msync(struct thread *td, uintptr_t addr0, size_t size, int flags) { + vm_offset_t addr; vm_size_t pageoff; vm_map_t map; int rv; + addr = addr0; pageoff = (addr & PAGE_MASK); addr -= pageoff; size += pageoff; @@ -487,23 +491,25 @@ int sys_munmap(struct thread *td, struct munmap_args *uap) { - return (kern_vm_munmap(td, (vm_offset_t)uap->addr, uap->len)); + return (kern_munmap(td, (uintptr_t)uap->addr, uap->len)); } int -kern_vm_munmap(struct thread *td, vm_offset_t addr, vm_size_t size) +kern_munmap(struct thread *td, uintptr_t addr0, size_t size) { #ifdef HWPMC_HOOKS struct pmckern_map_out pkm; vm_map_entry_t entry; bool pmc_handled; #endif + vm_offset_t addr; vm_size_t pageoff; vm_map_t map; if (size == 0) return (EINVAL); + addr = addr0; pageoff = (addr & PAGE_MASK); addr -= pageoff; size += pageoff; @@ -569,16 +575,16 @@ int sys_mprotect(struct thread *td, struct mprotect_args *uap) { - return (kern_vm_mprotect(td, (vm_offset_t)uap->addr, uap->len, - uap->prot)); + return (kern_mprotect(td, (uintptr_t)uap->addr, uap->len, uap->prot)); } int -kern_vm_mprotect(struct thread *td, vm_offset_t addr, vm_size_t size, - vm_prot_t prot) +kern_mprotect(struct thread *td, uintptr_t addr0, size_t size, int prot) { + vm_offset_t addr; vm_size_t pageoff; + addr = addr0; prot = (prot & VM_PROT_ALL); pageoff = (addr & PAGE_MASK); addr -= pageoff; @@ -646,15 +652,14 @@ int sys_madvise(struct thread *td, struct madvise_args *uap) { - return (kern_vm_madvise(td, (vm_offset_t)uap->addr, uap->len, - uap->behav)); + return (kern_madvise(td, (uintptr_t)uap->addr, uap->len, uap->behav)); } int -kern_vm_madvise(struct thread *td, vm_offset_t addr, vm_size_t len, int behav) +kern_madvise(struct thread *td, uintptr_t addr0, size_t len, int behav) { - vm_offset_t start, end; vm_map_t map; + vm_offset_t addr, end, start; int flags; /* @@ -677,6 +682,7 @@ kern_vm_madvise(struct thread *td, vm_of * that VM_*_ADDRESS are not constants due to casts (argh). */ map = &td->td_proc->p_vmspace->vm_map; + addr = addr0; if (addr < vm_map_min(map) || addr + len > vm_map_max(map)) return (EINVAL); if ((addr + len) < addr) @@ -957,11 +963,12 @@ int sys_mlock(struct thread *td, struct mlock_args *uap) { - return (vm_mlock(td->td_proc, td->td_ucred, uap->addr, uap->len)); + return (kern_mlock(td->td_proc, td->td_ucred, + __DECONST(uintptr_t, uap->addr), uap->len)); } int -vm_mlock(struct proc *proc, struct ucred *cred, const void *addr0, size_t len) +kern_mlock(struct proc *proc, struct ucred *cred, uintptr_t addr0, size_t len) { vm_offset_t addr, end, last, start; vm_size_t npages, size; @@ -972,7 +979,7 @@ vm_mlock(struct proc *proc, struct ucred error = priv_check_cred(cred, PRIV_VM_MLOCK, 0); if (error) return (error); - addr = (vm_offset_t)addr0; + addr = addr0; size = len; last = addr + size; start = trunc_page(addr); @@ -1132,13 +1139,13 @@ int sys_munlock(struct thread *td, struct munlock_args *uap) { - return (kern_vm_munlock(td, (vm_offset_t)uap->addr, uap->len)); + return (kern_munlock(td, (uintptr_t)uap->addr, uap->len)); } int -kern_vm_munlock(struct thread *td, vm_offset_t addr, vm_size_t size) +kern_munlock(struct thread *td, uintptr_t addr0, size_t size) { - vm_offset_t end, last, start; + vm_offset_t addr, end, last, start; #ifdef RACCT vm_map_t map; #endif @@ -1147,6 +1154,7 @@ kern_vm_munlock(struct thread *td, vm_of error = priv_check(td, PRIV_VM_MUNLOCK); if (error) return (error); + addr = addr0; last = addr + size; start = trunc_page(addr); end = round_page(last); From owner-svn-src-head@freebsd.org Mon Feb 13 11:37:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B800DCDDB47; Mon, 13 Feb 2017 11:37:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E16D1818; Mon, 13 Feb 2017 11:37:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1DBbros012598; Mon, 13 Feb 2017 11:37:53 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1DBbqKX012592; Mon, 13 Feb 2017 11:37:52 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201702131137.v1DBbqKX012592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 13 Feb 2017 11:37:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313697 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 11:37:54 -0000 Author: ae Date: Mon Feb 13 11:37:52 2017 New Revision: 313697 URL: https://svnweb.freebsd.org/changeset/base/313697 Log: Remove IPsec related PCB code from SCTP. The inpcb structure has inp_sp pointer that is initialized by ipsec_init_pcbpolicy() function. This pointer keeps strorage for IPsec security policies associated with a specific socket. An application can use IP_IPSEC_POLICY and IPV6_IPSEC_POLICY socket options to configure these security policies. Then ip[6]_output() uses inpcb pointer to specify that an outgoing packet is associated with some socket. And IPSEC_OUTPUT() method can use a security policy stored in the inp_sp. For inbound packet the protocol-specific input routine uses IPSEC_CHECK_POLICY() method to check that a packet conforms to inbound security policy configured in the inpcb. SCTP protocol doesn't specify inpcb for ip[6]_output() when it sends packets. Thus IPSEC_OUTPUT() method does not consider such packets as associated with some socket and can not apply security policies from inpcb, even if they are configured. Since IPSEC_CHECK_POLICY() method is called from protocol-specific input routine, it can specify inpcb pointer and associated with socket inbound policy will be checked. But there are two problems: 1. Such check is asymmetric, becasue we can not apply security policy from inpcb for outgoing packet. 2. IPSEC_CHECK_POLICY() expects that caller holds INPCB lock and access to inp_sp is protected. But for SCTP this is not correct, becasue SCTP uses own locks to protect inpcb. To fix these problems remove IPsec related PCB code from SCTP. This imply that IP_IPSEC_POLICY and IPV6_IPSEC_POLICY socket options will be not applicable to SCTP sockets. To be able correctly check inbound security policies for SCTP, mark its protocol header with the PR_LASTHDR flag. Reported by: tuexen Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D9538 Modified: head/sys/netinet/in_proto.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_pcb.c head/sys/netinet6/in6_proto.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Mon Feb 13 09:04:38 2017 (r313696) +++ head/sys/netinet/in_proto.c Mon Feb 13 11:37:52 2017 (r313697) @@ -148,7 +148,7 @@ struct protosw inetsw[] = { .pr_type = SOCK_SEQPACKET, .pr_domain = &inetdomain, .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, + .pr_flags = PR_WANTRCVD|PR_LASTHDR, .pr_input = sctp_input, .pr_ctlinput = sctp_ctlinput, .pr_ctloutput = sctp_ctloutput, @@ -160,7 +160,7 @@ struct protosw inetsw[] = { .pr_type = SOCK_STREAM, .pr_domain = &inetdomain, .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD, + .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_LASTHDR, .pr_input = sctp_input, .pr_ctlinput = sctp_ctlinput, .pr_ctloutput = sctp_ctloutput, Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon Feb 13 09:04:38 2017 (r313696) +++ head/sys/netinet/sctp_input.c Mon Feb 13 11:37:52 2017 (r313697) @@ -5790,40 +5790,6 @@ sctp_common_input_processing(struct mbuf } else if (stcb == NULL) { inp_decr = inp; } -#if defined(IPSEC) || defined(IPSEC_SUPPORT) - /*- - * I very much doubt any of the IPSEC stuff will work but I have no - * idea, so I will leave it in place. - */ - if (inp != NULL) { - switch (dst->sa_family) { -#ifdef INET - case AF_INET: - if (IPSEC_ENABLED(ipv4)) { - if (IPSEC_CHECK_POLICY(ipv4, m, - &inp->ip_inp.inp) != 0) { - SCTP_STAT_INCR(sctps_hdrops); - goto out; - } - } - break; -#endif -#ifdef INET6 - case AF_INET6: - if (IPSEC_ENABLED(ipv6)) { - if (IPSEC_CHECK_POLICY(ipv6, m, - &inp->ip_inp.inp) != 0) { - SCTP_STAT_INCR(sctps_hdrops); - goto out; - } - } - break; -#endif - default: - break; - } - } -#endif /* IPSEC */ SCTPDBG(SCTP_DEBUG_INPUT1, "Ok, Common input processing called, m:%p iphlen:%d offset:%d length:%d stcb:%p\n", (void *)m, iphlen, offset, length, (void *)stcb); if (stcb) { Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Mon Feb 13 09:04:38 2017 (r313696) +++ head/sys/netinet/sctp_os_bsd.h Mon Feb 13 11:37:52 2017 (r313697) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); /* * includes */ -#include "opt_ipsec.h" #include "opt_compat.h" #include "opt_inet6.h" #include "opt_inet.h" @@ -82,8 +81,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #ifdef INET6 #include #include @@ -94,7 +91,6 @@ __FBSDID("$FreeBSD$"); #include #endif /* INET6 */ - #include #include Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Feb 13 09:04:38 2017 (r313696) +++ head/sys/netinet/sctp_pcb.c Mon Feb 13 11:37:52 2017 (r313697) @@ -2469,15 +2469,6 @@ sctp_inpcb_alloc(struct socket *so, uint SCTP_INP_INFO_WUNLOCK(); return (ENOBUFS); } -#if defined(IPSEC) || defined(IPSEC_SUPPORT) - error = ipsec_init_pcbpolicy(&inp->ip_inp.inp); - if (error != 0) { - crfree(inp->ip_inp.inp.inp_cred); - SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); - SCTP_INP_INFO_WUNLOCK(); - return error; - } -#endif /* IPSEC */ SCTP_INCR_EP_COUNT(); inp->ip_inp.inp.inp_ip_ttl = MODULE_GLOBAL(ip_defttl); SCTP_INP_INFO_WUNLOCK(); @@ -2504,9 +2495,6 @@ sctp_inpcb_alloc(struct socket *so, uint SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EOPNOTSUPP); so->so_pcb = NULL; crfree(inp->ip_inp.inp.inp_cred); -#if defined(IPSEC) || defined(IPSEC_SUPPORT) - ipsec_delete_pcbpolicy(&inp->ip_inp.inp); -#endif SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); return (EOPNOTSUPP); } @@ -2527,9 +2515,6 @@ sctp_inpcb_alloc(struct socket *so, uint SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, ENOBUFS); so->so_pcb = NULL; crfree(inp->ip_inp.inp.inp_cred); -#if defined(IPSEC) || defined(IPSEC_SUPPORT) - ipsec_delete_pcbpolicy(&inp->ip_inp.inp); -#endif SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_ep), inp); return (ENOBUFS); } @@ -3641,9 +3626,6 @@ sctp_inpcb_free(struct sctp_inpcb *inp, * macro here since le_next will get freed as part of the * sctp_free_assoc() call. */ -#if defined(IPSEC) || defined(IPSEC_SUPPORT) - ipsec_delete_pcbpolicy(ip_pcb); -#endif if (ip_pcb->inp_options) { (void)sctp_m_free(ip_pcb->inp_options); ip_pcb->inp_options = 0; Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Mon Feb 13 09:04:38 2017 (r313696) +++ head/sys/netinet6/in6_proto.c Mon Feb 13 11:37:52 2017 (r313697) @@ -185,7 +185,7 @@ struct protosw inet6sw[] = { .pr_type = SOCK_SEQPACKET, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, + .pr_flags = PR_WANTRCVD|PR_LASTHDR, .pr_input = sctp6_input, .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, @@ -199,7 +199,7 @@ struct protosw inet6sw[] = { .pr_type = SOCK_STREAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD, + .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_LASTHDR, .pr_input = sctp6_input, .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Mon Feb 13 09:04:38 2017 (r313696) +++ head/sys/netinet6/sctp6_usrreq.c Mon Feb 13 11:37:52 2017 (r313697) @@ -551,10 +551,6 @@ sctp6_attach(struct socket *so, int prot */ inp6->inp_ip_ttl = MODULE_GLOBAL(ip_defttl); #endif - /* - * Hmm what about the IPSEC stuff that is missing here but in - * sctp_attach()? - */ SCTP_INP_WUNLOCK(inp); return (0); } From owner-svn-src-head@freebsd.org Mon Feb 13 12:04:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB8AACDCC38; Mon, 13 Feb 2017 12:04:51 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (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 4B4CDB27; Mon, 13 Feb 2017 12:04:50 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id v1DC4dpt056275; Mon, 13 Feb 2017 15:04:39 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Mon, 13 Feb 2017 15:04:39 +0300 (MSK) From: Dmitry Morozovsky To: Glen Barber cc: Cy Schubert , =?ISO-8859-15?Q?Ermal_Lu=E7i?= , svn-src-head@freebsd.org, George Neville-Neil , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r313675 - in head/sys: netinet netinet6 In-Reply-To: <20170212183327.GA2002@FreeBSD.org> Message-ID: References: <53D3A92C-6C64-4C0C-A5E6-B659BFA139BF@neville-neil.com> <201702121624.v1CGOQGr009733@slippy.cwsent.com> <20170212183327.GA2002@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Mon, 13 Feb 2017 15:04:40 +0300 (MSK) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 12:04:51 -0000 On Sun, 12 Feb 2017, Glen Barber wrote: [snip previous] > > I didn't read this when I hit send on my email. Hopefully nobody takes > > offense. I was upset and still am. > > > > I still think that the revision numbers of any backout should have been > > documented in the commit log. > > > > I absolutely agree, and was the key meaning behind my "what exactly does > this mean?" reply. The commit log, as-is, provides nothing useful to > the reader. > > > Something we could do, as is expected by re@ for commits during a freeze, > > is metees also let their mentors know of what the contents of commit log > > messages will be. I think commit log messages discussing the what, why and > > rationale are as important as the code itself. > > > > I thought this was standard practice. But if not, I would agree that > both code changes and the commit log should be both approved by the > mentor. Shouldn't we then emphacise this in the Committer's Guide? -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@freebsd.org Mon Feb 13 16:45:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C05BCDD9CB; Mon, 13 Feb 2017 16:45:43 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id E792E69E; Mon, 13 Feb 2017 16:45:42 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 21EF8564DF; Mon, 13 Feb 2017 10:45:42 -0600 (CST) Subject: Re: svn commit: r313401 - head/sys/netinet To: Adrian Chadd References: <201702071857.v17Ivvn1018291@repo.freebsd.org> <20170210201008.GG1973@FreeBSD.org> <5f3b4a86-7ca0-e823-346c-b035c0d5390b@FreeBSD.org> Cc: Ed Maste , Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Eric van Gyzen Message-ID: <354d0302-e923-6d4d-a627-b637c5f96fa4@FreeBSD.org> Date: Mon, 13 Feb 2017 10:45:41 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 16:45:43 -0000 On 02/11/2017 11:02, Adrian Chadd wrote: > Can we do the same with ether_ntoa too? ether_ntoa doesn't exist in the kernel. Eric From owner-svn-src-head@freebsd.org Mon Feb 13 17:44:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19256CDDC49; Mon, 13 Feb 2017 17:44:09 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE2DE134A; Mon, 13 Feb 2017 17:44:08 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1DHi7X9064010; Mon, 13 Feb 2017 17:44:07 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1DHi7NO064008; Mon, 13 Feb 2017 17:44:07 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201702131744.v1DHi7NO064008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Mon, 13 Feb 2017 17:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313701 - in head: sbin/mdconfig sys/dev/md X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 17:44:09 -0000 Author: stevek Date: Mon Feb 13 17:44:07 2017 New Revision: 313701 URL: https://svnweb.freebsd.org/changeset/base/313701 Log: For MD_PRELOAD type md(4) devices, if there is a file name in the preloaded meta-data, copy it into the softc structure. When returning md(4) device details to the caller, include the file name in any MD_PRELOAD type devices if it is set (first character is not NUL.) In mdconfig, for "preload" type md(4) devices, if there is file config available, print it in the file column of the output. Reviewed by: brooks Approved by: sjg (mentor) MFC after: 1 month Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D9529 Modified: head/sbin/mdconfig/mdconfig.c head/sys/dev/md/md.c Modified: head/sbin/mdconfig/mdconfig.c ============================================================================== --- head/sbin/mdconfig/mdconfig.c Mon Feb 13 16:11:37 2017 (r313700) +++ head/sbin/mdconfig/mdconfig.c Mon Feb 13 17:44:07 2017 (r313701) @@ -452,7 +452,8 @@ md_list(const char *units, int opt, cons } gc = &pp->lg_config; type = geom_config_get(gc, "type"); - if (strcmp(type, "vnode") == 0) { + if (strcmp(type, "vnode") == 0 || + strcmp(type, "preload") == 0) { file = geom_config_get(gc, "file"); if (fflag != NULL && strcmp(fflag, file) != 0) Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Mon Feb 13 16:11:37 2017 (r313700) +++ head/sys/dev/md/md.c Mon Feb 13 17:44:07 2017 (r313701) @@ -1689,7 +1689,8 @@ xmdctlioctl(struct cdev *dev, u_long cmd mdio->md_options = sc->flags; mdio->md_mediasize = sc->mediasize; mdio->md_sectorsize = sc->sectorsize; - if (sc->type == MD_VNODE) + if (sc->type == MD_VNODE || + (sc->type == MD_PRELOAD && mdio->md_file != NULL)) error = copyout(sc->file, mdio->md_file, strlen(sc->file) + 1); return (error); @@ -1733,6 +1734,8 @@ md_preloaded(u_char *image, size_t lengt sc->pl_ptr = image; sc->pl_len = length; sc->start = mdstart_preload; + if (name != NULL) + strlcpy(sc->file, name, sizeof(sc->file)); #if defined(MD_ROOT) && !defined(ROOTDEVNAME) if (sc->unit == 0) rootdevnames[0] = MD_ROOT_FSTYPE ":/dev/md0"; @@ -1835,7 +1838,8 @@ g_md_dumpconf(struct sbuf *sb, const cha sbuf_printf(sb, " fs %ju", (uintmax_t) mp->fwsectors); sbuf_printf(sb, " l %ju", (uintmax_t) mp->mediasize); sbuf_printf(sb, " t %s", type); - if (mp->type == MD_VNODE && mp->vnode != NULL) + if ((mp->type == MD_VNODE && mp->vnode != NULL) || + (mp->type == MD_PRELOAD && mp->file[0] != '\0')) sbuf_printf(sb, " file %s", mp->file); } else { sbuf_printf(sb, "%s%d\n", indent, @@ -1855,7 +1859,8 @@ g_md_dumpconf(struct sbuf *sb, const cha "read-only"); sbuf_printf(sb, "%s%s\n", indent, type); - if (mp->type == MD_VNODE && mp->vnode != NULL) { + if ((mp->type == MD_VNODE && mp->vnode != NULL) || + (mp->type == MD_PRELOAD && mp->file[0] != '\0')) sbuf_printf(sb, "%s", indent); g_conf_printf_escaped(sb, "%s", mp->file); sbuf_printf(sb, "\n"); From owner-svn-src-head@freebsd.org Mon Feb 13 18:24:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF280CDD976; Mon, 13 Feb 2017 18:24:14 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 561FBD4F; Mon, 13 Feb 2017 18:24:13 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([92.225.33.179]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MCtNr-1cUmim2OeZ-009i9O; Mon, 13 Feb 2017 19:24:11 +0100 Date: Mon, 13 Feb 2017 19:24:04 +0100 From: "O. Hartmann" To: "Stephen J. Kiernan" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313701 - in head: sbin/mdconfig sys/dev/md Message-ID: <20170213192404.01c6072b@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201702131744.v1DHi7NO064008@repo.freebsd.org> References: <201702131744.v1DHi7NO064008@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/FiJcbUNJfGiAp4FoX5w5yxA"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:Fid6kGGinfhYgvarkz6g4qyINuHEHz0cILW0CzHRAlD+U6I12M8 o4MCL9GyRF+bPfd87iNc6dcrVxv8744lUuXLOBzY1VIfawcOJL2GjiOoJIHHEdsaM8kATKw faod8zPq5uxuty4qQCzAE40PEVJX4gtuFB9+tug3/NhuMwqcUF65rqxyv/PXuYPK/BCBsOY HJtMcAP5O+y2qXuRmJhXw== X-UI-Out-Filterresults: notjunk:1;V01:K0:AjgHcY4ydCE=:j0ADAWQoVwqSAe/fi2QzbP nLrt/KmW8IiYo+b1wme6RdpCvOYey5C1hEq4hRq0/NHCrvNdyYkTtNXFHZo3++vlbih5XYWkJ z7BiPDhVGquFJAkZ/zdoDHNZKiFCOpRMkjTXPMsWgspHDgjsyZpujIDcoqQj35bnr+QT/RtPq 9djsTb1/c8cMRvAEttVfXmL15+wNUyd4O5lj6Zqe220J9FlWUEo9S5k5lKBQqqKYli/HX9JDw GQmIB4LbfGXhlxttEHankOuaymG1TTXwfSbx5Xbt8lHSRYHYBebpRlcDv9KT/L4JxnAsd/dZh C8/dVzx7spYnfmEvgFcP9IiX9H55ac0OxBvlM/B9nWHmQ3cQgaJunCjFGn/kaYuEhjx79tYXq QHXtyuLNolsh1NCLsXxiwmTb1GHXf8t/zRGOXflv+lUwPCh7Ljz+R0At1tPYbi+sCcKY0/6p/ /chsrIfnw1PQcU8b1qijhK/lIAC2xfl5vnIyUtb0Gb/wS2aHnICdfyCG7A5+tAliDomgMmje6 qiaRoBLt6jXP/YHEfyrTIurLaP6XKqKZDn8dwKbcvTN4v+S9vuDG8plQfocrXDB+HMKd00RRP n7z4qdpLt8hITTJIX7pjfs1hYX50u6qWGUadWA9D5MvffcgmrFTFMGKcy8QuPODhnoyJz5Twg 5U2Giox2w5xJpyMxXuW6UqdTga/sS+YNuANQx4B2xTcUHOwE+mqUE0P1YuJV8jY/cu6uuB3Ji vATVyHwnlTJp72aJIkEnzJZ6/sBsEaeffWL4R9AUeyrnBpXAVshDfxXf4tA= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 18:24:15 -0000 --Sig_/FiJcbUNJfGiAp4FoX5w5yxA Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Am Mon, 13 Feb 2017 17:44:07 +0000 (UTC) "Stephen J. Kiernan" schrieb: > Author: stevek > Date: Mon Feb 13 17:44:07 2017 > New Revision: 313701 > URL: https://svnweb.freebsd.org/changeset/base/313701 >=20 > Log: > For MD_PRELOAD type md(4) devices, if there is a file name in the prelo= aded > meta-data, copy it into the softc structure. > =20 > When returning md(4) device details to the caller, include the file nam= e in > any MD_PRELOAD type devices if it is set (first character is not NUL.) > =20 > In mdconfig, for "preload" type md(4) devices, if there is file config > available, print it in the file column of the output. > =20 > Reviewed by: brooks > Approved by: sjg (mentor) > MFC after: 1 month > Sponsored by: Juniper Networks, Inc. > Differential Revision: https://reviews.freebsd.org/D9529 >=20 > Modified: > head/sbin/mdconfig/mdconfig.c > head/sys/dev/md/md.c >=20 > Modified: head/sbin/mdconfig/mdconfig.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/mdconfig/mdconfig.c Mon Feb 13 16:11:37 2017 (r313700) > +++ head/sbin/mdconfig/mdconfig.c Mon Feb 13 17:44:07 2017 (r313701) > @@ -452,7 +452,8 @@ md_list(const char *units, int opt, cons > } > gc =3D &pp->lg_config; > type =3D geom_config_get(gc, "type"); > - if (strcmp(type, "vnode") =3D=3D 0) { > + if (strcmp(type, "vnode") =3D=3D 0 || > + strcmp(type, "preload") =3D=3D 0) { > file =3D geom_config_get(gc, "file"); > if (fflag !=3D NULL && > strcmp(fflag, file) !=3D 0) >=20 > Modified: head/sys/dev/md/md.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/md/md.c Mon Feb 13 16:11:37 2017 (r313700) > +++ head/sys/dev/md/md.c Mon Feb 13 17:44:07 2017 (r313701) > @@ -1689,7 +1689,8 @@ xmdctlioctl(struct cdev *dev, u_long cmd > mdio->md_options =3D sc->flags; > mdio->md_mediasize =3D sc->mediasize; > mdio->md_sectorsize =3D sc->sectorsize; > - if (sc->type =3D=3D MD_VNODE) > + if (sc->type =3D=3D MD_VNODE || > + (sc->type =3D=3D MD_PRELOAD && mdio->md_file !=3D NULL)) > error =3D copyout(sc->file, mdio->md_file, > strlen(sc->file) + 1); > return (error); > @@ -1733,6 +1734,8 @@ md_preloaded(u_char *image, size_t lengt > sc->pl_ptr =3D image; > sc->pl_len =3D length; > sc->start =3D mdstart_preload; > + if (name !=3D NULL) > + strlcpy(sc->file, name, sizeof(sc->file)); > #if defined(MD_ROOT) && !defined(ROOTDEVNAME) > if (sc->unit =3D=3D 0) > rootdevnames[0] =3D MD_ROOT_FSTYPE ":/dev/md0"; > @@ -1835,7 +1838,8 @@ g_md_dumpconf(struct sbuf *sb, const cha > sbuf_printf(sb, " fs %ju", (uintmax_t) mp->fwsectors); > sbuf_printf(sb, " l %ju", (uintmax_t) mp->mediasize); > sbuf_printf(sb, " t %s", type); > - if (mp->type =3D=3D MD_VNODE && mp->vnode !=3D NULL) > + if ((mp->type =3D=3D MD_VNODE && mp->vnode !=3D NULL) || > + (mp->type =3D=3D MD_PRELOAD && mp->file[0] !=3D '\0')) > sbuf_printf(sb, " file %s", mp->file); > } else { > sbuf_printf(sb, "%s%d\n", indent, > @@ -1855,7 +1859,8 @@ g_md_dumpconf(struct sbuf *sb, const cha > "read-only"); > sbuf_printf(sb, "%s%s\n", indent, > type); > - if (mp->type =3D=3D MD_VNODE && mp->vnode !=3D NULL) { > + if ((mp->type =3D=3D MD_VNODE && mp->vnode !=3D NULL) || > + (mp->type =3D=3D MD_PRELOAD && mp->file[0] !=3D '\0')) > sbuf_printf(sb, "%s", indent); > g_conf_printf_escaped(sb, "%s", mp->file); > sbuf_printf(sb, "\n"); > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" This broke kernel build on recent CURRENT: [...] =3D=3D=3D> mdio (all) --- all_subdir_md --- --- md.o --- /usr/src/sys/modules/md/../../dev/md/md.c:1870:1: error: extraneous closing= brace ('}') } ^ 1 error generated. *** [md.o] Error code 1 make[4]: stopped in /usr/src/sys/modules/md Kind regards, Oliver --Sig_/FiJcbUNJfGiAp4FoX5w5yxA Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWKH5xAAKCRDS528fyFhY lHPOAf9NZ0KCflGWxC/OdJk2So2EGrWxFHaEuMkwCB4bI3HyvqplMEKckWOkzQBQ d1zlpw6TLSs0hjOZIa8Wo0g5OvR7Af9vZygPRiXTUHZrPFocpFXpQbAbxe/jNsEY +OwBKgsJxz5NtoWPjzPd+Ch5QQjFP8ChJoJGDRyTuQQ2X2FI66LN =JTfk -----END PGP SIGNATURE----- --Sig_/FiJcbUNJfGiAp4FoX5w5yxA-- From owner-svn-src-head@freebsd.org Mon Feb 13 18:52:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2863ECDD2BD; Mon, 13 Feb 2017 18:52:28 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC1E61F3C; Mon, 13 Feb 2017 18:52:27 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1DIqRde090617; Mon, 13 Feb 2017 18:52:27 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1DIqRrc090616; Mon, 13 Feb 2017 18:52:27 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201702131852.v1DIqRrc090616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Mon, 13 Feb 2017 18:52:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313703 - head/sys/dev/md X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 18:52:28 -0000 Author: stevek Date: Mon Feb 13 18:52:26 2017 New Revision: 313703 URL: https://svnweb.freebsd.org/changeset/base/313703 Log: Fix typo where opening brace was needed. Reported by: Michael Butler Reviewed by: sjg Approved by: sjg (mentor) Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Mon Feb 13 18:39:21 2017 (r313702) +++ head/sys/dev/md/md.c Mon Feb 13 18:52:26 2017 (r313703) @@ -1860,7 +1860,7 @@ g_md_dumpconf(struct sbuf *sb, const cha sbuf_printf(sb, "%s%s\n", indent, type); if ((mp->type == MD_VNODE && mp->vnode != NULL) || - (mp->type == MD_PRELOAD && mp->file[0] != '\0')) + (mp->type == MD_PRELOAD && mp->file[0] != '\0')) { sbuf_printf(sb, "%s", indent); g_conf_printf_escaped(sb, "%s", mp->file); sbuf_printf(sb, "\n"); From owner-svn-src-head@freebsd.org Mon Feb 13 19:00:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0DCACDD59D; Mon, 13 Feb 2017 19:00:10 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76B369E0; Mon, 13 Feb 2017 19:00:10 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1DJ096x093711; Mon, 13 Feb 2017 19:00:09 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1DJ09lj093710; Mon, 13 Feb 2017 19:00:09 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201702131900.v1DJ09lj093710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 13 Feb 2017 19:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313704 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 19:00:10 -0000 Author: ed Date: Mon Feb 13 19:00:09 2017 New Revision: 313704 URL: https://svnweb.freebsd.org/changeset/base/313704 Log: Make work on its own. Right now this header file doesn't want to build when included on its own, as it depends on some integer types that are only declared internally. Switch it over to use and the __* counterparts. Modified: head/sys/sys/event.h Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Mon Feb 13 18:52:26 2017 (r313703) +++ head/sys/sys/event.h Mon Feb 13 19:00:09 2017 (r313704) @@ -29,7 +29,8 @@ #ifndef _SYS_EVENT_H_ #define _SYS_EVENT_H_ -#include +#include +#include #define EVFILT_READ (-1) #define EVFILT_WRITE (-2) @@ -57,11 +58,11 @@ } while(0) struct kevent { - uintptr_t ident; /* identifier for this event */ + __uintptr_t ident; /* identifier for this event */ short filter; /* filter for event */ - u_short flags; - u_int fflags; - intptr_t data; + unsigned short flags; + unsigned int fflags; + __intptr_t data; void *udata; /* opaque user data identifier */ }; From owner-svn-src-head@freebsd.org Mon Feb 13 19:07:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7218CDDDDE; Mon, 13 Feb 2017 19:07:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.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 871B2170A; Mon, 13 Feb 2017 19:07:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id EA17510A791; Mon, 13 Feb 2017 14:07:40 -0500 (EST) From: John Baldwin To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313696 - in head/sys: compat/cloudabi compat/freebsd32 compat/linux kern sys vm Date: Mon, 13 Feb 2017 10:51:06 -0800 Message-ID: <13521546.cRWLFkIb9W@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201702130904.v1D94c2t052291@repo.freebsd.org> References: <201702130904.v1D94c2t052291@repo.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.4.3 (mail.baldwin.cx); Mon, 13 Feb 2017 14:07:41 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 19:07:42 -0000 On Monday, February 13, 2017 09:04:38 AM Konstantin Belousov wrote: > Author: kib > Date: Mon Feb 13 09:04:38 2017 > New Revision: 313696 > URL: https://svnweb.freebsd.org/changeset/base/313696 > > Log: > Rework r313352. > > Rename kern_vm_* functions to kern_*. Move the prototypes to > syscallsubr.h. Also change Mach VM types to uintptr_t/size_t as > needed, to avoid headers pollution. > > Requested by: alc, jhb > Reviewed by: alc > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > Differential revision: https://reviews.freebsd.org/D9535 Thanks! -- John Baldwin From owner-svn-src-head@freebsd.org Mon Feb 13 19:53:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87527CDD46D; Mon, 13 Feb 2017 19:53:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x235.google.com (mail-qt0-x235.google.com [IPv6:2607:f8b0:400d:c0d::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4102A1E38; Mon, 13 Feb 2017 19:53:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x235.google.com with SMTP id w20so92861194qtb.1; Mon, 13 Feb 2017 11:53:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=QuyVNvdA61WvPMwp6wGriVls/0pGCQsNnrXo6o2Qt+w=; b=KSR/yIJZYWWwll6aZO8DwhAzmwQ7EzOLjDNyoBMQINgAXVSH6cws3AoE1Ukgyup+9O 9YBjJRi71kINLafER5ij75ZlOsnB0KlNC6+k8O/EoKAzoihMK+QVv4Sz3VIa6AauQLpV l5kgChMymt8iqemleDvw9YyKGG9Ym0ui7COsDx6d3EFgYUrbhHlUz/CnBTeQWzF3DJMv d04psCVbiPSfgKLb6ocyneKnK4I8e6GVVredoj7VBxyfgf91Rl73iBrjIkGXmXro6WTt RsT6CH7MBsT0BFBOt12V2RureFJNJEWRVL8O6aFrUZOWy9dtSZbhIZnAnDuU2pHHZ/bI Ma+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=QuyVNvdA61WvPMwp6wGriVls/0pGCQsNnrXo6o2Qt+w=; b=Gg2oiSeMR7c824yXcsRQSABnbGijZBLobkKDfXrgDkpa5pIeX/c5y9HLP1mdQEebbn Wus1WcN7Fmhe9GqLw2W+Dpp5UvmHXxG2IRUkzp5KDOB4LoGxwiVhiBoiGJRJcB3rPvLc ekVckNHTYkbPSijq1NQsTIsClAJfng6eO5Dhq0TEnZptDMkq5q5WienD6cutqEEjUKdL iy/1W4fJY7p4exlkXiE2eG1yy7qMaKaW0Xwmo9mqkt4Ct6Q1YI2Fa+HPTpofeVq7Ohl6 Xaiof4yPqlTB2bAGbGtnZGV43tqUll6Nt/Y4C1J8lxSspvFQqFC6kYtYhzUjBggQOwdK qjGg== X-Gm-Message-State: AMke39nKf5eybj7Hh/TnPaGx/XU3GJzulQjnFWDcEMlaRZHrh8eWIgoEkzBTYbnSOcY+UMfawTRw5k5GsFYjdw== X-Received: by 10.200.36.207 with SMTP id t15mr24233096qtt.84.1487015594033; Mon, 13 Feb 2017 11:53:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.84.230 with HTTP; Mon, 13 Feb 2017 11:53:13 -0800 (PST) In-Reply-To: <201702131900.v1DJ09lj093710@repo.freebsd.org> References: <201702131900.v1DJ09lj093710@repo.freebsd.org> From: Ngie Cooper Date: Mon, 13 Feb 2017 11:53:13 -0800 Message-ID: Subject: Re: svn commit: r313704 - head/sys/sys To: Ed Schouten Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 19:53:15 -0000 On Mon, Feb 13, 2017 at 11:00 AM, Ed Schouten wrote: > Author: ed > Date: Mon Feb 13 19:00:09 2017 > New Revision: 313704 > URL: https://svnweb.freebsd.org/changeset/base/313704 > > Log: > Make work on its own. > > Right now this header file doesn't want to build when included on its > own, as it depends on some integer types that are only declared > internally. Switch it over to use and the __* > counterparts. Thanks! Should kqueue(2)/kevent(2) be updated? -Ngie From owner-svn-src-head@freebsd.org Mon Feb 13 19:58:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 118A6CDD519; Mon, 13 Feb 2017 19:58:57 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D14825FA; Mon, 13 Feb 2017 19:58:56 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1DJwtud021621; Mon, 13 Feb 2017 19:58:55 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1DJwtvd021615; Mon, 13 Feb 2017 19:58:55 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201702131958.v1DJwtvd021615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Mon, 13 Feb 2017 19:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313705 - in head/sys: conf dev/bhnd dev/bhnd/bcma dev/bhnd/siba mips/broadcom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 19:58:57 -0000 Author: landonf Date: Mon Feb 13 19:58:55 2017 New Revision: 313705 URL: https://svnweb.freebsd.org/changeset/base/313705 Log: [mips/broadcom] Move MIPS-specific bhnd(4) nexus drivers to sys/mips/broadcom, and add MIPS/BCM4706-specific workaround to bhnd_nexus_is_hw_disabled() -- the BCM4706 low-cost package leaves secondary GMAC cores floating. Reviewed by: mizhka Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D9499 Added: head/sys/mips/broadcom/bcma_nexus.c - copied, changed from r313704, head/sys/dev/bhnd/bcma/bcma_nexus.c head/sys/mips/broadcom/bhnd_nexus.c - copied, changed from r313704, head/sys/dev/bhnd/bhnd_nexus.c head/sys/mips/broadcom/bhnd_nexusvar.h - copied, changed from r313704, head/sys/dev/bhnd/bhnd_nexusvar.h head/sys/mips/broadcom/siba_nexus.c - copied, changed from r313704, head/sys/dev/bhnd/siba/siba_nexus.c Deleted: head/sys/dev/bhnd/bcma/bcma_nexus.c head/sys/dev/bhnd/bhnd_nexus.c head/sys/dev/bhnd/bhnd_nexusvar.h head/sys/dev/bhnd/siba/siba_nexus.c Modified: head/sys/conf/files head/sys/mips/broadcom/files.broadcom Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 13 19:00:09 2017 (r313704) +++ head/sys/conf/files Mon Feb 13 19:58:55 2017 (r313705) @@ -1190,8 +1190,6 @@ dev/bge/if_bge.c optional bge dev/bhnd/bhnd.c optional bhnd dev/bhnd/bhnd_erom.c optional bhnd dev/bhnd/bhnd_erom_if.m optional bhnd -dev/bhnd/bhnd_nexus.c optional bhnd siba_nexus | \ - bhnd bcma_nexus dev/bhnd/bhnd_subr.c optional bhnd dev/bhnd/bhnd_bus_if.m optional bhnd dev/bhnd/bhndb/bhnd_bhndb.c optional bhndb bhnd @@ -1206,7 +1204,6 @@ dev/bhnd/bhndb/bhndb_subr.c optional bh dev/bhnd/bcma/bcma.c optional bcma bhnd dev/bhnd/bcma/bcma_bhndb.c optional bcma bhnd bhndb dev/bhnd/bcma/bcma_erom.c optional bcma bhnd -dev/bhnd/bcma/bcma_nexus.c optional bcma_nexus bcma bhnd dev/bhnd/bcma/bcma_subr.c optional bcma bhnd dev/bhnd/cores/chipc/bhnd_chipc_if.m optional bhnd dev/bhnd/cores/chipc/bhnd_sprom_chipc.c optional bhnd @@ -1252,7 +1249,6 @@ dev/bhnd/nvram/bhnd_sprom.c optional bh dev/bhnd/siba/siba.c optional siba bhnd dev/bhnd/siba/siba_bhndb.c optional siba bhnd bhndb dev/bhnd/siba/siba_erom.c optional siba bhnd -dev/bhnd/siba/siba_nexus.c optional siba_nexus siba bhnd dev/bhnd/siba/siba_subr.c optional siba bhnd # dev/bktr/bktr_audio.c optional bktr pci Copied and modified: head/sys/mips/broadcom/bcma_nexus.c (from r313704, head/sys/dev/bhnd/bcma/bcma_nexus.c) ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_nexus.c Mon Feb 13 19:00:09 2017 (r313704, copy source) +++ head/sys/mips/broadcom/bcma_nexus.c Mon Feb 13 19:58:55 2017 (r313705) @@ -43,49 +43,41 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include "bcmavar.h" -#include "bcma_eromreg.h" +#include + +#include "bcm_machdep.h" + +#include "bhnd_nexusvar.h" /* - * Supports bcma(4) attachment to a nexus bus. + * Supports bcma(4) attachment to a MIPS nexus bus. */ static int bcma_nexus_attach(device_t); static int bcma_nexus_probe(device_t); -struct bcma_nexus_softc { - struct bcma_softc parent_sc; - struct bhnd_chipid bcma_cid; -}; - static int bcma_nexus_probe(device_t dev) { - struct bcma_nexus_softc *sc; - int error; - - sc = device_get_softc(dev); - - /* Read the ChipCommon info using the hints the kernel - * was compiled with. */ - if ((error = bhnd_nexus_read_chipid(dev, &sc->bcma_cid))) - return (error); + int error; - if (sc->bcma_cid.chip_type != BHND_CHIPTYPE_BCMA) + switch (bcm_get_platform()->cid.chip_type) { + case BHND_CHIPTYPE_BCMA: + case BHND_CHIPTYPE_BCMA_ALT: + case BHND_CHIPTYPE_UBUS: + break; + default: return (ENXIO); + } - if ((error = bcma_probe(dev)) > 0) { - device_printf(dev, "error %d in probe\n", error); + if ((error = bcma_probe(dev)) > 0) return (error); - } /* Set device description */ - bhnd_set_default_bus_desc(dev, &sc->bcma_cid); + bhnd_set_default_bus_desc(dev, &bcm_get_platform()->cid); - return (0); + return (BUS_PROBE_SPECIFIC); } static int @@ -108,25 +100,15 @@ failed: return (error); } -static const struct bhnd_chipid * -bcma_nexus_get_chipid(device_t dev, device_t child) { - struct bcma_nexus_softc *sc = device_get_softc(dev); - return (&sc->bcma_cid); -} - static device_method_t bcma_nexus_methods[] = { - /* Device interface */ DEVMETHOD(device_probe, bcma_nexus_probe), DEVMETHOD(device_attach, bcma_nexus_attach), - /* bhnd interface */ - DEVMETHOD(bhnd_bus_get_chipid, bcma_nexus_get_chipid), - DEVMETHOD_END }; DEFINE_CLASS_2(bhnd, bcma_nexus_driver, bcma_nexus_methods, - sizeof(struct bcma_nexus_softc), bhnd_nexus_driver, bcma_driver); + sizeof(struct bcma_softc), bhnd_nexus_driver, bcma_driver); EARLY_DRIVER_MODULE(bcma_nexus, nexus, bcma_nexus_driver, bhnd_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); Copied and modified: head/sys/mips/broadcom/bhnd_nexus.c (from r313704, head/sys/dev/bhnd/bhnd_nexus.c) ============================================================================== --- head/sys/dev/bhnd/bhnd_nexus.c Mon Feb 13 19:00:09 2017 (r313704, copy source) +++ head/sys/mips/broadcom/bhnd_nexus.c Mon Feb 13 19:58:55 2017 (r313705) @@ -32,10 +32,9 @@ #include __FBSDID("$FreeBSD$"); - /* * bhnd(4) driver mix-in providing shared common methods for - * bhnd bus devices attached via a root nexus. + * bhnd bus devices attached via a MIPS root nexus. */ #include @@ -48,50 +47,16 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include -#include "bhnd_nexusvar.h" +#include "bcm_machdep.h" -static const struct resource_spec bhnd_nexus_res_spec[] = { - { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* chipc registers */ - { -1, 0, 0 } -}; +#include "bhnd_nexusvar.h" /** - * Map ChipCommon's register block and read the chip identifier data. - * - * @param dev A bhnd_nexus device. - * @param chipid On success, will be populated with the chip identifier. - * @retval 0 success - * @retval non-zero An error occurred reading the chip identifier.. - */ -int -bhnd_nexus_read_chipid(device_t dev, struct bhnd_chipid *chipid) -{ - struct resource_spec rspec[nitems(bhnd_nexus_res_spec)]; - int error; - - memcpy(rspec, bhnd_nexus_res_spec, sizeof(rspec)); - error = bhnd_read_chipid(dev, rspec, 0, chipid); - if (error) - device_printf(dev, "error %d reading chip ID\n", error); - - return (error); -} - -static bool -bhnd_nexus_is_hw_disabled(device_t dev, device_t child) -{ - return (false); -} - -static bhnd_attach_type -bhnd_nexus_get_attach_type(device_t dev, device_t child) -{ - return (BHND_ATTACH_NATIVE); -} - + * Default bhnd_nexus implementation of BHND_BUS_ACTIVATE_RESOURCE(). + */ static int bhnd_nexus_activate_resource(device_t dev, device_t child, int type, int rid, struct bhnd_resource *r) @@ -106,6 +71,9 @@ bhnd_nexus_activate_resource(device_t de return (0); } +/** + * Default bhnd_nexus implementation of BHND_BUS_DEACTIVATE_RESOURCE(). + */ static int bhnd_nexus_deactivate_resource(device_t dev, device_t child, int type, int rid, struct bhnd_resource *r) @@ -122,6 +90,52 @@ bhnd_nexus_deactivate_resource(device_t return (0); } +/** + * Default bhnd_nexus implementation of BHND_BUS_IS_HW_DISABLED(). + */ +static bool +bhnd_nexus_is_hw_disabled(device_t dev, device_t child) +{ + struct bcm_platform *bp; + struct bhnd_chipid *cid; + + bp = bcm_get_platform(); + cid = &bp->cid; + + /* The BCM4706 low-cost package leaves secondary GMAC cores + * floating */ + if (cid->chip_id == BHND_CHIPID_BCM4706 && + cid->chip_pkg == BHND_PKGID_BCM4706L && + bhnd_get_device(child) == BHND_COREID_4706_GMAC && + bhnd_get_core_unit(child) != 0) + { + return (true); + } + + return (false); +} + +/** + * Default bhnd_nexus implementation of BHND_BUS_AGET_ATTACH_TYPE(). + */ +static bhnd_attach_type +bhnd_nexus_get_attach_type(device_t dev, device_t child) +{ + return (BHND_ATTACH_NATIVE); +} + +/** + * Default bhnd_nexus implementation of BHND_BUS_GET_CHIPID(). + */ +static const struct bhnd_chipid * +bhnd_nexus_get_chipid(device_t dev, device_t child) +{ + return (&bcm_get_platform()->cid); +} + +/** + * Default bhnd_nexus implementation of BHND_BUS_GET_INTR_COUNT(). + */ static int bhnd_nexus_get_intr_count(device_t dev, device_t child) { @@ -129,14 +143,30 @@ bhnd_nexus_get_intr_count(device_t dev, return (0); } +/** + * Default bhnd_nexus implementation of BHND_BUS_ASSIGN_INTR(). + */ +static int +bhnd_nexus_assign_intr(device_t dev, device_t child, int rid) +{ + uint32_t ivec; + int error; + + if ((error = bhnd_get_core_ivec(child, rid, &ivec))) + return (error); + + return (bus_set_resource(child, SYS_RES_IRQ, rid, ivec, 1)); +} + static device_method_t bhnd_nexus_methods[] = { /* bhnd interface */ DEVMETHOD(bhnd_bus_activate_resource, bhnd_nexus_activate_resource), DEVMETHOD(bhnd_bus_deactivate_resource, bhnd_nexus_deactivate_resource), DEVMETHOD(bhnd_bus_is_hw_disabled, bhnd_nexus_is_hw_disabled), DEVMETHOD(bhnd_bus_get_attach_type, bhnd_nexus_get_attach_type), - + DEVMETHOD(bhnd_bus_get_chipid, bhnd_nexus_get_chipid), DEVMETHOD(bhnd_bus_get_intr_count, bhnd_nexus_get_intr_count), + DEVMETHOD(bhnd_bus_assign_intr, bhnd_nexus_assign_intr), DEVMETHOD_END }; Copied and modified: head/sys/mips/broadcom/bhnd_nexusvar.h (from r313704, head/sys/dev/bhnd/bhnd_nexusvar.h) ============================================================================== --- head/sys/dev/bhnd/bhnd_nexusvar.h Mon Feb 13 19:00:09 2017 (r313704, copy source) +++ head/sys/mips/broadcom/bhnd_nexusvar.h Mon Feb 13 19:58:55 2017 (r313705) @@ -29,18 +29,12 @@ * $FreeBSD$ */ -#ifndef _BHND_BHND_NEXUSVAR_H_ -#define _BHND_BHND_NEXUSVAR_H_ +#ifndef _MIPS_BROADCOM_BHND_NEXUSVAR_H_ +#define _MIPS_BROADCOM_BHND_NEXUSVAR_H_ #include -#include -#include -#include - -#include "bhndvar.h" +#include DECLARE_CLASS(bhnd_nexus_driver); -int bhnd_nexus_read_chipid(device_t dev, struct bhnd_chipid *chipid); - -#endif /* _BHND_BHND_NEXUSVAR_H_ */ +#endif /* _MIPS_BROADCOM_BHND_NEXUSVAR_H_ */ Modified: head/sys/mips/broadcom/files.broadcom ============================================================================== --- head/sys/mips/broadcom/files.broadcom Mon Feb 13 19:00:09 2017 (r313704) +++ head/sys/mips/broadcom/files.broadcom Mon Feb 13 19:58:55 2017 (r313705) @@ -10,6 +10,12 @@ mips/broadcom/bcm_mips74k.c optional bc mips/broadcom/bcm_nvram_cfe.c optional bhnd siba_nexus cfe | \ bhnd bcma_nexus cfe mips/broadcom/bcm_pmu.c standard + +mips/broadcom/bhnd_nexus.c optional bhnd siba_nexus | \ + bhnd bcma_nexus +mips/broadcom/bcma_nexus.c optional bcma_nexus bcma bhnd +mips/broadcom/siba_nexus.c optional siba_nexus siba bhnd + mips/mips/tick.c standard mips/broadcom/uart_cpu_chipc.c optional uart Copied and modified: head/sys/mips/broadcom/siba_nexus.c (from r313704, head/sys/dev/bhnd/siba/siba_nexus.c) ============================================================================== --- head/sys/dev/bhnd/siba/siba_nexus.c Mon Feb 13 19:00:09 2017 (r313704, copy source) +++ head/sys/mips/broadcom/siba_nexus.c Mon Feb 13 19:58:55 2017 (r313705) @@ -38,10 +38,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include "sibavar.h" +#include + +#include "bcm_machdep.h" + +#include "bhnd_nexusvar.h" /* * Supports siba(4) attachment to a MIPS nexus bus. @@ -49,36 +51,21 @@ __FBSDID("$FreeBSD$"); * Derived from Bruce M. Simpson' original siba(4) driver. */ -struct siba_nexus_softc { - struct siba_softc parent_sc; - struct bhnd_chipid siba_cid; -}; - static int siba_nexus_probe(device_t dev) { - struct siba_nexus_softc *sc; - int error; - - sc = device_get_softc(dev); - - /* Read the ChipCommon info using the hints the kernel - * was compiled with. */ - if ((error = bhnd_nexus_read_chipid(dev, &sc->siba_cid))) - return (error); + int error; - if (sc->siba_cid.chip_type != BHND_CHIPTYPE_SIBA) + if (bcm_get_platform()->cid.chip_type != BHND_CHIPTYPE_SIBA) return (ENXIO); - if ((error = siba_probe(dev)) > 0) { - device_printf(dev, "error %d in probe\n", error); + if ((error = siba_probe(dev)) > 0) return (error); - } /* Set device description */ - bhnd_set_default_bus_desc(dev, &sc->siba_cid); + bhnd_set_default_bus_desc(dev, &bcm_get_platform()->cid); - return (0); + return (BUS_PROBE_SPECIFIC); } static int @@ -101,25 +88,16 @@ failed: return (error); } -static const struct bhnd_chipid * -siba_nexus_get_chipid(device_t dev, device_t child) { - struct siba_nexus_softc *sc = device_get_softc(dev); - return (&sc->siba_cid); -} - static device_method_t siba_nexus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, siba_nexus_probe), DEVMETHOD(device_attach, siba_nexus_attach), - /* bhnd interface */ - DEVMETHOD(bhnd_bus_get_chipid, siba_nexus_get_chipid), - DEVMETHOD_END }; DEFINE_CLASS_2(bhnd, siba_nexus_driver, siba_nexus_methods, - sizeof(struct siba_nexus_softc), bhnd_nexus_driver, siba_driver); + sizeof(struct siba_softc), bhnd_nexus_driver, siba_driver); EARLY_DRIVER_MODULE(siba_nexus, nexus, siba_nexus_driver, bhnd_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); From owner-svn-src-head@freebsd.org Mon Feb 13 20:36:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9092ECDD61C; Mon, 13 Feb 2017 20:36:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DBF4115; Mon, 13 Feb 2017 20:36:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1DKaSMB037924; Mon, 13 Feb 2017 20:36:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1DKaSEM037923; Mon, 13 Feb 2017 20:36:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702132036.v1DKaSEM037923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 13 Feb 2017 20:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313707 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 20:36:29 -0000 Author: mav Date: Mon Feb 13 20:36:28 2017 New Revision: 313707 URL: https://svnweb.freebsd.org/changeset/base/313707 Log: Remove M_PKTHDR from m_getm2() in icl_pdu_append_data(). ip_data_mbuf is always appended to ip_bhs_mbuf, so it does not need own packet header. This change first avoids allocation/initialization of the header, and then avoids dropping one when it later gets to socket buffer. MFC after: 2 weeks Modified: head/sys/dev/iscsi/icl_soft.c Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Mon Feb 13 20:13:29 2017 (r313706) +++ head/sys/dev/iscsi/icl_soft.c Mon Feb 13 20:36:28 2017 (r313707) @@ -1087,7 +1087,7 @@ icl_pdu_append_data(struct icl_pdu *requ KASSERT(len > 0, ("len == 0")); - newmb = m_getm2(NULL, len, flags, MT_DATA, M_PKTHDR); + newmb = m_getm2(NULL, len, flags, MT_DATA, 0); if (newmb == NULL) { ICL_WARN("failed to allocate mbuf for %zd bytes", len); return (ENOMEM); From owner-svn-src-head@freebsd.org Mon Feb 13 20:51:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 616FFCDDB3E; Mon, 13 Feb 2017 20:51:09 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E72DF81; Mon, 13 Feb 2017 20:51:09 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1DKp8FX042539; Mon, 13 Feb 2017 20:51:08 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1DKp8nJ042538; Mon, 13 Feb 2017 20:51:08 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201702132051.v1DKp8nJ042538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 13 Feb 2017 20:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313708 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 20:51:09 -0000 Author: cognet Date: Mon Feb 13 20:51:08 2017 New Revision: 313708 URL: https://svnweb.freebsd.org/changeset/base/313708 Log: Remove debugging code that was probably unused since before the arm code was initially committed. Reported by: Alexandre Martins Modified: head/sys/arm/arm/cpufunc_asm.S Modified: head/sys/arm/arm/cpufunc_asm.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm.S Mon Feb 13 20:36:28 2017 (r313707) +++ head/sys/arm/arm/cpufunc_asm.S Mon Feb 13 20:51:08 2017 (r313708) @@ -124,9 +124,6 @@ ENTRY(cpufunc_control) mov r0, r3 /* Return old value */ RET -.Lglou: - .asciz "plop %p\n" - .align 2 END(cpufunc_control) /* From owner-svn-src-head@freebsd.org Mon Feb 13 20:56:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E695CDDD06; Mon, 13 Feb 2017 20:56:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10AD81260; Mon, 13 Feb 2017 20:56:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1DKusFg046276; Mon, 13 Feb 2017 20:56:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1DKusnZ046275; Mon, 13 Feb 2017 20:56:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201702132056.v1DKusnZ046275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 13 Feb 2017 20:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313709 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 20:56:55 -0000 Author: dim Date: Mon Feb 13 20:56:53 2017 New Revision: 313709 URL: https://svnweb.freebsd.org/changeset/base/313709 Log: Fix build of BSD dtc when NDEBUG is defined (MK_ASSERT_DEBUG=no): * Initialize correct parent in binary_operator's constructor. * Include explicitly, otherwise errno is undefined (without NDEBUG, this is accidentally 'fixed' by including ). Reported by: matteo MFC after: 3 days Modified: head/usr.bin/dtc/input_buffer.cc Modified: head/usr.bin/dtc/input_buffer.cc ============================================================================== --- head/usr.bin/dtc/input_buffer.cc Mon Feb 13 20:51:08 2017 (r313708) +++ head/usr.bin/dtc/input_buffer.cc Mon Feb 13 20:56:53 2017 (r313709) @@ -32,6 +32,7 @@ #include "input_buffer.hh" #include +#include #include #include #include @@ -544,7 +545,8 @@ struct binary_operator : public binary_o * Constructor. Takes the name of the operator as an argument, for * debugging. Only stores it in debug mode. */ - binary_operator(source_location l, const char *) : expression(l) {} + binary_operator(source_location l, const char *) : + binary_operator_base(l) {} #else const char *opName; binary_operator(source_location l, const char *o) : From owner-svn-src-head@freebsd.org Mon Feb 13 21:33:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1796CDDC8D; Mon, 13 Feb 2017 21:33:51 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 849F0F73; Mon, 13 Feb 2017 21:33:51 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1DLXopA062604; Mon, 13 Feb 2017 21:33:50 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1DLXoLf062603; Mon, 13 Feb 2017 21:33:50 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201702132133.v1DLXoLf062603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 13 Feb 2017 21:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313710 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 21:33:51 -0000 Author: tsoome Date: Mon Feb 13 21:33:50 2017 New Revision: 313710 URL: https://svnweb.freebsd.org/changeset/base/313710 Log: loader: cstyle fixes and DIOCGMEDIASIZE should use uint64_t Cleaned up some spaces where tabs should be. efipart_ioctl() DIOCGMEDIASIZE needs to use uint64_t, not off_t Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D9562 Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Mon Feb 13 20:56:53 2017 (r313709) +++ head/sys/boot/efi/libefi/efipart.c Mon Feb 13 21:33:50 2017 (r313710) @@ -254,7 +254,7 @@ efipart_cdinfo_add(EFI_HANDLE handle, EF } unit++; } - + cd = malloc(sizeof(pdinfo_t)); if (cd == NULL) { printf("Failed to add cd %d, out of memory\n", unit); @@ -290,7 +290,7 @@ efipart_updatecd(void) continue; if (efipart_floppy(node) != NULL) continue; - + status = BS->HandleProtocol(efipart_handles[i], &blkio_guid, (void **)&blkio); if (EFI_ERROR(status)) @@ -589,14 +589,14 @@ efipart_print_common(struct devsw *dev, if (STAILQ_EMPTY(pdlist)) return (0); - + printf("%s devices:", dev->dv_name); if ((ret = pager_output("\n")) != 0) return (ret); STAILQ_FOREACH(pd, pdlist, pd_link) { h = pd->pd_handle; - if (verbose) { /* Output the device path. */ + if (verbose) { /* Output the device path. */ text = efi_devpath_name(efi_lookup_devpath(h)); if (text != NULL) { printf(" %S", text); @@ -707,7 +707,7 @@ efipart_open(struct open_file *f, ...) pd = efiblk_get_pdinfo(pdi, dev->d_unit); if (pd == NULL) return (EIO); - + if (pd->pd_blkio == NULL) { status = BS->HandleProtocol(pd->pd_handle, &blkio_guid, (void **)&pd->pd_blkio); @@ -791,7 +791,7 @@ efipart_ioctl(struct open_file *f, u_lon *(u_int *)data = pd->pd_blkio->Media->BlockSize; break; case DIOCGMEDIASIZE: - *(off_t *)data = pd->pd_blkio->Media->BlockSize * + *(uint64_t *)data = pd->pd_blkio->Media->BlockSize * (pd->pd_blkio->Media->LastBlock + 1); break; default: @@ -915,9 +915,9 @@ efipart_realstrategy(void *devdata, int if (rsize != NULL) *rsize = size; - if ((size % blkio->Media->BlockSize == 0) && + if ((size % blkio->Media->BlockSize == 0) && ((blk * 512) % blkio->Media->BlockSize == 0)) - return (efipart_readwrite(blkio, rw, + return (efipart_readwrite(blkio, rw, blk * 512 / blkio->Media->BlockSize, size / blkio->Media->BlockSize, buf)); From owner-svn-src-head@freebsd.org Mon Feb 13 21:44:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63275CDE372; Mon, 13 Feb 2017 21:44:30 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FA1C1A4B; Mon, 13 Feb 2017 21:44:30 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1DLiTur066514; Mon, 13 Feb 2017 21:44:29 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1DLiTxq066513; Mon, 13 Feb 2017 21:44:29 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201702132144.v1DLiTxq066513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Mon, 13 Feb 2017 21:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313711 - head/sys/dev/virtio/network X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 21:44:30 -0000 Author: philip Date: Mon Feb 13 21:44:29 2017 New Revision: 313711 URL: https://svnweb.freebsd.org/changeset/base/313711 Log: vtnet: don't update VLAN filter when parent is not running Submitted by: Gerrie Roos Reviewed by: gnn Sponsored by: XipLink, Inc. Differential Revision: https://reviews.freebsd.org/D9573 Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Mon Feb 13 21:33:50 2017 (r313710) +++ head/sys/dev/virtio/network/if_vtnet.c Mon Feb 13 21:44:29 2017 (r313711) @@ -3473,6 +3473,7 @@ vtnet_update_vlan_filter(struct vtnet_so sc->vtnet_vlan_filter[idx] &= ~(1 << bit); if (ifp->if_capenable & IFCAP_VLAN_HWFILTER && + ifp->if_drv_flags & IFF_DRV_RUNNING && vtnet_exec_vlan_filter(sc, add, tag) != 0) { device_printf(sc->vtnet_dev, "cannot %s VLAN %d %s the host filter table\n", From owner-svn-src-head@freebsd.org Tue Feb 14 00:04:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 777DBCDECB8; Tue, 14 Feb 2017 00:04:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4191BC38; Tue, 14 Feb 2017 00:04:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1E04a0s023010; Tue, 14 Feb 2017 00:04:36 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1E04a4N023009; Tue, 14 Feb 2017 00:04:36 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201702140004.v1E04a4N023009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 14 Feb 2017 00:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313712 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 00:04:37 -0000 Author: gonzo Date: Tue Feb 14 00:04:36 2017 New Revision: 313712 URL: https://svnweb.freebsd.org/changeset/base/313712 Log: [sdhci_acpi] Add support for Bay Trail SDHC SD card slot Add ACPI device 80860F14 with _UID 3 to the list of known devices. It make SD card available on NUCs and Minnowboard. Previously added _UID 1 covered only eMMC devices. Reported by: kib@ MFC after: 1 week Modified: head/sys/dev/sdhci/sdhci_acpi.c Modified: head/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- head/sys/dev/sdhci/sdhci_acpi.c Mon Feb 13 21:44:29 2017 (r313711) +++ head/sys/dev/sdhci/sdhci_acpi.c Tue Feb 14 00:04:36 2017 (r313712) @@ -60,9 +60,11 @@ static const struct sdhci_acpi_device { const char *desc; u_int quirks; } sdhci_acpi_devices[] = { - { "80860F14", 1, "Intel Bay Trail eMMC 4.5 Controller", + { "80860F14", 1, "Intel Bay Trail SD Host Controller", SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | SDHCI_QUIRK_INTEL_POWER_UP_RESET }, + { "80860F14", 3, "Intel Bay Trail SD Host Controller", + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, { "80860F16", 0, "Intel Bay Trail SD Host Controller", 0 }, { NULL, 0, NULL, 0} From owner-svn-src-head@freebsd.org Tue Feb 14 00:54:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D93EECDC9D8; Tue, 14 Feb 2017 00:54:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B24611EC; Tue, 14 Feb 2017 00:54:49 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1E0sm28043501; Tue, 14 Feb 2017 00:54:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1E0smgI043500; Tue, 14 Feb 2017 00:54:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702140054.v1E0smgI043500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 14 Feb 2017 00:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313713 - head/lib/msun/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 00:54:50 -0000 Author: ngie Date: Tue Feb 14 00:54:48 2017 New Revision: 313713 URL: https://svnweb.freebsd.org/changeset/base/313713 Log: Handle clang 4.x+ with the compile-time exception added in r312213 It also fails the assertions noted in bug 208703 PR: 208703 PR: 217084 Submitted by: jbeich MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/lib/msun/tests/fmaxmin_test.c Modified: head/lib/msun/tests/fmaxmin_test.c ============================================================================== --- head/lib/msun/tests/fmaxmin_test.c Tue Feb 14 00:04:36 2017 (r313712) +++ head/lib/msun/tests/fmaxmin_test.c Tue Feb 14 00:54:48 2017 (r313713) @@ -116,7 +116,8 @@ testall(int testnum, long double big, lo /* Clang 3.8.0+ fails the invariants for testcase 6, 7, 10, and 11. */ #if defined(__clang__) && \ - (__clang_major__ >= 3 && __clang_minor__ >= 8 && __clang_patchlevel__ >= 0) + ((__clang_major__ > 3)) || \ + ((__clang_major__ == 3 && __clang_minor__ >= 8)) #define affected_by_bug_208703 #endif From owner-svn-src-head@freebsd.org Tue Feb 14 01:20:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0D53CDD41D; Tue, 14 Feb 2017 01:20:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0D101EB6; Tue, 14 Feb 2017 01:20:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1E1K3RR051498; Tue, 14 Feb 2017 01:20:03 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1E1K3dN051497; Tue, 14 Feb 2017 01:20:03 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201702140120.v1E1K3dN051497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 14 Feb 2017 01:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313714 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 01:20:05 -0000 Author: bz Date: Tue Feb 14 01:20:03 2017 New Revision: 313714 URL: https://svnweb.freebsd.org/changeset/base/313714 Log: Use %s __func__ to print the actual function name (been looking at the wrong one for too often lately at first), and also use %#lx to get the 0x prefix for the address. MFC after: 1 week Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Tue Feb 14 00:54:48 2017 (r313713) +++ head/sys/vm/vm_fault.c Tue Feb 14 01:20:03 2017 (r313714) @@ -528,8 +528,8 @@ RetryFault:; fs.map_generation = fs.map->timestamp; if (fs.entry->eflags & MAP_ENTRY_NOFAULT) { - panic("vm_fault: fault on nofault entry, addr: %lx", - (u_long)vaddr); + panic("%s: fault on nofault entry, addr: %#lx", + __func__, (u_long)vaddr); } if (fs.entry->eflags & MAP_ENTRY_IN_TRANSITION && From owner-svn-src-head@freebsd.org Tue Feb 14 03:32:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4A91CDCB82; Tue, 14 Feb 2017 03:32:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1DCC1DF4; Tue, 14 Feb 2017 03:32:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1E3WbDq008248; Tue, 14 Feb 2017 03:32:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1E3Wb9h008247; Tue, 14 Feb 2017 03:32:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702140332.v1E3Wb9h008247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 14 Feb 2017 03:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313715 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 03:32:38 -0000 Author: kib Date: Tue Feb 14 03:32:37 2017 New Revision: 313715 URL: https://svnweb.freebsd.org/changeset/base/313715 Log: Order alphabetically. Noted by: alc MFC after: 3 days Modified: head/sys/sys/syscallsubr.h Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Tue Feb 14 01:20:03 2017 (r313714) +++ head/sys/sys/syscallsubr.h Tue Feb 14 03:32:37 2017 (r313715) @@ -162,8 +162,8 @@ int kern_mmap(struct thread *td, uintptr int flags, int fd, off_t pos); int kern_mprotect(struct thread *td, uintptr_t addr, size_t size, int prot); int kern_msgctl(struct thread *, int, int, struct msqid_ds *); -int kern_msgsnd(struct thread *, int, const void *, size_t, int, long); int kern_msgrcv(struct thread *, int, void *, size_t, long, int, long *); +int kern_msgsnd(struct thread *, int, const void *, size_t, int, long); int kern_msync(struct thread *td, uintptr_t addr, size_t size, int flags); int kern_munlock(struct thread *td, uintptr_t addr, size_t size); int kern_munmap(struct thread *td, uintptr_t addr, size_t size); From owner-svn-src-head@freebsd.org Tue Feb 14 06:20:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C82E3CD105B for ; Tue, 14 Feb 2017 06:20:10 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x232.google.com (mail-yw0-x232.google.com [IPv6:2607:f8b0:4002:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8701B1E67 for ; Tue, 14 Feb 2017 06:20:10 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x232.google.com with SMTP id l19so61351251ywc.2 for ; Mon, 13 Feb 2017 22:20:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ACfOzApxvv2qk1xRona+wv72LBCMqXTS3EAc2xhjMVw=; b=TnNQOyPtVbDeRzlNejEe7mg1l8WcSwHbR5E5R0OEh2U7o+owr7KM1IuJkpyBuWu75Z gtmKwGKv3Asw5nCES+LaMqORiKIv2xmXlw34KnAd6nFZOjG4mxvbM7fVr1DjiaTdt6Q4 21hHhnNnmzQPHM1pD5ms4INBOKC+dL/bQz7N/HwNc3w60kxc7jmH96/G224OvbZAwaOk b95vmNsIHh69P+0IMYTWnFJBdBSD2IrS1n0v9KuMOS8Ifqy3MUWVyLL5du7SCdNcNUwu U58VwZU1Y90RlGpRJ+fWERncN/NFJFsT7tG1VOmKksJe9sxXviBRAFARAbwf7jsR3oxk NyGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ACfOzApxvv2qk1xRona+wv72LBCMqXTS3EAc2xhjMVw=; b=HnIwoJ2b9vZgM3zeyqMgAg2nxrFtSlklggeGS2yxNuOZtJp+S5p6B2zBwS+aA65Syd tFmOo0lu0f98DVyS2hi7jY1c61jKbVgoHE1ASIAIoXo0EovSbZ9Ydr2yYScwscE8+qTh jJafcFF92RPZ94uWr0lxS974lRCCyStNd3Sdo2OZKvevZvjKiLTAbkcrelRfQL658NoN dFOTqzvgl/Hic+GeCWKG1jgcVLhU7sxRxBZ78DxtekMr8y+d4uKyDvtWAC3W2dwuvImn cL7+h9juK+JrJYI4NfYlLTq0F0FMmM4pAZah51/SEGajZ2mCX8MNVCDIiqBi3RXpd5Ry GbNA== X-Gm-Message-State: AMke39lUKscb8l7A0bGt6Lf/DOQmsgEUevGW0eStrs70O/9w7vLAjSzCeSTik/DP758HaSE3o27bhFBRw6Lcog== X-Received: by 10.129.86.66 with SMTP id k63mr20119049ywb.112.1487053209457; Mon, 13 Feb 2017 22:20:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.52.76 with HTTP; Mon, 13 Feb 2017 22:19:39 -0800 (PST) In-Reply-To: References: <201702131900.v1DJ09lj093710@repo.freebsd.org> From: Ed Schouten Date: Tue, 14 Feb 2017 07:19:39 +0100 Message-ID: Subject: Re: svn commit: r313704 - head/sys/sys To: Ngie Cooper Cc: Ed Schouten , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 06:20:10 -0000 Hi there, 2017-02-13 20:53 GMT+01:00 Ngie Cooper : > Thanks! Should kqueue(2)/kevent(2) be updated? I'm really not sure what's best here. On one hand the header no longer depends on , but the man page does refer to types and identifiers that are no longer declared by simply including this header. Maybe it's best to leave it there, so that it's more likely for people to write code that also builds with previous versions of this header? -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Tue Feb 14 07:15:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69F92CDE7BD; Tue, 14 Feb 2017 07:15:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-oi0-x243.google.com (mail-oi0-x243.google.com [IPv6:2607:f8b0:4003:c06::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 358B41AE4; Tue, 14 Feb 2017 07:15:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-oi0-x243.google.com with SMTP id w144so1972357oiw.1; Mon, 13 Feb 2017 23:15:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=jhkFGbmURg8DrbyzO1jYEMR5Jap9A/IcONU8ZIj2OBg=; b=WPuqbK+a6C44U78vOEzXEv1nbegmJY1vrZA/wEn36zL2R8mvGn1HHNMwObHLqyv3ca IVKDsgDVzZNM7Qrek1WNC4ybzE1QD3FwcAbHcw1HUJLoLZzCQn1UCwnVyy60F4tA4G9m HtkoNwJHiUL3g+cFLdWnLHr/oiIq9CDZfVv+fpNKIIyliClbMBiBL9xVSnkEuSSmG1My zJtEr1zP13xROFpMviIPbJ612hKCgPilkoXWnnKZHV7tPT8L2T80r/QZzJvGkYVCxxOd O+kTVipTkbfsWoclBhJionPHdhR92BB7/mbGWnNKKURARPcrdiIMrq1WN/97dB0lcdJI Kndw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=jhkFGbmURg8DrbyzO1jYEMR5Jap9A/IcONU8ZIj2OBg=; b=I83hnXXwR9Z8/k4Sk69GUcNf5s7dx2HE642zu1oJqkrGr7Ux1BXQl35MsDl9uGlvUL 2DwI/eLrk7LM5NV66o+LcukSNxfQWpm12dNOioAmVKB9IEOOBHK+SOZaVQ2HYkt9Agji cueBAZSpWGdKHMC38nJRlFBfWejrBnZzxLrJtGJz9gT15ZoCnTQKKiknkizhI/y/IT2n lveb7GwRwVu0w9YBsF9wT3FMW9yy/w7sy1Ghjn5OKDbul2nrQ2vpNOElEqVqR6FzaKHu UrKAgTTztMHE1LVInb2/bGyT2IKoiz3qoiHEGrtqLa8bFkv2H+LWWQTn6ThP4xgqszxy rDZw== X-Gm-Message-State: AMke39n4YNq4BLflncf1iqbuGzTzUEK+uIb9rpzLkbjoSsP/a/eSefkTk7li7khPT1rGpw== X-Received: by 10.84.151.9 with SMTP id i9mr35255153pli.122.1487056557232; Mon, 13 Feb 2017 23:15:57 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id x10sm18442529pfi.117.2017.02.13.23.15.55 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Feb 2017 23:15:56 -0800 (PST) Subject: Re: svn commit: r313704 - head/sys/sys Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_E27BA85F-F1D4-4FFA-B8FD-84101C40FB40"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Mon, 13 Feb 2017 23:15:54 -0800 Cc: Ed Schouten , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <1F7CDE76-BAB9-4E2E-A455-9D5A4EA26A77@gmail.com> References: <201702131900.v1DJ09lj093710@repo.freebsd.org> To: Ed Schouten X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 07:15:58 -0000 --Apple-Mail=_E27BA85F-F1D4-4FFA-B8FD-84101C40FB40 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Feb 13, 2017, at 22:19, Ed Schouten wrote: >=20 > Hi there, >=20 > 2017-02-13 20:53 GMT+01:00 Ngie Cooper : >> Thanks! Should kqueue(2)/kevent(2) be updated? >=20 > I'm really not sure what's best here. On one hand the header no longer > depends on , but the man page does refer to types and > identifiers that are no longer declared by simply including this > header. >=20 > Maybe it's best to leave it there, so that it's more likely for people > to write code that also builds with previous versions of this header? Hm=E2=80=A6 Thinking about this a bit more, I think it=E2=80=99s = a good idea to update the manpages. My gut says that unless the explicit = requirement is removed, people will keep on using the old #include list. = Maybe a note should be made in the BUGS section about sys/types.h being = required in previous releases (or folks should just pay attention to = previous versions=E2=80=99 manpages *shrugs*?)? Thanks! -Ngie --Apple-Mail=_E27BA85F-F1D4-4FFA-B8FD-84101C40FB40 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 iQIcBAEBCgAGBQJYoq6rAAoJEPWDqSZpMIYVtPAP/2kxX28kItQVCPwr+tPTlVcP 5sf8B41MjW693pZ1Zwzasf7chVBUx2Z8GG7WnNTpvUKjyu1HKTVCAUSazbtJndDs DN/CL51I/R5gOy0gU3Cx2b6IvmDgaXh2i23nLLt4DJ+FVUItz8/yPhOPkFJdjlqM k3EONhKOfKWVnIQ+bsr+q59AJUkf5fraKT83vUiwppCgCw07s43oPliqaFlMM1/p z+C3JD8e86125WsbEAS06PkEi2s+uF6ZYW/j6Ey1wk3/FVJxguVss5AIl7wGRoKF npsDbV8PAmjRsfrBTr69qTFdx6OTe6KbU/9H9lAWBAoNCjcx7OwUCna7dmHj+Ap4 1Y2vT+XgVs30toNO6z9Pb2UTSRJ3tHjE7XXNcInfpQNenKEBJC9jtHtDYnbHgi/O KuGOQ9RbEn1HWoOUhT5JV6O+FdGIBhhv+H0qlEJFIcyNeh9uRTNFD0SJcf6nEDX7 K8dCXwmhfq5DcVEOUZXiJz3EUXg5G+X0D/m3poL3qiMZzhNOIMBH+54NYCVJi8Ic xvClTEgyXGQfH7aXqUuyQcvAtNA/nGcvb94P+NuytKk6SaRbHq9UsTbaWEWzX+U8 UMfKB2Cgr1dxCzlBbcHUOM+CM7xcReOCBWWLOL1swHkj3thdMoHEekmtQlgH/KcA miPR6YEhoQ2I3cL+7k3v =alq/ -----END PGP SIGNATURE----- --Apple-Mail=_E27BA85F-F1D4-4FFA-B8FD-84101C40FB40-- From owner-svn-src-head@freebsd.org Tue Feb 14 13:36:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33892CDE2FD; Tue, 14 Feb 2017 13:36:02 +0000 (UTC) (envelope-from robak@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3CFC1A35; Tue, 14 Feb 2017 13:36:01 +0000 (UTC) (envelope-from robak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EDa1T0057085; Tue, 14 Feb 2017 13:36:01 GMT (envelope-from robak@FreeBSD.org) Received: (from robak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EDZxr8057062; Tue, 14 Feb 2017 13:35:59 GMT (envelope-from robak@FreeBSD.org) Message-Id: <201702141335.v1EDZxr8057062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: robak set sender to robak@FreeBSD.org using -f From: Bartek Rutkowski Date: Tue, 14 Feb 2017 13:35:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313727 - in head: lib/libvmmapi 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 13:36:02 -0000 Author: robak (ports committer) Date: Tue Feb 14 13:35:59 2017 New Revision: 313727 URL: https://svnweb.freebsd.org/changeset/base/313727 Log: Capsicum support for bhyve(8). Adds Capsicum sandboxing to bhyve. Submitted by: Pawel Biernacki Reviewed by: grehan, oshogbo Approved by: emaste, grehan Sponsored by: Mysterious Code Ltd. Differential Revision: https://reviews.freebsd.org/D8290 Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/block_if.c head/usr.sbin/bhyve/consport.c head/usr.sbin/bhyve/dbgport.c head/usr.sbin/bhyve/mevent.c head/usr.sbin/bhyve/pci_e82545.c head/usr.sbin/bhyve/pci_passthru.c head/usr.sbin/bhyve/pci_virtio_console.c head/usr.sbin/bhyve/pci_virtio_net.c head/usr.sbin/bhyve/pci_virtio_rnd.c head/usr.sbin/bhyve/rfb.c head/usr.sbin/bhyve/uart_emul.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Tue Feb 14 04:52:24 2017 (r313726) +++ head/lib/libvmmapi/vmmapi.c Tue Feb 14 13:35:59 2017 (r313727) @@ -1416,3 +1416,45 @@ vm_restart_instruction(void *arg, int vc return (ioctl(ctx->fd, VM_RESTART_INSTRUCTION, &vcpu)); } + +int +vm_get_device_fd(struct vmctx *ctx) +{ + + return (ctx->fd); +} + +const cap_ioctl_t * +vm_get_ioctls(size_t *len) +{ + cap_ioctl_t *cmds; + /* keep in sync with machine/vmm_dev.h */ + static const cap_ioctl_t vm_ioctl_cmds[] = { VM_RUN, VM_SUSPEND, VM_REINIT, + VM_ALLOC_MEMSEG, VM_GET_MEMSEG, VM_MMAP_MEMSEG, VM_MMAP_MEMSEG, + VM_MMAP_GETNEXT, VM_SET_REGISTER, VM_GET_REGISTER, + VM_SET_SEGMENT_DESCRIPTOR, VM_GET_SEGMENT_DESCRIPTOR, + VM_INJECT_EXCEPTION, VM_LAPIC_IRQ, VM_LAPIC_LOCAL_IRQ, + VM_LAPIC_MSI, VM_IOAPIC_ASSERT_IRQ, VM_IOAPIC_DEASSERT_IRQ, + VM_IOAPIC_PULSE_IRQ, VM_IOAPIC_PINCOUNT, VM_ISA_ASSERT_IRQ, + VM_ISA_DEASSERT_IRQ, VM_ISA_PULSE_IRQ, VM_ISA_SET_IRQ_TRIGGER, + VM_SET_CAPABILITY, VM_GET_CAPABILITY, VM_BIND_PPTDEV, + VM_UNBIND_PPTDEV, VM_MAP_PPTDEV_MMIO, VM_PPTDEV_MSI, + VM_PPTDEV_MSIX, VM_INJECT_NMI, VM_STATS, VM_STAT_DESC, + VM_SET_X2APIC_STATE, VM_GET_X2APIC_STATE, + VM_GET_HPET_CAPABILITIES, VM_GET_GPA_PMAP, VM_GLA2GPA, + VM_ACTIVATE_CPU, VM_GET_CPUS, VM_SET_INTINFO, VM_GET_INTINFO, + VM_RTC_WRITE, VM_RTC_READ, VM_RTC_SETTIME, VM_RTC_GETTIME, + VM_RESTART_INSTRUCTION }; + + if (len == NULL) { + cmds = malloc(sizeof(vm_ioctl_cmds)); + if (cmds == NULL) + return (NULL); + bcopy(vm_ioctl_cmds, cmds, sizeof(vm_ioctl_cmds)); + return (cmds); + } + + *len = nitems(vm_ioctl_cmds); + return (NULL); +} + Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Tue Feb 14 04:52:24 2017 (r313726) +++ head/lib/libvmmapi/vmmapi.h Tue Feb 14 13:35:59 2017 (r313727) @@ -36,7 +36,7 @@ * API version for out-of-tree consumers like grub-bhyve for making compile * time decisions. */ -#define VMMAPI_VERSION 0102 /* 2 digit major followed by 2 digit minor */ +#define VMMAPI_VERSION 0103 /* 2 digit major followed by 2 digit minor */ struct iovec; struct vmctx; @@ -102,6 +102,7 @@ int vm_mmap_memseg(struct vmctx *ctx, vm vm_ooffset_t segoff, size_t len, int prot); int vm_create(const char *name); +int vm_get_device_fd(struct vmctx *ctx); struct vmctx *vm_open(const char *name); void vm_destroy(struct vmctx *ctx); int vm_parse_memsize(const char *optarg, size_t *memsize); @@ -162,6 +163,8 @@ int vm_setup_pptdev_msix(struct vmctx *c int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *i1, uint64_t *i2); int vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t exit_intinfo); +const cap_ioctl_t *vm_get_ioctls(size_t *len); + /* * Return a pointer to the statistics buffer. Note that this is not MT-safe. */ Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Tue Feb 14 04:52:24 2017 (r313726) +++ head/usr.sbin/bhyve/bhyverun.c Tue Feb 14 13:35:59 2017 (r313727) @@ -30,16 +30,23 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include #include +#include #include #include #include @@ -50,6 +57,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include "bhyverun.h" @@ -706,6 +716,11 @@ do_open(const char *vmname) struct vmctx *ctx; int error; bool reinit, romboot; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + const cap_ioctl_t *cmds; + size_t ncmds; +#endif reinit = romboot = false; @@ -744,6 +759,21 @@ do_open(const char *vmname) exit(1); } +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_IOCTL, CAP_MMAP_RW); + if (cap_rights_limit(vm_get_device_fd(ctx), &rights) == -1 && + errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + vm_get_ioctls(&ncmds); + cmds = vm_get_ioctls(NULL); + if (cmds == NULL) + errx(EX_OSERR, "out of memory"); + if (cap_ioctls_limit(vm_get_device_fd(ctx), cmds, ncmds) == -1 && + errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + free((cap_ioctl_t *)cmds); +#endif + if (reinit) { error = vm_reinit(ctx); if (error) { @@ -952,6 +982,16 @@ main(int argc, char *argv[]) if (lpc_bootrom()) fwctl_init(); +#ifndef WITHOUT_CAPSICUM + caph_cache_catpages(); + + if (caph_limit_stdout() == -1 || caph_limit_stderr() == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + + if (cap_enter() == -1 && errno != ENOSYS) + errx(EX_OSERR, "cap_enter() failed"); +#endif + /* * Change the proc title to include the VM name. */ Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Tue Feb 14 04:52:24 2017 (r313726) +++ head/usr.sbin/bhyve/block_if.c Tue Feb 14 13:35:59 2017 (r313727) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -45,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -400,6 +404,10 @@ blockif_open(const char *optstr, const c off_t size, psectsz, psectoff; int extra, fd, i, sectsz; int nocache, sync, ro, candelete, geom, ssopt, pssopt; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t cmds[] = { DIOCGFLUSH, DIOCGDELETE }; +#endif pthread_once(&blockif_once, blockif_init); @@ -457,6 +465,16 @@ blockif_open(const char *optstr, const c goto err; } +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_FSYNC, CAP_IOCTL, CAP_READ, CAP_SEEK, + CAP_WRITE); + if (ro) + cap_rights_clear(&rights, CAP_FSYNC, CAP_WRITE); + + if (cap_rights_limit(fd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + /* * Deal with raw devices */ @@ -483,6 +501,11 @@ blockif_open(const char *optstr, const c } else psectsz = sbuf.st_blksize; +#ifndef WITHOUT_CAPSICUM + if (cap_ioctls_limit(fd, cmds, nitems(cmds)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + if (ssopt != 0) { if (!powerof2(ssopt) || !powerof2(pssopt) || ssopt < 512 || ssopt > pssopt) { Modified: head/usr.sbin/bhyve/consport.c ============================================================================== --- head/usr.sbin/bhyve/consport.c Tue Feb 14 04:52:24 2017 (r313726) +++ head/usr.sbin/bhyve/consport.c Tue Feb 14 13:35:59 2017 (r313727) @@ -30,13 +30,19 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include +#include +#include #include #include #include #include #include +#include #include "inout.h" #include "pci_lpc.h" @@ -104,6 +110,10 @@ console_handler(struct vmctx *ctx, int v uint32_t *eax, void *arg) { static int opened; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t cmds[] = { TIOCGETA, TIOCSETA, TIOCGWINSZ }; +#endif if (bytes == 2 && in) { *eax = BVM_CONS_SIG; @@ -123,6 +133,13 @@ console_handler(struct vmctx *ctx, int v return (-1); if (!opened) { +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); + if (cap_rights_limit(STDIN_FILENO, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(STDIN_FILENO, cmds, nitems(cmds)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif ttyopen(); opened = 1; } Modified: head/usr.sbin/bhyve/dbgport.c ============================================================================== --- head/usr.sbin/bhyve/dbgport.c Tue Feb 14 04:52:24 2017 (r313726) +++ head/usr.sbin/bhyve/dbgport.c Tue Feb 14 13:35:59 2017 (r313727) @@ -30,13 +30,18 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include #include +#include #include #include +#include #include #include #include @@ -125,6 +130,9 @@ void init_dbgport(int sport) { int reuse; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif conn_fd = -1; @@ -155,5 +163,11 @@ init_dbgport(int sport) exit(1); } +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_ACCEPT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(listen_fd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + register_inout(&dbgport); } Modified: head/usr.sbin/bhyve/mevent.c ============================================================================== --- head/usr.sbin/bhyve/mevent.c Tue Feb 14 04:52:24 2017 (r313726) +++ head/usr.sbin/bhyve/mevent.c Tue Feb 14 13:35:59 2017 (r313727) @@ -35,13 +35,18 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include #include +#include #include #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include @@ -401,6 +406,9 @@ mevent_dispatch(void) int mfd; int numev; int ret; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif mevent_tid = pthread_self(); mevent_set_name(); @@ -408,6 +416,12 @@ mevent_dispatch(void) mfd = kqueue(); assert(mfd > 0); +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_KQUEUE); + if (cap_rights_limit(mfd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + /* * Open the pipe that will be used for other threads to force * the blocking kqueue call to exit by writing to it. Set the @@ -419,6 +433,14 @@ mevent_dispatch(void) exit(0); } +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(mevent_pipefd[0], &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_rights_limit(mevent_pipefd[1], &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + /* * Add internal event handler for the pipe write fd */ Modified: head/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- head/usr.sbin/bhyve/pci_e82545.c Tue Feb 14 04:52:24 2017 (r313726) +++ head/usr.sbin/bhyve/pci_e82545.c Tue Feb 14 13:35:59 2017 (r313727) @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -38,12 +41,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -2202,6 +2207,9 @@ static void e82545_open_tap(struct e82545_softc *sc, char *opts) { char tbuf[80]; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif if (opts == NULL) { sc->esc_tapfd = -1; @@ -2228,6 +2236,12 @@ e82545_open_tap(struct e82545_softc *sc, sc->esc_tapfd = -1; } +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(sc->esc_tapfd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + sc->esc_mevp = mevent_add(sc->esc_tapfd, EVF_READ, e82545_tap_callback, Modified: head/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- head/usr.sbin/bhyve/pci_passthru.c Tue Feb 14 04:52:24 2017 (r313726) +++ head/usr.sbin/bhyve/pci_passthru.c Tue Feb 14 13:35:59 2017 (r313727) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -44,7 +47,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -639,10 +644,19 @@ passthru_init(struct vmctx *ctx, struct { int bus, slot, func, error, memflags; struct passthru_softc *sc; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t pci_ioctls[] = { PCIOCREAD, PCIOCWRITE, PCIOCGETBAR }; + cap_ioctl_t io_ioctls[] = { IODEV_PIO }; +#endif sc = NULL; error = 1; +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_IOCTL, CAP_READ, CAP_WRITE); +#endif + memflags = vm_get_memflags(ctx); if (!(memflags & VM_MEM_F_WIRED)) { warnx("passthru requires guest memory to be wired"); @@ -657,6 +671,13 @@ passthru_init(struct vmctx *ctx, struct } } +#ifndef WITHOUT_CAPSICUM + if (cap_rights_limit(pcifd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(pcifd, pci_ioctls, nitems(pci_ioctls)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + if (iofd < 0) { iofd = open(_PATH_DEVIO, O_RDWR, 0); if (iofd < 0) { @@ -665,6 +686,13 @@ passthru_init(struct vmctx *ctx, struct } } +#ifndef WITHOUT_CAPSICUM + if (cap_rights_limit(iofd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(iofd, io_ioctls, nitems(io_ioctls)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + if (memfd < 0) { memfd = open(_PATH_MEM, O_RDWR, 0); if (memfd < 0) { @@ -673,6 +701,12 @@ passthru_init(struct vmctx *ctx, struct } } +#ifndef WITHOUT_CAPSICUM + cap_rights_clear(&rights, CAP_IOCTL); + if (cap_rights_limit(memfd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + if (opts == NULL || sscanf(opts, "%d/%d/%d", &bus, &slot, &func) != 3) { warnx("invalid passthru options"); Modified: head/usr.sbin/bhyve/pci_virtio_console.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_console.c Tue Feb 14 04:52:24 2017 (r313726) +++ head/usr.sbin/bhyve/pci_virtio_console.c Tue Feb 14 13:35:59 2017 (r313727) @@ -32,12 +32,16 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include #include #include +#include #include #include #include @@ -48,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bhyverun.h" #include "pci_emul.h" @@ -269,6 +274,9 @@ pci_vtcon_sock_add(struct pci_vtcon_soft struct sockaddr_un sun; char *pathcopy; int s = -1, fd = -1, error = 0; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif sock = calloc(1, sizeof(struct pci_vtcon_sock)); if (sock == NULL) { @@ -316,6 +324,11 @@ pci_vtcon_sock_add(struct pci_vtcon_soft goto out; } +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_ACCEPT, CAP_EVENT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(s, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif sock->vss_port = pci_vtcon_port_add(sc, name, pci_vtcon_sock_tx, sock); if (sock->vss_port == NULL) { Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Tue Feb 14 04:52:24 2017 (r313726) +++ head/usr.sbin/bhyve/pci_virtio_net.c Tue Feb 14 13:35:59 2017 (r313727) @@ -30,6 +30,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -41,6 +44,7 @@ __FBSDID("$FreeBSD$"); #endif #include +#include #include #include #include @@ -53,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bhyverun.h" #include "pci_emul.h" @@ -743,6 +748,9 @@ static void pci_vtnet_tap_setup(struct pci_vtnet_softc *sc, char *devname) { char tbuf[80]; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif strcpy(tbuf, "/dev/"); strlcat(tbuf, devname, sizeof(tbuf)); @@ -767,6 +775,12 @@ pci_vtnet_tap_setup(struct pci_vtnet_sof sc->vsc_tapfd = -1; } +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(sc->vsc_tapfd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + sc->vsc_mevp = mevent_add(sc->vsc_tapfd, EVF_READ, pci_vtnet_rx_callback, Modified: head/usr.sbin/bhyve/pci_virtio_rnd.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_rnd.c Tue Feb 14 04:52:24 2017 (r313726) +++ head/usr.sbin/bhyve/pci_virtio_rnd.c Tue Feb 14 13:35:59 2017 (r313727) @@ -35,9 +35,13 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include +#include #include #include #include @@ -46,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bhyverun.h" #include "pci_emul.h" @@ -138,6 +143,9 @@ pci_vtrnd_init(struct vmctx *ctx, struct int fd; int len; uint8_t v; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif /* * Should always be able to open /dev/random. @@ -146,6 +154,12 @@ pci_vtrnd_init(struct vmctx *ctx, struct assert(fd >= 0); +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_READ); + if (cap_rights_limit(fd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + /* * Check that device is seeded and non-blocking. */ Modified: head/usr.sbin/bhyve/rfb.c ============================================================================== --- head/usr.sbin/bhyve/rfb.c Tue Feb 14 04:52:24 2017 (r313726) +++ head/usr.sbin/bhyve/rfb.c Tue Feb 14 13:35:59 2017 (r313727) @@ -29,6 +29,9 @@ __FBSDID("$FreeBSD$"); #include +#ifndef WITHOUT_CAPSICUM +#include +#endif #include #include #include @@ -38,6 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -45,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -868,6 +874,9 @@ rfb_init(char *hostname, int port, int w struct rfb_softc *rc; struct sockaddr_in sin; int on = 1; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif rc = calloc(1, sizeof(struct rfb_softc)); @@ -904,6 +913,12 @@ rfb_init(char *hostname, int port, int w return (-1); } +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_ACCEPT, CAP_EVENT, CAP_READ, CAP_WRITE); + if (cap_rights_limit(rc->sfd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + rc->hw_crc = sse42_supported(); rc->conn_wait = wait; Modified: head/usr.sbin/bhyve/uart_emul.c ============================================================================== --- head/usr.sbin/bhyve/uart_emul.c Tue Feb 14 04:52:24 2017 (r313726) +++ head/usr.sbin/bhyve/uart_emul.c Tue Feb 14 13:35:59 2017 (r313727) @@ -32,16 +32,23 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_CAPSICUM +#include +#include +#endif #include #include #include +#include +#include #include #include #include #include #include #include +#include #include "mevent.h" #include "uart_emul.h" @@ -638,7 +645,7 @@ uart_tty_backend(struct uart_softc *sc, sc->tty.opened = true; retval = 0; } - + return (retval); } @@ -646,6 +653,10 @@ int uart_set_backend(struct uart_softc *sc, const char *opts) { int retval; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; + cap_ioctl_t cmds[] = { TIOCGETA, TIOCSETA, TIOCGWINSZ }; +#endif retval = -1; @@ -667,6 +678,18 @@ uart_set_backend(struct uart_softc *sc, if (retval == 0) retval = fcntl(sc->tty.fd, F_SETFL, O_NONBLOCK); +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); + if (cap_rights_limit(sc->tty.fd, &rights) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(sc->tty.fd, cmds, nitems(cmds)) == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (!uart_stdio) { + if (caph_limit_stdin() == -1 && errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + } +#endif + if (retval == 0) uart_opentty(sc); From owner-svn-src-head@freebsd.org Tue Feb 14 13:54:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAC6ECDE9D0; Tue, 14 Feb 2017 13:54:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 724E71704; Tue, 14 Feb 2017 13:54:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EDs5IT065063; Tue, 14 Feb 2017 13:54:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EDs5qB065061; Tue, 14 Feb 2017 13:54:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702141354.v1EDs5qB065061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 14 Feb 2017 13:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313730 - in head/sys: kern vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 13:54:06 -0000 Author: avg Date: Tue Feb 14 13:54:05 2017 New Revision: 313730 URL: https://svnweb.freebsd.org/changeset/base/313730 Log: try to fix RACCT_RSS accounting There could be a race between the vm daemon setting RACCT_RSS based on the vm space and vmspace_exit (called from exit1) resetting RACCT_RSS to zero. In that case we can get a zombie process with non-zero RACCT_RSS. If the process is jailed, that may break accounting for the jail. There could be other consequences. Fix this race in the vm daemon by updating RACCT_RSS only when a process is in the normal state. Also, make accounting a little bit more accurate by refreshing the page resident count after calling vm_pageout_map_deactivate_pages(). Finally, add an assert that the RSS is zero when a process is reaped. PR: 210315 Reviewed by: trasz Differential Revision: https://reviews.freebsd.org/D9464 Modified: head/sys/kern/kern_racct.c head/sys/vm/vm_pageout.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Tue Feb 14 13:45:38 2017 (r313729) +++ head/sys/kern/kern_racct.c Tue Feb 14 13:54:05 2017 (r313730) @@ -1010,10 +1010,13 @@ racct_proc_exit(struct proc *p) racct_set_locked(p, RACCT_CPU, runtime, 0); racct_add_cred_locked(p->p_ucred, RACCT_PCTCPU, pct); + KASSERT(p->p_racct->r_resources[RACCT_RSS] == 0, + ("process reaped with %ju allocated for RSS\n", + p->p_racct->r_resources[RACCT_RSS])); for (i = 0; i <= RACCT_MAX; i++) { if (p->p_racct->r_resources[i] == 0) continue; - if (!RACCT_IS_RECLAIMABLE(i)) + if (!RACCT_IS_RECLAIMABLE(i)) continue; racct_set_locked(p, i, 0, 0); } Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Tue Feb 14 13:45:38 2017 (r313729) +++ head/sys/vm/vm_pageout.c Tue Feb 14 13:54:05 2017 (r313730) @@ -2268,12 +2268,14 @@ again: if (size >= limit) { vm_pageout_map_deactivate_pages( &vm->vm_map, limit); + size = vmspace_resident_count(vm); } #ifdef RACCT if (racct_enable) { rsize = IDX_TO_OFF(size); PROC_LOCK(p); - racct_set(p, RACCT_RSS, rsize); + if (p->p_state == PRS_NORMAL) + racct_set(p, RACCT_RSS, rsize); ravailable = racct_get_available(p, RACCT_RSS); PROC_UNLOCK(p); if (rsize > ravailable) { @@ -2299,7 +2301,8 @@ again: size = vmspace_resident_count(vm); rsize = IDX_TO_OFF(size); PROC_LOCK(p); - racct_set(p, RACCT_RSS, rsize); + if (p->p_state == PRS_NORMAL) + racct_set(p, RACCT_RSS, rsize); PROC_UNLOCK(p); if (rsize > ravailable) tryagain = 1; From owner-svn-src-head@freebsd.org Tue Feb 14 16:28:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8E03CDF33C; Tue, 14 Feb 2017 16:28:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.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 C093B1B52; Tue, 14 Feb 2017 16:28:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 96AE410A7DB; Tue, 14 Feb 2017 11:28:57 -0500 (EST) From: John Baldwin To: Bartek Rutkowski Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313727 - in head: lib/libvmmapi usr.sbin/bhyve Date: Tue, 14 Feb 2017 07:14:15 -0800 Message-ID: <2453150.oLT9KULcP9@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201702141335.v1EDZxr8057062@repo.freebsd.org> References: <201702141335.v1EDZxr8057062@repo.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.4.3 (mail.baldwin.cx); Tue, 14 Feb 2017 11:28:57 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 16:28:59 -0000 On Tuesday, February 14, 2017 01:35:59 PM Bartek Rutkowski wrote: > Author: robak (ports committer) > Date: Tue Feb 14 13:35:59 2017 > New Revision: 313727 > URL: https://svnweb.freebsd.org/changeset/base/313727 > > Log: > Capsicum support for bhyve(8). > > Adds Capsicum sandboxing to bhyve. > > Submitted by: Pawel Biernacki > Reviewed by: grehan, oshogbo > Approved by: emaste, grehan > Sponsored by: Mysterious Code Ltd. > Differential Revision: https://reviews.freebsd.org/D8290 Neat, though it adds a bit more work to future changes. (I have WIP to add a GDB server to bhyve that adds more ioctls, etc. I can probably just compile without capsicum though until the set of ioctls stabilizes.) > Modified: head/lib/libvmmapi/vmmapi.c > ============================================================================== > --- head/lib/libvmmapi/vmmapi.c Tue Feb 14 04:52:24 2017 (r313726) > +++ head/lib/libvmmapi/vmmapi.c Tue Feb 14 13:35:59 2017 (r313727) > @@ -1416,3 +1416,45 @@ vm_restart_instruction(void *arg, int vc > > return (ioctl(ctx->fd, VM_RESTART_INSTRUCTION, &vcpu)); > } > + > +int > +vm_get_device_fd(struct vmctx *ctx) > +{ > + > + return (ctx->fd); > +} > + > +const cap_ioctl_t * > +vm_get_ioctls(size_t *len) > +{ > + cap_ioctl_t *cmds; > + /* keep in sync with machine/vmm_dev.h */ > + static const cap_ioctl_t vm_ioctl_cmds[] = { VM_RUN, VM_SUSPEND, VM_REINIT, > + VM_ALLOC_MEMSEG, VM_GET_MEMSEG, VM_MMAP_MEMSEG, VM_MMAP_MEMSEG, > + VM_MMAP_GETNEXT, VM_SET_REGISTER, VM_GET_REGISTER, > + VM_SET_SEGMENT_DESCRIPTOR, VM_GET_SEGMENT_DESCRIPTOR, > + VM_INJECT_EXCEPTION, VM_LAPIC_IRQ, VM_LAPIC_LOCAL_IRQ, > + VM_LAPIC_MSI, VM_IOAPIC_ASSERT_IRQ, VM_IOAPIC_DEASSERT_IRQ, > + VM_IOAPIC_PULSE_IRQ, VM_IOAPIC_PINCOUNT, VM_ISA_ASSERT_IRQ, > + VM_ISA_DEASSERT_IRQ, VM_ISA_PULSE_IRQ, VM_ISA_SET_IRQ_TRIGGER, > + VM_SET_CAPABILITY, VM_GET_CAPABILITY, VM_BIND_PPTDEV, > + VM_UNBIND_PPTDEV, VM_MAP_PPTDEV_MMIO, VM_PPTDEV_MSI, > + VM_PPTDEV_MSIX, VM_INJECT_NMI, VM_STATS, VM_STAT_DESC, > + VM_SET_X2APIC_STATE, VM_GET_X2APIC_STATE, > + VM_GET_HPET_CAPABILITIES, VM_GET_GPA_PMAP, VM_GLA2GPA, > + VM_ACTIVATE_CPU, VM_GET_CPUS, VM_SET_INTINFO, VM_GET_INTINFO, > + VM_RTC_WRITE, VM_RTC_READ, VM_RTC_SETTIME, VM_RTC_GETTIME, > + VM_RESTART_INSTRUCTION }; > + > + if (len == NULL) { > + cmds = malloc(sizeof(vm_ioctl_cmds)); > + if (cmds == NULL) > + return (NULL); > + bcopy(vm_ioctl_cmds, cmds, sizeof(vm_ioctl_cmds)); > + return (cmds); Given you are returning a const array, why do you have to malloc a separate copy vs just returning vm_ioctl_cmds[] directly? It would seem that the interface for this could be that it always returns vm_ioctl_cmds and sets *len if len is not NULL. > Modified: head/usr.sbin/bhyve/bhyverun.c > ============================================================================== > --- head/usr.sbin/bhyve/bhyverun.c Tue Feb 14 04:52:24 2017 (r313726) > +++ head/usr.sbin/bhyve/bhyverun.c Tue Feb 14 13:35:59 2017 (r313727) > @@ -744,6 +759,21 @@ do_open(const char *vmname) > exit(1); > } > > +#ifndef WITHOUT_CAPSICUM > + cap_rights_init(&rights, CAP_IOCTL, CAP_MMAP_RW); > + if (cap_rights_limit(vm_get_device_fd(ctx), &rights) == -1 && > + errno != ENOSYS) > + errx(EX_OSERR, "Unable to apply rights for sandbox"); > + vm_get_ioctls(&ncmds); > + cmds = vm_get_ioctls(NULL); > + if (cmds == NULL) > + errx(EX_OSERR, "out of memory"); > + if (cap_ioctls_limit(vm_get_device_fd(ctx), cmds, ncmds) == -1 && > + errno != ENOSYS) > + errx(EX_OSERR, "Unable to apply rights for sandbox"); > + free((cap_ioctl_t *)cmds); > +#endif > + I wonder if instead of doing this in the executable and exposing vm_get_ioctls, etc. if the API shouldn't really be something like 'vm_limit_rights(ctx)' and this code should be in that function in libvmmapi? It would be something like (assuming you drop vm_get_ioctls() entirely and expose vm_ioctl_cmds[] as a static global in the library): int vm_limit_rights(struct vm_ctx *ctx) { ... cap_rights_init(&rights, CAP_IOCTL, CAP_MMAP_RW); if (cap_rights_limit(ctx->fd, &rights) == -1) { if (errno == ENOSYS) return (0); else return (-1); } /* Shouldn't get ENOSYS here if cap_rights_limit worked. */ return (cap_ioctls_limit(ctx->fd, vm_ioctl_cmds, nitems(vm_ioctl_cmds)); } You wouldn't need vm_get_device_fd() either in this API. > Modified: head/usr.sbin/bhyve/consport.c > ============================================================================== > --- head/usr.sbin/bhyve/consport.c Tue Feb 14 04:52:24 2017 (r313726) > +++ head/usr.sbin/bhyve/consport.c Tue Feb 14 13:35:59 2017 (r313727) > @@ -123,6 +133,13 @@ console_handler(struct vmctx *ctx, int v > return (-1); > > if (!opened) { > +#ifndef WITHOUT_CAPSICUM > + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); > + if (cap_rights_limit(STDIN_FILENO, &rights) == -1 && errno != ENOSYS) > + errx(EX_OSERR, "Unable to apply rights for sandbox"); > + if (cap_ioctls_limit(STDIN_FILENO, cmds, nitems(cmds)) == -1 && errno != ENOSYS) > + errx(EX_OSERR, "Unable to apply rights for sandbox"); > +#endif > ttyopen(); > opened = 1; > } Indentation looks wrong? -- John Baldwin From owner-svn-src-head@freebsd.org Tue Feb 14 16:33:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB95BCDF56F; Tue, 14 Feb 2017 16:33:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 780FB1106; Tue, 14 Feb 2017 16:33:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EGXgav035360; Tue, 14 Feb 2017 16:33:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EGXg01035359; Tue, 14 Feb 2017 16:33:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702141633.v1EGXg01035359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 14 Feb 2017 16:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313731 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 16:33:43 -0000 Author: mav Date: Tue Feb 14 16:33:42 2017 New Revision: 313731 URL: https://svnweb.freebsd.org/changeset/base/313731 Log: Do not rely on data alignment after m_pullup(). In general case m_pullup() does not really guarantee any data alignment. Instead of depenting on side effects caused by data being always copied out of mbuf cluster (which is probably a bug by itself), always allocate aligned BHS buffer and read data there directly from socket. While there, reuse new icl_conn_receive_buf() function to read digests. The code could probably be even more optimized to aggregate those reads, but until that done, this is still easier then the way it was before. MFC after: 2 weeks Modified: head/sys/dev/iscsi/icl_soft.c Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Tue Feb 14 13:54:05 2017 (r313730) +++ head/sys/dev/iscsi/icl_soft.c Tue Feb 14 16:33:42 2017 (r313731) @@ -169,6 +169,40 @@ icl_conn_receive(struct icl_conn *ic, si return (m); } +static int +icl_conn_receive_buf(struct icl_conn *ic, void *buf, size_t len) +{ + struct iovec iov[1]; + struct uio uio; + struct socket *so; + int error, flags; + + so = ic->ic_socket; + + memset(&uio, 0, sizeof(uio)); + iov[0].iov_base = buf; + iov[0].iov_len = len; + uio.uio_iov = iov; + uio.uio_iovcnt = 1; + uio.uio_offset = 0; + uio.uio_resid = len; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_rw = UIO_READ; + + flags = MSG_DONTWAIT; + error = soreceive(so, NULL, &uio, NULL, NULL, &flags); + if (error != 0) { + ICL_DEBUG("soreceive error %d", error); + return (-1); + } + if (uio.uio_resid != 0) { + ICL_DEBUG("short read"); + return (-1); + } + + return (0); +} + static struct icl_pdu * icl_pdu_new_empty(struct icl_conn *ic, int flags) { @@ -229,7 +263,7 @@ icl_soft_conn_new_pdu(struct icl_conn *i ip->ip_bhs_mbuf = m_getm2(NULL, sizeof(struct iscsi_bhs), flags, MT_DATA, M_PKTHDR); if (ip->ip_bhs_mbuf == NULL) { - ICL_WARN("failed to allocate %zd bytes", sizeof(*ip)); + ICL_WARN("failed to allocate BHS mbuf"); icl_pdu_free(ip); return (NULL); } @@ -308,28 +342,13 @@ icl_pdu_size(const struct icl_pdu *respo static int icl_pdu_receive_bhs(struct icl_pdu *request, size_t *availablep) { - struct mbuf *m; - m = icl_conn_receive(request->ip_conn, sizeof(struct iscsi_bhs)); - if (m == NULL) { + if (icl_conn_receive_buf(request->ip_conn, + request->ip_bhs, sizeof(struct iscsi_bhs))) { ICL_DEBUG("failed to receive BHS"); return (-1); } - request->ip_bhs_mbuf = m_pullup(m, sizeof(struct iscsi_bhs)); - if (request->ip_bhs_mbuf == NULL) { - ICL_WARN("m_pullup failed"); - return (-1); - } - request->ip_bhs = mtod(request->ip_bhs_mbuf, struct iscsi_bhs *); - - /* - * XXX: For architectures with strict alignment requirements - * we may need to allocate ip_bhs and copy the data into it. - * For some reason, though, not doing this doesn't seem - * to cause problems; tested on sparc64. - */ - *availablep -= sizeof(struct iscsi_bhs); return (0); } @@ -371,22 +390,17 @@ icl_mbuf_to_crc32c(const struct mbuf *m0 static int icl_pdu_check_header_digest(struct icl_pdu *request, size_t *availablep) { - struct mbuf *m; uint32_t received_digest, valid_digest; if (request->ip_conn->ic_header_crc32c == false) return (0); - m = icl_conn_receive(request->ip_conn, ISCSI_HEADER_DIGEST_SIZE); - if (m == NULL) { + CTASSERT(sizeof(received_digest) == ISCSI_HEADER_DIGEST_SIZE); + if (icl_conn_receive_buf(request->ip_conn, + &received_digest, ISCSI_HEADER_DIGEST_SIZE)) { ICL_DEBUG("failed to receive header digest"); return (-1); } - - CTASSERT(sizeof(received_digest) == ISCSI_HEADER_DIGEST_SIZE); - m_copydata(m, 0, ISCSI_HEADER_DIGEST_SIZE, (void *)&received_digest); - m_freem(m); - *availablep -= ISCSI_HEADER_DIGEST_SIZE; /* @@ -526,7 +540,6 @@ icl_pdu_receive_data_segment(struct icl_ static int icl_pdu_check_data_digest(struct icl_pdu *request, size_t *availablep) { - struct mbuf *m; uint32_t received_digest, valid_digest; if (request->ip_conn->ic_data_crc32c == false) @@ -535,16 +548,12 @@ icl_pdu_check_data_digest(struct icl_pdu if (request->ip_data_len == 0) return (0); - m = icl_conn_receive(request->ip_conn, ISCSI_DATA_DIGEST_SIZE); - if (m == NULL) { + CTASSERT(sizeof(received_digest) == ISCSI_DATA_DIGEST_SIZE); + if (icl_conn_receive_buf(request->ip_conn, + &received_digest, ISCSI_DATA_DIGEST_SIZE)) { ICL_DEBUG("failed to receive data digest"); return (-1); } - - CTASSERT(sizeof(received_digest) == ISCSI_DATA_DIGEST_SIZE); - m_copydata(m, 0, ISCSI_DATA_DIGEST_SIZE, (void *)&received_digest); - m_freem(m); - *availablep -= ISCSI_DATA_DIGEST_SIZE; /* @@ -580,7 +589,7 @@ icl_conn_receive_pdu(struct icl_conn *ic if (ic->ic_receive_state == ICL_CONN_STATE_BHS) { KASSERT(ic->ic_receive_pdu == NULL, ("ic->ic_receive_pdu != NULL")); - request = icl_pdu_new_empty(ic, M_NOWAIT); + request = icl_soft_conn_new_pdu(ic, M_NOWAIT); if (request == NULL) { ICL_DEBUG("failed to allocate PDU; " "dropping connection"); From owner-svn-src-head@freebsd.org Tue Feb 14 16:49:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1D94CDF837; Tue, 14 Feb 2017 16:49:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C171D183E; Tue, 14 Feb 2017 16:49:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EGnWWq039653; Tue, 14 Feb 2017 16:49:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EGnWis039652; Tue, 14 Feb 2017 16:49:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201702141649.v1EGnWis039652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 14 Feb 2017 16:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313732 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 16:49:34 -0000 Author: emaste Date: Tue Feb 14 16:49:32 2017 New Revision: 313732 URL: https://svnweb.freebsd.org/changeset/base/313732 Log: bhyve: whitespace fix for r313727 Reported by: jhb Modified: head/usr.sbin/bhyve/consport.c Modified: head/usr.sbin/bhyve/consport.c ============================================================================== --- head/usr.sbin/bhyve/consport.c Tue Feb 14 16:33:42 2017 (r313731) +++ head/usr.sbin/bhyve/consport.c Tue Feb 14 16:49:32 2017 (r313732) @@ -134,11 +134,14 @@ console_handler(struct vmctx *ctx, int v if (!opened) { #ifndef WITHOUT_CAPSICUM - cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); - if (cap_rights_limit(STDIN_FILENO, &rights) == -1 && errno != ENOSYS) - errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (cap_ioctls_limit(STDIN_FILENO, cmds, nitems(cmds)) == -1 && errno != ENOSYS) - errx(EX_OSERR, "Unable to apply rights for sandbox"); + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, + CAP_WRITE); + if (cap_rights_limit(STDIN_FILENO, &rights) == -1 && + errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(STDIN_FILENO, cmds, nitems(cmds)) == -1 && + errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif ttyopen(); opened = 1; From owner-svn-src-head@freebsd.org Tue Feb 14 17:13:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A815CDFF75; Tue, 14 Feb 2017 17:13:24 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 290291964; Tue, 14 Feb 2017 17:13:24 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EHDNeb051758; Tue, 14 Feb 2017 17:13:23 GMT (envelope-from badger@FreeBSD.org) Received: (from badger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EHDNo1051757; Tue, 14 Feb 2017 17:13:23 GMT (envelope-from badger@FreeBSD.org) Message-Id: <201702141713.v1EHDNo1051757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: badger set sender to badger@FreeBSD.org using -f From: Eric Badger Date: Tue, 14 Feb 2017 17:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313733 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 17:13:24 -0000 Author: badger Date: Tue Feb 14 17:13:23 2017 New Revision: 313733 URL: https://svnweb.freebsd.org/changeset/base/313733 Log: sleepq_catch_signals: do thread suspension before signal check Since locks are dropped when a thread suspends, it's possible for another thread to deliver a signal to the suspended thread. If the thread awakens from suspension without checking for signals, it may go to sleep despite having a pending signal that should wake it up. Therefore the suspension check is done first, so any signals sent while suspended will be caught in the subsequent signal check. Reviewed by: kib Approved by: kib (mentor) MFC after: 2 weeks Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D9530 Modified: head/sys/kern/subr_sleepqueue.c Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Tue Feb 14 16:49:32 2017 (r313732) +++ head/sys/kern/subr_sleepqueue.c Tue Feb 14 17:13:23 2017 (r313733) @@ -430,6 +430,7 @@ sleepq_catch_signals(void *wchan, int pr struct sigacts *ps; int sig, ret; + ret = 0; td = curthread; p = curproc; sc = SC_LOOKUP(wchan); @@ -443,53 +444,65 @@ sleepq_catch_signals(void *wchan, int pr } /* - * See if there are any pending signals for this thread. If not - * we can switch immediately. Otherwise do the signal processing - * directly. + * See if there are any pending signals or suspension requests for this + * thread. If not, we can switch immediately. */ thread_lock(td); - if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) == 0) { - sleepq_switch(wchan, pri); - return (0); - } - thread_unlock(td); - mtx_unlock_spin(&sc->sc_lock); - CTR3(KTR_PROC, "sleepq catching signals: thread %p (pid %ld, %s)", - (void *)td, (long)p->p_pid, td->td_name); - PROC_LOCK(p); - ps = p->p_sigacts; - mtx_lock(&ps->ps_mtx); - sig = cursig(td); - if (sig == -1) { - mtx_unlock(&ps->ps_mtx); - KASSERT((td->td_flags & TDF_SBDRY) != 0, ("lost TDF_SBDRY")); - KASSERT(TD_SBDRY_INTR(td), - ("lost TDF_SERESTART of TDF_SEINTR")); - KASSERT((td->td_flags & (TDF_SEINTR | TDF_SERESTART)) != - (TDF_SEINTR | TDF_SERESTART), - ("both TDF_SEINTR and TDF_SERESTART")); - ret = TD_SBDRY_ERRNO(td); - } else if (sig == 0) { - mtx_unlock(&ps->ps_mtx); - ret = thread_suspend_check(1); - MPASS(ret == 0 || ret == EINTR || ret == ERESTART); - } else { - if (SIGISMEMBER(ps->ps_sigintr, sig)) - ret = EINTR; - else - ret = ERESTART; - mtx_unlock(&ps->ps_mtx); + if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) != 0) { + thread_unlock(td); + mtx_unlock_spin(&sc->sc_lock); + CTR3(KTR_PROC, "sleepq catching signals: thread %p (pid %ld, %s)", + (void *)td, (long)p->p_pid, td->td_name); + PROC_LOCK(p); + /* + * Check for suspension first. Checking for signals and then + * suspending could result in a missed signal, since a signal + * can be delivered while this thread is suspended. + */ + if ((td->td_flags & TDF_NEEDSUSPCHK) != 0) { + ret = thread_suspend_check(1); + MPASS(ret == 0 || ret == EINTR || ret == ERESTART); + if (ret != 0) { + PROC_UNLOCK(p); + mtx_lock_spin(&sc->sc_lock); + thread_lock(td); + goto out; + } + } + if ((td->td_flags & TDF_NEEDSIGCHK) != 0) { + ps = p->p_sigacts; + mtx_lock(&ps->ps_mtx); + sig = cursig(td); + if (sig == -1) { + mtx_unlock(&ps->ps_mtx); + KASSERT((td->td_flags & TDF_SBDRY) != 0, + ("lost TDF_SBDRY")); + KASSERT(TD_SBDRY_INTR(td), + ("lost TDF_SERESTART of TDF_SEINTR")); + KASSERT((td->td_flags & + (TDF_SEINTR | TDF_SERESTART)) != + (TDF_SEINTR | TDF_SERESTART), + ("both TDF_SEINTR and TDF_SERESTART")); + ret = TD_SBDRY_ERRNO(td); + } else if (sig != 0) { + ret = SIGISMEMBER(ps->ps_sigintr, sig) ? + EINTR : ERESTART; + mtx_unlock(&ps->ps_mtx); + } else { + mtx_unlock(&ps->ps_mtx); + } + } + /* + * Lock the per-process spinlock prior to dropping the PROC_LOCK + * to avoid a signal delivery race. PROC_LOCK, PROC_SLOCK, and + * thread_lock() are currently held in tdsendsignal(). + */ + PROC_SLOCK(p); + mtx_lock_spin(&sc->sc_lock); + PROC_UNLOCK(p); + thread_lock(td); + PROC_SUNLOCK(p); } - /* - * Lock the per-process spinlock prior to dropping the PROC_LOCK - * to avoid a signal delivery race. PROC_LOCK, PROC_SLOCK, and - * thread_lock() are currently held in tdsendsignal(). - */ - PROC_SLOCK(p); - mtx_lock_spin(&sc->sc_lock); - PROC_UNLOCK(p); - thread_lock(td); - PROC_SUNLOCK(p); if (ret == 0) { sleepq_switch(wchan, pri); return (0); From owner-svn-src-head@freebsd.org Tue Feb 14 17:44:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93F7CCDFAE3; Tue, 14 Feb 2017 17:44:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63B311B11; Tue, 14 Feb 2017 17:44:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EHiUGf064229; Tue, 14 Feb 2017 17:44:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EHiUqZ064228; Tue, 14 Feb 2017 17:44:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702141744.v1EHiUqZ064228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 14 Feb 2017 17:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313734 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 17:44:31 -0000 Author: kib Date: Tue Feb 14 17:44:30 2017 New Revision: 313734 URL: https://svnweb.freebsd.org/changeset/base/313734 Log: Add RLIM_SAVED_MAX and RLIM_SAVED_CUR symbols. Define them as RLIM_INFINITY. This is allowed by POSIX in case all resource limits are representable in an object of type rlim_t. Since we do not allow negative rlim_t, with some strength this definition is conforming. We are not conforming fully still because POSIX requires rlim_t to be unsigned type. Fixing this without breaking ABI to redefine RLIM_INFINITY is impossible. PR: 209729 Submitted by: bltsrc@mail.ru Exp-run done by: antoine MFC after: 2 weeks Modified: head/sys/sys/resource.h Modified: head/sys/sys/resource.h ============================================================================== --- head/sys/sys/resource.h Tue Feb 14 17:13:23 2017 (r313733) +++ head/sys/sys/resource.h Tue Feb 14 17:44:30 2017 (r313734) @@ -119,8 +119,8 @@ struct __wrusage { #define RLIM_NLIMITS 15 /* number of resource limits */ #define RLIM_INFINITY ((rlim_t)(((__uint64_t)1 << 63) - 1)) -/* XXX Missing: RLIM_SAVED_MAX, RLIM_SAVED_CUR */ - +#define RLIM_SAVED_MAX RLIM_INFINITY +#define RLIM_SAVED_CUR RLIM_INFINITY /* * Resource limit string identifiers From owner-svn-src-head@freebsd.org Tue Feb 14 17:49:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E33CACDFC72; Tue, 14 Feb 2017 17:49:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB0391DC3; Tue, 14 Feb 2017 17:49:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EHn8du064477; Tue, 14 Feb 2017 17:49:08 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EHn8vJ064474; Tue, 14 Feb 2017 17:49:08 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702141749.v1EHn8vJ064474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 14 Feb 2017 17:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313735 - in head/sys: fs/nfsserver rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 17:49:10 -0000 Author: avg Date: Tue Feb 14 17:49:08 2017 New Revision: 313735 URL: https://svnweb.freebsd.org/changeset/base/313735 Log: add svcpool_close to handle killed nfsd threads This patch adds a new function to the server krpc called svcpool_close(). It is similar to svcpool_destroy(), but does not free the data structures, so that the pool can be used again. This function is then used instead of svcpool_destroy(), svcpool_create() when the nfsd threads are killed. PR: 204340 Reported by: Panzura Approved by: rmacklem Obtained from: rmacklem MFC after: 1 week Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c head/sys/rpc/svc.c head/sys/rpc/svc.h Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Tue Feb 14 17:44:30 2017 (r313734) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Tue Feb 14 17:49:08 2017 (r313735) @@ -551,18 +551,16 @@ nfsrvd_init(int terminating) nfsd_master_proc = NULL; NFSD_UNLOCK(); nfsrv_freeallbackchannel_xprts(); - svcpool_destroy(nfsrvd_pool); - nfsrvd_pool = NULL; + svcpool_close(nfsrvd_pool); + NFSD_LOCK(); + } else { + NFSD_UNLOCK(); + nfsrvd_pool = svcpool_create("nfsd", + SYSCTL_STATIC_CHILDREN(_vfs_nfsd)); + nfsrvd_pool->sp_rcache = NULL; + nfsrvd_pool->sp_assign = fhanew_assign; + nfsrvd_pool->sp_done = fha_nd_complete; NFSD_LOCK(); } - - NFSD_UNLOCK(); - - nfsrvd_pool = svcpool_create("nfsd", SYSCTL_STATIC_CHILDREN(_vfs_nfsd)); - nfsrvd_pool->sp_rcache = NULL; - nfsrvd_pool->sp_assign = fhanew_assign; - nfsrvd_pool->sp_done = fha_nd_complete; - - NFSD_LOCK(); } Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Tue Feb 14 17:44:30 2017 (r313734) +++ head/sys/rpc/svc.c Tue Feb 14 17:49:08 2017 (r313735) @@ -75,6 +75,7 @@ static void svc_new_thread(SVCGROUP *grp static void xprt_unregister_locked(SVCXPRT *xprt); static void svc_change_space_used(SVCPOOL *pool, long delta); static bool_t svc_request_space_available(SVCPOOL *pool); +static void svcpool_cleanup(SVCPOOL *pool); /* *************** SVCXPRT related stuff **************** */ @@ -174,8 +175,12 @@ svcpool_create(const char *name, struct return pool; } -void -svcpool_destroy(SVCPOOL *pool) +/* + * Code common to svcpool_destroy() and svcpool_close(), which cleans up + * the pool data structures. + */ +static void +svcpool_cleanup(SVCPOOL *pool) { SVCGROUP *grp; SVCXPRT *xprt, *nxprt; @@ -211,6 +216,15 @@ svcpool_destroy(SVCPOOL *pool) mtx_lock(&pool->sp_lock); } mtx_unlock(&pool->sp_lock); +} + +void +svcpool_destroy(SVCPOOL *pool) +{ + SVCGROUP *grp; + int g; + + svcpool_cleanup(pool); for (g = 0; g < SVC_MAXGROUPS; g++) { grp = &pool->sp_groups[g]; @@ -226,6 +240,30 @@ svcpool_destroy(SVCPOOL *pool) } /* + * Similar to svcpool_destroy(), except that it does not destroy the actual + * data structures. As such, "pool" may be used again. + */ +void +svcpool_close(SVCPOOL *pool) +{ + SVCGROUP *grp; + int g; + + svcpool_cleanup(pool); + + /* Now, initialize the pool's state for a fresh svc_run() call. */ + mtx_lock(&pool->sp_lock); + pool->sp_state = SVCPOOL_INIT; + mtx_unlock(&pool->sp_lock); + for (g = 0; g < SVC_MAXGROUPS; g++) { + grp = &pool->sp_groups[g]; + mtx_lock(&grp->sg_lock); + grp->sg_state = SVCPOOL_ACTIVE; + mtx_unlock(&grp->sg_lock); + } +} + +/* * Sysctl handler to get the present thread count on a pool */ static int Modified: head/sys/rpc/svc.h ============================================================================== --- head/sys/rpc/svc.h Tue Feb 14 17:44:30 2017 (r313734) +++ head/sys/rpc/svc.h Tue Feb 14 17:49:08 2017 (r313735) @@ -729,6 +729,12 @@ extern SVCPOOL* svcpool_create(const cha extern void svcpool_destroy(SVCPOOL *pool); /* + * Close a service pool. Similar to svcpool_destroy(), but it does not + * free the data structures. As such, the pool can be used again. + */ +extern void svcpool_close(SVCPOOL *pool); + +/* * Transport independent svc_create routine. */ extern int svc_create(SVCPOOL *, void (*)(struct svc_req *, SVCXPRT *), From owner-svn-src-head@freebsd.org Tue Feb 14 18:03:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99F7FCDE1F5; Tue, 14 Feb 2017 18:03:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61884184A; Tue, 14 Feb 2017 18:03:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EI3HKM072540; Tue, 14 Feb 2017 18:03:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EI3HpB072539; Tue, 14 Feb 2017 18:03:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702141803.v1EI3HpB072539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 14 Feb 2017 18:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313736 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 18:03:18 -0000 Author: mav Date: Tue Feb 14 18:03:17 2017 New Revision: 313736 URL: https://svnweb.freebsd.org/changeset/base/313736 Log: Fix panic on shutdown of ramdisk LU with zero capacity. MFC after: 1 week Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Tue Feb 14 17:49:08 2017 (r313735) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Tue Feb 14 18:03:17 2017 (r313736) @@ -1120,8 +1120,10 @@ ctl_backend_ramdisk_create(struct ctl_be STAILQ_INIT(&be_lun->cont_queue); sx_init(&be_lun->page_lock, "cram page lock"); - if (be_lun->cap_bytes == 0) + if (be_lun->cap_bytes == 0) { + be_lun->indir = 0; be_lun->pages = malloc(be_lun->pblocksize, M_RAMDISK, M_WAITOK); + } be_lun->zero_page = malloc(be_lun->pblocksize, M_RAMDISK, M_WAITOK|M_ZERO); mtx_init(&be_lun->queue_lock, "cram queue lock", NULL, MTX_DEF); From owner-svn-src-head@freebsd.org Tue Feb 14 18:11:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42B10CDE38A; Tue, 14 Feb 2017 18:11:18 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01FBF1D39; Tue, 14 Feb 2017 18:11:17 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EIBHNQ073109; Tue, 14 Feb 2017 18:11:17 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EIBHgY073108; Tue, 14 Feb 2017 18:11:17 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201702141811.v1EIBHgY073108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Tue, 14 Feb 2017 18:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313737 - head/usr.sbin/ndp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 18:11:18 -0000 Author: garga (ports committer) Date: Tue Feb 14 18:11:16 2017 New Revision: 313737 URL: https://svnweb.freebsd.org/changeset/base/313737 Log: Fix style(9) Reviewed by: allanjude, vangyzen Approved by: allanjude MFC after: 1 week Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D9510 Modified: head/usr.sbin/ndp/ndp.c Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Tue Feb 14 18:03:17 2017 (r313736) +++ head/usr.sbin/ndp/ndp.c Tue Feb 14 18:11:16 2017 (r313737) @@ -109,10 +109,11 @@ #include #include "gmt2local.h" -#define NEXTADDR(w, s) \ - if (rtm->rtm_addrs & (w)) { \ - bcopy((char *)&s, cp, sizeof(s)); cp += SA_SIZE(&s);} - +#define NEXTADDR(w, s) \ + if (rtm->rtm_addrs & (w)) { \ + bcopy((char *)&s, cp, sizeof(s)); \ + cp += SA_SIZE(&s); \ + } static pid_t pid; static int nflag; @@ -529,10 +530,10 @@ delete: printf("cannot locate %s\n", host); return (1); } - /* - * need to reinit the field because it has rt_key - * but we want the actual address - */ + /* + * need to reinit the field because it has rt_key + * but we want the actual address + */ NEXTADDR(RTA_DST, sin_m); rtm->rtm_flags |= RTF_LLDATA; if (rtmsg(RTM_DELETE) == 0) { @@ -604,7 +605,8 @@ again:; rtm = (struct rt_msghdr *)next; sin = (struct sockaddr_in6 *)(rtm + 1); - sdl = (struct sockaddr_dl *)((char *)sin + ALIGN(sin->sin6_len)); + sdl = (struct sockaddr_dl *)((char *)sin + + ALIGN(sin->sin6_len)); /* * Some OSes can produce a route that has the LINK flag but @@ -724,7 +726,7 @@ again:; isrouter ? "R" : "", (rtm->rtm_flags & RTF_ANNOUNCE) ? "p" : ""); } else { -#if 0 /* W and P are mystery even for us */ +#if 0 /* W and P are mystery even for us */ sin = (struct sockaddr_in6 *) (sdl->sdl_len + (char *)sdl); snprintf(flgbuf, sizeof(flgbuf), "%s%s%s%s", @@ -855,7 +857,7 @@ rtmsg(int cmd) rtm->rtm_inits = RTV_EXPIRE; } rtm->rtm_flags |= (RTF_HOST | RTF_STATIC | RTF_LLDATA); -#if 0 /* we don't support ipv6addr/128 type proxying */ +#if 0 /* we don't support ipv6addr/128 type proxying */ if (rtm->rtm_flags & RTF_ANNOUNCE) { rtm->rtm_flags &= ~RTF_HOST; rtm->rtm_addrs |= RTA_NETMASK; @@ -868,7 +870,7 @@ rtmsg(int cmd) NEXTADDR(RTA_DST, sin_m); NEXTADDR(RTA_GATEWAY, sdl_m); -#if 0 /* we don't support ipv6addr/128 type proxying */ +#if 0 /* we don't support ipv6addr/128 type proxying */ memset(&so_mask.sin6_addr, 0xff, sizeof(so_mask.sin6_addr)); NEXTADDR(RTA_NETMASK, so_mask); #endif @@ -913,7 +915,7 @@ ifinfo(char *ifname, int argc, char **ar err(1, "ioctl(SIOCGIFINFO_IN6)"); /* NOTREACHED */ } -#define ND nd.ndi +#define ND nd.ndi newflags = ND.flags; for (i = 0; i < argc; i++) { int clear = 0; @@ -924,35 +926,33 @@ ifinfo(char *ifname, int argc, char **ar cp++; } -#define SETFLAG(s, f) \ - do {\ - if (strcmp(cp, (s)) == 0) {\ - if (clear)\ - newflags &= ~(f);\ - else\ - newflags |= (f);\ - }\ - } while (0) +#define SETFLAG(s, f) do { \ + if (strcmp(cp, (s)) == 0) { \ + if (clear) \ + newflags &= ~(f); \ + else \ + newflags |= (f); \ + } \ +} while (0) /* * XXX: this macro is not 100% correct, in that it matches "nud" against * "nudbogus". But we just let it go since this is minor. */ -#define SETVALUE(f, v) \ - do { \ - char *valptr; \ - unsigned long newval; \ - v = 0; /* unspecified */ \ - if (strncmp(cp, f, strlen(f)) == 0) { \ - valptr = strchr(cp, '='); \ - if (valptr == NULL) \ - err(1, "syntax error in %s field", (f)); \ - errno = 0; \ - newval = strtoul(++valptr, NULL, 0); \ - if (errno) \ - err(1, "syntax error in %s's value", (f)); \ - v = newval; \ - } \ - } while (0) +#define SETVALUE(f, v) do { \ + char *valptr; \ + unsigned long newval; \ + v = 0; /* unspecified */ \ + if (strncmp(cp, f, strlen(f)) == 0) { \ + valptr = strchr(cp, '='); \ + if (valptr == NULL) \ + err(1, "syntax error in %s field", (f)); \ + errno = 0; \ + newval = strtoul(++valptr, NULL, 0); \ + if (errno) \ + err(1, "syntax error in %s's value", (f)); \ + v = newval; \ + } \ +} while (0) SETFLAG("disabled", ND6_IFF_IFDISABLED); SETFLAG("nud", ND6_IFF_PERFORMNUD); @@ -1021,7 +1021,7 @@ ifinfo(char *ifname, int argc, char **ar printf("%02x", rbuf[j]); } } -#endif +#endif /* IPV6CTL_USETEMPADDR */ if (ND.flags) { printf("\nFlags: "); #ifdef ND6_IFF_IFDISABLED @@ -1314,7 +1314,7 @@ getdefif() close(s); } -#endif +#endif /* SIOCSDEFIFACE_IN6 */ static char * sec2str(time_t total) From owner-svn-src-head@freebsd.org Tue Feb 14 18:29:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E6BCCDEA2A; Tue, 14 Feb 2017 18:29:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BB0918B3; Tue, 14 Feb 2017 18:29:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EIT77A081144; Tue, 14 Feb 2017 18:29:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EIT73l081143; Tue, 14 Feb 2017 18:29:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702141829.v1EIT73l081143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 14 Feb 2017 18:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313738 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 18:29:08 -0000 Author: mav Date: Tue Feb 14 18:29:07 2017 New Revision: 313738 URL: https://svnweb.freebsd.org/changeset/base/313738 Log: Temporary attach AHS to BHS to calculate header digest. MFC after: 2 weeks Modified: head/sys/dev/iscsi/icl_soft.c Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Tue Feb 14 18:11:16 2017 (r313737) +++ head/sys/dev/iscsi/icl_soft.c Tue Feb 14 18:29:07 2017 (r313738) @@ -403,10 +403,10 @@ icl_pdu_check_header_digest(struct icl_p } *availablep -= ISCSI_HEADER_DIGEST_SIZE; - /* - * XXX: Handle AHS. - */ + /* Temporary attach AHS to BHS to calculate header digest. */ + request->ip_bhs_mbuf->m_next = request->ip_ahs_mbuf; valid_digest = icl_mbuf_to_crc32c(request->ip_bhs_mbuf); + request->ip_bhs_mbuf->m_next = NULL; if (received_digest != valid_digest) { ICL_WARN("header digest check failed; got 0x%x, " "should be 0x%x", received_digest, valid_digest); From owner-svn-src-head@freebsd.org Tue Feb 14 18:34:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6942CCDEEA0; Tue, 14 Feb 2017 18:34:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3684B1FE9; Tue, 14 Feb 2017 18:34:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EIYPcQ085101; Tue, 14 Feb 2017 18:34:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EIYP4q085100; Tue, 14 Feb 2017 18:34:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702141834.v1EIYP4q085100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 14 Feb 2017 18:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313739 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 18:34:26 -0000 Author: mav Date: Tue Feb 14 18:34:25 2017 New Revision: 313739 URL: https://svnweb.freebsd.org/changeset/base/313739 Log: Directly call m_gethdr() instead of m_getm2() for BHS. All this code is based on assumption that data will be stored in one piece, and since buffer size if known and fixed, it is easier to hardcode it. MFC after: 2 weeks Modified: head/sys/dev/iscsi/icl_soft.c Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Tue Feb 14 18:29:07 2017 (r313738) +++ head/sys/dev/iscsi/icl_soft.c Tue Feb 14 18:34:25 2017 (r313739) @@ -260,8 +260,8 @@ icl_soft_conn_new_pdu(struct icl_conn *i if (ip == NULL) return (NULL); - ip->ip_bhs_mbuf = m_getm2(NULL, sizeof(struct iscsi_bhs), - flags, MT_DATA, M_PKTHDR); + CTASSERT(sizeof(struct iscsi_bhs) <= MHLEN); + ip->ip_bhs_mbuf = m_gethdr(flags, MT_DATA); if (ip->ip_bhs_mbuf == NULL) { ICL_WARN("failed to allocate BHS mbuf"); icl_pdu_free(ip); From owner-svn-src-head@freebsd.org Tue Feb 14 19:13:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3698CCDFA27; Tue, 14 Feb 2017 19:13:29 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02948157B; Tue, 14 Feb 2017 19:13:28 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EJDS5X001732; Tue, 14 Feb 2017 19:13:28 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EJDSLF001731; Tue, 14 Feb 2017 19:13:28 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201702141913.v1EJDSLF001731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 14 Feb 2017 19:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313740 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 19:13:29 -0000 Author: dchagin Date: Tue Feb 14 19:13:27 2017 New Revision: 313740 URL: https://svnweb.freebsd.org/changeset/base/313740 Log: Replace Linuxulator implementation of readdir(), getdents() and getdents64() with wrapper over kern_getdirentries(). The patch was originally written by emaste@ and then adapted by trasz@ and me. Note: 1. I divided linux_getdents() and linux_readdir() as in case when the getdents() called with count = 1 (readdir() case) it can overwrite user stack (by writing to user buffer pointer more than 1 byte). 2. Linux returns EINVAL in case when user supplied buffer is not enough to contain fetched dirent. 3. Linux returns ENOTDIR in case when fd points to not a directory. Reviewed by: trasz@ MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D2210 Modified: head/sys/compat/linux/linux_file.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Tue Feb 14 18:34:25 2017 (r313739) +++ head/sys/compat/linux/linux_file.c Tue Feb 14 19:13:27 2017 (r313740) @@ -53,8 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #ifdef COMPAT_LINUX32 #include #include @@ -66,6 +64,10 @@ __FBSDID("$FreeBSD$"); #include #include +static int linux_common_open(struct thread *, int, char *, int, int); +static int linux_getdents_error(struct thread *, int, int); + + int linux_creat(struct thread *td, struct linux_creat_args *args) { @@ -244,28 +246,41 @@ linux_llseek(struct thread *td, struct l td->td_retval[0] = 0; return (0); } - -int -linux_readdir(struct thread *td, struct linux_readdir_args *args) -{ - struct linux_getdents_args lda; - - lda.fd = args->fd; - lda.dent = args->dent; - lda.count = 1; - return (linux_getdents(td, &lda)); -} #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ /* * Note that linux_getdents(2) and linux_getdents64(2) have the same * arguments. They only differ in the definition of struct dirent they - * operate on. We use this to common the code, with the exception of - * accessing struct dirent. Note that linux_readdir(2) is implemented - * by means of linux_getdents(2). In this case we never operate on - * struct dirent64 and thus don't need to handle it... + * operate on. + * Note that linux_readdir(2) is a special case of linux_getdents(2) + * where count is always equals 1, meaning that the buffer is one + * dirent-structure in size and that the code can't handle more anyway. + * Note that linux_readdir(2) can't be implemented by means of linux_getdents(2) + * as in case when the *dent buffer size is equal to 1 linux_getdents(2) will + * trash user stack. */ +static int +linux_getdents_error(struct thread *td, int fd, int err) +{ + cap_rights_t rights; + struct vnode *vp; + struct file *fp; + int error; + + /* Linux return ENOTDIR in case when fd is not a directory. */ + error = getvnode(td, fd, cap_rights_init(&rights, CAP_READ), &fp); + if (error != 0) + return (error); + vp = fp->f_vnode; + if (vp->v_type != VDIR) { + fdrop(fp, td); + return (ENOTDIR); + } + fdrop(fp, td); + return (err); +} + struct l_dirent { l_ulong d_ino; l_off_t d_off; @@ -292,242 +307,228 @@ struct l_dirent64 { roundup(offsetof(struct l_dirent64, d_name) + (namlen) + 1, \ sizeof(uint64_t)) -#define LINUX_MAXRECLEN max(LINUX_RECLEN(LINUX_NAME_MAX), \ - LINUX_RECLEN64(LINUX_NAME_MAX)) #define LINUX_DIRBLKSIZ 512 -static int -getdents_common(struct thread *td, struct linux_getdents64_args *args, - int is64bit) +/* + * Linux l_dirent is bigger than FreeBSD dirent, thus the buffer size + * passed to kern_getdirentries() must be smaller than the one passed + * to linux_getdents() by certain factor. + */ +#define LINUX_RECLEN_RATIO(X) X * offsetof(struct dirent, d_name) / \ + offsetof(struct l_dirent, d_name); +#define LINUX_RECLEN64_RATIO(X) X * offsetof(struct dirent, d_name) / \ + offsetof(struct l_dirent64, d_name); + +int +linux_getdents(struct thread *td, struct linux_getdents_args *args) { struct dirent *bdp; - struct vnode *vp; caddr_t inp, buf; /* BSD-format */ int len, reclen; /* BSD-format */ caddr_t outp; /* Linux-format */ - int resid, linuxreclen=0; /* Linux-format */ + int resid, linuxreclen; /* Linux-format */ caddr_t lbuf; /* Linux-format */ - cap_rights_t rights; - struct file *fp; - struct uio auio; - struct iovec aiov; - off_t off; + long base; struct l_dirent *linux_dirent; - struct l_dirent64 *linux_dirent64; - int buflen, error, eofflag, nbytes, justone; - u_long *cookies = NULL, *cookiep; - int ncookies; - - nbytes = args->count; - if (nbytes == 1) { - /* readdir(2) case. Always struct dirent. */ - if (is64bit) - return (EINVAL); - nbytes = sizeof(*linux_dirent); - justone = 1; - } else - justone = 0; + int buflen, error; + size_t retval; - error = getvnode(td, args->fd, cap_rights_init(&rights, CAP_READ), &fp); - if (error != 0) - return (error); - - if ((fp->f_flag & FREAD) == 0) { - fdrop(fp, td); - return (EBADF); - } +#ifdef DEBUG + if (ldebug(getdents)) + printf(ARGS(getdents, "%d, *, %d"), args->fd, args->count); +#endif + buflen = LINUX_RECLEN_RATIO(args->count); + buflen = min(buflen, MAXBSIZE); + buf = malloc(buflen, M_TEMP, M_WAITOK); - off = foffset_lock(fp, 0); - vp = fp->f_vnode; - if (vp->v_type != VDIR) { - foffset_unlock(fp, off, 0); - fdrop(fp, td); - return (EINVAL); + error = kern_getdirentries(td, args->fd, buf, buflen, + &base, NULL, UIO_SYSSPACE); + if (error != 0) { + error = linux_getdents_error(td, args->fd, error); + goto out1; } + lbuf = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_TEMP, M_WAITOK | M_ZERO); - buflen = max(LINUX_DIRBLKSIZ, nbytes); - buflen = min(buflen, MAXBSIZE); - buf = malloc(buflen, M_LINUX, M_WAITOK); - lbuf = malloc(LINUX_MAXRECLEN, M_LINUX, M_WAITOK | M_ZERO); - vn_lock(vp, LK_SHARED | LK_RETRY); - - aiov.iov_base = buf; - aiov.iov_len = buflen; - auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - auio.uio_rw = UIO_READ; - auio.uio_segflg = UIO_SYSSPACE; - auio.uio_td = td; - auio.uio_resid = buflen; - auio.uio_offset = off; - -#ifdef MAC - /* - * Do directory search MAC check using non-cached credentials. - */ - if ((error = mac_vnode_check_readdir(td->td_ucred, vp))) - goto out; -#endif /* MAC */ - if ((error = VOP_READDIR(vp, &auio, fp->f_cred, &eofflag, &ncookies, - &cookies))) - goto out; - + len = td->td_retval[0]; inp = buf; - outp = (caddr_t)args->dirent; - resid = nbytes; - if ((len = buflen - auio.uio_resid) <= 0) - goto eof; - - cookiep = cookies; - - if (cookies) { - /* - * When using cookies, the vfs has the option of reading from - * a different offset than that supplied (UFS truncates the - * offset to a block boundary to make sure that it never reads - * partway through a directory entry, even if the directory - * has been compacted). - */ - while (len > 0 && ncookies > 0 && *cookiep <= off) { - bdp = (struct dirent *) inp; - len -= bdp->d_reclen; - inp += bdp->d_reclen; - cookiep++; - ncookies--; - } - } + outp = (caddr_t)args->dent; + resid = args->count; + retval = 0; while (len > 0) { - if (cookiep && ncookies == 0) - break; bdp = (struct dirent *) inp; reclen = bdp->d_reclen; - if (reclen & 3) { - error = EFAULT; + linuxreclen = LINUX_RECLEN(bdp->d_namlen); + /* + * No more space in the user supplied dirent buffer. + * Return EINVAL. + */ + if (resid < linuxreclen) { + error = EINVAL; goto out; } - if (bdp->d_fileno == 0) { - inp += reclen; - if (cookiep) { - off = *cookiep++; - ncookies--; - } else - off += reclen; - - len -= reclen; - continue; - } - - linuxreclen = (is64bit) - ? LINUX_RECLEN64(bdp->d_namlen) - : LINUX_RECLEN(bdp->d_namlen); - - if (reclen > len || resid < linuxreclen) { - outp++; - break; - } - - if (justone) { - /* readdir(2) case. */ - linux_dirent = (struct l_dirent*)lbuf; - linux_dirent->d_ino = bdp->d_fileno; - linux_dirent->d_off = (l_off_t)linuxreclen; - linux_dirent->d_reclen = (l_ushort)bdp->d_namlen; - strlcpy(linux_dirent->d_name, bdp->d_name, - linuxreclen - offsetof(struct l_dirent, d_name)); - error = copyout(linux_dirent, outp, linuxreclen); - } - if (is64bit) { - linux_dirent64 = (struct l_dirent64*)lbuf; - linux_dirent64->d_ino = bdp->d_fileno; - linux_dirent64->d_off = (cookiep) - ? (l_off_t)*cookiep - : (l_off_t)(off + reclen); - linux_dirent64->d_reclen = (l_ushort)linuxreclen; - linux_dirent64->d_type = bdp->d_type; - strlcpy(linux_dirent64->d_name, bdp->d_name, - linuxreclen - offsetof(struct l_dirent64, d_name)); - error = copyout(linux_dirent64, outp, linuxreclen); - } else if (!justone) { - linux_dirent = (struct l_dirent*)lbuf; - linux_dirent->d_ino = bdp->d_fileno; - linux_dirent->d_off = (cookiep) - ? (l_off_t)*cookiep - : (l_off_t)(off + reclen); - linux_dirent->d_reclen = (l_ushort)linuxreclen; - /* - * Copy d_type to last byte of l_dirent buffer - */ - lbuf[linuxreclen-1] = bdp->d_type; - strlcpy(linux_dirent->d_name, bdp->d_name, - linuxreclen - offsetof(struct l_dirent, d_name)-1); - error = copyout(linux_dirent, outp, linuxreclen); - } - - if (error) + linux_dirent = (struct l_dirent*)lbuf; + linux_dirent->d_ino = bdp->d_fileno; + linux_dirent->d_off = base + reclen; + linux_dirent->d_reclen = linuxreclen; + /* + * Copy d_type to last byte of l_dirent buffer + */ + lbuf[linuxreclen - 1] = bdp->d_type; + strlcpy(linux_dirent->d_name, bdp->d_name, + linuxreclen - offsetof(struct l_dirent, d_name)-1); + error = copyout(linux_dirent, outp, linuxreclen); + if (error != 0) goto out; inp += reclen; - if (cookiep) { - off = *cookiep++; - ncookies--; - } else - off += reclen; + base += reclen; + len -= reclen; + retval += linuxreclen; outp += linuxreclen; resid -= linuxreclen; - len -= reclen; - if (justone) - break; } - - if (outp == (caddr_t)args->dirent) { - nbytes = resid; - goto eof; - } - - if (justone) - nbytes = resid + linuxreclen; - -eof: - td->td_retval[0] = nbytes - resid; + td->td_retval[0] = retval; out: - free(cookies, M_TEMP); - - VOP_UNLOCK(vp, 0); - foffset_unlock(fp, off, 0); - fdrop(fp, td); - free(buf, M_LINUX); free(lbuf, M_LINUX); +out1: + free(buf, M_LINUX); return (error); } int -linux_getdents(struct thread *td, struct linux_getdents_args *args) +linux_getdents64(struct thread *td, struct linux_getdents64_args *args) { + struct dirent *bdp; + caddr_t inp, buf; /* BSD-format */ + int len, reclen; /* BSD-format */ + caddr_t outp; /* Linux-format */ + int resid, linuxreclen; /* Linux-format */ + caddr_t lbuf; /* Linux-format */ + long base; + struct l_dirent64 *linux_dirent64; + int buflen, error; + size_t retval; #ifdef DEBUG - if (ldebug(getdents)) - printf(ARGS(getdents, "%d, *, %d"), args->fd, args->count); + if (ldebug(getdents64)) + uprintf(ARGS(getdents64, "%d, *, %d"), args->fd, args->count); #endif + buflen = LINUX_RECLEN64_RATIO(args->count); + buflen = min(buflen, MAXBSIZE); + buf = malloc(buflen, M_TEMP, M_WAITOK); - return (getdents_common(td, (struct linux_getdents64_args*)args, 0)); + error = kern_getdirentries(td, args->fd, buf, buflen, + &base, NULL, UIO_SYSSPACE); + if (error != 0) { + error = linux_getdents_error(td, args->fd, error); + goto out1; + } + + lbuf = malloc(LINUX_RECLEN64(LINUX_NAME_MAX), M_TEMP, M_WAITOK | M_ZERO); + + len = td->td_retval[0]; + inp = buf; + outp = (caddr_t)args->dirent; + resid = args->count; + retval = 0; + + while (len > 0) { + bdp = (struct dirent *) inp; + reclen = bdp->d_reclen; + linuxreclen = LINUX_RECLEN64(bdp->d_namlen); + /* + * No more space in the user supplied dirent buffer. + * Return EINVAL. + */ + if (resid < linuxreclen) { + error = EINVAL; + goto out; + } + + linux_dirent64 = (struct l_dirent64*)lbuf; + linux_dirent64->d_ino = bdp->d_fileno; + linux_dirent64->d_off = base + reclen; + linux_dirent64->d_reclen = linuxreclen; + linux_dirent64->d_type = bdp->d_type; + strlcpy(linux_dirent64->d_name, bdp->d_name, + linuxreclen - offsetof(struct l_dirent64, d_name)); + error = copyout(linux_dirent64, outp, linuxreclen); + if (error != 0) + goto out; + + inp += reclen; + base += reclen; + len -= reclen; + + retval += linuxreclen; + outp += linuxreclen; + resid -= linuxreclen; + } + td->td_retval[0] = retval; + +out: + free(lbuf, M_TEMP); +out1: + free(buf, M_TEMP); + return (error); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int -linux_getdents64(struct thread *td, struct linux_getdents64_args *args) +linux_readdir(struct thread *td, struct linux_readdir_args *args) { + struct dirent *bdp; + caddr_t buf; /* BSD-format */ + int linuxreclen; /* Linux-format */ + caddr_t lbuf; /* Linux-format */ + long base; + struct l_dirent *linux_dirent; + int buflen, error; #ifdef DEBUG - if (ldebug(getdents64)) - printf(ARGS(getdents64, "%d, *, %d"), args->fd, args->count); + if (ldebug(readdir)) + printf(ARGS(readdir, "%d, *"), args->fd); #endif + buflen = LINUX_RECLEN(LINUX_NAME_MAX); + buflen = LINUX_RECLEN_RATIO(buflen); + buf = malloc(buflen, M_TEMP, M_WAITOK); + + error = kern_getdirentries(td, args->fd, buf, buflen, + &base, NULL, UIO_SYSSPACE); + if (error != 0) { + error = linux_getdents_error(td, args->fd, error); + goto out; + } + if (td->td_retval[0] == 0) + goto out; - return (getdents_common(td, args, 1)); + lbuf = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_TEMP, M_WAITOK | M_ZERO); + + bdp = (struct dirent *) buf; + linuxreclen = LINUX_RECLEN(bdp->d_namlen); + + linux_dirent = (struct l_dirent*)lbuf; + linux_dirent->d_ino = bdp->d_fileno; + linux_dirent->d_off = linuxreclen; + linux_dirent->d_reclen = bdp->d_namlen; + strlcpy(linux_dirent->d_name, bdp->d_name, + linuxreclen - offsetof(struct l_dirent, d_name)); + error = copyout(linux_dirent, args->dent, linuxreclen); + if (error == 0) + td->td_retval[0] = linuxreclen; + + free(lbuf, M_LINUX); +out: + free(buf, M_LINUX); + return (error); } +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ + /* * These exist mainly for hooks for doing /compat/linux translation. From owner-svn-src-head@freebsd.org Tue Feb 14 19:54:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8B62CDF625; Tue, 14 Feb 2017 19:54:33 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B83531CD2; Tue, 14 Feb 2017 19:54:33 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EJsWCd018243; Tue, 14 Feb 2017 19:54:32 GMT (envelope-from tobik@FreeBSD.org) Received: (from tobik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EJsWS6018242; Tue, 14 Feb 2017 19:54:32 GMT (envelope-from tobik@FreeBSD.org) Message-Id: <201702141954.v1EJsWS6018242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tobik set sender to tobik@FreeBSD.org using -f From: Tobias Kortkamp Date: Tue, 14 Feb 2017 19:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313741 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 19:54:34 -0000 Author: tobik (ports committer) Date: Tue Feb 14 19:54:32 2017 New Revision: 313741 URL: https://svnweb.freebsd.org/changeset/base/313741 Log: Add myself as a new ports committer Approved by: mat (mentor) Differential Revision: https://reviews.freebsd.org/D9590 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Feb 14 19:13:27 2017 (r313740) +++ head/share/misc/committers-ports.dot Tue Feb 14 19:54:32 2017 (r313741) @@ -231,6 +231,7 @@ tijl [label="Tijl Coosemans\ntijl@FreeBS timur [label="Timur Bakeyev\ntimur@FreeBSD.org\n2007/06/07"] tj [label="Tom Judge\ntj@FreeBSD.org\n2012/05/28"] tmclaugh [label="Tom McLaughlin\ntmclaugh@FreeBSD.org\n2005/09/15"] +tobik [label="Tobias Kortkamp\ntobik@FreeBSD.org\n2017/02/08"] tota [label="TAKATSU Tomonari\ntota@FreeBSD.org\n2009/03/30"] trasz [label="Edward Tomasz Napierala\ntrasz@FreeBSD.org\n2007/04/12"] trhodes [label="Tom Rhodes\ntrhodes@FreeBSD.org\n2004/07/06"] @@ -462,6 +463,8 @@ leeym -> clsung lioux -> pat +lme -> tobik + lwhsu -> yzlin maho -> stephen @@ -486,6 +489,7 @@ mat -> gordon mat -> mmokhi mat -> tcberner mat -> thierry +mat -> tobik mat -> woodsb02 matthew -> lifanov From owner-svn-src-head@freebsd.org Tue Feb 14 21:05:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDCF8CDFB41; Tue, 14 Feb 2017 21:05:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73B57151B; Tue, 14 Feb 2017 21:05:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EL5a9a047728; Tue, 14 Feb 2017 21:05:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EL5aEU047727; Tue, 14 Feb 2017 21:05:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702142105.v1EL5aEU047727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 14 Feb 2017 21:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313744 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 21:05:37 -0000 Author: mav Date: Tue Feb 14 21:05:36 2017 New Revision: 313744 URL: https://svnweb.freebsd.org/changeset/base/313744 Log: No need to erase sense_data when sense_len is set to zero. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_error.c Modified: head/sys/cam/ctl/ctl_error.c ============================================================================== --- head/sys/cam/ctl/ctl_error.c Tue Feb 14 21:02:27 2017 (r313743) +++ head/sys/cam/ctl/ctl_error.c Tue Feb 14 21:05:36 2017 (r313744) @@ -920,10 +920,7 @@ ctl_set_data_phase_error(struct ctl_scsi void ctl_set_reservation_conflict(struct ctl_scsiio *ctsio) { - struct scsi_sense_data *sense; - sense = &ctsio->sense_data; - memset(sense, 0, sizeof(*sense)); ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT; ctsio->sense_len = 0; ctsio->io_hdr.status = CTL_SCSI_ERROR; @@ -932,10 +929,7 @@ ctl_set_reservation_conflict(struct ctl_ void ctl_set_queue_full(struct ctl_scsiio *ctsio) { - struct scsi_sense_data *sense; - sense = &ctsio->sense_data; - memset(sense, 0, sizeof(*sense)); ctsio->scsi_status = SCSI_STATUS_QUEUE_FULL; ctsio->sense_len = 0; ctsio->io_hdr.status = CTL_SCSI_ERROR; @@ -944,10 +938,7 @@ ctl_set_queue_full(struct ctl_scsiio *ct void ctl_set_busy(struct ctl_scsiio *ctsio) { - struct scsi_sense_data *sense; - sense = &ctsio->sense_data; - memset(sense, 0, sizeof(*sense)); ctsio->scsi_status = SCSI_STATUS_BUSY; ctsio->sense_len = 0; ctsio->io_hdr.status = CTL_SCSI_ERROR; @@ -956,10 +947,7 @@ ctl_set_busy(struct ctl_scsiio *ctsio) void ctl_set_task_aborted(struct ctl_scsiio *ctsio) { - struct scsi_sense_data *sense; - sense = &ctsio->sense_data; - memset(sense, 0, sizeof(*sense)); ctsio->scsi_status = SCSI_STATUS_TASK_ABORTED; ctsio->sense_len = 0; ctsio->io_hdr.status = CTL_CMD_ABORTED; @@ -992,10 +980,7 @@ ctl_set_space_alloc_fail(struct ctl_scsi void ctl_set_success(struct ctl_scsiio *ctsio) { - struct scsi_sense_data *sense; - sense = &ctsio->sense_data; - memset(sense, 0, sizeof(*sense)); ctsio->scsi_status = SCSI_STATUS_OK; ctsio->sense_len = 0; ctsio->io_hdr.status = CTL_SUCCESS; From owner-svn-src-head@freebsd.org Tue Feb 14 21:14:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3B76CDF0E5; Tue, 14 Feb 2017 21:14:25 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADD161CDA; Tue, 14 Feb 2017 21:14:25 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1ELEOJP051666; Tue, 14 Feb 2017 21:14:24 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1ELEOC8051664; Tue, 14 Feb 2017 21:14:24 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201702142114.v1ELEOC8051664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Tue, 14 Feb 2017 21:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313745 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 21:14:25 -0000 Author: garga (ports committer) Date: Tue Feb 14 21:14:24 2017 New Revision: 313745 URL: https://svnweb.freebsd.org/changeset/base/313745 Log: * Add missing parameters to usage() * Add missing parameters to manpage synopsis * Add missing description of -d flag * Sort flags descriptions Reviewed by: allanjude, kib Approved by: allanjude MFC after: 1 week Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D9152 Modified: head/sbin/fsck_ffs/fsck_ffs.8 head/sbin/fsck_ffs/main.c Modified: head/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- head/sbin/fsck_ffs/fsck_ffs.8 Tue Feb 14 21:05:36 2017 (r313744) +++ head/sbin/fsck_ffs/fsck_ffs.8 Tue Feb 14 21:14:24 2017 (r313745) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd October 5, 2016 +.Dd February 14, 2017 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BEFfnpRryZ +.Op Fl BCdEFfnpRrSyZ .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -149,45 +149,6 @@ If unexpected errors are found, the file system is marked as needing a foreground check and .Nm exits without attempting any further cleaning. -.It Fl E -Clear unallocated blocks, notifying the underlying device that they -are not used and that their contents may be discarded. -This is useful for filesystems which have been mounted on systems -without TRIM support, or with TRIM support disabled, as well as -filesystems which have been copied from one device to another. -.Pp -See the -.Fl E -and -.Fl t -flags of -.Xr newfs 8 , -and -the -.Fl t -flag of -.Xr tunefs 8 . -.It Fl F -Determine whether the file system needs to be cleaned immediately -in foreground, or if its cleaning can be deferred to background. -To be eligible for background cleaning it must have been running -with soft updates, not have been marked as needing a foreground check, -and be mounted and writable when the background check is to be done. -If these conditions are met, then -.Nm -exits with a zero exit status. -Otherwise it exits with a non-zero exit status. -If the file system is clean, -it will exit with a non-zero exit status so that the clean status -of the file system can be verified and reported during the foreground -checks. -Note that when invoked with the -.Fl F -flag, no cleanups are done. -The only thing that -.Nm -does is to determine whether a foreground or background -check is needed and exit with an appropriate status code. .It Fl b Use the block specified immediately after the flag as the super block for the file system. @@ -243,6 +204,47 @@ first line of output from This option implies the .Fl f flag. +.It Fl d +Enable debugging messages. +.It Fl E +Clear unallocated blocks, notifying the underlying device that they +are not used and that their contents may be discarded. +This is useful for filesystems which have been mounted on systems +without TRIM support, or with TRIM support disabled, as well as +filesystems which have been copied from one device to another. +.Pp +See the +.Fl E +and +.Fl t +flags of +.Xr newfs 8 , +and +the +.Fl t +flag of +.Xr tunefs 8 . +.It Fl F +Determine whether the file system needs to be cleaned immediately +in foreground, or if its cleaning can be deferred to background. +To be eligible for background cleaning it must have been running +with soft updates, not have been marked as needing a foreground check, +and be mounted and writable when the background check is to be done. +If these conditions are met, then +.Nm +exits with a zero exit status. +Otherwise it exits with a non-zero exit status. +If the file system is clean, +it will exit with a non-zero exit status so that the clean status +of the file system can be verified and reported during the foreground +checks. +Note that when invoked with the +.Fl F +flag, no cleanups are done. +The only thing that +.Nm +does is to determine whether a foreground or background +check is needed and exit with an appropriate status code. .It Fl f Force .Nm Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Tue Feb 14 21:05:36 2017 (r313744) +++ head/sbin/fsck_ffs/main.c Tue Feb 14 21:14:24 2017 (r313745) @@ -670,7 +670,7 @@ static void usage(void) { (void) fprintf(stderr, -"usage: %s [-BEFfnpry] [-b block] [-c level] [-m mode] filesystem ...\n", +"usage: %s [-BCdEFfnpRrSyZ] [-b block] [-c level] [-m mode] filesystem ...\n", getprogname()); exit(1); } From owner-svn-src-head@freebsd.org Tue Feb 14 21:33:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DBE3CDF612; Tue, 14 Feb 2017 21:33:11 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A9941625; Tue, 14 Feb 2017 21:33:11 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1ELXAAo060033; Tue, 14 Feb 2017 21:33:10 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1ELXA9u060032; Tue, 14 Feb 2017 21:33:10 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201702142133.v1ELXA9u060032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 14 Feb 2017 21:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313746 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 21:33:11 -0000 Author: ae Date: Tue Feb 14 21:33:10 2017 New Revision: 313746 URL: https://svnweb.freebsd.org/changeset/base/313746 Log: Add missing check to fix the build with IPSEC_SUPPORT and without MAC. Submitted by: netchild Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Tue Feb 14 21:14:24 2017 (r313745) +++ head/sys/netinet/in_pcb.c Tue Feb 14 21:33:10 2017 (r313746) @@ -329,7 +329,7 @@ in_pcballoc(struct socket *so, struct in inp->inp_gencnt = ++pcbinfo->ipi_gencnt; refcount_init(&inp->inp_refcount, 1); /* Reference from inpcbinfo */ INP_LIST_WUNLOCK(pcbinfo); -#if defined(IPSEC) || defined(MAC) +#if defined(IPSEC) || defined(IPSEC_SUPPORT) || defined(MAC) out: if (error != 0) { crfree(inp->inp_cred); From owner-svn-src-head@freebsd.org Tue Feb 14 21:36:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DA24CDF6D2; Tue, 14 Feb 2017 21:36:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D938E17C2; Tue, 14 Feb 2017 21:36:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1ELaI7i060203; Tue, 14 Feb 2017 21:36:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1ELaIJT060202; Tue, 14 Feb 2017 21:36:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201702142136.v1ELaIJT060202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 Feb 2017 21:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313747 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 21:36:20 -0000 Author: markj Date: Tue Feb 14 21:36:18 2017 New Revision: 313747 URL: https://svnweb.freebsd.org/changeset/base/313747 Log: Unbreak the gcc build of netmap. This fixes several LINT targets. Reviewed by: Vincenzo Maffione Modified: head/sys/dev/netmap/netmap_generic.c Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Tue Feb 14 21:33:10 2017 (r313746) +++ head/sys/dev/netmap/netmap_generic.c Tue Feb 14 21:36:18 2017 (r313747) @@ -109,10 +109,13 @@ __FBSDID("$FreeBSD$"); * chain into uma_zfree(zone_pack, mf) * (or reinstall the buffer ?) */ -#define SET_MBUF_DESTRUCTOR(m, fn) do { \ - (m)->m_ext.ext_free = (void *)fn; \ - (m)->m_ext.ext_type = EXT_EXTREF; \ -} while (0) +static inline void +set_mbuf_destructor(struct mbuf *m, void *fn) +{ + + m->m_ext.ext_free = fn; + m->m_ext.ext_type = EXT_EXTREF; +} static int void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) @@ -167,9 +170,12 @@ nm_os_get_mbuf(struct ifnet *ifp, int le static void void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) { } -#define SET_MBUF_DESTRUCTOR(m, fn) do { \ - (m)->m_ext.ext_free = fn ? (void *)fn : (void *)void_mbuf_dtor; \ -} while (0) +static inline void +set_mbuf_destructor(struct mbuf *m, void *fn) +{ + + m->m_ext.ext_free = (fn != NULL) ? fn : (void *)void_mbuf_dtor; +} static inline struct mbuf * nm_os_get_mbuf(struct ifnet *ifp, int len) @@ -381,7 +387,7 @@ generic_netmap_unregister(struct netmap_ * TX event is consumed. */ mtx_lock_spin(&kring->tx_event_lock); if (kring->tx_event) { - SET_MBUF_DESTRUCTOR(kring->tx_event, NULL); + set_mbuf_destructor(kring->tx_event, NULL); } kring->tx_event = NULL; mtx_unlock_spin(&kring->tx_event_lock); @@ -762,7 +768,7 @@ generic_set_tx_event(struct netmap_kring return; } - SET_MBUF_DESTRUCTOR(m, generic_mbuf_destructor); + set_mbuf_destructor(m, generic_mbuf_destructor); kring->tx_event = m; mtx_unlock_spin(&kring->tx_event_lock); From owner-svn-src-head@freebsd.org Tue Feb 14 21:51:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67F9BCDF9F1; Tue, 14 Feb 2017 21:51:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 373061F98; Tue, 14 Feb 2017 21:51:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1ELpJlD064568; Tue, 14 Feb 2017 21:51:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1ELpJAe064567; Tue, 14 Feb 2017 21:51:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201702142151.v1ELpJAe064567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 Feb 2017 21:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313748 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 21:51:20 -0000 Author: markj Date: Tue Feb 14 21:51:19 2017 New Revision: 313748 URL: https://svnweb.freebsd.org/changeset/base/313748 Log: Register nss_atexit() before parsing nsswitch.conf for the first time. NSS modules are loaded when nsswitch.conf is parsed and may register their own atexit handlers with libc. nss_atexit() unloads any dynamically loaded NSS modules, so it should run only after the modules' atexit handlers have been invoked. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libc/net/nsdispatch.c Modified: head/lib/libc/net/nsdispatch.c ============================================================================== --- head/lib/libc/net/nsdispatch.c Tue Feb 14 21:36:18 2017 (r313747) +++ head/lib/libc/net/nsdispatch.c Tue Feb 14 21:51:19 2017 (r313748) @@ -371,12 +371,12 @@ nss_configure(void) (vector_free_elem)ns_dbt_free); VECTOR_FREE(_nsmod, &_nsmodsize, sizeof(*_nsmod), (vector_free_elem)ns_mod_free); + if (confmod == 0) + (void)atexit(nss_atexit); nss_load_builtin_modules(); _nsyyparse(); (void)fclose(_nsyyin); vector_sort(_nsmap, _nsmapsize, sizeof(*_nsmap), string_compare); - if (confmod == 0) - (void)atexit(nss_atexit); confmod = statbuf.st_mtime; #ifdef NS_CACHING From owner-svn-src-head@freebsd.org Tue Feb 14 21:55:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 785CECDFCD4; Tue, 14 Feb 2017 21:55:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 271D81512; Tue, 14 Feb 2017 21:55:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1ELtogq068698; Tue, 14 Feb 2017 21:55:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1ELtoXA068697; Tue, 14 Feb 2017 21:55:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201702142155.v1ELtoXA068697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 Feb 2017 21:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313749 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 21:55:51 -0000 Author: markj Date: Tue Feb 14 21:55:50 2017 New Revision: 313749 URL: https://svnweb.freebsd.org/changeset/base/313749 Log: Fix indentation in nss_configure(). MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/lib/libc/net/nsdispatch.c Modified: head/lib/libc/net/nsdispatch.c ============================================================================== --- head/lib/libc/net/nsdispatch.c Tue Feb 14 21:51:19 2017 (r313748) +++ head/lib/libc/net/nsdispatch.c Tue Feb 14 21:55:50 2017 (r313749) @@ -349,20 +349,20 @@ nss_configure(void) path = getenv("NSSWITCH_CONF"); if (path == NULL) #endif - path = _PATH_NS_CONF; + path = _PATH_NS_CONF; if (stat(path, &statbuf) != 0) return (0); if (statbuf.st_mtime <= confmod) return (0); if (isthreaded) { - (void)_pthread_rwlock_unlock(&nss_lock); - result = _pthread_rwlock_wrlock(&nss_lock); - if (result != 0) - return (result); - if (stat(path, &statbuf) != 0) - goto fin; - if (statbuf.st_mtime <= confmod) - goto fin; + (void)_pthread_rwlock_unlock(&nss_lock); + result = _pthread_rwlock_wrlock(&nss_lock); + if (result != 0) + return (result); + if (stat(path, &statbuf) != 0) + goto fin; + if (statbuf.st_mtime <= confmod) + goto fin; } _nsyyin = fopen(path, "re"); if (_nsyyin == NULL) @@ -383,15 +383,15 @@ nss_configure(void) handle = libc_dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); if (handle != NULL) { nss_cache_cycle_prevention_func = dlsym(handle, - "_nss_cache_cycle_prevention_function"); + "_nss_cache_cycle_prevention_function"); dlclose(handle); } #endif fin: if (isthreaded) { - (void)_pthread_rwlock_unlock(&nss_lock); - if (result == 0) - result = _pthread_rwlock_rdlock(&nss_lock); + (void)_pthread_rwlock_unlock(&nss_lock); + if (result == 0) + result = _pthread_rwlock_rdlock(&nss_lock); } return (result); } From owner-svn-src-head@freebsd.org Tue Feb 14 21:56:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D7A2CDFD15; Tue, 14 Feb 2017 21:56:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D185315B8; Tue, 14 Feb 2017 21:56:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1ELu16g068758; Tue, 14 Feb 2017 21:56:01 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1ELu1rq068755; Tue, 14 Feb 2017 21:56:01 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201702142156.v1ELu1rq068755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 14 Feb 2017 21:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313750 - head/tools/regression/sockets/listen_kqueue X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 21:56:03 -0000 Author: glebius Date: Tue Feb 14 21:56:01 2017 New Revision: 313750 URL: https://svnweb.freebsd.org/changeset/base/313750 Log: Add a regression test for putting a socket on kqueue, and then doing listen(2) on it (see r313043). Based on Hartmut's code. Added: head/tools/regression/sockets/listen_kqueue/ head/tools/regression/sockets/listen_kqueue/Makefile (contents, props changed) head/tools/regression/sockets/listen_kqueue/listen_kqueue.c (contents, props changed) Added: head/tools/regression/sockets/listen_kqueue/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/listen_kqueue/Makefile Tue Feb 14 21:56:01 2017 (r313750) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= listen_kqueue +MAN= +WARNS?= 6 + +.include Added: head/tools/regression/sockets/listen_kqueue/listen_kqueue.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/listen_kqueue/listen_kqueue.c Tue Feb 14 21:56:01 2017 (r313750) @@ -0,0 +1,114 @@ +/*- + * Copyright (c) 2017 Hartmut Brandt + * Copyright (c) 2017 Gleb Smirnoff + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * This regression test is against a scenario when a socket is first added + * to a kqueue, and only then is put into listening state. + * This weird scenario was made a valid one in r313043, and shouldn't be + * broken later. + */ + +int +main() +{ + struct sockaddr_in addr; + struct kevent ev[2]; + socklen_t socklen; + int kq, sock, opt, pid, nev, fd; + + if ((kq = kqueue()) == -1) + err(1, "kqueue"); + + if ((sock = socket(PF_INET, SOCK_STREAM, 0)) == -1) + err(1, "socket"); + + EV_SET(&ev[0], sock, EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, NULL); + EV_SET(&ev[1], sock, EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, NULL); + + opt = 1; + if (setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &opt, sizeof(opt)) == -1) + err(1, "setsockopt"); + + if (kevent(kq, ev, 2, NULL, 0, NULL) == -1) + err(1, "kevent"); + + if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) == -1) + err(1, "setsockopt"); + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(10000); + + if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) == -1) + err(1, "bind"); + if (listen(sock, 0x80) == -1) + err(1, "listen"); + + if (ioctl(sock, FIONBIO, &opt) == -1) + err(1, "ioctl(FIONBIO)"); + + if (kevent(kq, ev, 2, NULL, 0, NULL) == -1) + err(1, "kevent"); + + pid = fork(); + if (pid == -1) + err(1, "fork"); + if (pid == 0) { + if (close(sock) == -1) + err(1, "close"); + if ((sock = socket(PF_INET, SOCK_STREAM, 0)) == -1) + err(1, "socket"); + if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) == -1) + err(1, "connect"); + } else { + nev = kevent(kq, NULL, 0, ev, 2, NULL); + if (nev < 1) + err(1, "kevent"); + for (int i = 0; i < nev; ++i) { + if (ev[i].ident == (uintptr_t )sock) { + fd = accept(ev[i].ident, + (struct sockaddr *)&addr, &socklen); + if (fd == -1) + err(1, "accept"); + printf("OK\n"); + } + } + } +} From owner-svn-src-head@freebsd.org Tue Feb 14 22:30:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ED9DCDF5DA; Tue, 14 Feb 2017 22:30:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E86117CA; Tue, 14 Feb 2017 22:30:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EMUMYY081139; Tue, 14 Feb 2017 22:30:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EMUMsl081138; Tue, 14 Feb 2017 22:30:22 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702142230.v1EMUMsl081138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 14 Feb 2017 22:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313751 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 22:30:23 -0000 Author: avg Date: Tue Feb 14 22:30:22 2017 New Revision: 313751 URL: https://svnweb.freebsd.org/changeset/base/313751 Log: mca: fix writes to MSR_MC_CTL2 in cmci_update Previously, if the threshold was changed, then MC_CTL2_CMCI_EN would get cleared and the logic would switch to the polling only mode. Discussed with: jhb MFC after: 2 weeks Modified: head/sys/x86/x86/mca.c Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Tue Feb 14 21:56:01 2017 (r313750) +++ head/sys/x86/x86/mca.c Tue Feb 14 22:30:22 2017 (r313751) @@ -548,7 +548,7 @@ cmci_update(enum scan_mode mode, int ban limit = min(limit << 1, cc->max_threshold); ctl &= ~MC_CTL2_THRESHOLD; ctl |= limit; - wrmsr(MSR_MC_CTL2(bank), limit); + wrmsr(MSR_MC_CTL2(bank), ctl); } cc->last_intr = ticks; return; @@ -581,7 +581,7 @@ cmci_update(enum scan_mode mode, int ban if ((ctl & MC_CTL2_THRESHOLD) != limit) { ctl &= ~MC_CTL2_THRESHOLD; ctl |= limit; - wrmsr(MSR_MC_CTL2(bank), limit); + wrmsr(MSR_MC_CTL2(bank), ctl); } } #endif From owner-svn-src-head@freebsd.org Tue Feb 14 22:46:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F3FBCDF945; Tue, 14 Feb 2017 22:46:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F34671235; Tue, 14 Feb 2017 22:46:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1EMkeA1089612; Tue, 14 Feb 2017 22:46:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1EMkert089611; Tue, 14 Feb 2017 22:46:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201702142246.v1EMkert089611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 14 Feb 2017 22:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313752 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 22:46:41 -0000 Author: avg Date: Tue Feb 14 22:46:39 2017 New Revision: 313752 URL: https://svnweb.freebsd.org/changeset/base/313752 Log: mca: use time_uptime instead of ticks for CMCI throttling This solves several problems. First of all, cmc_throttle is specified in seconds and there was no conversion between ticks and seconds when they were mixed together. Second, we avoid potential problems with ticks wrapping around. Resolution of time_uptime should be sufficient for the throttling purposes. Discussed with: jhb MFC after: 12 days Modified: head/sys/x86/x86/mca.c Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Tue Feb 14 22:30:22 2017 (r313751) +++ head/sys/x86/x86/mca.c Tue Feb 14 22:46:39 2017 (r313752) @@ -533,7 +533,7 @@ cmci_update(enum scan_mode mode, int ban cc = &cmc_state[PCPU_GET(cpuid)][bank]; ctl = rdmsr(MSR_MC_CTL2(bank)); count = (rec->mr_status & MC_STATUS_COR_COUNT) >> 38; - delta = (u_int)(ticks - cc->last_intr); + delta = (u_int)(time_uptime - cc->last_intr); /* * If an interrupt was received less than cmc_throttle seconds @@ -550,7 +550,7 @@ cmci_update(enum scan_mode mode, int ban ctl |= limit; wrmsr(MSR_MC_CTL2(bank), ctl); } - cc->last_intr = ticks; + cc->last_intr = time_uptime; return; } @@ -857,7 +857,7 @@ cmci_resume(int i) return; cc = &cmc_state[PCPU_GET(cpuid)][i]; - cc->last_intr = -ticks; + cc->last_intr = 0; ctl = rdmsr(MSR_MC_CTL2(i)); ctl &= ~MC_CTL2_THRESHOLD; ctl |= MC_CTL2_CMCI_EN | 1; From owner-svn-src-head@freebsd.org Wed Feb 15 01:35:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD01CCDF84E; Wed, 15 Feb 2017 01:35:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 799B9238; Wed, 15 Feb 2017 01:35:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1F1ZQbt059612; Wed, 15 Feb 2017 01:35:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1F1ZQjf059611; Wed, 15 Feb 2017 01:35:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201702150135.v1F1ZQjf059611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 15 Feb 2017 01:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313755 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 01:35:27 -0000 Author: markj Date: Wed Feb 15 01:35:26 2017 New Revision: 313755 URL: https://svnweb.freebsd.org/changeset/base/313755 Log: Check for an exiting process when enabling PID provider probes. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Wed Feb 15 00:16:52 2017 (r313754) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Wed Feb 15 01:35:26 2017 (r313755) @@ -1248,6 +1248,13 @@ fasttrap_pid_enable(void *arg, dtrace_id #else if ((p = pfind(probe->ftp_pid)) == NULL) return; + if ((p->p_flag & P_WEXIT) != 0) { + PROC_UNLOCK(p); + return; + } + + _PHOLD(p); + PROC_UNLOCK(p); #endif /* @@ -1255,13 +1262,6 @@ fasttrap_pid_enable(void *arg, dtrace_id * the chance to execute the trap instruction we're about to place * in their process's text. */ -#ifdef __FreeBSD__ - /* - * pfind() returns a locked process. - */ - _PHOLD(p); - PROC_UNLOCK(p); -#endif fasttrap_enable_callbacks(); /* From owner-svn-src-head@freebsd.org Wed Feb 15 01:51:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE187CDFCEF; Wed, 15 Feb 2017 01:51:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8875BBA5; Wed, 15 Feb 2017 01:51:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1F1oxFm063795; Wed, 15 Feb 2017 01:50:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1F1owRa063794; Wed, 15 Feb 2017 01:50:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201702150150.v1F1owRa063794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 15 Feb 2017 01:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313756 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 01:51:00 -0000 Author: markj Date: Wed Feb 15 01:50:58 2017 New Revision: 313756 URL: https://svnweb.freebsd.org/changeset/base/313756 Log: Apply MADV_FREE to exec_map entries only after a lowmem event. This effectively provides the same benefit as applying MADV_FREE inline upon every execve, since the page daemon invokes lowmem handlers prior to scanning the inactive queue. It also has less overhead; the cost of applying MADV_FREE is very noticeable on many-CPU systems since it includes that of a TLB shootdown of global PTEs. For instance, this change nearly halves the system CPU usage during a buildkernel on a 128-vCPU EC2 instance (with some other patches applied). Benchmarked by: cperciva (earlier version) Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D9586 Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Wed Feb 15 01:35:26 2017 (r313755) +++ head/sys/kern/kern_exec.c Wed Feb 15 01:50:58 2017 (r313756) @@ -1320,6 +1320,7 @@ err_exit: struct exec_args_kva { vm_offset_t addr; + u_int gen; SLIST_ENTRY(exec_args_kva) next; }; @@ -1327,6 +1328,7 @@ static DPCPU_DEFINE(struct exec_args_kva static SLIST_HEAD(, exec_args_kva) exec_args_kva_freelist; static struct mtx exec_args_kva_mtx; +static u_int exec_args_gen; static void exec_prealloc_args_kva(void *arg __unused) @@ -1339,6 +1341,7 @@ exec_prealloc_args_kva(void *arg __unuse for (i = 0; i < exec_map_entries; i++) { argkva = malloc(sizeof(*argkva), M_PARGS, M_WAITOK); argkva->addr = kmap_alloc_wait(exec_map, exec_map_entry_size); + argkva->gen = exec_args_gen; SLIST_INSERT_HEAD(&exec_args_kva_freelist, argkva, next); } } @@ -1364,15 +1367,16 @@ exec_alloc_args_kva(void **cookie) } static void -exec_free_args_kva(void *cookie) +exec_release_args_kva(struct exec_args_kva *argkva, u_int gen) { - struct exec_args_kva *argkva; vm_offset_t base; - argkva = cookie; base = argkva->addr; - - vm_map_madvise(exec_map, base, base + exec_map_entry_size, MADV_FREE); + if (argkva->gen != gen) { + vm_map_madvise(exec_map, base, base + exec_map_entry_size, + MADV_FREE); + argkva->gen = gen; + } if (!atomic_cmpset_ptr((uintptr_t *)DPCPU_PTR(exec_args_kva), (uintptr_t)NULL, (uintptr_t)argkva)) { mtx_lock(&exec_args_kva_mtx); @@ -1382,6 +1386,46 @@ exec_free_args_kva(void *cookie) } } +static void +exec_free_args_kva(void *cookie) +{ + + exec_release_args_kva(cookie, exec_args_gen); +} + +static void +exec_args_kva_lowmem(void *arg __unused) +{ + SLIST_HEAD(, exec_args_kva) head; + struct exec_args_kva *argkva; + u_int gen; + int i; + + gen = atomic_fetchadd_int(&exec_args_gen, 1) + 1; + + /* + * Force an madvise of each KVA range. Any currently allocated ranges + * will have MADV_FREE applied once they are freed. + */ + SLIST_INIT(&head); + mtx_lock(&exec_args_kva_mtx); + SLIST_SWAP(&head, &exec_args_kva_freelist, exec_args_kva); + mtx_unlock(&exec_args_kva_mtx); + while ((argkva = SLIST_FIRST(&head)) != NULL) { + SLIST_REMOVE_HEAD(&head, next); + exec_release_args_kva(argkva, gen); + } + + CPU_FOREACH(i) { + argkva = (void *)atomic_readandclear_ptr( + (uintptr_t *)DPCPU_ID_PTR(i, exec_args_kva)); + if (argkva != NULL) + exec_release_args_kva(argkva, gen); + } +} +EVENTHANDLER_DEFINE(vm_lowmem, exec_args_kva_lowmem, NULL, + EVENTHANDLER_PRI_ANY); + /* * Allocate temporary demand-paged, zero-filled memory for the file name, * argument, and environment strings. From owner-svn-src-head@freebsd.org Wed Feb 15 02:52:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5354ECDFB31; Wed, 15 Feb 2017 02:52:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AAB1379; Wed, 15 Feb 2017 02:52:44 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1F2qh6D091868; Wed, 15 Feb 2017 02:52:43 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1F2qh8P091867; Wed, 15 Feb 2017 02:52:43 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201702150252.v1F2qh8P091867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 15 Feb 2017 02:52:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313757 - head/sys/dev/atkbdc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 02:52:44 -0000 Author: gonzo Date: Wed Feb 15 02:52:43 2017 New Revision: 313757 URL: https://svnweb.freebsd.org/changeset/base/313757 Log: [psm] Fix calculation for clickpad softbuttons at the top On laptops like the ThinkPad X240, ClickPad buttons are located at the top. The hw.psm.synaptics.softbuttons_y sysctl was supposed to allow this by setting the value to a negative one (e.g. -1700). However, the condition was wrong (double negative), and doing that placed the buttons in an unreachable area. PR: 216342 Submitted by: Greg V MFC after: 1 week Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Wed Feb 15 01:50:58 2017 (r313756) +++ head/sys/dev/atkbdc/psm.c Wed Feb 15 02:52:43 2017 (r313757) @@ -3194,7 +3194,7 @@ psmgestures(struct psm_softc *sc, finger if (sc->synhw.capClickPad && ms->button & MOUSE_BUTTON1DOWN) { y_ok = sc->syninfo.softbuttons_y >= 0 ? start_y < sc->syninfo.softbuttons_y : - start_y > max_y - sc->syninfo.softbuttons_y; + start_y > max_y + sc->syninfo.softbuttons_y; center_button = MOUSE_BUTTON2DOWN; center_x = sc->syninfo.softbutton2_x; From owner-svn-src-head@freebsd.org Wed Feb 15 06:07:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69191CE04EE; Wed, 15 Feb 2017 06:07:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EC301497; Wed, 15 Feb 2017 06:07:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1F671Z9069915; Wed, 15 Feb 2017 06:07:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1F671EC069914; Wed, 15 Feb 2017 06:07:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201702150607.v1F671EC069914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 15 Feb 2017 06:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313758 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 06:07:02 -0000 Author: markj Date: Wed Feb 15 06:07:01 2017 New Revision: 313758 URL: https://svnweb.freebsd.org/changeset/base/313758 Log: Use pget() instead of pfind() in fasttrap_pid_{enable,disable}(). Suggested by: mjg MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Wed Feb 15 02:52:43 2017 (r313757) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Wed Feb 15 06:07:01 2017 (r313758) @@ -1246,15 +1246,8 @@ fasttrap_pid_enable(void *arg, dtrace_id ASSERT(!(p->p_flag & SVFORK)); mutex_exit(&p->p_lock); #else - if ((p = pfind(probe->ftp_pid)) == NULL) + if (pget(probe->ftp_pid, PGET_HOLD | PGET_NOTWEXIT, &p) != 0) return; - if ((p->p_flag & P_WEXIT) != 0) { - PROC_UNLOCK(p); - return; - } - - _PHOLD(p); - PROC_UNLOCK(p); #endif /* @@ -1333,17 +1326,8 @@ fasttrap_pid_disable(void *arg, dtrace_i * provider lock as a point of mutual exclusion to prevent other * DTrace consumers from disabling this probe. */ - if ((p = pfind(probe->ftp_pid)) != NULL) { -#ifdef __FreeBSD__ - if (p->p_flag & P_WEXIT) { - PROC_UNLOCK(p); - p = NULL; - } else { - _PHOLD(p); - PROC_UNLOCK(p); - } -#endif - } + if (pget(probe->ftp_pid, PGET_HOLD | PGET_NOTWEXIT, &p) != 0) + p = NULL; /* * Disable all the associated tracepoints (for fully enabled probes). From owner-svn-src-head@freebsd.org Wed Feb 15 07:22:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF1BECDF61D; Wed, 15 Feb 2017 07:22:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B748A17E8; Wed, 15 Feb 2017 07:22:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1F7MlU7002020; Wed, 15 Feb 2017 07:22:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1F7Mlru002017; Wed, 15 Feb 2017 07:22:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201702150722.v1F7Mlru002017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 15 Feb 2017 07:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313760 - in head: contrib/libpcap/pcap 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 07:22:49 -0000 Author: delphij Date: Wed Feb 15 07:22:47 2017 New Revision: 313760 URL: https://svnweb.freebsd.org/changeset/base/313760 Log: MFV r313759: license change for a few headers (4 clause BSD to 3 clause BSD). MFC after: 28 days X-MFC-with: r313695 Modified: head/contrib/libpcap/pcap/bpf.h head/contrib/libpcap/pcap/dlt.h head/sys/net/dlt.h Directory Properties: head/contrib/libpcap/ (props changed) Modified: head/contrib/libpcap/pcap/bpf.h ============================================================================== --- head/contrib/libpcap/pcap/bpf.h Wed Feb 15 07:19:23 2017 (r313759) +++ head/contrib/libpcap/pcap/bpf.h Wed Feb 15 07:22:47 2017 (r313760) @@ -15,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/contrib/libpcap/pcap/dlt.h ============================================================================== --- head/contrib/libpcap/pcap/dlt.h Wed Feb 15 07:19:23 2017 (r313759) +++ head/contrib/libpcap/pcap/dlt.h Wed Feb 15 07:22:47 2017 (r313760) @@ -15,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/net/dlt.h ============================================================================== --- head/sys/net/dlt.h Wed Feb 15 07:19:23 2017 (r313759) +++ head/sys/net/dlt.h Wed Feb 15 07:22:47 2017 (r313760) @@ -15,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-head@freebsd.org Wed Feb 15 07:59:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64746CE01BD; Wed, 15 Feb 2017 07:59:56 +0000 (UTC) (envelope-from mmokhi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 293F3E50; Wed, 15 Feb 2017 07:59:56 +0000 (UTC) (envelope-from mmokhi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1F7xtrB013955; Wed, 15 Feb 2017 07:59:55 GMT (envelope-from mmokhi@FreeBSD.org) Received: (from mmokhi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1F7xtKZ013952; Wed, 15 Feb 2017 07:59:55 GMT (envelope-from mmokhi@FreeBSD.org) Message-Id: <201702150759.v1F7xtKZ013952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmokhi set sender to mmokhi@FreeBSD.org using -f From: Mahdi Mokhtari Date: Wed, 15 Feb 2017 07:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313761 - in 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 07:59:56 -0000 Author: mmokhi (ports committer) Date: Wed Feb 15 07:59:54 2017 New Revision: 313761 URL: https://svnweb.freebsd.org/changeset/base/313761 Log: Add casinl() cacosl() catanl() casinhl() cacoshl() catanhl() APIs to msun to improve C11 conformance. PR: 216850 216851 216852 216856 216857 216858 Submitted by: mmokhi Reported by: sgk@troutmask.apl.washington.edu Reviewed by: bde, mat, theraven Approved by: bde (src committer), mat (mentor) Differential Revision: https://reviews.freebsd.org/D9491 Added: head/lib/msun/src/catrigl.c - copied, changed from r313732, head/lib/msun/src/catrigf.c Modified: head/lib/msun/Makefile head/lib/msun/Symbol.map Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Wed Feb 15 07:22:47 2017 (r313760) +++ head/lib/msun/Makefile Wed Feb 15 07:59:54 2017 (r313761) @@ -107,7 +107,7 @@ COMMON_SRCS+= e_acoshl.c e_acosl.c e_asi .endif # C99 complex functions -COMMON_SRCS+= catrig.c catrigf.c \ +COMMON_SRCS+= catrig.c catrigf.c catrigl.c \ s_ccosh.c s_ccoshf.c s_cexp.c s_cexpf.c \ s_cimag.c s_cimagf.c s_cimagl.c \ s_conj.c s_conjf.c s_conjl.c \ Modified: head/lib/msun/Symbol.map ============================================================================== --- head/lib/msun/Symbol.map Wed Feb 15 07:22:47 2017 (r313760) +++ head/lib/msun/Symbol.map Wed Feb 15 07:59:54 2017 (r313761) @@ -285,3 +285,13 @@ FBSD_1.3 { FBSD_1.4 { lgammal_r; }; + +/* First added in 12.0-CURRENT */ +FBSD_1.5 { + cacoshl; + cacosl; + casinhl; + casinl; + catanl; + catanhl; +}; Copied and modified: head/lib/msun/src/catrigl.c (from r313732, head/lib/msun/src/catrigf.c) ============================================================================== --- head/lib/msun/src/catrigf.c Tue Feb 14 16:49:32 2017 (r313732, copy source) +++ head/lib/msun/src/catrigl.c Wed Feb 15 07:59:54 2017 (r313761) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2012 Stephen Montgomery-Smith + * Copyright (c) 2017 Mahdi Mokhtari * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,38 +45,53 @@ __FBSDID("$FreeBSD$"); #include #include +#include "invtrig.h" #include "math.h" #include "math_private.h" #undef isinf -#define isinf(x) (fabsf(x) == INFINITY) +#define isinf(x) (fabsl(x) == INFINITY) #undef isnan #define isnan(x) ((x) != (x)) #define raise_inexact() do { volatile float junk = 1 + tiny; } while(0) #undef signbit -#define signbit(x) (__builtin_signbitf(x)) +#define signbit(x) (__builtin_signbitl(x)) -static const float +static const long double A_crossover = 10, B_crossover = 0.6417, -FOUR_SQRT_MIN = 0x1p-61, -QUARTER_SQRT_MAX = 0x1p61, -m_e = 2.7182818285e0, /* 0xadf854.0p-22 */ -m_ln2 = 6.9314718056e-1, /* 0xb17218.0p-24 */ -pio2_hi = 1.5707962513e0, /* 0xc90fda.0p-23 */ -RECIP_EPSILON = 1 / FLT_EPSILON, -SQRT_3_EPSILON = 5.9801995673e-4, /* 0x9cc471.0p-34 */ -SQRT_6_EPSILON = 8.4572793338e-4, /* 0xddb3d7.0p-34 */ -SQRT_MIN = 0x1p-63; +FOUR_SQRT_MIN = 0x1p-8189L, +QUARTER_SQRT_MAX = 0x1p8189L, +RECIP_EPSILON = 1 / LDBL_EPSILON, +SQRT_MIN = 0x1p-8191L; + +#if LDBL_MANT_DIG == 64 +static const union IEEEl2bits +um_e = LD80C(0xadf85458a2bb4a9b, 1, 2.71828182845904523536e+0L), +um_ln2 = LD80C(0xb17217f7d1cf79ac, -1, 6.93147180559945309417e-1L); +#define m_e um_e.e +#define m_ln2 um_ln2.e +static const long double +/* The next 2 literals for non-i386. Misrounding them on i386 is harmless. */ +SQRT_3_EPSILON = 5.70316273435758915310e-10, /* 0x9cc470a0490973e8.0p-94 */ +SQRT_6_EPSILON = 8.06549008734932771664e-10; /* 0xddb3d742c265539e.0p-94 */ +#elif LDBL_MANT_DIG == 113 +static const long double +m_e = 2.71828182845904523536028747135266250e0L, /* 0x15bf0a8b1457695355fb8ac404e7a.0p-111 */ +m_ln2 = 6.93147180559945309417232121458176568e-1L, /* 0x162e42fefa39ef35793c7673007e6.0p-113 */ +SQRT_3_EPSILON = 2.40370335797945490975336727199878124e-17, /* 0x1bb67ae8584caa73b25742d7078b8.0p-168 */ +SQRT_6_EPSILON = 3.39934988877629587239082586223300391e-17; /* 0x13988e1409212e7d0321914321a55.0p-167 */ +#else +#error "Unsupported long double format" +#endif static const volatile float -pio2_lo = 7.5497899549e-8, /* 0xa22169.0p-47 */ tiny = 0x1p-100; -static float complex clog_for_large_values(float complex z); +static long double complex clog_for_large_values(long double complex z); -static inline float -f(float a, float b, float hypot_a_b) +static inline long double +f(long double a, long double b, long double hypot_a_b) { if (b < 0) return ((hypot_a_b - b) / 2); @@ -85,40 +101,40 @@ f(float a, float b, float hypot_a_b) } static inline void -do_hard_work(float x, float y, float *rx, int *B_is_usable, float *B, - float *sqrt_A2my2, float *new_y) +do_hard_work(long double x, long double y, long double *rx, int *B_is_usable, + long double *B, long double *sqrt_A2my2, long double *new_y) { - float R, S, A; - float Am1, Amy; + long double R, S, A; + long double Am1, Amy; - R = hypotf(x, y + 1); - S = hypotf(x, y - 1); + R = hypotl(x, y + 1); + S = hypotl(x, y - 1); A = (R + S) / 2; if (A < 1) A = 1; if (A < A_crossover) { - if (y == 1 && x < FLT_EPSILON * FLT_EPSILON / 128) { - *rx = sqrtf(x); - } else if (x >= FLT_EPSILON * fabsf(y - 1)) { + if (y == 1 && x < LDBL_EPSILON * LDBL_EPSILON / 128) { + *rx = sqrtl(x); + } else if (x >= LDBL_EPSILON * fabsl(y - 1)) { Am1 = f(x, 1 + y, R) + f(x, 1 - y, S); - *rx = log1pf(Am1 + sqrtf(Am1 * (A + 1))); + *rx = log1pl(Am1 + sqrtl(Am1 * (A + 1))); } else if (y < 1) { - *rx = x / sqrtf((1 - y) * (1 + y)); + *rx = x / sqrtl((1 - y) * (1 + y)); } else { - *rx = log1pf((y - 1) + sqrtf((y - 1) * (y + 1))); + *rx = log1pl((y - 1) + sqrtl((y - 1) * (y + 1))); } } else { - *rx = logf(A + sqrtf(A * A - 1)); + *rx = logl(A + sqrtl(A * A - 1)); } *new_y = y; if (y < FOUR_SQRT_MIN) { *B_is_usable = 0; - *sqrt_A2my2 = A * (2 / FLT_EPSILON); - *new_y = y * (2 / FLT_EPSILON); + *sqrt_A2my2 = A * (2 / LDBL_EPSILON); + *new_y = y * (2 / LDBL_EPSILON); return; } @@ -127,41 +143,41 @@ do_hard_work(float x, float y, float *rx if (*B > B_crossover) { *B_is_usable = 0; - if (y == 1 && x < FLT_EPSILON / 128) { - *sqrt_A2my2 = sqrtf(x) * sqrtf((A + y) / 2); - } else if (x >= FLT_EPSILON * fabsf(y - 1)) { + if (y == 1 && x < LDBL_EPSILON / 128) { + *sqrt_A2my2 = sqrtl(x) * sqrtl((A + y) / 2); + } else if (x >= LDBL_EPSILON * fabsl(y - 1)) { Amy = f(x, y + 1, R) + f(x, y - 1, S); - *sqrt_A2my2 = sqrtf(Amy * (A + y)); + *sqrt_A2my2 = sqrtl(Amy * (A + y)); } else if (y > 1) { - *sqrt_A2my2 = x * (4 / FLT_EPSILON / FLT_EPSILON) * y / - sqrtf((y + 1) * (y - 1)); - *new_y = y * (4 / FLT_EPSILON / FLT_EPSILON); + *sqrt_A2my2 = x * (4 / LDBL_EPSILON / LDBL_EPSILON) * y / + sqrtl((y + 1) * (y - 1)); + *new_y = y * (4 / LDBL_EPSILON / LDBL_EPSILON); } else { - *sqrt_A2my2 = sqrtf((1 - y) * (1 + y)); + *sqrt_A2my2 = sqrtl((1 - y) * (1 + y)); } } } -float complex -casinhf(float complex z) +long double complex +casinhl(long double complex z) { - float x, y, ax, ay, rx, ry, B, sqrt_A2my2, new_y; + long double x, y, ax, ay, rx, ry, B, sqrt_A2my2, new_y; int B_is_usable; - float complex w; + long double complex w; - x = crealf(z); - y = cimagf(z); - ax = fabsf(x); - ay = fabsf(y); + x = creall(z); + y = cimagl(z); + ax = fabsl(x); + ay = fabsl(y); if (isnan(x) || isnan(y)) { if (isinf(x)) - return (CMPLXF(x, y + y)); + return (CMPLXL(x, y + y)); if (isinf(y)) - return (CMPLXF(y, x + x)); + return (CMPLXL(y, x + x)); if (y == 0) - return (CMPLXF(x + x, y)); - return (CMPLXF(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); + return (CMPLXL(x + x, y)); + return (CMPLXL(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); } if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) { @@ -169,8 +185,8 @@ casinhf(float complex z) w = clog_for_large_values(z) + m_ln2; else w = clog_for_large_values(-z) + m_ln2; - return (CMPLXF(copysignf(crealf(w), x), - copysignf(cimagf(w), y))); + return (CMPLXL(copysignl(creall(w), x), + copysignl(cimagl(w), y))); } if (x == 0 && y == 0) @@ -183,125 +199,126 @@ casinhf(float complex z) do_hard_work(ax, ay, &rx, &B_is_usable, &B, &sqrt_A2my2, &new_y); if (B_is_usable) - ry = asinf(B); + ry = asinl(B); else - ry = atan2f(new_y, sqrt_A2my2); - return (CMPLXF(copysignf(rx, x), copysignf(ry, y))); + ry = atan2l(new_y, sqrt_A2my2); + return (CMPLXL(copysignl(rx, x), copysignl(ry, y))); } -float complex -casinf(float complex z) +long double complex +casinl(long double complex z) { - float complex w = casinhf(CMPLXF(cimagf(z), crealf(z))); + long double complex w; - return (CMPLXF(cimagf(w), crealf(w))); + w = casinhl(CMPLXL(cimagl(z), creall(z))); + return (CMPLXL(cimagl(w), creall(w))); } -float complex -cacosf(float complex z) +long double complex +cacosl(long double complex z) { - float x, y, ax, ay, rx, ry, B, sqrt_A2mx2, new_x; + long double x, y, ax, ay, rx, ry, B, sqrt_A2mx2, new_x; int sx, sy; int B_is_usable; - float complex w; + long double complex w; - x = crealf(z); - y = cimagf(z); + x = creall(z); + y = cimagl(z); sx = signbit(x); sy = signbit(y); - ax = fabsf(x); - ay = fabsf(y); + ax = fabsl(x); + ay = fabsl(y); if (isnan(x) || isnan(y)) { if (isinf(x)) - return (CMPLXF(y + y, -INFINITY)); + return (CMPLXL(y + y, -INFINITY)); if (isinf(y)) - return (CMPLXF(x + x, -y)); + return (CMPLXL(x + x, -y)); if (x == 0) - return (CMPLXF(pio2_hi + pio2_lo, y + y)); - return (CMPLXF(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); + return (CMPLXL(pio2_hi + pio2_lo, y + y)); + return (CMPLXL(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); } if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) { w = clog_for_large_values(z); - rx = fabsf(cimagf(w)); - ry = crealf(w) + m_ln2; + rx = fabsl(cimagl(w)); + ry = creall(w) + m_ln2; if (sy == 0) ry = -ry; - return (CMPLXF(rx, ry)); + return (CMPLXL(rx, ry)); } if (x == 1 && y == 0) - return (CMPLXF(0, -y)); + return (CMPLXL(0, -y)); raise_inexact(); if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4) - return (CMPLXF(pio2_hi - (x - pio2_lo), -y)); + return (CMPLXL(pio2_hi - (x - pio2_lo), -y)); do_hard_work(ay, ax, &ry, &B_is_usable, &B, &sqrt_A2mx2, &new_x); if (B_is_usable) { if (sx == 0) - rx = acosf(B); + rx = acosl(B); else - rx = acosf(-B); + rx = acosl(-B); } else { if (sx == 0) - rx = atan2f(sqrt_A2mx2, new_x); + rx = atan2l(sqrt_A2mx2, new_x); else - rx = atan2f(sqrt_A2mx2, -new_x); + rx = atan2l(sqrt_A2mx2, -new_x); } if (sy == 0) ry = -ry; - return (CMPLXF(rx, ry)); + return (CMPLXL(rx, ry)); } -float complex -cacoshf(float complex z) +long double complex +cacoshl(long double complex z) { - float complex w; - float rx, ry; + long double complex w; + long double rx, ry; - w = cacosf(z); - rx = crealf(w); - ry = cimagf(w); + w = cacosl(z); + rx = creall(w); + ry = cimagl(w); if (isnan(rx) && isnan(ry)) - return (CMPLXF(ry, rx)); + return (CMPLXL(ry, rx)); if (isnan(rx)) - return (CMPLXF(fabsf(ry), rx)); + return (CMPLXL(fabsl(ry), rx)); if (isnan(ry)) - return (CMPLXF(ry, ry)); - return (CMPLXF(fabsf(ry), copysignf(rx, cimagf(z)))); + return (CMPLXL(ry, ry)); + return (CMPLXL(fabsl(ry), copysignl(rx, cimagl(z)))); } -static float complex -clog_for_large_values(float complex z) +static long double complex +clog_for_large_values(long double complex z) { - float x, y; - float ax, ay, t; + long double x, y; + long double ax, ay, t; - x = crealf(z); - y = cimagf(z); - ax = fabsf(x); - ay = fabsf(y); + x = creall(z); + y = cimagl(z); + ax = fabsl(x); + ay = fabsl(y); if (ax < ay) { t = ax; ax = ay; ay = t; } - if (ax > FLT_MAX / 2) - return (CMPLXF(logf(hypotf(x / m_e, y / m_e)) + 1, - atan2f(y, x))); + if (ax > LDBL_MAX / 2) + return (CMPLXL(logl(hypotl(x / m_e, y / m_e)) + 1, + atan2l(y, x))); if (ax > QUARTER_SQRT_MAX || ay < SQRT_MIN) - return (CMPLXF(logf(hypotf(x, y)), atan2f(y, x))); + return (CMPLXL(logl(hypotl(x, y)), atan2l(y, x))); - return (CMPLXF(logf(ax * ax + ay * ay) / 2, atan2f(y, x))); + return (CMPLXL(logl(ax * ax + ay * ay) / 2, atan2l(y, x))); } -static inline float -sum_squares(float x, float y) +static inline long double +sum_squares(long double x, long double y) { if (y < SQRT_MIN) @@ -310,84 +327,86 @@ sum_squares(float x, float y) return (x * x + y * y); } -static inline float -real_part_reciprocal(float x, float y) +static inline long double +real_part_reciprocal(long double x, long double y) { - float scale; - uint32_t hx, hy; - int32_t ix, iy; - - GET_FLOAT_WORD(hx, x); - ix = hx & 0x7f800000; - GET_FLOAT_WORD(hy, y); - iy = hy & 0x7f800000; -#define BIAS (FLT_MAX_EXP - 1) -#define CUTOFF (FLT_MANT_DIG / 2 + 1) - if (ix - iy >= CUTOFF << 23 || isinf(x)) + long double scale; + uint16_t hx, hy; + int16_t ix, iy; + + GET_LDBL_EXPSIGN(hx, x); + ix = hx & 0x7fff; + GET_LDBL_EXPSIGN(hy, y); + iy = hy & 0x7fff; +#define BIAS (LDBL_MAX_EXP - 1) +#define CUTOFF (LDBL_MANT_DIG / 2 + 1) + if (ix - iy >= CUTOFF || isinf(x)) return (1 / x); - if (iy - ix >= CUTOFF << 23) + if (iy - ix >= CUTOFF) return (x / y / y); - if (ix <= (BIAS + FLT_MAX_EXP / 2 - CUTOFF) << 23) + if (ix <= BIAS + LDBL_MAX_EXP / 2 - CUTOFF) return (x / (x * x + y * y)); - SET_FLOAT_WORD(scale, 0x7f800000 - ix); + scale = 1; + SET_LDBL_EXPSIGN(scale, 0x7fff - ix); x *= scale; y *= scale; return (x / (x * x + y * y) * scale); } -float complex -catanhf(float complex z) +long double complex +catanhl(long double complex z) { - float x, y, ax, ay, rx, ry; + long double x, y, ax, ay, rx, ry; - x = crealf(z); - y = cimagf(z); - ax = fabsf(x); - ay = fabsf(y); + x = creall(z); + y = cimagl(z); + ax = fabsl(x); + ay = fabsl(y); if (y == 0 && ax <= 1) - return (CMPLXF(atanhf(x), y)); + return (CMPLXL(atanhl(x), y)); if (x == 0) - return (CMPLXF(x, atanf(y))); + return (CMPLXL(x, atanl(y))); if (isnan(x) || isnan(y)) { if (isinf(x)) - return (CMPLXF(copysignf(0, x), y + y)); + return (CMPLXL(copysignl(0, x), y + y)); if (isinf(y)) - return (CMPLXF(copysignf(0, x), - copysignf(pio2_hi + pio2_lo, y))); - return (CMPLXF(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); + return (CMPLXL(copysignl(0, x), + copysignl(pio2_hi + pio2_lo, y))); + return (CMPLXL(x + 0.0L + (y + 0), x + 0.0L + (y + 0))); } if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) - return (CMPLXF(real_part_reciprocal(x, y), - copysignf(pio2_hi + pio2_lo, y))); + return (CMPLXL(real_part_reciprocal(x, y), + copysignl(pio2_hi + pio2_lo, y))); if (ax < SQRT_3_EPSILON / 2 && ay < SQRT_3_EPSILON / 2) { raise_inexact(); return (z); } - if (ax == 1 && ay < FLT_EPSILON) - rx = (m_ln2 - logf(ay)) / 2; + if (ax == 1 && ay < LDBL_EPSILON) + rx = (m_ln2 - logl(ay)) / 2; else - rx = log1pf(4 * ax / sum_squares(ax - 1, ay)) / 4; + rx = log1pl(4 * ax / sum_squares(ax - 1, ay)) / 4; if (ax == 1) - ry = atan2f(2, -ay) / 2; - else if (ay < FLT_EPSILON) - ry = atan2f(2 * ay, (1 - ax) * (1 + ax)) / 2; + ry = atan2l(2, -ay) / 2; + else if (ay < LDBL_EPSILON) + ry = atan2l(2 * ay, (1 - ax) * (1 + ax)) / 2; else - ry = atan2f(2 * ay, (1 - ax) * (1 + ax) - ay * ay) / 2; + ry = atan2l(2 * ay, (1 - ax) * (1 + ax) - ay * ay) / 2; - return (CMPLXF(copysignf(rx, x), copysignf(ry, y))); + return (CMPLXL(copysignl(rx, x), copysignl(ry, y))); } -float complex -catanf(float complex z) +long double complex +catanl(long double complex z) { - float complex w = catanhf(CMPLXF(cimagf(z), crealf(z))); + long double complex w; - return (CMPLXF(cimagf(w), crealf(w))); + w = catanhl(CMPLXL(cimagl(z), creall(z))); + return (CMPLXL(cimagl(w), creall(w))); } From owner-svn-src-head@freebsd.org Wed Feb 15 10:06:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 525B8CDFEC4; Wed, 15 Feb 2017 10:06:51 +0000 (UTC) (envelope-from prvs=21221c659=roger.pau@citrix.com) Received: from SMTP.EU.CITRIX.COM (smtp.ctxuk.citrix.com [185.25.65.24]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "mail.citrix.com", Issuer "DigiCert SHA2 Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5466BBF; Wed, 15 Feb 2017 10:06:49 +0000 (UTC) (envelope-from prvs=21221c659=roger.pau@citrix.com) X-IronPort-AV: E=Sophos;i="5.35,165,1484006400"; d="scan'208";a="40800941" Date: Wed, 15 Feb 2017 10:06:37 +0000 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: Sean Bruno CC: , , Subject: Re: svn commit: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf Message-ID: <20170215100637.2xsyyu46odzig4c4@dhcp-3-221.uk.xensource.com> References: <201701100323.v0A3NMAI045868@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <201701100323.v0A3NMAI045868@repo.freebsd.org> User-Agent: NeoMutt/20170206 (1.7.2) X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 10:06:51 -0000 On Tue, Jan 10, 2017 at 03:23:22AM +0000, Sean Bruno wrote: > Author: sbruno > Date: Tue Jan 10 03:23:22 2017 > New Revision: 311849 > URL: https://svnweb.freebsd.org/changeset/base/311849 > > Log: > Migrate e1000 to the IFLIB framework: > - em(4) igb(4) and lem(4) > - deprecate the igb device from kernel configurations > - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko This linking causes mfsBSD to choke when building an image from HEAD. It tries to issue the following command: ${_v}${CP} -rp ${_BOOTDIR}/kernel ${WRKDIR}/disk/boot Which fails when finding the symbol link. I can send a patch to change that to -Rp, which would work fine, but wouldn't it be better to either completely remove if_igb.ko, or simply copy if_em.ko to if_igb.ko? I'm wondering if for example anyone strips down it's /boot/kernel/ manually, by removing unused modules, and what would happen if if_em.ko is removed but not if_igb.ko. Roger. From owner-svn-src-head@freebsd.org Wed Feb 15 10:31:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90779CDF6B8; Wed, 15 Feb 2017 10:31:23 +0000 (UTC) (envelope-from sanpei.ml@gmail.com) Received: from mail-yw0-x233.google.com (mail-yw0-x233.google.com [IPv6:2607:f8b0:4002:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 506D51100; Wed, 15 Feb 2017 10:31:23 +0000 (UTC) (envelope-from sanpei.ml@gmail.com) Received: by mail-yw0-x233.google.com with SMTP id v200so79626301ywc.3; Wed, 15 Feb 2017 02:31:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=J5meNFn+w2fYQZo/caNEPDtEXBFY9XV8Gf1EosNYyrs=; b=O+roo587zw9DTojgbZqHAhePIwCDVa7ZnI7ksalYmdhhd1QC6MpJGvjzhpHv4izlNx bqV2/5i6xtEzaQv1jzhKqm9SHLYbtDZppAPDdi+YnX66x5r0FzrWGcsJod7NT+Y3Hk6S cZbCY8fmM7vbwtSU+1WiYsV9idLTOm5njSvY6XGCQwLG97SWV9s50+BKrny0K7Z5mO0j yWOqyGSfE2rhf5EY1YiKmY8Udm78w1+No66GPZuj4JD8bV1KjdXn7Q5fnIj2VRElXZ/u 0x/iEXSUdmECrfaIt24Qp/WOG9V9VDP0T14O6bWVu2qGUgwuPvuqKys0GA6LaPJMXVL6 nvUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=J5meNFn+w2fYQZo/caNEPDtEXBFY9XV8Gf1EosNYyrs=; b=hPuH6BG9y2YFV4jlqmUAZkT8Ff5j93Z9T0f5AhokZDpsyktwZNSxGcvvLttmi/u9aJ w07yquVBISdnmQfYA2gvr9uj8aoiuqUhm8N68GWzFIuTSzxngVipyiFpKcnt+OjJw3Hx KNWUL5s9oPrIDG06wo+P81zOsAv/BUNlX9Ngk6fNYbhrzKi+RroW654a22A2x2X4SyR3 B0FtoyMwlcLKufV9yUfsCO8YNYF2isQ9OFbSG6MjQdzutoZOCPB7PTmRpOh6jI9r1lmc k4XjV1CrigowCfVZVmuPusiyKkJzb8hD4Ic9Peep8N3LnDvdFKqAibyfxAN7ipiZQL7F EyIw== X-Gm-Message-State: AMke39n37oVJ/eLP41RpyrOS0ri5sasKGwAhYefO9D/+CVa4feps7zxjYo2w6XmgknHyyTFo9Pw7JrN8BhWPZw== X-Received: by 10.129.81.12 with SMTP id f12mr25035699ywb.80.1487154682343; Wed, 15 Feb 2017 02:31:22 -0800 (PST) MIME-Version: 1.0 References: <201701240209.v0O29UDD047838@repo.freebsd.org> In-Reply-To: <201701240209.v0O29UDD047838@repo.freebsd.org> From: Yoshiro MIHIRA Date: Wed, 15 Feb 2017 10:31:11 +0000 Message-ID: Subject: Re: svn commit: r312679 - head/sys/arm/freescale/imx To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 10:31:23 -0000 Hi. Ian Thank you for your strong effort to support imx6 board. I have SolidRun HummingBoard-i2(imx6dl-hummingboard). I have reboot issue(never reset after reboot) and if I use Linux, I reproduce this issue So I reported this issue to SolidRun Forum. http://forum.solid-run.com/linux-on-cubox-i-and-hummingboard-f8/need-to-pus= h-reset-button-to-reboot-linux-system-t3122.html But I could not get any information. I tested latest kernel(r313280) unfortunately it was not solved. Do you know other information about reset issue, please let me know. Currently I need to push reset button when I restart system... Yours Yoshiro MIHIRA 2017=E5=B9=B41=E6=9C=8824=E6=97=A5(=E7=81=AB) 11:09 Ian Lepore : > Author: ian > Date: Tue Jan 24 02:09:30 2017 > New Revision: 312679 > URL: https://svnweb.freebsd.org/changeset/base/312679 > > Log: > Handle imx6 erratum ERR004346... to reboot, clear the SRS bit twice > within > the same cycle of the 32khz clock. > > I've never actually noticed this error happening, but it's an easy fix. > > Modified: > head/sys/arm/freescale/imx/imx_machdep.c > > Modified: head/sys/arm/freescale/imx/imx_machdep.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/arm/freescale/imx/imx_machdep.c Tue Jan 24 01:39:40 2017 > (r312678) > +++ head/sys/arm/freescale/imx/imx_machdep.c Tue Jan 24 02:09:30 2017 > (r312679) > @@ -69,11 +69,18 @@ imx_wdog_cpu_reset(vm_offset_t wdcr_phys > * Trigger an immediate reset by clearing the SRS bit in the > watchdog > * control register. The reset happens on the next cycle of the > wdog > * 32KHz clock, so hang out in a spin loop until the reset takes > effect. > + * > + * Imx6 erratum ERR004346 says the SRS bit has to be cleared twic= e > + * within the same cycle of the 32khz clock to reliably trigger t= he > + * reset. Writing it 3 times in a row ensures at least 2 of the > writes > + * happen in the same 32k clock cycle. > */ > if ((pcr =3D devmap_ptov(wdcr_physaddr, sizeof(*pcr))) =3D=3D NUL= L) { > printf("cpu_reset() can't find its control register... > locking up now."); > } else { > *pcr &=3D ~WDOG_CR_SRS; > + *pcr &=3D ~WDOG_CR_SRS; > + *pcr &=3D ~WDOG_CR_SRS; > } > for (;;) > continue; > > From owner-svn-src-head@freebsd.org Wed Feb 15 13:37:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8180ACE01F6; Wed, 15 Feb 2017 13:37:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E0FA13B2; Wed, 15 Feb 2017 13:37:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FDbWEB051714; Wed, 15 Feb 2017 13:37:32 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FDbW6C051712; Wed, 15 Feb 2017 13:37:32 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201702151337.v1FDbW6C051712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Feb 2017 13:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313767 - head/sys/dev/axgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 13:37:34 -0000 Author: andrew Date: Wed Feb 15 13:37:32 2017 New Revision: 313767 URL: https://svnweb.freebsd.org/changeset/base/313767 Log: Import the AMD 10G ethernet driver for the AMD Opteron A1100. This is from Linux git as of 5eb4dce3b3471ec9d1ea2945fa3d2bab4ac7e100 Obtained from: Linux Sponsored by: SoftIron Inc Added: head/sys/dev/axgbe/ head/sys/dev/axgbe/xgbe-common.h (contents, props changed) head/sys/dev/axgbe/xgbe-desc.c (contents, props changed) head/sys/dev/axgbe/xgbe-dev.c (contents, props changed) head/sys/dev/axgbe/xgbe-drv.c (contents, props changed) head/sys/dev/axgbe/xgbe-mdio.c (contents, props changed) head/sys/dev/axgbe/xgbe.h (contents, props changed) Added: head/sys/dev/axgbe/xgbe-common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/axgbe/xgbe-common.h Wed Feb 15 13:37:32 2017 (r313767) @@ -0,0 +1,1304 @@ +/* + * AMD 10Gb Ethernet driver + * + * This file is available to you under your choice of the following two + * licenses: + * + * License 1: GPLv2 + * + * Copyright (c) 2014-2016 Advanced Micro Devices, Inc. + * + * This file is free software; you may copy, redistribute 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. + * + * This file 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 this program. If not, see . + * + * This file incorporates work covered by the following copyright and + * permission notice: + * The Synopsys DWC ETHER XGMAC Software Driver and documentation + * (hereinafter "Software") is an unsupported proprietary work of Synopsys, + * Inc. unless otherwise expressly agreed to in writing between Synopsys + * and you. + * + * The Software IS NOT an item of Licensed Software or Licensed Product + * under any End User Software License Agreement or Agreement for Licensed + * Product with Synopsys or any supplement thereto. Permission is hereby + * granted, free of charge, to any person obtaining a copy of this software + * annotated with this license and the Software, to deal in the Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished + * to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" + * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS + * 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. + * + * + * License 2: Modified BSD + * + * Copyright (c) 2014-2016 Advanced Micro Devices, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Advanced Micro Devices, Inc. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL 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. + * + * This file incorporates work covered by the following copyright and + * permission notice: + * The Synopsys DWC ETHER XGMAC Software Driver and documentation + * (hereinafter "Software") is an unsupported proprietary work of Synopsys, + * Inc. unless otherwise expressly agreed to in writing between Synopsys + * and you. + * + * The Software IS NOT an item of Licensed Software or Licensed Product + * under any End User Software License Agreement or Agreement for Licensed + * Product with Synopsys or any supplement thereto. Permission is hereby + * granted, free of charge, to any person obtaining a copy of this software + * annotated with this license and the Software, to deal in the Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished + * to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" + * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS + * 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 __XGBE_COMMON_H__ +#define __XGBE_COMMON_H__ + +/* DMA register offsets */ +#define DMA_MR 0x3000 +#define DMA_SBMR 0x3004 +#define DMA_ISR 0x3008 +#define DMA_AXIARCR 0x3010 +#define DMA_AXIAWCR 0x3018 +#define DMA_DSR0 0x3020 +#define DMA_DSR1 0x3024 + +/* DMA register entry bit positions and sizes */ +#define DMA_AXIARCR_DRC_INDEX 0 +#define DMA_AXIARCR_DRC_WIDTH 4 +#define DMA_AXIARCR_DRD_INDEX 4 +#define DMA_AXIARCR_DRD_WIDTH 2 +#define DMA_AXIARCR_TEC_INDEX 8 +#define DMA_AXIARCR_TEC_WIDTH 4 +#define DMA_AXIARCR_TED_INDEX 12 +#define DMA_AXIARCR_TED_WIDTH 2 +#define DMA_AXIARCR_THC_INDEX 16 +#define DMA_AXIARCR_THC_WIDTH 4 +#define DMA_AXIARCR_THD_INDEX 20 +#define DMA_AXIARCR_THD_WIDTH 2 +#define DMA_AXIAWCR_DWC_INDEX 0 +#define DMA_AXIAWCR_DWC_WIDTH 4 +#define DMA_AXIAWCR_DWD_INDEX 4 +#define DMA_AXIAWCR_DWD_WIDTH 2 +#define DMA_AXIAWCR_RPC_INDEX 8 +#define DMA_AXIAWCR_RPC_WIDTH 4 +#define DMA_AXIAWCR_RPD_INDEX 12 +#define DMA_AXIAWCR_RPD_WIDTH 2 +#define DMA_AXIAWCR_RHC_INDEX 16 +#define DMA_AXIAWCR_RHC_WIDTH 4 +#define DMA_AXIAWCR_RHD_INDEX 20 +#define DMA_AXIAWCR_RHD_WIDTH 2 +#define DMA_AXIAWCR_TDC_INDEX 24 +#define DMA_AXIAWCR_TDC_WIDTH 4 +#define DMA_AXIAWCR_TDD_INDEX 28 +#define DMA_AXIAWCR_TDD_WIDTH 2 +#define DMA_ISR_MACIS_INDEX 17 +#define DMA_ISR_MACIS_WIDTH 1 +#define DMA_ISR_MTLIS_INDEX 16 +#define DMA_ISR_MTLIS_WIDTH 1 +#define DMA_MR_SWR_INDEX 0 +#define DMA_MR_SWR_WIDTH 1 +#define DMA_SBMR_EAME_INDEX 11 +#define DMA_SBMR_EAME_WIDTH 1 +#define DMA_SBMR_BLEN_256_INDEX 7 +#define DMA_SBMR_BLEN_256_WIDTH 1 +#define DMA_SBMR_UNDEF_INDEX 0 +#define DMA_SBMR_UNDEF_WIDTH 1 + +/* DMA register values */ +#define DMA_DSR_RPS_WIDTH 4 +#define DMA_DSR_TPS_WIDTH 4 +#define DMA_DSR_Q_WIDTH (DMA_DSR_RPS_WIDTH + DMA_DSR_TPS_WIDTH) +#define DMA_DSR0_RPS_START 8 +#define DMA_DSR0_TPS_START 12 +#define DMA_DSRX_FIRST_QUEUE 3 +#define DMA_DSRX_INC 4 +#define DMA_DSRX_QPR 4 +#define DMA_DSRX_RPS_START 0 +#define DMA_DSRX_TPS_START 4 +#define DMA_TPS_STOPPED 0x00 +#define DMA_TPS_SUSPENDED 0x06 + +/* DMA channel register offsets + * Multiple channels can be active. The first channel has registers + * that begin at 0x3100. Each subsequent channel has registers that + * are accessed using an offset of 0x80 from the previous channel. + */ +#define DMA_CH_BASE 0x3100 +#define DMA_CH_INC 0x80 + +#define DMA_CH_CR 0x00 +#define DMA_CH_TCR 0x04 +#define DMA_CH_RCR 0x08 +#define DMA_CH_TDLR_HI 0x10 +#define DMA_CH_TDLR_LO 0x14 +#define DMA_CH_RDLR_HI 0x18 +#define DMA_CH_RDLR_LO 0x1c +#define DMA_CH_TDTR_LO 0x24 +#define DMA_CH_RDTR_LO 0x2c +#define DMA_CH_TDRLR 0x30 +#define DMA_CH_RDRLR 0x34 +#define DMA_CH_IER 0x38 +#define DMA_CH_RIWT 0x3c +#define DMA_CH_CATDR_LO 0x44 +#define DMA_CH_CARDR_LO 0x4c +#define DMA_CH_CATBR_HI 0x50 +#define DMA_CH_CATBR_LO 0x54 +#define DMA_CH_CARBR_HI 0x58 +#define DMA_CH_CARBR_LO 0x5c +#define DMA_CH_SR 0x60 + +/* DMA channel register entry bit positions and sizes */ +#define DMA_CH_CR_PBLX8_INDEX 16 +#define DMA_CH_CR_PBLX8_WIDTH 1 +#define DMA_CH_CR_SPH_INDEX 24 +#define DMA_CH_CR_SPH_WIDTH 1 +#define DMA_CH_IER_AIE_INDEX 15 +#define DMA_CH_IER_AIE_WIDTH 1 +#define DMA_CH_IER_FBEE_INDEX 12 +#define DMA_CH_IER_FBEE_WIDTH 1 +#define DMA_CH_IER_NIE_INDEX 16 +#define DMA_CH_IER_NIE_WIDTH 1 +#define DMA_CH_IER_RBUE_INDEX 7 +#define DMA_CH_IER_RBUE_WIDTH 1 +#define DMA_CH_IER_RIE_INDEX 6 +#define DMA_CH_IER_RIE_WIDTH 1 +#define DMA_CH_IER_RSE_INDEX 8 +#define DMA_CH_IER_RSE_WIDTH 1 +#define DMA_CH_IER_TBUE_INDEX 2 +#define DMA_CH_IER_TBUE_WIDTH 1 +#define DMA_CH_IER_TIE_INDEX 0 +#define DMA_CH_IER_TIE_WIDTH 1 +#define DMA_CH_IER_TXSE_INDEX 1 +#define DMA_CH_IER_TXSE_WIDTH 1 +#define DMA_CH_RCR_PBL_INDEX 16 +#define DMA_CH_RCR_PBL_WIDTH 6 +#define DMA_CH_RCR_RBSZ_INDEX 1 +#define DMA_CH_RCR_RBSZ_WIDTH 14 +#define DMA_CH_RCR_SR_INDEX 0 +#define DMA_CH_RCR_SR_WIDTH 1 +#define DMA_CH_RIWT_RWT_INDEX 0 +#define DMA_CH_RIWT_RWT_WIDTH 8 +#define DMA_CH_SR_FBE_INDEX 12 +#define DMA_CH_SR_FBE_WIDTH 1 +#define DMA_CH_SR_RBU_INDEX 7 +#define DMA_CH_SR_RBU_WIDTH 1 +#define DMA_CH_SR_RI_INDEX 6 +#define DMA_CH_SR_RI_WIDTH 1 +#define DMA_CH_SR_RPS_INDEX 8 +#define DMA_CH_SR_RPS_WIDTH 1 +#define DMA_CH_SR_TBU_INDEX 2 +#define DMA_CH_SR_TBU_WIDTH 1 +#define DMA_CH_SR_TI_INDEX 0 +#define DMA_CH_SR_TI_WIDTH 1 +#define DMA_CH_SR_TPS_INDEX 1 +#define DMA_CH_SR_TPS_WIDTH 1 +#define DMA_CH_TCR_OSP_INDEX 4 +#define DMA_CH_TCR_OSP_WIDTH 1 +#define DMA_CH_TCR_PBL_INDEX 16 +#define DMA_CH_TCR_PBL_WIDTH 6 +#define DMA_CH_TCR_ST_INDEX 0 +#define DMA_CH_TCR_ST_WIDTH 1 +#define DMA_CH_TCR_TSE_INDEX 12 +#define DMA_CH_TCR_TSE_WIDTH 1 + +/* DMA channel register values */ +#define DMA_OSP_DISABLE 0x00 +#define DMA_OSP_ENABLE 0x01 +#define DMA_PBL_1 1 +#define DMA_PBL_2 2 +#define DMA_PBL_4 4 +#define DMA_PBL_8 8 +#define DMA_PBL_16 16 +#define DMA_PBL_32 32 +#define DMA_PBL_64 64 /* 8 x 8 */ +#define DMA_PBL_128 128 /* 8 x 16 */ +#define DMA_PBL_256 256 /* 8 x 32 */ +#define DMA_PBL_X8_DISABLE 0x00 +#define DMA_PBL_X8_ENABLE 0x01 + +/* MAC register offsets */ +#define MAC_TCR 0x0000 +#define MAC_RCR 0x0004 +#define MAC_PFR 0x0008 +#define MAC_WTR 0x000c +#define MAC_HTR0 0x0010 +#define MAC_VLANTR 0x0050 +#define MAC_VLANHTR 0x0058 +#define MAC_VLANIR 0x0060 +#define MAC_IVLANIR 0x0064 +#define MAC_RETMR 0x006c +#define MAC_Q0TFCR 0x0070 +#define MAC_RFCR 0x0090 +#define MAC_RQC0R 0x00a0 +#define MAC_RQC1R 0x00a4 +#define MAC_RQC2R 0x00a8 +#define MAC_RQC3R 0x00ac +#define MAC_ISR 0x00b0 +#define MAC_IER 0x00b4 +#define MAC_RTSR 0x00b8 +#define MAC_PMTCSR 0x00c0 +#define MAC_RWKPFR 0x00c4 +#define MAC_LPICSR 0x00d0 +#define MAC_LPITCR 0x00d4 +#define MAC_VR 0x0110 +#define MAC_DR 0x0114 +#define MAC_HWF0R 0x011c +#define MAC_HWF1R 0x0120 +#define MAC_HWF2R 0x0124 +#define MAC_GPIOCR 0x0278 +#define MAC_GPIOSR 0x027c +#define MAC_MACA0HR 0x0300 +#define MAC_MACA0LR 0x0304 +#define MAC_MACA1HR 0x0308 +#define MAC_MACA1LR 0x030c +#define MAC_RSSCR 0x0c80 +#define MAC_RSSAR 0x0c88 +#define MAC_RSSDR 0x0c8c +#define MAC_TSCR 0x0d00 +#define MAC_SSIR 0x0d04 +#define MAC_STSR 0x0d08 +#define MAC_STNR 0x0d0c +#define MAC_STSUR 0x0d10 +#define MAC_STNUR 0x0d14 +#define MAC_TSAR 0x0d18 +#define MAC_TSSR 0x0d20 +#define MAC_TXSNR 0x0d30 +#define MAC_TXSSR 0x0d34 + +#define MAC_QTFCR_INC 4 +#define MAC_MACA_INC 4 +#define MAC_HTR_INC 4 + +#define MAC_RQC2_INC 4 +#define MAC_RQC2_Q_PER_REG 4 + +/* MAC register entry bit positions and sizes */ +#define MAC_HWF0R_ADDMACADRSEL_INDEX 18 +#define MAC_HWF0R_ADDMACADRSEL_WIDTH 5 +#define MAC_HWF0R_ARPOFFSEL_INDEX 9 +#define MAC_HWF0R_ARPOFFSEL_WIDTH 1 +#define MAC_HWF0R_EEESEL_INDEX 13 +#define MAC_HWF0R_EEESEL_WIDTH 1 +#define MAC_HWF0R_GMIISEL_INDEX 1 +#define MAC_HWF0R_GMIISEL_WIDTH 1 +#define MAC_HWF0R_MGKSEL_INDEX 7 +#define MAC_HWF0R_MGKSEL_WIDTH 1 +#define MAC_HWF0R_MMCSEL_INDEX 8 +#define MAC_HWF0R_MMCSEL_WIDTH 1 +#define MAC_HWF0R_RWKSEL_INDEX 6 +#define MAC_HWF0R_RWKSEL_WIDTH 1 +#define MAC_HWF0R_RXCOESEL_INDEX 16 +#define MAC_HWF0R_RXCOESEL_WIDTH 1 +#define MAC_HWF0R_SAVLANINS_INDEX 27 +#define MAC_HWF0R_SAVLANINS_WIDTH 1 +#define MAC_HWF0R_SMASEL_INDEX 5 +#define MAC_HWF0R_SMASEL_WIDTH 1 +#define MAC_HWF0R_TSSEL_INDEX 12 +#define MAC_HWF0R_TSSEL_WIDTH 1 +#define MAC_HWF0R_TSSTSSEL_INDEX 25 +#define MAC_HWF0R_TSSTSSEL_WIDTH 2 +#define MAC_HWF0R_TXCOESEL_INDEX 14 +#define MAC_HWF0R_TXCOESEL_WIDTH 1 +#define MAC_HWF0R_VLHASH_INDEX 4 +#define MAC_HWF0R_VLHASH_WIDTH 1 +#define MAC_HWF1R_ADDR64_INDEX 14 +#define MAC_HWF1R_ADDR64_WIDTH 2 +#define MAC_HWF1R_ADVTHWORD_INDEX 13 +#define MAC_HWF1R_ADVTHWORD_WIDTH 1 +#define MAC_HWF1R_DBGMEMA_INDEX 19 +#define MAC_HWF1R_DBGMEMA_WIDTH 1 +#define MAC_HWF1R_DCBEN_INDEX 16 +#define MAC_HWF1R_DCBEN_WIDTH 1 +#define MAC_HWF1R_HASHTBLSZ_INDEX 24 +#define MAC_HWF1R_HASHTBLSZ_WIDTH 3 +#define MAC_HWF1R_L3L4FNUM_INDEX 27 +#define MAC_HWF1R_L3L4FNUM_WIDTH 4 +#define MAC_HWF1R_NUMTC_INDEX 21 +#define MAC_HWF1R_NUMTC_WIDTH 3 +#define MAC_HWF1R_RSSEN_INDEX 20 +#define MAC_HWF1R_RSSEN_WIDTH 1 +#define MAC_HWF1R_RXFIFOSIZE_INDEX 0 +#define MAC_HWF1R_RXFIFOSIZE_WIDTH 5 +#define MAC_HWF1R_SPHEN_INDEX 17 +#define MAC_HWF1R_SPHEN_WIDTH 1 +#define MAC_HWF1R_TSOEN_INDEX 18 +#define MAC_HWF1R_TSOEN_WIDTH 1 +#define MAC_HWF1R_TXFIFOSIZE_INDEX 6 +#define MAC_HWF1R_TXFIFOSIZE_WIDTH 5 +#define MAC_HWF2R_AUXSNAPNUM_INDEX 28 +#define MAC_HWF2R_AUXSNAPNUM_WIDTH 3 +#define MAC_HWF2R_PPSOUTNUM_INDEX 24 +#define MAC_HWF2R_PPSOUTNUM_WIDTH 3 +#define MAC_HWF2R_RXCHCNT_INDEX 12 +#define MAC_HWF2R_RXCHCNT_WIDTH 4 +#define MAC_HWF2R_RXQCNT_INDEX 0 +#define MAC_HWF2R_RXQCNT_WIDTH 4 +#define MAC_HWF2R_TXCHCNT_INDEX 18 +#define MAC_HWF2R_TXCHCNT_WIDTH 4 +#define MAC_HWF2R_TXQCNT_INDEX 6 +#define MAC_HWF2R_TXQCNT_WIDTH 4 +#define MAC_IER_TSIE_INDEX 12 +#define MAC_IER_TSIE_WIDTH 1 +#define MAC_ISR_MMCRXIS_INDEX 9 +#define MAC_ISR_MMCRXIS_WIDTH 1 +#define MAC_ISR_MMCTXIS_INDEX 10 +#define MAC_ISR_MMCTXIS_WIDTH 1 +#define MAC_ISR_PMTIS_INDEX 4 +#define MAC_ISR_PMTIS_WIDTH 1 +#define MAC_ISR_TSIS_INDEX 12 +#define MAC_ISR_TSIS_WIDTH 1 +#define MAC_MACA1HR_AE_INDEX 31 +#define MAC_MACA1HR_AE_WIDTH 1 +#define MAC_PFR_HMC_INDEX 2 +#define MAC_PFR_HMC_WIDTH 1 +#define MAC_PFR_HPF_INDEX 10 +#define MAC_PFR_HPF_WIDTH 1 +#define MAC_PFR_HUC_INDEX 1 +#define MAC_PFR_HUC_WIDTH 1 +#define MAC_PFR_PM_INDEX 4 +#define MAC_PFR_PM_WIDTH 1 +#define MAC_PFR_PR_INDEX 0 +#define MAC_PFR_PR_WIDTH 1 +#define MAC_PFR_VTFE_INDEX 16 +#define MAC_PFR_VTFE_WIDTH 1 +#define MAC_PMTCSR_MGKPKTEN_INDEX 1 +#define MAC_PMTCSR_MGKPKTEN_WIDTH 1 +#define MAC_PMTCSR_PWRDWN_INDEX 0 +#define MAC_PMTCSR_PWRDWN_WIDTH 1 +#define MAC_PMTCSR_RWKFILTRST_INDEX 31 +#define MAC_PMTCSR_RWKFILTRST_WIDTH 1 +#define MAC_PMTCSR_RWKPKTEN_INDEX 2 +#define MAC_PMTCSR_RWKPKTEN_WIDTH 1 +#define MAC_Q0TFCR_PT_INDEX 16 +#define MAC_Q0TFCR_PT_WIDTH 16 +#define MAC_Q0TFCR_TFE_INDEX 1 +#define MAC_Q0TFCR_TFE_WIDTH 1 +#define MAC_RCR_ACS_INDEX 1 +#define MAC_RCR_ACS_WIDTH 1 +#define MAC_RCR_CST_INDEX 2 +#define MAC_RCR_CST_WIDTH 1 +#define MAC_RCR_DCRCC_INDEX 3 +#define MAC_RCR_DCRCC_WIDTH 1 +#define MAC_RCR_HDSMS_INDEX 12 +#define MAC_RCR_HDSMS_WIDTH 3 +#define MAC_RCR_IPC_INDEX 9 +#define MAC_RCR_IPC_WIDTH 1 +#define MAC_RCR_JE_INDEX 8 +#define MAC_RCR_JE_WIDTH 1 +#define MAC_RCR_LM_INDEX 10 +#define MAC_RCR_LM_WIDTH 1 +#define MAC_RCR_RE_INDEX 0 +#define MAC_RCR_RE_WIDTH 1 +#define MAC_RFCR_PFCE_INDEX 8 +#define MAC_RFCR_PFCE_WIDTH 1 +#define MAC_RFCR_RFE_INDEX 0 +#define MAC_RFCR_RFE_WIDTH 1 +#define MAC_RFCR_UP_INDEX 1 +#define MAC_RFCR_UP_WIDTH 1 +#define MAC_RQC0R_RXQ0EN_INDEX 0 +#define MAC_RQC0R_RXQ0EN_WIDTH 2 +#define MAC_RSSAR_ADDRT_INDEX 2 +#define MAC_RSSAR_ADDRT_WIDTH 1 +#define MAC_RSSAR_CT_INDEX 1 +#define MAC_RSSAR_CT_WIDTH 1 +#define MAC_RSSAR_OB_INDEX 0 +#define MAC_RSSAR_OB_WIDTH 1 +#define MAC_RSSAR_RSSIA_INDEX 8 +#define MAC_RSSAR_RSSIA_WIDTH 8 +#define MAC_RSSCR_IP2TE_INDEX 1 +#define MAC_RSSCR_IP2TE_WIDTH 1 +#define MAC_RSSCR_RSSE_INDEX 0 +#define MAC_RSSCR_RSSE_WIDTH 1 +#define MAC_RSSCR_TCP4TE_INDEX 2 +#define MAC_RSSCR_TCP4TE_WIDTH 1 +#define MAC_RSSCR_UDP4TE_INDEX 3 +#define MAC_RSSCR_UDP4TE_WIDTH 1 +#define MAC_RSSDR_DMCH_INDEX 0 +#define MAC_RSSDR_DMCH_WIDTH 4 +#define MAC_SSIR_SNSINC_INDEX 8 +#define MAC_SSIR_SNSINC_WIDTH 8 +#define MAC_SSIR_SSINC_INDEX 16 +#define MAC_SSIR_SSINC_WIDTH 8 +#define MAC_TCR_SS_INDEX 29 +#define MAC_TCR_SS_WIDTH 2 +#define MAC_TCR_TE_INDEX 0 +#define MAC_TCR_TE_WIDTH 1 +#define MAC_TSCR_AV8021ASMEN_INDEX 28 +#define MAC_TSCR_AV8021ASMEN_WIDTH 1 +#define MAC_TSCR_SNAPTYPSEL_INDEX 16 +#define MAC_TSCR_SNAPTYPSEL_WIDTH 2 +#define MAC_TSCR_TSADDREG_INDEX 5 +#define MAC_TSCR_TSADDREG_WIDTH 1 +#define MAC_TSCR_TSCFUPDT_INDEX 1 +#define MAC_TSCR_TSCFUPDT_WIDTH 1 +#define MAC_TSCR_TSCTRLSSR_INDEX 9 +#define MAC_TSCR_TSCTRLSSR_WIDTH 1 +#define MAC_TSCR_TSENA_INDEX 0 +#define MAC_TSCR_TSENA_WIDTH 1 +#define MAC_TSCR_TSENALL_INDEX 8 +#define MAC_TSCR_TSENALL_WIDTH 1 +#define MAC_TSCR_TSEVNTENA_INDEX 14 +#define MAC_TSCR_TSEVNTENA_WIDTH 1 +#define MAC_TSCR_TSINIT_INDEX 2 +#define MAC_TSCR_TSINIT_WIDTH 1 +#define MAC_TSCR_TSIPENA_INDEX 11 +#define MAC_TSCR_TSIPENA_WIDTH 1 +#define MAC_TSCR_TSIPV4ENA_INDEX 13 +#define MAC_TSCR_TSIPV4ENA_WIDTH 1 +#define MAC_TSCR_TSIPV6ENA_INDEX 12 +#define MAC_TSCR_TSIPV6ENA_WIDTH 1 +#define MAC_TSCR_TSMSTRENA_INDEX 15 +#define MAC_TSCR_TSMSTRENA_WIDTH 1 +#define MAC_TSCR_TSVER2ENA_INDEX 10 +#define MAC_TSCR_TSVER2ENA_WIDTH 1 +#define MAC_TSCR_TXTSSTSM_INDEX 24 +#define MAC_TSCR_TXTSSTSM_WIDTH 1 +#define MAC_TSSR_TXTSC_INDEX 15 +#define MAC_TSSR_TXTSC_WIDTH 1 +#define MAC_TXSNR_TXTSSTSMIS_INDEX 31 +#define MAC_TXSNR_TXTSSTSMIS_WIDTH 1 +#define MAC_VLANHTR_VLHT_INDEX 0 +#define MAC_VLANHTR_VLHT_WIDTH 16 +#define MAC_VLANIR_VLTI_INDEX 20 +#define MAC_VLANIR_VLTI_WIDTH 1 +#define MAC_VLANIR_CSVL_INDEX 19 +#define MAC_VLANIR_CSVL_WIDTH 1 +#define MAC_VLANTR_DOVLTC_INDEX 20 +#define MAC_VLANTR_DOVLTC_WIDTH 1 +#define MAC_VLANTR_ERSVLM_INDEX 19 +#define MAC_VLANTR_ERSVLM_WIDTH 1 +#define MAC_VLANTR_ESVL_INDEX 18 +#define MAC_VLANTR_ESVL_WIDTH 1 +#define MAC_VLANTR_ETV_INDEX 16 +#define MAC_VLANTR_ETV_WIDTH 1 +#define MAC_VLANTR_EVLS_INDEX 21 +#define MAC_VLANTR_EVLS_WIDTH 2 +#define MAC_VLANTR_EVLRXS_INDEX 24 +#define MAC_VLANTR_EVLRXS_WIDTH 1 +#define MAC_VLANTR_VL_INDEX 0 +#define MAC_VLANTR_VL_WIDTH 16 +#define MAC_VLANTR_VTHM_INDEX 25 +#define MAC_VLANTR_VTHM_WIDTH 1 +#define MAC_VLANTR_VTIM_INDEX 17 +#define MAC_VLANTR_VTIM_WIDTH 1 +#define MAC_VR_DEVID_INDEX 8 +#define MAC_VR_DEVID_WIDTH 8 +#define MAC_VR_SNPSVER_INDEX 0 +#define MAC_VR_SNPSVER_WIDTH 8 +#define MAC_VR_USERVER_INDEX 16 +#define MAC_VR_USERVER_WIDTH 8 + +/* MMC register offsets */ +#define MMC_CR 0x0800 +#define MMC_RISR 0x0804 +#define MMC_TISR 0x0808 +#define MMC_RIER 0x080c +#define MMC_TIER 0x0810 +#define MMC_TXOCTETCOUNT_GB_LO 0x0814 +#define MMC_TXOCTETCOUNT_GB_HI 0x0818 +#define MMC_TXFRAMECOUNT_GB_LO 0x081c +#define MMC_TXFRAMECOUNT_GB_HI 0x0820 +#define MMC_TXBROADCASTFRAMES_G_LO 0x0824 +#define MMC_TXBROADCASTFRAMES_G_HI 0x0828 +#define MMC_TXMULTICASTFRAMES_G_LO 0x082c +#define MMC_TXMULTICASTFRAMES_G_HI 0x0830 +#define MMC_TX64OCTETS_GB_LO 0x0834 +#define MMC_TX64OCTETS_GB_HI 0x0838 +#define MMC_TX65TO127OCTETS_GB_LO 0x083c +#define MMC_TX65TO127OCTETS_GB_HI 0x0840 +#define MMC_TX128TO255OCTETS_GB_LO 0x0844 +#define MMC_TX128TO255OCTETS_GB_HI 0x0848 +#define MMC_TX256TO511OCTETS_GB_LO 0x084c +#define MMC_TX256TO511OCTETS_GB_HI 0x0850 +#define MMC_TX512TO1023OCTETS_GB_LO 0x0854 +#define MMC_TX512TO1023OCTETS_GB_HI 0x0858 +#define MMC_TX1024TOMAXOCTETS_GB_LO 0x085c +#define MMC_TX1024TOMAXOCTETS_GB_HI 0x0860 +#define MMC_TXUNICASTFRAMES_GB_LO 0x0864 +#define MMC_TXUNICASTFRAMES_GB_HI 0x0868 +#define MMC_TXMULTICASTFRAMES_GB_LO 0x086c +#define MMC_TXMULTICASTFRAMES_GB_HI 0x0870 +#define MMC_TXBROADCASTFRAMES_GB_LO 0x0874 +#define MMC_TXBROADCASTFRAMES_GB_HI 0x0878 +#define MMC_TXUNDERFLOWERROR_LO 0x087c +#define MMC_TXUNDERFLOWERROR_HI 0x0880 +#define MMC_TXOCTETCOUNT_G_LO 0x0884 +#define MMC_TXOCTETCOUNT_G_HI 0x0888 +#define MMC_TXFRAMECOUNT_G_LO 0x088c +#define MMC_TXFRAMECOUNT_G_HI 0x0890 +#define MMC_TXPAUSEFRAMES_LO 0x0894 +#define MMC_TXPAUSEFRAMES_HI 0x0898 +#define MMC_TXVLANFRAMES_G_LO 0x089c +#define MMC_TXVLANFRAMES_G_HI 0x08a0 +#define MMC_RXFRAMECOUNT_GB_LO 0x0900 +#define MMC_RXFRAMECOUNT_GB_HI 0x0904 +#define MMC_RXOCTETCOUNT_GB_LO 0x0908 +#define MMC_RXOCTETCOUNT_GB_HI 0x090c +#define MMC_RXOCTETCOUNT_G_LO 0x0910 +#define MMC_RXOCTETCOUNT_G_HI 0x0914 +#define MMC_RXBROADCASTFRAMES_G_LO 0x0918 +#define MMC_RXBROADCASTFRAMES_G_HI 0x091c +#define MMC_RXMULTICASTFRAMES_G_LO 0x0920 +#define MMC_RXMULTICASTFRAMES_G_HI 0x0924 +#define MMC_RXCRCERROR_LO 0x0928 +#define MMC_RXCRCERROR_HI 0x092c +#define MMC_RXRUNTERROR 0x0930 +#define MMC_RXJABBERERROR 0x0934 +#define MMC_RXUNDERSIZE_G 0x0938 +#define MMC_RXOVERSIZE_G 0x093c +#define MMC_RX64OCTETS_GB_LO 0x0940 +#define MMC_RX64OCTETS_GB_HI 0x0944 +#define MMC_RX65TO127OCTETS_GB_LO 0x0948 +#define MMC_RX65TO127OCTETS_GB_HI 0x094c +#define MMC_RX128TO255OCTETS_GB_LO 0x0950 +#define MMC_RX128TO255OCTETS_GB_HI 0x0954 +#define MMC_RX256TO511OCTETS_GB_LO 0x0958 +#define MMC_RX256TO511OCTETS_GB_HI 0x095c +#define MMC_RX512TO1023OCTETS_GB_LO 0x0960 +#define MMC_RX512TO1023OCTETS_GB_HI 0x0964 +#define MMC_RX1024TOMAXOCTETS_GB_LO 0x0968 +#define MMC_RX1024TOMAXOCTETS_GB_HI 0x096c +#define MMC_RXUNICASTFRAMES_G_LO 0x0970 +#define MMC_RXUNICASTFRAMES_G_HI 0x0974 +#define MMC_RXLENGTHERROR_LO 0x0978 +#define MMC_RXLENGTHERROR_HI 0x097c +#define MMC_RXOUTOFRANGETYPE_LO 0x0980 +#define MMC_RXOUTOFRANGETYPE_HI 0x0984 +#define MMC_RXPAUSEFRAMES_LO 0x0988 +#define MMC_RXPAUSEFRAMES_HI 0x098c +#define MMC_RXFIFOOVERFLOW_LO 0x0990 +#define MMC_RXFIFOOVERFLOW_HI 0x0994 +#define MMC_RXVLANFRAMES_GB_LO 0x0998 +#define MMC_RXVLANFRAMES_GB_HI 0x099c +#define MMC_RXWATCHDOGERROR 0x09a0 + +/* MMC register entry bit positions and sizes */ +#define MMC_CR_CR_INDEX 0 +#define MMC_CR_CR_WIDTH 1 +#define MMC_CR_CSR_INDEX 1 +#define MMC_CR_CSR_WIDTH 1 +#define MMC_CR_ROR_INDEX 2 +#define MMC_CR_ROR_WIDTH 1 +#define MMC_CR_MCF_INDEX 3 +#define MMC_CR_MCF_WIDTH 1 +#define MMC_CR_MCT_INDEX 4 +#define MMC_CR_MCT_WIDTH 2 +#define MMC_RIER_ALL_INTERRUPTS_INDEX 0 +#define MMC_RIER_ALL_INTERRUPTS_WIDTH 23 +#define MMC_RISR_RXFRAMECOUNT_GB_INDEX 0 +#define MMC_RISR_RXFRAMECOUNT_GB_WIDTH 1 +#define MMC_RISR_RXOCTETCOUNT_GB_INDEX 1 +#define MMC_RISR_RXOCTETCOUNT_GB_WIDTH 1 +#define MMC_RISR_RXOCTETCOUNT_G_INDEX 2 +#define MMC_RISR_RXOCTETCOUNT_G_WIDTH 1 +#define MMC_RISR_RXBROADCASTFRAMES_G_INDEX 3 +#define MMC_RISR_RXBROADCASTFRAMES_G_WIDTH 1 +#define MMC_RISR_RXMULTICASTFRAMES_G_INDEX 4 +#define MMC_RISR_RXMULTICASTFRAMES_G_WIDTH 1 +#define MMC_RISR_RXCRCERROR_INDEX 5 +#define MMC_RISR_RXCRCERROR_WIDTH 1 +#define MMC_RISR_RXRUNTERROR_INDEX 6 +#define MMC_RISR_RXRUNTERROR_WIDTH 1 +#define MMC_RISR_RXJABBERERROR_INDEX 7 +#define MMC_RISR_RXJABBERERROR_WIDTH 1 +#define MMC_RISR_RXUNDERSIZE_G_INDEX 8 +#define MMC_RISR_RXUNDERSIZE_G_WIDTH 1 +#define MMC_RISR_RXOVERSIZE_G_INDEX 9 +#define MMC_RISR_RXOVERSIZE_G_WIDTH 1 +#define MMC_RISR_RX64OCTETS_GB_INDEX 10 +#define MMC_RISR_RX64OCTETS_GB_WIDTH 1 +#define MMC_RISR_RX65TO127OCTETS_GB_INDEX 11 +#define MMC_RISR_RX65TO127OCTETS_GB_WIDTH 1 +#define MMC_RISR_RX128TO255OCTETS_GB_INDEX 12 +#define MMC_RISR_RX128TO255OCTETS_GB_WIDTH 1 +#define MMC_RISR_RX256TO511OCTETS_GB_INDEX 13 +#define MMC_RISR_RX256TO511OCTETS_GB_WIDTH 1 +#define MMC_RISR_RX512TO1023OCTETS_GB_INDEX 14 +#define MMC_RISR_RX512TO1023OCTETS_GB_WIDTH 1 +#define MMC_RISR_RX1024TOMAXOCTETS_GB_INDEX 15 +#define MMC_RISR_RX1024TOMAXOCTETS_GB_WIDTH 1 +#define MMC_RISR_RXUNICASTFRAMES_G_INDEX 16 +#define MMC_RISR_RXUNICASTFRAMES_G_WIDTH 1 +#define MMC_RISR_RXLENGTHERROR_INDEX 17 +#define MMC_RISR_RXLENGTHERROR_WIDTH 1 +#define MMC_RISR_RXOUTOFRANGETYPE_INDEX 18 +#define MMC_RISR_RXOUTOFRANGETYPE_WIDTH 1 +#define MMC_RISR_RXPAUSEFRAMES_INDEX 19 +#define MMC_RISR_RXPAUSEFRAMES_WIDTH 1 +#define MMC_RISR_RXFIFOOVERFLOW_INDEX 20 +#define MMC_RISR_RXFIFOOVERFLOW_WIDTH 1 +#define MMC_RISR_RXVLANFRAMES_GB_INDEX 21 +#define MMC_RISR_RXVLANFRAMES_GB_WIDTH 1 +#define MMC_RISR_RXWATCHDOGERROR_INDEX 22 +#define MMC_RISR_RXWATCHDOGERROR_WIDTH 1 +#define MMC_TIER_ALL_INTERRUPTS_INDEX 0 +#define MMC_TIER_ALL_INTERRUPTS_WIDTH 18 +#define MMC_TISR_TXOCTETCOUNT_GB_INDEX 0 +#define MMC_TISR_TXOCTETCOUNT_GB_WIDTH 1 +#define MMC_TISR_TXFRAMECOUNT_GB_INDEX 1 +#define MMC_TISR_TXFRAMECOUNT_GB_WIDTH 1 +#define MMC_TISR_TXBROADCASTFRAMES_G_INDEX 2 +#define MMC_TISR_TXBROADCASTFRAMES_G_WIDTH 1 +#define MMC_TISR_TXMULTICASTFRAMES_G_INDEX 3 +#define MMC_TISR_TXMULTICASTFRAMES_G_WIDTH 1 +#define MMC_TISR_TX64OCTETS_GB_INDEX 4 +#define MMC_TISR_TX64OCTETS_GB_WIDTH 1 +#define MMC_TISR_TX65TO127OCTETS_GB_INDEX 5 +#define MMC_TISR_TX65TO127OCTETS_GB_WIDTH 1 +#define MMC_TISR_TX128TO255OCTETS_GB_INDEX 6 +#define MMC_TISR_TX128TO255OCTETS_GB_WIDTH 1 +#define MMC_TISR_TX256TO511OCTETS_GB_INDEX 7 +#define MMC_TISR_TX256TO511OCTETS_GB_WIDTH 1 +#define MMC_TISR_TX512TO1023OCTETS_GB_INDEX 8 +#define MMC_TISR_TX512TO1023OCTETS_GB_WIDTH 1 +#define MMC_TISR_TX1024TOMAXOCTETS_GB_INDEX 9 +#define MMC_TISR_TX1024TOMAXOCTETS_GB_WIDTH 1 +#define MMC_TISR_TXUNICASTFRAMES_GB_INDEX 10 +#define MMC_TISR_TXUNICASTFRAMES_GB_WIDTH 1 +#define MMC_TISR_TXMULTICASTFRAMES_GB_INDEX 11 +#define MMC_TISR_TXMULTICASTFRAMES_GB_WIDTH 1 +#define MMC_TISR_TXBROADCASTFRAMES_GB_INDEX 12 +#define MMC_TISR_TXBROADCASTFRAMES_GB_WIDTH 1 +#define MMC_TISR_TXUNDERFLOWERROR_INDEX 13 +#define MMC_TISR_TXUNDERFLOWERROR_WIDTH 1 +#define MMC_TISR_TXOCTETCOUNT_G_INDEX 14 +#define MMC_TISR_TXOCTETCOUNT_G_WIDTH 1 +#define MMC_TISR_TXFRAMECOUNT_G_INDEX 15 +#define MMC_TISR_TXFRAMECOUNT_G_WIDTH 1 +#define MMC_TISR_TXPAUSEFRAMES_INDEX 16 +#define MMC_TISR_TXPAUSEFRAMES_WIDTH 1 +#define MMC_TISR_TXVLANFRAMES_G_INDEX 17 +#define MMC_TISR_TXVLANFRAMES_G_WIDTH 1 + +/* MTL register offsets */ +#define MTL_OMR 0x1000 +#define MTL_FDCR 0x1008 +#define MTL_FDSR 0x100c +#define MTL_FDDR 0x1010 +#define MTL_ISR 0x1020 +#define MTL_RQDCM0R 0x1030 +#define MTL_TCPM0R 0x1040 +#define MTL_TCPM1R 0x1044 + +#define MTL_RQDCM_INC 4 +#define MTL_RQDCM_Q_PER_REG 4 +#define MTL_TCPM_INC 4 +#define MTL_TCPM_TC_PER_REG 4 + +/* MTL register entry bit positions and sizes */ +#define MTL_OMR_ETSALG_INDEX 5 +#define MTL_OMR_ETSALG_WIDTH 2 +#define MTL_OMR_RAA_INDEX 2 +#define MTL_OMR_RAA_WIDTH 1 + +/* MTL queue register offsets + * Multiple queues can be active. The first queue has registers + * that begin at 0x1100. Each subsequent queue has registers that + * are accessed using an offset of 0x80 from the previous queue. + */ +#define MTL_Q_BASE 0x1100 +#define MTL_Q_INC 0x80 + +#define MTL_Q_TQOMR 0x00 +#define MTL_Q_TQUR 0x04 +#define MTL_Q_TQDR 0x08 +#define MTL_Q_RQOMR 0x40 +#define MTL_Q_RQMPOCR 0x44 +#define MTL_Q_RQDR 0x48 +#define MTL_Q_RQFCR 0x50 +#define MTL_Q_IER 0x70 +#define MTL_Q_ISR 0x74 + +/* MTL queue register entry bit positions and sizes */ +#define MTL_Q_RQDR_PRXQ_INDEX 16 +#define MTL_Q_RQDR_PRXQ_WIDTH 14 +#define MTL_Q_RQDR_RXQSTS_INDEX 4 +#define MTL_Q_RQDR_RXQSTS_WIDTH 2 +#define MTL_Q_RQFCR_RFA_INDEX 1 +#define MTL_Q_RQFCR_RFA_WIDTH 6 +#define MTL_Q_RQFCR_RFD_INDEX 17 +#define MTL_Q_RQFCR_RFD_WIDTH 6 +#define MTL_Q_RQOMR_EHFC_INDEX 7 +#define MTL_Q_RQOMR_EHFC_WIDTH 1 +#define MTL_Q_RQOMR_RQS_INDEX 16 +#define MTL_Q_RQOMR_RQS_WIDTH 9 +#define MTL_Q_RQOMR_RSF_INDEX 5 +#define MTL_Q_RQOMR_RSF_WIDTH 1 +#define MTL_Q_RQOMR_RTC_INDEX 0 +#define MTL_Q_RQOMR_RTC_WIDTH 2 +#define MTL_Q_TQOMR_FTQ_INDEX 0 +#define MTL_Q_TQOMR_FTQ_WIDTH 1 +#define MTL_Q_TQOMR_Q2TCMAP_INDEX 8 +#define MTL_Q_TQOMR_Q2TCMAP_WIDTH 3 +#define MTL_Q_TQOMR_TQS_INDEX 16 +#define MTL_Q_TQOMR_TQS_WIDTH 10 +#define MTL_Q_TQOMR_TSF_INDEX 1 +#define MTL_Q_TQOMR_TSF_WIDTH 1 +#define MTL_Q_TQOMR_TTC_INDEX 4 +#define MTL_Q_TQOMR_TTC_WIDTH 3 +#define MTL_Q_TQOMR_TXQEN_INDEX 2 +#define MTL_Q_TQOMR_TXQEN_WIDTH 2 + +/* MTL queue register value */ +#define MTL_RSF_DISABLE 0x00 +#define MTL_RSF_ENABLE 0x01 +#define MTL_TSF_DISABLE 0x00 +#define MTL_TSF_ENABLE 0x01 + +#define MTL_RX_THRESHOLD_64 0x00 +#define MTL_RX_THRESHOLD_96 0x02 +#define MTL_RX_THRESHOLD_128 0x03 +#define MTL_TX_THRESHOLD_32 0x01 +#define MTL_TX_THRESHOLD_64 0x00 +#define MTL_TX_THRESHOLD_96 0x02 +#define MTL_TX_THRESHOLD_128 0x03 +#define MTL_TX_THRESHOLD_192 0x04 +#define MTL_TX_THRESHOLD_256 0x05 +#define MTL_TX_THRESHOLD_384 0x06 +#define MTL_TX_THRESHOLD_512 0x07 + +#define MTL_ETSALG_WRR 0x00 +#define MTL_ETSALG_WFQ 0x01 +#define MTL_ETSALG_DWRR 0x02 +#define MTL_RAA_SP 0x00 +#define MTL_RAA_WSP 0x01 + +#define MTL_Q_DISABLED 0x00 +#define MTL_Q_ENABLED 0x02 + +/* MTL traffic class register offsets + * Multiple traffic classes can be active. The first class has registers + * that begin at 0x1100. Each subsequent queue has registers that + * are accessed using an offset of 0x80 from the previous queue. + */ +#define MTL_TC_BASE MTL_Q_BASE +#define MTL_TC_INC MTL_Q_INC + +#define MTL_TC_ETSCR 0x10 +#define MTL_TC_ETSSR 0x14 +#define MTL_TC_QWR 0x18 + +/* MTL traffic class register entry bit positions and sizes */ +#define MTL_TC_ETSCR_TSA_INDEX 0 +#define MTL_TC_ETSCR_TSA_WIDTH 2 +#define MTL_TC_QWR_QW_INDEX 0 +#define MTL_TC_QWR_QW_WIDTH 21 + +/* MTL traffic class register value */ +#define MTL_TSA_SP 0x00 +#define MTL_TSA_ETS 0x02 + +/* PCS MMD select register offset + * The MMD select register is used for accessing PCS registers + * when the underlying APB3 interface is using indirect addressing. + * Indirect addressing requires accessing registers in two phases, + * an address phase and a data phase. The address phases requires + * writing an address selection value to the MMD select regiesters. + */ +#define PCS_MMD_SELECT 0xff + +/* SerDes integration register offsets */ +#define SIR0_KR_RT_1 0x002c +#define SIR0_STATUS 0x0040 +#define SIR1_SPEED 0x0000 + +/* SerDes integration register entry bit positions and sizes */ +#define SIR0_KR_RT_1_RESET_INDEX 11 +#define SIR0_KR_RT_1_RESET_WIDTH 1 +#define SIR0_STATUS_RX_READY_INDEX 0 +#define SIR0_STATUS_RX_READY_WIDTH 1 +#define SIR0_STATUS_TX_READY_INDEX 8 +#define SIR0_STATUS_TX_READY_WIDTH 1 +#define SIR1_SPEED_CDR_RATE_INDEX 12 +#define SIR1_SPEED_CDR_RATE_WIDTH 4 +#define SIR1_SPEED_DATARATE_INDEX 4 +#define SIR1_SPEED_DATARATE_WIDTH 2 +#define SIR1_SPEED_PLLSEL_INDEX 3 +#define SIR1_SPEED_PLLSEL_WIDTH 1 +#define SIR1_SPEED_RATECHANGE_INDEX 6 +#define SIR1_SPEED_RATECHANGE_WIDTH 1 +#define SIR1_SPEED_TXAMP_INDEX 8 +#define SIR1_SPEED_TXAMP_WIDTH 4 +#define SIR1_SPEED_WORDMODE_INDEX 0 +#define SIR1_SPEED_WORDMODE_WIDTH 3 + +/* SerDes RxTx register offsets */ +#define RXTX_REG6 0x0018 +#define RXTX_REG20 0x0050 +#define RXTX_REG22 0x0058 +#define RXTX_REG114 0x01c8 +#define RXTX_REG129 0x0204 + +/* SerDes RxTx register entry bit positions and sizes */ +#define RXTX_REG6_RESETB_RXD_INDEX 8 +#define RXTX_REG6_RESETB_RXD_WIDTH 1 +#define RXTX_REG20_BLWC_ENA_INDEX 2 +#define RXTX_REG20_BLWC_ENA_WIDTH 1 +#define RXTX_REG114_PQ_REG_INDEX 9 +#define RXTX_REG114_PQ_REG_WIDTH 7 +#define RXTX_REG129_RXDFE_CONFIG_INDEX 14 +#define RXTX_REG129_RXDFE_CONFIG_WIDTH 2 + +/* Descriptor/Packet entry bit positions and sizes */ +#define RX_PACKET_ERRORS_CRC_INDEX 2 +#define RX_PACKET_ERRORS_CRC_WIDTH 1 +#define RX_PACKET_ERRORS_FRAME_INDEX 3 +#define RX_PACKET_ERRORS_FRAME_WIDTH 1 +#define RX_PACKET_ERRORS_LENGTH_INDEX 0 +#define RX_PACKET_ERRORS_LENGTH_WIDTH 1 +#define RX_PACKET_ERRORS_OVERRUN_INDEX 1 +#define RX_PACKET_ERRORS_OVERRUN_WIDTH 1 + +#define RX_PACKET_ATTRIBUTES_CSUM_DONE_INDEX 0 +#define RX_PACKET_ATTRIBUTES_CSUM_DONE_WIDTH 1 +#define RX_PACKET_ATTRIBUTES_VLAN_CTAG_INDEX 1 +#define RX_PACKET_ATTRIBUTES_VLAN_CTAG_WIDTH 1 +#define RX_PACKET_ATTRIBUTES_INCOMPLETE_INDEX 2 +#define RX_PACKET_ATTRIBUTES_INCOMPLETE_WIDTH 1 +#define RX_PACKET_ATTRIBUTES_CONTEXT_NEXT_INDEX 3 +#define RX_PACKET_ATTRIBUTES_CONTEXT_NEXT_WIDTH 1 +#define RX_PACKET_ATTRIBUTES_CONTEXT_INDEX 4 +#define RX_PACKET_ATTRIBUTES_CONTEXT_WIDTH 1 +#define RX_PACKET_ATTRIBUTES_RX_TSTAMP_INDEX 5 +#define RX_PACKET_ATTRIBUTES_RX_TSTAMP_WIDTH 1 +#define RX_PACKET_ATTRIBUTES_RSS_HASH_INDEX 6 +#define RX_PACKET_ATTRIBUTES_RSS_HASH_WIDTH 1 + +#define RX_NORMAL_DESC0_OVT_INDEX 0 +#define RX_NORMAL_DESC0_OVT_WIDTH 16 +#define RX_NORMAL_DESC2_HL_INDEX 0 +#define RX_NORMAL_DESC2_HL_WIDTH 10 +#define RX_NORMAL_DESC3_CDA_INDEX 27 +#define RX_NORMAL_DESC3_CDA_WIDTH 1 +#define RX_NORMAL_DESC3_CTXT_INDEX 30 +#define RX_NORMAL_DESC3_CTXT_WIDTH 1 +#define RX_NORMAL_DESC3_ES_INDEX 15 +#define RX_NORMAL_DESC3_ES_WIDTH 1 +#define RX_NORMAL_DESC3_ETLT_INDEX 16 +#define RX_NORMAL_DESC3_ETLT_WIDTH 4 +#define RX_NORMAL_DESC3_FD_INDEX 29 +#define RX_NORMAL_DESC3_FD_WIDTH 1 +#define RX_NORMAL_DESC3_INTE_INDEX 30 +#define RX_NORMAL_DESC3_INTE_WIDTH 1 +#define RX_NORMAL_DESC3_L34T_INDEX 20 +#define RX_NORMAL_DESC3_L34T_WIDTH 4 +#define RX_NORMAL_DESC3_LD_INDEX 28 +#define RX_NORMAL_DESC3_LD_WIDTH 1 +#define RX_NORMAL_DESC3_OWN_INDEX 31 +#define RX_NORMAL_DESC3_OWN_WIDTH 1 +#define RX_NORMAL_DESC3_PL_INDEX 0 +#define RX_NORMAL_DESC3_PL_WIDTH 14 +#define RX_NORMAL_DESC3_RSV_INDEX 26 +#define RX_NORMAL_DESC3_RSV_WIDTH 1 + +#define RX_DESC3_L34T_IPV4_TCP 1 +#define RX_DESC3_L34T_IPV4_UDP 2 +#define RX_DESC3_L34T_IPV4_ICMP 3 +#define RX_DESC3_L34T_IPV6_TCP 9 +#define RX_DESC3_L34T_IPV6_UDP 10 +#define RX_DESC3_L34T_IPV6_ICMP 11 + +#define RX_CONTEXT_DESC3_TSA_INDEX 4 +#define RX_CONTEXT_DESC3_TSA_WIDTH 1 +#define RX_CONTEXT_DESC3_TSD_INDEX 6 +#define RX_CONTEXT_DESC3_TSD_WIDTH 1 + +#define TX_PACKET_ATTRIBUTES_CSUM_ENABLE_INDEX 0 +#define TX_PACKET_ATTRIBUTES_CSUM_ENABLE_WIDTH 1 +#define TX_PACKET_ATTRIBUTES_TSO_ENABLE_INDEX 1 +#define TX_PACKET_ATTRIBUTES_TSO_ENABLE_WIDTH 1 +#define TX_PACKET_ATTRIBUTES_VLAN_CTAG_INDEX 2 +#define TX_PACKET_ATTRIBUTES_VLAN_CTAG_WIDTH 1 +#define TX_PACKET_ATTRIBUTES_PTP_INDEX 3 +#define TX_PACKET_ATTRIBUTES_PTP_WIDTH 1 + +#define TX_CONTEXT_DESC2_MSS_INDEX 0 +#define TX_CONTEXT_DESC2_MSS_WIDTH 15 +#define TX_CONTEXT_DESC3_CTXT_INDEX 30 +#define TX_CONTEXT_DESC3_CTXT_WIDTH 1 +#define TX_CONTEXT_DESC3_TCMSSV_INDEX 26 +#define TX_CONTEXT_DESC3_TCMSSV_WIDTH 1 +#define TX_CONTEXT_DESC3_VLTV_INDEX 16 +#define TX_CONTEXT_DESC3_VLTV_WIDTH 1 +#define TX_CONTEXT_DESC3_VT_INDEX 0 +#define TX_CONTEXT_DESC3_VT_WIDTH 16 + +#define TX_NORMAL_DESC2_HL_B1L_INDEX 0 +#define TX_NORMAL_DESC2_HL_B1L_WIDTH 14 +#define TX_NORMAL_DESC2_IC_INDEX 31 +#define TX_NORMAL_DESC2_IC_WIDTH 1 +#define TX_NORMAL_DESC2_TTSE_INDEX 30 +#define TX_NORMAL_DESC2_TTSE_WIDTH 1 +#define TX_NORMAL_DESC2_VTIR_INDEX 14 +#define TX_NORMAL_DESC2_VTIR_WIDTH 2 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Feb 15 13:56:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BFEDCE06EC; Wed, 15 Feb 2017 13:56:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7A0E1C88; Wed, 15 Feb 2017 13:56:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FDu4WG059688; Wed, 15 Feb 2017 13:56:04 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FDu4u1059682; Wed, 15 Feb 2017 13:56:04 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201702151356.v1FDu4u1059682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Feb 2017 13:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313768 - in head/sys: arm64/conf conf dev/axgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 13:56:06 -0000 Author: andrew Date: Wed Feb 15 13:56:04 2017 New Revision: 313768 URL: https://svnweb.freebsd.org/changeset/base/313768 Log: Port the Linux AMX 10G network driver to FreeBSD as axgbe. It is unlikely we will import a newer version of the Linux code so the linuxkpi was not used. This is still missing 10G support, and multicast has not been tested. Reviewed by: gnn Obtained from: ABT Systems Ltd Sponsored by: SoftIron Inc Differential Revision: https://reviews.freebsd.org/D8549 Added: head/sys/dev/axgbe/if_axgbe.c (contents, props changed) head/sys/dev/axgbe/xgbe_osdep.h (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 head/sys/dev/axgbe/xgbe-common.h (contents, props changed) head/sys/dev/axgbe/xgbe-desc.c (contents, props changed) head/sys/dev/axgbe/xgbe-dev.c (contents, props changed) head/sys/dev/axgbe/xgbe-drv.c (contents, props changed) head/sys/dev/axgbe/xgbe-mdio.c (contents, props changed) head/sys/dev/axgbe/xgbe.h (contents, props changed) Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Feb 15 13:37:32 2017 (r313767) +++ head/sys/arm64/conf/GENERIC Wed Feb 15 13:56:04 2017 (r313768) @@ -119,6 +119,7 @@ options PCI_IOV # PCI SR-IOV support device mii device miibus # MII bus support device awg # Allwinner EMAC Gigabit Ethernet +device axgbe # AMD Opteron A1100 integrated NIC device em # Intel PRO/1000 Gigabit Ethernet Family device ix # Intel 10Gb Ethernet Family device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed Feb 15 13:37:32 2017 (r313767) +++ head/sys/conf/files.arm64 Wed Feb 15 13:56:04 2017 (r313768) @@ -146,6 +146,11 @@ crypto/blowfish/bf_enc.c optional crypto crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb dev/acpica/acpi_if.m optional acpi dev/ahci/ahci_generic.c optional ahci +dev/axgbe/if_axgbe.c optional axgbe +dev/axgbe/xgbe-desc.c optional axgbe +dev/axgbe/xgbe-dev.c optional axgbe +dev/axgbe/xgbe-drv.c optional axgbe +dev/axgbe/xgbe-mdio.c optional axgbe dev/cpufreq/cpufreq_dt.c optional cpufreq fdt dev/hwpmc/hwpmc_arm64.c optional hwpmc dev/hwpmc/hwpmc_arm64_md.c optional hwpmc Added: head/sys/dev/axgbe/if_axgbe.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/axgbe/if_axgbe.c Wed Feb 15 13:56:04 2017 (r313768) @@ -0,0 +1,619 @@ +/*- + * Copyright (c) 2016,2017 SoftIron Inc. + * All rights reserved. + * + * This software was developed by Andrew Turner under + * the sponsorship of SoftIron Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "miibus_if.h" + +#include "xgbe.h" +#include "xgbe-common.h" + +static device_probe_t axgbe_probe; +static device_attach_t axgbe_attach; + +struct axgbe_softc { + /* Must be first */ + struct xgbe_prv_data prv; + + uint8_t mac_addr[ETHER_ADDR_LEN]; + struct ifmedia media; +}; + +static struct ofw_compat_data compat_data[] = { + { "amd,xgbe-seattle-v1a", true }, + { NULL, false } +}; + +static struct resource_spec old_phy_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* Rx/Tx regs */ + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* Integration regs */ + { SYS_RES_MEMORY, 2, RF_ACTIVE }, /* Integration regs */ + { SYS_RES_IRQ, 0, RF_ACTIVE }, /* Interrupt */ + { -1, 0 } +}; + +static struct resource_spec old_mac_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* MAC regs */ + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* PCS regs */ + { SYS_RES_IRQ, 0, RF_ACTIVE }, /* Device interrupt */ + /* Per-channel interrupts */ + { SYS_RES_IRQ, 1, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 2, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 3, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 4, RF_ACTIVE | RF_OPTIONAL }, + { -1, 0 } +}; + +static struct resource_spec mac_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* MAC regs */ + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* PCS regs */ + { SYS_RES_MEMORY, 2, RF_ACTIVE }, /* Rx/Tx regs */ + { SYS_RES_MEMORY, 3, RF_ACTIVE }, /* Integration regs */ + { SYS_RES_MEMORY, 4, RF_ACTIVE }, /* Integration regs */ + { SYS_RES_IRQ, 0, RF_ACTIVE }, /* Device interrupt */ + /* Per-channel and auto-negotiation interrupts */ + { SYS_RES_IRQ, 1, RF_ACTIVE }, + { SYS_RES_IRQ, 2, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 3, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 4, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 5, RF_ACTIVE | RF_OPTIONAL }, + { -1, 0 } +}; + +MALLOC_DEFINE(M_AXGBE, "axgbe", "axgbe data"); + +static void +axgbe_init(void *p) +{ + struct axgbe_softc *sc; + struct ifnet *ifp; + + sc = p; + ifp = sc->prv.netdev; + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + return; + + ifp->if_drv_flags |= IFF_DRV_RUNNING; +} + +static int +axgbe_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data) +{ + struct axgbe_softc *sc = ifp->if_softc; + struct ifreq *ifr = (struct ifreq *)data; + int error; + + switch(command) { + case SIOCSIFMTU: + if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ETHERMTU_JUMBO) + error = EINVAL; + else + error = xgbe_change_mtu(ifp, ifr->ifr_mtu); + break; + case SIOCSIFFLAGS: + error = 0; + break; + case SIOCSIFMEDIA: + case SIOCGIFMEDIA: + error = ifmedia_ioctl(ifp, ifr, &sc->media, command); + break; + default: + error = ether_ioctl(ifp, command, data); + break; + } + + return (error); +} + +static void +axgbe_qflush(struct ifnet *ifp) +{ + + if_qflush(ifp); +} + +static int +axgbe_media_change(struct ifnet *ifp) +{ + struct axgbe_softc *sc; + int cur_media; + + sc = ifp->if_softc; + + sx_xlock(&sc->prv.an_mutex); + cur_media = sc->media.ifm_cur->ifm_media; + + switch (IFM_SUBTYPE(cur_media)) { + case IFM_10G_KR: + sc->prv.phy.speed = SPEED_10000; + sc->prv.phy.autoneg = AUTONEG_DISABLE; + break; + case IFM_2500_KX: + sc->prv.phy.speed = SPEED_2500; + sc->prv.phy.autoneg = AUTONEG_DISABLE; + break; + case IFM_1000_KX: + sc->prv.phy.speed = SPEED_1000; + sc->prv.phy.autoneg = AUTONEG_DISABLE; + break; + case IFM_AUTO: + sc->prv.phy.autoneg = AUTONEG_ENABLE; + break; + } + sx_xunlock(&sc->prv.an_mutex); + + return (-sc->prv.phy_if.phy_config_aneg(&sc->prv)); +} + +static void +axgbe_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + struct axgbe_softc *sc; + + sc = ifp->if_softc; + + ifmr->ifm_status = IFM_AVALID; + if (!sc->prv.phy.link) + return; + + ifmr->ifm_status |= IFM_ACTIVE; + ifmr->ifm_active = IFM_ETHER; + + if (sc->prv.phy.duplex == DUPLEX_FULL) + ifmr->ifm_active |= IFM_FDX; + else + ifmr->ifm_active |= IFM_HDX; + + switch (sc->prv.phy.speed) { + case SPEED_10000: + ifmr->ifm_active |= IFM_10G_KR; + break; + case SPEED_2500: + ifmr->ifm_active |= IFM_2500_KX; + break; + case SPEED_1000: + ifmr->ifm_active |= IFM_1000_KX; + break; + } +} + +static uint64_t +axgbe_get_counter(struct ifnet *ifp, ift_counter c) +{ + struct xgbe_prv_data *pdata = ifp->if_softc; + struct xgbe_mmc_stats *pstats = &pdata->mmc_stats; + + DBGPR("-->%s\n", __func__); + + pdata->hw_if.read_mmc_stats(pdata); + + switch(c) { + case IFCOUNTER_IPACKETS: + return (pstats->rxframecount_gb); + case IFCOUNTER_IERRORS: + return (pstats->rxframecount_gb - + pstats->rxbroadcastframes_g - + pstats->rxmulticastframes_g - + pstats->rxunicastframes_g); + case IFCOUNTER_OPACKETS: + return (pstats->txframecount_gb); + case IFCOUNTER_OERRORS: + return (pstats->txframecount_gb - pstats->txframecount_g); + case IFCOUNTER_IBYTES: + return (pstats->rxoctetcount_gb); + case IFCOUNTER_OBYTES: + return (pstats->txoctetcount_gb); + default: + return (if_get_counter_default(ifp, c)); + } +} + +static int +axgbe_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, "AMD 10 Gigabit Ethernet"); + return (BUS_PROBE_DEFAULT); +} + +static int +axgbe_get_optional_prop(device_t dev, phandle_t node, const char *name, + int *data, size_t len) +{ + + if (!OF_hasprop(node, name)) + return (-1); + + if (OF_getencprop(node, name, data, len) <= 0) { + device_printf(dev,"%s property is invalid\n", name); + return (ENXIO); + } + + return (0); +} + +static int +axgbe_attach(device_t dev) +{ + struct axgbe_softc *sc; + struct ifnet *ifp; + pcell_t phy_handle; + device_t phydev; + phandle_t node, phy_node; + struct resource *mac_res[11]; + struct resource *phy_res[4]; + ssize_t len; + int error, i, j; + + sc = device_get_softc(dev); + + node = ofw_bus_get_node(dev); + if (OF_getencprop(node, "phy-handle", &phy_handle, + sizeof(phy_handle)) <= 0) { + phy_node = node; + + if (bus_alloc_resources(dev, mac_spec, mac_res)) { + device_printf(dev, + "could not allocate phy resources\n"); + return (ENXIO); + } + + sc->prv.xgmac_res = mac_res[0]; + sc->prv.xpcs_res = mac_res[1]; + sc->prv.rxtx_res = mac_res[2]; + sc->prv.sir0_res = mac_res[3]; + sc->prv.sir1_res = mac_res[4]; + + sc->prv.dev_irq_res = mac_res[5]; + sc->prv.per_channel_irq = OF_hasprop(node, + XGBE_DMA_IRQS_PROPERTY); + for (i = 0, j = 6; j < nitems(mac_res) - 1 && + mac_res[j + 1] != NULL; i++, j++) { + if (sc->prv.per_channel_irq) { + sc->prv.chan_irq_res[i] = mac_res[j]; + } + } + + /* The last entry is the auto-negotiation interrupt */ + sc->prv.an_irq_res = mac_res[j]; + } else { + phydev = OF_device_from_xref(phy_handle); + phy_node = ofw_bus_get_node(phydev); + + if (bus_alloc_resources(phydev, old_phy_spec, phy_res)) { + device_printf(dev, + "could not allocate phy resources\n"); + return (ENXIO); + } + + if (bus_alloc_resources(dev, old_mac_spec, mac_res)) { + device_printf(dev, + "could not allocate mac resources\n"); + return (ENXIO); + } + + sc->prv.rxtx_res = phy_res[0]; + sc->prv.sir0_res = phy_res[1]; + sc->prv.sir1_res = phy_res[2]; + sc->prv.an_irq_res = phy_res[3]; + + sc->prv.xgmac_res = mac_res[0]; + sc->prv.xpcs_res = mac_res[1]; + sc->prv.dev_irq_res = mac_res[2]; + sc->prv.per_channel_irq = OF_hasprop(node, + XGBE_DMA_IRQS_PROPERTY); + if (sc->prv.per_channel_irq) { + for (i = 0, j = 3; i < nitems(sc->prv.chan_irq_res) && + mac_res[j] != NULL; i++, j++) { + sc->prv.chan_irq_res[i] = mac_res[j]; + } + } + } + + if ((len = OF_getproplen(node, "mac-address")) < 0) { + device_printf(dev, "No mac-address property\n"); + return (EINVAL); + } + + if (len != ETHER_ADDR_LEN) + return (EINVAL); + + OF_getprop(node, "mac-address", sc->mac_addr, ETHER_ADDR_LEN); + + sc->prv.netdev = ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + device_printf(dev, "Cannot alloc ifnet\n"); + return (ENXIO); + } + + sc->prv.dev = dev; + sc->prv.dmat = bus_get_dma_tag(dev); + sc->prv.phy.advertising = ADVERTISED_10000baseKR_Full | + ADVERTISED_1000baseKX_Full; + + + /* + * Read the needed properties from the phy node. + */ + + /* This is documented as optional, but Linux requires it */ + if (OF_getencprop(phy_node, XGBE_SPEEDSET_PROPERTY, &sc->prv.speed_set, + sizeof(sc->prv.speed_set)) <= 0) { + device_printf(dev, "%s property is missing\n", + XGBE_SPEEDSET_PROPERTY); + return (EINVAL); + } + + error = axgbe_get_optional_prop(dev, phy_node, XGBE_BLWC_PROPERTY, + sc->prv.serdes_blwc, sizeof(sc->prv.serdes_blwc)); + if (error > 0) { + return (error); + } else if (error < 0) { + sc->prv.serdes_blwc[0] = XGBE_SPEED_1000_BLWC; + sc->prv.serdes_blwc[1] = XGBE_SPEED_2500_BLWC; + sc->prv.serdes_blwc[2] = XGBE_SPEED_10000_BLWC; + } + + error = axgbe_get_optional_prop(dev, phy_node, XGBE_CDR_RATE_PROPERTY, + sc->prv.serdes_cdr_rate, sizeof(sc->prv.serdes_cdr_rate)); + if (error > 0) { + return (error); + } else if (error < 0) { + sc->prv.serdes_cdr_rate[0] = XGBE_SPEED_1000_CDR; + sc->prv.serdes_cdr_rate[1] = XGBE_SPEED_2500_CDR; + sc->prv.serdes_cdr_rate[2] = XGBE_SPEED_10000_CDR; + } + + error = axgbe_get_optional_prop(dev, phy_node, XGBE_PQ_SKEW_PROPERTY, + sc->prv.serdes_pq_skew, sizeof(sc->prv.serdes_pq_skew)); + if (error > 0) { + return (error); + } else if (error < 0) { + sc->prv.serdes_pq_skew[0] = XGBE_SPEED_1000_PQ; + sc->prv.serdes_pq_skew[1] = XGBE_SPEED_2500_PQ; + sc->prv.serdes_pq_skew[2] = XGBE_SPEED_10000_PQ; + } + + error = axgbe_get_optional_prop(dev, phy_node, XGBE_TX_AMP_PROPERTY, + sc->prv.serdes_tx_amp, sizeof(sc->prv.serdes_tx_amp)); + if (error > 0) { + return (error); + } else if (error < 0) { + sc->prv.serdes_tx_amp[0] = XGBE_SPEED_1000_TXAMP; + sc->prv.serdes_tx_amp[1] = XGBE_SPEED_2500_TXAMP; + sc->prv.serdes_tx_amp[2] = XGBE_SPEED_10000_TXAMP; + } + + error = axgbe_get_optional_prop(dev, phy_node, XGBE_DFE_CFG_PROPERTY, + sc->prv.serdes_dfe_tap_cfg, sizeof(sc->prv.serdes_dfe_tap_cfg)); + if (error > 0) { + return (error); + } else if (error < 0) { + sc->prv.serdes_dfe_tap_cfg[0] = XGBE_SPEED_1000_DFE_TAP_CONFIG; + sc->prv.serdes_dfe_tap_cfg[1] = XGBE_SPEED_2500_DFE_TAP_CONFIG; + sc->prv.serdes_dfe_tap_cfg[2] = XGBE_SPEED_10000_DFE_TAP_CONFIG; + } + + error = axgbe_get_optional_prop(dev, phy_node, XGBE_DFE_ENA_PROPERTY, + sc->prv.serdes_dfe_tap_ena, sizeof(sc->prv.serdes_dfe_tap_ena)); + if (error > 0) { + return (error); + } else if (error < 0) { + sc->prv.serdes_dfe_tap_ena[0] = XGBE_SPEED_1000_DFE_TAP_ENABLE; + sc->prv.serdes_dfe_tap_ena[1] = XGBE_SPEED_2500_DFE_TAP_ENABLE; + sc->prv.serdes_dfe_tap_ena[2] = XGBE_SPEED_10000_DFE_TAP_ENABLE; + } + + /* Check if the NIC is DMA coherent */ + sc->prv.coherent = OF_hasprop(node, "dma-coherent"); + if (sc->prv.coherent) { + sc->prv.axdomain = XGBE_DMA_OS_AXDOMAIN; + sc->prv.arcache = XGBE_DMA_OS_ARCACHE; + sc->prv.awcache = XGBE_DMA_OS_AWCACHE; + } else { + sc->prv.axdomain = XGBE_DMA_SYS_AXDOMAIN; + sc->prv.arcache = XGBE_DMA_SYS_ARCACHE; + sc->prv.awcache = XGBE_DMA_SYS_AWCACHE; + } + + /* Create the lock & workqueues */ + spin_lock_init(&sc->prv.xpcs_lock); + sc->prv.dev_workqueue = taskqueue_create("axgbe", M_WAITOK, + taskqueue_thread_enqueue, &sc->prv.dev_workqueue); + taskqueue_start_threads(&sc->prv.dev_workqueue, 1, PI_NET, + "axgbe taskq"); + + /* Set the needed pointers */ + xgbe_init_function_ptrs_phy(&sc->prv.phy_if); + xgbe_init_function_ptrs_dev(&sc->prv.hw_if); + xgbe_init_function_ptrs_desc(&sc->prv.desc_if); + + /* Reset the hardware */ + sc->prv.hw_if.exit(&sc->prv); + + /* Read the hardware features */ + xgbe_get_all_hw_features(&sc->prv); + + /* Set default values */ + sc->prv.pblx8 = DMA_PBL_X8_ENABLE; + sc->prv.tx_desc_count = XGBE_TX_DESC_CNT; + sc->prv.tx_sf_mode = MTL_TSF_ENABLE; + sc->prv.tx_threshold = MTL_TX_THRESHOLD_64; + sc->prv.tx_pbl = DMA_PBL_16; + sc->prv.tx_osp_mode = DMA_OSP_ENABLE; + sc->prv.rx_desc_count = XGBE_RX_DESC_CNT; + sc->prv.rx_sf_mode = MTL_RSF_DISABLE; + sc->prv.rx_threshold = MTL_RX_THRESHOLD_64; + sc->prv.rx_pbl = DMA_PBL_16; + sc->prv.pause_autoneg = 1; + sc->prv.tx_pause = 1; + sc->prv.rx_pause = 1; + sc->prv.phy_speed = SPEED_UNKNOWN; + sc->prv.power_down = 0; + + /* TODO: Limit to min(ncpus, hw rings) */ + sc->prv.tx_ring_count = 1; + sc->prv.tx_q_count = 1; + sc->prv.rx_ring_count = 1; + sc->prv.rx_q_count = sc->prv.hw_feat.rx_q_cnt; + + /* Init the PHY */ + sc->prv.phy_if.phy_init(&sc->prv); + + /* Set the coalescing */ + xgbe_init_rx_coalesce(&sc->prv); + xgbe_init_tx_coalesce(&sc->prv); + + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + ifp->if_init = axgbe_init; + ifp->if_softc = sc; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_ioctl = axgbe_ioctl; + ifp->if_transmit = xgbe_xmit; + ifp->if_qflush = axgbe_qflush; + ifp->if_get_counter = axgbe_get_counter; + + /* TODO: Support HW offload */ + ifp->if_capabilities = 0; + ifp->if_capenable = 0; + ifp->if_hwassist = 0; + + ether_ifattach(ifp, sc->mac_addr); + + ifmedia_init(&sc->media, IFM_IMASK, axgbe_media_change, + axgbe_media_status); +#ifdef notyet + ifmedia_add(&sc->media, IFM_ETHER | IFM_10G_KR, 0, NULL); +#endif + ifmedia_add(&sc->media, IFM_ETHER | IFM_1000_KX, 0, NULL); + ifmedia_add(&sc->media, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_set(&sc->media, IFM_ETHER | IFM_AUTO); + + set_bit(XGBE_DOWN, &sc->prv.dev_state); + + if (xgbe_open(ifp) < 0) { + device_printf(dev, "ndo_open failed\n"); + return (ENXIO); + } + + return (0); +} + +static device_method_t axgbe_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, axgbe_probe), + DEVMETHOD(device_attach, axgbe_attach), + + { 0, 0 } +}; + +static devclass_t axgbe_devclass; + +DEFINE_CLASS_0(axgbe, axgbe_driver, axgbe_methods, + sizeof(struct axgbe_softc)); +DRIVER_MODULE(axgbe, simplebus, axgbe_driver, axgbe_devclass, 0, 0); + + +static struct ofw_compat_data phy_compat_data[] = { + { "amd,xgbe-phy-seattle-v1a", true }, + { NULL, false } +}; + +static int +axgbephy_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, phy_compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, "AMD 10 Gigabit Ethernet"); + return (BUS_PROBE_DEFAULT); +} + +static int +axgbephy_attach(device_t dev) +{ + phandle_t node; + + node = ofw_bus_get_node(dev); + OF_device_register_xref(OF_xref_from_node(node), dev); + + return (0); +} + +static device_method_t axgbephy_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, axgbephy_probe), + DEVMETHOD(device_attach, axgbephy_attach), + + { 0, 0 } +}; + +static devclass_t axgbephy_devclass; + +DEFINE_CLASS_0(axgbephy, axgbephy_driver, axgbephy_methods, 0); +EARLY_DRIVER_MODULE(axgbephy, simplebus, axgbephy_driver, axgbephy_devclass, + 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/dev/axgbe/xgbe-common.h ============================================================================== --- head/sys/dev/axgbe/xgbe-common.h Wed Feb 15 13:37:32 2017 (r313767) +++ head/sys/dev/axgbe/xgbe-common.h Wed Feb 15 13:56:04 2017 (r313768) @@ -112,11 +112,16 @@ * 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 __XGBE_COMMON_H__ #define __XGBE_COMMON_H__ +#include +#include + /* DMA register offsets */ #define DMA_MR 0x3000 #define DMA_SBMR 0x3004 @@ -1123,7 +1128,7 @@ do { \ * register definitions formed using the input names */ #define XGMAC_IOREAD(_pdata, _reg) \ - ioread32((_pdata)->xgmac_regs + _reg) + bus_read_4((_pdata)->xgmac_res, _reg) #define XGMAC_IOREAD_BITS(_pdata, _reg, _field) \ GET_BITS(XGMAC_IOREAD((_pdata), _reg), \ @@ -1131,7 +1136,7 @@ do { \ _reg##_##_field##_WIDTH) #define XGMAC_IOWRITE(_pdata, _reg, _val) \ - iowrite32((_val), (_pdata)->xgmac_regs + _reg) + bus_write_4((_pdata)->xgmac_res, _reg, (_val)) #define XGMAC_IOWRITE_BITS(_pdata, _reg, _field, _val) \ do { \ @@ -1147,7 +1152,7 @@ do { \ * base register value is calculated by the queue or traffic class number */ #define XGMAC_MTL_IOREAD(_pdata, _n, _reg) \ - ioread32((_pdata)->xgmac_regs + \ + bus_read_4((_pdata)->xgmac_res, \ MTL_Q_BASE + ((_n) * MTL_Q_INC) + _reg) #define XGMAC_MTL_IOREAD_BITS(_pdata, _n, _reg, _field) \ @@ -1156,8 +1161,8 @@ do { \ _reg##_##_field##_WIDTH) #define XGMAC_MTL_IOWRITE(_pdata, _n, _reg, _val) \ - iowrite32((_val), (_pdata)->xgmac_regs + \ - MTL_Q_BASE + ((_n) * MTL_Q_INC) + _reg) + bus_write_4((_pdata)->xgmac_res, \ + MTL_Q_BASE + ((_n) * MTL_Q_INC) + _reg, (_val)) #define XGMAC_MTL_IOWRITE_BITS(_pdata, _n, _reg, _field, _val) \ do { \ @@ -1173,7 +1178,7 @@ do { \ * base register value is obtained from the ring */ #define XGMAC_DMA_IOREAD(_channel, _reg) \ - ioread32((_channel)->dma_regs + _reg) + bus_space_read_4((_channel)->dma_tag, (_channel)->dma_handle, _reg) #define XGMAC_DMA_IOREAD_BITS(_channel, _reg, _field) \ GET_BITS(XGMAC_DMA_IOREAD((_channel), _reg), \ @@ -1181,7 +1186,8 @@ do { \ _reg##_##_field##_WIDTH) #define XGMAC_DMA_IOWRITE(_channel, _reg, _val) \ - iowrite32((_val), (_channel)->dma_regs + _reg) + bus_space_write_4((_channel)->dma_tag, (_channel)->dma_handle, \ + _reg, (_val)) #define XGMAC_DMA_IOWRITE_BITS(_channel, _reg, _field, _val) \ do { \ @@ -1196,10 +1202,10 @@ do { \ * within the register values of XPCS registers. */ #define XPCS_IOWRITE(_pdata, _off, _val) \ - iowrite32(_val, (_pdata)->xpcs_regs + (_off)) + bus_write_4((_pdata)->xpcs_res, (_off), _val) #define XPCS_IOREAD(_pdata, _off) \ - ioread32((_pdata)->xpcs_regs + (_off)) + bus_read_4((_pdata)->xpcs_res, (_off)) /* Macros for building, reading or writing register values or bits * within the register values of SerDes integration registers. @@ -1215,7 +1221,7 @@ do { \ _prefix##_##_field##_WIDTH, (_val)) #define XSIR0_IOREAD(_pdata, _reg) \ - ioread16((_pdata)->sir0_regs + _reg) + bus_read_2((_pdata)->sir0_res, _reg) #define XSIR0_IOREAD_BITS(_pdata, _reg, _field) \ GET_BITS(XSIR0_IOREAD((_pdata), _reg), \ @@ -1223,7 +1229,7 @@ do { \ _reg##_##_field##_WIDTH) #define XSIR0_IOWRITE(_pdata, _reg, _val) \ - iowrite16((_val), (_pdata)->sir0_regs + _reg) + bus_write_2((_pdata)->sir0_res, _reg, (_val)) #define XSIR0_IOWRITE_BITS(_pdata, _reg, _field, _val) \ do { \ @@ -1235,7 +1241,7 @@ do { \ } while (0) #define XSIR1_IOREAD(_pdata, _reg) \ - ioread16((_pdata)->sir1_regs + _reg) + bus_read_2((_pdata)->sir1_res, _reg) #define XSIR1_IOREAD_BITS(_pdata, _reg, _field) \ GET_BITS(XSIR1_IOREAD((_pdata), _reg), \ @@ -1243,7 +1249,7 @@ do { \ _reg##_##_field##_WIDTH) #define XSIR1_IOWRITE(_pdata, _reg, _val) \ - iowrite16((_val), (_pdata)->sir1_regs + _reg) + bus_write_2((_pdata)->sir1_res, _reg, (_val)) #define XSIR1_IOWRITE_BITS(_pdata, _reg, _field, _val) \ do { \ @@ -1258,7 +1264,7 @@ do { \ * within the register values of SerDes RxTx registers. */ #define XRXTX_IOREAD(_pdata, _reg) \ - ioread16((_pdata)->rxtx_regs + _reg) + bus_read_2((_pdata)->rxtx_res, _reg) #define XRXTX_IOREAD_BITS(_pdata, _reg, _field) \ GET_BITS(XRXTX_IOREAD((_pdata), _reg), \ @@ -1266,7 +1272,7 @@ do { \ _reg##_##_field##_WIDTH) #define XRXTX_IOWRITE(_pdata, _reg, _val) \ - iowrite16((_val), (_pdata)->rxtx_regs + _reg) + bus_write_2((_pdata)->rxtx_res, _reg, (_val)) #define XRXTX_IOWRITE_BITS(_pdata, _reg, _field, _val) \ do { \ Modified: head/sys/dev/axgbe/xgbe-desc.c ============================================================================== --- head/sys/dev/axgbe/xgbe-desc.c Wed Feb 15 13:37:32 2017 (r313767) +++ head/sys/dev/axgbe/xgbe-desc.c Wed Feb 15 13:56:04 2017 (r313768) @@ -114,6 +114,9 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include "xgbe.h" #include "xgbe-common.h" @@ -128,45 +131,29 @@ static void xgbe_free_ring(struct xgbe_p if (!ring) return; + bus_dmamap_destroy(ring->mbuf_dmat, ring->mbuf_map); + bus_dma_tag_destroy(ring->mbuf_dmat); + + ring->mbuf_map = NULL; + ring->mbuf_dmat = NULL; + if (ring->rdata) { for (i = 0; i < ring->rdesc_count; i++) { rdata = XGBE_GET_DESC_DATA(ring, i); xgbe_unmap_rdata(pdata, rdata); } - kfree(ring->rdata); + free(ring->rdata, M_AXGBE); ring->rdata = NULL; } - if (ring->rx_hdr_pa.pages) { - dma_unmap_page(pdata->dev, ring->rx_hdr_pa.pages_dma, - ring->rx_hdr_pa.pages_len, DMA_FROM_DEVICE); - put_page(ring->rx_hdr_pa.pages); - - ring->rx_hdr_pa.pages = NULL; - ring->rx_hdr_pa.pages_len = 0; - ring->rx_hdr_pa.pages_offset = 0; - ring->rx_hdr_pa.pages_dma = 0; - } - - if (ring->rx_buf_pa.pages) { - dma_unmap_page(pdata->dev, ring->rx_buf_pa.pages_dma, - ring->rx_buf_pa.pages_len, DMA_FROM_DEVICE); - put_page(ring->rx_buf_pa.pages); - - ring->rx_buf_pa.pages = NULL; - ring->rx_buf_pa.pages_len = 0; - ring->rx_buf_pa.pages_offset = 0; - ring->rx_buf_pa.pages_dma = 0; - } - - if (ring->rdesc) { - dma_free_coherent(pdata->dev, - (sizeof(struct xgbe_ring_desc) * - ring->rdesc_count), - ring->rdesc, ring->rdesc_dma); - ring->rdesc = NULL; - } + bus_dmamap_unload(ring->rdesc_dmat, ring->rdesc_map); + bus_dmamem_free(ring->rdesc_dmat, ring->rdesc, ring->rdesc_map); + bus_dma_tag_destroy(ring->rdesc_dmat); + + ring->rdesc_map = NULL; + ring->rdesc_dmat = NULL; + ring->rdesc = NULL; } static void xgbe_free_ring_resources(struct xgbe_prv_data *pdata) @@ -185,32 +172,71 @@ static void xgbe_free_ring_resources(str DBGPR("<--xgbe_free_ring_resources\n"); } +static void xgbe_ring_dmamap_cb(void *arg, bus_dma_segment_t * segs, int nseg, + int error) +{ + if (error) + return; + *(bus_addr_t *) arg = segs->ds_addr; +} + static int xgbe_init_ring(struct xgbe_prv_data *pdata, struct xgbe_ring *ring, unsigned int rdesc_count) { + bus_size_t len; + int err, flags; + DBGPR("-->xgbe_init_ring\n"); if (!ring) return 0; + flags = 0; + if (pdata->coherent) + flags = BUS_DMA_COHERENT; + /* Descriptors */ ring->rdesc_count = rdesc_count; - ring->rdesc = dma_alloc_coherent(pdata->dev, - (sizeof(struct xgbe_ring_desc) * - rdesc_count), &ring->rdesc_dma, - GFP_KERNEL); - if (!ring->rdesc) - return -ENOMEM; + len = sizeof(struct xgbe_ring_desc) * rdesc_count; + err = bus_dma_tag_create(pdata->dmat, 512, 0, BUS_SPACE_MAXADDR, + BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, flags, NULL, NULL, + &ring->rdesc_dmat); + if (err != 0) { + printf("Unable to create the DMA tag: %d\n", err); + return -err; + } + + err = bus_dmamem_alloc(ring->rdesc_dmat, (void **)&ring->rdesc, + BUS_DMA_WAITOK | BUS_DMA_COHERENT, &ring->rdesc_map); + if (err != 0) { + bus_dma_tag_destroy(ring->rdesc_dmat); + printf("Unable to allocate DMA memory: %d\n", err); + return -err; + } + err = bus_dmamap_load(ring->rdesc_dmat, ring->rdesc_map, ring->rdesc, + len, xgbe_ring_dmamap_cb, &ring->rdesc_paddr, 0); + if (err != 0) { + bus_dmamem_free(ring->rdesc_dmat, ring->rdesc, ring->rdesc_map); + bus_dma_tag_destroy(ring->rdesc_dmat); + printf("Unable to load DMA memory\n"); + return -err; + } /* Descriptor information */ - ring->rdata = kcalloc(rdesc_count, sizeof(struct xgbe_ring_data), - GFP_KERNEL); - if (!ring->rdata) - return -ENOMEM; - - netif_dbg(pdata, drv, pdata->netdev, - "rdesc=%p, rdesc_dma=%pad, rdata=%p\n", - ring->rdesc, &ring->rdesc_dma, ring->rdata); + ring->rdata = malloc(rdesc_count * sizeof(struct xgbe_ring_data), + M_AXGBE, M_WAITOK | M_ZERO); + + /* Create the space DMA tag for mbufs */ + err = bus_dma_tag_create(pdata->dmat, 1, 0, BUS_SPACE_MAXADDR, + BUS_SPACE_MAXADDR, NULL, NULL, XGBE_TX_MAX_BUF_SIZE * rdesc_count, + rdesc_count, XGBE_TX_MAX_BUF_SIZE, flags, NULL, NULL, + &ring->mbuf_dmat); + if (err != 0) + return -err; + + err = bus_dmamap_create(ring->mbuf_dmat, 0, &ring->mbuf_map); + if (err != 0) + return -err; DBGPR("<--xgbe_init_ring\n"); @@ -227,25 +253,17 @@ static int xgbe_alloc_ring_resources(str channel = pdata->channel; for (i = 0; i < pdata->channel_count; i++, channel++) { - netif_dbg(pdata, drv, pdata->netdev, "%s - Tx ring:\n", - channel->name); - ret = xgbe_init_ring(pdata, channel->tx_ring, pdata->tx_desc_count); if (ret) { - netdev_alert(pdata->netdev, - "error initializing Tx ring\n"); + printf("error initializing Tx ring\n"); goto err_ring; } - netif_dbg(pdata, drv, pdata->netdev, "%s - Rx ring:\n", - channel->name); - ret = xgbe_init_ring(pdata, channel->rx_ring, pdata->rx_desc_count); if (ret) { - netdev_alert(pdata->netdev, - "error initializing Rx ring\n"); + printf("error initializing Rx ring\n"); goto err_ring; } } @@ -260,93 +278,58 @@ err_ring: return ret; } -static int xgbe_alloc_pages(struct xgbe_prv_data *pdata, - struct xgbe_page_alloc *pa, gfp_t gfp, int order) -{ - struct page *pages = NULL; - dma_addr_t pages_dma; - int ret; - - /* Try to obtain pages, decreasing order if necessary */ - gfp |= __GFP_COLD | __GFP_COMP | __GFP_NOWARN; - while (order >= 0) { - pages = alloc_pages(gfp, order); - if (pages) - break; - - order--; - } - if (!pages) - return -ENOMEM; - - /* Map the pages */ - pages_dma = dma_map_page(pdata->dev, pages, 0, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Feb 15 14:12:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92B8DCE0B78; Wed, 15 Feb 2017 14:12:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 623FAA18; Wed, 15 Feb 2017 14:12:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FECdnK067741; Wed, 15 Feb 2017 14:12:39 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FECdYd067740; Wed, 15 Feb 2017 14:12:39 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201702151412.v1FECdYd067740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 15 Feb 2017 14:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313769 - head/sys/amd64/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 14:12:40 -0000 Author: trasz Date: Wed Feb 15 14:12:39 2017 New Revision: 313769 URL: https://svnweb.freebsd.org/changeset/base/313769 Log: Fix definition of linux64 ptrace syscall. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/amd64/linux/syscalls.master Modified: head/sys/amd64/linux/syscalls.master ============================================================================== --- head/sys/amd64/linux/syscalls.master Wed Feb 15 13:56:04 2017 (r313768) +++ head/sys/amd64/linux/syscalls.master Wed Feb 15 14:12:39 2017 (r313769) @@ -219,7 +219,7 @@ 99 AUE_NULL STD { int linux_sysinfo(struct l_sysinfo *info); } 100 AUE_NULL STD { int linux_times(struct l_times_argv *buf); } 101 AUE_PTRACE STD { int linux_ptrace(l_long req, l_long pid, \ - l_long addr, l_long data); } + l_ulong addr, l_ulong data); } 102 AUE_GETUID STD { int linux_getuid(void); } 103 AUE_NULL STD { int linux_syslog(l_int type, char *buf, \ l_int len); } From owner-svn-src-head@freebsd.org Wed Feb 15 14:18:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DDAECE0D80; Wed, 15 Feb 2017 14:18:00 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 1F1A9E35; Wed, 15 Feb 2017 14:17:59 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (global-5-144.nat-2.net.cam.ac.uk [131.111.5.144]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 06A6DD8BB6; Wed, 15 Feb 2017 14:11:26 +0000 (UTC) Date: Wed, 15 Feb 2017 14:17:27 +0000 From: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313768 - in head/sys: arm64/conf conf dev/axgbe Message-ID: <20170215141727.6be2d586@zapp> In-Reply-To: <201702151356.v1FDu4u1059682@repo.freebsd.org> References: <201702151356.v1FDu4u1059682@repo.freebsd.org> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 14:18:00 -0000 On Wed, 15 Feb 2017 13:56:04 +0000 (UTC) Andrew Turner wrote: > Author: andrew > Date: Wed Feb 15 13:56:04 2017 > New Revision: 313768 > URL: https://svnweb.freebsd.org/changeset/base/313768 > > Log: > Port the Linux AMX 10G network driver to FreeBSD as axgbe. It is > unlikely we will import a newer version of the Linux code so the > linuxkpi was not used. This should be "Port the Linux AMD 10G..." Andrew From owner-svn-src-head@freebsd.org Wed Feb 15 14:25:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE778CE0FB8; Wed, 15 Feb 2017 14:25:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71D481306; Wed, 15 Feb 2017 14:25:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FEPoXu071830; Wed, 15 Feb 2017 14:25:50 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FEPoYm071828; Wed, 15 Feb 2017 14:25:50 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201702151425.v1FEPoYm071828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 15 Feb 2017 14:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313770 - head/sys/amd64/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 14:25:51 -0000 Author: trasz Date: Wed Feb 15 14:25:50 2017 New Revision: 313770 URL: https://svnweb.freebsd.org/changeset/base/313770 Log: Regen after r313769. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/amd64/linux/linux_proto.h head/sys/amd64/linux/linux_systrace_args.c Modified: head/sys/amd64/linux/linux_proto.h ============================================================================== --- head/sys/amd64/linux/linux_proto.h Wed Feb 15 14:12:39 2017 (r313769) +++ head/sys/amd64/linux/linux_proto.h Wed Feb 15 14:25:50 2017 (r313770) @@ -423,8 +423,8 @@ struct linux_times_args { struct linux_ptrace_args { char req_l_[PADL_(l_long)]; l_long req; char req_r_[PADR_(l_long)]; char pid_l_[PADL_(l_long)]; l_long pid; char pid_r_[PADR_(l_long)]; - char addr_l_[PADL_(l_long)]; l_long addr; char addr_r_[PADR_(l_long)]; - char data_l_[PADL_(l_long)]; l_long data; char data_r_[PADR_(l_long)]; + char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; + char data_l_[PADL_(l_ulong)]; l_ulong data; char data_r_[PADR_(l_ulong)]; }; struct linux_getuid_args { register_t dummy; Modified: head/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- head/sys/amd64/linux/linux_systrace_args.c Wed Feb 15 14:12:39 2017 (r313769) +++ head/sys/amd64/linux/linux_systrace_args.c Wed Feb 15 14:25:50 2017 (r313770) @@ -874,8 +874,8 @@ systrace_args(int sysnum, void *params, struct linux_ptrace_args *p = params; iarg[0] = p->req; /* l_long */ iarg[1] = p->pid; /* l_long */ - iarg[2] = p->addr; /* l_long */ - iarg[3] = p->data; /* l_long */ + iarg[2] = p->addr; /* l_ulong */ + iarg[3] = p->data; /* l_ulong */ *n_args = 4; break; } @@ -3971,10 +3971,10 @@ systrace_entry_setargdesc(int sysnum, in p = "l_long"; break; case 2: - p = "l_long"; + p = "l_ulong"; break; case 3: - p = "l_long"; + p = "l_ulong"; break; default: break; From owner-svn-src-head@freebsd.org Wed Feb 15 14:34:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 790F4CDF21E; Wed, 15 Feb 2017 14:34:41 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3940B184D; Wed, 15 Feb 2017 14:34:41 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FEYeYL075994; Wed, 15 Feb 2017 14:34:40 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FEYejW075993; Wed, 15 Feb 2017 14:34:40 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201702151434.v1FEYejW075993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Wed, 15 Feb 2017 14:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313771 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 14:34:41 -0000 Author: royger Date: Wed Feb 15 14:34:40 2017 New Revision: 313771 URL: https://svnweb.freebsd.org/changeset/base/313771 Log: bxe: enable usage with NetXtreme II BCM57840 2x20GbE chip Current bxe probe function won't attach to devices with the NetXtreme II BCM57840 2x20GbE chip, enable it by adding it's chip ID to the list of supported chips. Tested on: HP ProLiant WS460c Gen9 Reviewed by: gnn MFC after: 1 week Sponsored by: Citrix Systems R&D Differential Revision: https://reviews.freebsd.org/D9609 Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Wed Feb 15 14:25:50 2017 (r313770) +++ head/sys/dev/bxe/bxe.c Wed Feb 15 14:34:40 2017 (r313771) @@ -168,6 +168,12 @@ static struct bxe_device_type bxe_devs[] }, { BRCM_VENDORID, + CHIP_NUM_57840_2_20, + PCI_ANY_ID, PCI_ANY_ID, + "QLogic NetXtreme II BCM57840 2x20GbE" + }, + { + BRCM_VENDORID, CHIP_NUM_57840_MF, PCI_ANY_ID, PCI_ANY_ID, "QLogic NetXtreme II BCM57840 MF 10GbE" From owner-svn-src-head@freebsd.org Wed Feb 15 14:56:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C216DCDFA9E; Wed, 15 Feb 2017 14:56:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EFD3694; Wed, 15 Feb 2017 14:56:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FEulWn084304; Wed, 15 Feb 2017 14:56:47 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FEulq5084303; Wed, 15 Feb 2017 14:56:47 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201702151456.v1FEulq5084303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 15 Feb 2017 14:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313772 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 14:56:48 -0000 Author: andrew Date: Wed Feb 15 14:56:47 2017 New Revision: 313772 URL: https://svnweb.freebsd.org/changeset/base/313772 Log: Load the new sp_el0 with interrupts disabled in fork_trampoline. If an interrupt arrives in fork_trampoline after sp_el0 was written we may then switch to a new thread, enter userland so change this stack pointer, then return to this code with the wrong value. This fixes this case by moving the load of sp_el0 until after interrupts have been disabled. Reported by: Mark Millard (markmi@dsl-only.net) Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D9593 Modified: head/sys/arm64/arm64/swtch.S Modified: head/sys/arm64/arm64/swtch.S ============================================================================== --- head/sys/arm64/arm64/swtch.S Wed Feb 15 14:34:40 2017 (r313771) +++ head/sys/arm64/arm64/swtch.S Wed Feb 15 14:56:47 2017 (r313772) @@ -241,11 +241,6 @@ ENTRY(fork_trampoline) mov fp, #0 /* Stack traceback stops here. */ bl _C_LABEL(fork_exit) - /* Restore sp and lr */ - ldp x0, x1, [sp] - msr sp_el0, x0 - mov lr, x1 - /* Restore the registers other than x0 and x1 */ ldp x2, x3, [sp, #TF_X + 2 * 8] ldp x4, x5, [sp, #TF_X + 4 * 8] @@ -261,14 +256,18 @@ ENTRY(fork_trampoline) ldp x24, x25, [sp, #TF_X + 24 * 8] ldp x26, x27, [sp, #TF_X + 26 * 8] ldp x28, x29, [sp, #TF_X + 28 * 8] - /* Skip x30 as it was restored above as lr */ /* * Disable interrupts to avoid - * overwriting spsr_el1 by an IRQ exception. + * overwriting spsr_el1 and sp_el0 by an IRQ exception. */ msr daifset, #2 + /* Restore sp and lr */ + ldp x0, x1, [sp] + msr sp_el0, x0 + mov lr, x1 + /* Restore elr and spsr */ ldp x0, x1, [sp, #16] msr elr_el1, x0 From owner-svn-src-head@freebsd.org Wed Feb 15 15:32:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B616CE0875; Wed, 15 Feb 2017 15:32:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18D02AF8; Wed, 15 Feb 2017 15:32:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FFWUok001728; Wed, 15 Feb 2017 15:32:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FFWU5J001727; Wed, 15 Feb 2017 15:32:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201702151532.v1FFWU5J001727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 15 Feb 2017 15:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313774 - head/contrib/tzcode/stdtime X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 15:32:31 -0000 Author: emaste Date: Wed Feb 15 15:32:29 2017 New Revision: 313774 URL: https://svnweb.freebsd.org/changeset/base/313774 Log: localtime: return NULL if time_t out of range of struct tm Previously we would truncate tm.tm_year for any time_t corresponding to a year that does not fit in int. This issue was discovered because it caused the bash-static build to fail when linking with LLD. As reported by Rafael Espíndola: Configure has AC_FUNC_MKTIME which expands to a test of mktime that fails with the freebsd implementation. Given that, bash compiles a mktime.o file that defines just mktime and uses localtime. That goes in a .a file that is before libc. The freebsd libc defines mktime in localtime.o, which also defines localtime among other functions. When lld sees an undefined reference to mktime from libc, it uses the bash provided one and then tries to find a definition of localtime. It is found on libc's localtime.o, but now we have a duplicated error. The reason it works with bfd is that bash doesn't use mktime directly and the undefined reference from libc is resolved to the libc implementation. It would also fail to link if bash itself directly used mktime. The bash-static configure test verifies that, for many values of t, either localtime(t) returns NULL or mktime(localtime(t)) == t. This test failed when localtime returned a truncated tm_year. This was fixed in tzcode in 2004 but has persisted in our tree since rS2708. Reported by: Rafael Espíndola Reviewed by: bapt MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9534 Modified: head/contrib/tzcode/stdtime/localtime.c Modified: head/contrib/tzcode/stdtime/localtime.c ============================================================================== --- head/contrib/tzcode/stdtime/localtime.c Wed Feb 15 15:18:43 2017 (r313773) +++ head/contrib/tzcode/stdtime/localtime.c Wed Feb 15 15:32:29 2017 (r313774) @@ -1453,14 +1453,13 @@ localtime(const time_t *const timep) } _RWLOCK_RDLOCK(&lcl_rwlock); tzset_basic(1); - localsub(timep, 0L, p_tm); + p_tm = localsub(timep, 0L, p_tm); _RWLOCK_UNLOCK(&lcl_rwlock); - return(p_tm); } else { tzset_basic(0); - localsub(timep, 0L, &tm); - return(&tm); + p_tm = localsub(timep, 0L, &tm); } + return(p_tm); } /* @@ -1472,7 +1471,7 @@ localtime_r(const time_t *const timep, s { _RWLOCK_RDLOCK(&lcl_rwlock); tzset_basic(1); - localsub(timep, 0L, tmp); + tmp = localsub(timep, 0L, tmp); _RWLOCK_UNLOCK(&lcl_rwlock); return tmp; } From owner-svn-src-head@freebsd.org Wed Feb 15 16:08:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E31A6CE01CA; Wed, 15 Feb 2017 16:08:41 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A76A91C56; Wed, 15 Feb 2017 16:08:41 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x22f.google.com with SMTP id j13so92334887iod.3; Wed, 15 Feb 2017 08:08:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=uGHMiBrCyr3NDRASb5g2/BQX2VeK1W9VT8VrsTXHSd0=; b=O2mwD6ztuSbmmhxg3clsuaZRqAxv9YR9DdcsRwArF9Mla/JH8ga+qKAEaT3/AlWgEP 54KsFTBecLTW0BQqxOtr1bYV2DOdqCcdf5hgx81bpnoZzSygfMV/F5G4bSbPEddKbkxU yjaV+RKTmiwDW/5sUMxALfsLdH27j8DZHd91QiDeEzdTNG5cqcU1XrwQ1OhsNVYej367 PyQ20WHumY4kFLzB/0ib1VHNOVDpKwoIq54zIlbAeBC9711wf5/mnujvZ7DCemg7BAE/ 0Z5QinkvvvO59V9SvJLbSdxJkAmGf8HWb7m2Gveue7HH6cIyq0aG6tj9fA4OUqtmXBlg Hiag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=uGHMiBrCyr3NDRASb5g2/BQX2VeK1W9VT8VrsTXHSd0=; b=SYjrMi0k1/1sGbNYdqkSF4+IdT6bphgUie4bQK6zcuy9CFOONtwU0fpFMCKyZCBwHM Vd39ecBPP3F/p43W2a/TYkFx2VKFAHTRMDk3NsQfVuFXbVXP6D3bL+9KmWOpuAMoLZ48 tTmR9xDZZL0vkt34NO+Kz47DszHwIKzPR68GFjECY7w/dVmUV7ZHz50RvBWZQy/Cub7j t2pDkyQVl1h8K4FYvrBwclKfCtfufPkP8uLH2hTNZGWJXko8Z151PiRwfe3hHvp9Q1Pd jim993FX0ZEQwzdnruw7mYnQPjKnd62BnD4jVywYcKbPFILCGRCiofASt2uo13dwHVUN 52rw== X-Gm-Message-State: AMke39nRD5+WoGXarbO7EJhtdbPFeghUVbLT/nI3XKVC+fY7nQmyQnsV4fY9aOtfpb/gRJC0auKrF0QSg+/IqQ== X-Received: by 10.107.142.195 with SMTP id q186mr26105764iod.169.1487174921035; Wed, 15 Feb 2017 08:08:41 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.39.17 with HTTP; Wed, 15 Feb 2017 08:08:20 -0800 (PST) In-Reply-To: <201702150759.v1F7xtKZ013952@repo.freebsd.org> References: <201702150759.v1F7xtKZ013952@repo.freebsd.org> From: Ed Maste Date: Wed, 15 Feb 2017 11:08:20 -0500 X-Google-Sender-Auth: K5EZOXGNres2wsrRVpMMA8GZgfU Message-ID: Subject: Re: svn commit: r313761 - in head/lib/msun: . src To: Mahdi Mokhtari Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 16:08:42 -0000 On 15 February 2017 at 02:59, Mahdi Mokhtari wrote: > Author: mmokhi (ports committer) > Date: Wed Feb 15 07:59:54 2017 > New Revision: 313761 > URL: https://svnweb.freebsd.org/changeset/base/313761 > > Log: > Add casinl() cacosl() catanl() casinhl() cacoshl() catanhl() APIs to msun > to improve C11 conformance. This breaks the build on at least mips: /scratch/tmp/emaste/freebsd/lib/msun/src/catrigl.c:48:21: error: invtrig.h: No such file or directory /scratch/tmp/emaste/freebsd/lib/msun/src/catrigl.c:85:2: error: #error "Unsupported long double format" ... From owner-svn-src-head@freebsd.org Wed Feb 15 16:20:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74EAFCE04DB; Wed, 15 Feb 2017 16:20:07 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 359D0261; Wed, 15 Feb 2017 16:20:07 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x235.google.com with SMTP id x75so66035003itb.0; Wed, 15 Feb 2017 08:20:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=0PdaB36V635Y+piE79mVPVp1t1fAdG2QJRVtoIzx3EQ=; b=KLvKbdGpXi4Ge+cXA0byAHDG19Xar2ZaIayOpyrXgxAGym575vbsJIaGIhqTFImDUm 7h2+iVw7SNAO+djFJBzUZaLz6lD81xMIcBHPhOp+EV4nix8fsqSuUyD+ZdQdu+0mJu8h iNNEaqzkOEJeNFTJ8bhw4J7ZZ01a8zZT/x8L48j0KaIYgOk+JttWxQt6jF8kmeSWxidu ACyGeRdsCdiJgFcn5ipp85YdI52pRCf2QLebmAWpjn+W/edSnnHeh4UD81T2kiDu7/qG Co5IEwixKwHv8eq7CyJvhBvPn+8HOOA4gStMAkE41uBRm4+bW9z5W0Re3Dq8WSrAq9Nl M6Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=0PdaB36V635Y+piE79mVPVp1t1fAdG2QJRVtoIzx3EQ=; b=PIYSO3boDKxlFv6jcY14w2fUaub2OJZLyAD+TVTdKw1VEqLrjT4R6RjTzpPSZboVJm Qz0LX1LTZtA/jLLZrlAhes6Uxv+B5GFhEvt/2Qlo2d1UaaK6ZpG/Btxf2f9mbxT+R7yp 0H3I00DopfGwvqu6Bp61ruXP9CUk7dHWPmktkYOYqx5DI2ArmKaqpdRKy87NLfsvcggi s6sr072Rr+x6dp2j4bhJYWonuyNRnV6FAj/bRoDnzOd4IsAOGgF42MghC7Zq4S8BKHPJ qBzF0dKPEd5s2fpF49w9tXeoXh4ml/JitMF3fNkIUxmg1hOVS3wkm+VggyBmbGdUpvme dfbA== X-Gm-Message-State: AMke39lsZndSwIVxJYvq8xz5e3DiKz1KgDnfnt8D4m0Re34nUojVj2KKiEX5NuafrvzAWgqI7ziCDldcXdcfZA== X-Received: by 10.36.118.138 with SMTP id z132mr9381508itb.108.1487175606477; Wed, 15 Feb 2017 08:20:06 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.39.17 with HTTP; Wed, 15 Feb 2017 08:19:46 -0800 (PST) In-Reply-To: <201702101328.v1ADSVDV071984@repo.freebsd.org> References: <201702101328.v1ADSVDV071984@repo.freebsd.org> From: Ed Maste Date: Wed, 15 Feb 2017 11:19:46 -0500 X-Google-Sender-Auth: e5OXXxj9pnGVz_Vkh2wo4gKwAE8 Message-ID: Subject: Re: svn commit: r313547 - head/sys/dev/vt To: Aleksandr Rybalko Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 16:20:07 -0000 On 10 February 2017 at 08:28, Aleksandr Rybalko wrote: > Author: ray > Date: Fri Feb 10 13:28:30 2017 > New Revision: 313547 > URL: https://svnweb.freebsd.org/changeset/base/313547 sparc64 LINT kernel build failed with: cc1: warnings being treated as errors /scratch/tmp/emaste/freebsd/sys/dev/vt/vt_buf.c:198: warning: 'vtbuf_htw' defined but not used *** [vt_buf.o] Error code 1 From owner-svn-src-head@freebsd.org Wed Feb 15 16:46:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C18F0CE0C52; Wed, 15 Feb 2017 16:46:03 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54DD61643; Wed, 15 Feb 2017 16:46:03 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-wm0-x242.google.com with SMTP id r18so9108252wmd.3; Wed, 15 Feb 2017 08:46:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=ymUOytC/VvzYSrKdIcuwDKcucO6RiNfMhyRW9JwI1jk=; b=nOIZ4rUFwRCzgPYZ5gSP7OpfS4QN0XvXhsxvK60PxFL505EjAlR3LpkkeA89CQjgmm 1Ant3Wqtx4IipwhWrrpuo4Tt8QRuqJKzxSDh8k1TEQ+uMIXB8Fi2roAehzeGfRCk//jp f87so3Y2+9Ty8+26C6ocAiSLPgqLmt6jKcRlUW5+HeF9kgLuUIfPmDejtQj9CMST4LQS +mcKaaTNanSSOFqTZW9984GYKQMXW3L7IPgwJVl3/he49AQCesS8nZo/2JcYqJYEQWQa 5aebzSmNVNRvwdNFgFmn6zwV4gcNG5fraBDnizkXRqK04YIet1SWXy6LaQxn295zSjCy s/PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=ymUOytC/VvzYSrKdIcuwDKcucO6RiNfMhyRW9JwI1jk=; b=lbC/W6Q2PPatDowVYSOY099WF0EmMamcDvfi5feVLqqOS5GIrjRqKMSQ1DHLqd0tHX olBluB0Wy3NcdWW5ZnvESRJHwmf+3EbaGVlFLkRd8KPyjBaZrPrMjoJa/oq4HLbc4dzw ALfH/rvQ+eQMk7In23b3frpKozAz9NM1GBb6saOe/FlXlSp+/PQSA1UpEaEZoSkADK2e XeJ53VXOZLQjyd0j/Wh/2AcREqhwj8hncwzjPsjCL6lkORuIssDKWOdU5H5+22uC09nn PMXxSYFmI8/LPQn/29ZBD6ngtvpNoHnPpV/DvHHIWb4dcktXC0UhVI/c6tzcA0DYi/AI ttyQ== X-Gm-Message-State: AMke39nXLylTayieS5Kbf1GtfFPxaJsIzbtkMqRt19enybPih4Hn2GYMvT6Qm4ZW33dy2A== X-Received: by 10.28.17.133 with SMTP id 127mr8615775wmr.80.1487177160491; Wed, 15 Feb 2017 08:46:00 -0800 (PST) Received: from localhost (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id o2sm5521308wra.42.2017.02.15.08.45.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Feb 2017 08:45:59 -0800 (PST) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Date: Wed, 15 Feb 2017 16:45:55 +0000 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: davidch@FreeBSD.org, edavis@broadcom.com, davidch@broadcom.com, zambrano@broadcom.com Subject: Re: svn commit: r313771 - head/sys/dev/bxe Message-ID: <20170215164555.hvhpsh5s57ukf323@dhcp-3-221.uk.xensource.com> References: <201702151434.v1FEYejW075993@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201702151434.v1FEYejW075993@repo.freebsd.org> User-Agent: NeoMutt/20170206 (1.7.2) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 16:46:03 -0000 On Wed, Feb 15, 2017 at 02:34:40PM +0000, Roger Pau Monné wrote: > Author: royger > Date: Wed Feb 15 14:34:40 2017 > New Revision: 313771 > URL: https://svnweb.freebsd.org/changeset/base/313771 > > Log: > bxe: enable usage with NetXtreme II BCM57840 2x20GbE chip FWIW, I see the following message at boot: bxe0: mem 0x93800000-0x93ffffff,0x93000000-0x937fffff,0x95000000-0x9500ffff irq 16 at device 0.0 numa-domain 0 on pci5 bxe0: PCI BAR0 [10] memory allocated: 0x93800000-0x93ffffff (8388608) -> 0xfffff80093800000 bxe0: PCI BAR2 [18] memory allocated: 0x93000000-0x937fffff (8388608) -> 0xfffff80093000000 bxe0: PCI BAR4 [20] memory allocated: 0x95000000-0x9500ffff (65536) -> 0xfffff80095000000 bxe0: ERROR: Invalid config for Switch Dependent mode bxe0: Found 10GBase-CX4 media. bxe0: Using defaults for TSO: 65518/35/2048 bxe0: bpf attached bxe0: Ethernet address: 5c:b9:01:da:XX:XX bxe0: attempting to allocate 5 MSI-X vectors (32 supported) msi: routing MSI-X IRQ 264 to local APIC 34 vector 48 msi: routing MSI-X IRQ 265 to local APIC 36 vector 48 msi: routing MSI-X IRQ 266 to local APIC 38 vector 48 msi: routing MSI-X IRQ 267 to local APIC 40 vector 48 msi: routing MSI-X IRQ 268 to local APIC 48 vector 48 bxe0: using IRQs 264-268 for MSI-X bxe0: MSI-X vectors Requested 5 and Allocated 5 random: harvesting attach, 8 bytes (4 bits) from bxe0 bxe1: mem 0x94800000-0x94ffffff,0x94000000-0x947fffff,0x95010000-0x9501ffff irq 17 at device 0.1 numa-domain 0 on pci5 bxe1: PCI BAR0 [10] memory allocated: 0x94800000-0x94ffffff (8388608) -> 0xfffff80094800000 bxe1: PCI BAR2 [18] memory allocated: 0x94000000-0x947fffff (8388608) -> 0xfffff80094000000 bxe1: PCI BAR4 [20] memory allocated: 0x95010000-0x9501ffff (65536) -> 0xfffff80095010000 bxe1: ERROR: Invalid config for Switch Dependent mode bxe1: Found 10GBase-CX4 media. bxe1: Using defaults for TSO: 65518/35/2048 bxe1: bpf attached bxe1: Ethernet address: 5c:b9:01:da:XX:XX bxe1: attempting to allocate 5 MSI-X vectors (32 supported) msi: routing MSI-X IRQ 269 to local APIC 50 vector 48 msi: routing MSI-X IRQ 270 to local APIC 52 vector 48 msi: routing MSI-X IRQ 271 to local APIC 54 vector 48 msi: routing MSI-X IRQ 272 to local APIC 56 vector 48 msi: routing MSI-X IRQ 273 to local APIC 0 vector 58 bxe1: using IRQs 269-273 for MSI-X bxe1: MSI-X vectors Requested 5 and Allocated 5 But the card seems to be working fine AFAIK (I'm not able to do any kind of benchmarking anyway). Adding the Broadcom guys in case they can provide some input on this error message. Thansk, Roger. From owner-svn-src-head@freebsd.org Wed Feb 15 16:52:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 877BACE0E4C; Wed, 15 Feb 2017 16:52:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 548081B25; Wed, 15 Feb 2017 16:52:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FGqLSL034404; Wed, 15 Feb 2017 16:52:21 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FGqLCk034403; Wed, 15 Feb 2017 16:52:21 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201702151652.v1FGqLCk034403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 15 Feb 2017 16:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313775 - head/sys/fs/devfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 16:52:22 -0000 Author: trasz Date: Wed Feb 15 16:52:21 2017 New Revision: 313775 URL: https://svnweb.freebsd.org/changeset/base/313775 Log: Change the "devfs_fsync: vop_stdfsync failed" from panic to a printf. It's not a proper fix, but should be better than what we have now. Since it got broken some six months ago it results in an incredibly annoying and trivially reproducible panic every time eg an USB disk gets disconnected. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Wed Feb 15 15:32:29 2017 (r313774) +++ head/sys/fs/devfs/devfs_vnops.c Wed Feb 15 16:52:21 2017 (r313775) @@ -693,7 +693,7 @@ devfs_fsync(struct vop_fsync_args *ap) error = vop_stdfsync(ap); if (bo->bo_dirty.bv_cnt != 0 || error != 0) - panic("devfs_fsync: vop_stdfsync failed."); + printf("devfs_fsync: vop_stdfsync failed."); } return (0); From owner-svn-src-head@freebsd.org Wed Feb 15 17:33:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBB11CE0B0C; Wed, 15 Feb 2017 17:33:04 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9695015FE; Wed, 15 Feb 2017 17:33:04 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FHX3vj050833; Wed, 15 Feb 2017 17:33:03 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FHX3Fl050832; Wed, 15 Feb 2017 17:33:03 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201702151733.v1FHX3Fl050832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Wed, 15 Feb 2017 17:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313777 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 17:33:05 -0000 Author: rpokala Date: Wed Feb 15 17:33:03 2017 New Revision: 313777 URL: https://svnweb.freebsd.org/changeset/base/313777 Log: Un-break vt(4) for {powerpc,powerpc64,sparc64} LINT kernel builds The {powerpc,powerpc64,sparc64} LINT kernel builds fail with this error: sys/dev/vt/vt_buf.c:198: warning: 'vtbuf_htw' defined but not used Move vtbuf_htw() inside the '#if SC_NO_CUTPASTE' block where it belongs, and put it in the proper order. This fixes the immedate issue w/ vt(4), but all three then fail on different issues. Reviewed by: emaste Modified: head/sys/dev/vt/vt_buf.c Modified: head/sys/dev/vt/vt_buf.c ============================================================================== --- head/sys/dev/vt/vt_buf.c Wed Feb 15 16:55:24 2017 (r313776) +++ head/sys/dev/vt/vt_buf.c Wed Feb 15 17:33:03 2017 (r313777) @@ -55,10 +55,10 @@ static MALLOC_DEFINE(M_VTBUF, "vtbuf", " } while (0) #ifndef SC_NO_CUTPASTE +static int vtbuf_htw(const struct vt_buf *vb, int row); static int vtbuf_wth(const struct vt_buf *vb, int row); static int vtbuf_in_this_range(int begin, int test, int end, int sz); #endif -static int vtbuf_htw(const struct vt_buf *vb, int row); /* * line4 @@ -161,6 +161,21 @@ vthistory_getpos(const struct vt_buf *vb } #ifndef SC_NO_CUTPASTE /* Only mouse support use it now. */ +/* Translate history row to current view row number. */ +static int +vtbuf_htw(const struct vt_buf *vb, int row) +{ + + /* + * total 1000 rows. + * History offset roffset winrow + * 205 200 ((205 - 200 + 1000) % 1000) = 5 + * 90 990 ((90 - 990 + 1000) % 1000) = 100 + */ + return ((row - vb->vb_roffset + vb->vb_history_size) % + vb->vb_history_size); +} + /* Translate current view row number to history row. */ static int vtbuf_wth(const struct vt_buf *vb, int row) @@ -192,21 +207,6 @@ vtbuf_in_this_range(int begin, int test, } #endif -/* Translate history row to current view row number. */ -static int -vtbuf_htw(const struct vt_buf *vb, int row) -{ - - /* - * total 1000 rows. - * History offset roffset winrow - * 205 200 ((205 - 200 + 1000) % 1000) = 5 - * 90 990 ((90 - 990 + 1000) % 1000) = 100 - */ - return ((row - vb->vb_roffset + vb->vb_history_size) % - vb->vb_history_size); -} - int vtbuf_iscursor(const struct vt_buf *vb, int row, int col) { From owner-svn-src-head@freebsd.org Wed Feb 15 18:31:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17E32CE0A3A; Wed, 15 Feb 2017 18:31:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB838162E; Wed, 15 Feb 2017 18:31:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FIV9rG071259; Wed, 15 Feb 2017 18:31:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FIV9HN071258; Wed, 15 Feb 2017 18:31:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201702151831.v1FIV9HN071258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 15 Feb 2017 18:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313778 - head/sys/dev/mlx4/mlx4_ib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 18:31:12 -0000 Author: hselasky Date: Wed Feb 15 18:31:09 2017 New Revision: 313778 URL: https://svnweb.freebsd.org/changeset/base/313778 Log: Improve code readability and fix compilation error when using clang 4.x. Found by: emaste @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c ============================================================================== --- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c Wed Feb 15 17:33:03 2017 (r313777) +++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c Wed Feb 15 18:31:09 2017 (r313778) @@ -614,7 +614,7 @@ static int mlx4_ib_demux_mad(struct ib_d is_eth = 1; if (is_eth) { - if (!wc->wc_flags & IB_WC_GRH) { + if (!(wc->wc_flags & IB_WC_GRH)) { mlx4_ib_warn(ibdev, "RoCE grh not present.\n"); return -EINVAL; } From owner-svn-src-head@freebsd.org Wed Feb 15 19:45:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D2E3CE020C; Wed, 15 Feb 2017 19:45:42 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48BA6861; Wed, 15 Feb 2017 19:45:42 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x243.google.com with SMTP id f200so11330402itf.3; Wed, 15 Feb 2017 11:45:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=d1xrvB6ugsat7too3Ij97PUwMSUWXih5mukxVgyVUxc=; b=ju0A8U257/xHTTfN2K3LfAlGepAcIpd13l+brSRclJm8rsDveuvHHGDkqWuNygFuJA Q8RgUw790zx1BfAUorEuT+SK0u5ECFjom8JzQm1dONp1k0smbIj6vyoznWib0wLeeR0i 1XswKV8ImGyitKGVuZvX4n7lSMW3S06b5wa6iDgzvtjBozBMCxv0wyZg9v1ffbK0vCYk ALvL1VOjG58TVrtQNdb+7+BFn+13XNacSqrcjRJwUsckRsVQLayjvXea5iqpK6ZEZFee x8acfkzT/4mArDGjoUnt/z2/oMAwnjwIKQDwTNPSQ+rrJT5/ZwBwYYG96NekC/yFiYar hABQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=d1xrvB6ugsat7too3Ij97PUwMSUWXih5mukxVgyVUxc=; b=qR7CM47V7r6v1NEiOf0AFbBKnTOz75Xqn3iSEgb9N83wofACmE+TmT1IjGP4mFEDsT v1g7z9jVLVSfQh/Cvxf9hoNso0jCeC+5riCxfWVYdwjcECF8SkTkKZBR4msXpLW8rFG5 Fd8Aqc2M4mq0ssB9SdBM5K7ZIxmp5VunqvMEII+MkK8U8Bo3I5cx/w+rRlswmN+zoBk1 tJjAEONnlJuPUt6jmHr6L3fuCv7DQwJurf7PP+a1ChhaHZGGqMxbzIUQPPvJ41SaD1sz iT8Dm9jn1MxXmY5c9nMTUw4LH2oy/oV5O1V3zfvOjKgQ7IrCu88j9dg128MojC3ca7Gt ltxQ== X-Gm-Message-State: AMke39m6ldPgljsyKyTGf9csjH3SLV36/hP/zjuweYIVwanvmuH7B6kqsCaalLu2R+ODBEoHzpNzwD4hcjyZ3Q== X-Received: by 10.36.2.65 with SMTP id 62mr10619892itu.83.1487187941566; Wed, 15 Feb 2017 11:45:41 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.39.17 with HTTP; Wed, 15 Feb 2017 11:45:21 -0800 (PST) In-Reply-To: <201702060849.v168nwmf064277@repo.freebsd.org> References: <201702060849.v168nwmf064277@repo.freebsd.org> From: Ed Maste Date: Wed, 15 Feb 2017 14:45:21 -0500 X-Google-Sender-Auth: CT8PqFt0pCmKaCcSTOsenOqHixY Message-ID: Subject: Re: svn commit: r313330 - in head: contrib/netcat lib/libipsec sbin/ifconfig sbin/setkey share/man/man4 sys/conf sys/modules sys/modules/ipsec sys/modules/tcp/tcpmd5 sys/net sys/netinet sys/netinet/tcp... To: "Andrey V. Elsukov" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 19:45:42 -0000 On 6 February 2017 at 03:49, Andrey V. Elsukov wrote: > Author: ae > Date: Mon Feb 6 08:49:57 2017 > New Revision: 313330 > URL: https://svnweb.freebsd.org/changeset/base/313330 > > Log: > Merge projects/ipsec into head/. In tinderbox powerpc LINT kernel build is failing like so: cc1: warnings being treated as errors /scratch/tmp/emaste/freebsd/sys/netipsec/subr_ipsec.c:135: warning: 'ipsec_kmod_enter' defined but not used /scratch/tmp/emaste/freebsd/sys/netipsec/subr_ipsec.c:149: warning: 'ipsec_kmod_exit' defined but not used /scratch/tmp/emaste/freebsd/sys/netipsec/subr_ipsec.c:160: warning: 'ipsec_kmod_drain' defined but not used *** [subr_ipsec.o] Error code 1 From owner-svn-src-head@freebsd.org Wed Feb 15 19:46:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09D3BCE0264; Wed, 15 Feb 2017 19:46:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDB5399E; Wed, 15 Feb 2017 19:46:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FJk0Ld003876; Wed, 15 Feb 2017 19:46:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FJk057003875; Wed, 15 Feb 2017 19:46:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702151946.v1FJk057003875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 15 Feb 2017 19:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313779 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 19:46:02 -0000 Author: mav Date: Wed Feb 15 19:46:00 2017 New Revision: 313779 URL: https://svnweb.freebsd.org/changeset/base/313779 Log: Fix handling of negative sbspace() return values. I found that at least with Chelsio NICs TOE sockets quite often report negative sbspace() values. Using unsigned variable to store it resulted in attempts to aggregate too much data in one sosend() call, that caused errors and following connection termination. MFC after: 2 weeks Modified: head/sys/dev/iscsi/icl_soft.c Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Wed Feb 15 18:31:09 2017 (r313778) +++ head/sys/dev/iscsi/icl_soft.c Wed Feb 15 19:46:00 2017 (r313779) @@ -892,7 +892,7 @@ icl_conn_send_pdus(struct icl_conn *ic, { struct icl_pdu *request, *request2; struct socket *so; - size_t available, size, size2; + long available, size, size2; int coalesced, error; ICL_CONN_LOCK_ASSERT_NOT(ic); @@ -931,7 +931,7 @@ icl_conn_send_pdus(struct icl_conn *ic, if (available < size) { #if 1 ICL_DEBUG("no space to send; " - "have %zd, need %zd", + "have %ld, need %ld", available, size); #endif so->so_snd.sb_lowat = size; @@ -978,7 +978,7 @@ icl_conn_send_pdus(struct icl_conn *ic, } #if 0 if (coalesced > 1) { - ICL_DEBUG("coalesced %d PDUs into %zd bytes", + ICL_DEBUG("coalesced %d PDUs into %ld bytes", coalesced, size); } #endif From owner-svn-src-head@freebsd.org Wed Feb 15 19:50:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60697CE0361; Wed, 15 Feb 2017 19:50:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DCB5B5C; Wed, 15 Feb 2017 19:50:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FJoSGf004117; Wed, 15 Feb 2017 19:50:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FJoQh5004096; Wed, 15 Feb 2017 19:50:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201702151950.v1FJoQh5004096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 15 Feb 2017 19:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313780 - in head: lib/libstand sbin/dump sbin/ffsinfo sbin/fsck_ffs sbin/fsdb sbin/fsirand sbin/growfs sbin/newfs sbin/newfs_nandfs sbin/quotacheck sbin/restore sbin/tunefs sys/boot/co... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 19:50:29 -0000 Author: emaste Date: Wed Feb 15 19:50:26 2017 New Revision: 313780 URL: https://svnweb.freebsd.org/changeset/base/313780 Log: prefix UFS symbols with UFS_ to reduce namespace pollution Specifically: ROOTINO -> UFS_ROOTINO WINO -> UFS_WINO NXADDR -> UFS_NXADDR NDADDR -> UFS_NDADDR NIADDR -> UFS_NIADDR MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency) Also prefix ext2's and nandfs's NDADDR and NIADDR with EXT2_ and NANDFS_ Reviewed by: kib, mckusick Obtained from: NetBSD MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9536 Modified: head/lib/libstand/ext2fs.c head/lib/libstand/nandfs.c head/lib/libstand/ufs.c head/sbin/dump/traverse.c head/sbin/ffsinfo/ffsinfo.c head/sbin/fsck_ffs/dir.c head/sbin/fsck_ffs/fsutil.c head/sbin/fsck_ffs/gjournal.c head/sbin/fsck_ffs/inode.c head/sbin/fsck_ffs/main.c head/sbin/fsck_ffs/pass1.c head/sbin/fsck_ffs/pass1b.c head/sbin/fsck_ffs/pass2.c head/sbin/fsck_ffs/pass3.c head/sbin/fsck_ffs/pass4.c head/sbin/fsck_ffs/pass5.c head/sbin/fsck_ffs/suj.c head/sbin/fsdb/fsdb.c head/sbin/fsdb/fsdbutil.c head/sbin/fsirand/fsirand.c head/sbin/growfs/debug.c head/sbin/growfs/growfs.c head/sbin/newfs/mkfs.c head/sbin/newfs_nandfs/newfs_nandfs.c head/sbin/quotacheck/quotacheck.c head/sbin/restore/dirs.c head/sbin/restore/interactive.c head/sbin/restore/main.c head/sbin/restore/restore.c head/sbin/restore/symtab.c head/sbin/restore/tape.c head/sbin/restore/utilities.c head/sbin/tunefs/tunefs.c head/sys/boot/common/ufsread.c head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/inode.h head/sys/fs/nandfs/bmap.c head/sys/fs/nandfs/nandfs_fs.h head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ffs/fs.h head/sys/ufs/ufs/dinode.h head/sys/ufs/ufs/ufs_bmap.c head/sys/ufs/ufs/ufs_lookup.c head/sys/ufs/ufs/ufs_vfsops.c head/sys/ufs/ufs/ufs_vnops.c head/usr.sbin/makefs/ffs.c head/usr.sbin/makefs/ffs/ffs_alloc.c head/usr.sbin/makefs/ffs/ffs_balloc.c head/usr.sbin/makefs/ffs/mkfs.c head/usr.sbin/makefs/ffs/ufs_bmap.c head/usr.sbin/makefs/makefs.h head/usr.sbin/quot/quot.c Modified: head/lib/libstand/ext2fs.c ============================================================================== --- head/lib/libstand/ext2fs.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/lib/libstand/ext2fs.c Wed Feb 15 19:50:26 2017 (r313780) @@ -130,8 +130,8 @@ struct fs_ops ext2fs_fsops = { #define EXT2_MINBSHIFT 10 /* mininum block shift */ #define EXT2_MINFSHIFT 10 /* mininum frag shift */ -#define NDADDR 12 /* # of direct blocks */ -#define NIADDR 3 /* # of indirect blocks */ +#define EXT2_NDADDR 12 /* # of direct blocks */ +#define EXT2_NIADDR 3 /* # of indirect blocks */ /* * file system block to disk address @@ -162,7 +162,7 @@ struct fs_ops ext2fs_fsops = { #define fragroundup(fs, size) /* roundup(size, fsize) */ \ (((size) + (fs)->fs_fmask) & ~(fs)->fs_fmask) #define dblksize(fs, dip, lbn) \ - (((lbn) >= NDADDR || (dip)->di_size >= smalllblktosize(fs, (lbn) + 1)) \ + (((lbn) >= EXT2_NDADDR || (dip)->di_size >= smalllblktosize(fs, (lbn) + 1)) \ ? (fs)->fs_bsize \ : (fragroundup(fs, blkoff(fs, (dip)->di_size)))) @@ -275,8 +275,8 @@ struct ext2dinode { u_int32_t di_osdep1; /* os dependent stuff */ - u_int32_t di_db[NDADDR]; /* direct blocks */ - u_int32_t di_ib[NIADDR]; /* indirect blocks */ + u_int32_t di_db[EXT2_NDADDR]; /* direct blocks */ + u_int32_t di_ib[EXT2_NIADDR]; /* indirect blocks */ u_int32_t di_version; /* version */ u_int32_t di_facl; /* file acl */ u_int32_t di_dacl; /* dir acl */ @@ -305,12 +305,12 @@ struct file { struct ext2fs *f_fs; /* pointer to super-block */ struct ext2blkgrp *f_bg; /* pointer to blkgrp map */ struct ext2dinode f_di; /* copy of on-disk inode */ - int f_nindir[NIADDR]; /* number of blocks mapped by + int f_nindir[EXT2_NIADDR]; /* number of blocks mapped by indirect block at level i */ - char *f_blk[NIADDR]; /* buffer for indirect block + char *f_blk[EXT2_NIADDR]; /* buffer for indirect block at level i */ - size_t f_blksize[NIADDR]; /* size of buffer */ - daddr_t f_blkno[NIADDR]; /* disk address of block in + size_t f_blksize[EXT2_NIADDR]; /* size of buffer */ + daddr_t f_blkno[EXT2_NIADDR]; /* disk address of block in buffer */ char *f_buf; /* buffer for data block */ size_t f_buf_size; /* size of data block */ @@ -411,7 +411,7 @@ ext2fs_open(const char *upath, struct op * Calculate indirect block levels. */ mult = 1; - for (i = 0; i < NIADDR; i++) { + for (i = 0; i < EXT2_NIADDR; i++) { mult *= nindir(fs); fp->f_nindir[i] = mult; } @@ -582,7 +582,7 @@ read_inode(ino_t inumber, struct open_fi fp->f_di = dp[ino_to_bo(fs, inumber)]; /* clear out old buffers */ - for (level = 0; level < NIADDR; level++) + for (level = 0; level < EXT2_NIADDR; level++) fp->f_blkno[level] = -1; fp->f_buf_blkno = -1; fp->f_seekp = 0; @@ -609,33 +609,33 @@ block_map(struct open_file *f, daddr_t f /* * Index structure of an inode: * - * di_db[0..NDADDR-1] hold block numbers for blocks - * 0..NDADDR-1 + * di_db[0..EXT2_NDADDR-1] hold block numbers for blocks + * 0..EXT2_NDADDR-1 * * di_ib[0] index block 0 is the single indirect block * holds block numbers for blocks - * NDADDR .. NDADDR + NINDIR(fs)-1 + * EXT2_NDADDR .. EXT2_NDADDR + NINDIR(fs)-1 * * di_ib[1] index block 1 is the double indirect block * holds block numbers for INDEX blocks for blocks - * NDADDR + NINDIR(fs) .. - * NDADDR + NINDIR(fs) + NINDIR(fs)**2 - 1 + * EXT2_NDADDR + NINDIR(fs) .. + * EXT2_NDADDR + NINDIR(fs) + NINDIR(fs)**2 - 1 * * di_ib[2] index block 2 is the triple indirect block * holds block numbers for double-indirect * blocks for blocks - * NDADDR + NINDIR(fs) + NINDIR(fs)**2 .. - * NDADDR + NINDIR(fs) + NINDIR(fs)**2 + * EXT2_NDADDR + NINDIR(fs) + NINDIR(fs)**2 .. + * EXT2_NDADDR + NINDIR(fs) + NINDIR(fs)**2 * + NINDIR(fs)**3 - 1 */ - if (file_block < NDADDR) { + if (file_block < EXT2_NDADDR) { /* Direct block. */ *disk_block_p = fp->f_di.di_db[file_block]; return (0); } - file_block -= NDADDR; + file_block -= EXT2_NDADDR; /* * nindir[0] = NINDIR @@ -643,12 +643,12 @@ block_map(struct open_file *f, daddr_t f * nindir[2] = NINDIR**3 * etc */ - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < EXT2_NIADDR; level++) { if (file_block < fp->f_nindir[level]) break; file_block -= fp->f_nindir[level]; } - if (level == NIADDR) { + if (level == EXT2_NIADDR) { /* Block number too high */ return (EFBIG); } @@ -800,7 +800,7 @@ ext2fs_close(struct open_file *f) if (fp == (struct file *)0) return (0); - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < EXT2_NIADDR; level++) { if (fp->f_blk[level]) free(fp->f_blk[level]); } Modified: head/lib/libstand/nandfs.c ============================================================================== --- head/lib/libstand/nandfs.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/lib/libstand/nandfs.c Wed Feb 15 19:50:26 2017 (r313780) @@ -85,7 +85,7 @@ struct nandfs { struct nandfs_mdt nf_datfile_mdt; struct nandfs_mdt nf_ifile_mdt; - int nf_nindir[NIADDR]; + int nf_nindir[NANDFS_NIADDR]; }; static int nandfs_open(const char *, struct open_file *); @@ -313,7 +313,7 @@ nandfs_mount(struct nandfs *fs, struct o nandfs_daddr_t mult; mult = 1; - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < NANDFS_NIADDR; level++) { mult *= NINDIR(fs); fs->nf_nindir[level] = mult; } @@ -392,7 +392,7 @@ nandfs_open(const char *path, struct ope nandfs_daddr_t mult; mult = 1; - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < NANDFS_NIADDR; level++) { mult *= NINDIR(fs); fs->nf_nindir[level] = mult; } @@ -887,12 +887,12 @@ nandfs_bmap_lookup(struct nandfs *fs, st ino = node->inode; - if (lblknr < NDADDR) { + if (lblknr < NANDFS_NDADDR) { *vblknr = ino->i_db[lblknr]; return (0); } - lblknr -= NDADDR; + lblknr -= NANDFS_NDADDR; /* * nindir[0] = NINDIR @@ -900,14 +900,14 @@ nandfs_bmap_lookup(struct nandfs *fs, st * nindir[2] = NINDIR**3 * etc */ - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < NANDFS_NIADDR; level++) { NANDFS_DEBUG("lblknr=%jx fs->nf_nindir[%d]=%d\n", lblknr, level, fs->nf_nindir[level]); if (lblknr < fs->nf_nindir[level]) break; lblknr -= fs->nf_nindir[level]; } - if (level == NIADDR) { + if (level == NANDFS_NIADDR) { /* Block number too high */ NANDFS_DEBUG("lblknr %jx too high\n", lblknr); return (EFBIG); Modified: head/lib/libstand/ufs.c ============================================================================== --- head/lib/libstand/ufs.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/lib/libstand/ufs.c Wed Feb 15 19:50:26 2017 (r313780) @@ -112,14 +112,14 @@ struct file { struct ufs1_dinode di1; struct ufs2_dinode di2; } f_di; /* copy of on-disk inode */ - int f_nindir[NIADDR]; + int f_nindir[UFS_NIADDR]; /* number of blocks mapped by indirect block at level i */ - char *f_blk[NIADDR]; /* buffer for indirect block at + char *f_blk[UFS_NIADDR]; /* buffer for indirect block at level i */ - size_t f_blksize[NIADDR]; + size_t f_blksize[UFS_NIADDR]; /* size of buffer */ - ufs2_daddr_t f_blkno[NIADDR];/* disk address of block in buffer */ + ufs2_daddr_t f_blkno[UFS_NIADDR];/* disk address of block in buffer */ ufs2_daddr_t f_buf_blkno; /* block number of data block */ char *f_buf; /* buffer for data block */ size_t f_buf_size; /* size of data block */ @@ -179,7 +179,7 @@ read_inode(inumber, f) { int level; - for (level = 0; level < NIADDR; level++) + for (level = 0; level < UFS_NIADDR; level++) fp->f_blkno[level] = -1; fp->f_buf_blkno = -1; } @@ -209,33 +209,33 @@ block_map(f, file_block, disk_block_p) /* * Index structure of an inode: * - * di_db[0..NDADDR-1] hold block numbers for blocks - * 0..NDADDR-1 + * di_db[0..UFS_NDADDR-1] hold block numbers for blocks + * 0..UFS_NDADDR-1 * * di_ib[0] index block 0 is the single indirect block * holds block numbers for blocks - * NDADDR .. NDADDR + NINDIR(fs)-1 + * UFS_NDADDR .. UFS_NDADDR + NINDIR(fs)-1 * * di_ib[1] index block 1 is the double indirect block * holds block numbers for INDEX blocks for blocks - * NDADDR + NINDIR(fs) .. - * NDADDR + NINDIR(fs) + NINDIR(fs)**2 - 1 + * UFS_NDADDR + NINDIR(fs) .. + * UFS_NDADDR + NINDIR(fs) + NINDIR(fs)**2 - 1 * * di_ib[2] index block 2 is the triple indirect block * holds block numbers for double-indirect * blocks for blocks - * NDADDR + NINDIR(fs) + NINDIR(fs)**2 .. - * NDADDR + NINDIR(fs) + NINDIR(fs)**2 + * UFS_NDADDR + NINDIR(fs) + NINDIR(fs)**2 .. + * UFS_NDADDR + NINDIR(fs) + NINDIR(fs)**2 * + NINDIR(fs)**3 - 1 */ - if (file_block < NDADDR) { + if (file_block < UFS_NDADDR) { /* Direct block. */ *disk_block_p = DIP(fp, di_db[file_block]); return (0); } - file_block -= NDADDR; + file_block -= UFS_NDADDR; /* * nindir[0] = NINDIR @@ -243,12 +243,12 @@ block_map(f, file_block, disk_block_p) * nindir[2] = NINDIR**3 * etc */ - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < UFS_NIADDR; level++) { if (file_block < fp->f_nindir[level]) break; file_block -= fp->f_nindir[level]; } - if (level == NIADDR) { + if (level == UFS_NIADDR) { /* Block number too high */ return (EFBIG); } @@ -545,13 +545,13 @@ ufs_open(upath, f) int level; mult = 1; - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < UFS_NIADDR; level++) { mult *= NINDIR(fs); fp->f_nindir[level] = mult; } } - inumber = ROOTINO; + inumber = UFS_ROOTINO; if ((rc = read_inode(inumber, f)) != 0) goto out; @@ -667,7 +667,7 @@ ufs_open(upath, f) if (*cp != '/') inumber = parent_inumber; else - inumber = (ino_t)ROOTINO; + inumber = (ino_t)UFS_ROOTINO; if ((rc = read_inode(inumber, f)) != 0) goto out; @@ -704,7 +704,7 @@ ufs_close(f) if (fp == (struct file *)0) return (0); - for (level = 0; level < NIADDR; level++) { + for (level = 0; level < UFS_NIADDR; level++) { if (fp->f_blk[level]) free(fp->f_blk[level]); } Modified: head/sbin/dump/traverse.c ============================================================================== --- head/sbin/dump/traverse.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/dump/traverse.c Wed Feb 15 19:50:26 2017 (r313780) @@ -118,11 +118,10 @@ blockest(union dinode *dp) sizeest = howmany(DIP(dp, di_size), TP_BSIZE); if (blkest > sizeest) blkest = sizeest; - if (DIP(dp, di_size) > sblock->fs_bsize * NDADDR) { + if (DIP(dp, di_size) > sblock->fs_bsize * UFS_NDADDR) { /* calculate the number of indirect blocks on the dump tape */ - blkest += - howmany(sizeest - NDADDR * sblock->fs_bsize / TP_BSIZE, - TP_NINDIR); + blkest += howmany(sizeest - + UFS_NDADDR * sblock->fs_bsize / TP_BSIZE, TP_NINDIR); } return (blkest + 1); } @@ -192,7 +191,7 @@ mapfiles(ino_t maxino, long *tapesize) continue; } for (i = 0; i < inosused; i++, ino++) { - if (ino < ROOTINO || + if (ino < UFS_ROOTINO || (dp = getino(ino, &mode)) == NULL || (mode & IFMT) == 0) continue; @@ -232,7 +231,7 @@ mapfiles(ino_t maxino, long *tapesize) * Restore gets very upset if the root is not dumped, * so ensure that it always is dumped. */ - SETINO(ROOTINO, dumpinomap); + SETINO(UFS_ROOTINO, dumpinomap); return (anydirskipped); } @@ -284,7 +283,7 @@ mapdirs(ino_t maxino, long *tapesize) else di.dp2 = dp->dp2; filesize = DIP(&di, di_size); - for (ret = 0, i = 0; filesize > 0 && i < NDADDR; i++) { + for (ret = 0, i = 0; filesize > 0 && i < UFS_NDADDR; i++) { if (DIP(&di, di_db[i]) != 0) ret |= searchdir(ino, DIP(&di, di_db[i]), (long)sblksize(sblock, DIP(&di, di_size), @@ -294,7 +293,7 @@ mapdirs(ino_t maxino, long *tapesize) else filesize -= sblock->fs_bsize; } - for (i = 0; filesize > 0 && i < NIADDR; i++) { + for (i = 0; filesize > 0 && i < UFS_NIADDR; i++) { if (DIP(&di, di_ib[i]) == 0) continue; ret |= dirindir(ino, DIP(&di, di_ib[i]), i, &filesize, @@ -556,8 +555,8 @@ dumpino(union dinode *dp, ino_t ino) DIP(dp, di_mode) & IFMT); return; } - if (DIP(dp, di_size) > NDADDR * sblock->fs_bsize) { - cnt = NDADDR * sblock->fs_frag; + if (DIP(dp, di_size) > UFS_NDADDR * sblock->fs_bsize) { + cnt = UFS_NDADDR * sblock->fs_frag; last = 0; } else { cnt = howmany(DIP(dp, di_size), sblock->fs_fsize); @@ -567,9 +566,9 @@ dumpino(union dinode *dp, ino_t ino) ufs1_blksout(&dp->dp1.di_db[0], cnt, ino); else ufs2_blksout(dp, &dp->dp2.di_db[0], cnt, ino, last); - if ((size = DIP(dp, di_size) - NDADDR * sblock->fs_bsize) <= 0) + if ((size = DIP(dp, di_size) - UFS_NDADDR * sblock->fs_bsize) <= 0) return; - for (ind_level = 0; ind_level < NIADDR; ind_level++) { + for (ind_level = 0; ind_level < UFS_NIADDR; ind_level++) { dmpindir(dp, ino, DIP(dp, di_ib[ind_level]), ind_level, &size); if (size <= 0) return; @@ -740,8 +739,8 @@ appendextdata(union dinode *dp) * part of them here, we simply push them entirely into a * new block rather than putting some here and some later. */ - if (spcl.c_extsize > NXADDR * sblock->fs_bsize) - blks = howmany(NXADDR * sblock->fs_bsize, TP_BSIZE); + if (spcl.c_extsize > UFS_NXADDR * sblock->fs_bsize) + blks = howmany(UFS_NXADDR * sblock->fs_bsize, TP_BSIZE); else blks = howmany(spcl.c_extsize, TP_BSIZE); if (spcl.c_count + blks > TP_NINDIR) @@ -784,8 +783,8 @@ writeextdata(union dinode *dp, ino_t ino * dump them out in a new block, otherwise just dump the data. */ if (added == 0) { - if (spcl.c_extsize > NXADDR * sblock->fs_bsize) { - frags = NXADDR * sblock->fs_frag; + if (spcl.c_extsize > UFS_NXADDR * sblock->fs_bsize) { + frags = UFS_NXADDR * sblock->fs_frag; last = 0; } else { frags = howmany(spcl.c_extsize, sblock->fs_fsize); @@ -793,8 +792,8 @@ writeextdata(union dinode *dp, ino_t ino } ufs2_blksout(dp, &dp->dp2.di_extb[0], frags, ino, last); } else { - if (spcl.c_extsize > NXADDR * sblock->fs_bsize) - blks = howmany(NXADDR * sblock->fs_bsize, TP_BSIZE); + if (spcl.c_extsize > UFS_NXADDR * sblock->fs_bsize) + blks = howmany(UFS_NXADDR * sblock->fs_bsize, TP_BSIZE); else blks = howmany(spcl.c_extsize, TP_BSIZE); tbperdb = sblock->fs_bsize >> tp_bshift; @@ -820,7 +819,7 @@ writeextdata(union dinode *dp, ino_t ino * If the extended attributes fall into an indirect block, * dump it as well. */ - if ((size = spcl.c_extsize - NXADDR * sblock->fs_bsize) > 0) + if ((size = spcl.c_extsize - UFS_NXADDR * sblock->fs_bsize) > 0) dmpindir(dp, ino, dp->dp2.di_exti, 0, &size); } Modified: head/sbin/ffsinfo/ffsinfo.c ============================================================================== --- head/sbin/ffsinfo/ffsinfo.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/ffsinfo/ffsinfo.c Wed Feb 15 19:50:26 2017 (r313780) @@ -377,7 +377,7 @@ dump_whole_ufs1_inode(ino_t inode, int l /* * Ok, now prepare for dumping all direct and indirect pointers. */ - rb=howmany(ino->di_size, sblock.fs_bsize)-NDADDR; + rb = howmany(ino->di_size, sblock.fs_bsize) - UFS_NDADDR; if(rb>0) { /* * Dump single indirect block. @@ -529,7 +529,7 @@ dump_whole_ufs2_inode(ino_t inode, int l /* * Ok, now prepare for dumping all direct and indirect pointers. */ - rb = howmany(ino->di_size, sblock.fs_bsize) - NDADDR; + rb = howmany(ino->di_size, sblock.fs_bsize) - UFS_NDADDR; if (rb > 0) { /* * Dump single indirect block. Modified: head/sbin/fsck_ffs/dir.c ============================================================================== --- head/sbin/fsck_ffs/dir.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/dir.c Wed Feb 15 19:50:26 2017 (r313780) @@ -255,7 +255,7 @@ fileerror(ino_t cwd, ino_t ino, const ch pinode(ino); printf("\n"); getpathname(pathbuf, cwd, ino); - if (ino < ROOTINO || ino > maxino) { + if (ino < UFS_ROOTINO || ino > maxino) { pfatal("NAME=%s\n", pathbuf); return; } @@ -401,24 +401,25 @@ linkup(ino_t orphan, ino_t parentdir, ch if (reply("RECONNECT") == 0) return (0); if (lfdir == 0) { - dp = ginode(ROOTINO); + dp = ginode(UFS_ROOTINO); idesc.id_name = strdup(lfname); idesc.id_type = DATA; idesc.id_func = findino; - idesc.id_number = ROOTINO; + idesc.id_number = UFS_ROOTINO; if ((ckinode(dp, &idesc) & FOUND) != 0) { lfdir = idesc.id_parent; } else { pwarn("NO lost+found DIRECTORY"); if (preen || reply("CREATE")) { - lfdir = allocdir(ROOTINO, (ino_t)0, lfmode); + lfdir = allocdir(UFS_ROOTINO, (ino_t)0, lfmode); if (lfdir != 0) { - if (makeentry(ROOTINO, lfdir, lfname) != 0) { + if (makeentry(UFS_ROOTINO, lfdir, + lfname) != 0) { numdirs++; if (preen) printf(" (CREATED)\n"); } else { - freedir(lfdir, ROOTINO); + freedir(lfdir, UFS_ROOTINO); lfdir = 0; if (preen) printf("\n"); @@ -438,11 +439,11 @@ linkup(ino_t orphan, ino_t parentdir, ch if (reply("REALLOCATE") == 0) return (0); oldlfdir = lfdir; - if ((lfdir = allocdir(ROOTINO, (ino_t)0, lfmode)) == 0) { + if ((lfdir = allocdir(UFS_ROOTINO, (ino_t)0, lfmode)) == 0) { pfatal("SORRY. CANNOT CREATE lost+found DIRECTORY\n\n"); return (0); } - if ((changeino(ROOTINO, lfname, lfdir) & ALTERED) == 0) { + if ((changeino(UFS_ROOTINO, lfname, lfdir) & ALTERED) == 0) { pfatal("SORRY. CANNOT CREATE lost+found DIRECTORY\n\n"); return (0); } @@ -519,8 +520,8 @@ makeentry(ino_t parent, ino_t ino, const struct inodesc idesc; char pathbuf[MAXPATHLEN + 1]; - if (parent < ROOTINO || parent >= maxino || - ino < ROOTINO || ino >= maxino) + if (parent < UFS_ROOTINO || parent >= maxino || + ino < UFS_ROOTINO || ino >= maxino) return (0); memset(&idesc, 0, sizeof(struct inodesc)); idesc.id_type = DATA; @@ -554,7 +555,7 @@ expanddir(union dinode *dp, char *name) char *cp, firstblk[DIRBLKSIZ]; lastbn = lblkno(&sblock, DIP(dp, di_size)); - if (lastbn >= NDADDR - 1 || DIP(dp, di_db[lastbn]) == 0 || + if (lastbn >= UFS_NDADDR - 1 || DIP(dp, di_db[lastbn]) == 0 || DIP(dp, di_size) == 0) return (0); if ((newblk = allocblk(sblock.fs_frag)) == 0) @@ -630,7 +631,7 @@ allocdir(ino_t parent, ino_t request, in dirty(bp); DIP_SET(dp, di_nlink, 2); inodirty(); - if (ino == ROOTINO) { + if (ino == UFS_ROOTINO) { inoinfo(ino)->ino_linkcnt = DIP(dp, di_nlink); cacheino(dp, ino); return(ino); Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/fsutil.c Wed Feb 15 19:50:26 2017 (r313780) @@ -854,7 +854,7 @@ getpathname(char *namebuf, ino_t curdir, struct inodesc idesc; static int busy = 0; - if (curdir == ino && ino == ROOTINO) { + if (curdir == ino && ino == UFS_ROOTINO) { (void)strcpy(namebuf, "/"); return; } @@ -872,7 +872,7 @@ getpathname(char *namebuf, ino_t curdir, idesc.id_parent = curdir; goto namelookup; } - while (ino != ROOTINO) { + while (ino != UFS_ROOTINO) { idesc.id_number = ino; idesc.id_func = findino; idesc.id_name = strdup(".."); @@ -894,7 +894,7 @@ getpathname(char *namebuf, ino_t curdir, ino = idesc.id_number; } busy = 0; - if (ino != ROOTINO) + if (ino != UFS_ROOTINO) *--cp = '?'; memmove(namebuf, cp, (size_t)(&namebuf[MAXPATHLEN] - cp)); } Modified: head/sbin/fsck_ffs/gjournal.c ============================================================================== --- head/sbin/fsck_ffs/gjournal.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/gjournal.c Wed Feb 15 19:50:26 2017 (r313780) @@ -367,7 +367,7 @@ clear_inode(struct ufs2_dinode *dino) osize = dino->di_extsize; dino->di_blocks -= extblocks; dino->di_extsize = 0; - for (i = 0; i < NXADDR; i++) { + for (i = 0; i < UFS_NXADDR; i++) { if (dino->di_extb[i] == 0) continue; blkfree(dino->di_extb[i], sblksize(fs, osize, i)); @@ -383,7 +383,7 @@ clear_inode(struct ufs2_dinode *dino) freeindir(dino->di_ib[level], level); } /* deallocate direct blocks and fragments */ - for (i = 0; i < NDADDR; i++) { + for (i = 0; i < UFS_NDADDR; i++) { bn = dino->di_db[i]; if (bn == 0) continue; Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/inode.c Wed Feb 15 19:50:26 2017 (r313780) @@ -78,7 +78,7 @@ ckinode(union dinode *dp, struct inodesc else dino.dp2 = dp->dp2; ndb = howmany(DIP(&dino, di_size), sblock.fs_bsize); - for (i = 0; i < NDADDR; i++) { + for (i = 0; i < UFS_NDADDR; i++) { idesc->id_lbn++; if (--ndb == 0 && (offset = blkoff(&sblock, DIP(&dino, di_size))) != 0) @@ -115,9 +115,9 @@ ckinode(union dinode *dp, struct inodesc return (ret); } idesc->id_numfrags = sblock.fs_frag; - remsize = DIP(&dino, di_size) - sblock.fs_bsize * NDADDR; + remsize = DIP(&dino, di_size) - sblock.fs_bsize * UFS_NDADDR; sizepb = sblock.fs_bsize; - for (i = 0; i < NIADDR; i++) { + for (i = 0; i < UFS_NIADDR; i++) { sizepb *= NINDIR(&sblock); if (DIP(&dino, di_ib[i])) { idesc->id_blkno = DIP(&dino, di_ib[i]); @@ -284,7 +284,7 @@ ginode(ino_t inumber) { ufs2_daddr_t iblk; - if (inumber < ROOTINO || inumber > maxino) + if (inumber < UFS_ROOTINO || inumber > maxino) errx(EEXIT, "bad inode number %ju to ginode", (uintmax_t)inumber); if (startinum == 0 || @@ -348,9 +348,9 @@ getnextinode(ino_t inumber, int rebuildc mode = DIP(dp, di_mode) & IFMT; if (mode == 0) { if (memcmp(dp->dp2.di_db, ufs2_zino.di_db, - NDADDR * sizeof(ufs2_daddr_t)) || + UFS_NDADDR * sizeof(ufs2_daddr_t)) || memcmp(dp->dp2.di_ib, ufs2_zino.di_ib, - NIADDR * sizeof(ufs2_daddr_t)) || + UFS_NIADDR * sizeof(ufs2_daddr_t)) || dp->dp2.di_mode || dp->dp2.di_size) return (NULL); goto inodegood; @@ -370,20 +370,20 @@ getnextinode(ino_t inumber, int rebuildc if (DIP(dp, di_size) < (off_t)sblock.fs_maxsymlinklen) { ndb = howmany(DIP(dp, di_size), sizeof(ufs2_daddr_t)); - if (ndb > NDADDR) { - j = ndb - NDADDR; + if (ndb > UFS_NDADDR) { + j = ndb - UFS_NDADDR; for (ndb = 1; j > 1; j--) ndb *= NINDIR(&sblock); - ndb += NDADDR; + ndb += UFS_NDADDR; } } } - for (j = ndb; ndb < NDADDR && j < NDADDR; j++) + for (j = ndb; ndb < UFS_NDADDR && j < UFS_NDADDR; j++) if (DIP(dp, di_db[j]) != 0) return (NULL); - for (j = 0, ndb -= NDADDR; ndb > 0; j++) + for (j = 0, ndb -= UFS_NDADDR; ndb > 0; j++) ndb /= NINDIR(&sblock); - for (; j < NIADDR; j++) + for (; j < UFS_NIADDR; j++) if (DIP(dp, di_ib[j]) != 0) return (NULL); } @@ -449,8 +449,8 @@ cacheino(union dinode *dp, ino_t inumber struct inoinfo *inp, **inpp; int i, blks; - if (howmany(DIP(dp, di_size), sblock.fs_bsize) > NDADDR) - blks = NDADDR + NIADDR; + if (howmany(DIP(dp, di_size), sblock.fs_bsize) > UFS_NDADDR) + blks = UFS_NDADDR + UFS_NIADDR; else blks = howmany(DIP(dp, di_size), sblock.fs_bsize); inp = (struct inoinfo *) @@ -460,16 +460,16 @@ cacheino(union dinode *dp, ino_t inumber inpp = &inphead[inumber % dirhash]; inp->i_nexthash = *inpp; *inpp = inp; - inp->i_parent = inumber == ROOTINO ? ROOTINO : (ino_t)0; + inp->i_parent = inumber == UFS_ROOTINO ? UFS_ROOTINO : (ino_t)0; inp->i_dotdot = (ino_t)0; inp->i_number = inumber; inp->i_isize = DIP(dp, di_size); inp->i_numblks = blks; - for (i = 0; i < MIN(blks, NDADDR); i++) + for (i = 0; i < MIN(blks, UFS_NDADDR); i++) inp->i_blks[i] = DIP(dp, di_db[i]); - if (blks > NDADDR) - for (i = 0; i < NIADDR; i++) - inp->i_blks[NDADDR + i] = DIP(dp, di_ib[i]); + if (blks > UFS_NDADDR) + for (i = 0; i < UFS_NIADDR; i++) + inp->i_blks[UFS_NDADDR + i] = DIP(dp, di_ib[i]); if (inplast == listmax) { listmax += 100; inpsort = (struct inoinfo **)realloc((char *)inpsort, @@ -575,7 +575,7 @@ findino(struct inodesc *idesc) if (dirp->d_ino == 0) return (KEEPON); if (strcmp(dirp->d_name, idesc->id_name) == 0 && - dirp->d_ino >= ROOTINO && dirp->d_ino <= maxino) { + dirp->d_ino >= UFS_ROOTINO && dirp->d_ino <= maxino) { idesc->id_parent = dirp->d_ino; return (STOP|FOUND); } @@ -604,7 +604,7 @@ pinode(ino_t ino) time_t t; printf(" I=%lu ", (u_long)ino); - if (ino < ROOTINO || ino > maxino) + if (ino < UFS_ROOTINO || ino > maxino) return; dp = ginode(ino); printf(" OWNER="); @@ -662,7 +662,7 @@ allocino(ino_t request, int type) int cg; if (request == 0) - request = ROOTINO; + request = UFS_ROOTINO; else if (inoinfo(request)->ino_state != USTATE) return (0); for (ino = request; ino < maxino; ino++) Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/main.c Wed Feb 15 19:50:26 2017 (r313780) @@ -500,7 +500,7 @@ checkfilesys(char *filesys) */ n_ffree = sblock.fs_cstotal.cs_nffree; n_bfree = sblock.fs_cstotal.cs_nbfree; - files = maxino - ROOTINO - sblock.fs_cstotal.cs_nifree - n_files; + files = maxino - UFS_ROOTINO - sblock.fs_cstotal.cs_nifree - n_files; blks = n_blks + sblock.fs_ncg * (cgdmin(&sblock, 0) - cgsblock(&sblock, 0)); blks += cgsblock(&sblock, 0) - cgbase(&sblock, 0); Modified: head/sbin/fsck_ffs/pass1.c ============================================================================== --- head/sbin/fsck_ffs/pass1.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/pass1.c Wed Feb 15 19:50:26 2017 (r313780) @@ -163,7 +163,7 @@ pass1(void) * Scan the allocated inodes. */ for (i = 0; i < inosused; i++, inumber++) { - if (inumber < ROOTINO) { + if (inumber < UFS_ROOTINO) { (void)getnextinode(inumber, rebuildcg); continue; } @@ -250,15 +250,15 @@ checkinode(ino_t inumber, struct inodesc if (mode == 0) { if ((sblock.fs_magic == FS_UFS1_MAGIC && (memcmp(dp->dp1.di_db, ufs1_zino.di_db, - NDADDR * sizeof(ufs1_daddr_t)) || + UFS_NDADDR * sizeof(ufs1_daddr_t)) || memcmp(dp->dp1.di_ib, ufs1_zino.di_ib, - NIADDR * sizeof(ufs1_daddr_t)) || + UFS_NIADDR * sizeof(ufs1_daddr_t)) || dp->dp1.di_mode || dp->dp1.di_size)) || (sblock.fs_magic == FS_UFS2_MAGIC && (memcmp(dp->dp2.di_db, ufs2_zino.di_db, - NDADDR * sizeof(ufs2_daddr_t)) || + UFS_NDADDR * sizeof(ufs2_daddr_t)) || memcmp(dp->dp2.di_ib, ufs2_zino.di_ib, - NIADDR * sizeof(ufs2_daddr_t)) || + UFS_NIADDR * sizeof(ufs2_daddr_t)) || dp->dp2.di_mode || dp->dp2.di_size))) { pfatal("PARTIALLY ALLOCATED INODE I=%lu", (u_long)inumber); @@ -324,24 +324,24 @@ checkinode(ino_t inumber, struct inodesc else ndb = howmany(DIP(dp, di_size), sizeof(ufs2_daddr_t)); - if (ndb > NDADDR) { - j = ndb - NDADDR; + if (ndb > UFS_NDADDR) { + j = ndb - UFS_NDADDR; for (ndb = 1; j > 1; j--) ndb *= NINDIR(&sblock); - ndb += NDADDR; + ndb += UFS_NDADDR; } } } - for (j = ndb; ndb < NDADDR && j < NDADDR; j++) + for (j = ndb; ndb < UFS_NDADDR && j < UFS_NDADDR; j++) if (DIP(dp, di_db[j]) != 0) { if (debug) printf("bad direct addr[%d]: %ju\n", j, (uintmax_t)DIP(dp, di_db[j])); goto unknown; } - for (j = 0, ndb -= NDADDR; ndb > 0; j++) + for (j = 0, ndb -= UFS_NDADDR; ndb > 0; j++) ndb /= NINDIR(&sblock); - for (; j < NIADDR; j++) + for (; j < UFS_NIADDR; j++) if (DIP(dp, di_ib[j]) != 0) { if (debug) printf("bad indirect addr: %ju\n", @@ -376,7 +376,7 @@ checkinode(ino_t inumber, struct inodesc if (sblock.fs_magic == FS_UFS2_MAGIC && dp->dp2.di_extsize > 0) { idesc->id_type = ADDR; ndb = howmany(dp->dp2.di_extsize, sblock.fs_bsize); - for (j = 0; j < NXADDR; j++) { + for (j = 0; j < UFS_NXADDR; j++) { if (--ndb == 0 && (offset = blkoff(&sblock, dp->dp2.di_extsize)) != 0) idesc->id_numfrags = numfrags(&sblock, Modified: head/sbin/fsck_ffs/pass1b.c ============================================================================== --- head/sbin/fsck_ffs/pass1b.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/pass1b.c Wed Feb 15 19:50:26 2017 (r313780) @@ -73,7 +73,7 @@ pass1b(void) got_sigalarm = 0; } for (i = 0; i < sblock.fs_ipg; i++, inumber++) { - if (inumber < ROOTINO) + if (inumber < UFS_ROOTINO) continue; dp = ginode(inumber); if (dp == NULL) Modified: head/sbin/fsck_ffs/pass2.c ============================================================================== --- head/sbin/fsck_ffs/pass2.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/pass2.c Wed Feb 15 19:50:26 2017 (r313780) @@ -67,7 +67,7 @@ pass2(void) int i; char pathbuf[MAXPATHLEN + 1]; - switch (inoinfo(ROOTINO)->ino_state) { + switch (inoinfo(UFS_ROOTINO)->ino_state) { case USTATE: pfatal("ROOT INODE UNALLOCATED"); @@ -75,15 +75,16 @@ pass2(void) ckfini(0); exit(EEXIT); } - if (allocdir(ROOTINO, ROOTINO, 0755) != ROOTINO) + if (allocdir(UFS_ROOTINO, UFS_ROOTINO, 0755) != UFS_ROOTINO) errx(EEXIT, "CANNOT ALLOCATE ROOT INODE"); break; case DCLEAR: pfatal("DUPS/BAD IN ROOT INODE"); if (reply("REALLOCATE")) { - freeino(ROOTINO); - if (allocdir(ROOTINO, ROOTINO, 0755) != ROOTINO) + freeino(UFS_ROOTINO); + if (allocdir(UFS_ROOTINO, UFS_ROOTINO, 0755) != + UFS_ROOTINO) errx(EEXIT, "CANNOT ALLOCATE ROOT INODE"); break; } @@ -98,8 +99,9 @@ pass2(void) case FZLINK: pfatal("ROOT INODE NOT DIRECTORY"); if (reply("REALLOCATE")) { - freeino(ROOTINO); - if (allocdir(ROOTINO, ROOTINO, 0755) != ROOTINO) + freeino(UFS_ROOTINO); + if (allocdir(UFS_ROOTINO, UFS_ROOTINO, 0755) != + UFS_ROOTINO) errx(EEXIT, "CANNOT ALLOCATE ROOT INODE"); break; } @@ -107,7 +109,7 @@ pass2(void) ckfini(0); exit(EEXIT); } - dp = ginode(ROOTINO); + dp = ginode(UFS_ROOTINO); DIP_SET(dp, di_mode, DIP(dp, di_mode) & ~IFMT); DIP_SET(dp, di_mode, DIP(dp, di_mode) | IFDIR); inodirty(); @@ -119,11 +121,11 @@ pass2(void) default: errx(EEXIT, "BAD STATE %d FOR ROOT INODE", - inoinfo(ROOTINO)->ino_state); + inoinfo(UFS_ROOTINO)->ino_state); } - inoinfo(ROOTINO)->ino_state = DFOUND; - inoinfo(WINO)->ino_state = FSTATE; - inoinfo(WINO)->ino_type = DT_WHT; + inoinfo(UFS_ROOTINO)->ino_state = DFOUND; + inoinfo(UFS_WINO)->ino_state = FSTATE; + inoinfo(UFS_WINO)->ino_type = DT_WHT; /* * Sort the directory list into disk block order. */ @@ -182,11 +184,12 @@ pass2(void) memset(dp, 0, sizeof(struct ufs2_dinode)); DIP_SET(dp, di_mode, IFDIR); DIP_SET(dp, di_size, inp->i_isize); - for (i = 0; i < MIN(inp->i_numblks, NDADDR); i++) + for (i = 0; i < MIN(inp->i_numblks, UFS_NDADDR); i++) DIP_SET(dp, di_db[i], inp->i_blks[i]); - if (inp->i_numblks > NDADDR) - for (i = 0; i < NIADDR; i++) - DIP_SET(dp, di_ib[i], inp->i_blks[NDADDR + i]); + if (inp->i_numblks > UFS_NDADDR) + for (i = 0; i < UFS_NIADDR; i++) + DIP_SET(dp, di_ib[i], + inp->i_blks[UFS_NDADDR + i]); curino.id_number = inp->i_number; curino.id_parent = inp->i_parent; (void)ckinode(dp, &curino); @@ -411,10 +414,10 @@ chk2: if (dirp->d_ino > maxino) { fileerror(idesc->id_number, dirp->d_ino, "I OUT OF RANGE"); n = reply("REMOVE"); - } else if (((dirp->d_ino == WINO && dirp->d_type != DT_WHT) || - (dirp->d_ino != WINO && dirp->d_type == DT_WHT))) { + } else if (((dirp->d_ino == UFS_WINO && dirp->d_type != DT_WHT) || + (dirp->d_ino != UFS_WINO && dirp->d_type == DT_WHT))) { fileerror(idesc->id_number, dirp->d_ino, "BAD WHITEOUT ENTRY"); - dirp->d_ino = WINO; + dirp->d_ino = UFS_WINO; dirp->d_type = DT_WHT; if (reply("FIX") == 1) ret |= ALTERED; Modified: head/sbin/fsck_ffs/pass3.c ============================================================================== --- head/sbin/fsck_ffs/pass3.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/pass3.c Wed Feb 15 19:50:26 2017 (r313780) @@ -68,7 +68,7 @@ pass3(void) } inp = inpsort[inpindex]; state = inoinfo(inp->i_number)->ino_state; - if (inp->i_number == ROOTINO || + if (inp->i_number == UFS_ROOTINO || (inp->i_parent != 0 && !S_IS_DUNFOUND(state))) continue; if (state == DCLEAR) @@ -81,7 +81,7 @@ pass3(void) */ if ((preen || bkgrdflag) && resolved && usedsoftdep && S_IS_DUNFOUND(state)) { - if (inp->i_dotdot >= ROOTINO) + if (inp->i_dotdot >= UFS_ROOTINO) inoinfo(inp->i_dotdot)->ino_linkcnt++; continue; } Modified: head/sbin/fsck_ffs/pass4.c ============================================================================== --- head/sbin/fsck_ffs/pass4.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/pass4.c Wed Feb 15 19:50:26 2017 (r313780) @@ -71,7 +71,7 @@ pass4(void) } inumber = cg * sblock.fs_ipg; for (i = 0; i < inostathead[cg].il_numalloced; i++, inumber++) { - if (inumber < ROOTINO) + if (inumber < UFS_ROOTINO) continue; idesc.id_number = inumber; switch (inoinfo(inumber)->ino_state) { Modified: head/sbin/fsck_ffs/pass5.c ============================================================================== --- head/sbin/fsck_ffs/pass5.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/pass5.c Wed Feb 15 19:50:26 2017 (r313780) @@ -68,7 +68,7 @@ pass5(void) struct cg *cg, *newcg = (struct cg *)buf; struct bufarea *cgbp; - inoinfo(WINO)->ino_state = USTATE; + inoinfo(UFS_WINO)->ino_state = USTATE; memset(newcg, 0, (size_t)fs->fs_cgsize); newcg->cg_niblk = fs->fs_ipg; if (cvtlevel >= 3) { @@ -234,14 +234,14 @@ pass5(void) break; default: - if (j < (int)ROOTINO) + if (j < (int)UFS_ROOTINO) break; errx(EEXIT, "BAD STATE %d FOR INODE I=%d", inoinfo(j)->ino_state, j); } } if (c == 0) - for (i = 0; i < (int)ROOTINO; i++) { + for (i = 0; i < (int)UFS_ROOTINO; i++) { setbit(cg_inosused(newcg), i); newcg->cg_cs.cs_nifree--; } Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Wed Feb 15 19:46:00 2017 (r313779) +++ head/sbin/fsck_ffs/suj.c Wed Feb 15 19:50:26 2017 (r313780) @@ -758,7 +758,7 @@ ino_blkatoff(union dinode *ip, ino_t ino /* * Handle extattr blocks first. */ - if (lbn < 0 && lbn >= -NXADDR) { + if (lbn < 0 && lbn >= -UFS_NXADDR) { lbn = -1 - lbn; if (lbn > lblkno(fs, ip->dp2.di_extsize - 1)) return (0); @@ -771,13 +771,13 @@ ino_blkatoff(union dinode *ip, ino_t ino if (DIP(ip, di_mode) == IFLNK && DIP(ip, di_size) < fs->fs_maxsymlinklen) return (0); - if (lbn >= 0 && lbn < NDADDR) { + if (lbn >= 0 && lbn < UFS_NDADDR) { *frags = numfrags(fs, sblksize(fs, DIP(ip, di_size), lbn)); return (DIP(ip, di_db[lbn])); } *frags = fs->fs_frag; - for (i = 0, tmpval = NINDIR(fs), cur = NDADDR; i < NIADDR; i++, + for (i = 0, tmpval = NINDIR(fs), cur = UFS_NDADDR; i < UFS_NIADDR; i++, tmpval *= NINDIR(fs), cur = next) { next = cur + tmpval; if (lbn == -cur - i) @@ -1037,7 +1037,7 @@ ino_visit(union dinode *ip, ino_t ino, i *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Feb 15 20:17:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CE72CE0B00; Wed, 15 Feb 2017 20:17:57 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C34D1A4E; Wed, 15 Feb 2017 20:17:56 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FKHulX016106; Wed, 15 Feb 2017 20:17:56 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FKHtUq016096; Wed, 15 Feb 2017 20:17:55 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201702152017.v1FKHtUq016096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 15 Feb 2017 20:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313782 - in head/contrib/libarchive/libarchive: . test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 20:17:57 -0000 Author: mm Date: Wed Feb 15 20:17:55 2017 New Revision: 313782 URL: https://svnweb.freebsd.org/changeset/base/313782 Log: MFV r313781: Sync libarchive with vendor Vendor changes: Make SCHILY.acl.ace header more compact (NFSv4 ACLs) Vendor bugfixes: zip reader integer parsing fix (OSS-Fuzz 556) spelling fixes (issue #863) Modified: head/contrib/libarchive/libarchive/archive_acl.c head/contrib/libarchive/libarchive/archive_entry.h head/contrib/libarchive/libarchive/archive_entry_acl.3 head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_support_format_zip.c head/contrib/libarchive/libarchive/archive_write_disk_acl.c head/contrib/libarchive/libarchive/archive_write_set_format_pax.c head/contrib/libarchive/libarchive/test/test_acl_pax_nfs4.tar.uu head/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c head/contrib/libarchive/libarchive/test/test_acl_text.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_acl.c Wed Feb 15 20:00:36 2017 (r313781) +++ head/contrib/libarchive/libarchive/archive_acl.c Wed Feb 15 20:17:55 2017 (r313782) @@ -83,6 +83,50 @@ static void append_entry(char **p, const int tag, int flags, const char *name, int perm, int id); static void append_id(char **p, int id); +static const struct { + const int perm; + const char c; + const wchar_t wc; +} nfsv4_acl_perm_map[] = { + { ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, 'r', + L'r' }, + { ARCHIVE_ENTRY_ACL_WRITE_DATA | ARCHIVE_ENTRY_ACL_ADD_FILE, 'w', + L'w' }, + { ARCHIVE_ENTRY_ACL_EXECUTE, 'x', L'x' }, + { ARCHIVE_ENTRY_ACL_APPEND_DATA | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, + 'p', L'p' }, + { ARCHIVE_ENTRY_ACL_DELETE, 'd', L'd' }, + { ARCHIVE_ENTRY_ACL_DELETE_CHILD, 'D', L'D' }, + { ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, 'a', L'a' }, + { ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, 'A', L'A' }, + { ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, 'R', L'R' }, + { ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, 'W', L'W' }, + { ARCHIVE_ENTRY_ACL_READ_ACL, 'c', L'c' }, + { ARCHIVE_ENTRY_ACL_WRITE_ACL, 'C', L'C' }, + { ARCHIVE_ENTRY_ACL_WRITE_OWNER, 'o', L'o' }, + { ARCHIVE_ENTRY_ACL_SYNCHRONIZE, 's', L's' } +}; + +static const int nfsv4_acl_perm_map_size = (int)(sizeof(nfsv4_acl_perm_map) / + sizeof(nfsv4_acl_perm_map[0])); + +static const struct { + const int perm; + const char c; + const wchar_t wc; +} nfsv4_acl_flag_map[] = { + { ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, 'f', L'f' }, + { ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, 'd', L'd' }, + { ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, 'i', L'i' }, + { ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, 'n', L'n' }, + { ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, 'S', L'S' }, + { ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, 'F', L'F' }, + { ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, 'I', L'I' } +}; + +static const int nfsv4_acl_flag_map_size = (int)(sizeof(nfsv4_acl_flag_map) / + sizeof(nfsv4_acl_flag_map[0])); + void archive_acl_clear(struct archive_acl *acl) { @@ -741,6 +785,8 @@ static void append_entry_w(wchar_t **wp, const wchar_t *prefix, int type, int tag, int flags, const wchar_t *wname, int perm, int id) { + int i; + if (prefix != NULL) { wcscpy(*wp, prefix); *wp += wcslen(*wp); @@ -810,46 +856,20 @@ append_entry_w(wchar_t **wp, const wchar *(*wp)++ = (perm & 0222) ? L'w' : L'-'; *(*wp)++ = (perm & 0111) ? L'x' : L'-'; } else { - /* NFS4 ACL perms */ - *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_READ_DATA | - ARCHIVE_ENTRY_ACL_LIST_DIRECTORY)) ? L'r' : L'-'; - *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_WRITE_DATA | - ARCHIVE_ENTRY_ACL_ADD_FILE)) ? L'w' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_EXECUTE) ? L'x' : L'-'; - *(*wp)++ = (perm & (ARCHIVE_ENTRY_ACL_APPEND_DATA | - ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY)) ? L'p' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE) ? L'd' : L'-'; - *(*wp)++ = (perm & - ARCHIVE_ENTRY_ACL_DELETE_CHILD) ? L'D' : L'-'; - *(*wp)++ = (perm & - ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES) ? L'a' : L'-'; - *(*wp)++ = (perm & - ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES) ? L'A' : L'-'; - *(*wp)++ = (perm & - ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS) ? L'R' : L'-'; - *(*wp)++ = (perm & - ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS) ? L'W' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_READ_ACL) ? L'c' : L'-'; - *(*wp)++ = (perm & ARCHIVE_ENTRY_ACL_WRITE_ACL) ? L'C' : L'-'; - *(*wp)++ = (perm & - ARCHIVE_ENTRY_ACL_WRITE_OWNER) ? L'o' : L'-'; - *(*wp)++ = (perm & - ARCHIVE_ENTRY_ACL_SYNCHRONIZE) ? L's' : L'-'; + /* NFSv4 ACL perms */ + for (i = 0; i < nfsv4_acl_perm_map_size; i++) { + if (perm & nfsv4_acl_perm_map[i].perm) + *(*wp)++ = nfsv4_acl_perm_map[i].wc; + else if ((flags & ARCHIVE_ENTRY_ACL_STYLE_COMPACT) == 0) + *(*wp)++ = L'-'; + } *(*wp)++ = L':'; - *(*wp)++ = (perm & - ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT) ? L'f' : L'-'; - *(*wp)++ = (perm & - ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT) ? L'd' : L'-'; - *(*wp)++ = (perm & - ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY) ? L'i' : L'-'; - *(*wp)++ = (perm & - ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT) ? L'n' : L'-'; - *(*wp)++ = (perm & - ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS) ? L'S' : L'-'; - *(*wp)++ = (perm & - ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS) ? L'F' : L'-'; - *(*wp)++ = (perm & - ARCHIVE_ENTRY_ACL_ENTRY_INHERITED) ? L'I' : L'-'; + for (i = 0; i < nfsv4_acl_flag_map_size; i++) { + if (perm & nfsv4_acl_flag_map[i].perm) + *(*wp)++ = nfsv4_acl_flag_map[i].wc; + else if ((flags & ARCHIVE_ENTRY_ACL_STYLE_COMPACT) == 0) + *(*wp)++ = L'-'; + } *(*wp)++ = L':'; switch (type) { case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: @@ -998,6 +1018,8 @@ static void append_entry(char **p, const char *prefix, int type, int tag, int flags, const char *name, int perm, int id) { + int i; + if (prefix != NULL) { strcpy(*p, prefix); *p += strlen(*p); @@ -1067,47 +1089,20 @@ append_entry(char **p, const char *prefi *(*p)++ = (perm & 0222) ? 'w' : '-'; *(*p)++ = (perm & 0111) ? 'x' : '-'; } else { - /* NFS4 ACL perms */ - *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_READ_DATA | - ARCHIVE_ENTRY_ACL_LIST_DIRECTORY)) ? 'r' : '-'; - *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_WRITE_DATA | - ARCHIVE_ENTRY_ACL_ADD_FILE)) ? 'w' : '-'; - *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_EXECUTE)) ? 'x' : '-'; - *(*p)++ = (perm & (ARCHIVE_ENTRY_ACL_APPEND_DATA | - ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY)) ? 'p' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE) ? 'd' : '-'; - *(*p)++ = (perm & ARCHIVE_ENTRY_ACL_DELETE_CHILD) ? 'D' : '-'; - *(*p)++ = (perm & - ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES) ? 'a' : '-'; - *(*p)++ = (perm & - ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES) ? 'A' : '-'; - *(*p)++ = (perm & - ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS) ? 'R' : '-'; - *(*p)++ = (perm & - ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS) ? 'W' : '-'; - *(*p)++ = (perm & - ARCHIVE_ENTRY_ACL_READ_ACL) ? 'c' : '-'; - *(*p)++ = (perm & - ARCHIVE_ENTRY_ACL_WRITE_ACL) ? 'C' : '-'; - *(*p)++ = (perm & - ARCHIVE_ENTRY_ACL_WRITE_OWNER) ? 'o' : '-'; - *(*p)++ = (perm & - ARCHIVE_ENTRY_ACL_SYNCHRONIZE) ? 's' : '-'; + /* NFSv4 ACL perms */ + for (i = 0; i < nfsv4_acl_perm_map_size; i++) { + if (perm & nfsv4_acl_perm_map[i].perm) + *(*p)++ = nfsv4_acl_perm_map[i].c; + else if ((flags & ARCHIVE_ENTRY_ACL_STYLE_COMPACT) == 0) + *(*p)++ = '-'; + } *(*p)++ = ':'; - *(*p)++ = (perm & - ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT) ? 'f' : '-'; - *(*p)++ = (perm & - ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT) ? 'd' : '-'; - *(*p)++ = (perm & - ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY) ? 'i' : '-'; - *(*p)++ = (perm & - ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT) ? 'n' : '-'; - *(*p)++ = (perm & - ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS) ? 'S' : '-'; - *(*p)++ = (perm & - ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS) ? 'F' : '-'; - *(*p)++ = (perm & - ARCHIVE_ENTRY_ACL_ENTRY_INHERITED) ? 'I' : '-'; + for (i = 0; i < nfsv4_acl_flag_map_size; i++) { + if (perm & nfsv4_acl_flag_map[i].perm) + *(*p)++ = nfsv4_acl_flag_map[i].c; + else if ((flags & ARCHIVE_ENTRY_ACL_STYLE_COMPACT) == 0) + *(*p)++ = '-'; + } *(*p)++ = ':'; switch (type) { case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: @@ -1467,11 +1462,8 @@ ismode_w(const wchar_t *start, const wch static int is_nfs4_perms_w(const wchar_t *start, const wchar_t *end, int *permset) { - const wchar_t *p; + const wchar_t *p = start; - if (start >= end) - return (0); - p = start; while (p < end) { switch (*p++) { case L'r': @@ -1533,11 +1525,8 @@ is_nfs4_perms_w(const wchar_t *start, co static int is_nfs4_flags_w(const wchar_t *start, const wchar_t *end, int *permset) { - const wchar_t *p; + const wchar_t *p = start; - if (start >= end) - return (0); - p = start; while (p < end) { switch(*p++) { case L'f': @@ -1945,11 +1934,8 @@ ismode(const char *start, const char *en static int is_nfs4_perms(const char *start, const char *end, int *permset) { - const char *p; + const char *p = start; - if (start >= end) - return (0); - p = start; while (p < end) { switch (*p++) { case 'r': @@ -2011,11 +1997,8 @@ is_nfs4_perms(const char *start, const c static int is_nfs4_flags(const char *start, const char *end, int *permset) { - const char *p; + const char *p = start; - if (start >= end) - return (0); - p = start; while (p < end) { switch(*p++) { case 'f': Modified: head/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry.h Wed Feb 15 20:00:36 2017 (r313781) +++ head/contrib/libarchive/libarchive/archive_entry.h Wed Feb 15 20:17:55 2017 (r313782) @@ -509,6 +509,10 @@ __LA_DECL int archive_entry_acl_next_w( * ARCHIVE_ENTRY_ACL_STYLE_SOLARIS - Output only one colon after "other" and * "mask" entries. * + * Flags only for archive entries with NFSv4 ACL: + * ARCHIVE_ENTRY_ACL_STYLE_COMPACT - Do not output the minus character for + * unset permissions and flags in NFSv4 ACL permission and flag fields + * * Flags for for archive entries with POSIX.1e ACL or NFSv4 ACL: * ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID - Include extra numeric ID field in * each ACL entry. @@ -519,6 +523,7 @@ __LA_DECL int archive_entry_acl_next_w( #define ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT 0x00000002 #define ARCHIVE_ENTRY_ACL_STYLE_SOLARIS 0x00000004 #define ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA 0x00000008 +#define ARCHIVE_ENTRY_ACL_STYLE_COMPACT 0x00000010 __LA_DECL wchar_t *archive_entry_acl_to_text_w(struct archive_entry *, ssize_t * /* len */, int /* flags */); Modified: head/contrib/libarchive/libarchive/archive_entry_acl.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry_acl.3 Wed Feb 15 20:00:36 2017 (r313781) +++ head/contrib/libarchive/libarchive/archive_entry_acl.3 Wed Feb 15 20:17:55 2017 (r313782) @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 27, 2016 +.Dd February 15, 2017 .Dt ARCHIVE_ENTRY_ACL 3 .Os .Sh NAME @@ -390,6 +390,13 @@ Prefix each default ACL entry with the w The mask and other ACLs don not contain a double colon. .El .Pp +The following flags are effecive only on NFSv4 ACL: +.Bl -tag -offset indent -compact -width ARCHIV +.It Dv ARCHIVE_ENTRY_ACL_STYLE_COMPACT +Do not output minus characters for unset permissions and flags in NFSv4 ACL +permission and flag fields. +.El +.Pp The following flags are effective on both POSIX.1e and NFSv4 ACL: .Bl -tag -offset indent -compact -width ARCHIV .It Dv ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Wed Feb 15 20:00:36 2017 (r313781) +++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Wed Feb 15 20:17:55 2017 (r313782) @@ -618,9 +618,9 @@ setup_acls(struct archive_read_disk *a, /* * Translate system ACL permissions into libarchive internal structure */ -static struct { - int archive_perm; - int platform_perm; +static const struct { + const int archive_perm; + const int platform_perm; } acl_perm_map[] = { #if HAVE_SUN_ACL /* Solaris NFSv4 ACL permissions */ {ARCHIVE_ENTRY_ACL_EXECUTE, ACE_EXECUTE}, @@ -687,9 +687,9 @@ static struct { /* * Translate system NFSv4 inheritance flags into libarchive internal structure */ -static struct { - int archive_inherit; - int platform_inherit; +static const struct { + const int archive_inherit; + const int platform_inherit; } acl_inherit_map[] = { #if HAVE_SUN_ACL /* Solaris ACL inheritance flags */ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACE_FILE_INHERIT_ACE}, @@ -882,7 +882,7 @@ sun_acl_is_trivial(acl_t *acl, mode_t mo /* * POSIX.1e ACLs marked with ACL_IS_TRIVIAL are compatible with * FreeBSD acl_is_trivial_np(). On Solaris they have 4 entries, - * incuding mask. + * including mask. */ if (acl->acl_type == ACLENT_T) { if (acl->acl_cnt == 4) Modified: head/contrib/libarchive/libarchive/archive_read_support_format_zip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Wed Feb 15 20:00:36 2017 (r313781) +++ head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Wed Feb 15 20:17:55 2017 (r313782) @@ -452,26 +452,38 @@ process_extra(struct archive_read *a, co /* Zip64 extended information extra field. */ zip_entry->flags |= LA_USED_ZIP64; if (zip_entry->uncompressed_size == 0xffffffff) { - if (datasize < 8) - break; - zip_entry->uncompressed_size = - archive_le64dec(p + offset); + uint64_t t = 0; + if (datasize < 8 + || (t = archive_le64dec(p + offset)) > INT64_MAX) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Malformed 64-bit uncompressed size"); + return ARCHIVE_FAILED; + } + zip_entry->uncompressed_size = t; offset += 8; datasize -= 8; } if (zip_entry->compressed_size == 0xffffffff) { - if (datasize < 8) - break; - zip_entry->compressed_size = - archive_le64dec(p + offset); + uint64_t t = 0; + if (datasize < 8 + || (t = archive_le64dec(p + offset)) > INT64_MAX) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Malformed 64-bit compressed size"); + return ARCHIVE_FAILED; + } + zip_entry->compressed_size = t; offset += 8; datasize -= 8; } if (zip_entry->local_header_offset == 0xffffffff) { - if (datasize < 8) - break; - zip_entry->local_header_offset = - archive_le64dec(p + offset); + uint64_t t = 0; + if (datasize < 8 + || (t = archive_le64dec(p + offset)) > INT64_MAX) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Malformed 64-bit local header offset"); + return ARCHIVE_FAILED; + } + zip_entry->local_header_offset = t; offset += 8; datasize -= 8; } @@ -1156,11 +1168,18 @@ zip_read_data_none(struct archive_read * || (zip->hctx_valid && zip->entry->aes_extra.vendor == AES_VENDOR_AE_2))) { if (zip->entry->flags & LA_USED_ZIP64) { + uint64_t compressed, uncompressed; zip->entry->crc32 = archive_le32dec(p + 4); - zip->entry->compressed_size = - archive_le64dec(p + 8); - zip->entry->uncompressed_size = - archive_le64dec(p + 16); + compressed = archive_le64dec(p + 8); + uncompressed = archive_le64dec(p + 16); + if (compressed > INT64_MAX || uncompressed > INT64_MAX) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Overflow of 64-bit file sizes"); + return ARCHIVE_FAILED; + } + zip->entry->compressed_size = compressed; + zip->entry->uncompressed_size = uncompressed; zip->unconsumed = 24; } else { zip->entry->crc32 = archive_le32dec(p + 4); @@ -1437,9 +1456,18 @@ zip_read_data_deflate(struct archive_rea zip->unconsumed = 4; } if (zip->entry->flags & LA_USED_ZIP64) { + uint64_t compressed, uncompressed; zip->entry->crc32 = archive_le32dec(p); - zip->entry->compressed_size = archive_le64dec(p + 4); - zip->entry->uncompressed_size = archive_le64dec(p + 12); + compressed = archive_le64dec(p + 4); + uncompressed = archive_le64dec(p + 12); + if (compressed > INT64_MAX || uncompressed > INT64_MAX) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Overflow of 64-bit file sizes"); + return ARCHIVE_FAILED; + } + zip->entry->compressed_size = compressed; + zip->entry->uncompressed_size = uncompressed; zip->unconsumed += 20; } else { zip->entry->crc32 = archive_le32dec(p); Modified: head/contrib/libarchive/libarchive/archive_write_disk_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_acl.c Wed Feb 15 20:00:36 2017 (r313781) +++ head/contrib/libarchive/libarchive/archive_write_disk_acl.c Wed Feb 15 20:17:55 2017 (r313782) @@ -101,7 +101,7 @@ archive_write_disk_set_acls(struct archi ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, "default"); #endif /* !HAVE_SUN_ACL */ - /* Simultaeous POSIX.1e and NFSv4 is not supported */ + /* Simultaneous POSIX.1e and NFSv4 is not supported */ return (ret); } #endif /* !HAVE_DARWIN_ACL */ @@ -119,9 +119,9 @@ archive_write_disk_set_acls(struct archi /* * Translate system ACL permissions into libarchive internal structure */ -static struct { - int archive_perm; - int platform_perm; +static const struct { + const int archive_perm; + const int platform_perm; } acl_perm_map[] = { #if HAVE_SUN_ACL /* Solaris NFSv4 ACL permissions */ {ARCHIVE_ENTRY_ACL_EXECUTE, ACE_EXECUTE}, @@ -188,9 +188,9 @@ static struct { /* * Translate system NFSv4 inheritance flags into libarchive internal structure */ -static struct { - int archive_inherit; - int platform_inherit; +static const struct { + const int archive_inherit; + const int platform_inherit; } acl_inherit_map[] = { #if HAVE_SUN_ACL /* Solaris NFSv4 inheritance flags */ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACE_FILE_INHERIT_ACE}, Modified: head/contrib/libarchive/libarchive/archive_write_set_format_pax.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_pax.c Wed Feb 15 20:00:36 2017 (r313781) +++ head/contrib/libarchive/libarchive/archive_write_set_format_pax.c Wed Feb 15 20:17:55 2017 (r313782) @@ -1166,7 +1166,8 @@ archive_write_pax_header(struct archive_ if ((acl_types & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) { ret = add_pax_acl(a, entry_original, pax, ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID | - ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA); + ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA | + ARCHIVE_ENTRY_ACL_STYLE_COMPACT); if (ret == ARCHIVE_FATAL) return (ARCHIVE_FATAL); } Modified: head/contrib/libarchive/libarchive/test/test_acl_pax_nfs4.tar.uu ============================================================================== --- head/contrib/libarchive/libarchive/test/test_acl_pax_nfs4.tar.uu Wed Feb 15 20:00:36 2017 (r313781) +++ head/contrib/libarchive/libarchive/test/test_acl_pax_nfs4.tar.uu Wed Feb 15 20:17:55 2017 (r313782) @@ -1,8 +1,8 @@ begin 644 test_acl_pax_nfs4.tar M4&%X2&5A9&5R+V9I;&4````````````````````````````````````````` M```````````````````````````````````````````````````````````` -M`````````````#`P,#``````````````````````````````` +M`````````````#`P,#``````````````````````````````` M```````````````````````````````````````````````````````````` M``````````````````````````````````````````!U'`M+6%!4E=C0V]S.BTM+2TM+2TZ86QL;W``````````````````````` +M,#`P,C4V(#`P,#`P,#`P,#`P(#`Q,C`Q,@`@>``````````````````````` M```````````````````````````````````````````````````````````` M``````````````````````````````````````````````````!U#HZ9&5N>3HW."QG``````````````` +M`#`P,#`P,#`P,C8R(#`P,#`P,#`P,#`P(#`Q,C`P-P`@>``````````````` M```````````````````````````````````````````````````````````` M``````````````````````````````````````````````````````````!U M'`M+6%!4E=C0V]S.BTM+2TM+2TZ86QL;W6]N94`Z'!A05)78T-O Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CDD8CE0A64 for ; Wed, 15 Feb 2017 21:04:54 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-74.reflexion.net [208.70.210.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF744163C for ; Wed, 15 Feb 2017 21:04:53 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 9529 invoked from network); 15 Feb 2017 21:06:53 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 15 Feb 2017 21:06:53 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.30.0) with SMTP; Wed, 15 Feb 2017 16:04:52 -0500 (EST) Received: (qmail 15488 invoked from network); 15 Feb 2017 21:04:52 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 15 Feb 2017 21:04:52 -0000 Received: from [192.168.1.111] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 8F6DCEC8AE5; Wed, 15 Feb 2017 13:04:51 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf Message-Id: <3993D87B-2A22-484B-8B1E-5BF3CCFD5261@dsl-only.net> Date: Wed, 15 Feb 2017 13:04:50 -0800 To: Sean Bruno , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 21:04:54 -0000 > Author: sbruno > Date: Tue Jan 10 03:23:22 2017 > New Revision: 311849 > URL: https://svnweb.freebsd.org/changeset/base/311849 >=20 > Log: > Migrate e1000 to the IFLIB framework: > . . . > - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko If one used DESTDIR=3D pointing to a local directory for a cross built installkernel for later copying to the system(s) that will use the kernel one gets such things as: # ls -l = /usr/obj/DESTDIRs/clang-pine64-installkernel/boot/kernel/if_igb.ko=20 lrwxr-xr-x 1 root wheel 65 Feb 14 09:25 = /usr/obj/DESTDIRs/clang-pine64-installkernel/boot/kernel/if_igb.ko -> = /usr/obj/DESTDIRs/clang-pine64-installkernel/boot/kernel/if_em.ko But the target place(s) to later copy to is(are) unlikely to have such a path. Relative paths, hard links, or independent copies could avoid such things. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Wed Feb 15 21:22:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76D45CE0EA4 for ; Wed, 15 Feb 2017 21:22:47 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-73.reflexion.net [208.70.210.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 165301F13 for ; Wed, 15 Feb 2017 21:22:46 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 25615 invoked from network); 15 Feb 2017 21:22:38 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 15 Feb 2017 21:22:38 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.30.0) with SMTP; Wed, 15 Feb 2017 16:22:38 -0500 (EST) Received: (qmail 22297 invoked from network); 15 Feb 2017 21:22:38 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 15 Feb 2017 21:22:38 -0000 Received: from [192.168.1.111] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 0B38EEC788F; Wed, 15 Feb 2017 13:22:38 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r313772 - head/sys/arm64/arm64 Message-Id: <62A5F129-EFD3-496B-854C-9D8623EFFD38@dsl-only.net> Date: Wed, 15 Feb 2017 13:22:37 -0800 To: Andrew Turner , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 21:22:47 -0000 > Author: andrew > Date: Wed Feb 15 14:56:47 2017 > New Revision: 313772 > URL:=20 > https://svnweb.freebsd.org/changeset/base/313772 >=20 > Log: > Load the new sp_el0 with interrupts disabled in fork_trampoline. If = an > interrupt arrives in fork_trampoline after sp_el0 was written we may = then > switch to a new thread, enter userland so change this stack pointer, = then > return to this code with the wrong value. This fixes this case by = moving > the load of sp_el0 until after interrupts have been disabled. = https://svnweb.freebsd.org/base/stable/11/sys/arm64/arm64/swtch.S?revision= =3D302408&view=3Dmarkup shows stable/11 has the same issue. Is this to be MFC'd at some point? stable/10 seems to have a different code structure: https://svnweb.freebsd.org/base/stable/10/sys/amd64/amd64/ does not list swtch.S . So I'm unsure about its status for fork returning to the child process and its handling of the stack pointer to be restored. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Wed Feb 15 21:39:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFD54CDF2B1 for ; Wed, 15 Feb 2017 21:39:35 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-vk0-x229.google.com (mail-vk0-x229.google.com [IPv6:2607:f8b0:400c:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B127926 for ; Wed, 15 Feb 2017 21:39:35 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-vk0-x229.google.com with SMTP id r136so107681197vke.1 for ; Wed, 15 Feb 2017 13:39:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=chyB1sCUH1qLYfxTiIqOVbaJx+Wc845ByTKvMiDjAXg=; b=Zu2bgM22UMBwliRrz3KoHiuGrP8f+qn/TkvSVgvYb8teZcBsqP5LFwuvQug/zWDp32 cVcXec0bRvV29s0cIjCddWEHP5HCleNtiG1JcENF99vqMn5Ic5nJ68lYjItwLYtlsgvu mzlN3SCW7gwrGmiBcVoMfrRFgYKjkyWeCT+dRLqBw7Mj+afRMLL/E9BQ2FIPWwqXgtAc Xw5zntn5I5WdEh1YFRLm4RhkFAkz3aRPm2CNuRJ1N2umfUHTkqhP2kzYLtfKeRRhv4Ex T+3HMRjVIO2ZMepQsyil1vGizEfYMKkC83onHgZUPRVfD4vMCyCf2a1+RiQ8JiJQ4hCO /Tvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=chyB1sCUH1qLYfxTiIqOVbaJx+Wc845ByTKvMiDjAXg=; b=pi7kkOkXfzwZNMsUwkcbsXui6G1qVCLxWKumdURuSYmQ69Z+wZzqiXsWtV6BEGAW5u rvJ206mZksfcS4MbseeYjgCYsiH+Tk96lr84C4HO9XuzkckfrJKWO4EVXRQEGQLfQdA8 hrbF/wFJoArVA5L7U9YrWaYgKchuLEkg50UYcHpmM2cQ/ntozTvubKuAAG/4dndYbbal raUy5WpMAKzKUTBMtUZEMOv/sLCcgLTTw9WkOvFluiqZu/32B9YwKBHIwbmiSVXbtEYv WkPnGoHEOtsAyZqgfPoFjKgs/3YjvwgbCAwvlm34ZkzJUd0GsiH5lpcylHC9xnUV3JyC 2mhQ== X-Gm-Message-State: AMke39naOfSK+XwH8tUxWSmZGGcBrERfr3DcqtG7BgjVww0hv1G2G0+N+SDkv3dfxl6hEeh8QxO0XpicgPy3PI1N X-Received: by 10.31.220.5 with SMTP id t5mr18334127vkg.39.1487194774571; Wed, 15 Feb 2017 13:39:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.45.2 with HTTP; Wed, 15 Feb 2017 13:39:34 -0800 (PST) In-Reply-To: <62A5F129-EFD3-496B-854C-9D8623EFFD38@dsl-only.net> References: <62A5F129-EFD3-496B-854C-9D8623EFFD38@dsl-only.net> From: Oliver Pinter Date: Wed, 15 Feb 2017 22:39:34 +0100 Message-ID: Subject: Re: svn commit: r313772 - head/sys/arm64/arm64 To: Mark Millard Cc: Andrew Turner , svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 21:39:36 -0000 On 2/15/17, Mark Millard wrote: >> Author: andrew >> Date: Wed Feb 15 14:56:47 2017 >> New Revision: 313772 >> URL: >> https://svnweb.freebsd.org/changeset/base/313772 >> >> Log: >> Load the new sp_el0 with interrupts disabled in fork_trampoline. If an >> interrupt arrives in fork_trampoline after sp_el0 was written we may >> then >> switch to a new thread, enter userland so change this stack pointer, >> then >> return to this code with the wrong value. This fixes this case by >> moving >> the load of sp_el0 until after interrupts have been disabled. > > https://svnweb.freebsd.org/base/stable/11/sys/arm64/arm64/swtch.S?revision=302408&view=markup > > shows stable/11 has the same issue. > > Is this to be MFC'd at some point? > > > stable/10 seems to have a different code structure: > > https://svnweb.freebsd.org/base/stable/10/sys/amd64/amd64/ This is x86-64 aka amd64 in FreeBSD, in 10-STABLE only 32 bit ARM support exists, so there isn't arm64. > > does not list swtch.S . So I'm unsure about its status for > fork returning to the child process and its handling of the > stack pointer to be restored. > > === > Mark Millard > markmi at dsl-only.net > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Wed Feb 15 21:45:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93709CDF598 for ; Wed, 15 Feb 2017 21:45:14 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-75.reflexion.net [208.70.210.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CC56CD6 for ; Wed, 15 Feb 2017 21:45:13 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 24561 invoked from network); 15 Feb 2017 21:47:13 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 15 Feb 2017 21:47:13 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.30.0) with SMTP; Wed, 15 Feb 2017 16:45:12 -0500 (EST) Received: (qmail 4117 invoked from network); 15 Feb 2017 21:45:11 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 15 Feb 2017 21:45:11 -0000 Received: from [192.168.1.111] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 246CEEC788F; Wed, 15 Feb 2017 13:45:11 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r313772 - head/sys/arm64/arm64 From: Mark Millard In-Reply-To: Date: Wed, 15 Feb 2017 13:45:10 -0800 Cc: Andrew Turner , svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <22EF24E0-3DEA-44C4-AE23-2290082CB574@dsl-only.net> References: <62A5F129-EFD3-496B-854C-9D8623EFFD38@dsl-only.net> To: Oliver Pinter X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 21:45:14 -0000 On 2017-Feb-15, at 1:39 PM, Oliver Pinter = wrote: > On 2/15/17, Mark Millard wrote: >>> Author: andrew >>> Date: Wed Feb 15 14:56:47 2017 >>> New Revision: 313772 >>> URL: >>> https://svnweb.freebsd.org/changeset/base/313772 >>>=20 >>> Log: >>> Load the new sp_el0 with interrupts disabled in fork_trampoline. If = an >>> interrupt arrives in fork_trampoline after sp_el0 was written we = may >>> then >>> switch to a new thread, enter userland so change this stack = pointer, >>> then >>> return to this code with the wrong value. This fixes this case by >>> moving >>> the load of sp_el0 until after interrupts have been disabled. >>=20 >> = https://svnweb.freebsd.org/base/stable/11/sys/arm64/arm64/swtch.S?revision= =3D302408&view=3Dmarkup >>=20 >> shows stable/11 has the same issue. >>=20 >> Is this to be MFC'd at some point? >>=20 >>=20 >> stable/10 seems to have a different code structure: >>=20 >> https://svnweb.freebsd.org/base/stable/10/sys/amd64/amd64/ >=20 > This is x86-64 aka amd64 in FreeBSD, in 10-STABLE only 32 bit ARM > support exists, so there isn't arm64. Clearly I was somewhat distracted and careless when I looked at stable/10. Sorry for the noise in that part. Still the stable/11 part does apply: at least I got something right. >>=20 >> . . . =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Wed Feb 15 21:47:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 032E7CDF5DA for ; Wed, 15 Feb 2017 21:47:54 +0000 (UTC) (envelope-from megan.forster@demandgeneration247.com) Received: from IND01-MA1-obe.outbound.protection.outlook.com (mail-ma1ind01on0059.outbound.protection.outlook.com [104.47.100.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5969AD31 for ; Wed, 15 Feb 2017 21:47:52 +0000 (UTC) (envelope-from megan.forster@demandgeneration247.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORGFT1873619.onmicrosoft.com; s=selector1-demandgeneration247-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tT0uuzOPvyB+YEEJMeoLr+qRbkSiJLHkQOazW8gucjU=; b=TXgqf2LpNchazNm0WacVOtlm8IxNdJIiInmUVaqIO/s8s4+K03E8XHdmZEQfWvLN/3CLxxu7AVoKfoUCdE93Z80uKqgQ1FXN2rFPTwIx3vptym7AFOK9ZTGmPyuMOowtZXQCo5A/UNIzx8kKb+nhJ4jkGtPXSOW5iCClR8ctTYY= Received: from PN1PR01MB0736.INDPRD01.PROD.OUTLOOK.COM (10.174.145.149) by PN1PR01MB0734.INDPRD01.PROD.OUTLOOK.COM (10.174.145.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Wed, 15 Feb 2017 21:47:49 +0000 Received: from PN1PR01MB0736.INDPRD01.PROD.OUTLOOK.COM ([10.174.145.149]) by PN1PR01MB0736.INDPRD01.PROD.OUTLOOK.COM ([10.174.145.149]) with mapi id 15.01.0888.030; Wed, 15 Feb 2017 21:47:49 +0000 From: Megan Forster To: "svn-src-head@freebsd.org" Subject: Avaya Products and Services users DB Thread-Topic: Avaya Products and Services users DB Thread-Index: AdKHzyC6H6OuWtAgT2KnXyVZigoUBw== Date: Wed, 15 Feb 2017 21:47:17 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=megan.forster@demandgeneration247.com; x-originating-ip: [106.51.28.183] x-ms-office365-filtering-correlation-id: fa6f060c-45db-4376-8b1f-08d455ec493a x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:PN1PR01MB0734; x-microsoft-exchange-diagnostics: 1; PN1PR01MB0734; 7:clbGVNqgg7a6FcbeSe1kTuh9LSajHCUYg2T0esd7pTX7PSpyeytBbIM22w3q98f5uWntcDGp7eFjZGsKBqgwml6QhfzEFgSPkSmn1aqRUI3RwH9rpgr5yWMyZmVvB8wnE/0iTAamPRcgOUFo1OWDHna2SrenXrDJgKtcHO3f0aFeYnrZitHBhIOThzTmUMQsAvV8jxMYyHiyp4vdysw8OCBtZ4m6rIYkYfAY/tIgBJ7PT+90ZfSkrvPxVLZjuJf7AwCMV9Vd7mEAbzyLh4l4BLEH99/ztx3MT9spaZ84yP++HNSGnamtDmYoZpE1slRPoY+tibcf/0MkacqN6j7jCA== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(21748063052155); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(2016111802025)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(20161123558025)(6043046)(6072148); SRVR:PN1PR01MB0734; BCL:0; PCL:0; RULEID:; SRVR:PN1PR01MB0734; x-forefront-prvs: 021975AE46 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6039001)(6009001)(7916002)(39450400003)(39410400002)(39840400002)(39850400002)(189002)(199003)(33656002)(53936002)(92566002)(97736004)(189998001)(81156014)(3280700002)(9686003)(81166006)(2900100001)(8676002)(7736002)(450100001)(6916009)(2351001)(9456002)(66066001)(105586002)(3660700001)(74316002)(6666003)(7696004)(122556002)(68736007)(8936002)(5630700001)(50986999)(2906002)(86372001)(55016002)(2501003)(6506006)(110136004)(77096006)(54356999)(106356001)(38730400002)(5660300001)(6436002)(102836003)(5640700003)(101416001)(54896002)(86362001)(3846002)(6116002)(790700001)(6306002)(389900002); DIR:OUT; SFP:1101; SCL:1; SRVR:PN1PR01MB0734; H:PN1PR01MB0736.INDPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: demandgeneration247.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: demandgeneration247.com X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Feb 2017 21:47:17.4507 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 64b5755a-803b-4735-b875-9368d9a172b4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PN1PR01MB0734 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 21:47:54 -0000 Good Day, Would you be interested in acquiring a list of Companies or Clients using A= vaya products and services? We also have other technology: Cisco, Shoretel, Mitel, SAP, Salesforce, Ora= cle, SAS, Verizon, Sprint, Qwest, and many more.. We provide contacts from all over globe: North America, EMEA, Asia Pacific = and LATAM. Please review and let me know which industry you would need the contact lis= t and I will get back to you with counts, pricing and more information in m= y next email. Await your response. Best Regards, Megan Forster Demand Generation- Technology Database From owner-svn-src-head@freebsd.org Wed Feb 15 21:51:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D715FCDF663 for ; Wed, 15 Feb 2017 21:51:11 +0000 (UTC) (envelope-from kelly.collins@infodigitalzone.com) Received: from IND01-MA1-obe.outbound.protection.outlook.com (mail-ma1ind01on0064.outbound.protection.outlook.com [104.47.100.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A28DF06 for ; Wed, 15 Feb 2017 21:51:10 +0000 (UTC) (envelope-from kelly.collins@infodigitalzone.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NETORGFT2188731.onmicrosoft.com; s=selector1-infodigitalzone-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=XkB13Y8TSjI24nNwMcKy2isGtoCT+euvL+92dMkBmuk=; b=S9PQDMp7LUNRuKfhlbNGHgbU7jGfpPTxIvQLafBOYIxB57brNNJ8CdvaZ/i2eWjIK8N2DNHP4VHeU3NdF+jx98XQsxgsmfYeztgLD+mLtc/olqFLEP0o6dX06xR4XkIXJtOGnnaWGAuuweyHo+d2AAz8k+iMtOeZnCTqrlHFN04= Received: from BM1PR01MB0820.INDPRD01.PROD.OUTLOOK.COM (10.174.210.141) by BM1PR01MB0819.INDPRD01.PROD.OUTLOOK.COM (10.174.210.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Wed, 15 Feb 2017 21:51:06 +0000 Received: from BM1PR01MB0820.INDPRD01.PROD.OUTLOOK.COM ([10.174.210.141]) by BM1PR01MB0820.INDPRD01.PROD.OUTLOOK.COM ([10.174.210.141]) with mapi id 15.01.0919.013; Wed, 15 Feb 2017 21:51:07 +0000 From: Kelly Collins To: "svn-src-head@freebsd.org" Subject: Avaya Products and Services users DB Thread-Topic: Avaya Products and Services users DB Thread-Index: AdKH1Y3lhsH/OGusS8Cz/kXN7eZKOg== Date: Wed, 15 Feb 2017 21:50:42 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=kelly.collins@infodigitalzone.com; x-originating-ip: [106.51.28.183] x-ms-office365-filtering-correlation-id: 09dfbd3f-b516-410e-948b-08d455ecbef3 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201702085551020); SRVR:BM1PR01MB0819; x-microsoft-exchange-diagnostics: 1; BM1PR01MB0819; 7:rEYQyItK7fUAxTl3VaekeGgb+ny+gjsWokL4uyqzajcL7daFZYFKVwMblFFifcWVKP2TreoO5JU/eDKuPkQ8DzAvPDG9ifKZajv9y2eJ3PlC3CwtikR4rWPEs9Re4AZr8IHVXfG2qMcDl5nh2lUR39VI/vQtbnSg84vS0ZAq1L154xosOgVMBh3RY100SO8byqfUr4RtxgcMsO00Mv07ANKEdsDHeW2BB0fhuogPbLa/sCZTRGjAsO2I3Gs1/tSrzTE4ZfKImnIwSvaWw8sqcfPMMPV/UcQPGNpMYBQyyfRPHeNDhNatLTzADg0oB0KFmdiT7O6Q/0y/Nb6KQxVCww== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(21748063052155); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123564025)(2016111802025)(20161123558025)(20161123560025)(20161123555025)(20161123562025)(6072148)(6043046); SRVR:BM1PR01MB0819; BCL:0; PCL:0; RULEID:; SRVR:BM1PR01MB0819; x-forefront-prvs: 021975AE46 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39410400002)(39840400002)(39850400002)(39450400003)(199003)(189002)(106356001)(6436002)(54896002)(55016002)(105586002)(5640700003)(2351001)(6506006)(33656002)(6306002)(77096006)(101416001)(50986999)(9456002)(9686003)(54356999)(92566002)(66066001)(122556002)(389900002)(74316002)(2900100001)(7736002)(450100001)(8936002)(97736004)(189998001)(5660300001)(7696004)(6666003)(53936002)(6916009)(790700001)(102836003)(110136004)(3846002)(3280700002)(3660700001)(38730400002)(86362001)(68736007)(2501003)(5630700001)(6116002)(8676002)(81166006)(2906002)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:BM1PR01MB0819; H:BM1PR01MB0820.INDPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: infodigitalzone.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: infodigitalzone.com X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Feb 2017 21:50:42.5420 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0ed40d93-50a2-4bae-a38e-107c80b2c3c5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BM1PR01MB0819 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 21:51:11 -0000 Good Day, Would you be interested in acquiring a list of Companies or Clients using A= vaya products and services? We also have other technology: Cisco, Shoretel, Mitel, SAP, Salesforce, Ora= cle, SAS, Verizon, Sprint, Qwest, and many more.. We provide contacts from all over globe: North America, EMEA, Asia Pacific = and LATAM. Please review and let me know which industry you would need the contact lis= t and I will get back to you with counts, pricing and more information in m= y next email. Await your response. Best Regards, Kelly Collins Demand Generation- Technology Database From owner-svn-src-head@freebsd.org Wed Feb 15 23:04:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6330CCE0984; Wed, 15 Feb 2017 23:04:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23AFB1351; Wed, 15 Feb 2017 23:04:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FN4RUc085292; Wed, 15 Feb 2017 23:04:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FN4QKA085281; Wed, 15 Feb 2017 23:04:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702152304.v1FN4QKA085281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 15 Feb 2017 23:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313783 - in head: share/man/man4 share/man/man4/man4.i386 sys/conf sys/dev/aha sys/dev/buslogic sys/dev/ep sys/dev/mca sys/i386/bios sys/i386/conf sys/x86/isa sys/x86/x86 tools/kerneld... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 23:04:28 -0000 Author: imp Date: Wed Feb 15 23:04:25 2017 New Revision: 313783 URL: https://svnweb.freebsd.org/changeset/base/313783 Log: Remove Micro Channel Architecture support. Of the commonly available machines, only a few 486 machines that used it, and those haven't had enough memory to run FreeBSD for quite some time (often limited to 16MB). Not to be confused with the Machine Check Architecture, which is still very much alive and used (and untouched by this commit). No Objection From: arch@ Deleted: head/sys/dev/aha/aha_mca.c head/sys/dev/buslogic/bt_mca.c head/sys/dev/ep/if_ep_mca.c head/sys/dev/mca/ head/sys/i386/bios/mca_machdep.c head/sys/i386/bios/mca_machdep.h head/tools/kerneldoc/subsys/Doxyfile-dev_mca Modified: head/share/man/man4/aha.4 head/share/man/man4/le.4 head/share/man/man4/man4.i386/ep.4 head/sys/conf/files head/sys/conf/files.i386 head/sys/conf/options head/sys/i386/conf/NOTES head/sys/x86/isa/atpic.c head/sys/x86/isa/clock.c head/sys/x86/isa/nmi.c head/sys/x86/x86/legacy.c Modified: head/share/man/man4/aha.4 ============================================================================== --- head/share/man/man4/aha.4 Wed Feb 15 20:17:55 2017 (r313782) +++ head/share/man/man4/aha.4 Wed Feb 15 23:04:25 2017 (r313783) @@ -74,10 +74,6 @@ locations and attaches to the first unat The possible port addresses for this card are 0x330, 0x334, 0x230, 0x234, 0x130, and 0x134. -.Pp -The AHA-1640 is an MCA bus card. -Since the MCA bus is a self-identifying bus, no setting of hints is -required. .Sh HARDWARE The .Nm Modified: head/share/man/man4/le.4 ============================================================================== --- head/share/man/man4/le.4 Wed Feb 15 20:17:55 2017 (r313782) +++ head/share/man/man4/le.4 Wed Feb 15 23:04:25 2017 (r313783) @@ -204,19 +204,6 @@ bus Ethernet adapters. .\" .It .\" .Tn DEC DE422 .\" .El -.\" .Ss MCA -.\" The -.\" .Tn MCA -.\" bus Ethernet cards supported by the -.\" .Nm -.\" driver are: -.\" .Pp -.\" .Bl -bullet -compact -.\" .It -.\" .Tn SKNET Personal MC2 -.\" .It -.\" .Tn SKNET MC2+ -.\" .El .Ss PCI The .Tn PCI Modified: head/share/man/man4/man4.i386/ep.4 ============================================================================== --- head/share/man/man4/man4.i386/ep.4 Wed Feb 15 20:17:55 2017 (r313782) +++ head/share/man/man4/man4.i386/ep.4 Wed Feb 15 23:04:25 2017 (r313783) @@ -95,8 +95,6 @@ driver supports Ethernet adapters based .It 3Com 3C509B-TP, 3C509B-BNC, 3C509B-Combo, 3C509B-TPO, 3C509B-TPC ISA .It -3Com 3C529, 3C529-TP MCA -.It 3Com 3C562/3C563 PCMCIA .It 3Com 3C574, 3C574TX, 3C574-TX, 3CCFE574BT, 3CXFE574BT, 3C3FE574BT PCMCIA Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Feb 15 20:17:55 2017 (r313782) +++ head/sys/conf/files Wed Feb 15 23:04:25 2017 (r313783) @@ -694,7 +694,6 @@ dev/agp/agp.c optional agp pci dev/agp/agp_if.m optional agp pci dev/aha/aha.c optional aha dev/aha/aha_isa.c optional aha isa -dev/aha/aha_mca.c optional aha mca dev/ahb/ahb.c optional ahb eisa dev/ahci/ahci.c optional ahci dev/ahci/ahciem.c optional ahci @@ -1265,7 +1264,6 @@ dev/bnxt/if_bnxt.c optional bnxt iflib dev/buslogic/bt.c optional bt dev/buslogic/bt_eisa.c optional bt eisa dev/buslogic/bt_isa.c optional bt isa -dev/buslogic/bt_mca.c optional bt mca dev/buslogic/bt_pci.c optional bt pci dev/bwi/bwimac.c optional bwi dev/bwi/bwiphy.c optional bwi @@ -1609,7 +1607,6 @@ dev/en/midway.c optional en dev/ep/if_ep.c optional ep dev/ep/if_ep_eisa.c optional ep eisa dev/ep/if_ep_isa.c optional ep isa -dev/ep/if_ep_mca.c optional ep mca dev/ep/if_ep_pccard.c optional ep pccard dev/esp/esp_pci.c optional esp pci dev/esp/ncr53c9x.c optional esp @@ -2176,7 +2173,6 @@ dev/malo/if_malo.c optional malo dev/malo/if_malohal.c optional malo dev/malo/if_malo_pci.c optional malo pci dev/mc146818/mc146818.c optional mc146818 -dev/mca/mca_bus.c optional mca dev/md/md.c optional md dev/mdio/mdio_if.m optional miiproxy | mdio dev/mdio/mdio.c optional miiproxy | mdio Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Feb 15 20:17:55 2017 (r313782) +++ head/sys/conf/files.i386 Wed Feb 15 23:04:25 2017 (r313783) @@ -474,7 +474,6 @@ acpi_wakedata.h optional acpi \ clean "acpi_wakedata.h" # i386/bios/apm.c optional apm -i386/bios/mca_machdep.c optional mca i386/bios/smapi.c optional smapi i386/bios/smapi_bios.S optional smapi i386/cloudabi32/cloudabi32_sysvec.c optional compat_cloudabi32 Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Feb 15 20:17:55 2017 (r313782) +++ head/sys/conf/options Wed Feb 15 23:04:25 2017 (r313783) @@ -723,7 +723,6 @@ ISAPNP opt_isa.h # various 'device presence' options. DEV_BPF opt_bpf.h DEV_CARP opt_carp.h -DEV_MCA opt_mca.h DEV_NETMAP opt_global.h DEV_PCI opt_pci.h DEV_PF opt_pf.h Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Wed Feb 15 20:17:55 2017 (r313782) +++ head/sys/i386/conf/NOTES Wed Feb 15 23:04:25 2017 (r313783) @@ -353,15 +353,6 @@ device eisa options EISA_SLOTS=12 # -# MCA bus: -# -# The MCA bus device is `mca'. It provides auto-detection and -# configuration support for all devices on the MCA bus. -# No hints are required for MCA. - -device mca - -# # AGP GART support device agp Modified: head/sys/x86/isa/atpic.c ============================================================================== --- head/sys/x86/isa/atpic.c Wed Feb 15 20:17:55 2017 (r313782) +++ head/sys/x86/isa/atpic.c Wed Feb 15 23:04:25 2017 (r313783) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_auto_eoi.h" #include "opt_isa.h" -#include "opt_mca.h" #include #include @@ -54,9 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef DEV_MCA -#include -#endif #ifdef __amd64__ #define SDT_ATPIC SDT_SYSIGT @@ -356,13 +352,7 @@ i8259_init(struct atpic *pic, int slave) /* Reset the PIC and program with next four bytes. */ spinlock_enter(); -#ifdef DEV_MCA - /* MCA uses level triggered interrupts. */ - if (MCA_system) - outb(pic->at_ioaddr, ICW1_RESET | ICW1_IC4 | ICW1_LTIM); - else -#endif - outb(pic->at_ioaddr, ICW1_RESET | ICW1_IC4); + outb(pic->at_ioaddr, ICW1_RESET | ICW1_IC4); imr_addr = pic->at_ioaddr + ICU_IMR_OFFSET; /* Start vector. */ @@ -419,14 +409,6 @@ atpic_startup(void) ai->at_irq, ai->at_intr, SDT_ATPIC, SEL_KPL, GSEL_ATPIC); } -#ifdef DEV_MCA - /* For MCA systems, all interrupts are level triggered. */ - if (MCA_system) - for (i = 0, ai = atintrs; i < NUM_ISA_IRQS; i++, ai++) - ai->at_trigger = INTR_TRIGGER_LEVEL; - else -#endif - /* * Look for an ELCR. If we find one, update the trigger modes. * If we don't find one, assume that IRQs 0, 1, 2, and 13 are Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Wed Feb 15 20:17:55 2017 (r313782) +++ head/sys/x86/isa/clock.c Wed Feb 15 23:04:25 2017 (r313783) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include "opt_clock.h" #include "opt_isa.h" -#include "opt_mca.h" #include #include @@ -73,10 +72,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#ifdef DEV_MCA -#include -#endif - int clkintr_pending; #ifndef TIMER_FREQ #define TIMER_FREQ 1193182 @@ -153,11 +148,6 @@ clkintr(void *arg) if (sc->et.et_active && sc->mode != MODE_STOP) sc->et.et_event_cb(&sc->et, sc->et.et_arg); -#ifdef DEV_MCA - /* Reset clock interrupt by asserting bit 7 of port 0x61 */ - if (MCA_system) - outb(0x61, inb(0x61) | 0x80); -#endif return (FILTER_HANDLED); } Modified: head/sys/x86/isa/nmi.c ============================================================================== --- head/sys/x86/isa/nmi.c Wed Feb 15 20:17:55 2017 (r313782) +++ head/sys/x86/isa/nmi.c Wed Feb 15 23:04:25 2017 (r313783) @@ -35,18 +35,12 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_mca.h" - #include #include #include #include -#ifdef DEV_MCA -#include -#endif - #define NMI_PARITY (1 << 7) #define NMI_IOCHAN (1 << 6) #define ENMI_WATCHDOG (1 << 7) @@ -65,10 +59,6 @@ isa_nmi(int cd) int eisa_port = inb(0x461); log(LOG_CRIT, "NMI ISA %x, EISA %x\n", isa_port, eisa_port); -#ifdef DEV_MCA - if (MCA_system && mca_bus_nmi()) - return(0); -#endif if (isa_port & NMI_PARITY) { log(LOG_CRIT, "RAM parity error, likely hardware failure."); Modified: head/sys/x86/x86/legacy.c ============================================================================== --- head/sys/x86/x86/legacy.c Wed Feb 15 20:17:55 2017 (r313782) +++ head/sys/x86/x86/legacy.c Wed Feb 15 23:04:25 2017 (r313783) @@ -29,7 +29,6 @@ #ifdef __i386__ #include "opt_eisa.h" -#include "opt_mca.h" #endif #include __FBSDID("$FreeBSD$"); @@ -51,10 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef DEV_MCA -#include -#endif - #include #include #include @@ -144,14 +139,6 @@ legacy_attach(device_t dev) device_probe_and_attach(child); } #endif -#ifdef DEV_MCA - if (MCA_system && !devclass_get_device(devclass_find("mca"), 0)) { - child = BUS_ADD_CHILD(dev, 0, "mca", 0); - if (child == 0) - panic("legacy_probe mca"); - device_probe_and_attach(child); - } -#endif if (!devclass_get_device(devclass_find("isa"), 0)) { child = BUS_ADD_CHILD(dev, 0, "isa", 0); if (child == NULL) From owner-svn-src-head@freebsd.org Wed Feb 15 23:32:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3B7CCE0F54 for ; Wed, 15 Feb 2017 23:32:18 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D7601DF for ; Wed, 15 Feb 2017 23:32:18 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 06a6e5b6-f3d7-11e6-ba57-8bc134ee460a X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 06a6e5b6-f3d7-11e6-ba57-8bc134ee460a; Wed, 15 Feb 2017 23:32:34 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v1FNWFkv002243; Wed, 15 Feb 2017 16:32:15 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1487201535.73144.15.camel@freebsd.org> Subject: Re: svn commit: r312679 - head/sys/arm/freescale/imx From: Ian Lepore To: Yoshiro MIHIRA , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "freebsd-arm@FreeBSD.org" Date: Wed, 15 Feb 2017 16:32:15 -0700 In-Reply-To: References: <201701240209.v0O29UDD047838@repo.freebsd.org> Content-Type: multipart/mixed; boundary="=-7+SAO7B1lPddo/yKeoRL" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 23:32:18 -0000 --=-7+SAO7B1lPddo/yKeoRL Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit > > Author: ian > > Date: Tue Jan 24 02:09:30 2017 > > New Revision: 312679 > > URL: https://svnweb.freebsd.org/changeset/base/312679 [...] On Wed, 2017-02-15 at 10:31 +0000, Yoshiro MIHIRA wrote: > Hi. > Ian > > Thank you for your strong effort to support imx6 board. > > I have SolidRun HummingBoard-i2(imx6dl-hummingboard). > > I have reboot issue(never reset after reboot) and if I use Linux, I > reproduce this issue So I reported this issue to SolidRun Forum. > http://forum.solid-run.com/linux-on-cubox-i-and-hummingboard-f8/need- > to-push-reset-button-to-reboot-linux-system-t3122.html > But I could not get any information. > > I tested latest kernel(r313280) unfortunately it was not solved. > > Do you know other information about reset issue, please let me know. > > Currently I need to push reset button when I restart system... > > Yours > Yoshiro MIHIRA > [adding arm@ list] Are you set up to build and test a custom kernel?  If so, try applying the patch I'm attaching to this mail and let me know if it helps.  This turns on a bit in the control register that is described in the manual as "use a new more robust method to generate a software reset" (if it's better, I wonder why they didn't make it the hardware default?). -- Ian --=-7+SAO7B1lPddo/yKeoRL Content-Disposition: inline; filename="temp.diff" Content-Type: text/x-patch; name="temp.diff"; charset="us-ascii" Content-Transfer-Encoding: 7bit Index: imx_machdep.c =================================================================== --- imx_machdep.c (revision 313569) +++ imx_machdep.c (working copy) @@ -78,6 +78,7 @@ imx_wdog_cpu_reset(vm_offset_t wdcr_physaddr) if ((pcr = devmap_ptov(wdcr_physaddr, sizeof(*pcr))) == NULL) { printf("cpu_reset() can't find its control register... locking up now."); } else { + *pcr |= 1 << 6; *pcr &= ~WDOG_CR_SRS; *pcr &= ~WDOG_CR_SRS; *pcr &= ~WDOG_CR_SRS; --=-7+SAO7B1lPddo/yKeoRL-- From owner-svn-src-head@freebsd.org Wed Feb 15 23:33:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A368BCE004A; Wed, 15 Feb 2017 23:33:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 733BC669; Wed, 15 Feb 2017 23:33:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FNXEV0097302; Wed, 15 Feb 2017 23:33:14 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FNXE1u097301; Wed, 15 Feb 2017 23:33:14 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702152333.v1FNXE1u097301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 15 Feb 2017 23:33:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313784 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 23:33:15 -0000 Author: mjg Date: Wed Feb 15 23:33:14 2017 New Revision: 313784 URL: https://svnweb.freebsd.org/changeset/base/313784 Log: rwlock: tidy up r313392 While a new bit was added and thread alignment got shifted to accomodate it, RW_READERS_SHIFT was not modified accordingly and clashed with the new flag. This was surprisingly harmless. If the lock was taken for writing, other flags were tested. If the lock was taken for reading, it would correctly work for readers > 1 and this was the only relevant test performed. Modified: head/sys/sys/rwlock.h Modified: head/sys/sys/rwlock.h ============================================================================== --- head/sys/sys/rwlock.h Wed Feb 15 23:04:25 2017 (r313783) +++ head/sys/sys/rwlock.h Wed Feb 15 23:33:14 2017 (r313784) @@ -65,7 +65,7 @@ #define RW_LOCK_WAITERS (RW_LOCK_READ_WAITERS | RW_LOCK_WRITE_WAITERS) #define RW_OWNER(x) ((x) & ~RW_LOCK_FLAGMASK) -#define RW_READERS_SHIFT 4 +#define RW_READERS_SHIFT 5 #define RW_READERS(x) (RW_OWNER((x)) >> RW_READERS_SHIFT) #define RW_READERS_LOCK(x) ((x) << RW_READERS_SHIFT | RW_LOCK_READ) #define RW_ONE_READER (1 << RW_READERS_SHIFT) From owner-svn-src-head@freebsd.org Wed Feb 15 23:49:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFFCECE0443; Wed, 15 Feb 2017 23:49:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80C0BE90; Wed, 15 Feb 2017 23:49:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1FNnSwm001505; Wed, 15 Feb 2017 23:49:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1FNnS4Q001503; Wed, 15 Feb 2017 23:49:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702152349.v1FNnS4Q001503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 15 Feb 2017 23:49:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313785 - in head/sys/dev: acpica pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 23:49:29 -0000 Author: imp Date: Wed Feb 15 23:49:28 2017 New Revision: 313785 URL: https://svnweb.freebsd.org/changeset/base/313785 Log: Use symbolic constants for OSC support / control negotiations. Differential Revision: https://reviews.freebsd.org/D9604 Modified: head/sys/dev/acpica/acpi_pcib_acpi.c head/sys/dev/pci/pcireg.h Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Wed Feb 15 23:33:14 2017 (r313784) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Wed Feb 15 23:49:28 2017 (r313785) @@ -309,15 +309,19 @@ acpi_pcib_osc(struct acpi_hpcib_softc *s 0x96, 0x57, 0x74, 0x41, 0xc0, 0x3d, 0xd7, 0x66 }; + /* Status Field */ + cap_set[PCI_OSC_STATUS] = 0; + /* Support Field: Extended PCI Config Space, MSI */ - cap_set[1] = 0x11; + cap_set[PCI_OSC_SUPPORT] = PCIM_OSC_SUPPORT_EXT_PCI_CONF | + PCIM_OSC_SUPPORT_MSI; /* Control Field */ - cap_set[2] = 0; + cap_set[PCI_OSC_CTL] = 0; #ifdef PCI_HP /* Control Field: PCI Express Native Hot Plug */ - cap_set[2] |= 0x1; + cap_set[PCI_OSC_CTL] |= PCIM_OSC_CTL_PCIE_HP; #endif status = acpi_EvaluateOSC(sc->ap_handle, pci_host_bridge_uuid, 1, @@ -330,10 +334,16 @@ acpi_pcib_osc(struct acpi_hpcib_softc *s return; } - if (cap_set[0] != 0) { + if (cap_set[PCI_OSC_STATUS] != 0) { device_printf(sc->ap_dev, "_OSC returned error %#x\n", cap_set[0]); } + +#ifdef PCI_HP + if ((cap_set[PCI_OSC_CTL] & PCIM_OSC_CTL_PCIE_HP) == 0 && bootverbose) { + device_printf(sc->ap_dev, "_OSC didn't allow HP control\n"); + } +#endif } static int Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Wed Feb 15 23:33:14 2017 (r313784) +++ head/sys/dev/pci/pcireg.h Wed Feb 15 23:49:28 2017 (r313785) @@ -1040,3 +1040,19 @@ #define PCIR_SRIOV_BARS 0x24 #define PCIR_SRIOV_BAR(x) (PCIR_SRIOV_BARS + (x) * 4) +/* + * PCI Express Firmware Interface definitions + */ +#define PCI_OSC_STATUS 0 +#define PCI_OSC_SUPPORT 1 +#define PCIM_OSC_SUPPORT_EXT_PCI_CONF 0x01 /* Extended PCI Config Space */ +#define PCIM_OSC_SUPPORT_ASPM 0x02 /* Active State Power Management */ +#define PCIM_OSC_SUPPORT_CPMC 0x04 /* Clock Power Management Cap */ +#define PCIM_OSC_SUPPORT_SEG_GROUP 0x08 /* PCI Segment Groups supported */ +#define PCIM_OSC_SUPPORT_MSI 0x10 /* MSI signalling supported */ +#define PCI_OSC_CTL 2 +#define PCIM_OSC_CTL_PCIE_HP 0x01 /* PCIe Native Hot Plug */ +#define PCIM_OSC_CTL_SHPC_HP 0x02 /* SHPC Native Hot Plug */ +#define PCIM_OSC_CTL_PCIE_PME 0x04 /* PCIe Native Power Mgt Events */ +#define PCIM_OSC_CTL_PCIE_AER 0x08 /* PCIe Advanced Error Reporting */ +#define PCIM_OSC_CTL_PCIE_CAP_STRUCT 0x10 /* Various Capability Structures */ From owner-svn-src-head@freebsd.org Thu Feb 16 03:12:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C814CE00D4; Thu, 16 Feb 2017 03:12:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C2D110E; Thu, 16 Feb 2017 03:12:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1G3Clt9085863; Thu, 16 Feb 2017 03:12:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1G3Cl5H085862; Thu, 16 Feb 2017 03:12:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201702160312.v1G3Cl5H085862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 16 Feb 2017 03:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313787 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 03:12:48 -0000 Author: emaste Date: Thu Feb 16 03:12:47 2017 New Revision: 313787 URL: https://svnweb.freebsd.org/changeset/base/313787 Log: makefs: use a macro to simplify per-fs function declarations makefs.h 1.28 Obtained from: NetBSD Modified: head/usr.sbin/makefs/makefs.h Modified: head/usr.sbin/makefs/makefs.h ============================================================================== --- head/usr.sbin/makefs/makefs.h Thu Feb 16 01:44:56 2017 (r313786) +++ head/usr.sbin/makefs/makefs.h Thu Feb 16 03:12:47 2017 (r313787) @@ -158,16 +158,14 @@ int set_option(option_t *, const char * fsnode * walk_dir(const char *, const char *, fsnode *, fsnode *); void free_fsnodes(fsnode *); -void ffs_prep_opts(fsinfo_t *); -int ffs_parse_opts(const char *, fsinfo_t *); -void ffs_cleanup_opts(fsinfo_t *); -void ffs_makefs(const char *, const char *, fsnode *, fsinfo_t *); - -void cd9660_prep_opts(fsinfo_t *); -int cd9660_parse_opts(const char *, fsinfo_t *); -void cd9660_cleanup_opts(fsinfo_t *); -void cd9660_makefs(const char *, const char *, fsnode *, fsinfo_t *); +#define DECLARE_FUN(fs) \ +void fs ## _prep_opts(fsinfo_t *); \ +int fs ## _parse_opts(const char *, fsinfo_t *); \ +void fs ## _cleanup_opts(fsinfo_t *); \ +void fs ## _makefs(const char *, const char *, fsnode *, fsinfo_t *) +DECLARE_FUN(ffs); +DECLARE_FUN(cd9660); extern u_int debug; extern int dupsok; From owner-svn-src-head@freebsd.org Thu Feb 16 06:31:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9718DCE1A7E; Thu, 16 Feb 2017 06:31:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62E3910E0; Thu, 16 Feb 2017 06:31:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1G6VaSI066543; Thu, 16 Feb 2017 06:31:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1G6VaWG066542; Thu, 16 Feb 2017 06:31:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702160631.v1G6VaWG066542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 Feb 2017 06:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313797 - head/sys/fs/devfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 06:31:37 -0000 Author: kib Date: Thu Feb 16 06:31:36 2017 New Revision: 313797 URL: https://svnweb.freebsd.org/changeset/base/313797 Log: Minor style fixes. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/fs/devfs/devfs_devs.c Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Thu Feb 16 06:16:50 2017 (r313796) +++ head/sys/fs/devfs/devfs_devs.c Thu Feb 16 06:31:36 2017 (r313797) @@ -208,7 +208,7 @@ devfs_newdirent(char *name, int namelen) struct dirent d; d.d_namlen = namelen; - i = sizeof (*de) + GENERIC_DIRSIZ(&d); + i = sizeof(*de) + GENERIC_DIRSIZ(&d); de = malloc(i, M_DEVFS3, M_WAITOK | M_ZERO); de->de_dirent = (struct dirent *)(de + 1); de->de_dirent->d_namlen = namelen; @@ -246,7 +246,8 @@ devfs_parent_dirent(struct devfs_dirent } struct devfs_dirent * -devfs_vmkdir(struct devfs_mount *dmp, char *name, int namelen, struct devfs_dirent *dotdot, u_int inode) +devfs_vmkdir(struct devfs_mount *dmp, char *name, int namelen, + struct devfs_dirent *dotdot, u_int inode) { struct devfs_dirent *dd; struct devfs_dirent *de; From owner-svn-src-head@freebsd.org Thu Feb 16 06:32:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7CACCE1AFF; Thu, 16 Feb 2017 06:32:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7517712D5; Thu, 16 Feb 2017 06:32:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1G6Wd7X066618; Thu, 16 Feb 2017 06:32:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1G6Wdnb066617; Thu, 16 Feb 2017 06:32:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702160632.v1G6Wdnb066617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 Feb 2017 06:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313798 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 06:32:40 -0000 Author: kib Date: Thu Feb 16 06:32:39 2017 New Revision: 313798 URL: https://svnweb.freebsd.org/changeset/base/313798 Log: Use uintmax_t to print st_nlink. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/bin/ls/print.c Modified: head/bin/ls/print.c ============================================================================== --- head/bin/ls/print.c Thu Feb 16 06:31:36 2017 (r313797) +++ head/bin/ls/print.c Thu Feb 16 06:32:39 2017 (r313798) @@ -259,12 +259,12 @@ printlong(const DISPLAY *dp) np = p->fts_pointer; xo_attr("value", "%03o", (int) sp->st_mode & ALLPERMS); if (f_numericonly) { - xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {td:user/%-*s}{e:user/%ju} {td:group/%-*s}{e:group/%ju} ", - buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, + xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*ju} {td:user/%-*s}{e:user/%ju} {td:group/%-*s}{e:group/%ju} ", + buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, (uintmax_t)sp->st_nlink, dp->s_user, np->user, (uintmax_t)sp->st_uid, dp->s_group, np->group, (uintmax_t)sp->st_gid); } else { - xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {t:user/%-*s} {t:group/%-*s} ", - buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, + xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*ju} {t:user/%-*s} {t:group/%-*s} ", + buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, (uintmax_t)sp->st_nlink, dp->s_user, np->user, dp->s_group, np->group); } if (S_ISBLK(sp->st_mode)) From owner-svn-src-head@freebsd.org Thu Feb 16 06:34:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49C79CE1BED; Thu, 16 Feb 2017 06:34:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07EF514EE; Thu, 16 Feb 2017 06:34:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1G6YLMJ066734; Thu, 16 Feb 2017 06:34:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1G6YL7T066733; Thu, 16 Feb 2017 06:34:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702160634.v1G6YL7T066733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 Feb 2017 06:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313799 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 06:34:22 -0000 Author: kib Date: Thu Feb 16 06:34:20 2017 New Revision: 313799 URL: https://svnweb.freebsd.org/changeset/base/313799 Log: Do not allocate char[MNAMELEN] on stack in nfsclient. Right now this is not critical, but will be after planned increase of MNAMELEN from 88 to 1k. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Thu Feb 16 06:32:39 2017 (r313798) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Thu Feb 16 06:34:20 2017 (r313799) @@ -749,8 +749,7 @@ static int nfs_mount_parse_from(struct vfsoptlist *opts, char **hostnamep, struct sockaddr_in **sinp, char *dirpath, size_t dirpathsize, int *dirlenp) { - char nam[MNAMELEN + 1]; - char *delimp, *hostp, *spec; + char *nam, *delimp, *hostp, *spec; int error, have_bracket = 0, offset, rv, speclen; struct sockaddr_in *sin; size_t len; @@ -758,6 +757,7 @@ nfs_mount_parse_from(struct vfsoptlist * error = vfs_getopt(opts, "from", (void **)&spec, &speclen); if (error != 0) return (error); + nam = malloc(MNAMELEN + 1, M_TEMP, M_WAITOK); /* * This part comes from sbin/mount_nfs/mount_nfs.c:getnfsargs(). @@ -776,6 +776,7 @@ nfs_mount_parse_from(struct vfsoptlist * hostp = delimp + 1; } else { printf("%s: no : nfs-name\n", __func__); + free(nam, M_TEMP); return (EINVAL); } *delimp = '\0'; @@ -791,6 +792,7 @@ nfs_mount_parse_from(struct vfsoptlist * spec[speclen - 1] = '\0'; if (strlen(hostp) + strlen(spec) + 1 > MNAMELEN) { printf("%s: %s:%s: name too long", __func__, hostp, spec); + free(nam, M_TEMP); return (EINVAL); } /* Make both '@' and ':' notations equal */ @@ -816,6 +818,7 @@ nfs_mount_parse_from(struct vfsoptlist * if (rv != 1) { printf("%s: cannot parse '%s', inet_pton() returned %d\n", __func__, hostp, rv); + free(nam, M_TEMP); free(sin, M_SONAME); return (EINVAL); } @@ -832,6 +835,7 @@ nfs_mount_parse_from(struct vfsoptlist * strlcpy(dirpath, spec, dirpathsize); *dirlenp = strlen(dirpath); + free(nam, M_TEMP); return (0); } @@ -874,7 +878,7 @@ nfs_mount(struct mount *mp) struct sockaddr *nam = NULL; struct vnode *vp; struct thread *td; - char hst[MNAMELEN]; + char *hst; u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100]; char *cp, *opt, *name, *secname; int nametimeo = NFS_DEFAULT_NAMETIMEO; @@ -886,6 +890,7 @@ nfs_mount(struct mount *mp) has_nfs_args_opt = 0; has_nfs_from_opt = 0; + hst = malloc(MNAMELEN, M_TEMP, M_WAITOK); if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) { error = EINVAL; goto out; @@ -1324,6 +1329,7 @@ out: mp->mnt_kern_flag |= MNTK_NULL_NOCACHE; MNT_IUNLOCK(mp); } + free(hst, M_TEMP); return (error); } From owner-svn-src-head@freebsd.org Thu Feb 16 06:36:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE11ECE1CC6; Thu, 16 Feb 2017 06:36:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB1E116D1; Thu, 16 Feb 2017 06:36:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1G6aGX1066847; Thu, 16 Feb 2017 06:36:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1G6aGqY066846; Thu, 16 Feb 2017 06:36:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702160636.v1G6aGqY066846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 Feb 2017 06:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313800 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 06:36:18 -0000 Author: kib Date: Thu Feb 16 06:36:16 2017 New Revision: 313800 URL: https://svnweb.freebsd.org/changeset/base/313800 Log: Do not access memory past the buffer end. Do not accept and silently truncate too long hostname. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Thu Feb 16 06:34:20 2017 (r313799) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Thu Feb 16 06:36:16 2017 (r313800) @@ -1270,8 +1270,13 @@ nfs_mount(struct mount *mp) error = EINVAL; goto out; } - bcopy(args.hostname, hst, MNAMELEN); - hst[MNAMELEN - 1] = '\0'; + if (len >= MNAMELEN) { + vfs_mount_error(mp, "Hostname too long"); + error = EINVAL; + goto out; + } + bcopy(args.hostname, hst, len); + hst[len] = '\0'; } if (vfs_getopt(mp->mnt_optnew, "principal", (void **)&name, NULL) == 0) From owner-svn-src-head@freebsd.org Thu Feb 16 06:44:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C591CE1F2A; Thu, 16 Feb 2017 06:44:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EAC01BEB; Thu, 16 Feb 2017 06:44:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v1G6ij1g005502 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 16 Feb 2017 08:44:46 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v1G6ij1g005502 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v1G6ijY4005501; Thu, 16 Feb 2017 08:44:45 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 16 Feb 2017 08:44:45 +0200 From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313798 - head/bin/ls Message-ID: <20170216064445.GH2092@kib.kiev.ua> References: <201702160632.v1G6Wdnb066617@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201702160632.v1G6Wdnb066617@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 06:44:56 -0000 On Thu, Feb 16, 2017 at 06:32:39AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Thu Feb 16 06:32:39 2017 > New Revision: 313798 > URL: https://svnweb.freebsd.org/changeset/base/313798 > > Log: > Use uintmax_t to print st_nlink. > > Sponsored by: The FreeBSD Foundation Reported and tested by: pho Sorry. > MFC after: 1 week > > Modified: > head/bin/ls/print.c > > Modified: head/bin/ls/print.c > ============================================================================== > --- head/bin/ls/print.c Thu Feb 16 06:31:36 2017 (r313797) > +++ head/bin/ls/print.c Thu Feb 16 06:32:39 2017 (r313798) > @@ -259,12 +259,12 @@ printlong(const DISPLAY *dp) > np = p->fts_pointer; > xo_attr("value", "%03o", (int) sp->st_mode & ALLPERMS); > if (f_numericonly) { > - xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {td:user/%-*s}{e:user/%ju} {td:group/%-*s}{e:group/%ju} ", > - buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, > + xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*ju} {td:user/%-*s}{e:user/%ju} {td:group/%-*s}{e:group/%ju} ", > + buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, (uintmax_t)sp->st_nlink, > dp->s_user, np->user, (uintmax_t)sp->st_uid, dp->s_group, np->group, (uintmax_t)sp->st_gid); > } else { > - xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {t:user/%-*s} {t:group/%-*s} ", > - buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, > + xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*ju} {t:user/%-*s} {t:group/%-*s} ", > + buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, (uintmax_t)sp->st_nlink, > dp->s_user, np->user, dp->s_group, np->group); > } > if (S_ISBLK(sp->st_mode)) From owner-svn-src-head@freebsd.org Thu Feb 16 06:52:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AEF5CE136C; Thu, 16 Feb 2017 06:52:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18181304; Thu, 16 Feb 2017 06:52:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1G6qsna074923; Thu, 16 Feb 2017 06:52:54 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1G6qsvQ074922; Thu, 16 Feb 2017 06:52:54 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201702160652.v1G6qsvQ074922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 16 Feb 2017 06:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313801 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 06:52:55 -0000 Author: ed Date: Thu Feb 16 06:52:53 2017 New Revision: 313801 URL: https://svnweb.freebsd.org/changeset/base/313801 Log: Remove unnecessary #includes from the kqueue(2) man page. Now that can be included on its own, adjust the manual page accordingly. Remove both unnecessary #include statements from the synopsis and the example code. While there, also add a note to the BUGS section to mention that previous versions of this header file still depend on . Reviewed by: ngie, vangyzen Differential Revision: https://reviews.freebsd.org/D9605 Modified: head/lib/libc/sys/kqueue.2 Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Thu Feb 16 06:36:16 2017 (r313800) +++ head/lib/libc/sys/kqueue.2 Thu Feb 16 06:52:53 2017 (r313801) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2016 +.Dd February 15, 2017 .Dt KQUEUE 2 .Os .Sh NAME @@ -34,9 +34,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/event.h -.In sys/time.h .Ft int .Fn kqueue "void" .Ft int @@ -633,15 +631,12 @@ If the time limit expires, then returns 0. .Sh EXAMPLES .Bd -literal -compact -#include #include -#include #include #include #include #include #include -#include int main(int argc, char **argv) @@ -769,3 +764,9 @@ The .Fa timeout value is limited to 24 hours; longer timeouts will be silently reinterpreted as 24 hours. +.Pp +Previous versions of +.In sys/event.h +fail to parse without including +.In sys/types.h +manually. From owner-svn-src-head@freebsd.org Thu Feb 16 07:35:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 862EDCE1018 for ; Thu, 16 Feb 2017 07:35:42 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-74.reflexion.net [208.70.210.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 382D61967 for ; Thu, 16 Feb 2017 07:35:41 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 13963 invoked from network); 16 Feb 2017 07:36:18 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 16 Feb 2017 07:36:18 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.30.0) with SMTP; Thu, 16 Feb 2017 02:35:39 -0500 (EST) Received: (qmail 8433 invoked from network); 16 Feb 2017 07:35:39 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 16 Feb 2017 07:35:39 -0000 Received: from [192.168.1.111] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id F3C2AEC807D; Wed, 15 Feb 2017 23:35:38 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r313761 - in head/lib/msun: . src [breaks the build for armv6/v7] Message-Id: <71965D77-72CA-4479-9510-AD9A03C2EB1B@dsl-only.net> Date: Wed, 15 Feb 2017 23:35:38 -0800 To: mmokhi@FreeBSD.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 07:35:42 -0000 When I tried to cross-build -r313783 (via svnlite update) the following: __FBSDID("$FreeBSD: head/lib/msun/src/catrigl.c 313761 2017-02-15 = 07:59:54Z mmokhi $"); got: Building /usr/obj/bpim3_clang/arm.armv6/usr/src/lib/msun/catrigl.o --- catrigl.o --- /usr/src/lib/msun/src/catrigl.c:48:10: fatal error: 'invtrig.h' file not = found #include "invtrig.h" ^ . . . --- lib/msun__L --- 1 error generated. *** [catrigl.o] Error code 1 make[4]: stopped in /usr/src/lib/msun .ERROR_TARGET=3D'catrigl.o' = .ERROR_META_FILE=3D'/usr/obj/bpim3_clang/arm.armv6/usr/src/lib/msun/catrig= l.o.meta' .MAKE.LEVEL=3D'4' MAKEFILE=3D'' .MAKE.MODE=3D'meta missing-filemon=3Dyes missing-meta=3Dyes silent=3Dyes = verbose' .CURDIR=3D'/usr/src/lib/msun' .MAKE=3D'make' .OBJDIR=3D'/usr/obj/bpim3_clang/arm.armv6/usr/src/lib/msun' .TARGETS=3D'all' DESTDIR=3D'/usr/obj/bpim3_clang/arm.armv6/usr/src/tmp' LD_LIBRARY_PATH=3D'' MACHINE=3D'arm' MACHINE_ARCH=3D'armv6' MAKEOBJDIRPREFIX=3D'/usr/obj/bpim3_clang/arm.armv6' MAKESYSPATH=3D'/usr/src/share/mk' MAKE_VERSION=3D'20161212' = PATH=3D'/usr/obj/bpim3_clang/arm.armv6/usr/src/tmp/legacy/usr/sbin:/usr/ob= j/bpim3_clang/arm.armv6/usr/src/tmp/legacy/usr/bin:/usr/obj/bpim3_clang/ar= m.armv6/usr/src/tmp/legacy/bin:/usr/obj/bpim3_clang/arm.armv6/usr/src/tmp/= usr/sbin:/usr/obj/bpim3_clang/arm.armv6/usr/src/tmp/usr/bin:/sbin:/bin:/us= r/sbin:/usr/bin' SRCTOP=3D'/usr/src' OBJTOP=3D'/usr/obj/bpim3_clang/arm.armv6/usr/src' .MAKE.MAKEFILES=3D'/usr/src/share/mk/sys.mk = /usr/src/share/mk/local.sys.env.mk /usr/src/share/mk/src.sys.env.mk = /root/src.configs/src.conf.bpim3-clang-bootstrap.amd64-host = /usr/src/share/mk/bsd.mkopt.mk /usr/src/share/mk/bsd.suffixes.mk = /root/src.configs/make.conf /usr/src/share/mk/local.sys.mk = /usr/src/share/mk/src.sys.mk /dev/null /usr/src/lib/msun/Makefile = /usr/src/lib/msun/arm/Makefile.inc /usr/src/share/mk/src.opts.mk = /usr/src/share/mk/bsd.own.mk /usr/src/share/mk/bsd.opts.mk = /usr/src/share/mk/bsd.cpu.mk /usr/src/share/mk/bsd.compiler.mk = /usr/src/share/mk/bsd.compiler.mk /usr/src/share/mk/bsd.lib.mk = /usr/src/share/mk/bsd.init.mk /usr/src/share/mk/local.init.mk = /usr/src/share/mk/src.init.mk /usr/src/lib/msun/../Makefile.inc = /usr/src/share/mk/bsd.libnames.mk /usr/src/share/mk/src.libnames.mk = /usr/src/share/mk/bsd.symver.mk /usr/src/share/mk/bsd.nls.mk = /usr/src/share/mk/bsd.files.mk /usr/src/share/mk/bsd.incs.mk = /usr/src/share/mk/bsd.confs.mk /usr/src/share/mk/bsd.links.mk = /usr/src/share/mk/bsd.dep.mk /usr/src/share/mk/bsd.clang-analyze.mk = /usr/src/share/mk/bsd.obj.mk /usr/src/share/mk/bsd.subdir.mk = /usr/src/share/mk/bsd.sys.mk' .PATH=3D'. /usr/src/lib/msun /usr/src/lib/msun/arm = /usr/src/lib/msun/bsdsrc /usr/src/lib/msun/src /usr/src/lib/msun/man' 1 error =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Thu Feb 16 07:49:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67D6ECE16D6 for ; Thu, 16 Feb 2017 07:49:11 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-75.reflexion.net [208.70.210.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2891D1F75 for ; Thu, 16 Feb 2017 07:49:10 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 26424 invoked from network); 16 Feb 2017 07:49:09 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 16 Feb 2017 07:49:09 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.30.0) with SMTP; Thu, 16 Feb 2017 02:49:09 -0500 (EST) Received: (qmail 26338 invoked from network); 16 Feb 2017 07:49:08 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 16 Feb 2017 07:49:08 -0000 Received: from [192.168.1.111] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 25136EC807D; Wed, 15 Feb 2017 23:49:08 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r313761 - in head/lib/msun: . src [breaks the build for armv6/v7 and for powerpc64] Date: Wed, 15 Feb 2017 23:49:07 -0800 References: <71965D77-72CA-4479-9510-AD9A03C2EB1B@dsl-only.net> To: mmokhi@FreeBSD.org, svn-src-head@freebsd.org In-Reply-To: <71965D77-72CA-4479-9510-AD9A03C2EB1B@dsl-only.net> Message-Id: <51128A05-3264-4D9F-940E-DE9F263FDA3F@dsl-only.net> X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 07:49:11 -0000 On 2017-Feb-15, at 11:35 PM, Mark Millard = wrote: > When I tried to cross-build -r313783 (via svnlite update) the = following: >=20 > __FBSDID("$FreeBSD: head/lib/msun/src/catrigl.c 313761 2017-02-15 = 07:59:54Z mmokhi $"); >=20 > got: >=20 > Building /usr/obj/bpim3_clang/arm.armv6/usr/src/lib/msun/catrigl.o > --- catrigl.o --- > /usr/src/lib/msun/src/catrigl.c:48:10: fatal error: 'invtrig.h' file = not found > #include "invtrig.h" > ^ > . . . > --- lib/msun__L --- > 1 error generated. > *** [catrigl.o] Error code 1 >=20 > make[4]: stopped in /usr/src/lib/msun > .ERROR_TARGET=3D'catrigl.o' > = .ERROR_META_FILE=3D'/usr/obj/bpim3_clang/arm.armv6/usr/src/lib/msun/catrig= l.o.meta' > .MAKE.LEVEL=3D'4' > MAKEFILE=3D'' > .MAKE.MODE=3D'meta missing-filemon=3Dyes missing-meta=3Dyes silent=3Dyes= verbose' > .CURDIR=3D'/usr/src/lib/msun' > .MAKE=3D'make' > .OBJDIR=3D'/usr/obj/bpim3_clang/arm.armv6/usr/src/lib/msun' > .TARGETS=3D'all' > DESTDIR=3D'/usr/obj/bpim3_clang/arm.armv6/usr/src/tmp' > LD_LIBRARY_PATH=3D'' > MACHINE=3D'arm' > MACHINE_ARCH=3D'armv6' > MAKEOBJDIRPREFIX=3D'/usr/obj/bpim3_clang/arm.armv6' > MAKESYSPATH=3D'/usr/src/share/mk' > MAKE_VERSION=3D'20161212' > = PATH=3D'/usr/obj/bpim3_clang/arm.armv6/usr/src/tmp/legacy/usr/sbin:/usr/ob= j/bpim3_clang/arm.armv6/usr/src/tmp/legacy/usr/bin:/usr/obj/bpim3_clang/ar= m.armv6/usr/src/tmp/legacy/bin:/usr/obj/bpim3_clang/arm.armv6/usr/src/tmp/= usr/sbin:/usr/obj/bpim3_clang/arm.armv6/usr/src/tmp/usr/bin:/sbin:/bin:/us= r/sbin:/usr/bin' > SRCTOP=3D'/usr/src' > OBJTOP=3D'/usr/obj/bpim3_clang/arm.armv6/usr/src' > .MAKE.MAKEFILES=3D'/usr/src/share/mk/sys.mk = /usr/src/share/mk/local.sys.env.mk /usr/src/share/mk/src.sys.env.mk = /root/src.configs/src.conf.bpim3-clang-bootstrap.amd64-host = /usr/src/share/mk/bsd.mkopt.mk /usr/src/share/mk/bsd.suffixes.mk = /root/src.configs/make.conf /usr/src/share/mk/local.sys.mk = /usr/src/share/mk/src.sys.mk /dev/null /usr/src/lib/msun/Makefile = /usr/src/lib/msun/arm/Makefile.inc /usr/src/share/mk/src.opts.mk = /usr/src/share/mk/bsd.own.mk /usr/src/share/mk/bsd.opts.mk = /usr/src/share/mk/bsd.cpu.mk /usr/src/share/mk/bsd.compiler.mk = /usr/src/share/mk/bsd.compiler.mk /usr/src/share/mk/bsd.lib.mk = /usr/src/share/mk/bsd.init.mk /usr/src/share/mk/local.init.mk = /usr/src/share/mk/src.init.mk /usr/src/lib/msun/../Makefile.inc = /usr/src/share/mk/bsd.libnames.mk /usr/src/share/mk/src.libnames.mk = /usr/src/share/mk/bsd.symver.mk /usr/src/share/mk/bsd.nls.mk = /usr/src/share/mk/bsd.files.mk /usr/src/share/mk/bsd.incs.mk = /usr/src/share/mk/bsd.confs.mk /usr/src/share/mk/bsd.links.mk = /usr/src/share/mk/bsd.dep.mk /usr/src/share/mk/bsd.clang-analyze.mk = /usr/src/share/mk/bsd.obj.mk /usr/src/share/mk/bsd.subdir.mk = /usr/src/share/mk/bsd.sys.mk' > .PATH=3D'. /usr/src/lib/msun /usr/src/lib/msun/arm = /usr/src/lib/msun/bsdsrc /usr/src/lib/msun/src /usr/src/lib/msun/man' > 1 error powerpc64 gets the same sort of build failure: --- catrigl.o --- /usr/src/lib/msun/src/catrigl.c:48:10: fatal error: 'invtrig.h' file not = found #include "invtrig.h" ^ 1 error generated. *** [catrigl.o] Error code 1 make[4]: stopped in /usr/src/lib/msun .ERROR_TARGET=3D'catrigl.o' = .ERROR_META_FILE=3D'/usr/obj/powerpc64vtsc_clang_altbinutils_world/powerpc= .powerpc64/usr/src/lib/msun/catrigl.o.meta' .MAKE.LEVEL=3D'4' MAKEFILE=3D'' .MAKE.MODE=3D'meta missing-filemon=3Dyes missing-meta=3Dyes silent=3Dyes = verbose' .CURDIR=3D'/usr/src/lib/msun' .MAKE=3D'make' = .OBJDIR=3D'/usr/obj/powerpc64vtsc_clang_altbinutils_world/powerpc.powerpc6= 4/usr/src/lib/msun' .TARGETS=3D'all' = DESTDIR=3D'/usr/obj/powerpc64vtsc_clang_altbinutils_world/powerpc.powerpc6= 4/usr/src/tmp' LD_LIBRARY_PATH=3D'' MACHINE=3D'powerpc' MACHINE_ARCH=3D'powerpc64' = MAKEOBJDIRPREFIX=3D'/usr/obj/powerpc64vtsc_clang_altbinutils_world/powerpc= .powerpc64' MAKESYSPATH=3D'/usr/src/share/mk' MAKE_VERSION=3D'20161212' = PATH=3D'/usr/obj/powerpc64vtsc_clang_altbinutils_world/powerpc.powerpc64/u= sr/src/tmp/legacy/usr/sbin:/usr/obj/powerpc64vtsc_clang_altbinutils_world/= powerpc.powerpc64/usr/src/tmp/legacy/usr/bin:/usr/obj/powerpc64vtsc_clang_= altbinutils_world/powerpc.powerpc64/usr/src/tmp/legacy/bin:/usr/obj/powerp= c64vtsc_clang_altbinutils_world/powerpc.powerpc64/usr/src/tmp/usr/sbin:/us= r/obj/powerpc64vtsc_clang_altbinutils_world/powerpc.powerpc64/usr/src/tmp/= usr/bin:/sbin:/bin:/usr/sbin:/usr/bin' SRCTOP=3D'/usr/src' = OBJTOP=3D'/usr/obj/powerpc64vtsc_clang_altbinutils_world/powerpc.powerpc64= /usr/src' .MAKE.MAKEFILES=3D'/usr/src/share/mk/sys.mk = /usr/src/share/mk/local.sys.env.mk /usr/src/share/mk/src.sys.env.mk = /root/src.configs/src.conf.powerpc64-clang_altbinutils-bootstrap.amd64-hos= t /usr/src/share/mk/bsd.mkopt.mk /usr/src/share/mk/bsd.suffixes.mk = /root/src.configs/make.conf /usr/src/share/mk/local.sys.mk = /usr/src/share/mk/src.sys.mk /dev/null /usr/src/lib/msun/Makefile = /usr/src/lib/msun/powerpc/Makefile.inc /usr/src/share/mk/src.opts.mk = /usr/src/share/mk/bsd.own.mk /usr/src/share/mk/bsd.opts.mk = /usr/src/share/mk/bsd.cpu.mk /usr/src/share/mk/bsd.compiler.mk = /usr/src/share/mk/bsd.compiler.mk /usr/src/share/mk/bsd.lib.mk = /usr/src/share/mk/bsd.init.mk /usr/src/share/mk/local.init.mk = /usr/src/share/mk/src.init.mk /usr/src/lib/msun/../Makefile.inc = /usr/src/share/mk/bsd.libnames.mk /usr/src/share/mk/src.libnames.mk = /usr/src/share/mk/bsd.symver.mk /usr/src/share/mk/bsd.nls.mk = /usr/src/share/mk/bsd.files.mk /usr/src/share/mk/bsd.incs.mk = /usr/src/share/mk/bsd.confs.mk /usr/src/share/mk/bsd.links.mk = /usr/src/share/mk/bsd.dep.mk /usr/src/share/mk/bsd.clang-analyze.mk = /usr/src/share/mk/bsd.obj.mk /usr/src/share/mk/bsd.subdir.mk = /usr/src/share/mk/bsd.sys.mk' .PATH=3D'. /usr/src/lib/msun /usr/src/lib/msun/powerpc = /usr/src/lib/msun/bsdsrc /usr/src/lib/msun/src /usr/src/lib/msun/man' 1 error It seems likely that powerpc (32-bit) will as well. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Thu Feb 16 09:12:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE2CECE050F; Thu, 16 Feb 2017 09:12:04 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.imp.ch (smtp.imp.ch [IPv6:2001:4060:1:1001::13:198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4A41BF0; Thu, 16 Feb 2017 09:12:04 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from [192.168.225.14] (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by fgznet.ch (Postfix) with ESMTPSA id 3CD424614; Thu, 16 Feb 2017 10:12:00 +0100 (CET) Subject: Re: svn commit: r313761 - in head/lib/msun: . src To: Ed Maste , Mahdi Mokhtari References: <201702150759.v1F7xtKZ013952@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Andreas Tobler Message-ID: <9c45e0d0-e1f7-8f73-7b65-15e1bda4c812@FreeBSD.org> Date: Thu, 16 Feb 2017 10:11:59 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: Idefix Submit on 127.0.1.1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 09:12:05 -0000 On 15.02.17 17:08, Ed Maste wrote: > On 15 February 2017 at 02:59, Mahdi Mokhtari wrote: >> Author: mmokhi (ports committer) >> Date: Wed Feb 15 07:59:54 2017 >> New Revision: 313761 >> URL: https://svnweb.freebsd.org/changeset/base/313761 >> >> Log: >> Add casinl() cacosl() catanl() casinhl() cacoshl() catanhl() APIs to msun >> to improve C11 conformance. > > This breaks the build on at least mips: > > /scratch/tmp/emaste/freebsd/lib/msun/src/catrigl.c:48:21: error: > invtrig.h: No such file or directory > /scratch/tmp/emaste/freebsd/lib/msun/src/catrigl.c:85:2: error: #error > "Unsupported long double format" > ... +2 on powerpc and powerpc64. Andreas From owner-svn-src-head@freebsd.org Thu Feb 16 09:16:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3D9ACE0783 for ; Thu, 16 Feb 2017 09:16:48 +0000 (UTC) (envelope-from mmokhi.fbsd@gmail.com) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 789F51089 for ; Thu, 16 Feb 2017 09:16:48 +0000 (UTC) (envelope-from mmokhi.fbsd@gmail.com) Received: by mail-lf0-f47.google.com with SMTP id x1so5190290lff.0 for ; Thu, 16 Feb 2017 01:16:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=felhpeq4WTKHX91pq2zpXomTyO9HIYoQLzTwUDQ4Cp8=; b=Yhek6LgslZ9eEHJNKeYUWMl9JZELLx2rbNhWwnhwENlTvDw8Po73ZSQZn9g6BB2nQ3 Oo/ZBxT+PPQcGvXvpF0/hZ6Tn6O/kMjmHblNi0cLHeMj8LgF7L7EnZtyJ6e5zAFk6dzP gzLByIz+J4p2SY9RJE1BC9nUkRvnWY2u3vtEbr0mBpOhVbcnLmugZUHDerDMOOz8NC6j VG+l+uU5jwSJpwW7ahIClvrXByv/ZL8p3/0Ia5hB6RYKuXgK/2okNlybvV2tcFbrHSIP /6cEMxBWAzhiT6HAkZaBzxI6FCc/nZE5lCKIbsCtxqmTmVCo4V2r5AzXa6rK+mTsbhEf /hUg== X-Gm-Message-State: AMke39l7w51nXFRckDoSA79HC5VzIEKZ92aRMRFhj0/qaoKfyp+qJn5/YPRdlShsjgZemg== X-Received: by 10.46.20.66 with SMTP id 2mr348380lju.87.1487236605508; Thu, 16 Feb 2017 01:16:45 -0800 (PST) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com. [209.85.215.48]) by smtp.gmail.com with ESMTPSA id s63sm1565306lja.49.2017.02.16.01.16.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Feb 2017 01:16:45 -0800 (PST) Received: by mail-lf0-f48.google.com with SMTP id z134so5124412lff.3 for ; Thu, 16 Feb 2017 01:16:45 -0800 (PST) X-Received: by 10.25.155.11 with SMTP id d11mr460001lfe.110.1487236605291; Thu, 16 Feb 2017 01:16:45 -0800 (PST) MIME-Version: 1.0 Reply-To: mmokhi@freebsd.org Received: by 10.25.228.200 with HTTP; Thu, 16 Feb 2017 01:16:44 -0800 (PST) In-Reply-To: <71965D77-72CA-4479-9510-AD9A03C2EB1B@dsl-only.net> References: <71965D77-72CA-4479-9510-AD9A03C2EB1B@dsl-only.net> From: Mahdi Mokhtari Date: Thu, 16 Feb 2017 12:46:44 +0330 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r313761 - in head/lib/msun: . src [breaks the build for armv6/v7] To: Mark Millard Cc: svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 09:16:48 -0000 Hi Mark. Thanks for reporting it. Its reason is on armv7/v8, mips,... long double is same as double. I submitted a patch for fixing it (on phabricator) it seems builds fine. I'm just waiting for (re-)approval from bde@ on my changes. -- Best regards, MMokhi. From owner-svn-src-head@freebsd.org Thu Feb 16 10:36:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0772CE0B16; Thu, 16 Feb 2017 10:36:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A27541E14; Thu, 16 Feb 2017 10:36:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GAa0xB063881; Thu, 16 Feb 2017 10:36:00 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GAa06N063880; Thu, 16 Feb 2017 10:36:00 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201702161036.v1GAa06N063880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 16 Feb 2017 10:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313804 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 10:36:01 -0000 Author: trasz Date: Thu Feb 16 10:36:00 2017 New Revision: 313804 URL: https://svnweb.freebsd.org/changeset/base/313804 Log: Improve debugging output. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/compat/linux/linux.c Modified: head/sys/compat/linux/linux.c ============================================================================== --- head/sys/compat/linux/linux.c Thu Feb 16 09:19:29 2017 (r313803) +++ head/sys/compat/linux/linux.c Thu Feb 16 10:36:00 2017 (r313804) @@ -128,7 +128,7 @@ int linux_to_bsd_signal(int sig) { - KASSERT(sig > 0 && sig <= LINUX_SIGRTMAX, ("Invalid Linux signal\n")); + KASSERT(sig > 0 && sig <= LINUX_SIGRTMAX, ("invalid Linux signal %d\n", sig)); if (sig < LINUX_SIGRTMIN) return (linux_to_bsd_sigtbl[_SIG_IDX(sig)]); From owner-svn-src-head@freebsd.org Thu Feb 16 11:38:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F0A1CE219F; Thu, 16 Feb 2017 11:38:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 072901F67; Thu, 16 Feb 2017 11:38:51 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GBcp9t088582; Thu, 16 Feb 2017 11:38:51 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GBcpFI088581; Thu, 16 Feb 2017 11:38:51 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201702161138.v1GBcpFI088581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 16 Feb 2017 11:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313805 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 11:38:52 -0000 Author: ae Date: Thu Feb 16 11:38:50 2017 New Revision: 313805 URL: https://svnweb.freebsd.org/changeset/base/313805 Log: Fix LINT build for powerpc. Build kernel modules support only when both IPSEC and TCP_SIGNATURE are not defined. Reported by: emaste Modified: head/sys/netipsec/subr_ipsec.c Modified: head/sys/netipsec/subr_ipsec.c ============================================================================== --- head/sys/netipsec/subr_ipsec.c Thu Feb 16 10:36:00 2017 (r313804) +++ head/sys/netipsec/subr_ipsec.c Thu Feb 16 11:38:50 2017 (r313805) @@ -126,9 +126,12 @@ ipsec6_setsockaddrs(const struct mbuf *m #ifdef IPSEC_SUPPORT /* - * Declare IPSEC_SUPPORT as module even if IPSEC is defined. - * tcpmd5.ko module depends from IPSEC_SUPPORT. + * IPSEC_SUPPORT - loading of ipsec.ko and tcpmd5.ko is supported. + * IPSEC + IPSEC_SUPPORT - loading tcpmd5.ko is supported. + * IPSEC + TCP_SIGNATURE - all is build in the kernel, do not build + * IPSEC_SUPPORT. */ +#if !defined(IPSEC) || !defined(TCP_SIGNATURE) #define IPSEC_MODULE_INCR 2 static int ipsec_kmod_enter(volatile u_int *cntr) @@ -181,6 +184,30 @@ type name (decl) \ return (ret); \ } +static int +ipsec_support_modevent(module_t mod, int type, void *data) +{ + + switch (type) { + case MOD_LOAD: + return (0); + case MOD_UNLOAD: + return (EBUSY); + default: + return (EOPNOTSUPP); + } +} + +static moduledata_t ipsec_support_mod = { + "ipsec_support", + ipsec_support_modevent, + 0 +}; +DECLARE_MODULE(ipsec_support, ipsec_support_mod, SI_SUB_PROTO_DOMAIN, + SI_ORDER_ANY); +MODULE_VERSION(ipsec_support, 1); +#endif /* !IPSEC || !TCP_SIGNATURE */ + #ifndef TCP_SIGNATURE /* Declare TCP-MD5 support as kernel module. */ static struct tcpmd5_support tcpmd5_ipsec = { @@ -222,30 +249,7 @@ tcpmd5_support_disable(void) tcp_ipsec_support->methods = NULL; } } -#endif - -static int -ipsec_support_modevent(module_t mod, int type, void *data) -{ - - switch (type) { - case MOD_LOAD: - return (0); - case MOD_UNLOAD: - return (EBUSY); - default: - return (EOPNOTSUPP); - } -} - -static moduledata_t ipsec_support_mod = { - "ipsec_support", - ipsec_support_modevent, - 0 -}; -DECLARE_MODULE(ipsec_support, ipsec_support_mod, SI_SUB_PROTO_DOMAIN, - SI_ORDER_ANY); -MODULE_VERSION(ipsec_support, 1); +#endif /* !TCP_SIGNATURE */ #ifndef IPSEC /* From owner-svn-src-head@freebsd.org Thu Feb 16 12:08:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45B07CE2FE2; Thu, 16 Feb 2017 12:08:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 158FA12B9; Thu, 16 Feb 2017 12:08:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GC8q5A000432; Thu, 16 Feb 2017 12:08:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GC8qrs000431; Thu, 16 Feb 2017 12:08:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201702161208.v1GC8qrs000431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Feb 2017 12:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313806 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 12:08:53 -0000 Author: hselasky Date: Thu Feb 16 12:08:52 2017 New Revision: 313806 URL: https://svnweb.freebsd.org/changeset/base/313806 Log: Whitespace fix. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/device.h Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Thu Feb 16 11:38:50 2017 (r313805) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Thu Feb 16 12:08:52 2017 (r313806) @@ -413,7 +413,7 @@ class_create(struct module *owner, const class = kzalloc(sizeof(*class), M_WAITOK); class->owner = owner; - class->name= name; + class->name = name; class->class_release = linux_class_kfree; error = class_register(class); if (error) { From owner-svn-src-head@freebsd.org Thu Feb 16 12:20:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7D24CE04F6; Thu, 16 Feb 2017 12:20:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75D381A58; Thu, 16 Feb 2017 12:20:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GCKvcQ004718; Thu, 16 Feb 2017 12:20:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GCKvbN004717; Thu, 16 Feb 2017 12:20:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201702161220.v1GCKvbN004717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Feb 2017 12:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313807 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 12:20:58 -0000 Author: hselasky Date: Thu Feb 16 12:20:57 2017 New Revision: 313807 URL: https://svnweb.freebsd.org/changeset/base/313807 Log: Allow passing a constant atomic_t to atomic_read(). Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Thu Feb 16 12:08:52 2017 (r313806) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Thu Feb 16 12:20:57 2017 (r313807) @@ -81,9 +81,9 @@ atomic_set_mask(unsigned int mask, atomi } static inline int -atomic_read(atomic_t *v) +atomic_read(const atomic_t *v) { - return atomic_load_acq_int(&v->counter); + return atomic_load_acq_int(&__DECONST(atomic_t *, v)->counter); } static inline int From owner-svn-src-head@freebsd.org Thu Feb 16 12:56:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A361BCE117A; Thu, 16 Feb 2017 12:56:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 660F21E98; Thu, 16 Feb 2017 12:56:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GCuAFq020716; Thu, 16 Feb 2017 12:56:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GCuA3a020713; Thu, 16 Feb 2017 12:56:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201702161256.v1GCuA3a020713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Feb 2017 12:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313808 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 12:56:11 -0000 Author: hselasky Date: Thu Feb 16 12:56:10 2017 New Revision: 313808 URL: https://svnweb.freebsd.org/changeset/base/313808 Log: Implement more LinuxKPI atomic functions and macros. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h head/sys/compat/linuxkpi/common/include/asm/atomic.h head/sys/compat/linuxkpi/common/include/asm/atomic64.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Thu Feb 16 12:20:57 2017 (r313807) +++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Thu Feb 16 12:56:10 2017 (r313808) @@ -75,6 +75,12 @@ atomic_long_dec(atomic_long_t *v) return atomic_fetchadd_long(&v->counter, -1) - 1; } +static inline long +atomic_long_xchg(atomic_long_t *v, long val) +{ + return atomic_swap_long(&v->counter, val); +} + static inline int atomic_long_add_unless(atomic_long_t *v, long a, long u) { Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Thu Feb 16 12:20:57 2017 (r313807) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Thu Feb 16 12:56:10 2017 (r313808) @@ -75,6 +75,12 @@ atomic_set(atomic_t *v, int i) } static inline void +atomic_set_release(atomic_t *v, int i) +{ + atomic_store_rel_int(&v->counter, i); +} + +static inline void atomic_set_mask(unsigned int mask, atomic_t *v) { atomic_set_int(&v->counter, mask); @@ -187,8 +193,26 @@ static inline void atomic_##op(int i, at c = old; \ } +#define LINUX_ATOMIC_FETCH_OP(op, c_op) \ +static inline int atomic_fetch_##op(int i, atomic_t *v) \ +{ \ + int c, old; \ + \ + c = v->counter; \ + while ((old = atomic_cmpxchg(v, c, c c_op i)) != c) \ + c = old; \ + \ + return (c); \ +} + LINUX_ATOMIC_OP(or, |) LINUX_ATOMIC_OP(and, &) +LINUX_ATOMIC_OP(andnot, &~) LINUX_ATOMIC_OP(xor, ^) +LINUX_ATOMIC_FETCH_OP(or, |) +LINUX_ATOMIC_FETCH_OP(and, &) +LINUX_ATOMIC_FETCH_OP(andnot, &~) +LINUX_ATOMIC_FETCH_OP(xor, ^) + #endif /* _ASM_ATOMIC_H_ */ Modified: head/sys/compat/linuxkpi/common/include/asm/atomic64.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic64.h Thu Feb 16 12:20:57 2017 (r313807) +++ head/sys/compat/linuxkpi/common/include/asm/atomic64.h Thu Feb 16 12:56:10 2017 (r313808) @@ -36,6 +36,8 @@ typedef struct { volatile int64_t counter; } atomic64_t; +#define ATOMIC64_INIT(x) { .counter = (x) } + /*------------------------------------------------------------------------* * 64-bit atomic operations *------------------------------------------------------------------------*/ From owner-svn-src-head@freebsd.org Thu Feb 16 13:32:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8A14CE1EFE; Thu, 16 Feb 2017 13:32:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA096126D; Thu, 16 Feb 2017 13:32:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GDWG0H034496; Thu, 16 Feb 2017 13:32:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GDWFO9034492; Thu, 16 Feb 2017 13:32:15 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201702161332.v1GDWFO9034492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 16 Feb 2017 13:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313809 - in head/sys: amd64/linux modules/linux64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 13:32:18 -0000 Author: trasz Date: Thu Feb 16 13:32:15 2017 New Revision: 313809 URL: https://svnweb.freebsd.org/changeset/base/313809 Log: Implement linux version of ptrace(2). It's nowhere near complete, but it allows to use 64 bit linux strace(1) on 64 bit linux binaries. Reviewed by: dchagin (earlier version) MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9406 Added: head/sys/amd64/linux/linux_ptrace.c (contents, props changed) Modified: head/sys/amd64/linux/linux_dummy.c head/sys/modules/linux64/Makefile Modified: head/sys/amd64/linux/linux_dummy.c ============================================================================== --- head/sys/amd64/linux/linux_dummy.c Thu Feb 16 12:56:10 2017 (r313808) +++ head/sys/amd64/linux/linux_dummy.c Thu Feb 16 13:32:15 2017 (r313809) @@ -45,7 +45,6 @@ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); DUMMY(mincore); DUMMY(sendfile); -DUMMY(ptrace); DUMMY(syslog); DUMMY(setfsuid); DUMMY(setfsgid); Added: head/sys/amd64/linux/linux_ptrace.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/linux/linux_ptrace.c Thu Feb 16 13:32:15 2017 (r313809) @@ -0,0 +1,414 @@ +/*- + * Copyright (c) 2017 Edward Tomasz Napierala + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#define LINUX_PTRACE_TRACEME 0 +#define LINUX_PTRACE_PEEKTEXT 1 +#define LINUX_PTRACE_PEEKDATA 2 +#define LINUX_PTRACE_PEEKUSER 3 +#define LINUX_PTRACE_POKETEXT 4 +#define LINUX_PTRACE_POKEDATA 5 +#define LINUX_PTRACE_POKEUSER 6 +#define LINUX_PTRACE_CONT 7 +#define LINUX_PTRACE_KILL 8 +#define LINUX_PTRACE_SINGLESTEP 9 +#define LINUX_PTRACE_GETREGS 12 +#define LINUX_PTRACE_SETREGS 13 +#define LINUX_PTRACE_GETFPREGS 14 +#define LINUX_PTRACE_SETFPREGS 15 +#define LINUX_PTRACE_ATTACH 16 +#define LINUX_PTRACE_DETACH 17 +#define LINUX_PTRACE_SYSCALL 24 +#define LINUX_PTRACE_SETOPTIONS 0x4200 +#define LINUX_PTRACE_GETREGSET 0x4204 +#define LINUX_PTRACE_SEIZE 0x4206 + +#define LINUX_PTRACE_O_TRACESYSGOOD 1 +#define LINUX_PTRACE_O_TRACEFORK 2 +#define LINUX_PTRACE_O_TRACEVFORK 4 +#define LINUX_PTRACE_O_TRACECLONE 8 +#define LINUX_PTRACE_O_TRACEEXEC 16 +#define LINUX_PTRACE_O_TRACEVFORKDONE 32 +#define LINUX_PTRACE_O_TRACEEXIT 64 +#define LINUX_PTRACE_O_TRACESECCOMP 128 +#define LINUX_PTRACE_O_EXITKILL 1048576 +#define LINUX_PTRACE_O_SUSPEND_SECCOMP 2097152 + +#define LINUX_NT_PRSTATUS 1 + +#define LINUX_PTRACE_O_MASK (LINUX_PTRACE_O_TRACESYSGOOD | \ + LINUX_PTRACE_O_TRACEFORK | LINUX_PTRACE_O_TRACEVFORK | \ + LINUX_PTRACE_O_TRACECLONE | LINUX_PTRACE_O_TRACEEXEC | \ + LINUX_PTRACE_O_TRACEVFORKDONE | LINUX_PTRACE_O_TRACEEXIT | \ + LINUX_PTRACE_O_TRACESECCOMP | LINUX_PTRACE_O_EXITKILL | \ + LINUX_PTRACE_O_SUSPEND_SECCOMP) + +static int +map_signum(int lsig, int *bsigp) +{ + int bsig; + + if (lsig == 0) { + *bsigp = 0; + return (0); + } + + if (lsig < 0 || lsig > LINUX_SIGRTMAX) + return (EINVAL); + + bsig = linux_to_bsd_signal(lsig); + if (bsig == SIGSTOP) + bsig = 0; + + *bsigp = bsig; + return (0); +} + +struct linux_pt_reg { + l_ulong r15; + l_ulong r14; + l_ulong r13; + l_ulong r12; + l_ulong rbp; + l_ulong rbx; + l_ulong r11; + l_ulong r10; + l_ulong r9; + l_ulong r8; + l_ulong rax; + l_ulong rcx; + l_ulong rdx; + l_ulong rsi; + l_ulong rdi; + l_ulong orig_rax; + l_ulong rip; + l_ulong cs; + l_ulong eflags; + l_ulong rsp; + l_ulong ss; +}; + +/* + * Translate amd64 ptrace registers between Linux and FreeBSD formats. + * The translation is pretty straighforward, for all registers but + * orig_rax on Linux side and r_trapno and r_err in FreeBSD. + */ +static void +map_regs_to_linux(struct reg *b_reg, struct linux_pt_reg *l_reg) +{ + + l_reg->r15 = b_reg->r_r15; + l_reg->r14 = b_reg->r_r14; + l_reg->r13 = b_reg->r_r13; + l_reg->r12 = b_reg->r_r12; + l_reg->rbp = b_reg->r_rbp; + l_reg->rbx = b_reg->r_rbx; + l_reg->r11 = b_reg->r_r11; + l_reg->r10 = b_reg->r_r10; + l_reg->r9 = b_reg->r_r9; + l_reg->r8 = b_reg->r_r8; + l_reg->rax = b_reg->r_rax; + l_reg->rcx = b_reg->r_rcx; + l_reg->rdx = b_reg->r_rdx; + l_reg->rsi = b_reg->r_rsi; + l_reg->rdi = b_reg->r_rdi; + l_reg->orig_rax = b_reg->r_rax; + l_reg->rip = b_reg->r_rip; + l_reg->cs = b_reg->r_cs; + l_reg->eflags = b_reg->r_rflags; + l_reg->rsp = b_reg->r_rsp; + l_reg->ss = b_reg->r_ss; +} + +static void +map_regs_from_linux(struct reg *b_reg, struct linux_pt_reg *l_reg) +{ + b_reg->r_r15 = l_reg->r15; + b_reg->r_r14 = l_reg->r14; + b_reg->r_r13 = l_reg->r13; + b_reg->r_r12 = l_reg->r12; + b_reg->r_r11 = l_reg->r11; + b_reg->r_r10 = l_reg->r10; + b_reg->r_r9 = l_reg->r9; + b_reg->r_r8 = l_reg->r8; + b_reg->r_rdi = l_reg->rdi; + b_reg->r_rsi = l_reg->rsi; + b_reg->r_rbp = l_reg->rbp; + b_reg->r_rbx = l_reg->rbx; + b_reg->r_rdx = l_reg->rdx; + b_reg->r_rcx = l_reg->rcx; + b_reg->r_rax = l_reg->rax; + + /* + * XXX: Are zeroes the right thing to put here? + */ + b_reg->r_trapno = 0; + b_reg->r_fs = 0; + b_reg->r_gs = 0; + b_reg->r_err = 0; + b_reg->r_es = 0; + b_reg->r_ds = 0; + + b_reg->r_rip = l_reg->rip; + b_reg->r_cs = l_reg->cs; + b_reg->r_rflags = l_reg->eflags; + b_reg->r_rsp = l_reg->rsp; + b_reg->r_ss = l_reg->ss; +} + +static int +linux_ptrace_peek(struct thread *td, pid_t pid, void *addr, void *data) +{ + int error; + + error = kern_ptrace(td, PT_READ_I, pid, addr, 0); + if (error == 0) + error = copyout(td->td_retval, data, sizeof(l_int)); + td->td_retval[0] = error; + + return (error); +} + +static int +linux_ptrace_setoptions(struct thread *td, pid_t pid, l_ulong data) +{ + int mask; + + mask = 0; + + if (data & ~LINUX_PTRACE_O_MASK) { + printf("%s: unknown ptrace option %lx set; " + "returning EINVAL\n", + __func__, data & ~LINUX_PTRACE_O_MASK); + return (EINVAL); + } + + /* + * PTRACE_O_EXITKILL is ignored, we do that by default. + */ + + if (data & LINUX_PTRACE_O_TRACESYSGOOD) { + printf("%s: PTRACE_O_TRACESYSGOOD not implemented; " + "returning EINVAL\n", __func__); + return (EINVAL); + } + + if (data & LINUX_PTRACE_O_TRACEFORK) + mask |= PTRACE_FORK; + + if (data & LINUX_PTRACE_O_TRACEVFORK) + mask |= PTRACE_VFORK; + + if (data & LINUX_PTRACE_O_TRACECLONE) + mask |= PTRACE_VFORK; + + if (data & LINUX_PTRACE_O_TRACEEXEC) + mask |= PTRACE_EXEC; + + if (data & LINUX_PTRACE_O_TRACEVFORKDONE) + mask |= PTRACE_VFORK; /* XXX: Close enough? */ + + if (data & LINUX_PTRACE_O_TRACEEXIT) { + printf("%s: PTRACE_O_TRACEEXIT not implemented; " + "returning EINVAL\n", __func__); + return (EINVAL); + } + + return (kern_ptrace(td, PT_SET_EVENT_MASK, pid, &mask, sizeof(mask))); +} + +static int +linux_ptrace_getregs(struct thread *td, pid_t pid, void *data) +{ + struct ptrace_lwpinfo lwpinfo; + struct reg b_reg; + struct linux_pt_reg l_reg; + int error; + + error = kern_ptrace(td, PT_GETREGS, pid, &b_reg, 0); + if (error != 0) + return (error); + + map_regs_to_linux(&b_reg, &l_reg); + + /* + * The strace(1) utility depends on RAX being set to -ENOSYS + * on syscall entry. + */ + error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); + if (error != 0) { + printf("%s: PT_LWPINFO failed with error %d\n", __func__, error); + return (error); + } + if (lwpinfo.pl_flags & PL_FLAG_SCE) + l_reg.rax = -38; // XXX: Don't hardcode? + + error = copyout(&l_reg, (void *)data, sizeof(l_reg)); + return (error); +} + +static int +linux_ptrace_setregs(struct thread *td, pid_t pid, void *data) +{ + struct reg b_reg; + struct linux_pt_reg l_reg; + int error; + + error = copyin(data, &l_reg, sizeof(l_reg)); + if (error != 0) + return (error); + map_regs_from_linux(&b_reg, &l_reg); + error = kern_ptrace(td, PT_SETREGS, pid, &b_reg, 0); + return (error); +} + +static int +linux_ptrace_getregset(struct thread *td, pid_t pid, l_ulong addr, l_ulong data) +{ + + switch (addr) { + case LINUX_NT_PRSTATUS: + printf("%s: NT_PRSTATUS not implemented; returning EINVAL\n", + __func__); + return (EINVAL); + default: + printf("%s: PTRACE_GETREGSET request %ld not implemented; " + "returning EINVAL\n", __func__, addr); + return (EINVAL); + } +} + +static int +linux_ptrace_seize(struct thread *td, pid_t pid, l_ulong addr, l_ulong data) +{ + + printf("%s: PTRACE_SEIZE not implemented; returning EINVAL\n", __func__); + return (EINVAL); +} + +int +linux_ptrace(struct thread *td, struct linux_ptrace_args *uap) +{ + void *addr; + pid_t pid; + int error, sig; + + pid = (pid_t)uap->pid; + addr = (void *)uap->addr; + + switch (uap->req) { + case LINUX_PTRACE_TRACEME: + error = kern_ptrace(td, PT_TRACE_ME, 0, 0, 0); + break; + case LINUX_PTRACE_PEEKTEXT: + case LINUX_PTRACE_PEEKDATA: + error = linux_ptrace_peek(td, pid, addr, (void *)uap->data); + if (error != 0) + return (error); + /* + * Linux expects this syscall to read 64 bits, not 32. + */ + error = linux_ptrace_peek(td, pid, + (void *)(uap->addr + 4), (void *)(uap->data + 4)); + break; + case LINUX_PTRACE_POKETEXT: + error = kern_ptrace(td, PT_WRITE_I, pid, addr, uap->data); + break; + case LINUX_PTRACE_POKEDATA: + error = kern_ptrace(td, PT_WRITE_D, pid, addr, uap->data); + break; + case LINUX_PTRACE_CONT: + error = map_signum(uap->data, &sig); + if (error != 0) + break; + error = kern_ptrace(td, PT_CONTINUE, pid, (void *)1, sig); + break; + case LINUX_PTRACE_KILL: + error = kern_ptrace(td, PT_KILL, pid, addr, uap->data); + break; + case LINUX_PTRACE_SINGLESTEP: + error = map_signum(uap->data, &sig); + if (error != 0) + break; + error = kern_ptrace(td, PT_STEP, pid, (void *)1, sig); + break; + case LINUX_PTRACE_GETREGS: + error = linux_ptrace_getregs(td, pid, (void *)uap->data); + break; + case LINUX_PTRACE_SETREGS: + error = linux_ptrace_setregs(td, pid, (void *)uap->data); + break; + case LINUX_PTRACE_ATTACH: + error = kern_ptrace(td, PT_ATTACH, pid, addr, uap->data); + break; + case LINUX_PTRACE_DETACH: + error = map_signum(uap->data, &sig); + if (error != 0) + break; + error = kern_ptrace(td, PT_DETACH, pid, (void *)1, sig); + break; + case LINUX_PTRACE_SYSCALL: + error = map_signum(uap->data, &sig); + if (error != 0) + break; + error = kern_ptrace(td, PT_SYSCALL, pid, (void *)1, sig); + break; + case LINUX_PTRACE_SETOPTIONS: + error = linux_ptrace_setoptions(td, pid, uap->data); + break; + case LINUX_PTRACE_GETREGSET: + error = linux_ptrace_getregset(td, pid, uap->addr, uap->data); + break; + case LINUX_PTRACE_SEIZE: + error = linux_ptrace_seize(td, pid, uap->addr, uap->data); + break; + default: + printf("%s: ptrace(%ld, ...) not implemented; returning EINVAL\n", + __func__, uap->req); + error = EINVAL; + break; + } + + return (error); +} Modified: head/sys/modules/linux64/Makefile ============================================================================== --- head/sys/modules/linux64/Makefile Thu Feb 16 12:56:10 2017 (r313808) +++ head/sys/modules/linux64/Makefile Thu Feb 16 13:32:15 2017 (r313809) @@ -7,7 +7,7 @@ VDSO= linux_vdso KMOD= linux64 SRCS= linux_fork.c linux_dummy.c linux_file.c linux_event.c \ linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \ - linux_machdep.c linux_misc.c linux_signal.c \ + linux_machdep.c linux_misc.c linux_ptrace.c linux_signal.c \ linux_socket.c linux_stats.c linux_sysctl.c linux_sysent.c \ linux_sysvec.c linux_time.c linux_vdso.c linux_timer.c \ opt_inet6.h opt_compat.h opt_posix.h opt_usb.h \ From owner-svn-src-head@freebsd.org Thu Feb 16 14:13:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90523CE0DE7; Thu, 16 Feb 2017 14:13:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6227D16FA; Thu, 16 Feb 2017 14:13:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GEDaQA052721; Thu, 16 Feb 2017 14:13:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GEDaMX052720; Thu, 16 Feb 2017 14:13:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201702161413.v1GEDaMX052720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 Feb 2017 14:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313810 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 14:13:37 -0000 Author: hselasky Date: Thu Feb 16 14:13:36 2017 New Revision: 313810 URL: https://svnweb.freebsd.org/changeset/base/313810 Log: Allow container_of() to be used with constant data pointers. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Feb 16 13:32:15 2017 (r313809) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Thu Feb 16 14:13:36 2017 (r313810) @@ -245,8 +245,8 @@ scnprintf(char *buf, size_t size, const #define container_of(ptr, type, member) \ ({ \ - __typeof(((type *)0)->member) *_p = (ptr); \ - (type *)((char *)_p - offsetof(type, member)); \ + const __typeof(((type *)0)->member) *__p = (ptr); \ + (type *)((uintptr_t)__p - offsetof(type, member)); \ }) #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) From owner-svn-src-head@freebsd.org Thu Feb 16 19:00:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC11ACE0403; Thu, 16 Feb 2017 19:00:10 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6EEF1C81; Thu, 16 Feb 2017 19:00:10 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GJ09a4068490; Thu, 16 Feb 2017 19:00:09 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GJ09uE068487; Thu, 16 Feb 2017 19:00:09 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201702161900.v1GJ09uE068487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 16 Feb 2017 19:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313813 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 19:00:11 -0000 Author: jpaetzel Date: Thu Feb 16 19:00:09 2017 New Revision: 313813 URL: https://svnweb.freebsd.org/changeset/base/313813 Log: MFV 313786 7500 Simplify dbuf_free_range by removing dn_unlisted_l0_blkid illumos/illumos-gate@653af1b809998570c7e89fe7a0d3f90992bf0216 https://github.com/illumos/illumos-gate/commit/653af1b809998570c7e89fe7a0d3f90992bf0216 https://www.illumos.org/issues/7500 With the integration of: commit 0f6d88aded0d165f5954688a9b13bac76c38da84 Author: Alex Reece Date: Sat Jul 26 13:40:04 2014 -0800 4873 zvol unmap calls can take a very long time for larger datasets the dnode's dn_bufs field was changed from a list to a tree. As a result, the dn_unlisted_l0_blkid field is no longer necessary. Author: Stephen Blinick Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Approved by: Gordon Ross Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Thu Feb 16 17:08:43 2017 (r313812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Thu Feb 16 19:00:09 2017 (r313813) @@ -49,12 +49,6 @@ uint_t zfs_dbuf_evict_key; -/* - * Number of times that zfs_free_range() took the slow path while doing - * a zfs receive. A nonzero value indicates a potential performance problem. - */ -uint64_t zfs_free_range_recv_miss; - static boolean_t dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx); static void dbuf_write(dbuf_dirty_record_t *dr, arc_buf_t *data, dmu_tx_t *tx); @@ -1220,9 +1214,6 @@ dbuf_unoverride(dbuf_dirty_record_t *dr) * Evict (if its unreferenced) or clear (if its referenced) any level-0 * data blocks in the free range, so that any future readers will find * empty blocks. - * - * This is a no-op if the dataset is in the middle of an incremental - * receive; see comment below for details. */ void dbuf_free_range(dnode_t *dn, uint64_t start_blkid, uint64_t end_blkid, @@ -1232,10 +1223,9 @@ dbuf_free_range(dnode_t *dn, uint64_t st dmu_buf_impl_t *db, *db_next; uint64_t txg = tx->tx_txg; avl_index_t where; - boolean_t freespill = - (start_blkid == DMU_SPILL_BLKID || end_blkid == DMU_SPILL_BLKID); - if (end_blkid > dn->dn_maxblkid && !freespill) + if (end_blkid > dn->dn_maxblkid && + !(start_blkid == DMU_SPILL_BLKID || end_blkid == DMU_SPILL_BLKID)) end_blkid = dn->dn_maxblkid; dprintf_dnode(dn, "start=%llu end=%llu\n", start_blkid, end_blkid); @@ -1244,29 +1234,9 @@ dbuf_free_range(dnode_t *dn, uint64_t st db_search.db_state = DB_SEARCH; mutex_enter(&dn->dn_dbufs_mtx); - if (start_blkid >= dn->dn_unlisted_l0_blkid && !freespill) { - /* There can't be any dbufs in this range; no need to search. */ -#ifdef DEBUG - db = avl_find(&dn->dn_dbufs, &db_search, &where); - ASSERT3P(db, ==, NULL); - db = avl_nearest(&dn->dn_dbufs, where, AVL_AFTER); - ASSERT(db == NULL || db->db_level > 0); -#endif - mutex_exit(&dn->dn_dbufs_mtx); - return; - } else if (dmu_objset_is_receiving(dn->dn_objset)) { - /* - * If we are receiving, we expect there to be no dbufs in - * the range to be freed, because receive modifies each - * block at most once, and in offset order. If this is - * not the case, it can lead to performance problems, - * so note that we unexpectedly took the slow path. - */ - atomic_inc_64(&zfs_free_range_recv_miss); - } - db = avl_find(&dn->dn_dbufs, &db_search, &where); ASSERT3P(db, ==, NULL); + db = avl_nearest(&dn->dn_dbufs, where, AVL_AFTER); for (; db != NULL; db = db_next) { @@ -2283,9 +2253,7 @@ dbuf_create(dnode_t *dn, uint8_t level, return (odb); } avl_add(&dn->dn_dbufs, db); - if (db->db_level == 0 && db->db_blkid >= - dn->dn_unlisted_l0_blkid) - dn->dn_unlisted_l0_blkid = db->db_blkid + 1; + db->db_state = DB_UNCACHED; mutex_exit(&dn->dn_dbufs_mtx); arc_space_consume(sizeof (dmu_buf_impl_t), ARC_SPACE_OTHER); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Feb 16 17:08:43 2017 (r313812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Feb 16 19:00:09 2017 (r313813) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2015 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -153,7 +153,6 @@ dnode_cons(void *arg, void *unused, int dn->dn_id_flags = 0; dn->dn_dbufs_count = 0; - dn->dn_unlisted_l0_blkid = 0; avl_create(&dn->dn_dbufs, dbuf_compare, sizeof (dmu_buf_impl_t), offsetof(dmu_buf_impl_t, db_link)); @@ -207,7 +206,6 @@ dnode_dest(void *arg, void *unused) ASSERT0(dn->dn_id_flags); ASSERT0(dn->dn_dbufs_count); - ASSERT0(dn->dn_unlisted_l0_blkid); avl_destroy(&dn->dn_dbufs); } @@ -525,7 +523,6 @@ dnode_destroy(dnode_t *dn) dn->dn_newuid = 0; dn->dn_newgid = 0; dn->dn_id_flags = 0; - dn->dn_unlisted_l0_blkid = 0; dmu_zfetch_fini(&dn->dn_zfetch); kmem_cache_free(dnode_cache, dn); @@ -761,7 +758,6 @@ dnode_move_impl(dnode_t *odn, dnode_t *n ASSERT(avl_is_empty(&ndn->dn_dbufs)); avl_swap(&ndn->dn_dbufs, &odn->dn_dbufs); ndn->dn_dbufs_count = odn->dn_dbufs_count; - ndn->dn_unlisted_l0_blkid = odn->dn_unlisted_l0_blkid; ndn->dn_bonus = odn->dn_bonus; ndn->dn_have_spill = odn->dn_have_spill; ndn->dn_zio = odn->dn_zio; @@ -794,7 +790,6 @@ dnode_move_impl(dnode_t *odn, dnode_t *n avl_create(&odn->dn_dbufs, dbuf_compare, sizeof (dmu_buf_impl_t), offsetof(dmu_buf_impl_t, db_link)); odn->dn_dbufs_count = 0; - odn->dn_unlisted_l0_blkid = 0; odn->dn_bonus = NULL; odn->dn_zfetch.zf_dnode = NULL; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Thu Feb 16 17:08:43 2017 (r313812) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Thu Feb 16 19:00:09 2017 (r313813) @@ -195,8 +195,6 @@ struct dnode { /* protected by dn_dbufs_mtx; declared here to fill 32-bit hole */ uint32_t dn_dbufs_count; /* count of dn_dbufs */ - /* There are no level-0 blocks of this blkid or higher in dn_dbufs */ - uint64_t dn_unlisted_l0_blkid; /* protected by os_lock: */ list_node_t dn_dirty_link[TXG_SIZE]; /* next on dataset's dirty */ From owner-svn-src-head@freebsd.org Thu Feb 16 19:41:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F3FACE232F; Thu, 16 Feb 2017 19:41:14 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D5BC187D; Thu, 16 Feb 2017 19:41:14 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GJfD5v087707; Thu, 16 Feb 2017 19:41:13 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GJfDoP087457; Thu, 16 Feb 2017 19:41:13 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201702161941.v1GJfDoP087457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 16 Feb 2017 19:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313814 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 19:41:14 -0000 Author: rstone Date: Thu Feb 16 19:41:13 2017 New Revision: 313814 URL: https://svnweb.freebsd.org/changeset/base/313814 Log: Check for preemption after lowering a thread's priority When a high-priority thread is waiting for a mutex held by a low-priority thread, it temporarily lends its priority to the low-priority thread to prevent priority inversion. When the mutex is released, the lent priority is revoked and the low-priority thread goes back to its original priority. When the priority of that thread is lowered (through a call to sched_priority()), the schedule was not checking whether there is now a high-priority thread in the run queue. This can cause threads with real-time priority to be starved in the run queue while the low-priority thread finishes its quantum. Fix this by explicitly checking whether preemption is necessary when a thread's priority is lowered. Sponsored by: Dell EMC Isilon Obtained from: Sandvine Inc Differential Revision: https://reviews.freebsd.org/D9518 Reviewed by: Jeff Roberson (ule) MFC after: 1 month Modified: head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Thu Feb 16 19:00:09 2017 (r313813) +++ head/sys/kern/sched_4bsd.c Thu Feb 16 19:41:13 2017 (r313814) @@ -816,7 +816,12 @@ sched_class(struct thread *td, int class static void sched_priority(struct thread *td, u_char prio) { - + struct thread *newtd; + struct runq *rq; + u_char orig_pri; +#ifdef SMP + struct thread *cputd; +#endif KTR_POINT3(KTR_SCHED, "thread", sched_tdname(td), "priority change", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, @@ -832,10 +837,43 @@ sched_priority(struct thread *td, u_char THREAD_LOCK_ASSERT(td, MA_OWNED); if (td->td_priority == prio) return; + orig_pri = td->td_priority; td->td_priority = prio; if (TD_ON_RUNQ(td) && td->td_rqindex != (prio / RQ_PPQ)) { sched_rem(td); sched_add(td, SRQ_BORING); + } else if (orig_pri < prio && TD_IS_RUNNING(td)) { + /* + * If we have decreased the priority of a running thread, we + * have to check if it should be preempted. + */ + rq = &runq; + newtd = runq_choose(&runq); +#ifdef SMP + cputd = runq_choose(&runq_pcpu[td->td_oncpu]); + if (newtd == NULL || + (cputd != NULL && cputd->td_priority < td->td_priority)) + newtd = cputd; +#endif + + if (newtd != NULL && newtd->td_priority < prio +#ifndef FULL_PREEMPTION + && (newtd->td_priority <= PRI_MAX_ITHD || + prio >= PRI_MIN_IDLE)) +#endif + ) { + if (td == curthread) + /* + * Don't reschedule the thread here as it may + * be losing priority because it has released a + * mutex, and in that case we need it to finish + * releasing the lock before it gets preempted. + */ + td->td_owepreempt = 1; + else + kick_other_cpu(newtd->td_priority, + td->td_oncpu); + } } } Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Thu Feb 16 19:00:09 2017 (r313813) +++ head/sys/kern/sched_ule.c Thu Feb 16 19:41:13 2017 (r313814) @@ -319,7 +319,7 @@ static void tdq_add(struct tdq *, struct #ifdef SMP static int tdq_move(struct tdq *, struct tdq *); static int tdq_idled(struct tdq *); -static void tdq_notify(struct tdq *, struct thread *); +static void tdq_notify(struct tdq *, int); static struct thread *tdq_steal(struct tdq *, int); static struct thread *runq_steal(struct runq *, int); static int sched_pickcpu(struct thread *, int); @@ -1040,16 +1040,14 @@ tdq_idled(struct tdq *tdq) * Notify a remote cpu of new work. Sends an IPI if criteria are met. */ static void -tdq_notify(struct tdq *tdq, struct thread *td) +tdq_notify(struct tdq *tdq, int pri) { struct thread *ctd; - int pri; int cpu; if (tdq->tdq_ipipending) return; - cpu = td_get_sched(td)->ts_cpu; - pri = td->td_priority; + cpu = TD_ID(tdq); ctd = pcpu_find(cpu)->pc_curthread; if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) return; @@ -1675,6 +1673,22 @@ sched_pctcpu_update(struct td_sched *ts, ts->ts_ltick = t; } +static void +sched_check_preempt(struct tdq *tdq, struct thread *td) +{ + + KASSERT(TD_IS_RUNNING(td), ("thread is not running")); + TDQ_LOCK_ASSERT(tdq, MA_OWNED); + KASSERT(tdq == TDQ_CPU(td->td_sched->ts_cpu), + ("tdq does not contain td")); + + if (tdq == TDQ_SELF()) { + if (sched_shouldpreempt(tdq->tdq_lowpri, td->td_priority, 0)) + td->td_owepreempt = 1; + } else + tdq_notify(tdq, tdq->tdq_lowpri); +} + /* * Adjust the priority of a thread. Move it to the appropriate run-queue * if necessary. This is the back-end for several priority related @@ -1726,6 +1740,9 @@ sched_thread_priority(struct thread *td, tdq->tdq_lowpri = prio; else if (tdq->tdq_lowpri == oldpri) tdq_setlowpri(tdq, td); + + if (oldpri < prio) + sched_check_preempt(tdq, td); return; } td->td_priority = prio; @@ -1854,7 +1871,7 @@ sched_switch_migrate(struct tdq *tdq, st */ tdq_lock_pair(tdn, tdq); tdq_add(tdn, td, flags); - tdq_notify(tdn, td); + tdq_notify(tdn, td->td_priority); TDQ_UNLOCK(tdn); spinlock_exit(); #endif @@ -2429,7 +2446,7 @@ sched_add(struct thread *td, int flags) tdq = sched_setcpu(td, cpu, flags); tdq_add(tdq, td, flags); if (cpu != PCPU_GET(cpuid)) { - tdq_notify(tdq, td); + tdq_notify(tdq, td->td_priority); return; } #else From owner-svn-src-head@freebsd.org Thu Feb 16 19:55:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69865CE2674; Thu, 16 Feb 2017 19:55:20 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF382124E; Thu, 16 Feb 2017 19:55:19 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([78.52.163.163]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MVayZ-1csbiL07p9-00Yy0l; Thu, 16 Feb 2017 20:55:10 +0100 Date: Thu, 16 Feb 2017 20:55:04 +0100 From: "O. Hartmann" To: Ryan Stone Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313814 - head/sys/kern Message-ID: <20170216205455.4db475b0@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201702161941.v1GJfDoP087457@repo.freebsd.org> References: <201702161941.v1GJfDoP087457@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/Jl9eb+ySX0Of77FrF3jqqL9"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:fuzYitG5bNsYkE2ovQxZh/HvCpKP69InXJsHLTc56iTO7NUDAXw gZyxsYnXyUyEL5udWU6fY8uStFYUnnWKE21nHf+lQoYDtrQo6Wi3Rp2bNBBeNpRxyZBYoK0 qrsB7IqYV+n/r1nW7xnZ3nTMktnTUQ+DtK57jOs0cB4/7vyc6Y2QBow3FPeb0sgi1KcQ5UV 2QLqmdk1rjxSQptaAQMPg== X-UI-Out-Filterresults: notjunk:1;V01:K0:xM+bLjd/zuw=:smk6bY7lGsZsFFOAFdIWWn g1nvidEqUW7ZzTiUloL4O4gI7bHbBUvNulcbPtKXIpZUGgF7QPXcZz93qsV2SeroRHoSAAAQ5 bWd5YpkfA0Ddy7Up1SHFJQwq3j14Wyb7SHjTfb9HpaqfIdpk7yfM4nOLGGUYfA/WpkQ4eoV7b lt2ah/f61rayNCdOyCO3gwtaR4yFaUkHhq7OEWRUp8u017OqsKQ/phtHpISbuAnGflNPlBab+ 4RLiNrhJOtYxBhxYVPg7OnREn0Z2/SXBaGE0liOcTHEITT3PQP9OOEfoQ7wjAfZkgLpPwmkgP 813+3y4K0TppTDiVZ2hosb3LGA+1gx46pcpolUJS6hHggZchlLL7dLSrB4SQTHHR5KfR7gRcV ZJcd0pTJ3xlydrd0o5mXtJ25kXW7wRcGxH38PMSpbJND3bqzFspfhxsr7ktgg74cjFuXSVXyB 1wq8xqcH/ie4DM+mvnioqHjsSaJFi8RQMP/7LzMqxBrZ1+BjL1OYoJIJ7/yihV3nANTxfVt1t 7/gN09LjjYPaxUDwjZgjq7aOGze1PM50I6IIf6m5jlBvZpFEJMewE1z0NpGvlH9Jt5Bent+iB eWAH44TPtghOlmWuGZfcnzvdSi05ryjZQqU1W4TdGcmtpHPLQRUscCuUz8Ii4Z/FCqHeItAII L/35QMG/dp4Najmr3oqKpEomnbbHAjgfGYq+Gu2aZy0mrI/ZyAYDlgqQUNgjwEAVieQ/YjPzu JZzAW5onckbIPeS6i7k6rLSHW4+wg/zgCSpZ6RMeGBWdRxa5fXC4KNPFaGmoW/papoIZhfUMK v/FSoLj+OhiNnZonQ0Nw8dLp7C7LXsleJqS1XLmb/oKvFA6bpkIxC1dww0OYLbtjRYUHe3NCg o/QvnccVSM1Ztf1CY3SrMJdmAi1l0CufAVKpAYCfRHaDuh8B19DqMUlTqj650rqSRNlcaPRWy +YdJzQyaPYcFjGHGBNX5gNe8mdi0hTzkGRntdii3T3QTor9rOIesFVOeBn5k60aoK1h0ImcSr SBtCp8G5hhPQCRPd31eLA+jHsNpHF7x57lsmPzu7Hvld X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 19:55:20 -0000 --Sig_/Jl9eb+ySX0Of77FrF3jqqL9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Thu, 16 Feb 2017 19:41:13 +0000 (UTC) Ryan Stone schrieb: > Author: rstone > Date: Thu Feb 16 19:41:13 2017 > New Revision: 313814 > URL: https://svnweb.freebsd.org/changeset/base/313814 >=20 > Log: > Check for preemption after lowering a thread's priority > =20 > When a high-priority thread is waiting for a mutex held by a > low-priority thread, it temporarily lends its priority to the > low-priority thread to prevent priority inversion. When the mutex > is released, the lent priority is revoked and the low-priority > thread goes back to its original priority. > =20 > When the priority of that thread is lowered (through a call to > sched_priority()), the schedule was not checking whether > there is now a high-priority thread in the run queue. This can > cause threads with real-time priority to be starved in the run > queue while the low-priority thread finishes its quantum. > =20 > Fix this by explicitly checking whether preemption is necessary > when a thread's priority is lowered. > =20 > Sponsored by: Dell EMC Isilon > Obtained from: Sandvine Inc > Differential Revision: https://reviews.freebsd.org/D9518 > Reviewed by: Jeff Roberson (ule) > MFC after: 1 month >=20 > Modified: > head/sys/kern/sched_4bsd.c > head/sys/kern/sched_ule.c >=20 > Modified: head/sys/kern/sched_4bsd.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/kern/sched_4bsd.c Thu Feb 16 19:00:09 2017 (r313813) > +++ head/sys/kern/sched_4bsd.c Thu Feb 16 19:41:13 2017 (r313814) > @@ -816,7 +816,12 @@ sched_class(struct thread *td, int class > static void > sched_priority(struct thread *td, u_char prio) > { > - > + struct thread *newtd; > + struct runq *rq; > + u_char orig_pri; > +#ifdef SMP > + struct thread *cputd; > +#endif > =20 > KTR_POINT3(KTR_SCHED, "thread", sched_tdname(td), "priority change", > "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, > @@ -832,10 +837,43 @@ sched_priority(struct thread *td, u_char > THREAD_LOCK_ASSERT(td, MA_OWNED); > if (td->td_priority =3D=3D prio) > return; > + orig_pri =3D td->td_priority; > td->td_priority =3D prio; > if (TD_ON_RUNQ(td) && td->td_rqindex !=3D (prio / RQ_PPQ)) { > sched_rem(td); > sched_add(td, SRQ_BORING); > + } else if (orig_pri < prio && TD_IS_RUNNING(td)) { > + /* > + * If we have decreased the priority of a running thread, we > + * have to check if it should be preempted. > + */ > + rq =3D &runq; > + newtd =3D runq_choose(&runq); > +#ifdef SMP > + cputd =3D runq_choose(&runq_pcpu[td->td_oncpu]); > + if (newtd =3D=3D NULL || > + (cputd !=3D NULL && cputd->td_priority < td->td_priority)) > + newtd =3D cputd; > +#endif > + > + if (newtd !=3D NULL && newtd->td_priority < prio > +#ifndef FULL_PREEMPTION > + && (newtd->td_priority <=3D PRI_MAX_ITHD || > + prio >=3D PRI_MIN_IDLE)) > +#endif > + ) { > + if (td =3D=3D curthread) > + /* > + * Don't reschedule the thread here as it may > + * be losing priority because it has released a > + * mutex, and in that case we need it to finish > + * releasing the lock before it gets preempted. > + */ > + td->td_owepreempt =3D 1; > + else > + kick_other_cpu(newtd->td_priority, > + td->td_oncpu); > + } > } > } > =20 >=20 > Modified: head/sys/kern/sched_ule.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/kern/sched_ule.c Thu Feb 16 19:00:09 2017 (r313813) > +++ head/sys/kern/sched_ule.c Thu Feb 16 19:41:13 2017 (r313814) > @@ -319,7 +319,7 @@ static void tdq_add(struct tdq *, struct > #ifdef SMP > static int tdq_move(struct tdq *, struct tdq *); > static int tdq_idled(struct tdq *); > -static void tdq_notify(struct tdq *, struct thread *); > +static void tdq_notify(struct tdq *, int); > static struct thread *tdq_steal(struct tdq *, int); > static struct thread *runq_steal(struct runq *, int); > static int sched_pickcpu(struct thread *, int); > @@ -1040,16 +1040,14 @@ tdq_idled(struct tdq *tdq) > * Notify a remote cpu of new work. Sends an IPI if criteria are met. > */ > static void > -tdq_notify(struct tdq *tdq, struct thread *td) > +tdq_notify(struct tdq *tdq, int pri) > { > struct thread *ctd; > - int pri; > int cpu; > =20 > if (tdq->tdq_ipipending) > return; > - cpu =3D td_get_sched(td)->ts_cpu; > - pri =3D td->td_priority; > + cpu =3D TD_ID(tdq); > ctd =3D pcpu_find(cpu)->pc_curthread; > if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) > return; > @@ -1675,6 +1673,22 @@ sched_pctcpu_update(struct td_sched *ts, > ts->ts_ltick =3D t; > } > =20 > +static void > +sched_check_preempt(struct tdq *tdq, struct thread *td) > +{ > + > + KASSERT(TD_IS_RUNNING(td), ("thread is not running")); > + TDQ_LOCK_ASSERT(tdq, MA_OWNED); > + KASSERT(tdq =3D=3D TDQ_CPU(td->td_sched->ts_cpu), > + ("tdq does not contain td")); > + > + if (tdq =3D=3D TDQ_SELF()) { > + if (sched_shouldpreempt(tdq->tdq_lowpri, td->td_priority, 0)) > + td->td_owepreempt =3D 1; > + } else > + tdq_notify(tdq, tdq->tdq_lowpri); > +} > + > /* > * Adjust the priority of a thread. Move it to the appropriate run-queue > * if necessary. This is the back-end for several priority related > @@ -1726,6 +1740,9 @@ sched_thread_priority(struct thread *td, > tdq->tdq_lowpri =3D prio; > else if (tdq->tdq_lowpri =3D=3D oldpri) > tdq_setlowpri(tdq, td); > + > + if (oldpri < prio) > + sched_check_preempt(tdq, td); > return; > } > td->td_priority =3D prio; > @@ -1854,7 +1871,7 @@ sched_switch_migrate(struct tdq *tdq, st > */ > tdq_lock_pair(tdn, tdq); > tdq_add(tdn, td, flags); > - tdq_notify(tdn, td); > + tdq_notify(tdn, td->td_priority); > TDQ_UNLOCK(tdn); > spinlock_exit(); > #endif > @@ -2429,7 +2446,7 @@ sched_add(struct thread *td, int flags) > tdq =3D sched_setcpu(td, cpu, flags); > tdq_add(tdq, td, flags); > if (cpu !=3D PCPU_GET(cpuid)) { > - tdq_notify(tdq, td); > + tdq_notify(tdq, td->td_priority); > return; > } > #else > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" This commit breaks buildkernel: --- sched_ule.o --- /usr/src/sys/kern/sched_ule.c:1050:8: error: implicit declaration of functi= on 'TD_ID' is invalid in C99 [-Werror,-Wimplicit-function-declaration] cpu =3D TD_ID(tdq); ^ 1 error generated. *** [sched_ule.o] Error code 1 --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/Jl9eb+ySX0Of77FrF3jqqL9 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWKYDmAAKCRDS528fyFhY lCvKAfwL0yNbn5U6omEHedcfA5dUPaFaLLHp7IdMZNH6VWYiGNOPLcP5Jg86Xd5l K26dloHO3ULOsr0D8KWGVY9lv/mQAf4gZkEauEhlQ0R1xkh89WPtmdVWC0UES+gZ /0QzDezNvUqdwOOe+bqpiwU6SDGRz2ak2W30y9ra/Uq1XfWWXA1p =cqpf -----END PGP SIGNATURE----- --Sig_/Jl9eb+ySX0Of77FrF3jqqL9-- From owner-svn-src-head@freebsd.org Thu Feb 16 19:58:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2290BCE2713; Thu, 16 Feb 2017 19:58:04 +0000 (UTC) (envelope-from robak@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9DAC13BD; Thu, 16 Feb 2017 19:58:03 +0000 (UTC) (envelope-from robak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GJw2WG093402; Thu, 16 Feb 2017 19:58:02 GMT (envelope-from robak@FreeBSD.org) Received: (from robak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GJw2Rs093401; Thu, 16 Feb 2017 19:58:02 GMT (envelope-from robak@FreeBSD.org) Message-Id: <201702161958.v1GJw2Rs093401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: robak set sender to robak@FreeBSD.org using -f From: Bartek Rutkowski Date: Thu, 16 Feb 2017 19:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313815 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 19:58:04 -0000 Author: robak (ports committer) Date: Thu Feb 16 19:58:02 2017 New Revision: 313815 URL: https://svnweb.freebsd.org/changeset/base/313815 Log: Add 0-8 as shortcuts for jumping to menu items in the hardening menu. Submitted by: skreuzer Reviewed by: allanjude, robak Approved by: allanjude Differential Revision: https://reviews.freebsd.org/D6826 Modified: head/usr.sbin/bsdinstall/scripts/hardening Modified: head/usr.sbin/bsdinstall/scripts/hardening ============================================================================== --- head/usr.sbin/bsdinstall/scripts/hardening Thu Feb 16 19:41:13 2017 (r313814) +++ head/usr.sbin/bsdinstall/scripts/hardening Thu Feb 16 19:58:02 2017 (r313815) @@ -33,18 +33,18 @@ echo -n > $BSDINSTALL_TMPETC/sysctl.conf exec 3>&1 FEATURES=$( dialog --backtitle "FreeBSD Installer" \ - --title "System Hardening" --nocancel --notags --separate-output \ + --title "System Hardening" --nocancel --separate-output \ --checklist "Choose system security hardening options:" \ 0 0 0 \ - "hide_uids" "Hide processes running as other users" ${hide_uids:-off} \ - "hide_gids" "Hide processes running as other groups" ${hide_gids:-off} \ - "read_msgbuf" "Disable reading kernel message buffer for unprivileged users" ${read_msgbuf:-off} \ - "proc_debug" "Disable process debugging facilities for unprivileged users" ${proc_debug:-off} \ - "random_pid" "Randomize the PID of newly created processes" ${random_pid:-off} \ - "stack_guard" "Insert stack guard page ahead of the growable segments" ${stack_guard:-off} \ - "clear_tmp" "Clean the /tmp filesystem on system startup" ${clear_tmp:-off} \ - "disable_syslogd" "Disable opening Syslogd network socket (disables remote logging)" ${disable_syslogd:-off} \ - "disable_sendmail" "Disable Sendmail service" ${disable_sendmail:-off} \ + "0 hide_uids" "Hide processes running as other users" ${hide_uids:-off} \ + "1 hide_gids" "Hide processes running as other groups" ${hide_gids:-off} \ + "2 read_msgbuf" "Disable reading kernel message buffer for unprivileged users" ${read_msgbuf:-off} \ + "3 proc_debug" "Disable process debugging facilities for unprivileged users" ${proc_debug:-off} \ + "4 random_pid" "Randomize the PID of newly created processes" ${random_pid:-off} \ + "5 stack_guard" "Insert stack guard page ahead of the growable segments" ${stack_guard:-off} \ + "6 clear_tmp" "Clean the /tmp filesystem on system startup" ${clear_tmp:-off} \ + "7 disable_syslogd" "Disable opening Syslogd network socket (disables remote logging)" ${disable_syslogd:-off} \ + "8 disable_sendmail" "Disable Sendmail service" ${disable_sendmail:-off} \ 2>&1 1>&3 ) exec 3>&- From owner-svn-src-head@freebsd.org Thu Feb 16 20:06:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6402FCE2967; Thu, 16 Feb 2017 20:06:22 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 310CE19A3; Thu, 16 Feb 2017 20:06:22 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GK6L5p097533; Thu, 16 Feb 2017 20:06:21 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GK6LnX097532; Thu, 16 Feb 2017 20:06:21 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201702162006.v1GK6LnX097532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 16 Feb 2017 20:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313816 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 20:06:22 -0000 Author: rstone Date: Thu Feb 16 20:06:21 2017 New Revision: 313816 URL: https://svnweb.freebsd.org/changeset/base/313816 Log: Fix a typo in my previous commit Somehow in the late stages of testing my sched_ule patch, a character was accidentally deleted from the file. Correct this. While I'm committing anyway, the previous commit message requires some clarification: in the normal case of unlending priority after releasing a mutex, the thread that was doing the lending will be woken up and immediately become the highest-priority thread, and in that case no priority inversion would take place. However, if that thread is pinned to a different CPU, then the currently running thread that just had its priority lowered will not be preempted and then priority inversion can occur. Reported by: O. Hartmann (typo), jhb (scheduler clarification) MFC after: 1 month Pointy hat to: rstone Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Thu Feb 16 19:58:02 2017 (r313815) +++ head/sys/kern/sched_ule.c Thu Feb 16 20:06:21 2017 (r313816) @@ -1047,7 +1047,7 @@ tdq_notify(struct tdq *tdq, int pri) if (tdq->tdq_ipipending) return; - cpu = TD_ID(tdq); + cpu = TDQ_ID(tdq); ctd = pcpu_find(cpu)->pc_curthread; if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) return; From owner-svn-src-head@freebsd.org Thu Feb 16 20:27:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29BAACE2EE9; Thu, 16 Feb 2017 20:27:24 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED74814BA; Thu, 16 Feb 2017 20:27:23 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GKRN4S005995; Thu, 16 Feb 2017 20:27:23 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GKRNM1005994; Thu, 16 Feb 2017 20:27:23 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201702162027.v1GKRNM1005994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 16 Feb 2017 20:27:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313817 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 20:27:24 -0000 Author: vangyzen Date: Thu Feb 16 20:27:22 2017 New Revision: 313817 URL: https://svnweb.freebsd.org/changeset/base/313817 Log: acpica: remove a superfluous NULL check The address-of operator can't produce NULL (in practice). Remove an unnecessary NULL check. MFC after: 3 days Sponsored by: Dell EMC Modified: head/sys/dev/acpica/acpi_package.c Modified: head/sys/dev/acpica/acpi_package.c ============================================================================== --- head/sys/dev/acpica/acpi_package.c Thu Feb 16 20:06:21 2017 (r313816) +++ head/sys/dev/acpica/acpi_package.c Thu Feb 16 20:27:22 2017 (r313817) @@ -50,7 +50,7 @@ acpi_PkgInt(ACPI_OBJECT *res, int idx, U ACPI_OBJECT *obj; obj = &res->Package.Elements[idx]; - if (obj == NULL || obj->Type != ACPI_TYPE_INTEGER) + if (obj->Type != ACPI_TYPE_INTEGER) return (EINVAL); *dst = obj->Integer.Value; From owner-svn-src-head@freebsd.org Thu Feb 16 20:28:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 635C4CE2F78; Thu, 16 Feb 2017 20:28:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 308941711; Thu, 16 Feb 2017 20:28:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GKSUOj006076; Thu, 16 Feb 2017 20:28:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GKSUNq006075; Thu, 16 Feb 2017 20:28:30 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702162028.v1GKSUNq006075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 16 Feb 2017 20:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313818 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 20:28:31 -0000 Author: pfg Date: Thu Feb 16 20:28:30 2017 New Revision: 313818 URL: https://svnweb.freebsd.org/changeset/base/313818 Log: Small inclusion guard comment fix. Modified: head/include/pthread.h Modified: head/include/pthread.h ============================================================================== --- head/include/pthread.h Thu Feb 16 20:27:22 2017 (r313817) +++ head/include/pthread.h Thu Feb 16 20:28:30 2017 (r313818) @@ -347,4 +347,4 @@ void __pthread_cleanup_pop_imp(int); __END_DECLS __NULLABILITY_PRAGMA_POP -#endif /* _PTHREAD_H_ */ +#endif /* !_PTHREAD_H_ */ From owner-svn-src-head@freebsd.org Thu Feb 16 20:30:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E461CE2098; Thu, 16 Feb 2017 20:30:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26B491943; Thu, 16 Feb 2017 20:30:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GKUueX008300; Thu, 16 Feb 2017 20:30:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GKUuWm008299; Thu, 16 Feb 2017 20:30:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702162030.v1GKUuWm008299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 16 Feb 2017 20:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313819 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 20:30:57 -0000 Author: pfg Date: Thu Feb 16 20:30:55 2017 New Revision: 313819 URL: https://svnweb.freebsd.org/changeset/base/313819 Log: Remove outdated claim. Despite wishful thinking the removal of these old function hasn't happened yet. MFC after: 3 days Modified: head/include/stdlib.h Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Thu Feb 16 20:28:30 2017 (r313818) +++ head/include/stdlib.h Thu Feb 16 20:30:55 2017 (r313819) @@ -315,7 +315,7 @@ void srandomdev(void); long long strtonum(const char *, long long, long long, const char **); -/* Deprecated interfaces, to be removed in FreeBSD 6.0. */ +/* Deprecated interfaces, to be removed. */ __int64_t strtoq(const char *, char **, int); __uint64_t From owner-svn-src-head@freebsd.org Thu Feb 16 20:31:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCDF6CE2370; Thu, 16 Feb 2017 20:31:52 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 674EA1D19; Thu, 16 Feb 2017 20:31:51 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id eSiTc3UFKsa1keSiUcVcoi; Thu, 16 Feb 2017 13:31:51 -0700 X-Authority-Analysis: v=2.2 cv=W+NIbVek c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=n2v9WMKugxEA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=j9e7v2RgpAP0KFEN9twA:9 a=wFytJBbQj98qeGYh:21 a=DJLbta-Kyx7JE-Rh:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 90101DA1; Thu, 16 Feb 2017 12:31:49 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v1GKVmjA097376; Thu, 16 Feb 2017 12:31:48 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201702162031.v1GKVmjA097376@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ryan Stone cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313814 - head/sys/kern In-Reply-To: Message from Ryan Stone of "Thu, 16 Feb 2017 19:41:13 +0000." <201702161941.v1GJfDoP087457@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 16 Feb 2017 12:31:48 -0800 X-CMAE-Envelope: MS4wfKwUkmMUj32K8SmJbKX8rL3H1V895iGE4ZxYIRKPQCxIVa0oZU4VLODgyYIGEan845kJG1wbwxZuDJTYzJkcl0meWityk21dOW5B+EmDKPJlWTlLLlrl dEKbxicm4GHswdm++Dae12nZjpOhWU4BNP07VWn1hSKaXM0Tc9PT4+I73Xfg1KiO3/klgx188Dj6samQ5Gyl57l6SSzixG9BHeWXT6fSlBwPl5AeqMXawx5X PDPFxGKoJoHyWTaOLWNNrEHGnhaCxo9ikSwwAvS5A8+DMKv32jnwF+FutHnnk/iI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 20:31:52 -0000 In message <201702161941.v1GJfDoP087457@repo.freebsd.org>, Ryan Stone writes: > Author: rstone > Date: Thu Feb 16 19:41:13 2017 > New Revision: 313814 > URL: https://svnweb.freebsd.org/changeset/base/313814 > > Log: > Check for preemption after lowering a thread's priority > > When a high-priority thread is waiting for a mutex held by a > low-priority thread, it temporarily lends its priority to the > low-priority thread to prevent priority inversion. When the mutex > is released, the lent priority is revoked and the low-priority > thread goes back to its original priority. > > When the priority of that thread is lowered (through a call to > sched_priority()), the schedule was not checking whether > there is now a high-priority thread in the run queue. This can > cause threads with real-time priority to be starved in the run > queue while the low-priority thread finishes its quantum. > > Fix this by explicitly checking whether preemption is necessary > when a thread's priority is lowered. > > Sponsored by: Dell EMC Isilon > Obtained from: Sandvine Inc > Differential Revision: https://reviews.freebsd.org/D9518 > Reviewed by: Jeff Roberson (ule) > MFC after: 1 month > > Modified: > head/sys/kern/sched_4bsd.c > head/sys/kern/sched_ule.c > > Modified: head/sys/kern/sched_4bsd.c > ============================================================================= > = > --- head/sys/kern/sched_4bsd.c Thu Feb 16 19:00:09 2017 (r31381 > 3) > +++ head/sys/kern/sched_4bsd.c Thu Feb 16 19:41:13 2017 (r31381 > 4) > @@ -816,7 +816,12 @@ sched_class(struct thread *td, int class > static void > sched_priority(struct thread *td, u_char prio) > { > - > + struct thread *newtd; > + struct runq *rq; > + u_char orig_pri; > +#ifdef SMP > + struct thread *cputd; > +#endif > > KTR_POINT3(KTR_SCHED, "thread", sched_tdname(td), "priority change", > "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, > @@ -832,10 +837,43 @@ sched_priority(struct thread *td, u_char > THREAD_LOCK_ASSERT(td, MA_OWNED); > if (td->td_priority == prio) > return; > + orig_pri = td->td_priority; > td->td_priority = prio; > if (TD_ON_RUNQ(td) && td->td_rqindex != (prio / RQ_PPQ)) { > sched_rem(td); > sched_add(td, SRQ_BORING); > + } else if (orig_pri < prio && TD_IS_RUNNING(td)) { > + /* > + * If we have decreased the priority of a running thread, we > + * have to check if it should be preempted. > + */ > + rq = &runq; > + newtd = runq_choose(&runq); > +#ifdef SMP > + cputd = runq_choose(&runq_pcpu[td->td_oncpu]); > + if (newtd == NULL || > + (cputd != NULL && cputd->td_priority < td->td_priority)) > + newtd = cputd; > +#endif > + > + if (newtd != NULL && newtd->td_priority < prio > +#ifndef FULL_PREEMPTION > + && (newtd->td_priority <= PRI_MAX_ITHD || > + prio >= PRI_MIN_IDLE)) > +#endif > + ) { > + if (td == curthread) > + /* > + * Don't reschedule the thread here as it may > + * be losing priority because it has released a > + * mutex, and in that case we need it to finish > + * releasing the lock before it gets preempted. > + */ > + td->td_owepreempt = 1; > + else > + kick_other_cpu(newtd->td_priority, > + td->td_oncpu); > + } > } > } > > > Modified: head/sys/kern/sched_ule.c > ============================================================================= > = > --- head/sys/kern/sched_ule.c Thu Feb 16 19:00:09 2017 (r313813) > +++ head/sys/kern/sched_ule.c Thu Feb 16 19:41:13 2017 (r313814) > @@ -319,7 +319,7 @@ static void tdq_add(struct tdq *, struct > #ifdef SMP > static int tdq_move(struct tdq *, struct tdq *); > static int tdq_idled(struct tdq *); > -static void tdq_notify(struct tdq *, struct thread *); > +static void tdq_notify(struct tdq *, int); > static struct thread *tdq_steal(struct tdq *, int); > static struct thread *runq_steal(struct runq *, int); > static int sched_pickcpu(struct thread *, int); > @@ -1040,16 +1040,14 @@ tdq_idled(struct tdq *tdq) > * Notify a remote cpu of new work. Sends an IPI if criteria are met. > */ > static void > -tdq_notify(struct tdq *tdq, struct thread *td) > +tdq_notify(struct tdq *tdq, int pri) > { > struct thread *ctd; > - int pri; > int cpu; > > if (tdq->tdq_ipipending) > return; > - cpu = td_get_sched(td)->ts_cpu; > - pri = td->td_priority; > + cpu = TD_ID(tdq); Just my luck. The day I svn up and rebuild. --- sched_ule.o --- /opt/src/svn-current/sys/kern/sched_ule.c:1050:8: error: implicit declaration of function 'TD_ID' is invalid in C99 [-Werror,-Wimplicit-functi on-declaration] cpu = TD_ID(tdq); ^ -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. > ctd = pcpu_find(cpu)->pc_curthread; > if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) > return; > @@ -1675,6 +1673,22 @@ sched_pctcpu_update(struct td_sched *ts, > ts->ts_ltick = t; > } > > +static void > +sched_check_preempt(struct tdq *tdq, struct thread *td) > +{ > + > + KASSERT(TD_IS_RUNNING(td), ("thread is not running")); > + TDQ_LOCK_ASSERT(tdq, MA_OWNED); > + KASSERT(tdq == TDQ_CPU(td->td_sched->ts_cpu), > + ("tdq does not contain td")); > + > + if (tdq == TDQ_SELF()) { > + if (sched_shouldpreempt(tdq->tdq_lowpri, td->td_priority, 0)) > + td->td_owepreempt = 1; > + } else > + tdq_notify(tdq, tdq->tdq_lowpri); > +} > + > /* > * Adjust the priority of a thread. Move it to the appropriate run-queue > * if necessary. This is the back-end for several priority related > @@ -1726,6 +1740,9 @@ sched_thread_priority(struct thread *td, > tdq->tdq_lowpri = prio; > else if (tdq->tdq_lowpri == oldpri) > tdq_setlowpri(tdq, td); > + > + if (oldpri < prio) > + sched_check_preempt(tdq, td); > return; > } > td->td_priority = prio; > @@ -1854,7 +1871,7 @@ sched_switch_migrate(struct tdq *tdq, st > */ > tdq_lock_pair(tdn, tdq); > tdq_add(tdn, td, flags); > - tdq_notify(tdn, td); > + tdq_notify(tdn, td->td_priority); > TDQ_UNLOCK(tdn); > spinlock_exit(); > #endif > @@ -2429,7 +2446,7 @@ sched_add(struct thread *td, int flags) > tdq = sched_setcpu(td, cpu, flags); > tdq_add(tdq, td, flags); > if (cpu != PCPU_GET(cpuid)) { > - tdq_notify(tdq, td); > + tdq_notify(tdq, td->td_priority); > return; > } > #else > > From owner-svn-src-head@freebsd.org Thu Feb 16 20:37:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19803CE252E; Thu, 16 Feb 2017 20:37:56 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF01111F5; Thu, 16 Feb 2017 20:37:55 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-it0-x229.google.com with SMTP id k200so7862938itb.1; Thu, 16 Feb 2017 12:37:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rClRCAGiIUrezIfdgyP0Eg4lOgJ5EabacG7udbHGe4M=; b=oINLbJpcEdX+7UvKT2gIjwbuxj9lyUjc3vqdYmqu57ox9urEASwXYcg4qU5wlf+P/6 rsbYKqBe8woCdsesH7l4feyFYoFpL/iRaHimy4rJ7o1HnP4hH/ZdqNr1JVMceKXAzOUw 2iV1KedstsrYanhmegICEdjfOZ3Tqri02UuZiNHw27EbgTlkVgYfGxkLkucTa+QVzY8r JFkWVJ+mGBQ2wCZZO/CV0F7w596MxLsVs2prq/VqbmrBxC7iO329oy7sUanTE32UtpzV 3psGsweuame76xr6nHW+sAY6D244KM0EbM2b1IOIcCAyKcJYBBiBt5f5QD3Q5YepD8Kf M4cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=rClRCAGiIUrezIfdgyP0Eg4lOgJ5EabacG7udbHGe4M=; b=LGvCI98fvYoqy9FypfycUV5zU4O4uTK3CZG/yWFrgvr4rYfaIVQ6ZKLWXASF3oE04l z41eGHTqmC6l+RJrCIkw8igAzVr1aGnuTbkwnvPm1AAV6JZKcWKewXm1Ji+MX5YUk0dp pjgg1cI5+9S0vhAB3BQ7BOFjGOo12acaUY7kZaw2puBX8E322aL0ZlvyC7J6DsDS+zQ+ B5yCUHHbexl0z8+BoaMP8y5LVd0uncqlmFOtuEtrUQqku4JfZ4s9/wTJIuKHmAmAZ3RV 5jM6F4YgicHOM2N6R4lz5VKWaE56sZZ33MovwAHNxJE9rcQPoRtfWx+zZo7/DBuB3NKT Ajmg== X-Gm-Message-State: AMke39l9oqJkHxX6OhDarSGn13kchAvwcYs2vM2GmqHfxr0Zjv+3pCYHqP8kPBsQFilseMVq/DbeNhif2hVEfg== X-Received: by 10.107.26.205 with SMTP id a196mr3993564ioa.214.1487277475231; Thu, 16 Feb 2017 12:37:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.190.71 with HTTP; Thu, 16 Feb 2017 12:37:54 -0800 (PST) In-Reply-To: <201702162031.v1GKVmjA097376@slippy.cwsent.com> References: <201702161941.v1GJfDoP087457@repo.freebsd.org> <201702162031.v1GKVmjA097376@slippy.cwsent.com> From: Ryan Stone Date: Thu, 16 Feb 2017 15:37:54 -0500 Message-ID: Subject: Re: svn commit: r313814 - head/sys/kern To: Cy Schubert Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 20:37:56 -0000 Sorry about that. It's fixed in r313816. On Thu, Feb 16, 2017 at 3:31 PM, Cy Schubert wrote: > In message <201702161941.v1GJfDoP087457@repo.freebsd.org>, Ryan Stone > writes: > > Author: rstone > > Date: Thu Feb 16 19:41:13 2017 > > New Revision: 313814 > > URL: https://svnweb.freebsd.org/changeset/base/313814 > > > > Log: > > Check for preemption after lowering a thread's priority > > > > When a high-priority thread is waiting for a mutex held by a > > low-priority thread, it temporarily lends its priority to the > > low-priority thread to prevent priority inversion. When the mutex > > is released, the lent priority is revoked and the low-priority > > thread goes back to its original priority. > > > > When the priority of that thread is lowered (through a call to > > sched_priority()), the schedule was not checking whether > > there is now a high-priority thread in the run queue. This can > > cause threads with real-time priority to be starved in the run > > queue while the low-priority thread finishes its quantum. > > > > Fix this by explicitly checking whether preemption is necessary > > when a thread's priority is lowered. > > > > Sponsored by: Dell EMC Isilon > > Obtained from: Sandvine Inc > > Differential Revision: https://reviews.freebsd.org/D9518 > > Reviewed by: Jeff Roberson (ule) > > MFC after: 1 month > > > > Modified: > > head/sys/kern/sched_4bsd.c > > head/sys/kern/sched_ule.c > > > > Modified: head/sys/kern/sched_4bsd.c > > ============================================================ > ================= > > = > > --- head/sys/kern/sched_4bsd.c Thu Feb 16 19:00:09 2017 > (r31381 > > 3) > > +++ head/sys/kern/sched_4bsd.c Thu Feb 16 19:41:13 2017 > (r31381 > > 4) > > @@ -816,7 +816,12 @@ sched_class(struct thread *td, int class > > static void > > sched_priority(struct thread *td, u_char prio) > > { > > - > > + struct thread *newtd; > > + struct runq *rq; > > + u_char orig_pri; > > +#ifdef SMP > > + struct thread *cputd; > > +#endif > > > > KTR_POINT3(KTR_SCHED, "thread", sched_tdname(td), "priority > change", > > "prio:%d", td->td_priority, "new prio:%d", prio, > KTR_ATTR_LINKED, > > @@ -832,10 +837,43 @@ sched_priority(struct thread *td, u_char > > THREAD_LOCK_ASSERT(td, MA_OWNED); > > if (td->td_priority == prio) > > return; > > + orig_pri = td->td_priority; > > td->td_priority = prio; > > if (TD_ON_RUNQ(td) && td->td_rqindex != (prio / RQ_PPQ)) { > > sched_rem(td); > > sched_add(td, SRQ_BORING); > > + } else if (orig_pri < prio && TD_IS_RUNNING(td)) { > > + /* > > + * If we have decreased the priority of a running thread, > we > > + * have to check if it should be preempted. > > + */ > > + rq = &runq; > > + newtd = runq_choose(&runq); > > +#ifdef SMP > > + cputd = runq_choose(&runq_pcpu[td->td_oncpu]); > > + if (newtd == NULL || > > + (cputd != NULL && cputd->td_priority < > td->td_priority)) > > + newtd = cputd; > > +#endif > > + > > + if (newtd != NULL && newtd->td_priority < prio > > +#ifndef FULL_PREEMPTION > > + && (newtd->td_priority <= PRI_MAX_ITHD || > > + prio >= PRI_MIN_IDLE)) > > +#endif > > + ) { > > + if (td == curthread) > > + /* > > + * Don't reschedule the thread here as it > may > > + * be losing priority because it has > released a > > + * mutex, and in that case we need it to > finish > > + * releasing the lock before it gets > preempted. > > + */ > > + td->td_owepreempt = 1; > > + else > > + kick_other_cpu(newtd->td_priority, > > + td->td_oncpu); > > + } > > } > > } > > > > > > Modified: head/sys/kern/sched_ule.c > > ============================================================ > ================= > > = > > --- head/sys/kern/sched_ule.c Thu Feb 16 19:00:09 2017 (r313813) > > +++ head/sys/kern/sched_ule.c Thu Feb 16 19:41:13 2017 (r313814) > > @@ -319,7 +319,7 @@ static void tdq_add(struct tdq *, struct > > #ifdef SMP > > static int tdq_move(struct tdq *, struct tdq *); > > static int tdq_idled(struct tdq *); > > -static void tdq_notify(struct tdq *, struct thread *); > > +static void tdq_notify(struct tdq *, int); > > static struct thread *tdq_steal(struct tdq *, int); > > static struct thread *runq_steal(struct runq *, int); > > static int sched_pickcpu(struct thread *, int); > > @@ -1040,16 +1040,14 @@ tdq_idled(struct tdq *tdq) > > * Notify a remote cpu of new work. Sends an IPI if criteria are met. > > */ > > static void > > -tdq_notify(struct tdq *tdq, struct thread *td) > > +tdq_notify(struct tdq *tdq, int pri) > > { > > struct thread *ctd; > > - int pri; > > int cpu; > > > > if (tdq->tdq_ipipending) > > return; > > - cpu = td_get_sched(td)->ts_cpu; > > - pri = td->td_priority; > > + cpu = TD_ID(tdq); > > Just my luck. The day I svn up and rebuild. > > --- sched_ule.o --- > /opt/src/svn-current/sys/kern/sched_ule.c:1050:8: error: implicit > declaration of function 'TD_ID' is invalid in C99 > [-Werror,-Wimplicit-functi > on-declaration] > cpu = TD_ID(tdq); > ^ > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > > > ctd = pcpu_find(cpu)->pc_curthread; > > if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) > > return; > > @@ -1675,6 +1673,22 @@ sched_pctcpu_update(struct td_sched *ts, > > ts->ts_ltick = t; > > } > > > > +static void > > +sched_check_preempt(struct tdq *tdq, struct thread *td) > > +{ > > + > > + KASSERT(TD_IS_RUNNING(td), ("thread is not running")); > > + TDQ_LOCK_ASSERT(tdq, MA_OWNED); > > + KASSERT(tdq == TDQ_CPU(td->td_sched->ts_cpu), > > + ("tdq does not contain td")); > > + > > + if (tdq == TDQ_SELF()) { > > + if (sched_shouldpreempt(tdq->tdq_lowpri, td->td_priority, > 0)) > > + td->td_owepreempt = 1; > > + } else > > + tdq_notify(tdq, tdq->tdq_lowpri); > > +} > > + > > /* > > * Adjust the priority of a thread. Move it to the appropriate > run-queue > > * if necessary. This is the back-end for several priority related > > @@ -1726,6 +1740,9 @@ sched_thread_priority(struct thread *td, > > tdq->tdq_lowpri = prio; > > else if (tdq->tdq_lowpri == oldpri) > > tdq_setlowpri(tdq, td); > > + > > + if (oldpri < prio) > > + sched_check_preempt(tdq, td); > > return; > > } > > td->td_priority = prio; > > @@ -1854,7 +1871,7 @@ sched_switch_migrate(struct tdq *tdq, st > > */ > > tdq_lock_pair(tdn, tdq); > > tdq_add(tdn, td, flags); > > - tdq_notify(tdn, td); > > + tdq_notify(tdn, td->td_priority); > > TDQ_UNLOCK(tdn); > > spinlock_exit(); > > #endif > > @@ -2429,7 +2446,7 @@ sched_add(struct thread *td, int flags) > > tdq = sched_setcpu(td, cpu, flags); > > tdq_add(tdq, td, flags); > > if (cpu != PCPU_GET(cpuid)) { > > - tdq_notify(tdq, td); > > + tdq_notify(tdq, td->td_priority); > > return; > > } > > #else > > > > > > > From owner-svn-src-head@freebsd.org Thu Feb 16 20:44:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36795CE289F; Thu, 16 Feb 2017 20:44:43 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D617A192C; Thu, 16 Feb 2017 20:44:42 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id eSunc6MSacWiHeSuocSJoc; Thu, 16 Feb 2017 13:44:35 -0700 X-Authority-Analysis: v=2.2 cv=JLBLi4Cb c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=n2v9WMKugxEA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=7K6iAnAma2ZrwSx0rrMA:9 a=oG8rtNJzzlD5raLN:21 a=1UM9lNBWwGMI0q0j:21 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=pxhY87DP9d2VeQe4joPk:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id CA0DDDEB; Thu, 16 Feb 2017 12:44:32 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v1GKiWjD098166; Thu, 16 Feb 2017 12:44:32 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201702162044.v1GKiWjD098166@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ryan Stone cc: Cy Schubert , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r313814 - head/sys/kern In-Reply-To: Message from Ryan Stone of "Thu, 16 Feb 2017 15:37:54 -0500." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 16 Feb 2017 12:44:32 -0800 X-CMAE-Envelope: MS4wfFyyXvQmLsovc+Cx5tuPMr++Mzz3i8UjWz6tmD1LUHbr4xck723Qd3HYnaiC/7lKthaAdMnxZFNKle8o8pwSUfPRQzsffCp8v3+XBa5wE8khj9Ib+eLr w+A6cUDnBGN1MJigwXnoDMXmVM65oJixDUmVFILqsJmba9UxYq/yyAWQzEgoYgoz4HqIDI2Fja976odWamTgmC4RocNnf6QtSo/KFXgZA3szqBYmQf8Ng+/t RRZsAzEwl70WnOUk7Gb29kvYMzWHGHkJ0Upj0ya3c3XRnUwnvNG+aHBIvj+04CnauXaVfON6sAqBIBEiak4//A== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 20:44:43 -0000 No prob. Thanks. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. In message , Ryan Stone writes: > --001a113fd05697fd560548abc53e > Content-Type: text/plain; charset=UTF-8 > > Sorry about that. It's fixed in r313816. > > On Thu, Feb 16, 2017 at 3:31 PM, Cy Schubert > wrote: > > > In message <201702161941.v1GJfDoP087457@repo.freebsd.org>, Ryan Stone > > writes: > > > Author: rstone > > > Date: Thu Feb 16 19:41:13 2017 > > > New Revision: 313814 > > > URL: https://svnweb.freebsd.org/changeset/base/313814 > > > > > > Log: > > > Check for preemption after lowering a thread's priority > > > > > > When a high-priority thread is waiting for a mutex held by a > > > low-priority thread, it temporarily lends its priority to the > > > low-priority thread to prevent priority inversion. When the mutex > > > is released, the lent priority is revoked and the low-priority > > > thread goes back to its original priority. > > > > > > When the priority of that thread is lowered (through a call to > > > sched_priority()), the schedule was not checking whether > > > there is now a high-priority thread in the run queue. This can > > > cause threads with real-time priority to be starved in the run > > > queue while the low-priority thread finishes its quantum. > > > > > > Fix this by explicitly checking whether preemption is necessary > > > when a thread's priority is lowered. > > > > > > Sponsored by: Dell EMC Isilon > > > Obtained from: Sandvine Inc > > > Differential Revision: https://reviews.freebsd.org/D9518 > > > Reviewed by: Jeff Roberson (ule) > > > MFC after: 1 month > > > > > > Modified: > > > head/sys/kern/sched_4bsd.c > > > head/sys/kern/sched_ule.c > > > > > > Modified: head/sys/kern/sched_4bsd.c > > > ============================================================ > > ================= > > > = > > > --- head/sys/kern/sched_4bsd.c Thu Feb 16 19:00:09 2017 > > (r31381 > > > 3) > > > +++ head/sys/kern/sched_4bsd.c Thu Feb 16 19:41:13 2017 > > (r31381 > > > 4) > > > @@ -816,7 +816,12 @@ sched_class(struct thread *td, int class > > > static void > > > sched_priority(struct thread *td, u_char prio) > > > { > > > - > > > + struct thread *newtd; > > > + struct runq *rq; > > > + u_char orig_pri; > > > +#ifdef SMP > > > + struct thread *cputd; > > > +#endif > > > > > > KTR_POINT3(KTR_SCHED, "thread", sched_tdname(td), "priority > > change", > > > "prio:%d", td->td_priority, "new prio:%d", prio, > > KTR_ATTR_LINKED, > > > @@ -832,10 +837,43 @@ sched_priority(struct thread *td, u_char > > > THREAD_LOCK_ASSERT(td, MA_OWNED); > > > if (td->td_priority == prio) > > > return; > > > + orig_pri = td->td_priority; > > > td->td_priority = prio; > > > if (TD_ON_RUNQ(td) && td->td_rqindex != (prio / RQ_PPQ)) { > > > sched_rem(td); > > > sched_add(td, SRQ_BORING); > > > + } else if (orig_pri < prio && TD_IS_RUNNING(td)) { > > > + /* > > > + * If we have decreased the priority of a running thread, > > we > > > + * have to check if it should be preempted. > > > + */ > > > + rq = &runq; > > > + newtd = runq_choose(&runq); > > > +#ifdef SMP > > > + cputd = runq_choose(&runq_pcpu[td->td_oncpu]); > > > + if (newtd == NULL || > > > + (cputd != NULL && cputd->td_priority < > > td->td_priority)) > > > + newtd = cputd; > > > +#endif > > > + > > > + if (newtd != NULL && newtd->td_priority < prio > > > +#ifndef FULL_PREEMPTION > > > + && (newtd->td_priority <= PRI_MAX_ITHD || > > > + prio >= PRI_MIN_IDLE)) > > > +#endif > > > + ) { > > > + if (td == curthread) > > > + /* > > > + * Don't reschedule the thread here as it > > may > > > + * be losing priority because it has > > released a > > > + * mutex, and in that case we need it to > > finish > > > + * releasing the lock before it gets > > preempted. > > > + */ > > > + td->td_owepreempt = 1; > > > + else > > > + kick_other_cpu(newtd->td_priority, > > > + td->td_oncpu); > > > + } > > > } > > > } > > > > > > > > > Modified: head/sys/kern/sched_ule.c > > > ============================================================ > > ================= > > > = > > > --- head/sys/kern/sched_ule.c Thu Feb 16 19:00:09 2017 (r313813) > > > +++ head/sys/kern/sched_ule.c Thu Feb 16 19:41:13 2017 (r313814) > > > @@ -319,7 +319,7 @@ static void tdq_add(struct tdq *, struct > > > #ifdef SMP > > > static int tdq_move(struct tdq *, struct tdq *); > > > static int tdq_idled(struct tdq *); > > > -static void tdq_notify(struct tdq *, struct thread *); > > > +static void tdq_notify(struct tdq *, int); > > > static struct thread *tdq_steal(struct tdq *, int); > > > static struct thread *runq_steal(struct runq *, int); > > > static int sched_pickcpu(struct thread *, int); > > > @@ -1040,16 +1040,14 @@ tdq_idled(struct tdq *tdq) > > > * Notify a remote cpu of new work. Sends an IPI if criteria are met. > > > */ > > > static void > > > -tdq_notify(struct tdq *tdq, struct thread *td) > > > +tdq_notify(struct tdq *tdq, int pri) > > > { > > > struct thread *ctd; > > > - int pri; > > > int cpu; > > > > > > if (tdq->tdq_ipipending) > > > return; > > > - cpu = td_get_sched(td)->ts_cpu; > > > - pri = td->td_priority; > > > + cpu = TD_ID(tdq); > > > > Just my luck. The day I svn up and rebuild. > > > > --- sched_ule.o --- > > /opt/src/svn-current/sys/kern/sched_ule.c:1050:8: error: implicit > > declaration of function 'TD_ID' is invalid in C99 > > [-Werror,-Wimplicit-functi > > on-declaration] > > cpu = TD_ID(tdq); > > ^ > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: http://www.FreeBSD.org > > > > The need of the many outweighs the greed of the few. > > > > > > > ctd = pcpu_find(cpu)->pc_curthread; > > > if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) > > > return; > > > @@ -1675,6 +1673,22 @@ sched_pctcpu_update(struct td_sched *ts, > > > ts->ts_ltick = t; > > > } > > > > > > +static void > > > +sched_check_preempt(struct tdq *tdq, struct thread *td) > > > +{ > > > + > > > + KASSERT(TD_IS_RUNNING(td), ("thread is not running")); > > > + TDQ_LOCK_ASSERT(tdq, MA_OWNED); > > > + KASSERT(tdq == TDQ_CPU(td->td_sched->ts_cpu), > > > + ("tdq does not contain td")); > > > + > > > + if (tdq == TDQ_SELF()) { > > > + if (sched_shouldpreempt(tdq->tdq_lowpri, td->td_priority, > > 0)) > > > + td->td_owepreempt = 1; > > > + } else > > > + tdq_notify(tdq, tdq->tdq_lowpri); > > > +} > > > + > > > /* > > > * Adjust the priority of a thread. Move it to the appropriate > > run-queue > > > * if necessary. This is the back-end for several priority related > > > @@ -1726,6 +1740,9 @@ sched_thread_priority(struct thread *td, > > > tdq->tdq_lowpri = prio; > > > else if (tdq->tdq_lowpri == oldpri) > > > tdq_setlowpri(tdq, td); > > > + > > > + if (oldpri < prio) > > > + sched_check_preempt(tdq, td); > > > return; > > > } > > > td->td_priority = prio; > > > @@ -1854,7 +1871,7 @@ sched_switch_migrate(struct tdq *tdq, st > > > */ > > > tdq_lock_pair(tdn, tdq); > > > tdq_add(tdn, td, flags); > > > - tdq_notify(tdn, td); > > > + tdq_notify(tdn, td->td_priority); > > > TDQ_UNLOCK(tdn); > > > spinlock_exit(); > > > #endif > > > @@ -2429,7 +2446,7 @@ sched_add(struct thread *td, int flags) > > > tdq = sched_setcpu(td, cpu, flags); > > > tdq_add(tdq, td, flags); > > > if (cpu != PCPU_GET(cpuid)) { > > > - tdq_notify(tdq, td); > > > + tdq_notify(tdq, td->td_priority); > > > return; > > > } > > > #else > > > > > > > > > > > > From owner-svn-src-head@freebsd.org Thu Feb 16 20:44:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E61C7CE28AC; Thu, 16 Feb 2017 20:44:45 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99331192F; Thu, 16 Feb 2017 20:44:45 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GKii4l014342; Thu, 16 Feb 2017 20:44:44 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GKiiXq014341; Thu, 16 Feb 2017 20:44:44 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201702162044.v1GKiiXq014341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 16 Feb 2017 20:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313820 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 20:44:46 -0000 Author: vangyzen Date: Thu Feb 16 20:44:44 2017 New Revision: 313820 URL: https://svnweb.freebsd.org/changeset/base/313820 Log: pf: use inet_ntoa_r() instead of inet_ntoa(); maybe fix IPv6 OS fingerprinting inet_ntoa() cannot be used safely in a multithreaded environment because it uses a static local buffer. Instead, use inet_ntoa_r() with a buffer on the caller's stack. This code had an INET6 conditional before this commit, but opt_inet6.h was not included, so INET6 was never defined. Apparently, pf's OS fingerprinting hasn't worked with IPv6 for quite some time. This commit might fix it, but I didn't test that. Reviewed by: gnn, kp MFC after: 2 weeks Relnotes: yes (if I/someone can test pf OS fingerprinting with IPv6) Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D9625 Modified: head/sys/netpfil/pf/pf_osfp.c Modified: head/sys/netpfil/pf/pf_osfp.c ============================================================================== --- head/sys/netpfil/pf/pf_osfp.c Thu Feb 16 20:30:55 2017 (r313819) +++ head/sys/netpfil/pf/pf_osfp.c Thu Feb 16 20:44:44 2017 (r313820) @@ -19,6 +19,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet6.h" + #include #include #include @@ -34,7 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef INET6 #include +#endif static MALLOC_DEFINE(M_PFOSFP, "pf_osfp", "pf(4) operating system fingerprints"); #define DPFPRINTF(format, x...) \ @@ -94,7 +98,11 @@ pf_osfp_fingerprint_hdr(const struct ip struct pf_os_fingerprint fp, *fpresult; int cnt, optlen = 0; const u_int8_t *optp; - char srcname[128]; +#ifdef INET6 + char srcname[INET6_ADDRSTRLEN]; +#else + char srcname[INET_ADDRSTRLEN]; +#endif if ((tcp->th_flags & (TH_SYN|TH_ACK)) != TH_SYN) return (NULL); @@ -110,7 +118,7 @@ pf_osfp_fingerprint_hdr(const struct ip fp.fp_ttl = ip->ip_ttl; if (ip->ip_off & htons(IP_DF)) fp.fp_flags |= PF_OSFP_DF; - strlcpy(srcname, inet_ntoa(ip->ip_src), sizeof(srcname)); + inet_ntoa_r(ip->ip_src, srcname); } #ifdef INET6 else if (ip6) { @@ -119,8 +127,7 @@ pf_osfp_fingerprint_hdr(const struct ip fp.fp_ttl = ip6->ip6_hlim; fp.fp_flags |= PF_OSFP_DF; fp.fp_flags |= PF_OSFP_INET6; - strlcpy(srcname, ip6_sprintf((struct in6_addr *)&ip6->ip6_src), - sizeof(srcname)); + ip6_sprintf(srcname, (const struct in6_addr *)&ip6->ip6_src); } #endif else From owner-svn-src-head@freebsd.org Thu Feb 16 20:47:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19388CE29AF; Thu, 16 Feb 2017 20:47:44 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAFCB1C89; Thu, 16 Feb 2017 20:47:43 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GKlgJS014490; Thu, 16 Feb 2017 20:47:42 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GKlf9j014479; Thu, 16 Feb 2017 20:47:41 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201702162047.v1GKlf9j014479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 16 Feb 2017 20:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313821 - in head/sys: dev/cxgb/ulp/iw_cxgb fs/nfsserver kern netinet netinet/libalias 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 20:47:44 -0000 Author: vangyzen Date: Thu Feb 16 20:47:41 2017 New Revision: 313821 URL: https://svnweb.freebsd.org/changeset/base/313821 Log: Use inet_ntoa_r() instead of inet_ntoa() throughout the kernel inet_ntoa() cannot be used safely in a multithreaded environment because it uses a static local buffer. Instead, use inet_ntoa_r() with a buffer on the caller's stack. Suggested by: glebius, emaste Reviewed by: gnn MFC after: 2 weeks Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D9625 Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c head/sys/fs/nfsserver/nfs_nfsdkrpc.c head/sys/kern/kern_jail.c head/sys/netinet/if_ether.c head/sys/netinet/igmp.c head/sys/netinet/in.c head/sys/netinet/in_mcast.c head/sys/netinet/ip_icmp.c head/sys/netinet/ip_mroute.c head/sys/netinet/ip_options.c head/sys/netinet/libalias/alias_local.h head/sys/netinet/libalias/alias_nbt.c head/sys/netinet/libalias/alias_proxy.c head/sys/netinet/libalias/alias_sctp.c head/sys/netinet/tcp_hostcache.c head/sys/netpfil/ipfw/ip_fw_log.c Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Thu Feb 16 20:44:44 2017 (r313820) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Thu Feb 16 20:47:41 2017 (r313821) @@ -1461,6 +1461,9 @@ static void process_data(struct iwch_ep *ep) { struct sockaddr_in *local, *remote; +#ifdef KTR + char local_str[INET_ADDRSTRLEN], remote_str[INET_ADDRSTRLEN]; +#endif CTR4(KTR_IW_CXGB, "%s ep %p so %p state %s", __FUNCTION__, ep, ep->com.so, states[ep->com.state]); @@ -1479,8 +1482,8 @@ process_data(struct iwch_ep *ep) in_getsockaddr(ep->com.so, (struct sockaddr **)&local); in_getpeeraddr(ep->com.so, (struct sockaddr **)&remote); CTR3(KTR_IW_CXGB, "%s local %s remote %s", __FUNCTION__, - inet_ntoa(local->sin_addr), - inet_ntoa(remote->sin_addr)); + inet_ntoa_r(local->sin_addr, local_str), + inet_ntoa_r(remote->sin_addr, remote_str)); ep->com.local_addr = *local; ep->com.remote_addr = *remote; free(local, M_SONAME); @@ -1519,6 +1522,9 @@ process_newconn(struct iw_cm_id *parent_ struct sockaddr_in *local; struct sockaddr_in *remote; struct iwch_ep *parent_ep = parent_cm_id->provider_data; +#ifdef KTR + char buf[INET_ADDRSTRLEN]; +#endif CTR3(KTR_IW_CXGB, "%s parent ep %p so %p", __FUNCTION__, parent_ep, parent_ep->com.so); if (!child_so) { @@ -1539,7 +1545,7 @@ process_newconn(struct iw_cm_id *parent_ in_getpeeraddr(child_so, (struct sockaddr **)&remote); CTR3(KTR_IW_CXGB, "%s remote addr %s port %d", __FUNCTION__, - inet_ntoa(remote->sin_addr), ntohs(remote->sin_port)); + inet_ntoa_r(remote->sin_addr, buf), ntohs(remote->sin_port)); child_ep->com.tdev = parent_ep->com.tdev; child_ep->com.local_addr.sin_family = parent_ep->com.local_addr.sin_family; child_ep->com.local_addr.sin_port = parent_ep->com.local_addr.sin_port; Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Thu Feb 16 20:44:44 2017 (r313820) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Thu Feb 16 20:47:41 2017 (r313821) @@ -174,7 +174,11 @@ nfssvc_program(struct svc_req *rqst, SVC if (port >= IPPORT_RESERVED && nd.nd_procnum != NFSPROC_NULL) { #ifdef INET6 - char b6[INET6_ADDRSTRLEN]; + char buf[INET6_ADDRSTRLEN]; +#else + char buf[INET_ADDRSTRLEN]; +#endif +#ifdef INET6 #if defined(KLD_MODULE) /* Do not use ip6_sprintf: the nfs module should work without INET6. */ #define ip6_sprintf(buf, a) \ @@ -189,12 +193,12 @@ nfssvc_program(struct svc_req *rqst, SVC printf("NFS request from unprivileged port (%s:%d)\n", #ifdef INET6 sin->sin_family == AF_INET6 ? - ip6_sprintf(b6, &satosin6(sin)->sin6_addr) : + ip6_sprintf(buf, &satosin6(sin)->sin6_addr) : #if defined(KLD_MODULE) #undef ip6_sprintf #endif #endif - inet_ntoa(sin->sin_addr), port); + inet_ntoa_r(sin->sin_addr, buf), port); svcerr_weakauth(rqst); svc_freereq(rqst); m_freem(nd.nd_mrep); Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Thu Feb 16 20:44:44 2017 (r313820) +++ head/sys/kern/kern_jail.c Thu Feb 16 20:47:41 2017 (r313821) @@ -3999,6 +3999,9 @@ db_show_prison(struct prison *pr) int ii; #endif unsigned jsf; +#ifdef INET + char ip4buf[INET_ADDRSTRLEN]; +#endif #ifdef INET6 char ip6buf[INET6_ADDRSTRLEN]; #endif @@ -4050,7 +4053,7 @@ db_show_prison(struct prison *pr) for (ii = 0; ii < pr->pr_ip4s; ii++) db_printf(" %s %s\n", ii == 0 ? "ip4.addr =" : " ", - inet_ntoa(pr->pr_ip4[ii])); + inet_ntoa_r(pr->pr_ip4[ii], ip4buf)); #endif #ifdef INET6 db_printf(" ip6s = %d\n", pr->pr_ip6s); Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Thu Feb 16 20:44:44 2017 (r313820) +++ head/sys/netinet/if_ether.c Thu Feb 16 20:47:41 2017 (r313821) @@ -464,9 +464,12 @@ arpresolve_full(struct ifnet *ifp, int i if (la == NULL && (ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0) { la = lltable_alloc_entry(LLTABLE(ifp), 0, dst); if (la == NULL) { + char addrbuf[INET_ADDRSTRLEN]; + log(LOG_DEBUG, "arpresolve: can't allocate llinfo for %s on %s\n", - inet_ntoa(SIN(dst)->sin_addr), if_name(ifp)); + inet_ntoa_r(SIN(dst)->sin_addr, addrbuf), + if_name(ifp)); m_freem(m); return (EINVAL); } @@ -803,6 +806,7 @@ in_arpinput(struct mbuf *m) size_t linkhdrsize; int lladdr_off; int error; + char addrbuf[INET_ADDRSTRLEN]; sin.sin_len = sizeof(struct sockaddr_in); sin.sin_family = AF_INET; @@ -927,7 +931,7 @@ match: goto drop; /* it's from me, ignore it. */ if (!bcmp(ar_sha(ah), ifp->if_broadcastaddr, ifp->if_addrlen)) { ARP_LOG(LOG_NOTICE, "link address is broadcast for IP address " - "%s!\n", inet_ntoa(isaddr)); + "%s!\n", inet_ntoa_r(isaddr, addrbuf)); goto drop; } @@ -949,7 +953,7 @@ match: myaddr.s_addr != 0) { ARP_LOG(LOG_ERR, "%*D is using my IP address %s on %s!\n", ifp->if_addrlen, (u_char *)ar_sha(ah), ":", - inet_ntoa(isaddr), ifp->if_xname); + inet_ntoa_r(isaddr, addrbuf), ifp->if_xname); itaddr = myaddr; ARPSTAT_INC(dupips); goto reply; @@ -1086,12 +1090,14 @@ reply: if (nh4.nh_ifp != ifp) { ARP_LOG(LOG_INFO, "proxy: ignoring request" " from %s via %s\n", - inet_ntoa(isaddr), ifp->if_xname); + inet_ntoa_r(isaddr, addrbuf), + ifp->if_xname); goto drop; } #ifdef DEBUG_PROXY - printf("arp: proxying for %s\n", inet_ntoa(itaddr)); + printf("arp: proxying for %s\n", + inet_ntoa_r(itaddr, addrbuf)); #endif } } @@ -1101,7 +1107,7 @@ reply: /* RFC 3927 link-local IPv4; always reply by broadcast. */ #ifdef DEBUG_LINKLOCAL printf("arp: sending reply for link-local addr %s\n", - inet_ntoa(itaddr)); + inet_ntoa_r(itaddr, addrbuf)); #endif m->m_flags |= M_BCAST; m->m_flags &= ~M_MCAST; @@ -1162,6 +1168,7 @@ arp_check_update_lle(struct arphdr *ah, uint8_t linkhdr[LLE_MAX_LINKHDR]; size_t linkhdrsize; int lladdr_off; + char addrbuf[INET_ADDRSTRLEN]; LLE_WLOCK_ASSERT(la); @@ -1170,7 +1177,7 @@ arp_check_update_lle(struct arphdr *ah, if (log_arp_wrong_iface) ARP_LOG(LOG_WARNING, "%s is on %s " "but got reply from %*D on %s\n", - inet_ntoa(isaddr), + inet_ntoa_r(isaddr, addrbuf), la->lle_tbl->llt_ifp->if_xname, ifp->if_addrlen, (u_char *)ar_sha(ah), ":", ifp->if_xname); @@ -1187,13 +1194,14 @@ arp_check_update_lle(struct arphdr *ah, "permanent entry for %s on %s\n", ifp->if_addrlen, (u_char *)ar_sha(ah), ":", - inet_ntoa(isaddr), ifp->if_xname); + inet_ntoa_r(isaddr, addrbuf), + ifp->if_xname); return; } if (log_arp_movements) { ARP_LOG(LOG_INFO, "%s moved from %*D " "to %*D on %s\n", - inet_ntoa(isaddr), + inet_ntoa_r(isaddr, addrbuf), ifp->if_addrlen, (u_char *)&la->ll_addr, ":", ifp->if_addrlen, (u_char *)ar_sha(ah), ":", Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Thu Feb 16 20:44:44 2017 (r313820) +++ head/sys/netinet/igmp.c Thu Feb 16 20:47:41 2017 (r313821) @@ -314,12 +314,12 @@ igmp_scrub_context(struct mbuf *m) #ifdef KTR static __inline char * -inet_ntoa_haddr(in_addr_t haddr) +inet_ntoa_haddr(in_addr_t haddr, char *addrbuf) { struct in_addr ia; ia.s_addr = htonl(haddr); - return (inet_ntoa(ia)); + return (inet_ntoa_r(ia, addrbuf)); } #endif @@ -804,6 +804,9 @@ igmp_input_v2_query(struct ifnet *ifp, c struct in_multi *inm; int is_general_query; uint16_t timer; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif is_general_query = 0; @@ -873,7 +876,8 @@ igmp_input_v2_query(struct ifnet *ifp, c inm = inm_lookup(ifp, igmp->igmp_group); if (inm != NULL) { CTR3(KTR_IGMPV3, "process v2 query %s on ifp %p(%s)", - inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname); + inet_ntoa_r(igmp->igmp_group, addrbuf), ifp, + ifp->if_xname); igmp_v2_update_group(inm, timer); } } @@ -903,9 +907,12 @@ out_locked: static void igmp_v2_update_group(struct in_multi *inm, const int timer) { +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif CTR4(KTR_IGMPV3, "%s: %s/%s timer=%d", __func__, - inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname, timer); + inet_ntoa_r(inm->inm_addr, addrbuf), inm->inm_ifp->if_xname, timer); IN_MULTI_LOCK_ASSERT(); @@ -956,6 +963,9 @@ igmp_input_v3_query(struct ifnet *ifp, c uint32_t maxresp, nsrc, qqi; uint16_t timer; uint8_t qrv; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif is_general_query = 0; @@ -1086,7 +1096,8 @@ igmp_input_v3_query(struct ifnet *ifp, c } } CTR3(KTR_IGMPV3, "process v3 %s query on ifp %p(%s)", - inet_ntoa(igmpv3->igmp_group), ifp, ifp->if_xname); + inet_ntoa_r(igmpv3->igmp_group, addrbuf), ifp, + ifp->if_xname); /* * If there is a pending General Query response * scheduled sooner than the selected delay, no @@ -1219,6 +1230,9 @@ igmp_input_v1_report(struct ifnet *ifp, struct rm_priotracker in_ifa_tracker; struct in_ifaddr *ia; struct in_multi *inm; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif IGMPSTAT_INC(igps_rcv_reports); @@ -1247,7 +1261,7 @@ igmp_input_v1_report(struct ifnet *ifp, } CTR3(KTR_IGMPV3, "process v1 report %s on ifp %p(%s)", - inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname); + inet_ntoa_r(igmp->igmp_group, addrbuf), ifp, ifp->if_xname); /* * IGMPv1 report suppression. @@ -1290,14 +1304,16 @@ igmp_input_v1_report(struct ifnet *ifp, case IGMP_AWAKENING_MEMBER: CTR3(KTR_IGMPV3, "report suppressed for %s on ifp %p(%s)", - inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname); + inet_ntoa_r(igmp->igmp_group, addrbuf), ifp, + ifp->if_xname); case IGMP_SLEEPING_MEMBER: inm->inm_state = IGMP_SLEEPING_MEMBER; break; case IGMP_REPORTING_MEMBER: CTR3(KTR_IGMPV3, "report suppressed for %s on ifp %p(%s)", - inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname); + inet_ntoa_r(igmp->igmp_group, addrbuf), ifp, + ifp->if_xname); if (igi->igi_version == IGMP_VERSION_1) inm->inm_state = IGMP_LAZY_MEMBER; else if (igi->igi_version == IGMP_VERSION_2) @@ -1328,6 +1344,9 @@ igmp_input_v2_report(struct ifnet *ifp, struct rm_priotracker in_ifa_tracker; struct in_ifaddr *ia; struct in_multi *inm; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif /* * Make sure we don't hear our own membership report. Fast @@ -1371,7 +1390,7 @@ igmp_input_v2_report(struct ifnet *ifp, ifa_free(&ia->ia_ifa); CTR3(KTR_IGMPV3, "process v2 report %s on ifp %p(%s)", - inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname); + inet_ntoa_r(igmp->igmp_group, addrbuf), ifp, ifp->if_xname); /* * IGMPv2 report suppression. @@ -1412,7 +1431,8 @@ igmp_input_v2_report(struct ifnet *ifp, case IGMP_AWAKENING_MEMBER: CTR3(KTR_IGMPV3, "report suppressed for %s on ifp %p(%s)", - inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname); + inet_ntoa_r(igmp->igmp_group, addrbuf), ifp, + ifp->if_xname); case IGMP_LAZY_MEMBER: inm->inm_state = IGMP_LAZY_MEMBER; break; @@ -1814,6 +1834,9 @@ igmp_v3_process_group_timers(struct igmp { int query_response_timer_expired; int state_change_retransmit_timer_expired; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif IN_MULTI_LOCK_ASSERT(); IGMP_LOCK_ASSERT(); @@ -1900,7 +1923,8 @@ igmp_v3_process_group_timers(struct igmp inm_commit(inm); CTR3(KTR_IGMPV3, "%s: T1 -> T0 for %s/%s", __func__, - inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname); + inet_ntoa_r(inm->inm_addr, addrbuf), + inm->inm_ifp->if_xname); /* * If we are leaving the group for good, make sure @@ -2346,9 +2370,12 @@ igmp_initial_join(struct in_multi *inm, struct ifnet *ifp; struct mbufq *mq; int error, retval, syncstates; - +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif + CTR4(KTR_IGMPV3, "%s: initial join %s on ifp %p(%s)", - __func__, inet_ntoa(inm->inm_addr), inm->inm_ifp, + __func__, inet_ntoa_r(inm->inm_addr, addrbuf), inm->inm_ifp, inm->inm_ifp->if_xname); error = 0; @@ -2459,7 +2486,8 @@ igmp_initial_join(struct in_multi *inm, if (syncstates) { inm_commit(inm); CTR3(KTR_IGMPV3, "%s: T1 -> T0 for %s/%s", __func__, - inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname); + inet_ntoa_r(inm->inm_addr, addrbuf), + inm->inm_ifp->if_xname); } return (error); @@ -2473,9 +2501,12 @@ igmp_handle_state_change(struct in_multi { struct ifnet *ifp; int retval; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif CTR4(KTR_IGMPV3, "%s: state change for %s on ifp %p(%s)", - __func__, inet_ntoa(inm->inm_addr), inm->inm_ifp, + __func__, inet_ntoa_r(inm->inm_addr, addrbuf), inm->inm_ifp, inm->inm_ifp->if_xname); ifp = inm->inm_ifp; @@ -2496,7 +2527,8 @@ igmp_handle_state_change(struct in_multi CTR1(KTR_IGMPV3, "%s: nothing to do", __func__); inm_commit(inm); CTR3(KTR_IGMPV3, "%s: T1 -> T0 for %s/%s", __func__, - inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname); + inet_ntoa_r(inm->inm_addr, addrbuf), + inm->inm_ifp->if_xname); return (0); } @@ -2531,11 +2563,14 @@ static void igmp_final_leave(struct in_multi *inm, struct igmp_ifsoftc *igi) { int syncstates; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif syncstates = 1; CTR4(KTR_IGMPV3, "%s: final leave %s on ifp %p(%s)", - __func__, inet_ntoa(inm->inm_addr), inm->inm_ifp, + __func__, inet_ntoa_r(inm->inm_addr, addrbuf), inm->inm_ifp, inm->inm_ifp->if_xname); IN_MULTI_LOCK_ASSERT(); @@ -2578,7 +2613,7 @@ igmp_final_leave(struct in_multi *inm, s } CTR4(KTR_IGMPV3, "%s: Leaving %s/%s with %d " "pending retransmissions.", __func__, - inet_ntoa(inm->inm_addr), + inet_ntoa_r(inm->inm_addr, addrbuf), inm->inm_ifp->if_xname, inm->inm_scrv); if (inm->inm_scrv == 0) { inm->inm_state = IGMP_NOT_MEMBER; @@ -2612,10 +2647,12 @@ igmp_final_leave(struct in_multi *inm, s if (syncstates) { inm_commit(inm); CTR3(KTR_IGMPV3, "%s: T1 -> T0 for %s/%s", __func__, - inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname); + inet_ntoa_r(inm->inm_addr, addrbuf), + inm->inm_ifp->if_xname); inm->inm_st[1].iss_fmode = MCAST_UNDEFINED; CTR3(KTR_IGMPV3, "%s: T1 now MCAST_UNDEFINED for %s/%s", - __func__, inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname); + __func__, inet_ntoa_r(inm->inm_addr, addrbuf), + inm->inm_ifp->if_xname); } } @@ -2663,6 +2700,9 @@ igmp_v3_enqueue_group_record(struct mbuf int type; in_addr_t naddr; uint8_t mode; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif IN_MULTI_LOCK_ASSERT(); @@ -2741,7 +2781,7 @@ igmp_v3_enqueue_group_record(struct mbuf if (type == IGMP_DO_NOTHING) { CTR3(KTR_IGMPV3, "%s: nothing to do for %s/%s", - __func__, inet_ntoa(inm->inm_addr), + __func__, inet_ntoa_r(inm->inm_addr, addrbuf), inm->inm_ifp->if_xname); return (0); } @@ -2756,7 +2796,7 @@ igmp_v3_enqueue_group_record(struct mbuf minrec0len += sizeof(in_addr_t); CTR4(KTR_IGMPV3, "%s: queueing %s for %s/%s", __func__, - igmp_rec_type_to_str(type), inet_ntoa(inm->inm_addr), + igmp_rec_type_to_str(type), inet_ntoa_r(inm->inm_addr, addrbuf), inm->inm_ifp->if_xname); /* @@ -2845,7 +2885,7 @@ igmp_v3_enqueue_group_record(struct mbuf msrcs = 0; RB_FOREACH_SAFE(ims, ip_msource_tree, &inm->inm_srcs, nims) { CTR2(KTR_IGMPV3, "%s: visit node %s", __func__, - inet_ntoa_haddr(ims->ims_haddr)); + inet_ntoa_haddr(ims->ims_haddr, addrbuf)); now = ims_get_mode(inm, ims, 1); CTR2(KTR_IGMPV3, "%s: node is %d", __func__, now); if ((now != mode) || @@ -2941,7 +2981,7 @@ igmp_v3_enqueue_group_record(struct mbuf msrcs = 0; RB_FOREACH_FROM(ims, ip_msource_tree, nims) { CTR2(KTR_IGMPV3, "%s: visit node %s", __func__, - inet_ntoa_haddr(ims->ims_haddr)); + inet_ntoa_haddr(ims->ims_haddr, addrbuf)); now = ims_get_mode(inm, ims, 1); if ((now != mode) || (now == mode && mode == MCAST_UNDEFINED)) { @@ -3024,6 +3064,9 @@ igmp_v3_enqueue_filter_change(struct mbu int nallow, nblock; uint8_t mode, now, then; rectype_t crt, drt, nrt; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif IN_MULTI_LOCK_ASSERT(); @@ -3133,7 +3176,8 @@ igmp_v3_enqueue_filter_change(struct mbu nims = RB_MIN(ip_msource_tree, &inm->inm_srcs); RB_FOREACH_FROM(ims, ip_msource_tree, nims) { CTR2(KTR_IGMPV3, "%s: visit node %s", - __func__, inet_ntoa_haddr(ims->ims_haddr)); + __func__, + inet_ntoa_haddr(ims->ims_haddr, addrbuf)); now = ims_get_mode(inm, ims, 1); then = ims_get_mode(inm, ims, 0); CTR3(KTR_IGMPV3, "%s: mode: t0 %d, t1 %d", Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Thu Feb 16 20:44:44 2017 (r313820) +++ head/sys/netinet/in.c Thu Feb 16 20:47:41 2017 (r313821) @@ -1218,7 +1218,7 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ */ if (!(rt_flags & RTF_HOST) && info.rti_ifp != ifp) { const char *sa, *mask, *addr, *lim; - int len; + const struct sockaddr_in *l3sin; mask = (const char *)&rt_mask; /* @@ -1230,14 +1230,17 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ sa = (const char *)&rt_key; addr = (const char *)l3addr; - len = ((const struct sockaddr_in *)l3addr)->sin_len; - lim = addr + len; + l3sin = (const struct sockaddr_in *)l3addr; + lim = addr + l3sin->sin_len; for ( ; addr < lim; sa++, mask++, addr++) { if ((*sa ^ *addr) & *mask) { #ifdef DIAGNOSTIC - log(LOG_INFO, "IPv4 address: \"%s\" is not on the network\n", - inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr)); + char addrbuf[INET_ADDRSTRLEN]; + + log(LOG_INFO, "IPv4 address: \"%s\" " + "is not on the network\n", + inet_ntoa_r(l3sin->sin_addr, addrbuf)); #endif return (EINVAL); } Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Thu Feb 16 20:44:44 2017 (r313820) +++ head/sys/netinet/in_mcast.c Thu Feb 16 20:47:41 2017 (r313821) @@ -495,9 +495,12 @@ in_getmulti(struct ifnet *ifp, const str ("%s: ifma not AF_INET", __func__)); KASSERT(inm != NULL, ("%s: no ifma_protospec", __func__)); if (inm->inm_ifma != ifma || inm->inm_ifp != ifp || - !in_hosteq(inm->inm_addr, *group)) + !in_hosteq(inm->inm_addr, *group)) { + char addrbuf[INET_ADDRSTRLEN]; + panic("%s: ifma %p is inconsistent with %p (%s)", - __func__, ifma, inm, inet_ntoa(*group)); + __func__, ifma, inm, inet_ntoa_r(*group, addrbuf)); + } #endif ++inm->inm_refcount; *pinm = inm; @@ -875,7 +878,8 @@ inm_get_source(struct in_multi *inm, con struct ip_msource find; struct ip_msource *ims, *nims; #ifdef KTR - struct in_addr ia; + struct in_addr ia; + char addrbuf[INET_ADDRSTRLEN]; #endif find.ims_haddr = haddr; @@ -894,7 +898,7 @@ inm_get_source(struct in_multi *inm, con #ifdef KTR ia.s_addr = htonl(haddr); CTR3(KTR_IGMPV3, "%s: allocated %s as %p", __func__, - inet_ntoa(ia), ims); + inet_ntoa_r(ia, addrbuf), ims); #endif } @@ -912,6 +916,7 @@ ims_merge(struct ip_msource *ims, const { int n = rollback ? -1 : 1; #ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; struct in_addr ia; ia.s_addr = htonl(ims->ims_haddr); @@ -919,21 +924,21 @@ ims_merge(struct ip_msource *ims, const if (lims->imsl_st[0] == MCAST_EXCLUDE) { CTR3(KTR_IGMPV3, "%s: t1 ex -= %d on %s", - __func__, n, inet_ntoa(ia)); + __func__, n, inet_ntoa_r(ia, addrbuf)); ims->ims_st[1].ex -= n; } else if (lims->imsl_st[0] == MCAST_INCLUDE) { CTR3(KTR_IGMPV3, "%s: t1 in -= %d on %s", - __func__, n, inet_ntoa(ia)); + __func__, n, inet_ntoa_r(ia, addrbuf)); ims->ims_st[1].in -= n; } if (lims->imsl_st[1] == MCAST_EXCLUDE) { CTR3(KTR_IGMPV3, "%s: t1 ex += %d on %s", - __func__, n, inet_ntoa(ia)); + __func__, n, inet_ntoa_r(ia, addrbuf)); ims->ims_st[1].ex += n; } else if (lims->imsl_st[1] == MCAST_INCLUDE) { CTR3(KTR_IGMPV3, "%s: t1 in += %d on %s", - __func__, n, inet_ntoa(ia)); + __func__, n, inet_ntoa_r(ia, addrbuf)); ims->ims_st[1].in += n; } } @@ -1166,11 +1171,14 @@ in_joingroup_locked(struct ifnet *ifp, c struct in_mfilter timf; struct in_multi *inm; int error; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif IN_MULTI_LOCK_ASSERT(); CTR4(KTR_IGMPV3, "%s: join %s on %p(%s))", __func__, - inet_ntoa(*gina), ifp, ifp->if_xname); + inet_ntoa_r(*gina, addrbuf), ifp, ifp->if_xname); error = 0; inm = NULL; @@ -1248,13 +1256,16 @@ in_leavegroup_locked(struct in_multi *in { struct in_mfilter timf; int error; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif error = 0; IN_MULTI_LOCK_ASSERT(); CTR5(KTR_IGMPV3, "%s: leave inm %p, %s/%s, imf %p", __func__, - inm, inet_ntoa(inm->inm_addr), + inm, inet_ntoa_r(inm->inm_addr, addrbuf), (inm_is_ifp_detached(inm) ? "null" : inm->inm_ifp->if_xname), imf); @@ -1302,9 +1313,13 @@ in_addmulti(struct in_addr *ap, struct i { struct in_multi *pinm; int error; +#ifdef INVARIANTS + char addrbuf[INET_ADDRSTRLEN]; +#endif KASSERT(IN_LOCAL_GROUP(ntohl(ap->s_addr)), - ("%s: %s not in 224.0.0.0/24", __func__, inet_ntoa(*ap))); + ("%s: %s not in 224.0.0.0/24", __func__, + inet_ntoa_r(*ap, addrbuf))); error = in_joingroup(ifp, ap, NULL, &pinm); if (error != 0) @@ -1349,6 +1364,9 @@ inp_block_unblock_source(struct inpcb *i size_t idx; uint16_t fmode; int error, doblock; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif ifp = NULL; error = 0; @@ -1384,7 +1402,7 @@ inp_block_unblock_source(struct inpcb *i doblock = 1; CTR3(KTR_IGMPV3, "%s: imr_interface = %s, ifp = %p", - __func__, inet_ntoa(mreqs.imr_interface), ifp); + __func__, inet_ntoa_r(mreqs.imr_interface, addrbuf), ifp); break; } @@ -1457,7 +1475,8 @@ inp_block_unblock_source(struct inpcb *i ims = imo_match_source(imo, idx, &ssa->sa); if ((ims != NULL && doblock) || (ims == NULL && !doblock)) { CTR3(KTR_IGMPV3, "%s: source %s %spresent", __func__, - inet_ntoa(ssa->sin.sin_addr), doblock ? "" : "not "); + inet_ntoa_r(ssa->sin.sin_addr, addrbuf), + doblock ? "" : "not "); error = EADDRNOTAVAIL; goto out_inp_locked; } @@ -1934,6 +1953,9 @@ inp_join_group(struct inpcb *inp, struct struct in_msource *lims; size_t idx; int error, is_new; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif ifp = NULL; imf = NULL; @@ -1986,7 +2008,7 @@ inp_join_group(struct inpcb *inp, struct ifp = inp_lookup_mcast_ifp(inp, &gsa->sin, mreqs.imr_interface); CTR3(KTR_IGMPV3, "%s: imr_interface = %s, ifp = %p", - __func__, inet_ntoa(mreqs.imr_interface), ifp); + __func__, inet_ntoa_r(mreqs.imr_interface, addrbuf), ifp); break; } @@ -2233,6 +2255,9 @@ inp_leave_group(struct inpcb *inp, struc struct in_multi *inm; size_t idx; int error, is_final; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif ifp = NULL; error = 0; @@ -2287,7 +2312,7 @@ inp_leave_group(struct inpcb *inp, struc INADDR_TO_IFP(mreqs.imr_interface, ifp); CTR3(KTR_IGMPV3, "%s: imr_interface = %s, ifp = %p", - __func__, inet_ntoa(mreqs.imr_interface), ifp); + __func__, inet_ntoa_r(mreqs.imr_interface, addrbuf), ifp); break; @@ -2368,7 +2393,7 @@ inp_leave_group(struct inpcb *inp, struc ims = imo_match_source(imo, idx, &ssa->sa); if (ims == NULL) { CTR3(KTR_IGMPV3, "%s: source %s %spresent", __func__, - inet_ntoa(ssa->sin.sin_addr), "not "); + inet_ntoa_r(ssa->sin.sin_addr, addrbuf), "not "); error = EADDRNOTAVAIL; goto out_inp_locked; } @@ -2450,6 +2475,9 @@ inp_set_multicast_if(struct inpcb *inp, struct ifnet *ifp; struct ip_moptions *imo; int error; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif if (sopt->sopt_valsize == sizeof(struct ip_mreqn)) { /* @@ -2488,7 +2516,7 @@ inp_set_multicast_if(struct inpcb *inp, return (EADDRNOTAVAIL); } CTR3(KTR_IGMPV3, "%s: ifp = %p, addr = %s", __func__, ifp, - inet_ntoa(addr)); + inet_ntoa_r(addr, addrbuf)); } /* Reject interfaces which do not support multicast. */ @@ -2846,6 +2874,9 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_A int retval; u_int namelen; uint32_t fmode, ifindex; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif name = (int *)arg1; namelen = arg2; @@ -2866,7 +2897,7 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_A group.s_addr = name[1]; if (!IN_MULTICAST(ntohl(group.s_addr))) { CTR2(KTR_IGMPV3, "%s: group %s is not multicast", - __func__, inet_ntoa(group)); + __func__, inet_ntoa_r(group, addrbuf)); return (EINVAL); } @@ -2901,7 +2932,7 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_A struct in_addr ina; ina.s_addr = htonl(ims->ims_haddr); CTR2(KTR_IGMPV3, "%s: visit node %s", __func__, - inet_ntoa(ina)); + inet_ntoa_r(ina, addrbuf)); #endif /* * Only copy-out sources which are in-mode. @@ -2965,13 +2996,14 @@ void inm_print(const struct in_multi *inm) { int t; + char addrbuf[INET_ADDRSTRLEN]; if ((ktr_mask & KTR_IGMPV3) == 0) return; printf("%s: --- begin inm %p ---\n", __func__, inm); printf("addr %s ifp %p(%s) ifma %p\n", - inet_ntoa(inm->inm_addr), + inet_ntoa_r(inm->inm_addr, addrbuf), inm->inm_ifp, inm->inm_ifp->if_xname, inm->inm_ifma); Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Thu Feb 16 20:44:44 2017 (r313820) +++ head/sys/netinet/ip_icmp.c Thu Feb 16 20:47:41 2017 (r313821) @@ -380,10 +380,12 @@ icmp_input(struct mbuf **mp, int *offp, */ #ifdef ICMPPRINTFS if (icmpprintfs) { - char buf[4 * sizeof "123"]; - strcpy(buf, inet_ntoa(ip->ip_src)); + char srcbuf[INET_ADDRSTRLEN]; + char dstbuf[INET_ADDRSTRLEN]; + printf("icmp_input from %s to %s, len %d\n", - buf, inet_ntoa(ip->ip_dst), icmplen); + inet_ntoa_r(ip->ip_src, srcbuf), + inet_ntoa_r(ip->ip_dst, dstbuf), icmplen); } #endif if (icmplen < ICMP_MINLEN) { @@ -649,11 +651,12 @@ reflect: icmpdst.sin_addr = icp->icmp_gwaddr; #ifdef ICMPPRINTFS if (icmpprintfs) { - char buf[4 * sizeof "123"]; - strcpy(buf, inet_ntoa(icp->icmp_ip.ip_dst)); + char dstbuf[INET_ADDRSTRLEN]; + char gwbuf[INET_ADDRSTRLEN]; printf("redirect dst %s to %s\n", - buf, inet_ntoa(icp->icmp_gwaddr)); + inet_ntoa_r(icp->icmp_ip.ip_dst, dstbuf), + inet_ntoa_r(icp->icmp_gwaddr, gwbuf)); } #endif icmpsrc.sin_addr = icp->icmp_ip.ip_dst; @@ -901,10 +904,12 @@ icmp_send(struct mbuf *m, struct mbuf *o m->m_pkthdr.rcvif = (struct ifnet *)0; #ifdef ICMPPRINTFS if (icmpprintfs) { - char buf[4 * sizeof "123"]; - strcpy(buf, inet_ntoa(ip->ip_dst)); + char dstbuf[INET_ADDRSTRLEN]; + char srcbuf[INET_ADDRSTRLEN]; + printf("icmp_send dst %s src %s\n", - buf, inet_ntoa(ip->ip_src)); + inet_ntoa_r(ip->ip_dst, dstbuf), + inet_ntoa_r(ip->ip_src, srcbuf)); } #endif (void) ip_output(m, opts, NULL, 0, NULL, NULL); Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Thu Feb 16 20:44:44 2017 (r313820) +++ head/sys/netinet/ip_mroute.c Thu Feb 16 20:47:41 2017 (r313821) @@ -845,6 +845,9 @@ add_vif(struct vifctl *vifcp) struct ifaddr *ifa; struct ifnet *ifp; int error; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif VIF_LOCK(); if (vifcp->vifc_vifi >= MAXVIFS) { @@ -929,7 +932,7 @@ add_vif(struct vifctl *vifcp) VIF_UNLOCK(); CTR4(KTR_IPMF, "%s: add vif %d laddr %s thresh %x", __func__, - (int)vifcp->vifc_vifi, inet_ntoa(vifcp->vifc_lcl_addr), + (int)vifcp->vifc_vifi, inet_ntoa_r(vifcp->vifc_lcl_addr, addrbuf), (int)vifcp->vifc_threshold); return 0; @@ -1052,6 +1055,9 @@ add_mfc(struct mfcctl2 *mfccp) struct rtdetq *rte, *nrte; u_long hash = 0; u_short nstl; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif VIF_LOCK(); MFC_LOCK(); @@ -1061,7 +1067,7 @@ add_mfc(struct mfcctl2 *mfccp) /* If an entry already exists, just update the fields */ if (rt) { CTR4(KTR_IPMF, "%s: update mfc orig %s group %lx parent %x", - __func__, inet_ntoa(mfccp->mfcc_origin), + __func__, inet_ntoa_r(mfccp->mfcc_origin, addrbuf), (u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr), mfccp->mfcc_parent); update_mfc_params(rt, mfccp); @@ -1081,7 +1087,7 @@ add_mfc(struct mfcctl2 *mfccp) !TAILQ_EMPTY(&rt->mfc_stall)) { CTR5(KTR_IPMF, "%s: add mfc orig %s group %lx parent %x qh %p", - __func__, inet_ntoa(mfccp->mfcc_origin), + __func__, inet_ntoa_r(mfccp->mfcc_origin, addrbuf), (u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr), mfccp->mfcc_parent, TAILQ_FIRST(&rt->mfc_stall)); @@ -1155,12 +1161,15 @@ del_mfc(struct mfcctl2 *mfccp) struct in_addr origin; struct in_addr mcastgrp; struct mfc *rt; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif origin = mfccp->mfcc_origin; mcastgrp = mfccp->mfcc_mcastgrp; CTR3(KTR_IPMF, "%s: delete mfc orig %s group %lx", __func__, - inet_ntoa(origin), (u_long)ntohl(mcastgrp.s_addr)); + inet_ntoa_r(origin, addrbuf), (u_long)ntohl(mcastgrp.s_addr)); MFC_LOCK(); @@ -1223,9 +1232,13 @@ X_ip_mforward(struct ip *ip, struct ifne struct mfc *rt; int error; vifi_t vifi; +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif CTR3(KTR_IPMF, "ip_mforward: delete mfc orig %s group %lx ifp %p", - inet_ntoa(ip->ip_src), (u_long)ntohl(ip->ip_dst.s_addr), ifp); + inet_ntoa_r(ip->ip_src, addrbuf), (u_long)ntohl(ip->ip_dst.s_addr), + ifp); if (ip->ip_hl < (sizeof(struct ip) + TUNNEL_LEN) >> 2 || ((u_char *)(ip + 1))[1] != IPOPT_LSRR ) { @@ -1288,7 +1301,7 @@ X_ip_mforward(struct ip *ip, struct ifne MRTSTAT_INC(mrts_mfc_misses); MRTSTAT_INC(mrts_no_route); CTR2(KTR_IPMF, "ip_mforward: no mfc for (%s,%lx)", - inet_ntoa(ip->ip_src), (u_long)ntohl(ip->ip_dst.s_addr)); + inet_ntoa_r(ip->ip_src, addrbuf), (u_long)ntohl(ip->ip_dst.s_addr)); /* * Allocate mbufs early so that we don't do extra work if we are @@ -2570,7 +2583,10 @@ pim_input(struct mbuf **mp, int *offp, i int minlen; int datalen = ntohs(ip->ip_len) - iphlen; int ip_tos; - +#ifdef KTR + char addrbuf[INET_ADDRSTRLEN]; +#endif + *mp = NULL; /* Keep statistics */ @@ -2583,7 +2599,7 @@ pim_input(struct mbuf **mp, int *offp, i if (datalen < PIM_MINLEN) { PIMSTAT_INC(pims_rcv_tooshort); CTR3(KTR_IPMF, "%s: short packet (%d) from %s", - __func__, datalen, inet_ntoa(ip->ip_src)); + __func__, datalen, inet_ntoa_r(ip->ip_src, addrbuf)); m_freem(m); return (IPPROTO_DONE); } @@ -2683,7 +2699,8 @@ pim_input(struct mbuf **mp, int *offp, i encap_ip = (struct ip *)(reghdr + 1); CTR3(KTR_IPMF, "%s: register: encap ip src %s len %d", - __func__, inet_ntoa(encap_ip->ip_src), ntohs(encap_ip->ip_len)); + __func__, inet_ntoa_r(encap_ip->ip_src, addrbuf), + ntohs(encap_ip->ip_len)); /* verify the version number of the inner packet */ if (encap_ip->ip_v != IPVERSION) { @@ -2697,7 +2714,7 @@ pim_input(struct mbuf **mp, int *offp, i if (!IN_MULTICAST(ntohl(encap_ip->ip_dst.s_addr))) { PIMSTAT_INC(pims_rcv_badregisters); CTR2(KTR_IPMF, "%s: bad encap ip dest %s", __func__, - inet_ntoa(encap_ip->ip_dst)); + inet_ntoa_r(encap_ip->ip_dst, addrbuf)); m_freem(m); return (IPPROTO_DONE); } Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Thu Feb 16 20:44:44 2017 (r313820) +++ head/sys/netinet/ip_options.c Thu Feb 16 20:47:41 2017 (r313821) @@ -196,16 +196,19 @@ ip_dooptions(struct mbuf *m, int pass) #endif if (!V_ip_dosourceroute) { if (V_ipforwarding) { - char buf[16]; /* aaa.bbb.ccc.ddd\0 */ + char srcbuf[INET_ADDRSTRLEN]; + char dstbuf[INET_ADDRSTRLEN]; + /* * Acting as a router, so generate * ICMP */ nosourcerouting: - strcpy(buf, inet_ntoa(ip->ip_dst)); log(LOG_WARNING, - "attempted source route from %s to %s\n", - inet_ntoa(ip->ip_src), buf); + "attempted source route from %s " + "to %s\n", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Feb 16 20:50:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4526CE2B05; Thu, 16 Feb 2017 20:50:02 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98ACD1EE7; Thu, 16 Feb 2017 20:50:02 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GKo1Xn014628; Thu, 16 Feb 2017 20:50:01 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GKo1DL014626; Thu, 16 Feb 2017 20:50:01 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201702162050.v1GKo1DL014626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 16 Feb 2017 20:50:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313822 - in head/sys: libkern netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 20:50:03 -0000 Author: vangyzen Date: Thu Feb 16 20:50:01 2017 New Revision: 313822 URL: https://svnweb.freebsd.org/changeset/base/313822 Log: Remove inet_ntoa() from the kernel inet_ntoa() cannot be used safely in a multithreaded environment because it uses a static local buffer. Remove it from the kernel. Suggested by: glebius, emaste Reviewed by: gnn MFC after: never Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D9625 Modified: head/sys/libkern/inet_ntoa.c head/sys/netinet/in.h Modified: head/sys/libkern/inet_ntoa.c ============================================================================== --- head/sys/libkern/inet_ntoa.c Thu Feb 16 20:47:41 2017 (r313821) +++ head/sys/libkern/inet_ntoa.c Thu Feb 16 20:50:01 2017 (r313822) @@ -36,20 +36,6 @@ __FBSDID("$FreeBSD$"); #include char * -inet_ntoa(struct in_addr ina) -{ - static char buf[4*sizeof "123"]; - unsigned char *ucp = (unsigned char *)&ina; - - sprintf(buf, "%d.%d.%d.%d", - ucp[0] & 0xff, - ucp[1] & 0xff, - ucp[2] & 0xff, - ucp[3] & 0xff); - return buf; -} - -char * inet_ntoa_r(struct in_addr ina, char *buf) { unsigned char *ucp = (unsigned char *)&ina; Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Thu Feb 16 20:47:41 2017 (r313821) +++ head/sys/netinet/in.h Thu Feb 16 20:50:01 2017 (r313822) @@ -646,7 +646,6 @@ int in_localaddr(struct in_addr); int in_localip(struct in_addr); int in_ifhasaddr(struct ifnet *, struct in_addr); int inet_aton(const char *, struct in_addr *); /* in libkern */ -char *inet_ntoa(struct in_addr); /* in libkern */ char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */ char *inet_ntop(int, const void *, char *, socklen_t); /* in libkern */ int inet_pton(int af, const char *, void *); /* in libkern */ From owner-svn-src-head@freebsd.org Thu Feb 16 21:03:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAFBACE2FE9; Thu, 16 Feb 2017 21:03:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA74C18F1; Thu, 16 Feb 2017 21:03:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GL3hUA022531; Thu, 16 Feb 2017 21:03:43 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GL3h8C022530; Thu, 16 Feb 2017 21:03:43 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201702162103.v1GL3h8C022530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 16 Feb 2017 21:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313823 - head/contrib/compiler-rt/lib/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:03:45 -0000 Author: dim Date: Thu Feb 16 21:03:43 2017 New Revision: 313823 URL: https://svnweb.freebsd.org/changeset/base/313823 Log: Pull in r285478 from upstream compiler-rt trunk (by Saleem Abdulrasool): build: give aliases the same visibility ARM EABI also uses function aliases. Ensure that those aliased functions are given proper visibility annotations. Reported by: mmel MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D9633 Modified: head/contrib/compiler-rt/lib/builtins/assembly.h Modified: head/contrib/compiler-rt/lib/builtins/assembly.h ============================================================================== --- head/contrib/compiler-rt/lib/builtins/assembly.h Thu Feb 16 20:50:01 2017 (r313822) +++ head/contrib/compiler-rt/lib/builtins/assembly.h Thu Feb 16 21:03:43 2017 (r313823) @@ -149,6 +149,7 @@ #define DEFINE_COMPILERRT_FUNCTION_ALIAS(name, target) \ .globl SYMBOL_NAME(name) SEPARATOR \ SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \ + DECLARE_SYMBOL_VISIBILITY(SYMBOL_NAME(name)) SEPARATOR \ .set SYMBOL_NAME(name), SYMBOL_NAME(target) SEPARATOR #if defined(__ARM_EABI__) From owner-svn-src-head@freebsd.org Thu Feb 16 21:18:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7821CE228C; Thu, 16 Feb 2017 21:18:32 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79D531F1C; Thu, 16 Feb 2017 21:18:32 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLIVYQ026591; Thu, 16 Feb 2017 21:18:31 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLIVsq026589; Thu, 16 Feb 2017 21:18:31 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201702162118.v1GLIVsq026589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 16 Feb 2017 21:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313824 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:18:32 -0000 Author: rstone Date: Thu Feb 16 21:18:31 2017 New Revision: 313824 URL: https://svnweb.freebsd.org/changeset/base/313824 Log: Revert r313814 and r313816 Something evidently got mangled in my git tree in between testing and review, as an old and broken version of the patch was apparently submitted to svn. Revert this while I work out what went wrong. Reported by: tuexen Pointy hat to: rstone Modified: head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Thu Feb 16 21:03:43 2017 (r313823) +++ head/sys/kern/sched_4bsd.c Thu Feb 16 21:18:31 2017 (r313824) @@ -816,12 +816,7 @@ sched_class(struct thread *td, int class static void sched_priority(struct thread *td, u_char prio) { - struct thread *newtd; - struct runq *rq; - u_char orig_pri; -#ifdef SMP - struct thread *cputd; -#endif + KTR_POINT3(KTR_SCHED, "thread", sched_tdname(td), "priority change", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, @@ -837,43 +832,10 @@ sched_priority(struct thread *td, u_char THREAD_LOCK_ASSERT(td, MA_OWNED); if (td->td_priority == prio) return; - orig_pri = td->td_priority; td->td_priority = prio; if (TD_ON_RUNQ(td) && td->td_rqindex != (prio / RQ_PPQ)) { sched_rem(td); sched_add(td, SRQ_BORING); - } else if (orig_pri < prio && TD_IS_RUNNING(td)) { - /* - * If we have decreased the priority of a running thread, we - * have to check if it should be preempted. - */ - rq = &runq; - newtd = runq_choose(&runq); -#ifdef SMP - cputd = runq_choose(&runq_pcpu[td->td_oncpu]); - if (newtd == NULL || - (cputd != NULL && cputd->td_priority < td->td_priority)) - newtd = cputd; -#endif - - if (newtd != NULL && newtd->td_priority < prio -#ifndef FULL_PREEMPTION - && (newtd->td_priority <= PRI_MAX_ITHD || - prio >= PRI_MIN_IDLE)) -#endif - ) { - if (td == curthread) - /* - * Don't reschedule the thread here as it may - * be losing priority because it has released a - * mutex, and in that case we need it to finish - * releasing the lock before it gets preempted. - */ - td->td_owepreempt = 1; - else - kick_other_cpu(newtd->td_priority, - td->td_oncpu); - } } } Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Thu Feb 16 21:03:43 2017 (r313823) +++ head/sys/kern/sched_ule.c Thu Feb 16 21:18:31 2017 (r313824) @@ -319,7 +319,7 @@ static void tdq_add(struct tdq *, struct #ifdef SMP static int tdq_move(struct tdq *, struct tdq *); static int tdq_idled(struct tdq *); -static void tdq_notify(struct tdq *, int); +static void tdq_notify(struct tdq *, struct thread *); static struct thread *tdq_steal(struct tdq *, int); static struct thread *runq_steal(struct runq *, int); static int sched_pickcpu(struct thread *, int); @@ -1040,14 +1040,16 @@ tdq_idled(struct tdq *tdq) * Notify a remote cpu of new work. Sends an IPI if criteria are met. */ static void -tdq_notify(struct tdq *tdq, int pri) +tdq_notify(struct tdq *tdq, struct thread *td) { struct thread *ctd; + int pri; int cpu; if (tdq->tdq_ipipending) return; - cpu = TDQ_ID(tdq); + cpu = td_get_sched(td)->ts_cpu; + pri = td->td_priority; ctd = pcpu_find(cpu)->pc_curthread; if (!sched_shouldpreempt(pri, ctd->td_priority, 1)) return; @@ -1673,22 +1675,6 @@ sched_pctcpu_update(struct td_sched *ts, ts->ts_ltick = t; } -static void -sched_check_preempt(struct tdq *tdq, struct thread *td) -{ - - KASSERT(TD_IS_RUNNING(td), ("thread is not running")); - TDQ_LOCK_ASSERT(tdq, MA_OWNED); - KASSERT(tdq == TDQ_CPU(td->td_sched->ts_cpu), - ("tdq does not contain td")); - - if (tdq == TDQ_SELF()) { - if (sched_shouldpreempt(tdq->tdq_lowpri, td->td_priority, 0)) - td->td_owepreempt = 1; - } else - tdq_notify(tdq, tdq->tdq_lowpri); -} - /* * Adjust the priority of a thread. Move it to the appropriate run-queue * if necessary. This is the back-end for several priority related @@ -1740,9 +1726,6 @@ sched_thread_priority(struct thread *td, tdq->tdq_lowpri = prio; else if (tdq->tdq_lowpri == oldpri) tdq_setlowpri(tdq, td); - - if (oldpri < prio) - sched_check_preempt(tdq, td); return; } td->td_priority = prio; @@ -1871,7 +1854,7 @@ sched_switch_migrate(struct tdq *tdq, st */ tdq_lock_pair(tdn, tdq); tdq_add(tdn, td, flags); - tdq_notify(tdn, td->td_priority); + tdq_notify(tdn, td); TDQ_UNLOCK(tdn); spinlock_exit(); #endif @@ -2446,7 +2429,7 @@ sched_add(struct thread *td, int flags) tdq = sched_setcpu(td, cpu, flags); tdq_add(tdq, td, flags); if (cpu != PCPU_GET(cpuid)) { - tdq_notify(tdq, td->td_priority); + tdq_notify(tdq, td); return; } #else From owner-svn-src-head@freebsd.org Thu Feb 16 21:56:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC773CE226C; Thu, 16 Feb 2017 21:56:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC4AB1CA6; Thu, 16 Feb 2017 21:56:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLuLdg043210; Thu, 16 Feb 2017 21:56:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLuLnu043209; Thu, 16 Feb 2017 21:56:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162156.v1GLuLnu043209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 21:56:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313825 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:56:23 -0000 Author: imp Date: Thu Feb 16 21:56:21 2017 New Revision: 313825 URL: https://svnweb.freebsd.org/changeset/base/313825 Log: Remove stale MCA comment now that the MCA bus support is gone. Relnotes: yes Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Feb 16 21:18:31 2017 (r313824) +++ head/sys/conf/NOTES Thu Feb 16 21:56:21 2017 (r313825) @@ -1429,7 +1429,7 @@ options PCI_IOV # PCI SR-IOV support # HARDWARE DEVICE CONFIGURATION # For ISA the required hints are listed. -# EISA, MCA, PCI, CardBus, SD/MMC and pccard are self identifying buses, so +# EISA, PCI, CardBus, SD/MMC and pccard are self identifying buses, so # no hints are needed. # From owner-svn-src-head@freebsd.org Thu Feb 16 21:56:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC071CE228C; Thu, 16 Feb 2017 21:56:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D47331CD3; Thu, 16 Feb 2017 21:56:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLuRMI043267; Thu, 16 Feb 2017 21:56:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLuRPU043263; Thu, 16 Feb 2017 21:56:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162156.v1GLuRPU043263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 21:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313826 - in head: share/man/man4 sys/conf sys/dev/ahb sys/modules sys/modules/ahb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:56:30 -0000 Author: imp Date: Thu Feb 16 21:56:27 2017 New Revision: 313826 URL: https://svnweb.freebsd.org/changeset/base/313826 Log: Remove the ahb driver for the EISA Adaptec 174x. Deleted: head/share/man/man4/ahb.4 head/sys/dev/ahb/ahb.c head/sys/dev/ahb/ahbreg.h head/sys/modules/ahb/Makefile Modified: head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Feb 16 21:56:21 2017 (r313825) +++ head/share/man/man4/Makefile Thu Feb 16 21:56:27 2017 (r313826) @@ -29,7 +29,6 @@ MAN= aac.4 \ age.4 \ agp.4 \ aha.4 \ - ahb.4 \ ahc.4 \ ahci.4 \ ahd.4 \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Feb 16 21:56:21 2017 (r313825) +++ head/sys/conf/NOTES Thu Feb 16 21:56:27 2017 (r313826) @@ -1530,7 +1530,6 @@ options TERMINAL_KERN_ATTR=(FG_LIGHTRED # adv: All Narrow SCSI bus AdvanSys controllers. # adw: Second Generation AdvanSys controllers including the ADV940UW. # aha: Adaptec 154x/1535/1640 -# ahb: Adaptec 174x EISA controllers # ahc: Adaptec 274x/284x/2910/293x/294x/394x/3950x/3960x/398X/4944/ # 19160x/29160x, aic7770/aic78xx # ahd: Adaptec 29320/39320 Controllers. @@ -1570,7 +1569,6 @@ device aha hint.aha.0.at="isa" device aic hint.aic.0.at="isa" -device ahb device ahc device ahd device esp Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 16 21:56:21 2017 (r313825) +++ head/sys/conf/files Thu Feb 16 21:56:27 2017 (r313826) @@ -694,7 +694,6 @@ dev/agp/agp.c optional agp pci dev/agp/agp_if.m optional agp pci dev/aha/aha.c optional aha dev/aha/aha_isa.c optional aha isa -dev/ahb/ahb.c optional ahb eisa dev/ahci/ahci.c optional ahci dev/ahci/ahciem.c optional ahci dev/ahci/ahci_pci.c optional ahci pci Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Feb 16 21:56:21 2017 (r313825) +++ head/sys/modules/Makefile Thu Feb 16 21:56:27 2017 (r313826) @@ -27,7 +27,6 @@ SUBDIR= \ age \ ${_agp} \ aha \ - ${_ahb} \ ahci \ ${_aic} \ aic7xxx \ @@ -736,9 +735,6 @@ _sbni= sbni _streams= streams _stg= stg _svr4= svr4 -.if ${MK_EISA} != "no" -_ahb= ahb -.endif _cm= cm .if ${MK_SOURCELESS_UCODE} != "no" _ctau= ctau From owner-svn-src-head@freebsd.org Thu Feb 16 21:56:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01465CE22B8; Thu, 16 Feb 2017 21:56:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A34731D16; Thu, 16 Feb 2017 21:56:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLuWWO043321; Thu, 16 Feb 2017 21:56:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLuW13043319; Thu, 16 Feb 2017 21:56:32 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162156.v1GLuW13043319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 21:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313827 - in head: share/man/man4 sys/dev/mlx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:56:34 -0000 Author: imp Date: Thu Feb 16 21:56:32 2017 New Revision: 313827 URL: https://svnweb.freebsd.org/changeset/base/313827 Log: Remove references to EISA support in mlx. The driver never supported the EISA cards and EISA bus support is being removed. Modified: head/share/man/man4/mlx.4 head/sys/dev/mlx/mlx.c Modified: head/share/man/man4/mlx.4 ============================================================================== --- head/share/man/man4/mlx.4 Thu Feb 16 21:56:27 2017 (r313826) +++ head/share/man/man4/mlx.4 Thu Feb 16 21:56:32 2017 (r313827) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 2004 +.Dd February 15, 2017 .Dt MLX 4 .Os .Sh NAME @@ -245,7 +245,6 @@ This manual page was written by and .An Michael Smith Aq Mt msmith@FreeBSD.org . .Sh BUGS -The driver does not yet support EISA adapters. The DEC KZPSC has insufficient flash ROM to hold any reasonably recent firmware. This has caused problems for this driver. .Pp Modified: head/sys/dev/mlx/mlx.c ============================================================================== --- head/sys/dev/mlx/mlx.c Thu Feb 16 21:56:27 2017 (r313826) +++ head/sys/dev/mlx/mlx.c Thu Feb 16 21:56:32 2017 (r313827) @@ -450,7 +450,7 @@ mlx_attach(struct mlx_softc *sc) } sc->mlx_enq2->me_firmware_id = ('0' << 24) | (0 << 16) | (meo->me_fwminor << 8) | meo->me_fwmajor; - /* XXX require 2.42 or better (PCI) or 2.14 or better (EISA) */ + /* XXX require 2.42 or better (PCI) */ if (meo->me_fwminor < 42) { device_printf(sc->mlx_dev, " *** WARNING *** This firmware revision is not recommended\n"); device_printf(sc->mlx_dev, " *** WARNING *** Use revision 2.42 or later\n"); From owner-svn-src-head@freebsd.org Thu Feb 16 21:56:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0594FCE22EA; Thu, 16 Feb 2017 21:56:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9967C1D6E; Thu, 16 Feb 2017 21:56:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLuaKF043373; Thu, 16 Feb 2017 21:56:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLua02043372; Thu, 16 Feb 2017 21:56:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162156.v1GLua02043372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 21:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313828 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:56:39 -0000 Author: imp Date: Thu Feb 16 21:56:36 2017 New Revision: 313828 URL: https://svnweb.freebsd.org/changeset/base/313828 Log: Remove stray reference to EISA bus support that was never in FreeBSD. Modified: head/share/man/man4/le.4 Modified: head/share/man/man4/le.4 ============================================================================== --- head/share/man/man4/le.4 Thu Feb 16 21:56:32 2017 (r313827) +++ head/share/man/man4/le.4 Thu Feb 16 21:56:36 2017 (r313828) @@ -193,17 +193,6 @@ with and .Tn ISA bus Ethernet adapters. -.\" .Ss EISA -.\" The -.\" .Tn EISA -.\" bus Ethernet cards supported by the -.\" .Nm -.\" driver are: -.\" .Pp -.\" .Bl -bullet -compact -.\" .It -.\" .Tn DEC DE422 -.\" .El .Ss PCI The .Tn PCI From owner-svn-src-head@freebsd.org Thu Feb 16 21:56:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D424CE2317; Thu, 16 Feb 2017 21:56:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47C531DBA; Thu, 16 Feb 2017 21:56:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLufQ0043428; Thu, 16 Feb 2017 21:56:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLufEV043427; Thu, 16 Feb 2017 21:56:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162156.v1GLufEV043427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 21:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313829 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:56:42 -0000 Author: imp Date: Thu Feb 16 21:56:41 2017 New Revision: 313829 URL: https://svnweb.freebsd.org/changeset/base/313829 Log: Remove references to C-Bus support in the le(4) driver. Support for these devices were removed when pc98 was removed. Modified: head/share/man/man4/le.4 Modified: head/share/man/man4/le.4 ============================================================================== --- head/share/man/man4/le.4 Thu Feb 16 21:56:36 2017 (r313828) +++ head/share/man/man4/le.4 Thu Feb 16 21:56:41 2017 (r313829) @@ -36,7 +36,7 @@ .\" from: @(#)le.4 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd January 20, 2007 +.Dd February 15, 2017 .Dt LE 4 .Os .Sh NAME @@ -119,12 +119,10 @@ Selective reception of multicast Etherne multicast destination addresses are hashed to a bit entry using the Ethernet CRC function. .Sh HARDWARE -.Ss C-Bus and ISA +.Ss ISA The .Nm driver supports -.Tn C-Bus -and .Tn ISA bus Ethernet adapters which are based on the following chips: .Pp @@ -141,13 +139,6 @@ bus Ethernet adapters which are based on .Pp This includes support for the following Ethernet adapters: .Pp -C-Bus non-PnP: -.Pp -.Bl -bullet -compact -.It -.Tn Contec C-NET(98)S -.El -.Pp ISA non-PnP: .Pp .Bl -bullet -compact @@ -189,8 +180,6 @@ The driver does not support the selection of media types and options via .Xr ifconfig 8 with -.Tn C-Bus -and .Tn ISA bus Ethernet adapters. .Ss PCI From owner-svn-src-head@freebsd.org Thu Feb 16 21:56:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72F62CE2352; Thu, 16 Feb 2017 21:56:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1DFD1E28; Thu, 16 Feb 2017 21:56:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLukiW043486; Thu, 16 Feb 2017 21:56:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLukt2043481; Thu, 16 Feb 2017 21:56:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162156.v1GLukt2043481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 21:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313830 - in head: share/man/man4/man4.i386 sys/conf sys/dev/ep sys/dev/vx sys/modules/vx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:56:48 -0000 Author: imp Date: Thu Feb 16 21:56:46 2017 New Revision: 313830 URL: https://svnweb.freebsd.org/changeset/base/313830 Log: Remove references to EISA support from the vx driver, along with EISA support. Fix a comment block that's shared with both vx and ep. Remove obsolete refernce to statically compiling a kernel with a fixed number of vx devices. Have not removed EISA from the title of the document the register definitions were originally derived from (though no doubt more recent docments were also consulted). Deleted: head/sys/dev/vx/if_vx_eisa.c Modified: head/share/man/man4/man4.i386/vx.4 head/sys/conf/files head/sys/dev/ep/if_epreg.h head/sys/dev/vx/if_vxreg.h head/sys/modules/vx/Makefile Modified: head/share/man/man4/man4.i386/vx.4 ============================================================================== --- head/share/man/man4/man4.i386/vx.4 Thu Feb 16 21:56:41 2017 (r313829) +++ head/share/man/man4/man4.i386/vx.4 Thu Feb 16 21:56:46 2017 (r313830) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd February 15, 2017 .Dt VX 4 i386 .Os .Sh NAME @@ -79,21 +79,9 @@ driver supports the following cards: .It 3Com 3c590 EtherLink III PCI .It -3Com 3c592 EtherLink III EISA -.It 3Com 3c595 Fast EtherLink III PCI in 10 Mbps mode -.It -3Com 3c597 Fast EtherLink III EISA in 10 Mbps mode .El .Sh DIAGNOSTICS -.Bl -diag -.It "vx%d: not configured; kernel is built for only %d devices." -There are not enough devices in the kernel configuration file for the number -of adapters present in the system. -Add devices to the configuration file, -rebuild the kernel, and reboot. -.El -.Pp All other diagnostics indicate either a hardware problem or a bug in the driver. .Sh SEE ALSO Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 16 21:56:41 2017 (r313829) +++ head/sys/conf/files Thu Feb 16 21:56:46 2017 (r313830) @@ -3243,7 +3243,6 @@ dev/vt/vt_font.c optional vt dev/vt/vt_sysmouse.c optional vt dev/vte/if_vte.c optional vte pci dev/vx/if_vx.c optional vx -dev/vx/if_vx_eisa.c optional vx eisa dev/vx/if_vx_pci.c optional vx pci dev/vxge/vxge.c optional vxge dev/vxge/vxgehal/vxgehal-ifmsg.c optional vxge Modified: head/sys/dev/ep/if_epreg.h ============================================================================== --- head/sys/dev/ep/if_epreg.h Thu Feb 16 21:56:41 2017 (r313829) +++ head/sys/dev/ep/if_epreg.h Thu Feb 16 21:56:46 2017 (r313830) @@ -113,7 +113,7 @@ /************************************************************************** * * * These are the registers for the 3Com 3c509 and their bit patterns when * - * applicable. They have been taken out the "EtherLink III Parallel * + * applicable. They have been taken out the "EtherLink III Parallel * * Tasking EISA and ISA Technical Reference" "Beta Draft 10/30/92" manual * * from 3com. * * * Modified: head/sys/dev/vx/if_vxreg.h ============================================================================== --- head/sys/dev/vx/if_vxreg.h Thu Feb 16 21:56:41 2017 (r313829) +++ head/sys/dev/vx/if_vxreg.h Thu Feb 16 21:56:46 2017 (r313830) @@ -77,8 +77,6 @@ #define EEPROM_MFG_PRODUCT 0x6 /* Product code */ #define EEPROM_MFG_ID 0x7 /* 0x6d50 */ #define EEPROM_ADDR_CFG 0x8 /* Base addr */ -#define ADDR_CFG_EISA 0x1f -#define ADDR_CFG_MASK 0x1f #define EEPROM_RESOURCE_CFG 0x9 /* IRQ. Bits 12-15 */ #define EEPROM_OEM_ADDR0 0xa #define EEPROM_OEM_ADDR1 0xb @@ -87,8 +85,6 @@ #define EEPROM_COMPAT 0xe #define EEPROM_SOFTINFO2 0xf #define EEPROM_CAP 0x10 -#define CAP_ISA 0x2083 -#define CAP_PCMCIA 0x2082 #define EEPROM_INT_CONFIG_0 0x12 #define EEPROM_INT_CONFIG_1 0x13 /* RAM Partition TX FIFO/RX FIFO */ @@ -112,7 +108,7 @@ /************************************************************************** * These are the registers for the 3Com 3c509 and their bit patterns when * - * applicable. They have been taken out the "EtherLink III Parallel * + * applicable. They have been taken out the "EtherLink III Parallel * * Tasking EISA and ISA Technical Reference" "Beta Draft 10/30/92" manual * * from 3com. * **************************************************************************/ Modified: head/sys/modules/vx/Makefile ============================================================================== --- head/sys/modules/vx/Makefile Thu Feb 16 21:56:41 2017 (r313829) +++ head/sys/modules/vx/Makefile Thu Feb 16 21:56:46 2017 (r313830) @@ -7,7 +7,6 @@ SYSDIR?=${.CURDIR}/../.. KMOD= if_vx SRCS= if_vx.c if_vx_pci.c -SRCS.DEV_EISA= if_vx_eisa.c eisa_if.h SRCS+= device_if.h bus_if.h pci_if.h .include From owner-svn-src-head@freebsd.org Thu Feb 16 21:56:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E79A2CE2388; Thu, 16 Feb 2017 21:56:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2FA01EA1; Thu, 16 Feb 2017 21:56:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLuqfF043545; Thu, 16 Feb 2017 21:56:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLup24043539; Thu, 16 Feb 2017 21:56:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162156.v1GLup24043539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 21:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313831 - in head: share/man/man4/man4.i386 sys/conf sys/dev/ep sys/modules/ep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:56:54 -0000 Author: imp Date: Thu Feb 16 21:56:51 2017 New Revision: 313831 URL: https://svnweb.freebsd.org/changeset/base/313831 Log: Remove EISA support for ep driver. Left in place EISA strings that are still relevant (ISA cards can still be in EISA mode, and we're still ignoring those in the identify routine). Notes about cards in EISA mode have been left in the manual since they aren't relevant to EISA support, but instruct how to properly configure an ISA card in a mode when it is in a ISA bus slot. Deleted: head/sys/dev/ep/if_ep_eisa.c Modified: head/share/man/man4/man4.i386/ep.4 head/sys/conf/files head/sys/dev/ep/if_ep.c head/sys/dev/ep/if_ep_isa.c head/sys/dev/ep/if_epvar.h head/sys/modules/ep/Makefile Modified: head/share/man/man4/man4.i386/ep.4 ============================================================================== --- head/share/man/man4/man4.i386/ep.4 Thu Feb 16 21:56:46 2017 (r313830) +++ head/share/man/man4/man4.i386/ep.4 Thu Feb 16 21:56:51 2017 (r313831) @@ -99,8 +99,6 @@ driver supports Ethernet adapters based .It 3Com 3C574, 3C574TX, 3C574-TX, 3CCFE574BT, 3CXFE574BT, 3C3FE574BT PCMCIA .It -3Com 3C579-TP, 3C579-BNC EISA -.It 3Com 3C589, 3C589B, 3C589C, 3C589D, 3CXE589DT PCMCIA .It 3Com 3CCFEM556B, 3CCFEM556BI PCMCIA @@ -121,10 +119,7 @@ scan operation at IO address 0x110. Beware! Avoid placing other cards at that address! .Pp -Furthermore, the 3c509 should only be configured in EISA mode -when installed in a computer that has actual EISA slots -(and an EISA-aware BIOS). -The normal driver auto-detection support is sufficient for non-EISA systems. +Furthermore, the 3c509 should not be configured in EISA mode. .Pp Cards in PnP mode may conflict with other resources in the system. Ensure your BIOS is configured correctly to exclude resources used by @@ -180,9 +175,9 @@ has about connectors, so it is assuming .It "ep0: unknown ID 0xXXXXXXXX" The driver has found an ID that it believes it supports, but does not have a specific identification string to present to the user. -.It "ep0: <%s> at port 0x%03x in EISA mode" +.It "ep0: <%s> at port 0x%03x in EISA mode, ignored." The 3C509 ISA card is in EISA mode. -This message appears to be purely informational. +The card will be ignored until it is taken out of EISA mode. .It "ep0: <%s> at x0%03x in PnP mode" This card appears to be in Plug and Play mode. It should be probed as part of the plug and play phase of the ISA Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 16 21:56:46 2017 (r313830) +++ head/sys/conf/files Thu Feb 16 21:56:51 2017 (r313831) @@ -1604,7 +1604,6 @@ dev/et/if_et.c optional et dev/en/if_en_pci.c optional en pci dev/en/midway.c optional en dev/ep/if_ep.c optional ep -dev/ep/if_ep_eisa.c optional ep eisa dev/ep/if_ep_isa.c optional ep isa dev/ep/if_ep_pccard.c optional ep pccard dev/esp/esp_pci.c optional esp pci Modified: head/sys/dev/ep/if_ep.c ============================================================================== --- head/sys/dev/ep/if_ep.c Thu Feb 16 21:56:46 2017 (r313830) +++ head/sys/dev/ep/if_ep.c Thu Feb 16 21:56:51 2017 (r313831) @@ -530,31 +530,17 @@ startagain: CSR_WRITE_2(sc, EP_COMMAND, SET_TX_AVAIL_THRESH | EP_THRESH_DISABLE); - /* XXX 4.x and earlier would splhigh here */ - CSR_WRITE_2(sc, EP_W1_TX_PIO_WR_1, len); /* Second dword meaningless */ CSR_WRITE_2(sc, EP_W1_TX_PIO_WR_1, 0x0); - if (EP_FTST(sc, F_ACCESS_32_BITS)) { - for (m = m0; m != NULL; m = m->m_next) { - if (m->m_len > 3) - CSR_WRITE_MULTI_4(sc, EP_W1_TX_PIO_WR_1, - mtod(m, uint32_t *), m->m_len / 4); - if (m->m_len & 3) - CSR_WRITE_MULTI_1(sc, EP_W1_TX_PIO_WR_1, - mtod(m, uint8_t *)+(m->m_len & (~3)), - m->m_len & 3); - } - } else { - for (m = m0; m != NULL; m = m->m_next) { - if (m->m_len > 1) - CSR_WRITE_MULTI_2(sc, EP_W1_TX_PIO_WR_1, - mtod(m, uint16_t *), m->m_len / 2); - if (m->m_len & 1) - CSR_WRITE_1(sc, EP_W1_TX_PIO_WR_1, - *(mtod(m, uint8_t *)+m->m_len - 1)); - } + for (m = m0; m != NULL; m = m->m_next) { + if (m->m_len > 1) + CSR_WRITE_MULTI_2(sc, EP_W1_TX_PIO_WR_1, + mtod(m, uint16_t *), m->m_len / 2); + if (m->m_len & 1) + CSR_WRITE_1(sc, EP_W1_TX_PIO_WR_1, + *(mtod(m, uint8_t *)+m->m_len - 1)); } while (pad--) @@ -788,25 +774,13 @@ read_again: mcur->m_next = m; lenthisone = min(rx_fifo, M_TRAILINGSPACE(m)); } - if (EP_FTST(sc, F_ACCESS_32_BITS)) { - /* default for EISA configured cards */ - CSR_READ_MULTI_4(sc, EP_W1_RX_PIO_RD_1, - (uint32_t *)(mtod(m, caddr_t)+m->m_len), - lenthisone / 4); - m->m_len += (lenthisone & ~3); - if (lenthisone & 3) - CSR_READ_MULTI_1(sc, EP_W1_RX_PIO_RD_1, - mtod(m, caddr_t)+m->m_len, lenthisone & 3); - m->m_len += (lenthisone & 3); - } else { - CSR_READ_MULTI_2(sc, EP_W1_RX_PIO_RD_1, - (uint16_t *)(mtod(m, caddr_t)+m->m_len), - lenthisone / 2); - m->m_len += lenthisone; - if (lenthisone & 1) - *(mtod(m, caddr_t)+m->m_len - 1) = - CSR_READ_1(sc, EP_W1_RX_PIO_RD_1); - } + CSR_READ_MULTI_2(sc, EP_W1_RX_PIO_RD_1, + (uint16_t *)(mtod(m, caddr_t)+m->m_len), + lenthisone / 2); + m->m_len += lenthisone; + if (lenthisone & 1) + *(mtod(m, caddr_t)+m->m_len - 1) = + CSR_READ_1(sc, EP_W1_RX_PIO_RD_1); rx_fifo -= lenthisone; } Modified: head/sys/dev/ep/if_ep_isa.c ============================================================================== --- head/sys/dev/ep/if_ep_isa.c Thu Feb 16 21:56:46 2017 (r313830) +++ head/sys/dev/ep/if_ep_isa.c Thu Feb 16 21:56:51 2017 (r313831) @@ -194,8 +194,7 @@ ep_isa_identify(driver_t * driver, devic (void)get_eeprom_data(ELINK_ID_PORT, j); /* - * Construct an 'isa_id' in 'EISA' - * format. + * Construct an 'isa_id' in 'EISA' format. */ data = get_eeprom_data(ELINK_ID_PORT, EEPROM_MFG_ID); isa_id = (htons(data) << 16); @@ -220,7 +219,7 @@ ep_isa_identify(driver_t * driver, devic if ((data & ADDR_CFG_MASK) == ADDR_CFG_EISA) { device_printf(parent, - "<%s> at port 0x%03x in EISA mode!\n", + "<%s> at port 0x%03x in EISA mode, ignoring!\n", desc, ioport); /* * Set the adaptor tag so that the next card can be Modified: head/sys/dev/ep/if_epvar.h ============================================================================== --- head/sys/dev/ep/if_epvar.h Thu Feb 16 21:56:46 2017 (r313830) +++ head/sys/dev/ep/if_epvar.h Thu Feb 16 21:56:51 2017 (r313831) @@ -59,7 +59,6 @@ struct ep_softc { #define F_RX_FIRST 0x001 #define F_ENADDR_SKIP 0x002 #define F_PROMISC 0x008 -#define F_ACCESS_32_BITS 0x100 #define F_HAS_TX_PLL 0x200 int gone; /* adapter is not present (for PCCARD) */ Modified: head/sys/modules/ep/Makefile ============================================================================== --- head/sys/modules/ep/Makefile Thu Feb 16 21:56:46 2017 (r313830) +++ head/sys/modules/ep/Makefile Thu Feb 16 21:56:51 2017 (r313831) @@ -9,7 +9,6 @@ KMOD= if_ep SRCS= if_ep.c SRCS+= if_ep_pccard.c pccarddevs.h card_if.h SRCS+= if_ep_isa.c isa_if.h -SRCS.DEV_EISA= if_ep_eisa.c eisa_if.h SRCS+= bus_if.h device_if.h .include From owner-svn-src-head@freebsd.org Thu Feb 16 21:56:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDCFBCE23C5; Thu, 16 Feb 2017 21:56:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79A1F1F21; Thu, 16 Feb 2017 21:56:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLuvY8043600; Thu, 16 Feb 2017 21:56:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLuvG7043596; Thu, 16 Feb 2017 21:56:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162156.v1GLuvG7043596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 21:56:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313832 - in head: share/man/man4 sys/conf sys/dev/ida X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:56:59 -0000 Author: imp Date: Thu Feb 16 21:56:57 2017 New Revision: 313832 URL: https://svnweb.freebsd.org/changeset/base/313832 Log: Remove support for EISA in the ida driver. Remove references to EISA-only registers. Remove known EISA cards from man page. Deleted: head/sys/dev/ida/ida_eisa.c Modified: head/share/man/man4/ida.4 head/sys/conf/files head/sys/dev/ida/idareg.h Modified: head/share/man/man4/ida.4 ============================================================================== --- head/share/man/man4/ida.4 Thu Feb 16 21:56:51 2017 (r313831) +++ head/share/man/man4/ida.4 Thu Feb 16 21:56:57 2017 (r313832) @@ -2,7 +2,7 @@ .\" Written by Tom Rhodes .\" This file is public domain .\" -.Dd August 8, 2004 +.Dd February 15, 2017 .Dt IDA 4 .Os .Sh NAME @@ -57,10 +57,6 @@ Compaq SMART-2/DH Controller Compaq SMART-2/SL Controller .It Compaq SMART-2/P Controller -.It -Compaq SMART-2/E Controller -.It -Compaq SMART Controller .El .Sh IMPLEMENTATION NOTES Extreme caution should be exercised when using the pass-through interface. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 16 21:56:51 2017 (r313831) +++ head/sys/conf/files Thu Feb 16 21:56:57 2017 (r313832) @@ -1727,7 +1727,6 @@ dev/ichsmb/ichsmb.c optional ichsmb dev/ichsmb/ichsmb_pci.c optional ichsmb pci dev/ida/ida.c optional ida dev/ida/ida_disk.c optional ida -dev/ida/ida_eisa.c optional ida eisa dev/ida/ida_pci.c optional ida pci dev/iicbus/ad7418.c optional ad7418 dev/iicbus/ds1307.c optional ds1307 Modified: head/sys/dev/ida/idareg.h ============================================================================== --- head/sys/dev/ida/idareg.h Thu Feb 16 21:56:51 2017 (r313831) +++ head/sys/dev/ida/idareg.h Thu Feb 16 21:56:57 2017 (r313832) @@ -31,23 +31,6 @@ */ /* - * defines for older EISA controllers (IDA, IDA-2, IAES, SMART) - */ -#define R_EISA_INT_MASK 0x01 -#define R_EISA_LOCAL_MASK 0x04 -#define R_EISA_LOCAL_DOORBELL 0x05 -#define R_EISA_SYSTEM_MASK 0x06 -#define R_EISA_SYSTEM_DOORBELL 0x07 -#define R_EISA_LIST_ADDR 0x08 -#define R_EISA_LIST_LEN 0x0c -#define R_EISA_TAG 0x0f -#define R_EISA_COMPLETE_ADDR 0x10 -#define R_EISA_LIST_STATUS 0x16 - -#define EISA_CHANNEL_BUSY 0x01 -#define EISA_CHANNEL_CLEAR 0x02 - -/* * board register offsets for SMART-2 controllers */ #define R_CMD_FIFO 0x04 From owner-svn-src-head@freebsd.org Thu Feb 16 21:57:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78CCCCE23F8; Thu, 16 Feb 2017 21:57:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 390A01FAF; Thu, 16 Feb 2017 21:57:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLv3jk043660; Thu, 16 Feb 2017 21:57:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLv2ab043655; Thu, 16 Feb 2017 21:57:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162157.v1GLv2ab043655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 21:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313833 - in head: share/man/man4 sys/conf sys/dev/advansys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:57:04 -0000 Author: imp Date: Thu Feb 16 21:57:02 2017 New Revision: 313833 URL: https://svnweb.freebsd.org/changeset/base/313833 Log: Remove EISA support from adv driver. Remove references to it from man page. Remove comment about EISA dual channel card. Remove trivial references in advlib to avoid false positives with grep. Remove stray MCA reference not worth a seperate commit. Deleted: head/sys/dev/advansys/adv_eisa.c Modified: head/share/man/man4/adv.4 head/sys/conf/files head/sys/dev/advansys/advansys.c head/sys/dev/advansys/advlib.c head/sys/dev/advansys/advlib.h Modified: head/share/man/man4/adv.4 ============================================================================== --- head/share/man/man4/adv.4 Thu Feb 16 21:56:57 2017 (r313832) +++ head/share/man/man4/adv.4 Thu Feb 16 21:57:02 2017 (r313833) @@ -28,7 +28,7 @@ .Os .Sh NAME .Nm adv -.Nd Advansys ISA/VL/EISA/PCI 8bit SCSI Host adapter driver +.Nd Advansys ISA/VL/PCI Narrow 8bit SCSI Host adapter driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -37,9 +37,6 @@ kernel configuration file: .Cd "device scbus" .Cd "device adv" .Pp -For one or more EISA cards: -.Cd "device eisa" -.Pp For one or more VL/ISA cards: .Cd "device isa" .Pp @@ -51,7 +48,7 @@ For one or more PCI cards: .Cd "device pci" .Ed .Sh DESCRIPTION -This driver provides access to the 8bit +This driver provides access to the narrow 8bit .Tn SCSI bus connected to the Advanced Systems Products, Inc. .Tn ASC900 , @@ -82,8 +79,8 @@ Connectivity Products: .It "ABP930" Ta "PCI" Ta "\&No" Ta "10MHz" Ta "16" Ta "5" .It "ABP930U" Ta "PCI" Ta "\&No" Ta "20MHz" Ta "16" Ta "" .It "ABP930UA" Ta "PCI" Ta "\&No" Ta "20MHz" Ta "16" Ta "" -.It "ABP960" Ta "PCI" Ta "\&No" Ta "10MHz" Ta "16" Ta "" -.It "ABP960U" Ta "PCI" Ta "\&No" Ta "20MHz" Ta "16" Ta "" +.It "ABP960" Ta "PCI" Ta "\&No" Ta "10MHz" Ta "16" Ta "2" +.It "ABP960U" Ta "PCI" Ta "\&No" Ta "20MHz" Ta "16" Ta "2" .El .Pp Footnotes: @@ -104,10 +101,9 @@ This board has been sold by SIIG as the .Ed .Bd -ragged -offset indent Single Channel Products: -.Bl -column "ABPX3X940UA " "EISA " "Floppy " "MaxSync " "Commands" +.Bl -column "ABPX3X940UA " "PCI " "Floppy " "MaxSync " "Commands" .Em "Adapter" Ta Em "Bus" Ta Em "Floppy" Ta Em "MaxSync" Ta Em "Commands" .It "ABP542" Ta "ISA" Ta "Yes" Ta "10MHz" Ta "240" -.It "ABP742" Ta "EISA" Ta "Yes" Ta "10MHz" Ta "240" .It "ABP842" Ta "VL" Ta "Yes" Ta "10MHz" Ta "240" .It "ABP940" Ta "PCI" Ta "\&No" Ta "10MHz" Ta "240" .It "ABP[3]940UA" Ta "PCI" Ta "\&No" Ta "20MHz" Ta "240" @@ -119,9 +115,8 @@ Single Channel Products: .Ed .Bd -ragged -offset indent Multi Channel Products (Commands are per-channel): -.Bl -column "ABPX3X980UA " "EISA " "Floppy " "MaxSync " "Commands " "Channels" +.Bl -column "ABPX3X980UA " "PCI " "Floppy " "MaxSync " "Commands " "Channels" .Em "Adapter" Ta Em "Bus" Ta Em "Floppy" Ta Em "MaxSync" Ta Em "Commands" Ta Em "Channels" -.It "ABP752" Ta "EISA" Ta "Yes" Ta "10MHz" Ta "240" Ta "2" .It "ABP852" Ta "VL" Ta "Yes" Ta "10MHz" Ta "240" Ta "2" .It "ABP950" Ta "PCI" Ta "\&No" Ta "10MHz" Ta "240" Ta "2" .It "ABP980" Ta "PCI" Ta "\&No" Ta "10MHz" Ta "240" Ta "4" @@ -130,15 +125,17 @@ Multi Channel Products (Commands are per .El .Ed .Pp -.\" For ISA or Vesa Local Bus adapters, one kernel config entry is required -.\" for every card to be attached by the system. Specific values for the port -.\" address, irq, and drq may be specified. If wildcard values are used, the -.\" driver will query the device for its current settings and use those. If -.\" the port address is a wildcard, the driver consults an internal table of -.\" possible port address locations and attaches to the first unattached card -.\" it finds. The possible port addresses for these card are 0x110, 0x130, -.\" 0x150, 0x190, 0x210, 0x230, 0x250, and 0x330. -.\" .Pp +For ISA or Vesa Local Bus adapters, one kernel hints entry is required +for every card to be attached by the system. +Specific values for the port address, irq and drq may be specified. +If unspecified, the driver will query the device for its current +settings and use those. +If the port address is unspecified, the driver will search for it at +one of the possible addresses. +Cards configured for ISA PNP addresses are found automatically. +The possible port addresses for these card are 0x110, 0x130, +0x150, 0x190, 0x210, 0x230, 0x250, and 0x330. +.Pp Per target configuration performed in the .Tn AdvanceWare menu, which is accessible at boot, @@ -181,8 +178,6 @@ AdvanSys ABP960, ABP960U .It AdvanSys ABP542 .It -AdvanSys ABP742 -.It AdvanSys ABP842 .It AdvanSys ABP940 @@ -195,8 +190,6 @@ AdvanSys ABP3960UA .It AdvanSys ABP970, ABP970U .It -AdvanSys ABP752 -.It AdvanSys ABP852 .It AdvanSys ABP950 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 16 21:56:57 2017 (r313832) +++ head/sys/conf/files Thu Feb 16 21:57:02 2017 (r313833) @@ -679,7 +679,6 @@ dev/acpica/acpi_throttle.c optional acpi dev/acpica/acpi_video.c optional acpi_video acpi dev/acpica/acpi_dock.c optional acpi_dock acpi dev/adlink/adlink.c optional adlink -dev/advansys/adv_eisa.c optional adv eisa dev/advansys/adv_pci.c optional adv pci dev/advansys/advansys.c optional adv dev/advansys/advlib.c optional adv Modified: head/sys/dev/advansys/advansys.c ============================================================================== --- head/sys/dev/advansys/advansys.c Thu Feb 16 21:56:57 2017 (r313832) +++ head/sys/dev/advansys/advansys.c Thu Feb 16 21:57:02 2017 (r313833) @@ -3,7 +3,6 @@ * Product specific probe and attach routines can be found in: * * i386/isa/adv_isa.c ABP5140, ABP542, ABP5150, ABP842, ABP852 - * i386/eisa/adv_eisa.c ABP742, ABP752 * pci/adv_pci.c ABP920, ABP930, ABP930U, ABP930UA, ABP940, ABP940U, * ABP940UA, ABP950, ABP960, ABP960U, ABP960UA, * ABP970, ABP970U @@ -1378,8 +1377,6 @@ adv_attach(adv) /* * Register the bus. - * - * XXX Twin Channel EISA Cards??? */ mtx_lock(&adv->lock); if (xpt_bus_register(adv->sim, adv->dev, 0) != CAM_SUCCESS) { Modified: head/sys/dev/advansys/advlib.c ============================================================================== --- head/sys/dev/advansys/advlib.c Thu Feb 16 21:56:57 2017 (r313832) +++ head/sys/dev/advansys/advlib.c Thu Feb 16 21:57:02 2017 (r313833) @@ -729,7 +729,7 @@ adv_execute_scsi_queue(struct adv_softc panic("adv_execute_scsi_queue: " "Queue with too many segs."); - if ((adv->type & (ADV_ISA | ADV_VL | ADV_EISA)) != 0) { + if ((adv->type & (ADV_ISA | ADV_VL)) != 0) { int i; for (i = 0; i < sg_entry_cnt_minus_one; i++) { Modified: head/sys/dev/advansys/advlib.h ============================================================================== --- head/sys/dev/advansys/advlib.h Thu Feb 16 21:56:57 2017 (r313832) +++ head/sys/dev/advansys/advlib.h Thu Feb 16 21:57:02 2017 (r313833) @@ -66,9 +66,7 @@ typedef enum { ADV_ISA = 0x001, ADV_ISAPNP = 0x003, ADV_VL = 0x004, - ADV_EISA = 0x008, ADV_PCI = 0x010, - ADV_MCA = 0x020, ADV_PCMCIA = 0x040, ADV_ULTRA = 0x100, ADV_WIDE = 0x200, @@ -170,9 +168,6 @@ struct adv_ccb_info { #define ADV_CHIP_VER_ISA_BIT 0x30 #define ADV_CHIP_VER_ISAPNP_BIT 0x20 #define ADV_CHIP_VER_ASYN_BUG 0x21 -#define ADV_CHIP_MIN_VER_EISA 0x41 -#define ADV_CHIP_MAX_VER_EISA 0x47 -#define ADV_CHIP_VER_EISA_BIT 0x40 #define ADV_CONFIG_MSW 0x0004 #define ADV_CFG_MSW_SCSI_TARGET_ON 0x0080 From owner-svn-src-head@freebsd.org Thu Feb 16 21:57:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21655CE243B; Thu, 16 Feb 2017 21:57:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CF15105D; Thu, 16 Feb 2017 21:57:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLv9Hm043722; Thu, 16 Feb 2017 21:57:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLv8XE043713; Thu, 16 Feb 2017 21:57:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162157.v1GLv8XE043713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 21:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313834 - in head: share/man/man4 sys/conf sys/dev/pdq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:57:11 -0000 Author: imp Date: Thu Feb 16 21:57:08 2017 New Revision: 313834 URL: https://svnweb.freebsd.org/changeset/base/313834 Log: Remove EISA attachment (fea) from pdq driver. Remove vestiges of TurboChannel and Q-Bus support while I'm here. Remove obsolete diagnostics from man page. Deleted: head/sys/dev/pdq/if_fea.c Modified: head/share/man/man4/Makefile head/share/man/man4/fpa.4 head/sys/conf/NOTES head/sys/conf/files head/sys/dev/pdq/pdq.c head/sys/dev/pdq/pdq_freebsd.h head/sys/dev/pdq/pdq_ifsubr.c head/sys/dev/pdq/pdqreg.h head/sys/dev/pdq/pdqvar.h Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Feb 16 21:57:02 2017 (r313833) +++ head/share/man/man4/Makefile Thu Feb 16 21:57:08 2017 (r313834) @@ -634,7 +634,6 @@ MLINKS+=fd.4 stderr.4 \ fd.4 stdout.4 MLINKS+=fdt.4 FDT.4 MLINKS+=firewire.4 ieee1394.4 -MLINKS+=fpa.4 fea.4 MLINKS+=fwe.4 if_fwe.4 MLINKS+=fwip.4 if_fwip.4 MLINKS+=fxp.4 if_fxp.4 Modified: head/share/man/man4/fpa.4 ============================================================================== --- head/share/man/man4/fpa.4 Thu Feb 16 21:57:02 2017 (r313833) +++ head/share/man/man4/fpa.4 Thu Feb 16 21:57:08 2017 (r313834) @@ -4,16 +4,14 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 1995 +.Dd February 15, 2017 .Dt FPA 4 .Os .Sh NAME -.Nm fpa , -.Nm fea +.Nm fpa .Nd device drivers for DEC FDDI controllers .Sh SYNOPSIS .Cd "device fpa" -.Cd "device fea" .Pp .Fx only: @@ -21,25 +19,9 @@ only: .Sh DESCRIPTION The .Nm -and -.Nm fea -device drivers provide support for the DEC DEFPA PCI FDDI Controller and -the DEC DEFEA EISA FDDI Controller, respectively. -All variants of either +device driver provide support for the DEC DEFPA PCI FDDI Controller. +All variants of the controller are supported including the DAS and SAS configurations. -.Sh DIAGNOSTICS -.Bl -diag -.It "fea%d: error: desired IRQ of %d does not match device's actual IRQ (%d)" -The device probe detected that the DEFEA board is configured for a different -interrupt than the one specified in the kernel configuration file. -.It "fea%d: error: memory not enabled! ECU reconfiguration required" -The device probe found that no device memory had been configured on the -DEFEA. -Although the DEFEA can be configured with no device memory, this driver -requires a minimum of 1K device memory to be set up. -The ECU (EISA Configuration -Utility) will need to be run to change the settings. -.El .Sh SEE ALSO .Xr arp 4 , .Xr netintro 4 , @@ -47,9 +29,7 @@ Utility) will need to be run to change t .Sh AUTHORS The .Nm -and -.Nm fea -device drivers and this manual page were written by +device driver and this manual page were written by .An Matt Thomas . .Sh CAVEATS Normally, the device driver will not enable the reception of SMT frames. Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Feb 16 21:57:02 2017 (r313833) +++ head/sys/conf/NOTES Thu Feb 16 21:57:08 2017 (r313834) @@ -1974,7 +1974,6 @@ device xmphy # XaQti XMAC II # ex: Intel EtherExpress Pro/10 and other i82595-based adapters, # Olicom Ethernet PC Card devices. # fe: Fujitsu MB86960A/MB86965A Ethernet -# fea: DEC DEFEA EISA FDDI adapter # fpa: Support for the Digital DEFPA PCI FDDI. `device fddi' is also needed. # fxp: Intel EtherExpress Pro/100B # (hint of prefer_iomap can be done to prefer I/O instead of Mem mapping) @@ -2087,7 +2086,6 @@ device ex device fe hint.fe.0.at="isa" hint.fe.0.port="0x300" -device fea device sn hint.sn.0.at="isa" hint.sn.0.port="0x300" Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 16 21:57:02 2017 (r313833) +++ head/sys/conf/files Thu Feb 16 21:57:08 2017 (r313834) @@ -2409,10 +2409,9 @@ dev/pci/pcib_if.m standard dev/pci/pcib_support.c standard dev/pci/vga_pci.c optional pci dev/pcn/if_pcn.c optional pcn pci -dev/pdq/if_fea.c optional fea eisa dev/pdq/if_fpa.c optional fpa pci -dev/pdq/pdq.c optional nowerror fea eisa | fpa pci -dev/pdq/pdq_ifsubr.c optional nowerror fea eisa | fpa pci +dev/pdq/pdq.c optional nowerror fpa pci +dev/pdq/pdq_ifsubr.c optional nowerror fpa pci dev/pms/freebsd/driver/ini/src/agtiapi.c optional pmspcv \ compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w" dev/pms/RefTisa/sallsdk/spc/sadisc.c optional pmspcv \ Modified: head/sys/dev/pdq/pdq.c ============================================================================== --- head/sys/dev/pdq/pdq.c Thu Feb 16 21:57:02 2017 (r313833) +++ head/sys/dev/pdq/pdq.c Thu Feb 16 21:57:08 2017 (r313834) @@ -163,10 +163,6 @@ static const char * const * const pdq_pm static const char * const pdq_descriptions[] = { "DEFPA PCI", - "DEFEA EISA", - "DEFTA TC", - "DEFAA Futurebus", - "DEFQA Q-bus", }; static void @@ -1088,8 +1084,7 @@ pdq_hwreset( state = PDQ_PSTS_ADAPTER_STATE(PDQ_CSR_READ(csrs, csr_port_status)); if (state == PDQS_DMA_UNAVAILABLE) return; - PDQ_CSR_WRITE(csrs, csr_port_data_a, - (state == PDQS_HALTED && pdq->pdq_type != PDQ_DEFTA) ? 0 : PDQ_PRESET_SKIP_SELFTEST); + PDQ_CSR_WRITE(csrs, csr_port_data_a, PDQ_PRESET_SKIP_SELFTEST); PDQ_CSR_WRITE(csrs, csr_port_reset, 1); PDQ_OS_USEC_DELAY(100); PDQ_CSR_WRITE(csrs, csr_port_reset, 0); @@ -1164,13 +1159,11 @@ pdq_stop( pdq_read_fwrev(&pdq->pdq_csrs, &pdq->pdq_fwrev); pdq->pdq_chip_rev = pdq_read_chiprev(&pdq->pdq_csrs); - if (pdq->pdq_type == PDQ_DEFPA) { - /* - * Disable interrupts and DMA. - */ - PDQ_CSR_WRITE(&pdq->pdq_pci_csrs, csr_pfi_mode_control, 0); - PDQ_CSR_WRITE(&pdq->pdq_pci_csrs, csr_pfi_status, 0x10); - } + /* + * Disable interrupts and DMA. + */ + PDQ_CSR_WRITE(&pdq->pdq_pci_csrs, csr_pfi_mode_control, 0); + PDQ_CSR_WRITE(&pdq->pdq_pci_csrs, csr_pfi_status, 0x10); /* * Flush all the databuf queues. @@ -1229,27 +1222,21 @@ pdq_stop( * Allow the DEFPA to do DMA. Then program the physical * addresses of the consumer and descriptor blocks. */ - if (pdq->pdq_type == PDQ_DEFPA) { #ifdef PDQTEST - PDQ_CSR_WRITE(&pdq->pdq_pci_csrs, csr_pfi_mode_control, - PDQ_PFI_MODE_DMA_ENABLE); + PDQ_CSR_WRITE(&pdq->pdq_pci_csrs, csr_pfi_mode_control, + PDQ_PFI_MODE_DMA_ENABLE); #else - PDQ_CSR_WRITE(&pdq->pdq_pci_csrs, csr_pfi_mode_control, - PDQ_PFI_MODE_DMA_ENABLE - /*|PDQ_PFI_MODE_PFI_PCI_INTR*/|PDQ_PFI_MODE_PDQ_PCI_INTR); + PDQ_CSR_WRITE(&pdq->pdq_pci_csrs, csr_pfi_mode_control, + PDQ_PFI_MODE_DMA_ENABLE + /*|PDQ_PFI_MODE_PFI_PCI_INTR*/|PDQ_PFI_MODE_PDQ_PCI_INTR); #endif - } /* * Make sure the unsolicited queue has events ... */ pdq_process_unsolicited_events(pdq); - if ((pdq->pdq_type == PDQ_DEFEA && pdq->pdq_chip_rev == PDQ_CHIP_REV_E) - || pdq->pdq_type == PDQ_DEFTA) - PDQ_CSR_WRITE(csrs, csr_port_data_b, PDQ_DMA_BURST_16LW); - else - PDQ_CSR_WRITE(csrs, csr_port_data_b, PDQ_DMA_BURST_8LW); + PDQ_CSR_WRITE(csrs, csr_port_data_b, PDQ_DMA_BURST_8LW); PDQ_CSR_WRITE(csrs, csr_port_data_a, PDQ_SUB_CMD_DMA_BURST_SIZE_SET); pdq_do_port_control(csrs, PDQ_PCTL_SUB_CMD); @@ -1408,8 +1395,7 @@ pdq_interrupt( pdq_uint32_t data; int progress = 0; - if (pdq->pdq_type == PDQ_DEFPA) - PDQ_CSR_WRITE(&pdq->pdq_pci_csrs, csr_pfi_status, 0x18); + PDQ_CSR_WRITE(&pdq->pdq_pci_csrs, csr_pfi_status, 0x18); while ((data = PDQ_CSR_READ(csrs, csr_port_status)) & PDQ_PSTS_INTR_PENDING) { progress = 1; @@ -1454,7 +1440,7 @@ pdq_interrupt( pdq_halt_code_t halt_code = PDQ_PSTS_HALT_ID(PDQ_CSR_READ(csrs, csr_port_status)); printf(": halt code = %d (%s)\n", halt_code, pdq_halt_codes[halt_code]); - if (halt_code == PDQH_DMA_ERROR && pdq->pdq_type == PDQ_DEFPA) { + if (halt_code == PDQH_DMA_ERROR) { PDQ_PRINTF(("\tPFI status = 0x%x, Host 0 Fatal Interrupt = 0x%x\n", PDQ_CSR_READ(&pdq->pdq_pci_csrs, csr_pfi_status), data & PDQ_HOST_INT_FATAL_ERROR)); @@ -1503,8 +1489,7 @@ pdq_interrupt( PDQ_CSR_WRITE(csrs, csr_host_int_type_0, PDQ_HOST_INT_XMT_DATA_FLUSH); } } - if (pdq->pdq_type == PDQ_DEFPA) - PDQ_CSR_WRITE(&pdq->pdq_pci_csrs, csr_pfi_status, 0x18); + PDQ_CSR_WRITE(&pdq->pdq_pci_csrs, csr_pfi_status, 0x18); } return progress; } @@ -1639,9 +1624,8 @@ pdq_initialize( * Initialize the CSR references. * the DEFAA (FutureBus+) skips a longword between registers */ - pdq_init_csrs(&pdq->pdq_csrs, bus, csr_base, pdq->pdq_type == PDQ_DEFAA ? 2 : 1); - if (pdq->pdq_type == PDQ_DEFPA) - pdq_init_pci_csrs(&pdq->pdq_pci_csrs, bus, csr_base, 1); + pdq_init_csrs(&pdq->pdq_csrs, bus, csr_base, 1); + pdq_init_pci_csrs(&pdq->pdq_pci_csrs, bus, csr_base, 1); PDQ_PRINTF(("PDQ CSRs: BASE = " PDQ_OS_CSR_FMT "\n", pdq->pdq_csrs.csr_base)); PDQ_PRINTF((" Port Reset = " PDQ_OS_CSR_FMT " [0x%08x]\n", @@ -1774,7 +1758,7 @@ pdq_initialize( if (state == PDQS_HALTED) { pdq_halt_code_t halt_code = PDQ_PSTS_HALT_ID(PDQ_CSR_READ(&pdq->pdq_csrs, csr_port_status)); printf("Halt code = %d (%s)\n", halt_code, pdq_halt_codes[halt_code]); - if (halt_code == PDQH_DMA_ERROR && pdq->pdq_type == PDQ_DEFPA) + if (halt_code == PDQH_DMA_ERROR) PDQ_PRINTF(("PFI status = 0x%x, Host 0 Fatal Interrupt = 0x%x\n", PDQ_CSR_READ(&pdq->pdq_pci_csrs, csr_pfi_status), PDQ_CSR_READ(&pdq->pdq_csrs, csr_host_int_type_0) & PDQ_HOST_INT_FATAL_ERROR)); Modified: head/sys/dev/pdq/pdq_freebsd.h ============================================================================== --- head/sys/dev/pdq/pdq_freebsd.h Thu Feb 16 21:57:02 2017 (r313833) +++ head/sys/dev/pdq/pdq_freebsd.h Thu Feb 16 21:57:08 2017 (r313834) @@ -86,10 +86,6 @@ extern devclass_t pdq_devclass; enum _pdq_type_t { PDQ_DEFPA, /* PCI-bus */ - PDQ_DEFEA, /* EISA-bus */ - PDQ_DEFTA, /* TurboChannel */ - PDQ_DEFAA, /* FutureBus+ */ - PDQ_DEFQA /* Q-bus */ }; #define sc_ifmedia ifmedia Modified: head/sys/dev/pdq/pdq_ifsubr.c ============================================================================== --- head/sys/dev/pdq/pdq_ifsubr.c Thu Feb 16 21:57:02 2017 (r313833) +++ head/sys/dev/pdq/pdq_ifsubr.c Thu Feb 16 21:57:08 2017 (r313834) @@ -459,6 +459,8 @@ pdq_ifattach(pdq_softc_t *sc, const pdq_ { struct ifnet *ifp; + KASSERT(type == PDQ_DEFPA, ("We only support PCI attachment.")); + ifp = PDQ_IFNET(sc) = if_alloc(IFT_FDDI); if (ifp == NULL) { device_printf(sc->dev, "can not if_alloc()\n"); Modified: head/sys/dev/pdq/pdqreg.h ============================================================================== --- head/sys/dev/pdq/pdqreg.h Thu Feb 16 21:57:02 2017 (r313833) +++ head/sys/dev/pdq/pdqreg.h Thu Feb 16 21:57:08 2017 (r313834) @@ -127,52 +127,6 @@ struct _pdq_pci_csrs_t { #define PDQ_PFI_STATUS_PDQ_INTR 0x10 /* PDQ Int received */ #define PDQ_PFI_STATUS_DMA_ABORT 0x08 /* PDQ DMA Abort asserted */ -#define PDQ_EISA_BURST_HOLDOFF 0x0040 -#define PDQ_EISA_SLOT_ID 0x0C80 -#define PDQ_EISA_SLOT_CTRL 0x0C84 -#define PDQ_EISA_MEM_ADD_CMP_0 0x0C85 -#define PDQ_EISA_MEM_ADD_CMP_1 0x0C86 -#define PDQ_EISA_MEM_ADD_CMP_2 0x0C87 -#define PDQ_EISA_MEM_ADD_HI_CMP_0 0x0C88 -#define PDQ_EISA_MEM_ADD_HI_CMP_1 0x0C89 -#define PDQ_EISA_MEM_ADD_HI_CMP_2 0x0C8A -#define PDQ_EISA_MEM_ADD_MASK_0 0x0C8B -#define PDQ_EISA_MEM_ADD_MASK_1 0x0C8C -#define PDQ_EISA_MEM_ADD_MASK_2 0x0C8D -#define PDQ_EISA_MEM_ADD_LO_CMP_0 0x0C8E -#define PDQ_EISA_MEM_ADD_LO_CMP_1 0x0C8F -#define PDQ_EISA_MEM_ADD_LO_CMP_2 0x0C90 -#define PDQ_EISA_IO_CMP_0_0 0x0C91 -#define PDQ_EISA_IO_CMP_0_1 0x0C92 -#define PDQ_EISA_IO_CMP_1_0 0x0C93 -#define PDQ_EISA_IO_CMP_1_1 0x0C94 -#define PDQ_EISA_IO_CMP_2_0 0x0C95 -#define PDQ_EISA_IO_CMP_2_1 0x0C96 -#define PDQ_EISA_IO_CMP_3_0 0x0C97 -#define PDQ_EISA_IO_CMP_3_1 0x0C98 -#define PDQ_EISA_IO_ADD_MASK_0_0 0x0C99 -#define PDQ_EISA_IO_ADD_MASK_0_1 0x0C9A -#define PDQ_EISA_IO_ADD_MASK_1_0 0x0C9B -#define PDQ_EISA_IO_ADD_MASK_1_1 0x0C9C -#define PDQ_EISA_IO_ADD_MASK_2_0 0x0C9D -#define PDQ_EISA_IO_ADD_MASK_2_1 0x0C9E -#define PDQ_EISA_IO_ADD_MASK_3_0 0x0C9F -#define PDQ_EISA_IO_ADD_MASK_3_1 0x0CA0 -#define PDQ_EISA_MOD_CONFIG_1 0x0CA1 -#define PDQ_EISA_MOD_CONFIG_2 0x0CA2 -#define PDQ_EISA_MOD_CONFIG_3 0x0CA3 -#define PDQ_EISA_MOD_CONFIG_4 0x0CA4 -#define PDQ_EISA_MOD_CONFIG_5 0x0CA5 -#define PDQ_EISA_MOD_CONFIG_6 0x0CA6 -#define PDQ_EISA_MOD_CONFIG_7 0x0CA7 -#define PDQ_EISA_DIP_SWITCH 0x0CA8 -#define PDQ_EISA_IO_CONFIG_STAT_0 0x0CA9 -#define PDQ_EISA_IO_CONFIG_STAT_1 0x0CAA -#define PDQ_EISA_DMA_CONFIG 0x0CAB -#define PDQ_EISA_INPUT_PORT 0x0CAC -#define PDQ_EISA_OUTPUT_PORT 0x0CAD -#define PDQ_EISA_FUNCTION_CTRL 0x0CAE - #define PDQ_TC_CSR_OFFSET 0x00100000 #define PDQ_TC_CSR_SPACE 0x0040 #define PDQ_FBUS_CSR_OFFSET 0x00200000 Modified: head/sys/dev/pdq/pdqvar.h ============================================================================== --- head/sys/dev/pdq/pdqvar.h Thu Feb 16 21:57:02 2017 (r313833) +++ head/sys/dev/pdq/pdqvar.h Thu Feb 16 21:57:08 2017 (r313834) @@ -53,10 +53,6 @@ typedef enum _pdq_state_t pdq_state_t; enum _pdq_type_t { PDQ_DEFPA, /* PCI-bus */ - PDQ_DEFEA, /* EISA-bus */ - PDQ_DEFTA, /* TurboChannel */ - PDQ_DEFAA, /* FutureBus+ */ - PDQ_DEFQA /* Q-bus */ }; #if defined(PDQTEST) From owner-svn-src-head@freebsd.org Thu Feb 16 21:57:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BFEDCE2472; Thu, 16 Feb 2017 21:57:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89C6710DB; Thu, 16 Feb 2017 21:57:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLvEct043781; Thu, 16 Feb 2017 21:57:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLvEP5043775; Thu, 16 Feb 2017 21:57:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162157.v1GLvEP5043775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 21:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313835 - in head: share/man/man4 sys/conf sys/dev/dpt sys/modules/dpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:57:17 -0000 Author: imp Date: Thu Feb 16 21:57:13 2017 New Revision: 313835 URL: https://svnweb.freebsd.org/changeset/base/313835 Log: Remove EISA support from dpt. Remove known EISA models from dpt.4. Remove EISA-only bits from dpt_scsi.c. Deleted: head/sys/dev/dpt/dpt_eisa.c Modified: head/share/man/man4/dpt.4 head/sys/conf/files head/sys/dev/dpt/dpt.h head/sys/dev/dpt/dpt_scsi.c head/sys/modules/dpt/Makefile Modified: head/share/man/man4/dpt.4 ============================================================================== --- head/share/man/man4/dpt.4 Thu Feb 16 21:57:08 2017 (r313834) +++ head/share/man/man4/dpt.4 Thu Feb 16 21:57:13 2017 (r313835) @@ -37,9 +37,6 @@ kernel configuration file: .Cd "device scbus" .Cd "device dpt" .Pp -For one or more EISA cards: -.Cd "device eisa" -.Pp For one or more PCI cards: .Cd "device pci" .Pp @@ -78,15 +75,15 @@ driver provides support for the followin .It DPT Smart Cache Plus .It -Smart Cache II (PM2?2?, PM2022 [EISA], PM2024/PM2124 [PCI]) (Gen2) +Smart Cache II (PM2?2?, PM2024/PM2124 [PCI]) (Gen2) .It Smart RAID II (PM3?2?, PM3021, PM3222) .It Smart Cache III (PM2?3?) .It -Smart RAID III (PM3?3?, PM3332 [EISA], PM3334UW [PCI]) (Gen3) +Smart RAID III (PM3?3?, PM3334UW [PCI]) (Gen3) .It -Smart Cache IV (PM2?4?, PM2042 [EISA], PM2044/PM2144 [PCI]) (Gen4) +Smart Cache IV (PM2?4?, PM2044/PM2144 [PCI]) (Gen4) .It Smart RAID IV .El Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 16 21:57:08 2017 (r313834) +++ head/sys/conf/files Thu Feb 16 21:57:13 2017 (r313835) @@ -1439,7 +1439,6 @@ dev/dcons/dcons_crom.c optional dcons_c dev/dcons/dcons_os.c optional dcons dev/de/if_de.c optional de pci dev/dme/if_dme.c optional dme -dev/dpt/dpt_eisa.c optional dpt eisa dev/dpt/dpt_pci.c optional dpt pci dev/dpt/dpt_scsi.c optional dpt dev/drm/ati_pcigart.c optional drm Modified: head/sys/dev/dpt/dpt.h ============================================================================== --- head/sys/dev/dpt/dpt.h Thu Feb 16 21:57:08 2017 (r313834) +++ head/sys/dev/dpt/dpt.h Thu Feb 16 21:57:13 2017 (r313835) @@ -147,17 +147,13 @@ typedef void *physaddr; #define min(a,b) ((a #include @@ -79,7 +78,7 @@ __FBSDID("$FreeBSD$"); #include -/* dpt_isa.c, dpt_eisa.c, and dpt_pci.c need this in a central place */ +/* dpt_isa.c, and dpt_pci.c need this in a central place */ devclass_t dpt_devclass; #define microtime_now dpt_time_now() @@ -107,9 +106,6 @@ devclass_t dpt_devclass; /* ================= Private Inline Function declarations ===================*/ static __inline int dpt_just_reset(dpt_softc_t * dpt); static __inline int dpt_raid_busy(dpt_softc_t * dpt); -#ifdef DEV_EISA -static __inline int dpt_pio_wait (u_int32_t, u_int, u_int, u_int); -#endif static __inline int dpt_wait(dpt_softc_t *dpt, u_int bits, u_int state); static __inline struct dpt_ccb* dptgetccb(struct dpt_softc *dpt); @@ -185,24 +181,6 @@ dpt_raid_busy(dpt_softc_t * dpt) return (0); } -#ifdef DEV_EISA -static __inline int -dpt_pio_wait (u_int32_t base, u_int reg, u_int bits, u_int state) -{ - int i; - u_int c; - - for (i = 0; i < 20000; i++) { /* wait 20ms for not busy */ - c = inb(base + reg) & bits; - if (!(c == state)) - return (0); - else - DELAY(50); - } - return (-1); -} -#endif - static __inline int dpt_wait(dpt_softc_t *dpt, u_int bits, u_int state) { @@ -392,96 +370,6 @@ dptallocccbs(dpt_softc_t *dpt) return (i); } -#ifdef DEV_EISA -dpt_conf_t * -dpt_pio_get_conf (u_int32_t base) -{ - static dpt_conf_t * conf; - u_int16_t * p; - int i; - - /* - * Allocate a dpt_conf_t - */ - if (!conf) { - conf = (dpt_conf_t *)malloc(sizeof(dpt_conf_t), - M_DEVBUF, M_NOWAIT | M_ZERO); - } - - /* - * If we didn't get one then we probably won't ever get one. - */ - if (!conf) { - printf("dpt: unable to allocate dpt_conf_t\n"); - return (NULL); - } - - /* - * Reset the controller. - */ - outb((base + HA_WCOMMAND), EATA_CMD_RESET); - - /* - * Wait for the controller to become ready. - * For some reason there can be -no- delays after calling reset - * before we wait on ready status. - */ - if (dpt_pio_wait(base, HA_RSTATUS, HA_SBUSY, 0)) { - printf("dpt: timeout waiting for controller to become ready\n"); - return (NULL); - } - - if (dpt_pio_wait(base, HA_RAUXSTAT, HA_ABUSY, 0)) { - printf("dpt: timetout waiting for adapter ready.\n"); - return (NULL); - } - - /* - * Send the PIO_READ_CONFIG command. - */ - outb((base + HA_WCOMMAND), EATA_CMD_PIO_READ_CONFIG); - - /* - * Read the data into the struct. - */ - p = (u_int16_t *)conf; - for (i = 0; i < (sizeof(dpt_conf_t) / 2); i++) { - - if (dpt_pio_wait(base, HA_RSTATUS, HA_SDRQ, 0)) { - if (bootverbose) - printf("dpt: timeout in data read.\n"); - return (NULL); - } - - (*p) = inw(base + HA_RDATA); - p++; - } - - if (inb(base + HA_RSTATUS) & HA_SERROR) { - if (bootverbose) - printf("dpt: error reading configuration data.\n"); - return (NULL); - } - -#define BE_EATA_SIGNATURE 0x45415441 -#define LE_EATA_SIGNATURE 0x41544145 - - /* - * Test to see if we have a valid card. - */ - if ((conf->signature == BE_EATA_SIGNATURE) || - (conf->signature == LE_EATA_SIGNATURE)) { - - while (inb(base + HA_RSTATUS) & HA_SDRQ) { - inw(base + HA_RDATA); - } - - return (conf); - } - return (NULL); -} -#endif - /* * Read a configuration page into the supplied dpt_cont_t buffer. */ @@ -1352,8 +1240,6 @@ dpt_init(struct dpt_softc *dpt) else dpt->immediate_support = 0; - dpt->broken_INQUIRY = FALSE; - dpt->cplen = ntohl(conf.cplen); dpt->cppadlen = ntohs(conf.cppadlen); dpt->max_dccbs = ntohs(conf.queuesiz); Modified: head/sys/modules/dpt/Makefile ============================================================================== --- head/sys/modules/dpt/Makefile Thu Feb 16 21:57:08 2017 (r313834) +++ head/sys/modules/dpt/Makefile Thu Feb 16 21:57:13 2017 (r313835) @@ -7,10 +7,8 @@ SYSDIR?=${.CURDIR}/../.. KMOD= dpt SRCS= dpt_scsi.c dpt.h \ dpt_pci.c pci_if.h \ - opt_dpt.h opt_eisa.h \ + opt_dpt.h \ opt_cam.h opt_scsi.h \ device_if.h bus_if.h -SRCS.DEV_EISA= dpt_eisa.c eisa_if.h - .include From owner-svn-src-head@freebsd.org Thu Feb 16 21:57:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1366BCE24A0; Thu, 16 Feb 2017 21:57:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52E3A116B; Thu, 16 Feb 2017 21:57:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLvKp6043838; Thu, 16 Feb 2017 21:57:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLvJmR043832; Thu, 16 Feb 2017 21:57:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162157.v1GLvJmR043832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 21:57:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313836 - in head: share/man/man4 sys/conf sys/dev/aic7xxx sys/modules/aic7xxx/ahc sys/modules/aic7xxx/ahc/ahc_eisa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:57:23 -0000 Author: imp Date: Thu Feb 16 21:57:19 2017 New Revision: 313836 URL: https://svnweb.freebsd.org/changeset/base/313836 Log: Remove EISA support from ahc driver. The AIC-7770 chip can be on ISA, VesaLocalBus or EISA. Internally, EISA and ISA are handled the same, with VL being handled slightly differently. To avoid too much code churn, retain the EISA name, despite it being used only for ISA bus. When it is on the ISA bus, weird gymnastics are required with EISA-space address accesses as well. Remove known models from the ahc man page. Remove ahc_eisa module. Deleted: head/sys/dev/aic7xxx/ahc_eisa.c head/sys/modules/aic7xxx/ahc/ahc_eisa/Makefile Modified: head/share/man/man4/ahc.4 head/sys/conf/files head/sys/dev/aic7xxx/aic7770.c head/sys/dev/aic7xxx/aic7xxx.h head/sys/dev/aic7xxx/aic7xxx_osm.h head/sys/modules/aic7xxx/ahc/Makefile Modified: head/share/man/man4/ahc.4 ============================================================================== --- head/share/man/man4/ahc.4 Thu Feb 16 21:57:13 2017 (r313835) +++ head/share/man/man4/ahc.4 Thu Feb 16 21:57:19 2017 (r313836) @@ -26,12 +26,12 @@ .\" .\" $FreeBSD$ .\" -.Dd July 13, 2008 +.Dd February 15, 2017 .Dt AHC 4 .Os .Sh NAME .Nm ahc -.Nd Adaptec VL/EISA/PCI SCSI host adapter driver +.Nd Adaptec VL/ISA/PCI SCSI host adapter driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -40,9 +40,6 @@ kernel configuration file: .Cd "device scbus" .Cd "device ahc" .Pp -For one or more VL/EISA cards: -.Cd "device eisa" -.Pp For one or more PCI cards: .Cd "device pci" .Pp @@ -58,7 +55,6 @@ module at boot time, place the following .Xr loader.conf 5 : .Bd -literal -offset indent ahc_load="YES" -ahc_eisa_load="YES" ahc_isa_load="YES" ahc_pci_load="YES" .Ed @@ -98,45 +94,19 @@ A value of 0x8a enables it for units 1, Per target configuration performed in the .Tn SCSI-Select menu, accessible at boot -in -.No non- Ns Tn EISA -models, -or through an -.Tn EISA -configuration utility for -.Tn EISA -models, is honored by this driver. This includes synchronous/asynchronous transfers, maximum synchronous negotiation rate, wide transfers, disconnection, -the host adapter's SCSI ID, -and, -in the case of -.Tn EISA -Twin Channel controllers, -the primary channel selection. +the host adapter's SCSI ID. For systems that store non-volatile settings in a system specific manner rather than a serial eeprom directly connected to the aic7xxx controller, the .Tn BIOS must be enabled for the driver to access this information. -This restriction applies to all -.Tn EISA -and many motherboard configurations. -.Pp -Note that I/O addresses are determined automatically by the probe routines, -but care should be taken when using a 284x -.Pq Tn VESA No local bus controller -in an -.Tn EISA -system. -The jumpers setting the I/O area for the 284x should match the -.Tn EISA -slot into which the card is inserted to prevent conflicts with other -.Tn EISA -cards. +This restriction applies to +many chip-down motherboard configurations. .Pp Performance and feature sets vary throughout the aic7xxx product line. The following table provides a comparison of the different chips supported @@ -147,9 +117,9 @@ Note that wide and twin channel features by a particular chip, may be disabled in a particular motherboard or card design. .Bd -ragged -offset indent -.Bl -column "aic7895CX" "MIPSX" "EISA/VLX" "MaxSyncX" "MaxWidthX" "SCBsX" "2 3 4 5 6 7 8X" +.Bl -column "aic7895CX" "MIPSX" "PCI/64X" "MaxSyncX" "MaxWidthX" "SCBsX" "2 3 4 5 6 7 8X" .It Em "Chip" Ta "MIPS" Ta "Bus" Ta "MaxSync" Ta "MaxWidth" Ta "SCBs" Ta "Features" -.It "aic7770" Ta "10" Ta "EISA/VL" Ta "10MHz" Ta "16Bit" Ta "4" Ta "1" +.It "aic7770" Ta "10" Ta "VL" Ta "10MHz" Ta "16Bit" Ta "4" Ta "1" .It "aic7850" Ta "10" Ta "PCI/32" Ta "10MHz" Ta "8Bit" Ta "3" Ta "" .It "aic7860" Ta "10" Ta "PCI/32" Ta "20MHz" Ta "8Bit" Ta "3" Ta "" .It "aic7870" Ta "10" Ta "PCI/32" Ta "10MHz" Ta "16Bit" Ta "16" Ta "" @@ -254,9 +224,6 @@ Adaptec .Tn 274X(T) .It Adaptec -.Tn 284X -.It -Adaptec .Tn 2910 .It Adaptec Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 16 21:57:13 2017 (r313835) +++ head/sys/conf/files Thu Feb 16 21:57:19 2017 (r313836) @@ -698,7 +698,6 @@ dev/ahci/ahciem.c optional ahci dev/ahci/ahci_pci.c optional ahci pci dev/aic/aic.c optional aic dev/aic/aic_pccard.c optional aic pccard -dev/aic7xxx/ahc_eisa.c optional ahc eisa dev/aic7xxx/ahc_isa.c optional ahc isa dev/aic7xxx/ahc_pci.c optional ahc pci \ compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}" Modified: head/sys/dev/aic7xxx/aic7770.c ============================================================================== --- head/sys/dev/aic7xxx/aic7770.c Thu Feb 16 21:57:13 2017 (r313835) +++ head/sys/dev/aic7xxx/aic7770.c Thu Feb 16 21:57:19 2017 (r313836) @@ -64,7 +64,7 @@ static int aic7770_suspend(struct ahc_so static int aic7770_resume(struct ahc_softc *ahc); static int aha2840_load_seeprom(struct ahc_softc *ahc); static ahc_device_setup_t ahc_aic7770_VL_setup; -static ahc_device_setup_t ahc_aic7770_EISA_setup; +static ahc_device_setup_t ahc_aic7770_EISA_setup; /* Really just ISA */ static ahc_device_setup_t ahc_aic7770_setup; struct aic7770_identity aic7770_ident_table[] = Modified: head/sys/dev/aic7xxx/aic7xxx.h ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx.h Thu Feb 16 21:57:13 2017 (r313835) +++ head/sys/dev/aic7xxx/aic7xxx.h Thu Feb 16 21:57:19 2017 (r313836) @@ -207,7 +207,7 @@ typedef enum { AHC_AIC7892 = 0x000c, AHC_AIC7899 = 0x000d, AHC_VL = 0x0100, /* Bus type VL */ - AHC_EISA = 0x0200, /* Bus type EISA */ + AHC_EISA = 0x0200, /* Bus type EISA/ISA */ AHC_PCI = 0x0400, /* Bus type PCI */ AHC_BUS_MASK = 0x0F00 } ahc_chip; @@ -1170,7 +1170,7 @@ struct ahc_pci_identity { extern struct ahc_pci_identity ahc_pci_ident_table[]; extern const u_int ahc_num_pci_devs; -/***************************** VL/EISA Declarations ***************************/ +/*************************** VL/EISA/ISA Declarations *************************/ struct aic7770_identity { uint32_t full_id; uint32_t id_mask; @@ -1197,7 +1197,7 @@ int ahc_pci_config(struct ahc_softc * struct ahc_pci_identity *); int ahc_pci_test_register_access(struct ahc_softc *); -/*************************** EISA/VL Front End ********************************/ +/*************************** ISA/EISA/VL Front End ****************************/ struct aic7770_identity *aic7770_find_device(uint32_t); int aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *, Modified: head/sys/dev/aic7xxx/aic7xxx_osm.h ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx_osm.h Thu Feb 16 21:57:13 2017 (r313835) +++ head/sys/dev/aic7xxx/aic7xxx_osm.h Thu Feb 16 21:57:19 2017 (r313836) @@ -224,7 +224,7 @@ int ahc_pci_map_registers(struct ahc_sof #define ahc_pci_map_int ahc_map_int #endif /*AIC_PCI_CONFIG*/ -/******************************** VL/EISA *************************************/ +/******************************** VL/EISA/ISA *********************************/ int aic7770_map_registers(struct ahc_softc *ahc, u_int port); static __inline int aic7770_map_int(struct ahc_softc *, int); @@ -233,9 +233,9 @@ aic7770_map_int(struct ahc_softc *ahc, i { /* * The IRQ is unused in the FreeBSD - * implementation since the EISA and - * ISA attachments register the IRQ - * with newbus before the core is called. + * implementation since the ISA attachment + * registers the IRQ with newbus before + * the core is called. */ return ahc_map_int(ahc); } Modified: head/sys/modules/aic7xxx/ahc/Makefile ============================================================================== --- head/sys/modules/aic7xxx/ahc/Makefile Thu Feb 16 21:57:13 2017 (r313835) +++ head/sys/modules/aic7xxx/ahc/Makefile Thu Feb 16 21:57:19 2017 (r313836) @@ -6,9 +6,6 @@ SYSDIR?=${.CURDIR}/../../.. .PATH: ${SYSDIR}/dev/aic7xxx KMOD= ahc -.if ${MK_EISA} != "no" -SUBDIR+= ahc_eisa -.endif SUBDIR+= ahc_isa ahc_pci GENSRCS= aic7xxx_seq.h aic7xxx_reg.h From owner-svn-src-head@freebsd.org Thu Feb 16 21:57:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F965CE24D1; Thu, 16 Feb 2017 21:57:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AD1811C6; Thu, 16 Feb 2017 21:57:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLvPpb043899; Thu, 16 Feb 2017 21:57:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLvPQH043894; Thu, 16 Feb 2017 21:57:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162157.v1GLvPQH043894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 21:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313837 - in head: share/man/man4 sys/conf sys/dev/buslogic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:57:28 -0000 Author: imp Date: Thu Feb 16 21:57:25 2017 New Revision: 313837 URL: https://svnweb.freebsd.org/changeset/base/313837 Log: Remove EISA support from Buslogic (bt) cards. Remove known models form man page. Tweak comments to not refer to EISA scenarios now that it is no longer supported. Remove unused enum. Deleted: head/sys/dev/buslogic/bt_eisa.c Modified: head/share/man/man4/bt.4 head/sys/conf/files head/sys/dev/buslogic/bt.c head/sys/dev/buslogic/bt_isa.c head/sys/dev/buslogic/btreg.h Modified: head/share/man/man4/bt.4 ============================================================================== --- head/share/man/man4/bt.4 Thu Feb 16 21:57:19 2017 (r313836) +++ head/share/man/man4/bt.4 Thu Feb 16 21:57:25 2017 (r313837) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 18, 2006 +.Dd February 15, 2017 .Dt BT 4 .Os .Sh NAME @@ -66,9 +66,6 @@ BT-946C PCI 100 Fast SCSI-2 BT-956C PCI 100 Wide Fast SCSI-2 BT-956CD PCI 100 Wide Differential Fast SCSI-2 BT-445C VLB 100 Fast SCSI-2 -BT-747C EISA 100 Fast SCSI-2 -BT-757C EISA 100 Wide Fast SCSI-2 -BT-757CD EISA 100 Wide Differential Fast SCSI-2 BT-545C ISA 50 Fast SCSI-2 BT-540CF ISA 50 Fast SCSI-2 .El @@ -77,20 +74,14 @@ MultiMaster "S" Series Host Adapters: .Bl -column "BT-956CD " "ISA " "Commands " "Description" .Em "Adapter" Ta Em "Bus" Ta Em "Commands" Ta Em "Description" BT-445S VLB 30 Fast SCSI-2 -BT-747S EISA 30 Fast SCSI-2 -BT-747D EISA 30 Differential Fast SCSI-2 -BT-757S EISA 30 Wide Fast SCSI-2 -BT-757D EISA 30 Wide Differential Fast SCSI-2 BT-545S ISA 30 Fast SCSI-2 BT-542D ISA 30 Differential Fast SCSI-2 -BT-742A EISA 30 SCSI-2 (742A revision H) BT-542B ISA 30 SCSI-2 (542B revision H) .El .Pp MultiMaster "A" Series Host Adapters: .Bl -column "BT-956CD " "ISA " "Commands " "Description" .Em "Adapter" Ta Em "Bus" Ta Em "Commands" Ta Em "Description" -BT-742A EISA 30 SCSI-2 (742A revisions A - G) BT-542B ISA 30 SCSI-2 (542B revisions A - G) .El .Ed @@ -135,24 +126,6 @@ BusLogic BT-545S .It BusLogic/BusTek BT-640 .It -BusLogic BT-742A -.It -BusLogic BT-742A -.It -BusLogic BT-747C -.It -BusLogic BT-747D -.It -BusLogic BT-747S -.It -BusLogic BT-757C -.It -BusLogic BT-757CD -.It -BusLogic BT-757D -.It -BusLogic BT-757S -.It BusLogic BT-946C .It BusLogic BT-948 @@ -167,11 +140,6 @@ BusLogic BT-958D .It Storage Dimensions SDC3211B / SDC3211F .El -.Pp -AMI FastDisk Host Adapters that are true BusLogic MultiMaster clones -are also supported by the -.Nm -driver. .Sh SEE ALSO .Xr cd 4 , .Xr da 4 , Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 16 21:57:19 2017 (r313836) +++ head/sys/conf/files Thu Feb 16 21:57:25 2017 (r313837) @@ -1259,7 +1259,6 @@ dev/bnxt/bnxt_sysctl.c optional bnxt if dev/bnxt/bnxt_txrx.c optional bnxt iflib pci dev/bnxt/if_bnxt.c optional bnxt iflib pci dev/buslogic/bt.c optional bt -dev/buslogic/bt_eisa.c optional bt eisa dev/buslogic/bt_isa.c optional bt isa dev/buslogic/bt_pci.c optional bt pci dev/bwi/bwimac.c optional bwi Modified: head/sys/dev/buslogic/bt.c ============================================================================== --- head/sys/dev/buslogic/bt.c Thu Feb 16 21:57:19 2017 (r313836) +++ head/sys/dev/buslogic/bt.c Thu Feb 16 21:57:25 2017 (r313837) @@ -3,7 +3,6 @@ * Product specific probe and attach routines can be found in: * sys/dev/buslogic/bt_isa.c BT-54X, BT-445 cards * sys/dev/buslogic/bt_mca.c BT-64X, SDC3211B, SDC3211F - * sys/dev/buslogic/bt_eisa.c BT-74X, BT-75x cards, SDC3222F * sys/dev/buslogic/bt_pci.c BT-946, BT-948, BT-956, BT-958 cards * * Copyright (c) 1998, 1999 Justin T. Gibbs. @@ -169,7 +168,7 @@ static void bttimeout(void *arg); * XXX * Do our own re-probe protection until a configuration * manager can do it for us. This ensures that we don't - * reprobe a card already found by the EISA or PCI probes. + * reprobe a card already found by the PCI probes. */ struct bt_isa_port bt_isa_ports[] = { @@ -313,7 +312,6 @@ bt_port_probe(device_t dev, struct bt_pr return (1); } } else { - /* VL/EISA/PCI DMA */ info->drq = -1; } switch (config_data.irq) { @@ -482,7 +480,6 @@ bt_fetch_adapter_info(device_t dev) * BT-542B/742A (revision H) * 2.xx BusLogic "A" Series Host Adapters: * BT-542B/742A (revision G and below) - * 0.xx AMI FastDisk VLB/EISA BusLogic Clone Host Adapter */ length_param = sizeof(esetup_info); error = bt_cmd(bt, BOP_INQUIRE_ESETUP_INFO, &length_param, /*parmlen*/1, @@ -499,19 +496,6 @@ bt_fetch_adapter_info(device_t dev) if (esetup_info.bus_type == 'A' && bt->firmware_ver[0] == '2') { snprintf(bt->model, sizeof(bt->model), "542B"); - } else if (esetup_info.bus_type == 'E' - && bt->firmware_ver[0] == '2') { - - /* - * The 742A seems to object if its mailboxes are - * allocated above the 16MB mark. - */ - bt->mailbox_addrlimit = BUS_SPACE_MAXADDR_24BIT; - snprintf(bt->model, sizeof(bt->model), "742A"); - } else if (esetup_info.bus_type == 'E' - && bt->firmware_ver[0] == '0') { - /* AMI FastDisk EISA Series 441 0.x */ - snprintf(bt->model, sizeof(bt->model), "747A"); } else { ha_model_data_t model_data; int i; Modified: head/sys/dev/buslogic/bt_isa.c ============================================================================== --- head/sys/dev/buslogic/bt_isa.c Thu Feb 16 21:57:19 2017 (r313836) +++ head/sys/dev/buslogic/bt_isa.c Thu Feb 16 21:57:25 2017 (r313837) @@ -150,7 +150,7 @@ bt_isa_probe(device_t dev) /* * Ensure this port has not already been claimed already - * by a PCI, EISA or ISA adapter. + * by a PCI, ISA adapter. */ if (bt_check_probed_iop(ioport) != 0) continue; Modified: head/sys/dev/buslogic/btreg.h ============================================================================== --- head/sys/dev/buslogic/btreg.h Thu Feb 16 21:57:19 2017 (r313836) +++ head/sys/dev/buslogic/btreg.h Thu Feb 16 21:57:25 2017 (r313837) @@ -4,7 +4,6 @@ * attach routines can be found in: * sys/dev/buslogic/bt_isa.c BT-54X, BT-445 cards * sys/dev/buslogic/bt_mca.c BT-64X, SDC3211B, SDC3211F - * sys/dev/buslogic/bt_eisa.c BT-74X, BT-75x cards, SDC3222F * sys/dev/buslogic/bt_pci.c BT-946, BT-948, BT-956, BT-958 cards * * Copyright (c) 1998, 1999 Justin T. Gibbs. @@ -238,15 +237,6 @@ typedef struct { sync : 1; } targ_syncinfo_t; -typedef enum { - HAB_ISA = 'A', - HAB_MCA = 'B', - HAB_EISA = 'C', - HAB_NUBUS = 'D', - HAB_VESA = 'E', - HAB_PCI = 'F' -} ha_type_t; - typedef struct { u_int8_t initiate_sync : 1, parity_enable : 1, From owner-svn-src-head@freebsd.org Thu Feb 16 21:57:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4A2DCE24FB; Thu, 16 Feb 2017 21:57:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96740122A; Thu, 16 Feb 2017 21:57:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLvUrF043951; Thu, 16 Feb 2017 21:57:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLvU41043950; Thu, 16 Feb 2017 21:57:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162157.v1GLvU41043950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 21:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313838 - in head/sys: conf dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:57:32 -0000 Author: imp Date: Thu Feb 16 21:57:30 2017 New Revision: 313838 URL: https://svnweb.freebsd.org/changeset/base/313838 Log: Remove PCI/EISA bridge support. But keep knowing that a chip is this kind of bridge since we know for other types of unsupported bridges as well. Deleted: head/sys/dev/pci/eisa_pci.c Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 16 21:57:25 2017 (r313837) +++ head/sys/conf/files Thu Feb 16 21:57:30 2017 (r313838) @@ -2389,7 +2389,6 @@ dev/pccbb/pccbb.c optional cbb dev/pccbb/pccbb_isa.c optional cbb isa dev/pccbb/pccbb_pci.c optional cbb pci dev/pcf/pcf.c optional pcf -dev/pci/eisa_pci.c optional pci eisa dev/pci/fixup_pci.c optional pci dev/pci/hostb_pci.c optional pci dev/pci/ignore_pci.c optional pci From owner-svn-src-head@freebsd.org Thu Feb 16 21:57:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F862CE254C; Thu, 16 Feb 2017 21:57:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C27F112DD; Thu, 16 Feb 2017 21:57:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GLvaJZ044014; Thu, 16 Feb 2017 21:57:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GLvZYn044003; Thu, 16 Feb 2017 21:57:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162157.v1GLvZYn044003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 21:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313839 - in head: share/man/man5 share/man/man9 share/mk sys/conf sys/dev/eisa sys/i386/conf sys/x86/x86 tools/build/options tools/kerneldoc/subsys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 21:57:38 -0000 Author: imp Date: Thu Feb 16 21:57:35 2017 New Revision: 313839 URL: https://svnweb.freebsd.org/changeset/base/313839 Log: Remove EISA bus support for add-in cards. Remove related kernel and compile options. Remove doxygen pointers to now deleted files. Remove EISA and VME as examples in bus_space.9. Retained EISA mode code for IO PIC and MPTABLES because that's not EISA bus, per se, and some people have abused EISA to mean "EISA-like behavior as opposed to ISA" rather than using it for EISA add-in cards. Relnotes: yes Deleted: head/sys/dev/eisa/eisa_if.m head/sys/dev/eisa/eisaconf.c head/sys/dev/eisa/eisaconf.h head/tools/build/options/WITH_EISA head/tools/kerneldoc/subsys/Doxyfile-dev_eisa Modified: head/share/man/man5/src.conf.5 head/share/man/man9/bus_space.9 head/share/mk/src.opts.mk head/sys/conf/NOTES head/sys/conf/config.mk head/sys/conf/files head/sys/conf/options head/sys/i386/conf/NOTES head/sys/x86/x86/legacy.c Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Feb 16 21:57:30 2017 (r313838) +++ head/share/man/man5/src.conf.5 Thu Feb 16 21:57:35 2017 (r313839) @@ -653,9 +653,6 @@ and .Pp It is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386. -.It Va WITH_EISA -.\" from FreeBSD: head/tools/build/options/WITH_EISA 264654 2014-04-18 16:53:06Z imp -Set to build EISA kernel modules. .It Va WITHOUT_ELFTOOLCHAIN_BOOTSTRAP .\" from FreeBSD: head/tools/build/options/WITHOUT_ELFTOOLCHAIN_BOOTSTRAP 295491 2016-02-11 00:14:00Z emaste Set to not build ELF Tool Chain tools Modified: head/share/man/man9/bus_space.9 ============================================================================== --- head/share/man/man9/bus_space.9 Thu Feb 16 21:57:30 2017 (r313838) +++ head/share/man/man9/bus_space.9 Thu Feb 16 21:57:35 2017 (r313839) @@ -853,8 +853,8 @@ Some implementations may keep track of u bus spaces and refuse to allow duplicate allocations. This is encouraged for bus spaces which have no notion of slot-specific space addressing, -such as ISA and VME, and for spaces which coexist with those spaces -(e.g.\& EISA and PCI memory and I/O spaces co-existing with ISA memory and +such as ISA, and for spaces which coexist with those spaces +(e.g.\& PCI memory and I/O spaces co-existing with ISA memory and I/O spaces). .Pp Mapped regions may contain areas for which there is no device on the Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Feb 16 21:57:30 2017 (r313838) +++ head/share/mk/src.opts.mk Thu Feb 16 21:57:35 2017 (r313839) @@ -183,7 +183,6 @@ __DEFAULT_NO_OPTIONS = \ BSD_GREP \ CLANG_EXTRAS \ DTRACE_TESTS \ - EISA \ HESIOD \ LIBSOFT \ NAND \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Feb 16 21:57:30 2017 (r313838) +++ head/sys/conf/NOTES Thu Feb 16 21:57:35 2017 (r313839) @@ -1429,7 +1429,7 @@ options PCI_IOV # PCI SR-IOV support # HARDWARE DEVICE CONFIGURATION # For ISA the required hints are listed. -# EISA, PCI, CardBus, SD/MMC and pccard are self identifying buses, so +# PCI, CardBus, SD/MMC and pccard are self identifying buses, so # no hints are needed. # @@ -1556,7 +1556,7 @@ options TERMINAL_KERN_ATTR=(FG_LIGHTRED # trm: Tekram DC395U/UW/F DC315U adapters. # -# Note that the order is important in order for Buslogic ISA/EISA cards to be +# Note that the order is important in order for Buslogic ISA cards to be # probed correctly. # device bt @@ -2074,7 +2074,7 @@ device xmphy # XaQti XMAC II # in Dell Latitude laptop docking stations. # Also supported: 3Com 3c980(C)-TX, 3Com 3cSOHO100-TX, 3Com 3c450-TX -# Order for ISA/EISA devices is important here +# Order for ISA devices is important here device cm hint.cm.0.at="isa" Modified: head/sys/conf/config.mk ============================================================================== --- head/sys/conf/config.mk Thu Feb 16 21:57:30 2017 (r313838) +++ head/sys/conf/config.mk Thu Feb 16 21:57:35 2017 (r313839) @@ -23,10 +23,6 @@ opt_inet6.h: opt_ratelimit.h: @echo "#define RATELIMIT 1" > ${.TARGET} .endif -.if ${MK_EISA} != "no" -opt_eisa.h: - @echo "#define DEV_EISA 1" > ${.TARGET} -.endif opt_mrouting.h: echo "#define MROUTING 1" > ${.TARGET} opt_natm.h: @@ -49,9 +45,6 @@ KERN_OPTS+= INET TCP_OFFLOAD .if ${MK_INET6_SUPPORT} != "no" KERN_OPTS+= INET6 .endif -.if ${MK_EISA} != "no" -KERN_OPTS+= DEV_EISA -.endif .elif !defined(KERN_OPTS) KERN_OPTS!=cat ${KERNBUILDDIR}/opt*.h | awk '{print $$2;}' | sort -u .export KERN_OPTS Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 16 21:57:30 2017 (r313838) +++ head/sys/conf/files Thu Feb 16 21:57:35 2017 (r313839) @@ -1554,8 +1554,6 @@ dev/ed/if_ed_rtl80x9.c optional ed dev/ed/if_ed_pccard.c optional ed pccard dev/ed/if_ed_pci.c optional ed pci dev/efidev/efidev.c optional efirt -dev/eisa/eisa_if.m standard -dev/eisa/eisaconf.c optional eisa dev/e1000/if_em.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/em_txrx.c optional em \ Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Feb 16 21:57:30 2017 (r313838) +++ head/sys/conf/options Thu Feb 16 21:57:35 2017 (r313839) @@ -732,10 +732,6 @@ DEV_RANDOM opt_global.h DEV_SPLASH opt_splash.h DEV_VLAN opt_vlan.h -# EISA support -DEV_EISA opt_eisa.h -EISA_SLOTS opt_eisa.h - # ed driver ED_HPP opt_ed.h ED_3C503 opt_ed.h Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Thu Feb 16 21:57:30 2017 (r313838) +++ head/sys/i386/conf/NOTES Thu Feb 16 21:57:35 2017 (r313839) @@ -337,22 +337,6 @@ options MAXMEM=(128*1024) #options BROKEN_KEYBOARD_RESET # -# EISA bus -# -# The EISA bus device is `eisa'. It provides auto-detection and -# configuration support for all devices on the EISA bus. - -device eisa - -# By default, only 10 EISA slots are probed, since the slot numbers -# above clash with the configuration address space of the PCI subsystem, -# and the EISA probe is not very smart about this. This is sufficient -# for most machines, but in particular the HP NetServer LC series comes -# with an onboard AIC7770 dual-channel SCSI controller on EISA slot #11, -# thus you need to bump this figure to 12 for them. -options EISA_SLOTS=12 - -# # AGP GART support device agp Modified: head/sys/x86/x86/legacy.c ============================================================================== --- head/sys/x86/x86/legacy.c Thu Feb 16 21:57:30 2017 (r313838) +++ head/sys/x86/x86/legacy.c Thu Feb 16 21:57:35 2017 (r313839) @@ -27,9 +27,6 @@ * SUCH DAMAGE. */ -#ifdef __i386__ -#include "opt_eisa.h" -#endif #include __FBSDID("$FreeBSD$"); @@ -128,17 +125,9 @@ legacy_attach(device_t dev) bus_generic_attach(dev); /* - * If we didn't see EISA or ISA on a pci bridge, create some + * If we didn't see ISA on a pci bridge, create some * connection points now so they show up "on motherboard". */ -#ifdef DEV_EISA - if (!devclass_get_device(devclass_find("eisa"), 0)) { - child = BUS_ADD_CHILD(dev, 0, "eisa", 0); - if (child == NULL) - panic("legacy_attach eisa"); - device_probe_and_attach(child); - } -#endif if (!devclass_get_device(devclass_find("isa"), 0)) { child = BUS_ADD_CHILD(dev, 0, "isa", 0); if (child == NULL) From owner-svn-src-head@freebsd.org Thu Feb 16 22:29:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9F34CE2074; Thu, 16 Feb 2017 22:29:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76E402EFF; Thu, 16 Feb 2017 22:29:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GMTb4C056143; Thu, 16 Feb 2017 22:29:37 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GMTb3X056142; Thu, 16 Feb 2017 22:29:37 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201702162229.v1GMTb3X056142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 16 Feb 2017 22:29:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313840 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 22:29:38 -0000 Author: gjb Date: Thu Feb 16 22:29:37 2017 New Revision: 313840 URL: https://svnweb.freebsd.org/changeset/base/313840 Log: Fix the hardware.html build. Sponsored by: The FreeBSD Foundation 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 Thu Feb 16 21:57:35 2017 (r313839) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Feb 16 22:29:37 2017 (r313840) @@ -618,8 +618,6 @@ &hwlist.aha; - &hwlist.ahb; - &hwlist.ahc; &hwlist.ahci; From owner-svn-src-head@freebsd.org Thu Feb 16 23:05:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44A44CE2E2B; Thu, 16 Feb 2017 23:05:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 057441533; Thu, 16 Feb 2017 23:05:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GN5L44071963; Thu, 16 Feb 2017 23:05:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GN5LjX071961; Thu, 16 Feb 2017 23:05:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201702162305.v1GN5LjX071961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 16 Feb 2017 23:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313841 - in head/sys/cddl/dev/dtrace: amd64 i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 23:05:22 -0000 Author: markj Date: Thu Feb 16 23:05:20 2017 New Revision: 313841 URL: https://svnweb.freebsd.org/changeset/base/313841 Log: Prevent CPU migration when checking the DTrace nofault flag on x86. dtrace_trap() consumes page and protection faults triggered by code running in DTrace probe context. Such faults occur with interrupts disabled and are detected using a per-CPU flag. Regular faults cause dtrace_trap() to be called with interrupts enabled, and nothing was ensuring that the flag was read from the correct CPU. This may result in dtrace_trap() consuming unrelated page and protection faults when DTrace is enabled, causing the fault handler to return without actually having handled the fault. Diagnosed by: Ryan Libby MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Thu Feb 16 22:29:37 2017 (r313840) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Thu Feb 16 23:05:20 2017 (r313841) @@ -384,6 +384,8 @@ dtrace_gethrestime(void) int dtrace_trap(struct trapframe *frame, u_int type) { + uint16_t nofault; + /* * A trap can occur while DTrace executes a probe. Before * executing the probe, DTrace blocks re-scheduling and sets @@ -393,7 +395,12 @@ dtrace_trap(struct trapframe *frame, u_i * * Check if DTrace has enabled 'no-fault' mode: */ - if ((cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT) != 0) { + sched_pin(); + nofault = cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT; + sched_unpin(); + if (nofault) { + KASSERT((read_rflags() & PSL_I) == 0, ("interrupts enabled")); + /* * There are only a couple of trap types that are expected. * All the rest will be handled in the usual way. Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Thu Feb 16 22:29:37 2017 (r313840) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Thu Feb 16 23:05:20 2017 (r313841) @@ -386,6 +386,8 @@ dtrace_gethrestime(void) int dtrace_trap(struct trapframe *frame, u_int type) { + uint16_t nofault; + /* * A trap can occur while DTrace executes a probe. Before * executing the probe, DTrace blocks re-scheduling and sets @@ -395,7 +397,12 @@ dtrace_trap(struct trapframe *frame, u_i * * Check if DTrace has enabled 'no-fault' mode: */ - if ((cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT) != 0) { + sched_pin(); + nofault = cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT; + sched_unpin(); + if (nofault) { + KASSERT((read_eflags() & PSL_I) == 0, ("interrupts enabled")); + /* * There are only a couple of trap types that are expected. * All the rest will be handled in the usual way. From owner-svn-src-head@freebsd.org Thu Feb 16 23:38:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 980D2CE25C3; Thu, 16 Feb 2017 23:38:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 535B412FB; Thu, 16 Feb 2017 23:38:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1GNcUXT084192; Thu, 16 Feb 2017 23:38:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1GNcU0p084191; Thu, 16 Feb 2017 23:38:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702162338.v1GNcU0p084191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 16 Feb 2017 23:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313842 - head/share/examples/drivers X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 23:38:31 -0000 Author: imp Date: Thu Feb 16 23:38:30 2017 New Revision: 313842 URL: https://svnweb.freebsd.org/changeset/base/313842 Log: Remove EISA reference here Modified: head/share/examples/drivers/README Modified: head/share/examples/drivers/README ============================================================================== --- head/share/examples/drivers/README Thu Feb 16 23:05:20 2017 (r313841) +++ head/share/examples/drivers/README Thu Feb 16 23:38:30 2017 (r313842) @@ -25,7 +25,7 @@ There are presently two scripts. One for making a real device driver for ISA devices, and one for making a device driver for pseudo devices (e.g. /dev/null). Hopefully they will be joined by similar scripts for creating -skeletons for PCI and EISA devices as well. +skeletons for PCI devices as well. Give them a single argument: the name of the driver. They will use this given name in many places within the driver, From owner-svn-src-head@freebsd.org Fri Feb 17 00:16:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03364CE1270; Fri, 17 Feb 2017 00:16:47 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x235.google.com (mail-qk0-x235.google.com [IPv6:2607:f8b0:400d:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9E8913B4; Fri, 17 Feb 2017 00:16:46 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x235.google.com with SMTP id s186so31632439qkb.1; Thu, 16 Feb 2017 16:16:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Yq9SOJeUSAHP2Jdf3MYFIqKajoR7HwT0OCEVODf4+/o=; b=vUvlVd5Xxf0Z/kF/5bquUkYNRFomMU4hmWzOnMcCmNsyR75r3BRaRHwUA4whFRMEvH aCGpNQfUanAe6FORnE2NpsuFTHPYskkmBUcfJZw2ctzLjKqg7uzD5HNHVumQfsxIfcM2 vd5WPQmVUx7u+gi/q/2fHTMC6kGxkahDhis2vhQHi7NTR2T83dEZfpv789NNwWNsP+Q8 cu4c1yFxAkWNjXxVLZkBff5+TgIb2bIQE56d9MUeDLj1mKvmdJLGMwrGlYWvaseCX107 y1cswVobO5DV6ZcKYGdPlkBgXrDGQDfslGW385rqF8AdM/aNYkm+fj1e6e774FzIZ9Si n2Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Yq9SOJeUSAHP2Jdf3MYFIqKajoR7HwT0OCEVODf4+/o=; b=sn4jsgYt+234RLxZgvMHesnIF8kJ3ZRGT1nypxUDvnBLXSxM0Gzcip4kci282uEk1N 2iVjpiWjiTm8WrVgywkOAQKltu6tLjVbAM07fekX8pXId8w6ikwkUpHFi50lAL64MZkw KyNqcxtJRRxmh4SZoAe3tK2cz0mxf9rtdt94BZ7II0jDKW6J5Q2WHVBkJ98Jkch3cIkb qijMop/+n7ErdvDEo6B5RNnxl7HjoHYxOvfBN9skZN4vI+s1eEV9fj0rpk1vqc7yHj4u 13I7IMMaPA0F9/GezBrY3Eawby4WQQZVPnWVFifD9I5XUmpVW9vVEGH21QrmWD0oPrxh ehdw== X-Gm-Message-State: AMke39lLi6DIYKfY7sZK2kpb+9R9mLJPKrLHtmVVoQ5+H5aETc/zJrqxrJx082ciLEEutFA1muGlQ+kfszFdMQ== X-Received: by 10.55.67.135 with SMTP id q129mr5098608qka.98.1487290605787; Thu, 16 Feb 2017 16:16:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.84.230 with HTTP; Thu, 16 Feb 2017 16:16:45 -0800 (PST) In-Reply-To: <201702162050.v1GKo1DL014626@repo.freebsd.org> References: <201702162050.v1GKo1DL014626@repo.freebsd.org> From: Ngie Cooper Date: Thu, 16 Feb 2017 16:16:45 -0800 Message-ID: Subject: Re: svn commit: r313822 - in head/sys: libkern netinet To: Eric van Gyzen Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 00:16:47 -0000 On Thu, Feb 16, 2017 at 12:50 PM, Eric van Gyzen wrote: > Author: vangyzen > Date: Thu Feb 16 20:50:01 2017 > New Revision: 313822 > URL: https://svnweb.freebsd.org/changeset/base/313822 > > Log: > Remove inet_ntoa() from the kernel > > inet_ntoa() cannot be used safely in a multithreaded environment > because it uses a static local buffer. Remove it from the kernel. Uhmmmm.... did you mean to remove it from netinet/in.h ? This gets used in userspace too... -Ngie From owner-svn-src-head@freebsd.org Fri Feb 17 00:22:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96360CE1340; Fri, 17 Feb 2017 00:22:00 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x230.google.com (mail-qt0-x230.google.com [IPv6:2607:f8b0:400d:c0d::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2A017E9; Fri, 17 Feb 2017 00:22:00 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x230.google.com with SMTP id w20so28856794qtb.1; Thu, 16 Feb 2017 16:22:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=PesYfAZAxntcBjh9h6l4SHwOAMw7NEgt3LSbPnMoxx4=; b=ikgKYIFmmVCQrflgFmmwgIzK8nyMFZEhw8TCvAKdbjMA0fDHyttmABG7WwbaBjsyo3 DPCYCwW4NpmKMC486BWMKW4AGjH33zUmNNty612MsAGaXyppG/0iQzPWL1KBQYT9amlx +1PnpXz0grEB/X82sDeSQDEJ+ciJsmYASDpmlEaCUzDQ8mxCl8aOK+16He8zmf4Mdw17 d7Oy0PQi6feyegeHbud7EpEs1fDi/82Xd9VFBjlo9jKqc9orzufDrsQyVu7uUWLRL4fB CCvyTh9OFgs+PbzqB2wKQxk0VbzuHfEi1rEvokhB0V6YinmQdhcR7Iv3xns9t16rNwww UrfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=PesYfAZAxntcBjh9h6l4SHwOAMw7NEgt3LSbPnMoxx4=; b=ttrJgOsy6zp+rsyMDKGJ5uOYxQklXW/BDrmgXf8/xBe8J9JdbfxVzeKQAg9XR2+J0o 23STJnMKy74nerChCTwlpPAW5K4pPKob1wKn3ktXxXMD4oz95lX4YkrgpXxyDkr1M2/K a0jy5iCDlwpkKgT2FXd1+tA+VYb5Fmef+EQAFbCVMXIfMmGg2hRhqyrM6qn3WOlmD4Q1 DR63y1ZyEDS3hSr+pRLv848Kk8p8kx8xj0XjHFZiRyNeMJQU5WXtY9/5qatysTwBsvgu 9Q5wJWk7wdCMYLKOueqslqb37uCy5CHH8wCgLeiTVrRSqGzanppyVFMGUW38qsy5AIRV t4Eg== X-Gm-Message-State: AMke39n40wkY9MZb297Hld03gcv45F9DpxVo45AbPeVSCPAU3Vcz0RcA6s8oJA7dUY6xHW93pWdnnPWcUTcQAw== X-Received: by 10.237.34.125 with SMTP id o58mr4786030qtc.95.1487290919412; Thu, 16 Feb 2017 16:21:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.84.230 with HTTP; Thu, 16 Feb 2017 16:21:59 -0800 (PST) In-Reply-To: References: <201702162050.v1GKo1DL014626@repo.freebsd.org> From: Ngie Cooper Date: Thu, 16 Feb 2017 16:21:59 -0800 Message-ID: Subject: Re: svn commit: r313822 - in head/sys: libkern netinet To: Eric van Gyzen Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 00:22:00 -0000 On Thu, Feb 16, 2017 at 4:16 PM, Ngie Cooper wrote: > On Thu, Feb 16, 2017 at 12:50 PM, Eric van Gyzen wrote: >> Author: vangyzen >> Date: Thu Feb 16 20:50:01 2017 >> New Revision: 313822 >> URL: https://svnweb.freebsd.org/changeset/base/313822 >> >> Log: >> Remove inet_ntoa() from the kernel >> >> inet_ntoa() cannot be used safely in a multithreaded environment >> because it uses a static local buffer. Remove it from the kernel. > > Uhmmmm.... did you mean to remove it from netinet/in.h ? This gets > used in userspace too... Oh good grief -- there were 3 definitions??? Ok, I see you deleted the libkern one. Nevermind... carry on! -Ngie $ grep -r inet_ntoa /usr/include/ /usr/include/netinet/in.h:char *inet_ntoa(struct in_addr); /* in libkern */ /usr/include/netinet/in.h:char *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */ /usr/include/arpa/inet.h:#define inet_ntoa __inet_ntoa /usr/include/arpa/inet.h:#define inet_ntoa_r __inet_ntoa_r /usr/include/arpa/inet.h:/*const*/ char *inet_ntoa(struct in_addr); /usr/include/arpa/inet.h:char *inet_ntoa_r(struct in_addr, char *buf, socklen_t size); $ From owner-svn-src-head@freebsd.org Fri Feb 17 03:27:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C06CDCDB0C1; Fri, 17 Feb 2017 03:27:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 875641F83; Fri, 17 Feb 2017 03:27:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1H3RKOQ078744; Fri, 17 Feb 2017 03:27:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1H3RKK4078742; Fri, 17 Feb 2017 03:27:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201702170327.v1H3RKK4078742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 17 Feb 2017 03:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313850 - in head/sys/cddl/dev/dtrace: amd64 i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 03:27:21 -0000 Author: markj Date: Fri Feb 17 03:27:20 2017 New Revision: 313850 URL: https://svnweb.freebsd.org/changeset/base/313850 Log: Directly include needed headers rather than relying on pollution. We get machine/cpu.h via kmem.h -> proc.h -> _vm_domain.h -> seq.h. Reported by: Ryan Libby Sponsored by: Dell EMC Isilon X-MFC with: r313841 Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Fri Feb 17 00:50:00 2017 (r313849) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Fri Feb 17 03:27:20 2017 (r313850) @@ -41,7 +41,9 @@ #include #include #include +#include #include +#include #include extern void dtrace_getnanotime(struct timespec *tsp); Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Fri Feb 17 00:50:00 2017 (r313849) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Fri Feb 17 03:27:20 2017 (r313850) @@ -42,7 +42,9 @@ #include #include #include +#include #include +#include #include extern uintptr_t kernelbase; From owner-svn-src-head@freebsd.org Fri Feb 17 04:13:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35B64CDBB93; Fri, 17 Feb 2017 04:13:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F866164D; Fri, 17 Feb 2017 04:13:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v1H4DZsk084581 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 16 Feb 2017 20:13:35 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v1H4DZPJ084580; Thu, 16 Feb 2017 20:13:35 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 16 Feb 2017 20:13:35 -0800 From: Gleb Smirnoff To: Eric van Gyzen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313821 - in head/sys: dev/cxgb/ulp/iw_cxgb fs/nfsserver kern netinet netinet/libalias netpfil/ipfw Message-ID: <20170217041334.GH58829@FreeBSD.org> References: <201702162047.v1GKlf9j014479@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201702162047.v1GKlf9j014479@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 04:13:37 -0000 On Thu, Feb 16, 2017 at 08:47:41PM +0000, Eric van Gyzen wrote: E> Author: vangyzen E> Date: Thu Feb 16 20:47:41 2017 E> New Revision: 313821 E> URL: https://svnweb.freebsd.org/changeset/base/313821 E> E> Log: E> Use inet_ntoa_r() instead of inet_ntoa() throughout the kernel E> E> inet_ntoa() cannot be used safely in a multithreaded environment E> because it uses a static local buffer. Instead, use inet_ntoa_r() E> with a buffer on the caller's stack. Thanks a lot, Eric! -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Feb 17 04:17:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C26DCDBC7E; Fri, 17 Feb 2017 04:17:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 70B5517C8; Fri, 17 Feb 2017 04:17:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v1H4Hmhf084620 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 16 Feb 2017 20:17:48 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v1H4HmCh084619; Thu, 16 Feb 2017 20:17:48 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 16 Feb 2017 20:17:48 -0800 From: Gleb Smirnoff To: Eric van Gyzen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313821 - in head/sys: dev/cxgb/ulp/iw_cxgb fs/nfsserver kern netinet netinet/libalias netpfil/ipfw Message-ID: <20170217041748.GI58829@FreeBSD.org> References: <201702162047.v1GKlf9j014479@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201702162047.v1GKlf9j014479@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 04:17:49 -0000 Eric, heh, things are worse. Multiple places you changes are CTR() macros. Neither inet_ntoa() nor inet_ntoa_r() will work with them. :( Basicly non-constant strings can not be logged with KTR. All the lines you touched should log actual binary value of the IPv4 address. I am not asking you to do this work! :) But I couldn't leave that without a comment. On Thu, Feb 16, 2017 at 08:47:41PM +0000, Eric van Gyzen wrote: E> Author: vangyzen E> Date: Thu Feb 16 20:47:41 2017 E> New Revision: 313821 E> URL: https://svnweb.freebsd.org/changeset/base/313821 E> E> Log: E> Use inet_ntoa_r() instead of inet_ntoa() throughout the kernel E> E> inet_ntoa() cannot be used safely in a multithreaded environment E> because it uses a static local buffer. Instead, use inet_ntoa_r() E> with a buffer on the caller's stack. E> E> Suggested by: glebius, emaste E> Reviewed by: gnn E> MFC after: 2 weeks E> Sponsored by: Dell EMC E> Differential Revision: https://reviews.freebsd.org/D9625 E> E> Modified: E> head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c E> head/sys/fs/nfsserver/nfs_nfsdkrpc.c E> head/sys/kern/kern_jail.c E> head/sys/netinet/if_ether.c E> head/sys/netinet/igmp.c E> head/sys/netinet/in.c E> head/sys/netinet/in_mcast.c E> head/sys/netinet/ip_icmp.c E> head/sys/netinet/ip_mroute.c E> head/sys/netinet/ip_options.c E> head/sys/netinet/libalias/alias_local.h E> head/sys/netinet/libalias/alias_nbt.c E> head/sys/netinet/libalias/alias_proxy.c E> head/sys/netinet/libalias/alias_sctp.c E> head/sys/netinet/tcp_hostcache.c E> head/sys/netpfil/ipfw/ip_fw_log.c E> E> Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c E> ============================================================================== E> --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Thu Feb 16 20:44:44 2017 (r313820) E> +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Thu Feb 16 20:47:41 2017 (r313821) E> @@ -1461,6 +1461,9 @@ static void E> process_data(struct iwch_ep *ep) E> { E> struct sockaddr_in *local, *remote; E> +#ifdef KTR E> + char local_str[INET_ADDRSTRLEN], remote_str[INET_ADDRSTRLEN]; E> +#endif E> E> CTR4(KTR_IW_CXGB, "%s ep %p so %p state %s", __FUNCTION__, ep, ep->com.so, states[ep->com.state]); E> E> @@ -1479,8 +1482,8 @@ process_data(struct iwch_ep *ep) E> in_getsockaddr(ep->com.so, (struct sockaddr **)&local); E> in_getpeeraddr(ep->com.so, (struct sockaddr **)&remote); E> CTR3(KTR_IW_CXGB, "%s local %s remote %s", __FUNCTION__, E> - inet_ntoa(local->sin_addr), E> - inet_ntoa(remote->sin_addr)); E> + inet_ntoa_r(local->sin_addr, local_str), E> + inet_ntoa_r(remote->sin_addr, remote_str)); E> ep->com.local_addr = *local; E> ep->com.remote_addr = *remote; E> free(local, M_SONAME); E> @@ -1519,6 +1522,9 @@ process_newconn(struct iw_cm_id *parent_ E> struct sockaddr_in *local; E> struct sockaddr_in *remote; E> struct iwch_ep *parent_ep = parent_cm_id->provider_data; E> +#ifdef KTR E> + char buf[INET_ADDRSTRLEN]; E> +#endif E> E> CTR3(KTR_IW_CXGB, "%s parent ep %p so %p", __FUNCTION__, parent_ep, parent_ep->com.so); E> if (!child_so) { E> @@ -1539,7 +1545,7 @@ process_newconn(struct iw_cm_id *parent_ E> in_getpeeraddr(child_so, (struct sockaddr **)&remote); E> E> CTR3(KTR_IW_CXGB, "%s remote addr %s port %d", __FUNCTION__, E> - inet_ntoa(remote->sin_addr), ntohs(remote->sin_port)); E> + inet_ntoa_r(remote->sin_addr, buf), ntohs(remote->sin_port)); E> child_ep->com.tdev = parent_ep->com.tdev; E> child_ep->com.local_addr.sin_family = parent_ep->com.local_addr.sin_family; E> child_ep->com.local_addr.sin_port = parent_ep->com.local_addr.sin_port; E> E> Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c E> ============================================================================== E> --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Thu Feb 16 20:44:44 2017 (r313820) E> +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Thu Feb 16 20:47:41 2017 (r313821) E> @@ -174,7 +174,11 @@ nfssvc_program(struct svc_req *rqst, SVC E> if (port >= IPPORT_RESERVED && E> nd.nd_procnum != NFSPROC_NULL) { E> #ifdef INET6 E> - char b6[INET6_ADDRSTRLEN]; E> + char buf[INET6_ADDRSTRLEN]; E> +#else E> + char buf[INET_ADDRSTRLEN]; E> +#endif E> +#ifdef INET6 E> #if defined(KLD_MODULE) E> /* Do not use ip6_sprintf: the nfs module should work without INET6. */ E> #define ip6_sprintf(buf, a) \ E> @@ -189,12 +193,12 @@ nfssvc_program(struct svc_req *rqst, SVC E> printf("NFS request from unprivileged port (%s:%d)\n", E> #ifdef INET6 E> sin->sin_family == AF_INET6 ? E> - ip6_sprintf(b6, &satosin6(sin)->sin6_addr) : E> + ip6_sprintf(buf, &satosin6(sin)->sin6_addr) : E> #if defined(KLD_MODULE) E> #undef ip6_sprintf E> #endif E> #endif E> - inet_ntoa(sin->sin_addr), port); E> + inet_ntoa_r(sin->sin_addr, buf), port); E> svcerr_weakauth(rqst); E> svc_freereq(rqst); E> m_freem(nd.nd_mrep); E> E> Modified: head/sys/kern/kern_jail.c E> ============================================================================== E> --- head/sys/kern/kern_jail.c Thu Feb 16 20:44:44 2017 (r313820) E> +++ head/sys/kern/kern_jail.c Thu Feb 16 20:47:41 2017 (r313821) E> @@ -3999,6 +3999,9 @@ db_show_prison(struct prison *pr) E> int ii; E> #endif E> unsigned jsf; E> +#ifdef INET E> + char ip4buf[INET_ADDRSTRLEN]; E> +#endif E> #ifdef INET6 E> char ip6buf[INET6_ADDRSTRLEN]; E> #endif E> @@ -4050,7 +4053,7 @@ db_show_prison(struct prison *pr) E> for (ii = 0; ii < pr->pr_ip4s; ii++) E> db_printf(" %s %s\n", E> ii == 0 ? "ip4.addr =" : " ", E> - inet_ntoa(pr->pr_ip4[ii])); E> + inet_ntoa_r(pr->pr_ip4[ii], ip4buf)); E> #endif E> #ifdef INET6 E> db_printf(" ip6s = %d\n", pr->pr_ip6s); E> E> Modified: head/sys/netinet/if_ether.c E> ============================================================================== E> --- head/sys/netinet/if_ether.c Thu Feb 16 20:44:44 2017 (r313820) E> +++ head/sys/netinet/if_ether.c Thu Feb 16 20:47:41 2017 (r313821) E> @@ -464,9 +464,12 @@ arpresolve_full(struct ifnet *ifp, int i E> if (la == NULL && (ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0) { E> la = lltable_alloc_entry(LLTABLE(ifp), 0, dst); E> if (la == NULL) { E> + char addrbuf[INET_ADDRSTRLEN]; E> + E> log(LOG_DEBUG, E> "arpresolve: can't allocate llinfo for %s on %s\n", E> - inet_ntoa(SIN(dst)->sin_addr), if_name(ifp)); E> + inet_ntoa_r(SIN(dst)->sin_addr, addrbuf), E> + if_name(ifp)); E> m_freem(m); E> return (EINVAL); E> } E> @@ -803,6 +806,7 @@ in_arpinput(struct mbuf *m) E> size_t linkhdrsize; E> int lladdr_off; E> int error; E> + char addrbuf[INET_ADDRSTRLEN]; E> E> sin.sin_len = sizeof(struct sockaddr_in); E> sin.sin_family = AF_INET; E> @@ -927,7 +931,7 @@ match: E> goto drop; /* it's from me, ignore it. */ E> if (!bcmp(ar_sha(ah), ifp->if_broadcastaddr, ifp->if_addrlen)) { E> ARP_LOG(LOG_NOTICE, "link address is broadcast for IP address " E> - "%s!\n", inet_ntoa(isaddr)); E> + "%s!\n", inet_ntoa_r(isaddr, addrbuf)); E> goto drop; E> } E> E> @@ -949,7 +953,7 @@ match: E> myaddr.s_addr != 0) { E> ARP_LOG(LOG_ERR, "%*D is using my IP address %s on %s!\n", E> ifp->if_addrlen, (u_char *)ar_sha(ah), ":", E> - inet_ntoa(isaddr), ifp->if_xname); E> + inet_ntoa_r(isaddr, addrbuf), ifp->if_xname); E> itaddr = myaddr; E> ARPSTAT_INC(dupips); E> goto reply; E> @@ -1086,12 +1090,14 @@ reply: E> if (nh4.nh_ifp != ifp) { E> ARP_LOG(LOG_INFO, "proxy: ignoring request" E> " from %s via %s\n", E> - inet_ntoa(isaddr), ifp->if_xname); E> + inet_ntoa_r(isaddr, addrbuf), E> + ifp->if_xname); E> goto drop; E> } E> E> #ifdef DEBUG_PROXY E> - printf("arp: proxying for %s\n", inet_ntoa(itaddr)); E> + printf("arp: proxying for %s\n", E> + inet_ntoa_r(itaddr, addrbuf)); E> #endif E> } E> } E> @@ -1101,7 +1107,7 @@ reply: E> /* RFC 3927 link-local IPv4; always reply by broadcast. */ E> #ifdef DEBUG_LINKLOCAL E> printf("arp: sending reply for link-local addr %s\n", E> - inet_ntoa(itaddr)); E> + inet_ntoa_r(itaddr, addrbuf)); E> #endif E> m->m_flags |= M_BCAST; E> m->m_flags &= ~M_MCAST; E> @@ -1162,6 +1168,7 @@ arp_check_update_lle(struct arphdr *ah, E> uint8_t linkhdr[LLE_MAX_LINKHDR]; E> size_t linkhdrsize; E> int lladdr_off; E> + char addrbuf[INET_ADDRSTRLEN]; E> E> LLE_WLOCK_ASSERT(la); E> E> @@ -1170,7 +1177,7 @@ arp_check_update_lle(struct arphdr *ah, E> if (log_arp_wrong_iface) E> ARP_LOG(LOG_WARNING, "%s is on %s " E> "but got reply from %*D on %s\n", E> - inet_ntoa(isaddr), E> + inet_ntoa_r(isaddr, addrbuf), E> la->lle_tbl->llt_ifp->if_xname, E> ifp->if_addrlen, (u_char *)ar_sha(ah), ":", E> ifp->if_xname); E> @@ -1187,13 +1194,14 @@ arp_check_update_lle(struct arphdr *ah, E> "permanent entry for %s on %s\n", E> ifp->if_addrlen, E> (u_char *)ar_sha(ah), ":", E> - inet_ntoa(isaddr), ifp->if_xname); E> + inet_ntoa_r(isaddr, addrbuf), E> + ifp->if_xname); E> return; E> } E> if (log_arp_movements) { E> ARP_LOG(LOG_INFO, "%s moved from %*D " E> "to %*D on %s\n", E> - inet_ntoa(isaddr), E> + inet_ntoa_r(isaddr, addrbuf), E> ifp->if_addrlen, E> (u_char *)&la->ll_addr, ":", E> ifp->if_addrlen, (u_char *)ar_sha(ah), ":", E> E> Modified: head/sys/netinet/igmp.c E> ============================================================================== E> --- head/sys/netinet/igmp.c Thu Feb 16 20:44:44 2017 (r313820) E> +++ head/sys/netinet/igmp.c Thu Feb 16 20:47:41 2017 (r313821) E> @@ -314,12 +314,12 @@ igmp_scrub_context(struct mbuf *m) E> E> #ifdef KTR E> static __inline char * E> -inet_ntoa_haddr(in_addr_t haddr) E> +inet_ntoa_haddr(in_addr_t haddr, char *addrbuf) E> { E> struct in_addr ia; E> E> ia.s_addr = htonl(haddr); E> - return (inet_ntoa(ia)); E> + return (inet_ntoa_r(ia, addrbuf)); E> } E> #endif E> E> @@ -804,6 +804,9 @@ igmp_input_v2_query(struct ifnet *ifp, c E> struct in_multi *inm; E> int is_general_query; E> uint16_t timer; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> is_general_query = 0; E> E> @@ -873,7 +876,8 @@ igmp_input_v2_query(struct ifnet *ifp, c E> inm = inm_lookup(ifp, igmp->igmp_group); E> if (inm != NULL) { E> CTR3(KTR_IGMPV3, "process v2 query %s on ifp %p(%s)", E> - inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname); E> + inet_ntoa_r(igmp->igmp_group, addrbuf), ifp, E> + ifp->if_xname); E> igmp_v2_update_group(inm, timer); E> } E> } E> @@ -903,9 +907,12 @@ out_locked: E> static void E> igmp_v2_update_group(struct in_multi *inm, const int timer) E> { E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> CTR4(KTR_IGMPV3, "%s: %s/%s timer=%d", __func__, E> - inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname, timer); E> + inet_ntoa_r(inm->inm_addr, addrbuf), inm->inm_ifp->if_xname, timer); E> E> IN_MULTI_LOCK_ASSERT(); E> E> @@ -956,6 +963,9 @@ igmp_input_v3_query(struct ifnet *ifp, c E> uint32_t maxresp, nsrc, qqi; E> uint16_t timer; E> uint8_t qrv; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> is_general_query = 0; E> E> @@ -1086,7 +1096,8 @@ igmp_input_v3_query(struct ifnet *ifp, c E> } E> } E> CTR3(KTR_IGMPV3, "process v3 %s query on ifp %p(%s)", E> - inet_ntoa(igmpv3->igmp_group), ifp, ifp->if_xname); E> + inet_ntoa_r(igmpv3->igmp_group, addrbuf), ifp, E> + ifp->if_xname); E> /* E> * If there is a pending General Query response E> * scheduled sooner than the selected delay, no E> @@ -1219,6 +1230,9 @@ igmp_input_v1_report(struct ifnet *ifp, E> struct rm_priotracker in_ifa_tracker; E> struct in_ifaddr *ia; E> struct in_multi *inm; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> IGMPSTAT_INC(igps_rcv_reports); E> E> @@ -1247,7 +1261,7 @@ igmp_input_v1_report(struct ifnet *ifp, E> } E> E> CTR3(KTR_IGMPV3, "process v1 report %s on ifp %p(%s)", E> - inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname); E> + inet_ntoa_r(igmp->igmp_group, addrbuf), ifp, ifp->if_xname); E> E> /* E> * IGMPv1 report suppression. E> @@ -1290,14 +1304,16 @@ igmp_input_v1_report(struct ifnet *ifp, E> case IGMP_AWAKENING_MEMBER: E> CTR3(KTR_IGMPV3, E> "report suppressed for %s on ifp %p(%s)", E> - inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname); E> + inet_ntoa_r(igmp->igmp_group, addrbuf), ifp, E> + ifp->if_xname); E> case IGMP_SLEEPING_MEMBER: E> inm->inm_state = IGMP_SLEEPING_MEMBER; E> break; E> case IGMP_REPORTING_MEMBER: E> CTR3(KTR_IGMPV3, E> "report suppressed for %s on ifp %p(%s)", E> - inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname); E> + inet_ntoa_r(igmp->igmp_group, addrbuf), ifp, E> + ifp->if_xname); E> if (igi->igi_version == IGMP_VERSION_1) E> inm->inm_state = IGMP_LAZY_MEMBER; E> else if (igi->igi_version == IGMP_VERSION_2) E> @@ -1328,6 +1344,9 @@ igmp_input_v2_report(struct ifnet *ifp, E> struct rm_priotracker in_ifa_tracker; E> struct in_ifaddr *ia; E> struct in_multi *inm; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> /* E> * Make sure we don't hear our own membership report. Fast E> @@ -1371,7 +1390,7 @@ igmp_input_v2_report(struct ifnet *ifp, E> ifa_free(&ia->ia_ifa); E> E> CTR3(KTR_IGMPV3, "process v2 report %s on ifp %p(%s)", E> - inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname); E> + inet_ntoa_r(igmp->igmp_group, addrbuf), ifp, ifp->if_xname); E> E> /* E> * IGMPv2 report suppression. E> @@ -1412,7 +1431,8 @@ igmp_input_v2_report(struct ifnet *ifp, E> case IGMP_AWAKENING_MEMBER: E> CTR3(KTR_IGMPV3, E> "report suppressed for %s on ifp %p(%s)", E> - inet_ntoa(igmp->igmp_group), ifp, ifp->if_xname); E> + inet_ntoa_r(igmp->igmp_group, addrbuf), ifp, E> + ifp->if_xname); E> case IGMP_LAZY_MEMBER: E> inm->inm_state = IGMP_LAZY_MEMBER; E> break; E> @@ -1814,6 +1834,9 @@ igmp_v3_process_group_timers(struct igmp E> { E> int query_response_timer_expired; E> int state_change_retransmit_timer_expired; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> IN_MULTI_LOCK_ASSERT(); E> IGMP_LOCK_ASSERT(); E> @@ -1900,7 +1923,8 @@ igmp_v3_process_group_timers(struct igmp E> E> inm_commit(inm); E> CTR3(KTR_IGMPV3, "%s: T1 -> T0 for %s/%s", __func__, E> - inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname); E> + inet_ntoa_r(inm->inm_addr, addrbuf), E> + inm->inm_ifp->if_xname); E> E> /* E> * If we are leaving the group for good, make sure E> @@ -2346,9 +2370,12 @@ igmp_initial_join(struct in_multi *inm, E> struct ifnet *ifp; E> struct mbufq *mq; E> int error, retval, syncstates; E> - E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> + E> CTR4(KTR_IGMPV3, "%s: initial join %s on ifp %p(%s)", E> - __func__, inet_ntoa(inm->inm_addr), inm->inm_ifp, E> + __func__, inet_ntoa_r(inm->inm_addr, addrbuf), inm->inm_ifp, E> inm->inm_ifp->if_xname); E> E> error = 0; E> @@ -2459,7 +2486,8 @@ igmp_initial_join(struct in_multi *inm, E> if (syncstates) { E> inm_commit(inm); E> CTR3(KTR_IGMPV3, "%s: T1 -> T0 for %s/%s", __func__, E> - inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname); E> + inet_ntoa_r(inm->inm_addr, addrbuf), E> + inm->inm_ifp->if_xname); E> } E> E> return (error); E> @@ -2473,9 +2501,12 @@ igmp_handle_state_change(struct in_multi E> { E> struct ifnet *ifp; E> int retval; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> CTR4(KTR_IGMPV3, "%s: state change for %s on ifp %p(%s)", E> - __func__, inet_ntoa(inm->inm_addr), inm->inm_ifp, E> + __func__, inet_ntoa_r(inm->inm_addr, addrbuf), inm->inm_ifp, E> inm->inm_ifp->if_xname); E> E> ifp = inm->inm_ifp; E> @@ -2496,7 +2527,8 @@ igmp_handle_state_change(struct in_multi E> CTR1(KTR_IGMPV3, "%s: nothing to do", __func__); E> inm_commit(inm); E> CTR3(KTR_IGMPV3, "%s: T1 -> T0 for %s/%s", __func__, E> - inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname); E> + inet_ntoa_r(inm->inm_addr, addrbuf), E> + inm->inm_ifp->if_xname); E> return (0); E> } E> E> @@ -2531,11 +2563,14 @@ static void E> igmp_final_leave(struct in_multi *inm, struct igmp_ifsoftc *igi) E> { E> int syncstates; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> syncstates = 1; E> E> CTR4(KTR_IGMPV3, "%s: final leave %s on ifp %p(%s)", E> - __func__, inet_ntoa(inm->inm_addr), inm->inm_ifp, E> + __func__, inet_ntoa_r(inm->inm_addr, addrbuf), inm->inm_ifp, E> inm->inm_ifp->if_xname); E> E> IN_MULTI_LOCK_ASSERT(); E> @@ -2578,7 +2613,7 @@ igmp_final_leave(struct in_multi *inm, s E> } E> CTR4(KTR_IGMPV3, "%s: Leaving %s/%s with %d " E> "pending retransmissions.", __func__, E> - inet_ntoa(inm->inm_addr), E> + inet_ntoa_r(inm->inm_addr, addrbuf), E> inm->inm_ifp->if_xname, inm->inm_scrv); E> if (inm->inm_scrv == 0) { E> inm->inm_state = IGMP_NOT_MEMBER; E> @@ -2612,10 +2647,12 @@ igmp_final_leave(struct in_multi *inm, s E> if (syncstates) { E> inm_commit(inm); E> CTR3(KTR_IGMPV3, "%s: T1 -> T0 for %s/%s", __func__, E> - inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname); E> + inet_ntoa_r(inm->inm_addr, addrbuf), E> + inm->inm_ifp->if_xname); E> inm->inm_st[1].iss_fmode = MCAST_UNDEFINED; E> CTR3(KTR_IGMPV3, "%s: T1 now MCAST_UNDEFINED for %s/%s", E> - __func__, inet_ntoa(inm->inm_addr), inm->inm_ifp->if_xname); E> + __func__, inet_ntoa_r(inm->inm_addr, addrbuf), E> + inm->inm_ifp->if_xname); E> } E> } E> E> @@ -2663,6 +2700,9 @@ igmp_v3_enqueue_group_record(struct mbuf E> int type; E> in_addr_t naddr; E> uint8_t mode; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> IN_MULTI_LOCK_ASSERT(); E> E> @@ -2741,7 +2781,7 @@ igmp_v3_enqueue_group_record(struct mbuf E> E> if (type == IGMP_DO_NOTHING) { E> CTR3(KTR_IGMPV3, "%s: nothing to do for %s/%s", E> - __func__, inet_ntoa(inm->inm_addr), E> + __func__, inet_ntoa_r(inm->inm_addr, addrbuf), E> inm->inm_ifp->if_xname); E> return (0); E> } E> @@ -2756,7 +2796,7 @@ igmp_v3_enqueue_group_record(struct mbuf E> minrec0len += sizeof(in_addr_t); E> E> CTR4(KTR_IGMPV3, "%s: queueing %s for %s/%s", __func__, E> - igmp_rec_type_to_str(type), inet_ntoa(inm->inm_addr), E> + igmp_rec_type_to_str(type), inet_ntoa_r(inm->inm_addr, addrbuf), E> inm->inm_ifp->if_xname); E> E> /* E> @@ -2845,7 +2885,7 @@ igmp_v3_enqueue_group_record(struct mbuf E> msrcs = 0; E> RB_FOREACH_SAFE(ims, ip_msource_tree, &inm->inm_srcs, nims) { E> CTR2(KTR_IGMPV3, "%s: visit node %s", __func__, E> - inet_ntoa_haddr(ims->ims_haddr)); E> + inet_ntoa_haddr(ims->ims_haddr, addrbuf)); E> now = ims_get_mode(inm, ims, 1); E> CTR2(KTR_IGMPV3, "%s: node is %d", __func__, now); E> if ((now != mode) || E> @@ -2941,7 +2981,7 @@ igmp_v3_enqueue_group_record(struct mbuf E> msrcs = 0; E> RB_FOREACH_FROM(ims, ip_msource_tree, nims) { E> CTR2(KTR_IGMPV3, "%s: visit node %s", __func__, E> - inet_ntoa_haddr(ims->ims_haddr)); E> + inet_ntoa_haddr(ims->ims_haddr, addrbuf)); E> now = ims_get_mode(inm, ims, 1); E> if ((now != mode) || E> (now == mode && mode == MCAST_UNDEFINED)) { E> @@ -3024,6 +3064,9 @@ igmp_v3_enqueue_filter_change(struct mbu E> int nallow, nblock; E> uint8_t mode, now, then; E> rectype_t crt, drt, nrt; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> IN_MULTI_LOCK_ASSERT(); E> E> @@ -3133,7 +3176,8 @@ igmp_v3_enqueue_filter_change(struct mbu E> nims = RB_MIN(ip_msource_tree, &inm->inm_srcs); E> RB_FOREACH_FROM(ims, ip_msource_tree, nims) { E> CTR2(KTR_IGMPV3, "%s: visit node %s", E> - __func__, inet_ntoa_haddr(ims->ims_haddr)); E> + __func__, E> + inet_ntoa_haddr(ims->ims_haddr, addrbuf)); E> now = ims_get_mode(inm, ims, 1); E> then = ims_get_mode(inm, ims, 0); E> CTR3(KTR_IGMPV3, "%s: mode: t0 %d, t1 %d", E> E> Modified: head/sys/netinet/in.c E> ============================================================================== E> --- head/sys/netinet/in.c Thu Feb 16 20:44:44 2017 (r313820) E> +++ head/sys/netinet/in.c Thu Feb 16 20:47:41 2017 (r313821) E> @@ -1218,7 +1218,7 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ E> */ E> if (!(rt_flags & RTF_HOST) && info.rti_ifp != ifp) { E> const char *sa, *mask, *addr, *lim; E> - int len; E> + const struct sockaddr_in *l3sin; E> E> mask = (const char *)&rt_mask; E> /* E> @@ -1230,14 +1230,17 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ E> E> sa = (const char *)&rt_key; E> addr = (const char *)l3addr; E> - len = ((const struct sockaddr_in *)l3addr)->sin_len; E> - lim = addr + len; E> + l3sin = (const struct sockaddr_in *)l3addr; E> + lim = addr + l3sin->sin_len; E> E> for ( ; addr < lim; sa++, mask++, addr++) { E> if ((*sa ^ *addr) & *mask) { E> #ifdef DIAGNOSTIC E> - log(LOG_INFO, "IPv4 address: \"%s\" is not on the network\n", E> - inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr)); E> + char addrbuf[INET_ADDRSTRLEN]; E> + E> + log(LOG_INFO, "IPv4 address: \"%s\" " E> + "is not on the network\n", E> + inet_ntoa_r(l3sin->sin_addr, addrbuf)); E> #endif E> return (EINVAL); E> } E> E> Modified: head/sys/netinet/in_mcast.c E> ============================================================================== E> --- head/sys/netinet/in_mcast.c Thu Feb 16 20:44:44 2017 (r313820) E> +++ head/sys/netinet/in_mcast.c Thu Feb 16 20:47:41 2017 (r313821) E> @@ -495,9 +495,12 @@ in_getmulti(struct ifnet *ifp, const str E> ("%s: ifma not AF_INET", __func__)); E> KASSERT(inm != NULL, ("%s: no ifma_protospec", __func__)); E> if (inm->inm_ifma != ifma || inm->inm_ifp != ifp || E> - !in_hosteq(inm->inm_addr, *group)) E> + !in_hosteq(inm->inm_addr, *group)) { E> + char addrbuf[INET_ADDRSTRLEN]; E> + E> panic("%s: ifma %p is inconsistent with %p (%s)", E> - __func__, ifma, inm, inet_ntoa(*group)); E> + __func__, ifma, inm, inet_ntoa_r(*group, addrbuf)); E> + } E> #endif E> ++inm->inm_refcount; E> *pinm = inm; E> @@ -875,7 +878,8 @@ inm_get_source(struct in_multi *inm, con E> struct ip_msource find; E> struct ip_msource *ims, *nims; E> #ifdef KTR E> - struct in_addr ia; E> + struct in_addr ia; E> + char addrbuf[INET_ADDRSTRLEN]; E> #endif E> E> find.ims_haddr = haddr; E> @@ -894,7 +898,7 @@ inm_get_source(struct in_multi *inm, con E> #ifdef KTR E> ia.s_addr = htonl(haddr); E> CTR3(KTR_IGMPV3, "%s: allocated %s as %p", __func__, E> - inet_ntoa(ia), ims); E> + inet_ntoa_r(ia, addrbuf), ims); E> #endif E> } E> E> @@ -912,6 +916,7 @@ ims_merge(struct ip_msource *ims, const E> { E> int n = rollback ? -1 : 1; E> #ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> struct in_addr ia; E> E> ia.s_addr = htonl(ims->ims_haddr); E> @@ -919,21 +924,21 @@ ims_merge(struct ip_msource *ims, const E> E> if (lims->imsl_st[0] == MCAST_EXCLUDE) { E> CTR3(KTR_IGMPV3, "%s: t1 ex -= %d on %s", E> - __func__, n, inet_ntoa(ia)); E> + __func__, n, inet_ntoa_r(ia, addrbuf)); E> ims->ims_st[1].ex -= n; E> } else if (lims->imsl_st[0] == MCAST_INCLUDE) { E> CTR3(KTR_IGMPV3, "%s: t1 in -= %d on %s", E> - __func__, n, inet_ntoa(ia)); E> + __func__, n, inet_ntoa_r(ia, addrbuf)); E> ims->ims_st[1].in -= n; E> } E> E> if (lims->imsl_st[1] == MCAST_EXCLUDE) { E> CTR3(KTR_IGMPV3, "%s: t1 ex += %d on %s", E> - __func__, n, inet_ntoa(ia)); E> + __func__, n, inet_ntoa_r(ia, addrbuf)); E> ims->ims_st[1].ex += n; E> } else if (lims->imsl_st[1] == MCAST_INCLUDE) { E> CTR3(KTR_IGMPV3, "%s: t1 in += %d on %s", E> - __func__, n, inet_ntoa(ia)); E> + __func__, n, inet_ntoa_r(ia, addrbuf)); E> ims->ims_st[1].in += n; E> } E> } E> @@ -1166,11 +1171,14 @@ in_joingroup_locked(struct ifnet *ifp, c E> struct in_mfilter timf; E> struct in_multi *inm; E> int error; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> IN_MULTI_LOCK_ASSERT(); E> E> CTR4(KTR_IGMPV3, "%s: join %s on %p(%s))", __func__, E> - inet_ntoa(*gina), ifp, ifp->if_xname); E> + inet_ntoa_r(*gina, addrbuf), ifp, ifp->if_xname); E> E> error = 0; E> inm = NULL; E> @@ -1248,13 +1256,16 @@ in_leavegroup_locked(struct in_multi *in E> { E> struct in_mfilter timf; E> int error; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> error = 0; E> E> IN_MULTI_LOCK_ASSERT(); E> E> CTR5(KTR_IGMPV3, "%s: leave inm %p, %s/%s, imf %p", __func__, E> - inm, inet_ntoa(inm->inm_addr), E> + inm, inet_ntoa_r(inm->inm_addr, addrbuf), E> (inm_is_ifp_detached(inm) ? "null" : inm->inm_ifp->if_xname), E> imf); E> E> @@ -1302,9 +1313,13 @@ in_addmulti(struct in_addr *ap, struct i E> { E> struct in_multi *pinm; E> int error; E> +#ifdef INVARIANTS E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> KASSERT(IN_LOCAL_GROUP(ntohl(ap->s_addr)), E> - ("%s: %s not in 224.0.0.0/24", __func__, inet_ntoa(*ap))); E> + ("%s: %s not in 224.0.0.0/24", __func__, E> + inet_ntoa_r(*ap, addrbuf))); E> E> error = in_joingroup(ifp, ap, NULL, &pinm); E> if (error != 0) E> @@ -1349,6 +1364,9 @@ inp_block_unblock_source(struct inpcb *i E> size_t idx; E> uint16_t fmode; E> int error, doblock; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> ifp = NULL; E> error = 0; E> @@ -1384,7 +1402,7 @@ inp_block_unblock_source(struct inpcb *i E> doblock = 1; E> E> CTR3(KTR_IGMPV3, "%s: imr_interface = %s, ifp = %p", E> - __func__, inet_ntoa(mreqs.imr_interface), ifp); E> + __func__, inet_ntoa_r(mreqs.imr_interface, addrbuf), ifp); E> break; E> } E> E> @@ -1457,7 +1475,8 @@ inp_block_unblock_source(struct inpcb *i E> ims = imo_match_source(imo, idx, &ssa->sa); E> if ((ims != NULL && doblock) || (ims == NULL && !doblock)) { E> CTR3(KTR_IGMPV3, "%s: source %s %spresent", __func__, E> - inet_ntoa(ssa->sin.sin_addr), doblock ? "" : "not "); E> + inet_ntoa_r(ssa->sin.sin_addr, addrbuf), E> + doblock ? "" : "not "); E> error = EADDRNOTAVAIL; E> goto out_inp_locked; E> } E> @@ -1934,6 +1953,9 @@ inp_join_group(struct inpcb *inp, struct E> struct in_msource *lims; E> size_t idx; E> int error, is_new; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> ifp = NULL; E> imf = NULL; E> @@ -1986,7 +2008,7 @@ inp_join_group(struct inpcb *inp, struct E> ifp = inp_lookup_mcast_ifp(inp, &gsa->sin, E> mreqs.imr_interface); E> CTR3(KTR_IGMPV3, "%s: imr_interface = %s, ifp = %p", E> - __func__, inet_ntoa(mreqs.imr_interface), ifp); E> + __func__, inet_ntoa_r(mreqs.imr_interface, addrbuf), ifp); E> break; E> } E> E> @@ -2233,6 +2255,9 @@ inp_leave_group(struct inpcb *inp, struc E> struct in_multi *inm; E> size_t idx; E> int error, is_final; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> ifp = NULL; E> error = 0; E> @@ -2287,7 +2312,7 @@ inp_leave_group(struct inpcb *inp, struc E> INADDR_TO_IFP(mreqs.imr_interface, ifp); E> E> CTR3(KTR_IGMPV3, "%s: imr_interface = %s, ifp = %p", E> - __func__, inet_ntoa(mreqs.imr_interface), ifp); E> + __func__, inet_ntoa_r(mreqs.imr_interface, addrbuf), ifp); E> E> break; E> E> @@ -2368,7 +2393,7 @@ inp_leave_group(struct inpcb *inp, struc E> ims = imo_match_source(imo, idx, &ssa->sa); E> if (ims == NULL) { E> CTR3(KTR_IGMPV3, "%s: source %s %spresent", __func__, E> - inet_ntoa(ssa->sin.sin_addr), "not "); E> + inet_ntoa_r(ssa->sin.sin_addr, addrbuf), "not "); E> error = EADDRNOTAVAIL; E> goto out_inp_locked; E> } E> @@ -2450,6 +2475,9 @@ inp_set_multicast_if(struct inpcb *inp, E> struct ifnet *ifp; E> struct ip_moptions *imo; E> int error; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> if (sopt->sopt_valsize == sizeof(struct ip_mreqn)) { E> /* E> @@ -2488,7 +2516,7 @@ inp_set_multicast_if(struct inpcb *inp, E> return (EADDRNOTAVAIL); E> } E> CTR3(KTR_IGMPV3, "%s: ifp = %p, addr = %s", __func__, ifp, E> - inet_ntoa(addr)); E> + inet_ntoa_r(addr, addrbuf)); E> } E> E> /* Reject interfaces which do not support multicast. */ E> @@ -2846,6 +2874,9 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_A E> int retval; E> u_int namelen; E> uint32_t fmode, ifindex; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> name = (int *)arg1; E> namelen = arg2; E> @@ -2866,7 +2897,7 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_A E> group.s_addr = name[1]; E> if (!IN_MULTICAST(ntohl(group.s_addr))) { E> CTR2(KTR_IGMPV3, "%s: group %s is not multicast", E> - __func__, inet_ntoa(group)); E> + __func__, inet_ntoa_r(group, addrbuf)); E> return (EINVAL); E> } E> E> @@ -2901,7 +2932,7 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_A E> struct in_addr ina; E> ina.s_addr = htonl(ims->ims_haddr); E> CTR2(KTR_IGMPV3, "%s: visit node %s", __func__, E> - inet_ntoa(ina)); E> + inet_ntoa_r(ina, addrbuf)); E> #endif E> /* E> * Only copy-out sources which are in-mode. E> @@ -2965,13 +2996,14 @@ void E> inm_print(const struct in_multi *inm) E> { E> int t; E> + char addrbuf[INET_ADDRSTRLEN]; E> E> if ((ktr_mask & KTR_IGMPV3) == 0) E> return; E> E> printf("%s: --- begin inm %p ---\n", __func__, inm); E> printf("addr %s ifp %p(%s) ifma %p\n", E> - inet_ntoa(inm->inm_addr), E> + inet_ntoa_r(inm->inm_addr, addrbuf), E> inm->inm_ifp, E> inm->inm_ifp->if_xname, E> inm->inm_ifma); E> E> Modified: head/sys/netinet/ip_icmp.c E> ============================================================================== E> --- head/sys/netinet/ip_icmp.c Thu Feb 16 20:44:44 2017 (r313820) E> +++ head/sys/netinet/ip_icmp.c Thu Feb 16 20:47:41 2017 (r313821) E> @@ -380,10 +380,12 @@ icmp_input(struct mbuf **mp, int *offp, E> */ E> #ifdef ICMPPRINTFS E> if (icmpprintfs) { E> - char buf[4 * sizeof "123"]; E> - strcpy(buf, inet_ntoa(ip->ip_src)); E> + char srcbuf[INET_ADDRSTRLEN]; E> + char dstbuf[INET_ADDRSTRLEN]; E> + E> printf("icmp_input from %s to %s, len %d\n", E> - buf, inet_ntoa(ip->ip_dst), icmplen); E> + inet_ntoa_r(ip->ip_src, srcbuf), E> + inet_ntoa_r(ip->ip_dst, dstbuf), icmplen); E> } E> #endif E> if (icmplen < ICMP_MINLEN) { E> @@ -649,11 +651,12 @@ reflect: E> icmpdst.sin_addr = icp->icmp_gwaddr; E> #ifdef ICMPPRINTFS E> if (icmpprintfs) { E> - char buf[4 * sizeof "123"]; E> - strcpy(buf, inet_ntoa(icp->icmp_ip.ip_dst)); E> + char dstbuf[INET_ADDRSTRLEN]; E> + char gwbuf[INET_ADDRSTRLEN]; E> E> printf("redirect dst %s to %s\n", E> - buf, inet_ntoa(icp->icmp_gwaddr)); E> + inet_ntoa_r(icp->icmp_ip.ip_dst, dstbuf), E> + inet_ntoa_r(icp->icmp_gwaddr, gwbuf)); E> } E> #endif E> icmpsrc.sin_addr = icp->icmp_ip.ip_dst; E> @@ -901,10 +904,12 @@ icmp_send(struct mbuf *m, struct mbuf *o E> m->m_pkthdr.rcvif = (struct ifnet *)0; E> #ifdef ICMPPRINTFS E> if (icmpprintfs) { E> - char buf[4 * sizeof "123"]; E> - strcpy(buf, inet_ntoa(ip->ip_dst)); E> + char dstbuf[INET_ADDRSTRLEN]; E> + char srcbuf[INET_ADDRSTRLEN]; E> + E> printf("icmp_send dst %s src %s\n", E> - buf, inet_ntoa(ip->ip_src)); E> + inet_ntoa_r(ip->ip_dst, dstbuf), E> + inet_ntoa_r(ip->ip_src, srcbuf)); E> } E> #endif E> (void) ip_output(m, opts, NULL, 0, NULL, NULL); E> E> Modified: head/sys/netinet/ip_mroute.c E> ============================================================================== E> --- head/sys/netinet/ip_mroute.c Thu Feb 16 20:44:44 2017 (r313820) E> +++ head/sys/netinet/ip_mroute.c Thu Feb 16 20:47:41 2017 (r313821) E> @@ -845,6 +845,9 @@ add_vif(struct vifctl *vifcp) E> struct ifaddr *ifa; E> struct ifnet *ifp; E> int error; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> VIF_LOCK(); E> if (vifcp->vifc_vifi >= MAXVIFS) { E> @@ -929,7 +932,7 @@ add_vif(struct vifctl *vifcp) E> VIF_UNLOCK(); E> E> CTR4(KTR_IPMF, "%s: add vif %d laddr %s thresh %x", __func__, E> - (int)vifcp->vifc_vifi, inet_ntoa(vifcp->vifc_lcl_addr), E> + (int)vifcp->vifc_vifi, inet_ntoa_r(vifcp->vifc_lcl_addr, addrbuf), E> (int)vifcp->vifc_threshold); E> E> return 0; E> @@ -1052,6 +1055,9 @@ add_mfc(struct mfcctl2 *mfccp) E> struct rtdetq *rte, *nrte; E> u_long hash = 0; E> u_short nstl; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> VIF_LOCK(); E> MFC_LOCK(); E> @@ -1061,7 +1067,7 @@ add_mfc(struct mfcctl2 *mfccp) E> /* If an entry already exists, just update the fields */ E> if (rt) { E> CTR4(KTR_IPMF, "%s: update mfc orig %s group %lx parent %x", E> - __func__, inet_ntoa(mfccp->mfcc_origin), E> + __func__, inet_ntoa_r(mfccp->mfcc_origin, addrbuf), E> (u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr), E> mfccp->mfcc_parent); E> update_mfc_params(rt, mfccp); E> @@ -1081,7 +1087,7 @@ add_mfc(struct mfcctl2 *mfccp) E> !TAILQ_EMPTY(&rt->mfc_stall)) { E> CTR5(KTR_IPMF, E> "%s: add mfc orig %s group %lx parent %x qh %p", E> - __func__, inet_ntoa(mfccp->mfcc_origin), E> + __func__, inet_ntoa_r(mfccp->mfcc_origin, addrbuf), E> (u_long)ntohl(mfccp->mfcc_mcastgrp.s_addr), E> mfccp->mfcc_parent, E> TAILQ_FIRST(&rt->mfc_stall)); E> @@ -1155,12 +1161,15 @@ del_mfc(struct mfcctl2 *mfccp) E> struct in_addr origin; E> struct in_addr mcastgrp; E> struct mfc *rt; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> origin = mfccp->mfcc_origin; E> mcastgrp = mfccp->mfcc_mcastgrp; E> E> CTR3(KTR_IPMF, "%s: delete mfc orig %s group %lx", __func__, E> - inet_ntoa(origin), (u_long)ntohl(mcastgrp.s_addr)); E> + inet_ntoa_r(origin, addrbuf), (u_long)ntohl(mcastgrp.s_addr)); E> E> MFC_LOCK(); E> E> @@ -1223,9 +1232,13 @@ X_ip_mforward(struct ip *ip, struct ifne E> struct mfc *rt; E> int error; E> vifi_t vifi; E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> E> CTR3(KTR_IPMF, "ip_mforward: delete mfc orig %s group %lx ifp %p", E> - inet_ntoa(ip->ip_src), (u_long)ntohl(ip->ip_dst.s_addr), ifp); E> + inet_ntoa_r(ip->ip_src, addrbuf), (u_long)ntohl(ip->ip_dst.s_addr), E> + ifp); E> E> if (ip->ip_hl < (sizeof(struct ip) + TUNNEL_LEN) >> 2 || E> ((u_char *)(ip + 1))[1] != IPOPT_LSRR ) { E> @@ -1288,7 +1301,7 @@ X_ip_mforward(struct ip *ip, struct ifne E> MRTSTAT_INC(mrts_mfc_misses); E> MRTSTAT_INC(mrts_no_route); E> CTR2(KTR_IPMF, "ip_mforward: no mfc for (%s,%lx)", E> - inet_ntoa(ip->ip_src), (u_long)ntohl(ip->ip_dst.s_addr)); E> + inet_ntoa_r(ip->ip_src, addrbuf), (u_long)ntohl(ip->ip_dst.s_addr)); E> E> /* E> * Allocate mbufs early so that we don't do extra work if we are E> @@ -2570,7 +2583,10 @@ pim_input(struct mbuf **mp, int *offp, i E> int minlen; E> int datalen = ntohs(ip->ip_len) - iphlen; E> int ip_tos; E> - E> +#ifdef KTR E> + char addrbuf[INET_ADDRSTRLEN]; E> +#endif E> + E> *mp = NULL; E> E> /* Keep statistics */ E> @@ -2583,7 +2599,7 @@ pim_input(struct mbuf **mp, int *offp, i E> if (datalen < PIM_MINLEN) { E> PIMSTAT_INC(pims_rcv_tooshort); E> CTR3(KTR_IPMF, "%s: short packet (%d) from %s", E> - __func__, datalen, inet_ntoa(ip->ip_src)); E> + __func__, datalen, inet_ntoa_r(ip->ip_src, addrbuf)); E> m_freem(m); E> return (IPPROTO_DONE); E> } E> @@ -2683,7 +2699,8 @@ pim_input(struct mbuf **mp, int *offp, i E> encap_ip = (struct ip *)(reghdr + 1); E> E> CTR3(KTR_IPMF, "%s: register: encap ip src %s len %d", E> - __func__, inet_ntoa(encap_ip->ip_src), ntohs(encap_ip->ip_len)); E> + __func__, inet_ntoa_r(encap_ip->ip_src, addrbuf), E> + ntohs(encap_ip->ip_len)); E> E> /* verify the version number of the inner packet */ E> if (encap_ip->ip_v != IPVERSION) { E> @@ -2697,7 +2714,7 @@ pim_input(struct mbuf **mp, int *offp, i E> if (!IN_MULTICAST(ntohl(encap_ip->ip_dst.s_addr))) { E> PIMSTAT_INC(pims_rcv_badregisters); E> CTR2(KTR_IPMF, "%s: bad encap ip dest %s", __func__, E> - inet_ntoa(encap_ip->ip_dst)); E> + inet_ntoa_r(encap_ip->ip_dst, addrbuf)); E> m_freem(m); E> return (IPPROTO_DONE); E> } E> E> Modified: head/sys/netinet/ip_options.c E> ============================================================================== E> --- head/sys/netinet/ip_options.c Thu Feb 16 20:44:44 2017 (r313820) E> +++ head/sys/netinet/ip_options.c Thu Feb 16 20:47:41 2017 (r313821) E> @@ -196,16 +196,19 @@ ip_dooptions(struct mbuf *m, int pass) E> #endif E> if (!V_ip_dosourceroute) { E> if (V_ipforwarding) { E> - char buf[16]; /* aaa.bbb.ccc.ddd\0 */ E> + char srcbuf[INET_ADDRSTRLEN]; E> + char dstbuf[INET_ADDRSTRLEN]; E> + E> /* E> * Acting as a router, so generate E> * ICMP E> */ E> nosourcerouting: E> - strcpy(buf, inet_ntoa(ip->ip_dst)); E> log(LOG_WARNING, E> - "attempted source route from %s to %s\n", E> - inet_ntoa(ip->ip_src), buf); E> + "attempted source route from %s " E> + "to %s\n", E> E> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** E> _______________________________________________ E> svn-src-all@freebsd.org mailing list E> https://lists.freebsd.org/mailman/listinfo/svn-src-all E> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Feb 17 04:29:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E91B4CDBEAC; Fri, 17 Feb 2017 04:29:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8CBC1C6C; Fri, 17 Feb 2017 04:29:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1H4TNSp003694; Fri, 17 Feb 2017 04:29:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1H4TNUI003693; Fri, 17 Feb 2017 04:29:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702170429.v1H4TNUI003693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 17 Feb 2017 04:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313851 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 04:29:25 -0000 Author: mav Date: Fri Feb 17 04:29:23 2017 New Revision: 313851 URL: https://svnweb.freebsd.org/changeset/base/313851 Log: Fix tight loop spinning on postponed requests. MFC after: 2 weeks Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Fri Feb 17 03:27:20 2017 (r313850) +++ head/sys/dev/iscsi/iscsi.c Fri Feb 17 04:29:23 2017 (r313851) @@ -475,15 +475,14 @@ iscsi_maintenance_thread_terminate(struc static void iscsi_maintenance_thread(void *arg) { - struct iscsi_session *is; - - is = arg; + struct iscsi_session *is = arg; + ISCSI_SESSION_LOCK(is); for (;;) { - ISCSI_SESSION_LOCK(is); if (is->is_reconnecting == false && is->is_terminating == false && - STAILQ_EMPTY(&is->is_postponed)) + (STAILQ_EMPTY(&is->is_postponed) || + ISCSI_SNGT(is->is_cmdsn, is->is_maxcmdsn))) cv_wait(&is->is_maintenance_cv, &is->is_lock); /* Terminate supersedes reconnect. */ @@ -497,12 +496,13 @@ iscsi_maintenance_thread(void *arg) if (is->is_reconnecting) { ISCSI_SESSION_UNLOCK(is); iscsi_maintenance_thread_reconnect(is); + ISCSI_SESSION_LOCK(is); continue; } iscsi_session_send_postponed(is); - ISCSI_SESSION_UNLOCK(is); } + ISCSI_SESSION_UNLOCK(is); } static void From owner-svn-src-head@freebsd.org Fri Feb 17 04:34:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BFEFCDF065; Fri, 17 Feb 2017 04:34:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E25F9105A; Fri, 17 Feb 2017 04:34:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1H4YHbk007430; Fri, 17 Feb 2017 04:34:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1H4YHoF007429; Fri, 17 Feb 2017 04:34:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702170434.v1H4YHoF007429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 17 Feb 2017 04:34:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313852 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 04:34:19 -0000 Author: mav Date: Fri Feb 17 04:34:17 2017 New Revision: 313852 URL: https://svnweb.freebsd.org/changeset/base/313852 Log: Freeze CAM SIM when request is postponed due to MaxCmdSN. This allows to avoid resource allocation (especially offload) for requests that can not be executed at this time any way. MFC after: 2 weeks Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Fri Feb 17 04:29:23 2017 (r313851) +++ head/sys/dev/iscsi/iscsi.c Fri Feb 17 04:34:17 2017 (r313852) @@ -231,14 +231,16 @@ iscsi_session_send_postponed(struct iscs ISCSI_SESSION_LOCK_ASSERT(is); - while (!STAILQ_EMPTY(&is->is_postponed)) { - request = STAILQ_FIRST(&is->is_postponed); + if (STAILQ_EMPTY(&is->is_postponed)) + return; + while ((request = STAILQ_FIRST(&is->is_postponed)) != NULL) { postpone = iscsi_pdu_prepare(request); if (postpone) - break; + return; STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next); icl_pdu_queue(request); } + xpt_release_simq(is->is_sim, 1); } static void @@ -252,6 +254,8 @@ iscsi_pdu_queue_locked(struct icl_pdu *r iscsi_session_send_postponed(is); postpone = iscsi_pdu_prepare(request); if (postpone) { + if (STAILQ_EMPTY(&is->is_postponed)) + xpt_freeze_simq(is->is_sim, 1); STAILQ_INSERT_TAIL(&is->is_postponed, request, ip_next); return; } @@ -339,8 +343,9 @@ iscsi_session_cleanup(struct iscsi_sessi /* * Remove postponed PDUs. */ - while (!STAILQ_EMPTY(&is->is_postponed)) { - pdu = STAILQ_FIRST(&is->is_postponed); + if (!STAILQ_EMPTY(&is->is_postponed)) + xpt_release_simq(is->is_sim, 1); + while ((pdu = STAILQ_FIRST(&is->is_postponed)) != NULL) { STAILQ_REMOVE_HEAD(&is->is_postponed, ip_next); icl_pdu_free(pdu); } From owner-svn-src-head@freebsd.org Fri Feb 17 05:09:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BBDCCDF6DF; Fri, 17 Feb 2017 05:09:53 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23ED21BDC; Fri, 17 Feb 2017 05:09:53 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1H59qnO019804; Fri, 17 Feb 2017 05:09:52 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1H59qJA019801; Fri, 17 Feb 2017 05:09:52 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702170509.v1H59qJA019801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 17 Feb 2017 05:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313853 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 05:09:53 -0000 Author: mjg Date: Fri Feb 17 05:09:51 2017 New Revision: 313853 URL: https://svnweb.freebsd.org/changeset/base/313853 Log: locks: remove SCHEDULER_STOPPED checks from primitives for modules They all fallback to the slow path if necessary and the check is there. This means a panicked kernel executing code from modules will be able to succeed doing actual lock/unlock, but this was already the case for core code which has said primitives inlined. Modified: head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Fri Feb 17 04:34:17 2017 (r313852) +++ head/sys/kern/kern_mutex.c Fri Feb 17 05:09:51 2017 (r313853) @@ -231,9 +231,6 @@ __mtx_lock_flags(volatile uintptr_t *c, struct mtx *m; uintptr_t tid, v; - if (SCHEDULER_STOPPED()) - return; - m = mtxlock2mtx(c); KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread), @@ -266,9 +263,6 @@ __mtx_unlock_flags(volatile uintptr_t *c { struct mtx *m; - if (SCHEDULER_STOPPED()) - return; - m = mtxlock2mtx(c); KASSERT(m->mtx_lock != MTX_DESTROYED, Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Fri Feb 17 04:34:17 2017 (r313852) +++ head/sys/kern/kern_rwlock.c Fri Feb 17 05:09:51 2017 (r313853) @@ -267,9 +267,6 @@ _rw_wlock_cookie(volatile uintptr_t *c, struct rwlock *rw; uintptr_t tid, v; - if (SCHEDULER_STOPPED()) - return; - rw = rwlock2rw(c); KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread), @@ -335,9 +332,6 @@ _rw_wunlock_cookie(volatile uintptr_t *c { struct rwlock *rw; - if (SCHEDULER_STOPPED()) - return; - rw = rwlock2rw(c); KASSERT(rw->rw_lock != RW_DESTROYED, Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Fri Feb 17 04:34:17 2017 (r313852) +++ head/sys/kern/kern_sx.c Fri Feb 17 05:09:51 2017 (r313853) @@ -295,8 +295,6 @@ _sx_xlock(struct sx *sx, int opts, const uintptr_t tid, x; int error = 0; - if (SCHEDULER_STOPPED()) - return (0); KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread), ("sx_xlock() by idle thread %p on sx %s @ %s:%d", curthread, sx->lock_object.lo_name, file, line)); @@ -360,8 +358,6 @@ void _sx_xunlock(struct sx *sx, const char *file, int line) { - if (SCHEDULER_STOPPED()) - return; KASSERT(sx->sx_lock != SX_LOCK_DESTROYED, ("sx_xunlock() of destroyed sx @ %s:%d", file, line)); _sx_assert(sx, SA_XLOCKED, file, line); From owner-svn-src-head@freebsd.org Fri Feb 17 05:22:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFE85CDFB24; Fri, 17 Feb 2017 05:22:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D63912C2; Fri, 17 Feb 2017 05:22:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1H5MwC0027648; Fri, 17 Feb 2017 05:22:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1H5MwGK027647; Fri, 17 Feb 2017 05:22:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702170522.v1H5MwGK027647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 17 Feb 2017 05:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313854 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 05:23:00 -0000 Author: mav Date: Fri Feb 17 05:22:58 2017 New Revision: 313854 URL: https://svnweb.freebsd.org/changeset/base/313854 Log: Change the way MaxCmdSN is used. Before this change MaxCmdSN was reported as CmdSN + delta, that made it limit number of requests in transmission from the initiator to target, that was pretty useless. After this change MaxCmdSN limits number of requests queued to CTL, i.e. maximal queue depth for the initiator. The default limit is 256 outstanding requests per initiator at a time. This code uses existing cs_outstanding_ctl_pdus counter to track queue depth. It's semantics doen't perfectly match, but close enough to not add another counter. Just don't set the maxtags below 2. MFC after: 2 weeks 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 Fri Feb 17 05:09:51 2017 (r313853) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Fri Feb 17 05:22:58 2017 (r313854) @@ -95,10 +95,9 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO static int login_timeout = 60; SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, login_timeout, CTLFLAG_RWTUN, &login_timeout, 60, "Time to wait for ctld(8) to finish Login Phase, in seconds"); -static int maxcmdsn_delta = 256; -SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxcmdsn_delta, CTLFLAG_RWTUN, - &maxcmdsn_delta, 256, "Number of commands the initiator can send " - "without confirmation"); +static int maxtags = 256; +SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, maxtags, CTLFLAG_RWTUN, + &maxtags, 0, "Max number of requests queued by initiator"); #define CFISCSI_DEBUG(X, ...) \ do { \ @@ -244,7 +243,7 @@ cfiscsi_pdu_update_cmdsn(const struct ic * outside of this range. */ if (ISCSI_SNLT(cmdsn, cs->cs_cmdsn) || - ISCSI_SNGT(cmdsn, cs->cs_cmdsn + maxcmdsn_delta)) { + ISCSI_SNGT(cmdsn, cs->cs_cmdsn - 1 + maxtags)) { CFISCSI_SESSION_UNLOCK(cs); CFISCSI_SESSION_WARN(cs, "received PDU with CmdSN %u, " "while expected %u", cmdsn, cs->cs_cmdsn); @@ -399,7 +398,8 @@ cfiscsi_pdu_prepare(struct icl_pdu *resp (bhssr->bhssr_flags & BHSDI_FLAGS_S)) bhssr->bhssr_statsn = htonl(cs->cs_statsn); bhssr->bhssr_expcmdsn = htonl(cs->cs_cmdsn); - bhssr->bhssr_maxcmdsn = htonl(cs->cs_cmdsn + maxcmdsn_delta); + bhssr->bhssr_maxcmdsn = htonl(cs->cs_cmdsn - 1 + + imax(0, maxtags - cs->cs_outstanding_ctl_pdus)); if (advance_statsn) cs->cs_statsn++; From owner-svn-src-head@freebsd.org Fri Feb 17 05:39:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 744E5CDFEFF; Fri, 17 Feb 2017 05:39:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EAB319D7; Fri, 17 Feb 2017 05:39:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1H5dfEE032126; Fri, 17 Feb 2017 05:39:41 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1H5de82032123; Fri, 17 Feb 2017 05:39:40 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702170539.v1H5de82032123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 17 Feb 2017 05:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313855 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 05:39:42 -0000 Author: mjg Date: Fri Feb 17 05:39:40 2017 New Revision: 313855 URL: https://svnweb.freebsd.org/changeset/base/313855 Log: locks: let primitives for modules unlock without always goging to the slsow path It is only needed if the LOCK_PROFILING is enabled. It has to always check if the lock is about to be released which requires an avoidable read if the option is not specified.. Modified: head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Fri Feb 17 05:22:58 2017 (r313854) +++ head/sys/kern/kern_mutex.c Fri Feb 17 05:39:40 2017 (r313855) @@ -275,7 +275,11 @@ __mtx_unlock_flags(volatile uintptr_t *c line); mtx_assert(m, MA_OWNED); +#ifdef LOCK_PROFILING __mtx_unlock_sleep(c, opts, file, line); +#else + __mtx_unlock(m, curthread, opts, file, line); +#endif TD_LOCKS_DEC(curthread); } Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Fri Feb 17 05:22:58 2017 (r313854) +++ head/sys/kern/kern_rwlock.c Fri Feb 17 05:39:40 2017 (r313855) @@ -341,7 +341,11 @@ _rw_wunlock_cookie(volatile uintptr_t *c LOCK_LOG_LOCK("WUNLOCK", &rw->lock_object, 0, rw->rw_recurse, file, line); +#ifdef LOCK_PROFILING _rw_wunlock_hard(rw, (uintptr_t)curthread, file, line); +#else + __rw_wunlock(rw, curthread, file, line); +#endif TD_LOCKS_DEC(curthread); } Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Fri Feb 17 05:22:58 2017 (r313854) +++ head/sys/kern/kern_sx.c Fri Feb 17 05:39:40 2017 (r313855) @@ -364,7 +364,11 @@ _sx_xunlock(struct sx *sx, const char *f WITNESS_UNLOCK(&sx->lock_object, LOP_EXCLUSIVE, file, line); LOCK_LOG_LOCK("XUNLOCK", &sx->lock_object, 0, sx->sx_recurse, file, line); +#ifdef LOCK_PROFILING _sx_xunlock_hard(sx, (uintptr_t)curthread, file, line); +#else + __sx_xunlock(sx, curthread, file, line); +#endif TD_LOCKS_DEC(curthread); } From owner-svn-src-head@freebsd.org Fri Feb 17 06:13:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D918FCE16CE; Fri, 17 Feb 2017 06:13:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0FB31711; Fri, 17 Feb 2017 06:13:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1H6DnnA048275; Fri, 17 Feb 2017 06:13:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1H6DnJH048274; Fri, 17 Feb 2017 06:13:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702170613.v1H6DnJH048274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 17 Feb 2017 06:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313856 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 06:13:51 -0000 Author: imp Date: Fri Feb 17 06:13:49 2017 New Revision: 313856 URL: https://svnweb.freebsd.org/changeset/base/313856 Log: Remove EISA build option Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Fri Feb 17 05:39:40 2017 (r313855) +++ head/sys/conf/kern.opts.mk Fri Feb 17 06:13:49 2017 (r313856) @@ -45,7 +45,6 @@ __DEFAULT_YES_OPTIONS = \ ZFS __DEFAULT_NO_OPTIONS = \ - EISA \ EXTRA_TCP_STACKS \ NAND \ OFED \ @@ -77,10 +76,6 @@ BROKEN_OPTIONS+= ZFS # Things that don't work because the kernel doesn't have the support # for them. -.if ${MACHINE} != "i386" -BROKEN_OPTIONS+= EISA -.endif - .if ${MACHINE} != "i386" && ${MACHINE} != "amd64" BROKEN_OPTIONS+= OFED .endif From owner-svn-src-head@freebsd.org Fri Feb 17 06:22:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59881CE19F5; Fri, 17 Feb 2017 06:22:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B60D11CA6; Fri, 17 Feb 2017 06:22:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1H6M0Da052293; Fri, 17 Feb 2017 06:22:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1H6M0GN052292; Fri, 17 Feb 2017 06:22:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702170622.v1H6M0GN052292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 17 Feb 2017 06:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313857 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 06:22:02 -0000 Author: imp Date: Fri Feb 17 06:22:00 2017 New Revision: 313857 URL: https://svnweb.freebsd.org/changeset/base/313857 Log: Note EISA and MCA bus removal Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Feb 17 06:13:49 2017 (r313856) +++ head/UPDATING Fri Feb 17 06:22:00 2017 (r313857) @@ -51,6 +51,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 ****************************** SPECIAL WARNING: ****************************** +20170216: + EISA bus support has been removed. The WITH_EISA option is no longer + valid. + +20170215: + MCA bus support has been removed. + 20170127: The WITH_LLD_AS_LD / WITHOUT_LLD_AS_LD build knobs have been renamed WITH_LLD_IS_LD / WITHOUT_LLD_IS_LD, for consistency with CLANG_IS_CC. From owner-svn-src-head@freebsd.org Fri Feb 17 06:22:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E18CCE1A35; Fri, 17 Feb 2017 06:22:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4BED1CD0; Fri, 17 Feb 2017 06:22:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1H6M5Yh052351; Fri, 17 Feb 2017 06:22:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1H6M5Ag052350; Fri, 17 Feb 2017 06:22:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702170622.v1H6M5Ag052350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 17 Feb 2017 06:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313858 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 06:22:08 -0000 Author: imp Date: Fri Feb 17 06:22:05 2017 New Revision: 313858 URL: https://svnweb.freebsd.org/changeset/base/313858 Log: Bump FreeBSD_version to 1200021 for removal of EISA and MCA. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Feb 17 06:22:00 2017 (r313857) +++ head/sys/sys/param.h Fri Feb 17 06:22:05 2017 (r313858) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200020 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200021 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Fri Feb 17 06:34:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A78B9CE1CE1; Fri, 17 Feb 2017 06:34:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 63CC312ED; Fri, 17 Feb 2017 06:34:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 8D78010452F1; Fri, 17 Feb 2017 17:05:55 +1100 (AEDT) Date: Fri, 17 Feb 2017 17:05:54 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mark Johnston cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313850 - in head/sys/cddl/dev/dtrace: amd64 i386 In-Reply-To: <201702170327.v1H3RKK4078742@repo.freebsd.org> Message-ID: <20170217160016.D1386@besplex.bde.org> References: <201702170327.v1H3RKK4078742@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=Ca543Pjl c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=ZDuaA4-kceXO56LHDsIA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 06:34:49 -0000 On Fri, 17 Feb 2017, Mark Johnston wrote: > Log: > Directly include needed headers rather than relying on pollution. > > We get machine/cpu.h via kmem.h -> proc.h -> _vm_domain.h -> seq.h. machine/cpu.h is not added here. Do you mean machine/cpufnc.h? > Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c > ============================================================================== > --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Fri Feb 17 00:50:00 2017 (r313849) > +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Fri Feb 17 03:27:20 2017 (r313850) > @@ -41,7 +41,9 @@ > #include > #include > #include > +#include This was correct. is standard pollution in , and it is a style bug to include it directly, and a bug to not include after and before all other headers in kernel .c files. It is pollution to include in any header except . kmem.h has grosser pollution (param, proc, malloc, vmem, vm/uma, vm/vm, vm/vm_extern, but not systm which is a prerequisite for most of the other headers that kmem.h includes). Most of the other headers also have gross pollution, ending with seq.h which includes systm.h and its standard pollution. seq.h also includes machine/cpu.h. Apparently kmem.h does depend on this, and this commit doesn't fix it. seq.h also has a nonsense include of sys/types.h after sys/systm.h. sys/types.h is a prerequisite for sys/systm.h, and is apparently usually suppied for seq.h in the usual way by including sys/param.h before all other headers in kernel files. seq.h is also polluted with sys/lock.h. It apparently only does this to get MPASS() defined. MPASS() has nothing to do with the locking in lock.h, and isn't even used there. It is just a trivial wrapper for KASSERT and probably belongs next to the definition of KASSERT() in systm.h. This wrapper mostly subtracts value by adding "Assertion... failed" and __FILE__ and __LINE__ to KASSERT(). That is, it makes the output format more like user assert(). But KASSERT() intentionally doesn't use this format, since is too generic. MPASS() is easier to use, and I suspect most uses of it are because of this and not because it is any good. In kern, there are 1214 KASSERT()s and 346 MPASS(), with MPASS(). > #include > +#include This include is not mentioned in the log message. machine/psl.h is stamdard pollution in machine/cpu.h (on at least amd64 and i386), so would not be needed here if machine/cpu.h had been spelled correctly. > #include > > extern void dtrace_getnanotime(struct timespec *tsp); The timestamping seems over-engineered, but it has a chance of working, unlike KTR timestamps which just used unscaled get_cyclecount() whatever that is (it is raw TSC on most x86, and KTR doesn't even record its current frequency to give the user a chance of scaling). Bruce From owner-svn-src-head@freebsd.org Fri Feb 17 06:45:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 356E7CE1EE8; Fri, 17 Feb 2017 06:45:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F348317B6; Fri, 17 Feb 2017 06:45:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1H6j5ER060551; Fri, 17 Feb 2017 06:45:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1H6j4l6060548; Fri, 17 Feb 2017 06:45:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702170645.v1H6j4l6060548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 17 Feb 2017 06:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313859 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 06:45:06 -0000 Author: mjg Date: Fri Feb 17 06:45:04 2017 New Revision: 313859 URL: https://svnweb.freebsd.org/changeset/base/313859 Log: Introduce SCHEDULER_STOPPED_TD for use when the thread pointer was already read Sprinkle in few places. Modified: head/sys/kern/kern_condvar.c head/sys/kern/kern_synch.c head/sys/sys/systm.h Modified: head/sys/kern/kern_condvar.c ============================================================================== --- head/sys/kern/kern_condvar.c Fri Feb 17 06:22:05 2017 (r313858) +++ head/sys/kern/kern_condvar.c Fri Feb 17 06:45:04 2017 (r313859) @@ -122,7 +122,7 @@ _cv_wait(struct cv *cvp, struct lock_obj "Waiting on \"%s\"", cvp->cv_description); class = LOCK_CLASS(lock); - if (SCHEDULER_STOPPED()) + if (SCHEDULER_STOPPED_TD(td)) return; sleepq_lock(cvp); @@ -176,7 +176,7 @@ _cv_wait_unlock(struct cv *cvp, struct l ("cv_wait_unlock cannot be used with Giant")); class = LOCK_CLASS(lock); - if (SCHEDULER_STOPPED()) { + if (SCHEDULER_STOPPED_TD(td)) { class->lc_unlock(lock); return; } @@ -227,7 +227,7 @@ _cv_wait_sig(struct cv *cvp, struct lock "Waiting on \"%s\"", cvp->cv_description); class = LOCK_CLASS(lock); - if (SCHEDULER_STOPPED()) + if (SCHEDULER_STOPPED_TD(td)) return (0); sleepq_lock(cvp); @@ -287,7 +287,7 @@ _cv_timedwait_sbt(struct cv *cvp, struct "Waiting on \"%s\"", cvp->cv_description); class = LOCK_CLASS(lock); - if (SCHEDULER_STOPPED()) + if (SCHEDULER_STOPPED_TD(td)) return (0); sleepq_lock(cvp); @@ -349,7 +349,7 @@ _cv_timedwait_sig_sbt(struct cv *cvp, st "Waiting on \"%s\"", cvp->cv_description); class = LOCK_CLASS(lock); - if (SCHEDULER_STOPPED()) + if (SCHEDULER_STOPPED_TD(td)) return (0); sleepq_lock(cvp); Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Fri Feb 17 06:22:05 2017 (r313858) +++ head/sys/kern/kern_synch.c Fri Feb 17 06:45:04 2017 (r313859) @@ -162,7 +162,7 @@ _sleep(void *ident, struct lock_object * else class = NULL; - if (SCHEDULER_STOPPED()) { + if (SCHEDULER_STOPPED_TD(td)) { if (lock != NULL && priority & PDROP) class->lc_unlock(lock); return (0); @@ -250,7 +250,7 @@ msleep_spin_sbt(void *ident, struct mtx KASSERT(ident != NULL, ("msleep_spin_sbt: NULL ident")); KASSERT(TD_IS_RUNNING(td), ("msleep_spin_sbt: curthread not running")); - if (SCHEDULER_STOPPED()) + if (SCHEDULER_STOPPED_TD(td)) return (0); sleepq_lock(ident); @@ -411,7 +411,7 @@ mi_switch(int flags, struct thread *newt */ if (kdb_active) kdb_switch(); - if (SCHEDULER_STOPPED()) + if (SCHEDULER_STOPPED_TD(td)) return; if (flags & SW_VOL) { td->td_ru.ru_nvcsw++; Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Feb 17 06:22:05 2017 (r313858) +++ head/sys/sys/systm.h Fri Feb 17 06:45:04 2017 (r313859) @@ -128,7 +128,11 @@ void kassert_panic(const char *fmt, ...) * Otherwise, the kernel will deadlock since the scheduler isn't * going to run the thread that holds any lock we need. */ -#define SCHEDULER_STOPPED() __predict_false(curthread->td_stopsched) +#define SCHEDULER_STOPPED_TD(td) ({ \ + MPASS((td) == curthread); \ + __predict_false((td)->td_stopsched); \ +}) +#define SCHEDULER_STOPPED() SCHEDULER_STOPPED_TD(curthread) /* * Align variables. From owner-svn-src-head@freebsd.org Fri Feb 17 06:49:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3293BCE1FB8; Fri, 17 Feb 2017 06:49:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCA83195A; Fri, 17 Feb 2017 06:49:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1H6nk3c060924; Fri, 17 Feb 2017 06:49:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1H6nkbu060922; Fri, 17 Feb 2017 06:49:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702170649.v1H6nkbu060922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 17 Feb 2017 06:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313860 - head/sys/dev/aha X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 06:49:48 -0000 Author: imp Date: Fri Feb 17 06:49:46 2017 New Revision: 313860 URL: https://svnweb.freebsd.org/changeset/base/313860 Log: Remove residuals of mca support Modified: head/sys/dev/aha/aha.c head/sys/dev/aha/ahareg.h Modified: head/sys/dev/aha/aha.c ============================================================================== --- head/sys/dev/aha/aha.c Fri Feb 17 06:45:04 2017 (r313859) +++ head/sys/dev/aha/aha.c Fri Feb 17 06:49:46 2017 (r313860) @@ -1,9 +1,8 @@ /* - * Generic register and struct definitions for the Adaptech 154x/164x + * Generic register and struct definitions for the Adaptech 154x * SCSI host adapters. Product specific probe and attach routines can * be found in: * aha 1542A/1542B/1542C/1542CF/1542CP aha_isa.c - * aha 1640 aha_mca.c */ /*- * Copyright (c) 1998 M. Warner Losh. @@ -339,9 +338,6 @@ aha_fetch_adapter_info(struct aha_softc case BOARD_1542: snprintf(aha->model, sizeof(aha->model), "1540/1542 64 head BIOS"); break; - case BOARD_1640: - snprintf(aha->model, sizeof(aha->model), "1640"); - break; case BOARD_1740: snprintf(aha->model, sizeof(aha->model), "1740A/1742A/1744"); break; Modified: head/sys/dev/aha/ahareg.h ============================================================================== --- head/sys/dev/aha/ahareg.h Fri Feb 17 06:45:04 2017 (r313859) +++ head/sys/dev/aha/ahareg.h Fri Feb 17 06:49:46 2017 (r313860) @@ -1,8 +1,8 @@ /*- * Generic register and struct definitions for the Adaptech 1540, 1542, - * 1640, 1642 SCSI host adapters. Product specific probe and attach + * SCSI host adapters. Product specific probe and attach * routines can be found in: - * aha_isa.c, aha_mca.c + * aha_isa.c * * Derived from bt.c written by: * @@ -157,7 +157,6 @@ typedef struct { #define BOARD_1540_16HEAD_BIOS 0x00 #define BOARD_1540_64HEAD_BIOS 0x30 #define BOARD_1542 0x41 /* aha-1540/1542 w/64-h bios */ -#define BOARD_1640 0x42 /* aha-1640 */ #define BOARD_1740 0x43 /* aha-1740A/1742A/1744 */ #define BOARD_1542C 0x44 /* aha-1542C */ #define BOARD_1542CF 0x45 /* aha-1542CF */ From owner-svn-src-head@freebsd.org Fri Feb 17 06:49:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E922CCE1FF9; Fri, 17 Feb 2017 06:49:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A05EB1A11; Fri, 17 Feb 2017 06:49:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1H6nsO9060982; Fri, 17 Feb 2017 06:49:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1H6ns0k060978; Fri, 17 Feb 2017 06:49:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201702170649.v1H6ns0k060978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 17 Feb 2017 06:49:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313861 - in head: share/man/man4 sys/dev/aha X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 06:49:56 -0000 Author: imp Date: Fri Feb 17 06:49:54 2017 New Revision: 313861 URL: https://svnweb.freebsd.org/changeset/base/313861 Log: Remove ahb references as well as 1640 info in aha.4 Modified: head/share/man/man4/aha.4 head/sys/dev/aha/aha.c head/sys/dev/aha/ahareg.h Modified: head/share/man/man4/aha.4 ============================================================================== --- head/share/man/man4/aha.4 Fri Feb 17 06:49:46 2017 (r313860) +++ head/share/man/man4/aha.4 Fri Feb 17 06:49:54 2017 (r313861) @@ -54,14 +54,9 @@ In .Sh DESCRIPTION This driver provides access to the .Tn SCSI -bus connected to the Adaptec AHA-154x and AHA-1640 SCSI host adapters. +bus connected to the Adaptec AHA-154x SCSI host adapters. x is 0 for controllers without a floppy drive and 2 for controllers that have them. -For optimum -performance, Adaptec AHA-174x controllers should be configured in -enhanced mode and attached via the -.Xr ahb 4 -driver. .Pp One device hint entry for every card to be attached by the system is required. @@ -89,16 +84,11 @@ Adaptec AHA-154xCF .It Adaptec AHA-154xCP .It -Adaptec AHA-1640 -.It -Adaptec AHA-174x in 154x emulation mode -.It DTC 3290 SCSI controller in 1542 emulation mode .It Tekram SCSI controllers in 154x emulation mode .El .Sh SEE ALSO -.Xr ahb 4 , .Xr ahc 4 , .Xr aic 4 , .Xr cd 4 , Modified: head/sys/dev/aha/aha.c ============================================================================== --- head/sys/dev/aha/aha.c Fri Feb 17 06:49:46 2017 (r313860) +++ head/sys/dev/aha/aha.c Fri Feb 17 06:49:54 2017 (r313861) @@ -338,9 +338,6 @@ aha_fetch_adapter_info(struct aha_softc case BOARD_1542: snprintf(aha->model, sizeof(aha->model), "1540/1542 64 head BIOS"); break; - case BOARD_1740: - snprintf(aha->model, sizeof(aha->model), "1740A/1742A/1744"); - break; case BOARD_1542C: snprintf(aha->model, sizeof(aha->model), "1542C"); break; Modified: head/sys/dev/aha/ahareg.h ============================================================================== --- head/sys/dev/aha/ahareg.h Fri Feb 17 06:49:46 2017 (r313860) +++ head/sys/dev/aha/ahareg.h Fri Feb 17 06:49:54 2017 (r313861) @@ -157,7 +157,6 @@ typedef struct { #define BOARD_1540_16HEAD_BIOS 0x00 #define BOARD_1540_64HEAD_BIOS 0x30 #define BOARD_1542 0x41 /* aha-1540/1542 w/64-h bios */ -#define BOARD_1740 0x43 /* aha-1740A/1742A/1744 */ #define BOARD_1542C 0x44 /* aha-1542C */ #define BOARD_1542CF 0x45 /* aha-1542CF */ #define BOARD_1542CP 0x46 /* aha-1542CP, plug and play */ From owner-svn-src-head@freebsd.org Fri Feb 17 07:16:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A77CECE270D; Fri, 17 Feb 2017 07:16:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 562CD18EE; Fri, 17 Feb 2017 07:16:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 7F184D67110; Fri, 17 Feb 2017 18:15:52 +1100 (AEDT) Date: Fri, 17 Feb 2017 18:15:52 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff cc: Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313821 - in head/sys: dev/cxgb/ulp/iw_cxgb fs/nfsserver kern netinet netinet/libalias netpfil/ipfw In-Reply-To: <20170217041748.GI58829@FreeBSD.org> Message-ID: <20170217170724.B1386@besplex.bde.org> References: <201702162047.v1GKlf9j014479@repo.freebsd.org> <20170217041748.GI58829@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=ZI_ac5DnKVBrprJGNNMA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 07:16:00 -0000 On Thu, 16 Feb 2017, Gleb Smirnoff wrote: > heh, things are worse. Multiple places you changes are CTR() > macros. Neither inet_ntoa() nor inet_ntoa_r() will work with > them. :( > > Basicly non-constant strings can not be logged with KTR. All > the lines you touched should log actual binary value of the > IPv4 address. > > I am not asking you to do this work! :) But I couldn't leave > that without a comment. Nothing in KTR printing (exept %% and literals) works right. %s is only works for strings in kernel memory (fetched by kread() in ktrdump(8)). All args, even for the string pointers for %s, have type u_long. ktrdump doesn't check or translate formats, so all format descriptors except %lu (possibly qualified) except %lu give undefined behaviour that mostly works. ktr_tracepoint() only takes (printing) args of type u_long, and CTR6() casts to this. These casts inhibit type checking, and printf format is defeated by the use of non-const strings when ktrdump sees the format and by not using a variadic printf-like function for ktr_tracepoint(). > On Thu, Feb 16, 2017 at 08:47:41PM +0000, Eric van Gyzen wrote: > E> Author: vangyzen > E> Date: Thu Feb 16 20:47:41 2017 > E> New Revision: 313821 > E> URL: https://svnweb.freebsd.org/changeset/base/313821 > E> > E> Log: > E> Use inet_ntoa_r() instead of inet_ntoa() throughout the kernel > E> > E> inet_ntoa() cannot be used safely in a multithreaded environment > E> because it uses a static local buffer. Instead, use inet_ntoa_r() > E> with a buffer on the caller's stack. This is a lot of churn. _r functions are hard to use. If inet_ntoa() had not already existed, then someone should have invented it. It used to be a reasonable hack for functions that return static buffers to use an array of such buffers, with each caller getting a unique buffer unless the calls arrive at a high rate or the buffers remain in use for too long. This is not good enough with threads and/or preemption. The kernel inet_ntoa() didn't even do that. A good enough inet_ntoa() is easy to implement using alloca(). Something like: #define inet_ntoa(in) __extension__ ({ \ char *__cp; \ \ __cp = alloca(16); \ inet_ntoa_r(in, __cp, 16); \ }) I don't know how to do this using VLAs. The allocation must live until after leaving the the macro. alloc() maks it live until the end of the function. Kernel use must be careful not to allocate too much using alloca(), but this is not much harder than using explicit auto declarations. Compilers usually pessimize the auto declarations for space, so their space is not overlapped or reclaimed until the end of the function. alloca() only creates garbage at a higher rate if it is used in a loop. Converting to use malloc() would be worse than using auto declarations, since malloc() is slower and messier to clean up, though the actual malloc() can be hidden in a macro like the above. Implementations of alloca() on to of malloc() try to do garbage collection on function return (really on the next call to alloca(), if it detects that results of previous call(s) are garbage by looking at magic related to the calls). The latter is related to the simpler implementation with an array of static buffers. Even more simply and portably, I think it works to use a per-thread buffer: char td_msgbuf[32]; /* Buffer for small messages. */ ... #define td_alloc_msg(size) ... #define inet_ntoa(in) inet_ntoa_r(in, td_alloc_msg(16), 16) where td_alloc_msg(size) has to allocate 'size' bytes in curthread->td_msbug, circularly, starting at the previous position. This is the implementation using a static array, except I made td_msgbuf[64] generic so that it can be used for other functions with small buffer sizes other than 16. The sub-buffers are unique for each thread provided too many of them aren't used in a single statement. 64 allows just 2 buffers of size 16 for use in code like: printf("src %s, dst %s\n", inet_ntoa(src), inet_ntoa(dst)); You can also have 2 active assignments of inet_ntoa(any) at a time. If you want more, then expand the 32. This is already easier to use than the old inet_ntoa(9) -- using that required the discipline of only having 1 active assignment at a time, and using a UP && !PREEMPTION kernel to avoid races. Even more simpler to implement, but harder to use: char td_inet_ntoa_buf[16]; ... #define inet_ntoa(in) inet_ntoa_r(in, curthread->td_inet_ntoa_buf, 16) Callers now have to copy the result if they want to use more than 1 result. Old code already did this. Bruce From owner-svn-src-head@freebsd.org Fri Feb 17 08:22:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D5F2CE0019; Fri, 17 Feb 2017 08:22:33 +0000 (UTC) (envelope-from mmokhi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D5BD19F9; Fri, 17 Feb 2017 08:22:33 +0000 (UTC) (envelope-from mmokhi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1H8MWdJ001444; Fri, 17 Feb 2017 08:22:32 GMT (envelope-from mmokhi@FreeBSD.org) Received: (from mmokhi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1H8MWfK001442; Fri, 17 Feb 2017 08:22:32 GMT (envelope-from mmokhi@FreeBSD.org) Message-Id: <201702170822.v1H8MWfK001442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmokhi set sender to mmokhi@FreeBSD.org using -f From: Mahdi Mokhtari Date: Fri, 17 Feb 2017 08:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313863 - in 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 08:22:33 -0000 Author: mmokhi (ports committer) Date: Fri Feb 17 08:22:32 2017 New Revision: 313863 URL: https://svnweb.freebsd.org/changeset/base/313863 Log: Fix building of r313761 on platforms that `long double` is alias of `double` (MIPS, etc) PR: 216850 216851 216852 216856 216857 216858 Reported by: emsate Reviewed by: bde emaste hselasky Approved by: bde emaste hselasky Differential Revision: https://reviews.freebsd.org/D9491 Modified: head/lib/msun/Makefile head/lib/msun/src/catrig.c Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Fri Feb 17 07:08:37 2017 (r313862) +++ head/lib/msun/Makefile Fri Feb 17 08:22:32 2017 (r313863) @@ -94,7 +94,8 @@ SYMBOL_MAPS= ${SYM_MAPS} COMMON_SRCS+= s_copysignl.c s_fabsl.c s_llrintl.c s_lrintl.c s_modfl.c .if ${LDBL_PREC} != 53 # If long double != double use these; otherwise, we alias the double versions. -COMMON_SRCS+= e_acoshl.c e_acosl.c e_asinl.c e_atan2l.c e_atanhl.c \ +COMMON_SRCS+= catrigl.c \ + e_acoshl.c e_acosl.c e_asinl.c e_atan2l.c e_atanhl.c \ e_coshl.c e_fmodl.c e_hypotl.c \ e_lgammal.c e_lgammal_r.c \ e_remainderl.c e_sinhl.c e_sqrtl.c \ @@ -107,7 +108,7 @@ COMMON_SRCS+= e_acoshl.c e_acosl.c e_asi .endif # C99 complex functions -COMMON_SRCS+= catrig.c catrigf.c catrigl.c \ +COMMON_SRCS+= catrig.c catrigf.c \ s_ccosh.c s_ccoshf.c s_cexp.c s_cexpf.c \ s_cimag.c s_cimagf.c s_cimagl.c \ s_conj.c s_conjf.c s_conjl.c \ @@ -147,9 +148,12 @@ MLINKS+=atan.3 atanf.3 atan.3 atanl.3 MLINKS+=atanh.3 atanhf.3 atanh.3 atanhl.3 MLINKS+=atan2.3 atan2f.3 atan2.3 atan2l.3 \ atan2.3 carg.3 atan2.3 cargf.3 atan2.3 cargl.3 -MLINKS+=cacos.3 cacosf.3 cacos.3 cacosh.3 cacos.3 cacoshf.3 \ - cacos.3 casin.3 cacos.3 casinf.3 cacos.3 casinh.3 cacos.3 casinhf.3 \ - cacos.3 catan.3 cacos.3 catanf.3 cacos.3 catanh.3 cacos.3 catanhf.3 +MLINKS+=cacos.3 cacosf.3 cacos.3 cacosl.3 \ + cacos.3 cacosh.3 cacos.3 cacoshf.3 cacos.3 cacoshl.3 \ + cacos.3 casin.3 cacos.3 casinf.3 cacos.3 casinl.3 \ + cacos.3 casinh.3 cacos.3 casinhf.3 cacos.3 casinhl.3 \ + cacos.3 catan.3 cacos.3 catanf.3 cacos.3 catanl.3 \ + cacos.3 catanh.3 cacos.3 catanhf.3 cacos.3 catanhl.3 MLINKS+=ccos.3 ccosf.3 ccos.3 csin.3 ccos.3 csinf.3 ccos.3 ctan.3 ccos.3 ctanf.3 MLINKS+=ccosh.3 ccoshf.3 ccosh.3 csinh.3 ccosh.3 csinhf.3 \ ccosh.3 ctanh.3 ccosh.3 ctanhf.3 Modified: head/lib/msun/src/catrig.c ============================================================================== --- head/lib/msun/src/catrig.c Fri Feb 17 07:08:37 2017 (r313862) +++ head/lib/msun/src/catrig.c Fri Feb 17 08:22:32 2017 (r313863) @@ -637,3 +637,12 @@ catan(double complex z) return (CMPLX(cimag(w), creal(w))); } + +#if LDBL_MANT_DIG == 53 +__weak_reference(cacosh, cacoshl); +__weak_reference(cacos, cacosl); +__weak_reference(casinh, casinhl); +__weak_reference(casin, casinl); +__weak_reference(catanh, catanhl); +__weak_reference(catan, catanl); +#endif From owner-svn-src-head@freebsd.org Fri Feb 17 08:25:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71D5CCE04BF; Fri, 17 Feb 2017 08:25:49 +0000 (UTC) (envelope-from mmokhi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3156E1F4D; Fri, 17 Feb 2017 08:25:49 +0000 (UTC) (envelope-from mmokhi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1H8Pm1Z001673; Fri, 17 Feb 2017 08:25:48 GMT (envelope-from mmokhi@FreeBSD.org) Received: (from mmokhi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1H8Pm2g001672; Fri, 17 Feb 2017 08:25:48 GMT (envelope-from mmokhi@FreeBSD.org) Message-Id: <201702170825.v1H8Pm2g001672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmokhi set sender to mmokhi@FreeBSD.org using -f From: Mahdi Mokhtari Date: Fri, 17 Feb 2017 08:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313864 - head/lib/msun/man X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 08:25:49 -0000 Author: mmokhi (ports committer) Date: Fri Feb 17 08:25:48 2017 New Revision: 313864 URL: https://svnweb.freebsd.org/changeset/base/313864 Log: Add documentations related to new APIs of r313761 PR: 216850 216851 216852 216856 216857 216858 Submitted by: sgk@troutmask.apl.washington.edu Reported by: sgk@troutmask.apl.washington.edu Reviewed by: bde emaste hselasky Approved by: bde emaste hselasky Differential Revision: https://reviews.freebsd.org/D9491 Modified: head/lib/msun/man/cacos.3 Modified: head/lib/msun/man/cacos.3 ============================================================================== --- head/lib/msun/man/cacos.3 Fri Feb 17 08:22:32 2017 (r313863) +++ head/lib/msun/man/cacos.3 Fri Feb 17 08:25:48 2017 (r313864) @@ -24,23 +24,29 @@ .\" .\" $FreeBSD$ .\" -.Dd Jul 14, 2015 +.Dd February 15, 2017 .Dt CACOS 3 .Os .Sh NAME .Nm cacos , .Nm cacosf , +.Nm cacosl , .Nm cacosh , .Nm cacoshf , +.Nm cacoshl , .Nm casin , -.Nm casinf +.Nm casinf , +.Nm casinl , .Nm casinh , -.Nm casinhf -.Nm catan , -.Nm catanf +.Nm casinhf , +.Nm casinhl , +.Nm catan , +.Nm catanf , +.Nm catanl , .Nm catanh , -.Nm catanhf -.Nd complex arc trigonometric and hyperbolic functions +.Nm catanhf , +.Nm catanhl +.Nd complex inverse trigonometric and hyperbolic functions .Sh LIBRARY .Lb libm .Sh SYNOPSIS @@ -49,26 +55,38 @@ .Fn cacos "double complex z" .Ft float complex .Fn cacosf "float complex z" +.Ft long double complex +.Fn cacosl "long double complex z" .Ft double complex .Fn cacosh "double complex z" .Ft float complex .Fn cacoshf "float complex z" +.Ft long double complex +.Fn cacoshl "long double complex z" .Ft double complex .Fn casin "double complex z" .Ft float complex .Fn casinf "float complex z" +.Ft long double complex +.Fn casinl "long double complex z" .Ft double complex .Fn casinh "double complex z" .Ft float complex .Fn casinhf "float complex z" +.Ft long double complex +.Fn casinhl "long double complex z" .Ft double complex .Fn catan "double complex z" .Ft float complex .Fn catanf "float complex z" +.Ft long double complex +.Fn catanl "long double complex z" .Ft double complex .Fn catanh "double complex z" .Ft float complex .Fn catanhf "float complex z" +.Ft long double complex +.Fn catanhl "long double complex z" .Sh DESCRIPTION The .Fn cacos , @@ -97,10 +115,22 @@ and functions perform the same operations in .Fa float precision. +The +.Fn cacosl , +.Fn casinl , +.Fn catanl +.Fn cacoshl , +.Fn casinhl , +and +.Fn catanhl +functions perform the same operations in +.Fa long double +precision. .Pp .ds Un \[cu] There is no universal convention for defining the principal values of -these functions. The following table gives the branch cuts, and the +these functions. +The following table gives the branch cuts, and the corresponding ranges for the return values, adopted by the C language. .Bl -column ".Sy Function" ".Sy (-\*(If*I, -I) \*(Un (I, \*(If*I)" ".Sy [-\*(Pi/2*I, \*(Pi/2*I]" .It Sy Function Ta Sy Branch Cut(s) Ta Sy Range From owner-svn-src-head@freebsd.org Fri Feb 17 09:09:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92911CE163A; Fri, 17 Feb 2017 09:09:12 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B5891576; Fri, 17 Feb 2017 09:09:12 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 5A3B31FE025; Fri, 17 Feb 2017 10:08:52 +0100 (CET) Subject: Re: svn commit: r313859 - in head/sys: kern sys To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201702170645.v1H6j4l6060548@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <2c01557a-3412-8b46-ef4d-77214566b74a@selasky.org> Date: Fri, 17 Feb 2017 10:08:27 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <201702170645.v1H6j4l6060548@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 09:09:12 -0000 On 02/17/17 07:45, Mateusz Guzik wrote: > Author: mjg > Date: Fri Feb 17 06:45:04 2017 > New Revision: 313859 > URL: https://svnweb.freebsd.org/changeset/base/313859 > > Log: > Introduce SCHEDULER_STOPPED_TD for use when the thread pointer was already read > > Sprinkle in few places. > > Modified: > head/sys/kern/kern_condvar.c > head/sys/kern/kern_synch.c > head/sys/sys/systm.h > > Modified: head/sys/kern/kern_condvar.c > ============================================================================== > --- head/sys/kern/kern_condvar.c Fri Feb 17 06:22:05 2017 (r313858) > +++ head/sys/kern/kern_condvar.c Fri Feb 17 06:45:04 2017 (r313859) > @@ -122,7 +122,7 @@ _cv_wait(struct cv *cvp, struct lock_obj > "Waiting on \"%s\"", cvp->cv_description); > class = LOCK_CLASS(lock); > > - if (SCHEDULER_STOPPED()) > + if (SCHEDULER_STOPPED_TD(td)) > return; > > sleepq_lock(cvp); > @@ -176,7 +176,7 @@ _cv_wait_unlock(struct cv *cvp, struct l > ("cv_wait_unlock cannot be used with Giant")); > class = LOCK_CLASS(lock); > > - if (SCHEDULER_STOPPED()) { > + if (SCHEDULER_STOPPED_TD(td)) { > class->lc_unlock(lock); > return; > } > @@ -227,7 +227,7 @@ _cv_wait_sig(struct cv *cvp, struct lock > "Waiting on \"%s\"", cvp->cv_description); > class = LOCK_CLASS(lock); > > - if (SCHEDULER_STOPPED()) > + if (SCHEDULER_STOPPED_TD(td)) > return (0); > > sleepq_lock(cvp); > @@ -287,7 +287,7 @@ _cv_timedwait_sbt(struct cv *cvp, struct > "Waiting on \"%s\"", cvp->cv_description); > class = LOCK_CLASS(lock); > > - if (SCHEDULER_STOPPED()) > + if (SCHEDULER_STOPPED_TD(td)) > return (0); > > sleepq_lock(cvp); > @@ -349,7 +349,7 @@ _cv_timedwait_sig_sbt(struct cv *cvp, st > "Waiting on \"%s\"", cvp->cv_description); > class = LOCK_CLASS(lock); > > - if (SCHEDULER_STOPPED()) > + if (SCHEDULER_STOPPED_TD(td)) > return (0); > > sleepq_lock(cvp); > > Modified: head/sys/kern/kern_synch.c > ============================================================================== > --- head/sys/kern/kern_synch.c Fri Feb 17 06:22:05 2017 (r313858) > +++ head/sys/kern/kern_synch.c Fri Feb 17 06:45:04 2017 (r313859) > @@ -162,7 +162,7 @@ _sleep(void *ident, struct lock_object * > else > class = NULL; > > - if (SCHEDULER_STOPPED()) { > + if (SCHEDULER_STOPPED_TD(td)) { > if (lock != NULL && priority & PDROP) > class->lc_unlock(lock); > return (0); > @@ -250,7 +250,7 @@ msleep_spin_sbt(void *ident, struct mtx > KASSERT(ident != NULL, ("msleep_spin_sbt: NULL ident")); > KASSERT(TD_IS_RUNNING(td), ("msleep_spin_sbt: curthread not running")); > > - if (SCHEDULER_STOPPED()) > + if (SCHEDULER_STOPPED_TD(td)) > return (0); > > sleepq_lock(ident); > @@ -411,7 +411,7 @@ mi_switch(int flags, struct thread *newt > */ > if (kdb_active) > kdb_switch(); > - if (SCHEDULER_STOPPED()) > + if (SCHEDULER_STOPPED_TD(td)) > return; > if (flags & SW_VOL) { > td->td_ru.ru_nvcsw++; > > Modified: head/sys/sys/systm.h > ============================================================================== > --- head/sys/sys/systm.h Fri Feb 17 06:22:05 2017 (r313858) > +++ head/sys/sys/systm.h Fri Feb 17 06:45:04 2017 (r313859) > @@ -128,7 +128,11 @@ void kassert_panic(const char *fmt, ...) > * Otherwise, the kernel will deadlock since the scheduler isn't > * going to run the thread that holds any lock we need. > */ > -#define SCHEDULER_STOPPED() __predict_false(curthread->td_stopsched) > +#define SCHEDULER_STOPPED_TD(td) ({ \ > + MPASS((td) == curthread); \ > + __predict_false((td)->td_stopsched); \ > +}) > +#define SCHEDULER_STOPPED() SCHEDULER_STOPPED_TD(curthread) > > /* > * Align variables. > > Hi, Do these checks also cover panics? Or only shutdown? Should you also add a check for kdb_active // panicstr ? Then I could factor out some checks I've sprinkled in the USB code. --HPS From owner-svn-src-head@freebsd.org Fri Feb 17 09:58:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C773CE232C; Fri, 17 Feb 2017 09:58:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A87691A99; Fri, 17 Feb 2017 09:58:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x241.google.com with SMTP id r18so1630574wmd.3; Fri, 17 Feb 2017 01:58:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+galaawpgETV/ZbSMRMZK8u/NAfo+Td/2nvdZ7gtdqQ=; b=FsH+/5v2cZogrU+p+cbqR5VxS5oL6u/hnLCF1s91bfIiPJwYvVDlNRTssZCzn/2OUE t5T15Ycd5gxjj7wNRH6QNVqIBfHH4NxqemoTI0AWYjGParvy9r7JNPgpFqdURDHNil0A +Z/JlpM2tIjVFnWOk8Cwr5pEvMT1082J+BOEaR/pOHjGnKGcdvdKFbJPjhWO45UO5f+o ckFFLpn8iAjSruBPV5lP7yT/6l6fUvUxznRtVMcC0IE7gQ0u+6MB0Xoqe7+tX/7AxgHr IHuotBCmClWhbzus+CFmr2sddkpPqOs3i+YIBf/EOQpYYUi30r8USTGxIBPxYFwrFp/M 25jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+galaawpgETV/ZbSMRMZK8u/NAfo+Td/2nvdZ7gtdqQ=; b=n/B8CDgWG5GPsRrUHQIgx5ZyhEMOyN+VtUtR44FCmsD/1pCqNPQ5/F7TDKN4Pm83F/ Oeyp0L17Sc8hajVLZnuTxZBor8cXSn4g82mZ9slu4tw8yN7dkaEZRPS1/Oll7dijM3+B j3o5TPQ9sfqLm8aEm1ID+ZFjBoiawa84YPL/LvIOvjRD5jbTc/lbKeurtisb/bkmagWk 7yYI32Kk5iYGUu7F622HKOWqdB6A8W5GLT9rWstMCZAEjzDvR2/NKxs8+4f0MoKki+4n 2JyD/b/G+PEU87ankPlW60A3eiNEXCqp0agR+nUi6LvRZfATl2/u5qym9Kh5wdklyyo0 pNzA== X-Gm-Message-State: AMke39mPFFePaF16xNeGpCZJJ506qvenO8eWNiJlEp1slxU8OEtcDB0uUUfAm7BgSaIBTQ== X-Received: by 10.28.136.13 with SMTP id k13mr1402638wmd.94.1487325524589; Fri, 17 Feb 2017 01:58:44 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id u42sm12306964wrc.1.2017.02.17.01.58.43 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 17 Feb 2017 01:58:43 -0800 (PST) Date: Fri, 17 Feb 2017 10:58:41 +0100 From: Mateusz Guzik To: Hans Petter Selasky Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313859 - in head/sys: kern sys Message-ID: <20170217095841.GB30217@dft-labs.eu> References: <201702170645.v1H6j4l6060548@repo.freebsd.org> <2c01557a-3412-8b46-ef4d-77214566b74a@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2c01557a-3412-8b46-ef4d-77214566b74a@selasky.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 09:58:47 -0000 On Fri, Feb 17, 2017 at 10:08:27AM +0100, Hans Petter Selasky wrote: > On 02/17/17 07:45, Mateusz Guzik wrote: > >Author: mjg > >Date: Fri Feb 17 06:45:04 2017 > >New Revision: 313859 > >URL: https://svnweb.freebsd.org/changeset/base/313859 > > > >Log: > > Introduce SCHEDULER_STOPPED_TD for use when the thread pointer was already read > > > > Do these checks also cover panics? Or only shutdown? > > Should you also add a check for kdb_active // panicstr ? Then I could > factor out some checks I've sprinkled in the USB code. > These are specifically for panics. I don't plan to add other macros, just needded this for further refactoring of locking primitives. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Fri Feb 17 10:15:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7685CE28CF; Fri, 17 Feb 2017 10:15:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 23AC6157F; Fri, 17 Feb 2017 10:15:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 9E804D463DD; Fri, 17 Feb 2017 21:15:02 +1100 (AEDT) Date: Fri, 17 Feb 2017 21:15:00 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hans Petter Selasky cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313859 - in head/sys: kern sys In-Reply-To: <2c01557a-3412-8b46-ef4d-77214566b74a@selasky.org> Message-ID: <20170217203028.K2144@besplex.bde.org> References: <201702170645.v1H6j4l6060548@repo.freebsd.org> <2c01557a-3412-8b46-ef4d-77214566b74a@selasky.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=Ca543Pjl c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=Ue2R6lYrubxZHF9GuYkA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 10:15:12 -0000 On Fri, 17 Feb 2017, Hans Petter Selasky wrote: >> Log: >> Introduce SCHEDULER_STOPPED_TD for use when the thread pointer was >> already read >> >> Sprinkle in few places. >> >> Modified: >> head/sys/kern/kern_condvar.c >> head/sys/kern/kern_synch.c >> head/sys/sys/systm.h > > Do these checks also cover panics? Or only shutdown? This is just an optimization. I don't like it because it moves further from moving the stopped flag back out of the thread to a global. The stopped flag is only set for panics. > Should you also add a check for kdb_active // panicstr ? Then I could factor > out some checks I've sprinkled in the USB code. No. kdb active is very different from the scheduler being stopped. The stopped flag is just a different spelling of panicstr != NULL, modulo minor races. panicstr is used as a flag to avoid doing all sorts of things during panics. This is a bit hackish, but SCHEDULER_STOPPED() is worse. Things are not done, and it is correct to not do them, not because the scheduler is stopped, but because the system is panicing. E.g., not doing normal locking is necessary because normal locking might deadlock, but correct because locking is done in another way (by spinlock_enter() and stopping other CPUs); it is not possible to get back to normal locking, but this is correct since a reboot occurs first. Bruce From owner-svn-src-head@freebsd.org Fri Feb 17 10:24:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3EF8CE2B82; Fri, 17 Feb 2017 10:24:12 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 402281A2D; Fri, 17 Feb 2017 10:24:12 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x230.google.com with SMTP id 196so8662829wmm.1; Fri, 17 Feb 2017 02:24:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=yhLagh7+QKCScF5J6G9I2n+oQ4T9tLkkPC+toqnb9rE=; b=OMUUWPsvKO/xLOpfkK7i17/FZfEtfmz7reRNqjYRB1S9kCtqd4WznrLmK+uLfZkJdk aDE6JsZ3+xaHmZByDpiiOZrnvZpMw9Uk+0R69UjEdz5EsHHV+/gelnR7VRBB5dz6UQSC 4Ck1oylcY/tnqVbkMPL11Xy7fmth8OZp57rYlWA+Itpcwpa9VuHSNmCuaFkV22SiAH53 LXMaHyXkPFRKwod/MmN1VGIuirZ3dE//5mI3DC1H/4K5bwcI304wGJFsEC9KbyqiyEE8 wFvchutkJ5XBIccXlTLi5ux9R/9i8TBwUD1ZndvQhkaqRwctpoZlOdJTDwefBUR64adx uLog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=yhLagh7+QKCScF5J6G9I2n+oQ4T9tLkkPC+toqnb9rE=; b=LUeOvSAW7NM0T+ymXTlNDaYTBW5w3nOWnc0XHsto3lUHsDvZk3TKNYcJPn/Tr4B5Rj xEHb3+udztkQkHMTakS6aDHmcW9ArndTEOrv06KMLm5U2IYWSDT3CVat+hBk+qqaiUso 0uFJwQajP1xUbYMNOUG91akNodoZ4kCAVlOIhwjaGjP+p5ilUTDTtaRJ+Nuj08EdiJpM SqIXAE8OW4+bZGOUHwWWQo3ey8XKU3Mg0ILxgo4z7Zx0bhMmzOBSCC5apG8zhWc5KZkO v9muzVTiXtXkHWt2HJ+X6zmaeZencWqhP2JqJXsvhDYUwxmtljZ6xSTvusZHFU/+BtiW K/9Q== X-Gm-Message-State: AMke39l+KduH3xatLs7CsiIHUi420oLQ9GT7D7Djy0EvO2/taBWmGsgdI5nLM4YMfEduRQ== X-Received: by 10.28.236.93 with SMTP id k90mr1409754wmh.40.1487327050660; Fri, 17 Feb 2017 02:24:10 -0800 (PST) Received: from brick (global-5-142.nat-2.net.cam.ac.uk. [131.111.5.142]) by smtp.gmail.com with ESMTPSA id q1sm1150298wmd.6.2017.02.17.02.24.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Feb 2017 02:24:10 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 17 Feb 2017 10:24:08 +0000 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313854 - head/sys/cam/ctl Message-ID: <20170217102408.GA74901@brick> Mail-Followup-To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201702170522.v1H5MwGK027647@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201702170522.v1H5MwGK027647@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 10:24:12 -0000 On 0217T0522, Alexander Motin wrote: > Author: mav > Date: Fri Feb 17 05:22:58 2017 > New Revision: 313854 > URL: https://svnweb.freebsd.org/changeset/base/313854 > > Log: > Change the way MaxCmdSN is used. > > Before this change MaxCmdSN was reported as CmdSN + delta, that made it > limit number of requests in transmission from the initiator to target, > that was pretty useless. After this change MaxCmdSN limits number of > requests queued to CTL, i.e. maximal queue depth for the initiator. > The default limit is 256 outstanding requests per initiator at a time. > > This code uses existing cs_outstanding_ctl_pdus counter to track queue > depth. It's semantics doen't perfectly match, but close enough to not > add another counter. Just don't set the maxtags below 2. I like the change in principle, but I don't like the gratuitous change of sysctl name. It will break people's configs. Could you rename it back? Thanks! From owner-svn-src-head@freebsd.org Fri Feb 17 10:55:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5ECC0CE23D6 for ; Fri, 17 Feb 2017 10:55:37 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wr0-x233.google.com (mail-wr0-x233.google.com [IPv6:2a00:1450:400c:c0c::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E768B18FD; Fri, 17 Feb 2017 10:55:36 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wr0-x233.google.com with SMTP id 89so23160870wrr.3; Fri, 17 Feb 2017 02:55:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:reply-to:subject:references:to:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=SfEBg4L52EqeUGEj1Mv8IldLxUkl4dUIzvejPlzvWys=; b=NoiCJqhcEmLKCx09FMmtoUNAek5CgmztQ3kWRkpb6k4ycLtG1EItOXCRy41EMOvuR6 Sel365ooJnd0fLbC7grqy8fERvpJF+joapmOSFEkpsMsUotpA+K3WmPXFWgbIzMsIfrE qpUkJVVKw5EURz6DqbyhZ9WZeIY1XuRz72kz8lPvtHdPtriD2IlEROrYzlqPL+GRyIoi VBST6H0/30NTCiYrsqvHipgix6vXgWwqjl1fdna4YL7qcPSu8DdZRpHM/bdl68h0dmFR 6sLCbPh+QpfFqOSJcWxtNaqF0Hvk3jLeWJfKbcUeoSZ5GDN8Ef61ooE9s/EY/VvAEm1e KzUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:reply-to:subject:references:to:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=SfEBg4L52EqeUGEj1Mv8IldLxUkl4dUIzvejPlzvWys=; b=ZMZPgiYWtkzCO0lvaElTX1RtS9YHFfhKAhX2rUsh+skhrPlft7p3aYiXalSDDET7h2 h6yFYUSiHuMlVf/M9Hp39QTGQdnd5vye/eQjBTXdlP98WzG/E2Mm4VSSeYyVJ/QTGu8f yo/XDsaUjF3BupPe/YyNuSz/DkPTAO024rQUYqkMh1lc8qK4BPZo1Nbe1xzx5/sQZTX8 siAAP7M3eUsB+m5Lv6mVlCQrWT/tcDnuSGUVLVLoqq4QIOQvqP0ttqL6D7mu7HcjyR/W DGhNnkAqN6j7vZJurPZWmFtKZrkpwhePF4M7hvANPQfQ89B9gWQiZBIbBuHu6lBd4sRD OJIg== X-Gm-Message-State: AMke39n7iVx6d7Ii76x9WA2jQksRoGxTg5V2/OS2fq6m1pG4vGdA5w6vuwbQhch5ktwcEw== X-Received: by 10.223.145.45 with SMTP id j42mr6554806wrj.141.1487328935237; Fri, 17 Feb 2017 02:55:35 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id u42sm12488230wrc.1.2017.02.17.02.55.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Feb 2017 02:55:34 -0800 (PST) From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: meloun.michal@gmail.com Subject: Re: svn commit: r313855 - head/sys/kern References: <201702170539.v1H5de82032123@repo.freebsd.org> To: Mateusz Guzik , svn-src-head@freebsd.org Message-ID: Date: Fri, 17 Feb 2017 11:55:36 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <201702170539.v1H5de82032123@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 10:55:37 -0000 On 17.02.2017 6:39, Mateusz Guzik wrote: > Author: mjg > Date: Fri Feb 17 05:39:40 2017 > New Revision: 313855 > URL: https://svnweb.freebsd.org/changeset/base/313855 > > Log: > locks: let primitives for modules unlock without always goging to the slsow path > > It is only needed if the LOCK_PROFILING is enabled. It has to always check if > the lock is about to be released which requires an avoidable read if the option > is not specified.. > > Modified: > head/sys/kern/kern_mutex.c > head/sys/kern/kern_rwlock.c > head/sys/kern/kern_sx.c > > Modified: head/sys/kern/kern_mutex.c > ============================================================================== > --- head/sys/kern/kern_mutex.c Fri Feb 17 05:22:58 2017 (r313854) > +++ head/sys/kern/kern_mutex.c Fri Feb 17 05:39:40 2017 (r313855) > @@ -275,7 +275,11 @@ __mtx_unlock_flags(volatile uintptr_t *c > line); > mtx_assert(m, MA_OWNED); > > +#ifdef LOCK_PROFILING > __mtx_unlock_sleep(c, opts, file, line); > +#else > + __mtx_unlock(m, curthread, opts, file, line); > +#endif > TD_LOCKS_DEC(curthread); > } > > > Modified: head/sys/kern/kern_rwlock.c > ============================================================================== > --- head/sys/kern/kern_rwlock.c Fri Feb 17 05:22:58 2017 (r313854) > +++ head/sys/kern/kern_rwlock.c Fri Feb 17 05:39:40 2017 (r313855) > @@ -341,7 +341,11 @@ _rw_wunlock_cookie(volatile uintptr_t *c > LOCK_LOG_LOCK("WUNLOCK", &rw->lock_object, 0, rw->rw_recurse, file, > line); > > +#ifdef LOCK_PROFILING > _rw_wunlock_hard(rw, (uintptr_t)curthread, file, line); > +#else > + __rw_wunlock(rw, curthread, file, line); > +#endif > > TD_LOCKS_DEC(curthread); > } > > Modified: head/sys/kern/kern_sx.c > ============================================================================== > --- head/sys/kern/kern_sx.c Fri Feb 17 05:22:58 2017 (r313854) > +++ head/sys/kern/kern_sx.c Fri Feb 17 05:39:40 2017 (r313855) > @@ -364,7 +364,11 @@ _sx_xunlock(struct sx *sx, const char *f > WITNESS_UNLOCK(&sx->lock_object, LOP_EXCLUSIVE, file, line); > LOCK_LOG_LOCK("XUNLOCK", &sx->lock_object, 0, sx->sx_recurse, file, > line); > +#ifdef LOCK_PROFILING > _sx_xunlock_hard(sx, (uintptr_t)curthread, file, line); > +#else > + __sx_xunlock(sx, curthread, file, line); > +#endif > TD_LOCKS_DEC(curthread); > } > > This breaks armv6 kernel. Michal /usr2/Meloun/git/tegra/sys/kern/kern_sx.c:370:2: error: implicit declaration of function '__sx_xunlock' is invalid in C99 [-Werror,-Wimplicit-function-declaration] __sx_xunlock(sx, curthread, file, line); ^ /usr2/Meloun/git/tegra/sys/kern/kern_sx.c:370:2: note: did you mean '_sx_xunlock'? /usr2/Meloun/git/tegra/sys/kern/kern_sx.c:358:1: note: '_sx_xunlock' declared here _sx_xunlock(struct sx *sx, const char *file, int line) ^ 1 error generated. From owner-svn-src-head@freebsd.org Fri Feb 17 10:58:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D917CE244D; Fri, 17 Feb 2017 10:58:14 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AC651981; Fri, 17 Feb 2017 10:58:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HAwDgI061762; Fri, 17 Feb 2017 10:58:13 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HAwDm3061761; Fri, 17 Feb 2017 10:58:13 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702171058.v1HAwDm3061761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 17 Feb 2017 10:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313865 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 10:58:14 -0000 Author: mjg Date: Fri Feb 17 10:58:12 2017 New Revision: 313865 URL: https://svnweb.freebsd.org/changeset/base/313865 Log: sx: fix compilation on UP kernels after r313855 sx primitives use inlines as opposed to macros. Change the tested condition to LOCK_DEBUG which covers the case, but is slightly overzelaous. Reported by: kib Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Fri Feb 17 08:25:48 2017 (r313864) +++ head/sys/kern/kern_sx.c Fri Feb 17 10:58:12 2017 (r313865) @@ -364,7 +364,7 @@ _sx_xunlock(struct sx *sx, const char *f WITNESS_UNLOCK(&sx->lock_object, LOP_EXCLUSIVE, file, line); LOCK_LOG_LOCK("XUNLOCK", &sx->lock_object, 0, sx->sx_recurse, file, line); -#ifdef LOCK_PROFILING +#if LOCK_DEBUG > 0 _sx_xunlock_hard(sx, (uintptr_t)curthread, file, line); #else __sx_xunlock(sx, curthread, file, line); From owner-svn-src-head@freebsd.org Fri Feb 17 10:59:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E377ACE24BB for ; Fri, 17 Feb 2017 10:59:04 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 824FC1AF4; Fri, 17 Feb 2017 10:59:04 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id v77so1900146wmv.0; Fri, 17 Feb 2017 02:59:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=G7RmT3PGRJwLYuFQ9eBg8LvRUwd9FWPpmh87S46onYM=; b=INWg/Y3fT1tEoBIRlV/KiM4VCL079D8B+Q1axCioZETKjvxXJBvtf0EaTFe9iK2niw yf0rGsCWhmre1dUt9v1AdcmS1/ERjsRxvNxmRQDtFZxS/gwoYkGILIFqIWWZqnZ8GLRg XMLg+aS9Z5OtJyk01YMZOxNleSfczzHIjZA3bgpinKKIb+On3X6c/cS1dL+xWwv6MirD qUuQ+7zSAIIKZlQWZLqASw/tfZI8IxTA2iqMbzwadKHOdqXPvKA5doJA3KjMd6jlQJgL EyPOqgG+nFw+HoI7U8zlWOTO0fAXNiKn9IsABhHw52bxA0XcT2tKtUcovq7TD/pohHtc sGqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=G7RmT3PGRJwLYuFQ9eBg8LvRUwd9FWPpmh87S46onYM=; b=PyqY/127f4/x6KQdY75L1iW+NST1fZ3xjzhEmak6AExrlh7wI4roSYEifp4qteg+HK DPYsXQGILpAADXcJqciwmmjm3DeVC4epQt9HxxU+yO9t7q5j0F55Py+rMsubRVnt8ZNn 309H8IB2NSlSa7R7f6iUnhl2Xt6sh9//mYCs3AIqpIzzEQGrhCHhVkhu+R0XIxDJcUSV AmQJvc00JJktfieWoGywjTsXAYYuEsT20L6jZlCvMz/w+EbShNAQ9VATltE4msu2U5z1 PoRuWLZGLw4D/lBAGe2jJOEHww85gVrF82FA4/UReVJgQArRey33AOke5sA44CRPHVnH DCeg== X-Gm-Message-State: AMke39nTEB2Fi2rU1Jnd3orlfgmP+suwvk72DSXI4dcqcEPNFWw1ylWRWANeyP0OMWIIhw== X-Received: by 10.28.127.13 with SMTP id a13mr1543581wmd.96.1487329141602; Fri, 17 Feb 2017 02:59:01 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id d1sm12520986wrb.62.2017.02.17.02.59.00 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 17 Feb 2017 02:59:01 -0800 (PST) Date: Fri, 17 Feb 2017 11:58:58 +0100 From: Mateusz Guzik To: meloun.michal@gmail.com Cc: Mateusz Guzik , svn-src-head@freebsd.org Subject: Re: svn commit: r313855 - head/sys/kern Message-ID: <20170217105858.GC30217@dft-labs.eu> References: <201702170539.v1H5de82032123@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 10:59:05 -0000 On Fri, Feb 17, 2017 at 11:55:36AM +0100, Michal Meloun wrote: > > > On 17.02.2017 6:39, Mateusz Guzik wrote: > > Modified: head/sys/kern/kern_sx.c > > ============================================================================== > > --- head/sys/kern/kern_sx.c Fri Feb 17 05:22:58 2017 (r313854) > > +++ head/sys/kern/kern_sx.c Fri Feb 17 05:39:40 2017 (r313855) > > @@ -364,7 +364,11 @@ _sx_xunlock(struct sx *sx, const char *f > > WITNESS_UNLOCK(&sx->lock_object, LOP_EXCLUSIVE, file, line); > > LOCK_LOG_LOCK("XUNLOCK", &sx->lock_object, 0, sx->sx_recurse, file, > > line); > > +#ifdef LOCK_PROFILING > > _sx_xunlock_hard(sx, (uintptr_t)curthread, file, line); > > +#else > > + __sx_xunlock(sx, curthread, file, line); > > +#endif > > TD_LOCKS_DEC(curthread); > > } > > > > > > This breaks armv6 kernel. > Michal > > > /usr2/Meloun/git/tegra/sys/kern/kern_sx.c:370:2: error: implicit > declaration of function '__sx_xunlock' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] > __sx_xunlock(sx, curthread, file, line); > ^ > /usr2/Meloun/git/tegra/sys/kern/kern_sx.c:370:2: note: did you mean > '_sx_xunlock'? > /usr2/Meloun/git/tegra/sys/kern/kern_sx.c:358:1: note: '_sx_xunlock' > declared here > _sx_xunlock(struct sx *sx, const char *file, int line) > ^ > 1 error generated. > Should work with r313865. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Fri Feb 17 11:16:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC4A5CE2A78; Fri, 17 Feb 2017 11:16:20 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A8C31338; Fri, 17 Feb 2017 11:16:20 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HBGJl4069858; Fri, 17 Feb 2017 11:16:19 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HBGJ5l069855; Fri, 17 Feb 2017 11:16:19 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201702171116.v1HBGJ5l069855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 17 Feb 2017 11:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313866 - head/lib/libc/arm/aeabi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 11:16:20 -0000 Author: mmel Date: Fri Feb 17 11:16:19 2017 New Revision: 313866 URL: https://svnweb.freebsd.org/changeset/base/313866 Log: Publish __aeabi_uidiv and __aeabi_idiv as compatible symbols from libc. Due to bug[1] in libcompiler_rt, all symbols declared by DEFINE_AEABI_FUNCTION_ALIAS() are not hidden. All these but two are explicitly exported from libc and don't causes problems. Remaining two, __aeabi_uidiv and __aeabi_idiv, infecting all non-versioned shared libraries. And these symbols are consumed by many (if not all) packages[2]. As workaround, export these from libc as compatible symbols, in global namespace. With this, these are still visible for rtld, but static linker doesn't use then. [1] DEFINE_AEABI_FUNCTION_ALIAS() macro uses '.set' directive for declaration of aliased symbol. Unfortunately, '.set' doesn't inherit visibility of base symbol, and macro don't explicitly sets visibility for aliased one. [2] Given symbols are exported from non-versioned libraries only if library itself uses them. So, if world is built for CPU with HW divide, these function are not used and given symbols are not exported. By this, contents of these libraries is not stable, and all packages fails to run. Note: Due to r313823 I'm forced to commit this too early, without leave enough time for proper review. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D9632 Added: head/lib/libc/arm/aeabi/aeabi_int_div.S (contents, props changed) Modified: head/lib/libc/arm/aeabi/Makefile.inc head/lib/libc/arm/aeabi/Symbol.map Modified: head/lib/libc/arm/aeabi/Makefile.inc ============================================================================== --- head/lib/libc/arm/aeabi/Makefile.inc Fri Feb 17 10:58:12 2017 (r313865) +++ head/lib/libc/arm/aeabi/Makefile.inc Fri Feb 17 11:16:19 2017 (r313866) @@ -28,5 +28,6 @@ SRCS+= aeabi_memcmp.S \ aeabi_memmove.S \ aeabi_memset.S -SYM_MAPS+=${LIBC_SRCTOP}/arm/aeabi/Symbol.map +SRCS+= aeabi_int_div.S +SYM_MAPS+=${LIBC_SRCTOP}/arm/aeabi/Symbol.map Modified: head/lib/libc/arm/aeabi/Symbol.map ============================================================================== --- head/lib/libc/arm/aeabi/Symbol.map Fri Feb 17 10:58:12 2017 (r313865) +++ head/lib/libc/arm/aeabi/Symbol.map Fri Feb 17 11:16:19 2017 (r313866) @@ -69,4 +69,11 @@ FBSDprivate_1.0 { __aeabi_memset; __aeabi_memset4; __aeabi_memset8; + + /* + * A workaround for DEFINE_AEABI_FUNCTION_ALIAS() bug. + * - see aeabi_int_div.S + */ + __aeabi_idiv; + __aeabi_uidiv; }; Added: head/lib/libc/arm/aeabi/aeabi_int_div.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/aeabi_int_div.S Fri Feb 17 11:16:19 2017 (r313866) @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2017 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. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Due to bug in libcompiler_rt, all symbols declared by + * DEFINE_AEABI_FUNCTION_ALIAS() are not hidden. All these but + * __aeabi_uidiv_compat and/or __aeabi_idiv_compat are explicitly + * exported from libc and don't causes problems. + * + * As workaround, export these from libc as compatible symbols, + * in global namespace + */ + +ENTRY(__aeabi_uidiv_compat) + .symver __aeabi_uidiv_compat, __aeabi_uidiv@ + b __udivsi3 +END(__aeabi_uidiv_compat) + +ENTRY(__aeabi_idiv_compat) + .symver __aeabi_idiv_compat, __aeabi_idiv@ + b __divsi3 +END(__aeabi_idiv_compat) + + .section .note.GNU-stack,"",%progbits From owner-svn-src-head@freebsd.org Fri Feb 17 11:17:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A212CE2B4D; Fri, 17 Feb 2017 11:17:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 471B41502; Fri, 17 Feb 2017 11:17:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HBHu48069971; Fri, 17 Feb 2017 11:17:56 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HBHuVv069970; Fri, 17 Feb 2017 11:17:56 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201702171117.v1HBHuVv069970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 17 Feb 2017 11:17:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313867 - head/usr.bin/timeout X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 11:17:57 -0000 Author: bapt Date: Fri Feb 17 11:17:56 2017 New Revision: 313867 URL: https://svnweb.freebsd.org/changeset/base/313867 Log: Add history and Authors section in the manpage Submitted by: dteske MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D9419 Modified: head/usr.bin/timeout/timeout.1 Modified: head/usr.bin/timeout/timeout.1 ============================================================================== --- head/usr.bin/timeout/timeout.1 Fri Feb 17 11:16:19 2017 (r313866) +++ head/usr.bin/timeout/timeout.1 Fri Feb 17 11:17:56 2017 (r313867) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Oct 28, 2014 +.Dd Feb 17, 2017 .Dt TIMEOUT 1 .Os .Sh NAME @@ -127,3 +127,10 @@ the exit status return is 125. .Sh SEE ALSO .Xr kill 1 , .Xr signal 3 +.Sh HISTORY +The +.Nm +command first appeared in +.Fx 10.3 . +.Sh AUTHORS +.An Baptiste Daroussin Aq Mt bapt@FreeBSD.org From owner-svn-src-head@freebsd.org Fri Feb 17 11:26:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEBF8CE2EAF; Fri, 17 Feb 2017 11:26:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E3EB1CFE; Fri, 17 Feb 2017 11:26:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HBQ3qJ073994; Fri, 17 Feb 2017 11:26:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HBQ3ml073993; Fri, 17 Feb 2017 11:26:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201702171126.v1HBQ3ml073993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 17 Feb 2017 11:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313869 - head/usr.bin/timeout X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 11:26:04 -0000 Author: bapt Date: Fri Feb 17 11:26:03 2017 New Revision: 313869 URL: https://svnweb.freebsd.org/changeset/base/313869 Log: Also add vsevolod@ in the authors Modified: head/usr.bin/timeout/timeout.1 Modified: head/usr.bin/timeout/timeout.1 ============================================================================== --- head/usr.bin/timeout/timeout.1 Fri Feb 17 11:20:55 2017 (r313868) +++ head/usr.bin/timeout/timeout.1 Fri Feb 17 11:26:03 2017 (r313869) @@ -134,3 +134,5 @@ command first appeared in .Fx 10.3 . .Sh AUTHORS .An Baptiste Daroussin Aq Mt bapt@FreeBSD.org +and +.An Vsevolod Stakhov Aq Mt vsevolod@FreeBSD.org From owner-svn-src-head@freebsd.org Fri Feb 17 11:31:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CACBDCE22EB; Fri, 17 Feb 2017 11:31:28 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9367411A2; Fri, 17 Feb 2017 11:31:28 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HBVRd5076306; Fri, 17 Feb 2017 11:31:27 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HBVRYg076305; Fri, 17 Feb 2017 11:31:27 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201702171131.v1HBVRYg076305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 17 Feb 2017 11:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313870 - head/usr.bin/timeout X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 11:31:28 -0000 Author: bapt Date: Fri Feb 17 11:31:27 2017 New Revision: 313870 URL: https://svnweb.freebsd.org/changeset/base/313870 Log: Use full name for the month Reported by: brueffer Modified: head/usr.bin/timeout/timeout.1 Modified: head/usr.bin/timeout/timeout.1 ============================================================================== --- head/usr.bin/timeout/timeout.1 Fri Feb 17 11:26:03 2017 (r313869) +++ head/usr.bin/timeout/timeout.1 Fri Feb 17 11:31:27 2017 (r313870) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Feb 17, 2017 +.Dd February 17, 2017 .Dt TIMEOUT 1 .Os .Sh NAME From owner-svn-src-head@freebsd.org Fri Feb 17 12:47:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12CFDCE2019; Fri, 17 Feb 2017 12:47:53 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B96BB1686; Fri, 17 Feb 2017 12:47:52 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HClpie006205; Fri, 17 Feb 2017 12:47:51 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HClp0G006203; Fri, 17 Feb 2017 12:47:51 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201702171247.v1HClp0G006203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 17 Feb 2017 12:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313871 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 12:47:53 -0000 Author: royger Date: Fri Feb 17 12:47:51 2017 New Revision: 313871 URL: https://svnweb.freebsd.org/changeset/base/313871 Log: x86: fix MTRR initialization if EARLY_AP_STARTUP is used MTRR handlers are set in {amd64/i686}_mem_drvinit, which is called at SI_SUB_DRIVERS, and that's too late when EARLY_AP_STARTUP is set because APs have already started at this point. {amd64/i686}_mrinit is also called too late for the BSP, since that happens when the memory device is attached, also after APs have already started. Move the position to SI_SUB_CPU, and also initialize the state for the BSP, so that the APs can correctly get to the same state as the BSP. Sponsored by: Citrix Systems R&D MFC after: 1 week Reviewed by: jhb, kib Differential Revision: https://reviews.freebsd.org/D9630 Modified: head/sys/amd64/amd64/amd64_mem.c head/sys/i386/i386/i686_mem.c Modified: head/sys/amd64/amd64/amd64_mem.c ============================================================================== --- head/sys/amd64/amd64/amd64_mem.c Fri Feb 17 11:31:27 2017 (r313870) +++ head/sys/amd64/amd64/amd64_mem.c Fri Feb 17 12:47:51 2017 (r313871) @@ -609,6 +609,10 @@ amd64_mrinit(struct mem_range_softc *sc) u_int regs[4]; int i, nmdesc = 0, pabits; + if (sc->mr_desc != NULL) + /* Already initialized. */ + return; + mtrrcap = rdmsr(MSR_MTRRcap); mtrrdef = rdmsr(MSR_MTRRdefType); @@ -750,5 +754,6 @@ amd64_mem_drvinit(void *unused) return; } mem_range_softc.mr_op = &amd64_mrops; + amd64_mrinit(&mem_range_softc); } -SYSINIT(amd64memdev, SI_SUB_DRIVERS, SI_ORDER_FIRST, amd64_mem_drvinit, NULL); +SYSINIT(amd64memdev, SI_SUB_CPU, SI_ORDER_ANY, amd64_mem_drvinit, NULL); Modified: head/sys/i386/i386/i686_mem.c ============================================================================== --- head/sys/i386/i386/i686_mem.c Fri Feb 17 11:31:27 2017 (r313870) +++ head/sys/i386/i386/i686_mem.c Fri Feb 17 12:47:51 2017 (r313871) @@ -588,6 +588,10 @@ i686_mrinit(struct mem_range_softc *sc) u_int regs[4]; int i, nmdesc = 0, pabits; + if (sc->mr_desc != NULL) + /* Already initialized. */ + return; + mtrrcap = rdmsr(MSR_MTRRcap); mtrrdef = rdmsr(MSR_MTRRdefType); @@ -716,5 +720,6 @@ i686_mem_drvinit(void *unused) return; } mem_range_softc.mr_op = &i686_mrops; + i686_mrinit(&mem_range_softc); } -SYSINIT(i686memdev, SI_SUB_DRIVERS, SI_ORDER_FIRST, i686_mem_drvinit, NULL); +SYSINIT(i686memdev, SI_SUB_CPU, SI_ORDER_ANY, i686_mem_drvinit, NULL); From owner-svn-src-head@freebsd.org Fri Feb 17 13:22:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A527BCE2933; Fri, 17 Feb 2017 13:22:36 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40C6C1852; Fri, 17 Feb 2017 13:22:36 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-lf0-x243.google.com with SMTP id z127so1465831lfa.2; Fri, 17 Feb 2017 05:22:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=UKTNCKhYFCOsTrcCDlWjlznNi/8g5I0W2skXg67XU2I=; b=GMQofCUBXeeT25RI+EXJGPg8I7qGxAsgYkq3FDu6qENkW+W+fXen4v50FfesOMOOJO zRJhZqw3kblXfAH/FDsTvhk5EkiFXLMbxBaFQGgKD74RN9ez+6HiagxOWbnYjAhVfVdx VISMyVqYHL/aqQU1OaFoLY0bysyfnUZv9ZDs/A2zFyicJjODAbBO+dq12cW8U26RHo7B gy2FfovKKu/3YFAtX8QTsyMmPqLBJxeXOCH2N+LeIWDqBfjeDRg9Pai0OSngLFZg0+Nt RIIowfEqlPcTOhdjhUVE5msn387ZyPrsyW5+Ry6b73VlqbrPBU+d6kYOHDF7AAj6gW4a +ePw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=UKTNCKhYFCOsTrcCDlWjlznNi/8g5I0W2skXg67XU2I=; b=BhnmeYMZAL0hEma++0k/Pwzx4T3mRi/Ns+eb0+vYwZeS8E3B+92yJfdw5bhStQapkW VLUac4jOdJawxXTRKuUJhiMN9AjEEB/SvgaJPrrDl7cjvZIvts8Wsck7vVNZA+fC3Spk OhcCI+hgQfq3pOjSTVVgbU3eb8+r9C/h+0+xP8sLSLtdJ24QCFErqe/lAfdZJYyr0OxE 4IQEPxI0izexXJugQI84QFpJsxd6Q4JDJHtO5qa5ucN8AiZya5+4cPlNeaUQan9IMTbC 0Y4zXOKPU5mxigFRE5RHPBUbfapN+5A3dmt2aEklzvFnsDLISG9b+7DJZBOfpjxMJRxM PxKg== X-Gm-Message-State: AMke39kZhQuS9yXdAd3O1Nlc2BEB2aFg7bEnN0mqX29WupqItZiBoCNzV2TFp2F6tIcqsg== X-Received: by 10.46.84.84 with SMTP id y20mr2060878ljd.111.1487337753011; Fri, 17 Feb 2017 05:22:33 -0800 (PST) Received: from spectre.mavhome.dp.ua ([134.249.139.101]) by smtp.gmail.com with ESMTPSA id 13sm2534941ljb.57.2017.02.17.05.22.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Feb 2017 05:22:32 -0800 (PST) Sender: Alexander Motin Subject: Re: svn commit: r313854 - head/sys/cam/ctl To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201702170522.v1H5MwGK027647@repo.freebsd.org> <20170217102408.GA74901@brick> From: Alexander Motin Message-ID: <653994e0-b49f-21ac-3bdc-d6fc34496b29@FreeBSD.org> Date: Fri, 17 Feb 2017 15:22:30 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170217102408.GA74901@brick> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 13:22:36 -0000 On 17.02.2017 12:24, Edward Tomasz Napierała wrote: > On 0217T0522, Alexander Motin wrote: >> Author: mav >> Date: Fri Feb 17 05:22:58 2017 >> New Revision: 313854 >> URL: https://svnweb.freebsd.org/changeset/base/313854 >> >> Log: >> Change the way MaxCmdSN is used. >> >> Before this change MaxCmdSN was reported as CmdSN + delta, that made it >> limit number of requests in transmission from the initiator to target, >> that was pretty useless. After this change MaxCmdSN limits number of >> requests queued to CTL, i.e. maximal queue depth for the initiator. >> The default limit is 256 outstanding requests per initiator at a time. >> >> This code uses existing cs_outstanding_ctl_pdus counter to track queue >> depth. It's semantics doen't perfectly match, but close enough to not >> add another counter. Just don't set the maxtags below 2. > > I like the change in principle, but I don't like the gratuitous change > of sysctl name. It will break people's configs. Could you rename it > back? Thanks! But its meaning is different now. Do you know anybody tuning the old sysctl? I can't imagine who would do it and what for. -- Alexander Motin From owner-svn-src-head@freebsd.org Fri Feb 17 13:31:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 066B7CE2A3B; Fri, 17 Feb 2017 13:31:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADA6A1CA7; Fri, 17 Feb 2017 13:31:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HDVB0M022362; Fri, 17 Feb 2017 13:31:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HDVB5A022360; Fri, 17 Feb 2017 13:31:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201702171331.v1HDVB5A022360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 17 Feb 2017 13:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313872 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 13:31:13 -0000 Author: hselasky Date: Fri Feb 17 13:31:11 2017 New Revision: 313872 URL: https://svnweb.freebsd.org/changeset/base/313872 Log: Implement GFP_DMA32 flag in the LinuxKPI. Define all FreeBSD native GFP bits as GFP_NATIVE_MASK. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h head/sys/compat/linuxkpi/common/include/linux/gfp.h Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Fri Feb 17 12:47:51 2017 (r313871) +++ head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Fri Feb 17 13:31:11 2017 (r313872) @@ -129,8 +129,10 @@ dma_alloc_coherent(struct device *dev, s if (dev->dma_mask) high = *dev->dma_mask; - else + else if (flag & GFP_DMA32) high = BUS_SPACE_MAXADDR_32BIT; + else + high = BUS_SPACE_MAXADDR; align = PAGE_SIZE << get_order(size); mem = (void *)kmem_alloc_contig(kmem_arena, size, flag, 0, high, align, 0, VM_MEMATTR_DEFAULT); Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/gfp.h Fri Feb 17 12:47:51 2017 (r313871) +++ head/sys/compat/linuxkpi/common/include/linux/gfp.h Fri Feb 17 13:31:11 2017 (r313872) @@ -53,7 +53,7 @@ #define __GFP_IO 0 #define __GFP_NO_KSWAPD 0 #define __GFP_WAIT M_WAITOK -#define __GFP_DMA32 0 +#define __GFP_DMA32 (1U << 24) /* LinuxKPI only */ #define GFP_NOWAIT M_NOWAIT #define GFP_ATOMIC (M_NOWAIT | M_USE_RESERVE) @@ -63,8 +63,9 @@ #define GFP_HIGHUSER_MOVABLE M_WAITOK #define GFP_IOFS M_NOWAIT #define GFP_NOIO M_NOWAIT -#define GFP_DMA32 0 +#define GFP_DMA32 __GFP_DMA32 #define GFP_TEMPORARY M_NOWAIT +#define GFP_NATIVE_MASK (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_ZERO) static inline void * page_address(struct page *page) From owner-svn-src-head@freebsd.org Fri Feb 17 13:49:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37A55CE313B; Fri, 17 Feb 2017 13:49:48 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04A5716E4; Fri, 17 Feb 2017 13:49:47 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HDnlbJ030649; Fri, 17 Feb 2017 13:49:47 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HDnl0u030648; Fri, 17 Feb 2017 13:49:47 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201702171349.v1HDnl0u030648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 17 Feb 2017 13:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313873 - head/lib/libc/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 13:49:48 -0000 Author: mmel Date: Fri Feb 17 13:49:46 2017 New Revision: 313873 URL: https://svnweb.freebsd.org/changeset/base/313873 Log: Publish fp[get][set]sticky() for ARMv6. Although fp[get][set]sticky() functions are obsolete, they are still required for GNU fortran49 library. MFC after: 2 months Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D9634 Modified: head/lib/libc/arm/Symbol_vfp.map Modified: head/lib/libc/arm/Symbol_vfp.map ============================================================================== --- head/lib/libc/arm/Symbol_vfp.map Fri Feb 17 13:31:11 2017 (r313872) +++ head/lib/libc/arm/Symbol_vfp.map Fri Feb 17 13:49:46 2017 (r313873) @@ -8,3 +8,8 @@ FBSD_1.0 { fpsetmask; fpsetround; }; + +FBSD_1.5 { + fpgetsticky; + fpsetsticky; +}; From owner-svn-src-head@freebsd.org Fri Feb 17 14:05:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84328CE34A1; Fri, 17 Feb 2017 14:05:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5187F1059; Fri, 17 Feb 2017 14:05:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HE5v7t038721; Fri, 17 Feb 2017 14:05:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HE5vfO038720; Fri, 17 Feb 2017 14:05:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702171405.v1HE5vfO038720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 17 Feb 2017 14:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313874 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 14:05:58 -0000 Author: mjg Date: Fri Feb 17 14:05:57 2017 New Revision: 313874 URL: https://svnweb.freebsd.org/changeset/base/313874 Log: Make inline lockstat checks just inspect lockstat_enabled There is no correctness issue and this lets the kernel just test one typically false variable. Modified: head/sys/sys/lockstat.h Modified: head/sys/sys/lockstat.h ============================================================================== --- head/sys/sys/lockstat.h Fri Feb 17 13:49:46 2017 (r313873) +++ head/sys/sys/lockstat.h Fri Feb 17 14:05:57 2017 (r313874) @@ -107,6 +107,13 @@ extern int lockstat_enabled; LOCKSTAT_RECORD1(probe, lp, a); \ } while (0) +#ifndef LOCK_PROFILING +#define LOCKSTAT_PROFILE_ENABLED(probe) __predict_false(lockstat_enabled) +#define LOCKSTAT_OOL_PROFILE_ENABLED(probe) LOCKSTAT_PROFILE_ENABLED(probe) +#else +#define LOCKSTAT_OOL_PROFILE_ENABLED(probe) 1 +#endif + struct lock_object; uint64_t lockstat_nsecs(struct lock_object *); @@ -130,16 +137,12 @@ uint64_t lockstat_nsecs(struct lock_obje #define LOCKSTAT_PROFILE_RELEASE_RWLOCK(probe, lp, a) \ LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp) -#endif /* !KDTRACE_HOOKS */ - #ifndef LOCK_PROFILING -#define LOCKSTAT_PROFILE_ENABLED(probe) \ - SDT_PROBE_ENABLED(lockstat, , , probe) -#define LOCKSTAT_OOL_PROFILE_ENABLED(probe) \ - SDT_PROBE_ENABLED(lockstat, , , probe) -#else -#define LOCKSTAT_OOL_PROFILE_ENABLED(probe) 1 +#define LOCKSTAT_PROFILE_ENABLED(probe) 0 #endif +#define LOCKSTAT_OOL_PROFILE_ENABLED(probe) 1 + +#endif /* !KDTRACE_HOOKS */ #endif /* _KERNEL */ #endif /* _SYS_LOCKSTAT_H */ From owner-svn-src-head@freebsd.org Fri Feb 17 14:56:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2F4BCE3EDC; Fri, 17 Feb 2017 14:56:00 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D7CA18CA; Fri, 17 Feb 2017 14:56:00 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HEtxg1058652; Fri, 17 Feb 2017 14:55:59 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HEtxS5058649; Fri, 17 Feb 2017 14:55:59 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702171455.v1HEtxS5058649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 17 Feb 2017 14:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313875 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 14:56:00 -0000 Author: mjg Date: Fri Feb 17 14:55:59 2017 New Revision: 313875 URL: https://svnweb.freebsd.org/changeset/base/313875 Log: mtx: microoptimize lockstat handling in __mtx_lock_sleep This saves a function call and multiple branches after the lock is acquired. Modified: head/sys/kern/kern_lockstat.c head/sys/kern/kern_mutex.c head/sys/sys/lockstat.h Modified: head/sys/kern/kern_lockstat.c ============================================================================== --- head/sys/kern/kern_lockstat.c Fri Feb 17 14:05:57 2017 (r313874) +++ head/sys/kern/kern_lockstat.c Fri Feb 17 14:55:59 2017 (r313875) @@ -62,7 +62,7 @@ SDT_PROBE_DEFINE1(lockstat, , , sx__down SDT_PROBE_DEFINE2(lockstat, , , thread__spin, "struct mtx *", "uint64_t"); -int __read_mostly lockstat_enabled; +volatile int __read_mostly lockstat_enabled; uint64_t lockstat_nsecs(struct lock_object *lo) Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Fri Feb 17 14:05:57 2017 (r313874) +++ head/sys/kern/kern_mutex.c Fri Feb 17 14:55:59 2017 (r313875) @@ -446,6 +446,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; + int doing_lockstat; #endif if (SCHEDULER_STOPPED()) @@ -484,7 +485,9 @@ __mtx_lock_sleep(volatile uintptr_t *c, "_mtx_lock_sleep: %s contested (lock=%p) at %s:%d", m->lock_object.lo_name, (void *)m->mtx_lock, file, line); #ifdef KDTRACE_HOOKS - all_time -= lockstat_nsecs(&m->lock_object); + doing_lockstat = lockstat_enabled; + if (__predict_false(doing_lockstat)) + all_time -= lockstat_nsecs(&m->lock_object); #endif for (;;) { @@ -591,9 +594,6 @@ __mtx_lock_sleep(volatile uintptr_t *c, #endif v = MTX_READ_VALUE(m); } -#ifdef KDTRACE_HOOKS - all_time += lockstat_nsecs(&m->lock_object); -#endif #ifdef KTR if (cont_logged) { CTR4(KTR_CONTENTION, @@ -601,6 +601,11 @@ __mtx_lock_sleep(volatile uintptr_t *c, m->lock_object.lo_name, (void *)tid, file, line); } #endif +#ifdef KDTRACE_HOOKS + if (__predict_true(!doing_lockstat)) + return; + all_time += lockstat_nsecs(&m->lock_object); +#endif LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(adaptive__acquire, m, contested, waittime, file, line); #ifdef KDTRACE_HOOKS Modified: head/sys/sys/lockstat.h ============================================================================== --- head/sys/sys/lockstat.h Fri Feb 17 14:05:57 2017 (r313874) +++ head/sys/sys/lockstat.h Fri Feb 17 14:55:59 2017 (r313875) @@ -68,7 +68,7 @@ SDT_PROBE_DECLARE(lockstat, , , thread__ #define LOCKSTAT_WRITER 0 #define LOCKSTAT_READER 1 -extern int lockstat_enabled; +extern volatile int lockstat_enabled; #ifdef KDTRACE_HOOKS From owner-svn-src-head@freebsd.org Fri Feb 17 15:34:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82BD2CE383A; Fri, 17 Feb 2017 15:34:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D38C1BCD; Fri, 17 Feb 2017 15:34:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HFYePX074749; Fri, 17 Feb 2017 15:34:40 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HFYeSj074747; Fri, 17 Feb 2017 15:34:40 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702171534.v1HFYeSj074747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 17 Feb 2017 15:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313877 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 15:34:41 -0000 Author: mjg Date: Fri Feb 17 15:34:40 2017 New Revision: 313877 URL: https://svnweb.freebsd.org/changeset/base/313877 Log: mtx: restrict r313875 to kernels without LOCK_PROFILING Modified: head/sys/kern/kern_mutex.c head/sys/sys/mutex.h Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Fri Feb 17 15:00:13 2017 (r313876) +++ head/sys/kern/kern_mutex.c Fri Feb 17 15:34:40 2017 (r313877) @@ -423,9 +423,14 @@ _mtx_trylock_flags_(volatile uintptr_t * * We call this if the lock is either contested (i.e. we need to go to * sleep waiting for it), or if we need to recurse on it. */ +#if LOCK_DEBUG > 0 void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, int opts, const char *file, int line) +#else +void +__mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, int opts) +#endif { struct mtx *m; struct turnstile *ts; @@ -485,7 +490,11 @@ __mtx_lock_sleep(volatile uintptr_t *c, "_mtx_lock_sleep: %s contested (lock=%p) at %s:%d", m->lock_object.lo_name, (void *)m->mtx_lock, file, line); #ifdef KDTRACE_HOOKS +#ifdef LOCK_PROFILING + doing_lockstat = 1; +#else doing_lockstat = lockstat_enabled; +#endif if (__predict_false(doing_lockstat)) all_time -= lockstat_nsecs(&m->lock_object); #endif @@ -859,8 +868,13 @@ thread_lock_set(struct thread *td, struc * We are only called here if the lock is recursed, contested (i.e. we * need to wake up a blocked thread) or lockstat probe is active. */ +#if LOCK_DEBUG > 0 void __mtx_unlock_sleep(volatile uintptr_t *c, int opts, const char *file, int line) +#else +void +__mtx_unlock_sleep(volatile uintptr_t *c, int opts) +#endif { struct mtx *m; struct turnstile *ts; Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Fri Feb 17 15:00:13 2017 (r313876) +++ head/sys/sys/mutex.h Fri Feb 17 15:34:40 2017 (r313877) @@ -98,10 +98,17 @@ void mtx_sysinit(void *arg); int _mtx_trylock_flags_(volatile uintptr_t *c, int opts, const char *file, int line); void mutex_init(void); +#if LOCK_DEBUG > 0 void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, int opts, const char *file, int line); void __mtx_unlock_sleep(volatile uintptr_t *c, int opts, const char *file, int line); +#else +void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, + int opts); +void __mtx_unlock_sleep(volatile uintptr_t *c, int opts); +#endif + #ifdef SMP void _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, int opts, const char *file, int line); @@ -140,10 +147,17 @@ void thread_lock_flags_(struct thread *, _mtx_destroy(&(m)->mtx_lock) #define mtx_trylock_flags_(m, o, f, l) \ _mtx_trylock_flags_(&(m)->mtx_lock, o, f, l) +#if LOCK_DEBUG > 0 #define _mtx_lock_sleep(m, v, t, o, f, l) \ __mtx_lock_sleep(&(m)->mtx_lock, v, t, o, f, l) #define _mtx_unlock_sleep(m, o, f, l) \ __mtx_unlock_sleep(&(m)->mtx_lock, o, f, l) +#else +#define _mtx_lock_sleep(m, v, t, o, f, l) \ + __mtx_lock_sleep(&(m)->mtx_lock, v, t, o) +#define _mtx_unlock_sleep(m, o, f, l) \ + __mtx_unlock_sleep(&(m)->mtx_lock, o) +#endif #ifdef SMP #define _mtx_lock_spin(m, v, t, o, f, l) \ _mtx_lock_spin_cookie(&(m)->mtx_lock, v, t, o, f, l) From owner-svn-src-head@freebsd.org Fri Feb 17 15:40:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7BE5CE3EDE; Fri, 17 Feb 2017 15:40:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4F2812D4; Fri, 17 Feb 2017 15:40:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HFeO7V074992; Fri, 17 Feb 2017 15:40:24 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HFeOAs074991; Fri, 17 Feb 2017 15:40:24 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702171540.v1HFeOAs074991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 17 Feb 2017 15:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313878 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 15:40:26 -0000 Author: mjg Date: Fri Feb 17 15:40:24 2017 New Revision: 313878 URL: https://svnweb.freebsd.org/changeset/base/313878 Log: mtx: get rid of file/line args from slow paths if they are unused This denotes changes which went in by accident in r313877. On most production kernels both said parameters are zeroed and have nothing reading them in either __mtx_lock_sleep or __mtx_unlock_sleep. Thus this change stops passing them by internal consumers which this is the case. Kernel modules use _flags variants which are not affected kbi-wise. Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Fri Feb 17 15:34:40 2017 (r313877) +++ head/sys/kern/kern_mutex.c Fri Feb 17 15:40:24 2017 (r313878) @@ -622,7 +622,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, LOCKSTAT_RECORD1(adaptive__block, m, sleep_time); /* - * Only record the loops spinning and not sleeping. + * Only record the loops spinning and not sleeping. */ if (lda.spin_cnt > sleep_cnt) LOCKSTAT_RECORD1(adaptive__spin, m, all_time - sleep_time); From owner-svn-src-head@freebsd.org Fri Feb 17 15:52:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7354CE33CE; Fri, 17 Feb 2017 15:52:10 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr0-x230.google.com (mail-wr0-x230.google.com [IPv6:2a00:1450:400c:c0c::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 583BF1A4B; Fri, 17 Feb 2017 15:52:10 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr0-x230.google.com with SMTP id i10so32264827wrb.0; Fri, 17 Feb 2017 07:52:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=6BhJUl/v8ZzH9CVojlMenNGMLvrx4d85pifyC0P8b7g=; b=BjUFd1jkP9XSHSY5XY6RQlmlfIcCqQwmE3HkN9iyL25YEUFzEcUVk0qU+QFOzmikEy dldgHBSU0XB3UE1JIkw2Bt+OjqmMwN50CxaleY4r/KfgE/SRYQt6PgMy5Zmf0WWvjCqf yeIg8wrAF7DA+7Vy8tE/abWIXWFsConKJ2UdV6fH5Y9ozNyudURud8AMFW/RCLTs3MoR O/BcTjo+SeGQr/2rjh9TWf0EA6E2xL6rwJ8GFWLBkCpVR3X+hGmJ9kSsBtLC1cdAH+Up Z6MAjzc9pjBURO8izo0yEV12B/DGvMYaKZzMPo2BdJxKYwfy2FAZMLvVo5Bao9UB5jiw Zdqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=6BhJUl/v8ZzH9CVojlMenNGMLvrx4d85pifyC0P8b7g=; b=ugfuieDZMwNnq9G9hx6eKtq7txYeifn6R8GMEIme82TCLped7D7aproUyda1uDReWl sA/3o9DInAO/sWst1+uz8fdTxB0I9xfexTYygOYQ/rJ5RUtpmNjlLyulLq0WVjO4nfhd //5+peRrAa4FcTN99R0/dPgbG5Lg0+CsfuZnU2Bd72EVi+NcP9kIYyOVM7aLkSb4yiu3 4AC6ZMumhE/dX4Ta75n1dwmsosjDok2+6vrizXsLG+rLIjWjNk8egb7sbuFlJ3JziTyq ot4R4PZn94+EBpSkXMK5I9wQwzR+Qr3dTgVXt+J29AIJ52F0xZrf90iRp3yBibB2jIc6 ZdqQ== X-Gm-Message-State: AMke39lfoZb7nMn+QvgGHdF4cNxKivwWTuhrNoXMSodF2MsbmjkrQWnlMt5SV/l5NHxZlA== X-Received: by 10.223.150.59 with SMTP id b56mr7286905wra.192.1487346728628; Fri, 17 Feb 2017 07:52:08 -0800 (PST) Received: from brick (global-5-142.nat-2.net.cam.ac.uk. [131.111.5.142]) by smtp.gmail.com with ESMTPSA id c202sm2149079wmd.10.2017.02.17.07.52.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Feb 2017 07:52:08 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 17 Feb 2017 15:52:06 +0000 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r313854 - head/sys/cam/ctl Message-ID: <20170217155206.GA40422@brick> Mail-Followup-To: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201702170522.v1H5MwGK027647@repo.freebsd.org> <20170217102408.GA74901@brick> <653994e0-b49f-21ac-3bdc-d6fc34496b29@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <653994e0-b49f-21ac-3bdc-d6fc34496b29@FreeBSD.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 15:52:10 -0000 On 0217T1522, Alexander Motin wrote: > On 17.02.2017 12:24, Edward Tomasz Napierała wrote: > > On 0217T0522, Alexander Motin wrote: > >> Author: mav > >> Date: Fri Feb 17 05:22:58 2017 > >> New Revision: 313854 > >> URL: https://svnweb.freebsd.org/changeset/base/313854 > >> > >> Log: > >> Change the way MaxCmdSN is used. > >> > >> Before this change MaxCmdSN was reported as CmdSN + delta, that made it > >> limit number of requests in transmission from the initiator to target, > >> that was pretty useless. After this change MaxCmdSN limits number of > >> requests queued to CTL, i.e. maximal queue depth for the initiator. > >> The default limit is 256 outstanding requests per initiator at a time. > >> > >> This code uses existing cs_outstanding_ctl_pdus counter to track queue > >> depth. It's semantics doen't perfectly match, but close enough to not > >> add another counter. Just don't set the maxtags below 2. > > > > I like the change in principle, but I don't like the gratuitous change > > of sysctl name. It will break people's configs. Could you rename it > > back? Thanks! > > But its meaning is different now. Do you know anybody tuning the old > sysctl? I can't imagine who would do it and what for. Yes. It's been asked about a few times on forums, and it's documented in ctl(4). The new meaning is slightly different, sure, but I'd say it's very close, except that now it really works :-) From owner-svn-src-head@freebsd.org Fri Feb 17 16:51:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDADCCE3657; Fri, 17 Feb 2017 16:51:52 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id D646215B1; Fri, 17 Feb 2017 16:51:52 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from ford.home.vangyzen.net (unknown [76.164.15.242]) by smtp.vangyzen.net (Postfix) with ESMTPSA id B0C4A56486; Fri, 17 Feb 2017 10:51:45 -0600 (CST) Subject: Re: svn commit: r313821 - in head/sys: dev/cxgb/ulp/iw_cxgb fs/nfsserver kern netinet netinet/libalias netpfil/ipfw To: Gleb Smirnoff References: <201702162047.v1GKlf9j014479@repo.freebsd.org> <20170217041748.GI58829@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eric van Gyzen Message-ID: Date: Fri, 17 Feb 2017 10:51:40 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170217041748.GI58829@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 16:51:53 -0000 On 02/16/2017 22:17, Gleb Smirnoff wrote: > Eric, > > heh, things are worse. Multiple places you changes are CTR() > macros. Neither inet_ntoa() nor inet_ntoa_r() will work with > them. :( > > Basicly non-constant strings can not be logged with KTR. All > the lines you touched should log actual binary value of the > IPv4 address. *facepalm* It's even worse, because I /knew/ about this, but I failed to think of it while making this change. Oh well. > I am not asking you to do this work! :) But I couldn't leave > that without a comment. :) Thanks for mentioning it. Eric From owner-svn-src-head@freebsd.org Fri Feb 17 17:52:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79CE0CE34FC; Fri, 17 Feb 2017 17:52:13 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B2121C9C; Fri, 17 Feb 2017 17:52:13 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HHqCr1032487; Fri, 17 Feb 2017 17:52:12 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HHqCXQ032486; Fri, 17 Feb 2017 17:52:12 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201702171752.v1HHqCXQ032486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Fri, 17 Feb 2017 17:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313879 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 17:52:13 -0000 Author: jpaetzel Date: Fri Feb 17 17:52:12 2017 New Revision: 313879 URL: https://svnweb.freebsd.org/changeset/base/313879 Log: MVF: 313876 7504 kmem_reap hangs spa_sync and administrative tasks illumos/illumos-gate@405a5a0f5c3ab36cb76559467d1a62ba648bd809 https://github.com/illumos/illumos-gate/commit/405a5a0f5c3ab36cb76559467d1a62ba648bd80 https://www.illumos.org/issues/7504 We see long spa_sync(). We are waiting to hold dp_config_rwlock for writer. Some other thread holds dp_config_rwlock for reader, then calls arc_get_data_buf(), which finds that arc_is_overflowing()==B_TRUE. So it waits (while holding dp_config_rwlock for reader) for arc_reclaim_thread to signal arc_reclaim_waiters_cv. Before signaling, arc_reclaim_thread does arc_kmem_reap_now(), which takes ~seconds. Author: Matthew Ahrens Reviewed by: George Wilson Reviewed by: Prakash Surya Approved by: Dan McDonald Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Feb 17 15:40:24 2017 (r313878) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Feb 17 17:52:12 2017 (r313879) @@ -4086,7 +4086,6 @@ arc_reclaim_thread(void *dummy __unused) mutex_enter(&arc_reclaim_lock); while (!arc_reclaim_thread_exit) { - int64_t free_memory = arc_available_memory(); uint64_t evicted = 0; /* @@ -4105,6 +4104,14 @@ arc_reclaim_thread(void *dummy __unused) mutex_exit(&arc_reclaim_lock); + /* + * We call arc_adjust() before (possibly) calling + * arc_kmem_reap_now(), so that we can wake up + * arc_get_data_buf() sooner. + */ + evicted = arc_adjust(); + + int64_t free_memory = arc_available_memory(); if (free_memory < 0) { arc_no_grow = B_TRUE; @@ -4138,8 +4145,6 @@ arc_reclaim_thread(void *dummy __unused) arc_no_grow = B_FALSE; } - evicted = arc_adjust(); - mutex_enter(&arc_reclaim_lock); /* From owner-svn-src-head@freebsd.org Fri Feb 17 18:49:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C46ECE231C; Fri, 17 Feb 2017 18:49:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4D6C14BE; Fri, 17 Feb 2017 18:49:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HInJvJ054392; Fri, 17 Feb 2017 18:49:19 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HInIKA054389; Fri, 17 Feb 2017 18:49:18 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201702171849.v1HInIKA054389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 17 Feb 2017 18:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313880 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 18:49:20 -0000 Author: adrian Date: Fri Feb 17 18:49:18 2017 New Revision: 313880 URL: https://svnweb.freebsd.org/changeset/base/313880 Log: [asmc] Add support for MacBook Pro 11,2 This patch will add support for MacBookPro 11.2. For the macros, the MBP11_* macros (for the existing MacBookPro11.3) did not match so they have been renamed to MBP113_* and a new MBP112_* has been added (modified copy of MBP11_*). Some trailing whitespaces may have been removed automatically. PR: kern/214836 Obtained from: Johannes Lundberg sc_mtx, "asmc", NULL, MTX_SPIN); @@ -495,13 +501,13 @@ asmc_attach(device_t dev) sc->sc_light_tree = SYSCTL_ADD_NODE(sysctlctx, SYSCTL_CHILDREN(sysctlnode), OID_AUTO, "light", CTLFLAG_RD, 0, "Keyboard backlight sensors"); - + SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_light_tree), OID_AUTO, "left", CTLTYPE_INT | CTLFLAG_RD, dev, 0, model->smc_light_left, "I", "Keyboard backlight left sensor"); - + SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_light_tree), OID_AUTO, "right", CTLTYPE_INT | CTLFLAG_RD, @@ -574,7 +580,7 @@ asmc_attach(device_t dev) goto err2; } - ret = bus_setup_intr(dev, sc->sc_irq, + ret = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_MISC | INTR_MPSAFE, #ifdef INTR_FILTER asmc_sms_intrfast, asmc_sms_handler, @@ -663,7 +669,7 @@ asmc_init(device_t dev) asmc_key_write(dev, ASMC_KEY_INTOK, buf, 1); DELAY(50); - /* + /* * Initiate the polling intervals. */ buf[0] = 20; /* msecs */ @@ -698,13 +704,13 @@ asmc_init(device_t dev) DELAY(100); sc->sc_sms_intr_works = 0; - + /* * Retry SMS initialization 1000 times * (takes approx. 2 seconds in worst case) */ for (i = 0; i < 1000; i++) { - if (asmc_key_read(dev, ASMC_KEY_SMS, buf, 2) == 0 && + if (asmc_key_read(dev, ASMC_KEY_SMS, buf, 2) == 0 && (buf[0] == ASMC_SMS_INIT1 && buf[1] == ASMC_SMS_INIT2)) { error = 0; sc->sc_sms_intr_works = 1; @@ -734,7 +740,7 @@ nosms: */ asmc_key_read(dev, ASMC_NKEYS, buf, 4); device_printf(dev, "number of keys: %d\n", ntohl(*(uint32_t*)buf)); - } + } #ifdef DEBUG asmc_dumpall(dev); @@ -782,10 +788,10 @@ asmc_wait(device_t dev, uint8_t val) #ifdef DEBUG device_printf(dev, "%s failed: 0x%x, 0x%x\n", __func__, val, ASMC_CMDPORT_READ(sc)); -#endif +#endif return (1); } - + /* * Send the given command, retrying up to 10 times if * the acknowledgement fails. @@ -919,7 +925,7 @@ out: maxlen = type[0]; type[0] = ' '; type[5] = 0; - if (maxlen > sizeof(v)) { + if (maxlen > sizeof(v)) { device_printf(dev, "WARNING: cropping maxlen from %d to %zu\n", maxlen, sizeof(v)); @@ -1189,7 +1195,7 @@ asmc_sms_read(device_t dev, const char * uint8_t buf[2]; int error; - /* no need to do locking here as asmc_key_read() already does it */ + /* no need to do locking here as asmc_key_read() already does it */ switch (key[3]) { case 'X': case 'Y': @@ -1246,7 +1252,7 @@ static void asmc_sms_handler(void *arg) { struct asmc_softc *sc = device_get_softc(arg); - + asmc_sms_task(sc, 0); } #endif @@ -1293,7 +1299,7 @@ asmc_sms_task(void *arg, int pending) } snprintf(notify, sizeof(notify), " notify=0x%x", type); - devctl_notify("ACPI", "asmc", "SMS", notify); + devctl_notify("ACPI", "asmc", "SMS", notify); } static int @@ -1363,11 +1369,11 @@ asmc_mbp_sysctl_light_right(SYSCTL_HANDL uint8_t buf[6]; int error; int32_t v; - + asmc_key_read(dev, ASMC_KEY_LIGHTRIGHT, buf, sizeof buf); v = buf[2]; error = sysctl_handle_int(oidp, &v, 0, req); - + return (error); } Modified: head/sys/dev/asmc/asmcvar.h ============================================================================== --- head/sys/dev/asmc/asmcvar.h Fri Feb 17 17:52:12 2017 (r313879) +++ head/sys/dev/asmc/asmcvar.h Fri Feb 17 18:49:18 2017 (r313880) @@ -76,7 +76,7 @@ struct asmc_softc { /* Number of keys */ -#define ASMC_NKEYS "#KEY" /* RO; 4 bytes */ +#define ASMC_NKEYS "#KEY" /* RO; 4 bytes */ /* * Fan control via SMC. @@ -154,7 +154,7 @@ struct asmc_softc { #define ASMC_MB31_TEMPDESCS { "Enclosure Bottomside", \ "Northbridge Point 1", \ "Heatsink 1","Heatsink 2" \ - "Memory Bank A", } + "Memory Bank A", } #define ASMC_MBP_TEMPS { "TB0T", "Th0H", "Th1H", "Tm0P", \ "TG0H", "TG0P", "TG0T", NULL } @@ -167,7 +167,7 @@ struct asmc_softc { "Heatsink 1", "Heatsink 2", \ "Memory Controller", \ "Graphics Chip", "Graphics Heatsink", \ - "Unknown", } + "Unknown", } #define ASMC_MBP4_TEMPS { "TB0T", "Th0H", "Th1H", "Th2H", "Tm0P", \ "TG0H", "TG0D", "TC0D", "TC0P", "Ts0P", \ @@ -186,13 +186,13 @@ struct asmc_softc { "Graphics Chip Diode", \ "CPU Temperature Diode", "CPU Point 2", \ "Unknown", "Unknown", \ - "Wireless Module", } + "Wireless Module", } #define ASMC_MBP5_TEMPS { "TB0T", "TB1T", "TB2T", "TB3T", "TC0D", \ "TC0F", "TC0P", "TG0D", "TG0F", "TG0H", \ "TG0P", "TG0T", "TG1H", "TN0D", "TN0P", \ "TTF0", "Th2H", "Tm0P", "Ts0P", "Ts0S", \ - NULL } + NULL } #define ASMC_MBP5_TEMPNAMES { "enclosure_bottom_0", "enclosure_bottom_1", \ "enclosure_bottom_2", "enclosure_bottom_3", \ @@ -203,7 +203,7 @@ struct asmc_softc { "gpu_2_heatsink", "northbridge_diode", \ "northbridge_pin", "unknown", \ "heatsink_2", "memory_controller", \ - "pci_express_slot_pin", "pci_express_slot_unk" } + "pci_express_slot_pin", "pci_express_slot_unk" } #define ASMC_MBP5_TEMPDESCS { "Enclosure Bottom 0", "Enclosure Bottom 1", \ "Enclosure Bottom 2", "Enclosure Bottom 3", \ @@ -214,30 +214,57 @@ struct asmc_softc { "GPU 2 Heatsink", "Northbridge Diode", \ "Northbridge Pin", "Unknown", \ "Heatsink 2", "Memory Controller", \ - "PCI Express Slot Pin", "PCI Express Slot (unk)" } + "PCI Express Slot Pin", "PCI Express Slot (unk)" } #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 } + "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" } + "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" } + "Th2H", "Tm0P", "Ts0P", "Ts0S" } + +#define ASMC_MBP112_TEMPS { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ + "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \ + "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \ + "TCXC", "TH0A", "TH0B", "TH0F", "TH0R", \ + "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \ + "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \ + "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \ + "Ts1S", NULL } + +#define ASMC_MBP112_TEMPNAMES { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ + "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \ + "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \ + "TCXC", "TH0A", "TH0B", "TH0F", "TH0R", \ + "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \ + "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \ + "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \ + "Ts1S" } + +#define ASMC_MBP112_TEMPDESCS { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ + "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \ + "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \ + "TCXC", "TH0A", "TH0B", "TH0F", "TH0R", \ + "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \ + "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \ + "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \ + "Ts1S" } -#define ASMC_MBP11_TEMPS { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ +#define ASMC_MBP113_TEMPS { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \ "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \ "TCXC", "TG0D", "TG0P", "TG1D", "TG1F", \ @@ -245,9 +272,9 @@ struct asmc_softc { "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \ "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \ "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \ - "Ts1S", NULL } + "Ts1S", NULL } -#define ASMC_MBP11_TEMPNAMES { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ +#define ASMC_MBP113_TEMPNAMES { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \ "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \ "TCXC", "TG0D", "TG0P", "TG1D", "TG1F", \ @@ -255,9 +282,9 @@ struct asmc_softc { "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \ "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \ "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \ - "Ts1S" } + "Ts1S" } -#define ASMC_MBP11_TEMPDESCS { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ +#define ASMC_MBP113_TEMPDESCS { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \ "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \ "TCXC", "TG0D", "TG0P", "TG1D", "TG1F", \ @@ -265,7 +292,8 @@ struct asmc_softc { "TH0V", "TH0a", "TH0b", "TH0c", "TM0P", \ "TM0S", "TP0P", "TPCD", "TW0P", "Ta0P", \ "TaSP", "Th1H", "Th2H", "Ts0P", "Ts0S", \ - "Ts1S" } + "Ts1S" } + #define ASMC_MM_TEMPS { "TN0P", "TN1P", NULL } #define ASMC_MM_TEMPNAMES { "northbridge1", "northbridge2" } From owner-svn-src-head@freebsd.org Fri Feb 17 19:12:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83EDECE2C91; Fri, 17 Feb 2017 19:12:27 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 60EBE1387; Fri, 17 Feb 2017 19:12:26 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id B7394174E7; Fri, 17 Feb 2017 11:06:21 -0800 (PST) Date: Fri, 17 Feb 2017 11:06:21 -0800 From: hiren panchasara To: Gleb Smirnoff Cc: "Simon J. Gerraty" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r278729 - head/sys/sys Message-ID: <20170217190621.GE66077@strugglingcoder.info> References: <201502132319.t1DNJZuP057045@svn.freebsd.org> <20150311213607.GN88380@strugglingcoder.info> <20150316123940.GA17947@FreeBSD.org> <20150317010654.GB53237@strugglingcoder.info> <20150319180812.GI53237@strugglingcoder.info> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="PPYy/fEw/8QCHSq3" Content-Disposition: inline In-Reply-To: <20150319180812.GI53237@strugglingcoder.info> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 19:12:27 -0000 --PPYy/fEw/8QCHSq3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 03/19/15 at 11:08P, hiren panchasara wrote: > On 03/16/15 at 06:06P, hiren panchasara wrote: > > On 03/16/15 at 03:39P, Gleb Smirnoff wrote: > > > On Wed, Mar 11, 2015 at 02:36:07PM -0700, hiren panchasara wrote: > > > h> On 02/13/15 at 11:19P, Simon J. Gerraty wrote: > > > h> > Author: sjg > > > h> > Date: Fri Feb 13 23:19:35 2015 > > > h> > New Revision: 278729 > > > h> > URL: https://svnweb.freebsd.org/changeset/base/278729 > > > h> >=20 > > > h> > Log: > > > h> > sbspace: size of bleft, mleft must match sockbuf fields to avo= id > > > h> > overflow on amd64 > > > h> > =20 > > > h> > Submitted by: anshukla@juniper.net > > > h> > Obtained from: Juniper Networks > > > h>=20 > > > h> Talking to sjg on -arch to MFC this. If he cannot get around doing= that, > > > h> I'll do it tomorrow.=20 > > > h>=20 > > > h> Letting people know here to see if there are any objections. > > >=20 > > > Would that fix the bug we've been discussing? > >=20 > > Unsure as I am not sure what caused the issue I saw. > >=20 > > For those who do not know the details, we recently saw a userland > > process stuck spinning at 100% around sbcut_internal(). Inside > > sbflush_internal(), the sb_cc was grown to be about 4G. And before > > passing it to sbcut_internal(), we cast it from uint to int which > > would make that valud -ve. > >=20 > > Gleb pointed out to me that sbspace() is supposed to check/stop sb_cc > > from growing that large. > >=20 > > Now, I am not sure if we'd ever run into this situation again but > > current fix is a great catch anyways. > >=20 > > I still have 2 questions around what we saw. It'd be great if someone c= an > > clarify them for my understanding: > >=20 > > 1) Even if we get into such a scenario that we were in, following would > > help by not looping endlessly. > >=20 > > --- uipc_sockbuf.c.0 2015-03-11 15:49:52.000000000 -0700 > > +++ uipc_sockbuf.c 2015-03-11 15:51:48.000000000 -0700 > > @@ -877,6 +877,9 @@ > > { > > struct mbuf *m, *n, *next, *mfree; > >=20 > > + if (len < 0) > > + panic("%s: len is %d and it is supposed to be +ve", > > + __func__, len); > > + > > next =3D (m =3D sb->sb_mb) ? m->m_nextpkt : 0; > > mfree =3D NULL > >=20 > > 2) We need 1) because we are casting a uint to int which _may_ rander a > > value -ve. Is there a way we can avoid the casting? >=20 > It'd be useful if someone with knowledge in this area can weigh in. Ran into this again today. While the real question of how sb_ccc grew this large is still unsolved, any objection to adding this patch to avoid a hang and panic instead? Cheers, Hiren --PPYy/fEw/8QCHSq3 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJYp0moXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lLG4IAJ+xldkMPsMXUL5x8iBE1xSR DiK8Ir1CfODMMOA0vRqr1iGmh6aPZomx6tb9Wso8jRV4JvuxzL0k5GqN9JwmzikD T+N8ttD6tTgm9McKIr1EzO+YRLG55KxZiQ+KJYtZq0M5s9O2hGL8tb74dstDpDlw n9f1BTyEJ38GBOgmOqQJepEd5AV/ZcbvVyaXymwI6qQo+EGGIKBU1GdupiWSPSO1 mO3nVOgw+DeqLFAeSVwI2ej/IF47S8DB9l/qt1vkS2jggXZVmGNPMrL7/CE4Nq4A HiYr4QqcYWKqdf3zbSSxlusluQ9l9juGDFPX+02J/cMjuI00+fS1x68jY13D1qI= =a+1M -----END PGP SIGNATURE----- --PPYy/fEw/8QCHSq3-- From owner-svn-src-head@freebsd.org Fri Feb 17 19:53:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76928CE3926; Fri, 17 Feb 2017 19:53:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D2E816DA; Fri, 17 Feb 2017 19:53:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HJrLvW083359; Fri, 17 Feb 2017 19:53:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HJrLKm083356; Fri, 17 Feb 2017 19:53:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702171953.v1HJrLKm083356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 17 Feb 2017 19:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313891 - head/usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 19:53:22 -0000 Author: pfg Date: Fri Feb 17 19:53:20 2017 New Revision: 313891 URL: https://svnweb.freebsd.org/changeset/base/313891 Log: sort(1): Remove unneeded initializations. Found by: Clang static analyzer Modified: head/usr.bin/sort/bwstring.c head/usr.bin/sort/coll.c head/usr.bin/sort/file.c Modified: head/usr.bin/sort/bwstring.c ============================================================================== --- head/usr.bin/sort/bwstring.c Fri Feb 17 19:39:31 2017 (r313890) +++ head/usr.bin/sort/bwstring.c Fri Feb 17 19:53:20 2017 (r313891) @@ -268,7 +268,7 @@ bwscsbdup(const unsigned char *str, size const char *s; size_t charlen, chars, cptr; - charlen = chars = 0; + chars = 0; cptr = 0; s = (const char *) str; @@ -581,7 +581,6 @@ bwsncmp(const struct bwstring *bws1, con size_t cmp_len, len1, len2; int res = 0; - cmp_len = 0; len1 = bws1->len; len2 = bws2->len; Modified: head/usr.bin/sort/coll.c ============================================================================== --- head/usr.bin/sort/coll.c Fri Feb 17 19:39:31 2017 (r313890) +++ head/usr.bin/sort/coll.c Fri Feb 17 19:53:20 2017 (r313891) @@ -330,8 +330,6 @@ find_field_end(const struct bwstring *s, size_t f2, next_field_start, pos_end; bool empty_field, empty_key; - pos_end = 0; - next_field_start = 0; empty_field = false; empty_key = false; f2 = ks->f2; @@ -827,7 +825,6 @@ numcoll_impl(struct key_value *kv1, stru main1 = main2 = 0; frac1 = frac2 = 0; - cmp_res = 0; key1_read = key2_read = false; if (debug_sort) { Modified: head/usr.bin/sort/file.c ============================================================================== --- head/usr.bin/sort/file.c Fri Feb 17 19:39:31 2017 (r313890) +++ head/usr.bin/sort/file.c Fri Feb 17 19:53:20 2017 (r313891) @@ -631,7 +631,6 @@ file_reader_init(const char *fsrc) int fd, flags; flags = MAP_NOCORE | MAP_NOSYNC; - addr = MAP_FAILED; fd = open(fsrc, O_RDONLY); if (fd < 0) From owner-svn-src-head@freebsd.org Fri Feb 17 20:02:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90EE7CE3CFD; Fri, 17 Feb 2017 20:02:41 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 421B51E21; Fri, 17 Feb 2017 20:02:41 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HK2ejR087534; Fri, 17 Feb 2017 20:02:40 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HK2elT087533; Fri, 17 Feb 2017 20:02:40 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201702172002.v1HK2elT087533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 17 Feb 2017 20:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313892 - head/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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 20:02:41 -0000 Author: sbruno Date: Fri Feb 17 20:02:40 2017 New Revision: 313892 URL: https://svnweb.freebsd.org/changeset/base/313892 Log: Update OLD_DIRS for various targets so that some of the branches of directories are pruned when the appropriate knobs are turned. Specifically, turning off bsdconfig, locales, examples, i18n, man, ntp, syscons. It may not seem like a lot, but it helps when trying to keep an x86 image under 96MB for MFSRoot netbooting. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D9558 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Feb 17 19:53:20 2017 (r313891) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Feb 17 20:02:40 2017 (r313892) @@ -1592,6 +1592,14 @@ OLD_FILES+=usr/share/man/man1/dpv.1.gz OLD_FILES+=usr/share/man/man3/dialog.3.gz OLD_FILES+=usr/share/man/man3/dpv.3.gz OLD_FILES+=usr/share/man/man8/bsdconfig.8.gz +OLD_DIRS+=usr/share/bsdconfig +OLD_DIRS+=usr/share/bsdconfig/media +OLD_DIRS+=usr/share/bsdconfig/networking +OLD_DIRS+=usr/share/bsdconfig/packages +OLD_DIRS+=usr/share/bsdconfig/password +OLD_DIRS+=usr/share/bsdconfig/startup +OLD_DIRS+=usr/share/bsdconfig/timezone +OLD_DIRS+=usr/share/bsdconfig/usermgmt .endif .if ${MK_FMTREE} == no @@ -2226,9 +2234,62 @@ OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/ee OLD_FILES+=usr/share/nls/uk_UA.KOI8-U/ee.cat .endif -#.if ${MK_EXAMPLES} == no -# to be filled in -#.endif +.if ${MK_EXAMPLES} == no +OLD_DIRS+=usr/share/examples +OLD_DIRS+=usr/share/examples/BSD_daemon +OLD_DIRS+=usr/share/examples/FreeBSD_version +OLD_DIRS+=usr/share/examples/IPv6 +OLD_DIRS+=usr/share/examples/bootforth +OLD_DIRS+=usr/share/examples/bsdconfig +OLD_DIRS+=usr/share/examples/csh +OLD_DIRS+=usr/share/examples/diskless +OLD_DIRS+=usr/share/examples/dma +OLD_DIRS+=usr/share/examples/drivers +OLD_DIRS+=usr/share/examples/etc +OLD_DIRS+=usr/share/examples/etc/defaults +OLD_DIRS+=usr/share/examples/find_interface +OLD_DIRS+=usr/share/examples/hast +OLD_DIRS+=usr/share/examples/ibcs2 +OLD_DIRS+=usr/share/examples/indent +OLD_DIRS+=usr/share/examples/ipfw +OLD_DIRS+=usr/share/examples/jails +OLD_DIRS+=usr/share/examples/kld +OLD_DIRS+=usr/share/examples/kld/cdev +OLD_DIRS+=usr/share/examples/kld/cdev/module +OLD_DIRS+=usr/share/examples/kld/cdev/test +OLD_DIRS+=usr/share/examples/kld/dyn_sysctl +OLD_DIRS+=usr/share/examples/kld/firmware +OLD_DIRS+=usr/share/examples/kld/firmware/fwconsumer +OLD_DIRS+=usr/share/examples/kld/firmware/fwimage +OLD_DIRS+=usr/share/examples/kld/khelp +OLD_DIRS+=usr/share/examples/kld/syscall +OLD_DIRS+=usr/share/examples/kld/syscall/module +OLD_DIRS+=usr/share/examples/kld/syscall/test +OLD_DIRS+=usr/share/examples/libusb20 +OLD_DIRS+=usr/share/examples/libvgl +OLD_DIRS+=usr/share/examples/mdoc +OLD_DIRS+=usr/share/examples/netgraph +OLD_DIRS+=usr/share/examples/perfmon +OLD_DIRS+=usr/share/examples/ppi +OLD_DIRS+=usr/share/examples/ppp +OLD_DIRS+=usr/share/examples/printing +OLD_DIRS+=usr/share/examples/scsi_target +OLD_DIRS+=usr/share/examples/ses +OLD_DIRS+=usr/share/examples/ses/getencstat +OLD_DIRS+=usr/share/examples/ses/sesd +OLD_DIRS+=usr/share/examples/ses/setencstat +OLD_DIRS+=usr/share/examples/ses/setobjstat +OLD_DIRS+=usr/share/examples/ses/srcs +OLD_DIRS+=usr/share/examples/smbfs +OLD_DIRS+=usr/share/examples/smbfs/print +OLD_DIRS+=usr/share/examples/sunrpc +OLD_DIRS+=usr/share/examples/sunrpc/dir +OLD_DIRS+=usr/share/examples/sunrpc/msg +OLD_DIRS+=usr/share/examples/sunrpc/sort +OLD_DIRS+=usr/share/examples/tcsh +OLD_DIRS+=usr/share/examples/uefisign +OLD_DIRS+=usr/share/examples/ypldap +.endif .if ${MK_FINGER} == no OLD_FILES+=usr/bin/finger @@ -3116,6 +3177,7 @@ OLD_FILES+=usr/share/man/man5/hesiod.con .if ${MK_HTML} == no OLD_FILES+=usr/share/doc/ncurses/hackguide.html OLD_FILES+=usr/share/doc/ncurses/ncurses-intro.html +OLD_DIRS+=usr/share/doc/ncurses OLD_FILES+=usr/share/doc/ntp/accopt.html OLD_FILES+=usr/share/doc/ntp/assoc.html OLD_FILES+=usr/share/doc/ntp/audio.html @@ -3203,6 +3265,42 @@ OLD_FILES+=usr/share/man/man3/iconv_open OLD_FILES+=usr/share/man/man3/iconv_open_into.3.gz OLD_FILES+=usr/share/man/man3/iconvctl.3.gz OLD_FILES+=usr/share/man/man3/iconvlist.3.gz +OLD_DIRS+=usr/share/i18n +OLD_DIRS+=usr/share/i18n/esdb +OLD_DIRS+=usr/share/i18n/esdb/ISO-2022 +OLD_DIRS+=usr/share/i18n/esdb/BIG5 +OLD_DIRS+=usr/share/i18n/esdb/MISC +OLD_DIRS+=usr/share/i18n/esdb/TCVN +OLD_DIRS+=usr/share/i18n/esdb/EBCDIC +OLD_DIRS+=usr/share/i18n/esdb/ISO-8859 +OLD_DIRS+=usr/share/i18n/esdb/GEORGIAN +OLD_DIRS+=usr/share/i18n/esdb/AST +OLD_DIRS+=usr/share/i18n/esdb/KAZAKH +OLD_DIRS+=usr/share/i18n/esdb/APPLE +OLD_DIRS+=usr/share/i18n/esdb/EUC +OLD_DIRS+=usr/share/i18n/esdb/CP +OLD_DIRS+=usr/share/i18n/esdb/DEC +OLD_DIRS+=usr/share/i18n/esdb/UTF +OLD_DIRS+=usr/share/i18n/esdb/GB +OLD_DIRS+=usr/share/i18n/esdb/ISO646 +OLD_DIRS+=usr/share/i18n/esdb/KOI +OLD_DIRS+=usr/share/i18n/csmapper +OLD_DIRS+=usr/share/i18n/csmapper/KAZAKH +OLD_DIRS+=usr/share/i18n/csmapper/CNS +OLD_DIRS+=usr/share/i18n/csmapper/BIG5 +OLD_DIRS+=usr/share/i18n/csmapper/JIS +OLD_DIRS+=usr/share/i18n/csmapper/KOI +OLD_DIRS+=usr/share/i18n/csmapper/TCVN +OLD_DIRS+=usr/share/i18n/csmapper/MISC +OLD_DIRS+=usr/share/i18n/csmapper/EBCDIC +OLD_DIRS+=usr/share/i18n/csmapper/ISO646 +OLD_DIRS+=usr/share/i18n/csmapper/CP +OLD_DIRS+=usr/share/i18n/csmapper/GEORGIAN +OLD_DIRS+=usr/share/i18n/csmapper/ISO-8859 +OLD_DIRS+=usr/share/i18n/csmapper/AST +OLD_DIRS+=usr/share/i18n/csmapper/APPLE +OLD_DIRS+=usr/share/i18n/csmapper/KS +OLD_DIRS+=usr/share/i18n/csmapper/GB .endif .if ${MK_INET6} == no @@ -4728,1146 +4826,1338 @@ OLD_FILES+=usr/share/man/man1/lldb.1.gz .endif .if ${MK_LOCALES} == no +OLD_DIRS+=usr/share/locale +OLD_DIRS+=usr/share/locale/af_ZA.ISO8859-15 OLD_FILES+=usr/share/locale/af_ZA.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/af_ZA.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/af_ZA.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/af_ZA.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/af_ZA.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/af_ZA.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/af_ZA.ISO8859-1 OLD_FILES+=usr/share/locale/af_ZA.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/af_ZA.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/af_ZA.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/af_ZA.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/af_ZA.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/af_ZA.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/af_ZA.UTF-8 OLD_FILES+=usr/share/locale/af_ZA.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/af_ZA.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/af_ZA.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/af_ZA.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/af_ZA.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/af_ZA.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/am_ET.UTF-8 OLD_FILES+=usr/share/locale/am_ET.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/am_ET.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/am_ET.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/am_ET.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/am_ET.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/am_ET.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/ar_AE.UTF-8 OLD_FILES+=usr/share/locale/ar_AE.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/ar_AE.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/ar_AE.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/ar_AE.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/ar_AE.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/ar_AE.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/ar_EG.UTF-8 OLD_FILES+=usr/share/locale/ar_EG.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/ar_EG.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/ar_EG.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/ar_EG.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/ar_EG.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/ar_EG.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/ar_JO.UTF-8 OLD_FILES+=usr/share/locale/ar_JO.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/ar_JO.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/ar_JO.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/ar_JO.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/ar_JO.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/ar_JO.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/ar_MA.UTF-8 OLD_FILES+=usr/share/locale/ar_MA.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/ar_MA.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/ar_MA.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/ar_MA.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/ar_MA.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/ar_MA.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/ar_QA.UTF-8 OLD_FILES+=usr/share/locale/ar_QA.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/ar_QA.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/ar_QA.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/ar_QA.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/ar_QA.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/ar_QA.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/ar_SA.UTF-8 OLD_FILES+=usr/share/locale/ar_SA.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/ar_SA.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/ar_SA.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/ar_SA.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/ar_SA.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/ar_SA.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/be_BY.CP1131 OLD_FILES+=usr/share/locale/be_BY.CP1131/LC_COLLATE OLD_FILES+=usr/share/locale/be_BY.CP1131/LC_CTYPE OLD_FILES+=usr/share/locale/be_BY.CP1131/LC_MESSAGES OLD_FILES+=usr/share/locale/be_BY.CP1131/LC_MONETARY OLD_FILES+=usr/share/locale/be_BY.CP1131/LC_NUMERIC OLD_FILES+=usr/share/locale/be_BY.CP1131/LC_TIME +OLD_DIRS+=usr/share/locale/be_BY.CP1251 OLD_FILES+=usr/share/locale/be_BY.CP1251/LC_COLLATE OLD_FILES+=usr/share/locale/be_BY.CP1251/LC_CTYPE OLD_FILES+=usr/share/locale/be_BY.CP1251/LC_MESSAGES OLD_FILES+=usr/share/locale/be_BY.CP1251/LC_MONETARY OLD_FILES+=usr/share/locale/be_BY.CP1251/LC_NUMERIC OLD_FILES+=usr/share/locale/be_BY.CP1251/LC_TIME +OLD_DIRS+=usr/share/locale/be_BY.ISO8859-5 OLD_FILES+=usr/share/locale/be_BY.ISO8859-5/LC_COLLATE OLD_FILES+=usr/share/locale/be_BY.ISO8859-5/LC_CTYPE OLD_FILES+=usr/share/locale/be_BY.ISO8859-5/LC_MESSAGES OLD_FILES+=usr/share/locale/be_BY.ISO8859-5/LC_MONETARY OLD_FILES+=usr/share/locale/be_BY.ISO8859-5/LC_NUMERIC OLD_FILES+=usr/share/locale/be_BY.ISO8859-5/LC_TIME +OLD_DIRS+=usr/share/locale/be_BY.UTF-8 OLD_FILES+=usr/share/locale/be_BY.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/be_BY.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/be_BY.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/be_BY.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/be_BY.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/be_BY.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/bg_BG.CP1251 OLD_FILES+=usr/share/locale/bg_BG.CP1251/LC_COLLATE OLD_FILES+=usr/share/locale/bg_BG.CP1251/LC_CTYPE OLD_FILES+=usr/share/locale/bg_BG.CP1251/LC_MESSAGES OLD_FILES+=usr/share/locale/bg_BG.CP1251/LC_MONETARY OLD_FILES+=usr/share/locale/bg_BG.CP1251/LC_NUMERIC OLD_FILES+=usr/share/locale/bg_BG.CP1251/LC_TIME +OLD_DIRS+=usr/share/locale/bg_BG.UTF-8 OLD_FILES+=usr/share/locale/bg_BG.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/bg_BG.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/bg_BG.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/bg_BG.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/bg_BG.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/bg_BG.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/ca_AD.ISO8859-1 OLD_FILES+=usr/share/locale/ca_AD.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/ca_AD.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/ca_AD.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/ca_AD.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/ca_AD.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/ca_AD.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/ca_AD.ISO8859-15 OLD_FILES+=usr/share/locale/ca_AD.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/ca_AD.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/ca_AD.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/ca_AD.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/ca_AD.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/ca_AD.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/ca_AD.UTF-8 OLD_FILES+=usr/share/locale/ca_AD.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/ca_AD.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/ca_AD.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/ca_AD.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/ca_AD.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/ca_AD.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/ca_ES.ISO8859-1 OLD_FILES+=usr/share/locale/ca_ES.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/ca_ES.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/ca_ES.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/ca_ES.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/ca_ES.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/ca_ES.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/ca_ES.ISO8859-15 OLD_FILES+=usr/share/locale/ca_ES.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/ca_ES.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/ca_ES.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/ca_ES.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/ca_ES.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/ca_ES.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/ca_ES.UTF-8 OLD_FILES+=usr/share/locale/ca_ES.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/ca_ES.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/ca_ES.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/ca_ES.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/ca_ES.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/ca_ES.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/ca_FR.ISO8859-1 OLD_FILES+=usr/share/locale/ca_FR.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/ca_FR.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/ca_FR.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/ca_FR.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/ca_FR.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/ca_FR.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/ca_FR.ISO8859-15 OLD_FILES+=usr/share/locale/ca_FR.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/ca_FR.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/ca_FR.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/ca_FR.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/ca_FR.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/ca_FR.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/ca_FR.UTF-8 OLD_FILES+=usr/share/locale/ca_FR.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/ca_FR.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/ca_FR.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/ca_FR.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/ca_FR.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/ca_FR.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/ca_IT.ISO8859-1 OLD_FILES+=usr/share/locale/ca_IT.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/ca_IT.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/ca_IT.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/ca_IT.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/ca_IT.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/ca_IT.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/ca_IT.ISO8859-15 OLD_FILES+=usr/share/locale/ca_IT.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/ca_IT.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/ca_IT.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/ca_IT.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/ca_IT.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/ca_IT.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/ca_IT.UTF-8 OLD_FILES+=usr/share/locale/ca_IT.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/ca_IT.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/ca_IT.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/ca_IT.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/ca_IT.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/ca_IT.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/cs_CZ.ISO8859-2 OLD_FILES+=usr/share/locale/cs_CZ.ISO8859-2/LC_COLLATE OLD_FILES+=usr/share/locale/cs_CZ.ISO8859-2/LC_CTYPE OLD_FILES+=usr/share/locale/cs_CZ.ISO8859-2/LC_MESSAGES OLD_FILES+=usr/share/locale/cs_CZ.ISO8859-2/LC_MONETARY OLD_FILES+=usr/share/locale/cs_CZ.ISO8859-2/LC_NUMERIC OLD_FILES+=usr/share/locale/cs_CZ.ISO8859-2/LC_TIME +OLD_DIRS+=usr/share/locale/cs_CZ.UTF-8 OLD_FILES+=usr/share/locale/cs_CZ.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/cs_CZ.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/cs_CZ.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/cs_CZ.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/cs_CZ.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/cs_CZ.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/da_DK.ISO8859-1 OLD_FILES+=usr/share/locale/da_DK.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/da_DK.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/da_DK.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/da_DK.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/da_DK.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/da_DK.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/da_DK.ISO8859-15 OLD_FILES+=usr/share/locale/da_DK.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/da_DK.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/da_DK.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/da_DK.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/da_DK.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/da_DK.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/da_DK.UTF-8 OLD_FILES+=usr/share/locale/da_DK.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/da_DK.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/da_DK.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/da_DK.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/da_DK.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/da_DK.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/de_AT.ISO8859-1 OLD_FILES+=usr/share/locale/de_AT.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/de_AT.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/de_AT.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/de_AT.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/de_AT.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/de_AT.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/de_AT.ISO8859-15 OLD_FILES+=usr/share/locale/de_AT.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/de_AT.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/de_AT.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/de_AT.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/de_AT.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/de_AT.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/de_AT.UTF-8 OLD_FILES+=usr/share/locale/de_AT.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/de_AT.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/de_AT.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/de_AT.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/de_AT.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/de_AT.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/de_CH.ISO8859-1 OLD_FILES+=usr/share/locale/de_CH.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/de_CH.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/de_CH.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/de_CH.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/de_CH.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/de_CH.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/de_CH.ISO8859-15 OLD_FILES+=usr/share/locale/de_CH.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/de_CH.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/de_CH.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/de_CH.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/de_CH.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/de_CH.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/de_CH.UTF-8 OLD_FILES+=usr/share/locale/de_CH.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/de_CH.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/de_CH.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/de_CH.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/de_CH.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/de_CH.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/de_DE.ISO8859-1 OLD_FILES+=usr/share/locale/de_DE.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/de_DE.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/de_DE.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/de_DE.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/de_DE.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/de_DE.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/de_DE.ISO8859-15 OLD_FILES+=usr/share/locale/de_DE.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/de_DE.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/de_DE.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/de_DE.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/de_DE.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/de_DE.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/de_DE.UTF-8 OLD_FILES+=usr/share/locale/de_DE.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/de_DE.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/de_DE.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/de_DE.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/de_DE.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/de_DE.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/el_GR.ISO8859-7 OLD_FILES+=usr/share/locale/el_GR.ISO8859-7/LC_COLLATE OLD_FILES+=usr/share/locale/el_GR.ISO8859-7/LC_CTYPE OLD_FILES+=usr/share/locale/el_GR.ISO8859-7/LC_MESSAGES OLD_FILES+=usr/share/locale/el_GR.ISO8859-7/LC_MONETARY OLD_FILES+=usr/share/locale/el_GR.ISO8859-7/LC_NUMERIC OLD_FILES+=usr/share/locale/el_GR.ISO8859-7/LC_TIME +OLD_DIRS+=usr/share/locale/el_GR.UTF-8 OLD_FILES+=usr/share/locale/el_GR.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/el_GR.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/el_GR.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/el_GR.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/el_GR.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/el_GR.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/en_AU.ISO8859-1 OLD_FILES+=usr/share/locale/en_AU.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/en_AU.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/en_AU.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/en_AU.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/en_AU.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/en_AU.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/en_AU.ISO8859-15 OLD_FILES+=usr/share/locale/en_AU.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/en_AU.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/en_AU.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/en_AU.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/en_AU.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/en_AU.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/en_AU.US-ASCII OLD_FILES+=usr/share/locale/en_AU.US-ASCII/LC_COLLATE OLD_FILES+=usr/share/locale/en_AU.US-ASCII/LC_CTYPE OLD_FILES+=usr/share/locale/en_AU.US-ASCII/LC_MESSAGES OLD_FILES+=usr/share/locale/en_AU.US-ASCII/LC_MONETARY OLD_FILES+=usr/share/locale/en_AU.US-ASCII/LC_NUMERIC OLD_FILES+=usr/share/locale/en_AU.US-ASCII/LC_TIME +OLD_DIRS+=usr/share/locale/en_AU.UTF-8 OLD_FILES+=usr/share/locale/en_AU.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/en_AU.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/en_AU.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/en_AU.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/en_AU.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/en_AU.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/en_CA.ISO8859-1 OLD_FILES+=usr/share/locale/en_CA.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/en_CA.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/en_CA.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/en_CA.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/en_CA.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/en_CA.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/en_CA.ISO8859-15 OLD_FILES+=usr/share/locale/en_CA.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/en_CA.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/en_CA.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/en_CA.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/en_CA.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/en_CA.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/en_CA.US-ASCII OLD_FILES+=usr/share/locale/en_CA.US-ASCII/LC_COLLATE OLD_FILES+=usr/share/locale/en_CA.US-ASCII/LC_CTYPE OLD_FILES+=usr/share/locale/en_CA.US-ASCII/LC_MESSAGES OLD_FILES+=usr/share/locale/en_CA.US-ASCII/LC_MONETARY OLD_FILES+=usr/share/locale/en_CA.US-ASCII/LC_NUMERIC OLD_FILES+=usr/share/locale/en_CA.US-ASCII/LC_TIME +OLD_DIRS+=usr/share/locale/en_CA.UTF-8 OLD_FILES+=usr/share/locale/en_CA.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/en_CA.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/en_CA.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/en_CA.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/en_CA.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/en_CA.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/en_GB.ISO8859-1 OLD_FILES+=usr/share/locale/en_GB.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/en_GB.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/en_GB.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/en_GB.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/en_GB.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/en_GB.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/en_GB.ISO8859-15 OLD_FILES+=usr/share/locale/en_GB.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/en_GB.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/en_GB.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/en_GB.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/en_GB.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/en_GB.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/en_GB.US-ASCII OLD_FILES+=usr/share/locale/en_GB.US-ASCII/LC_COLLATE OLD_FILES+=usr/share/locale/en_GB.US-ASCII/LC_CTYPE OLD_FILES+=usr/share/locale/en_GB.US-ASCII/LC_MESSAGES OLD_FILES+=usr/share/locale/en_GB.US-ASCII/LC_MONETARY OLD_FILES+=usr/share/locale/en_GB.US-ASCII/LC_NUMERIC OLD_FILES+=usr/share/locale/en_GB.US-ASCII/LC_TIME +OLD_DIRS+=usr/share/locale/en_GB.UTF-8 OLD_FILES+=usr/share/locale/en_GB.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/en_GB.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/en_GB.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/en_GB.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/en_GB.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/en_GB.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/en_HK.ISO8859-1 OLD_FILES+=usr/share/locale/en_HK.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/en_HK.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/en_HK.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/en_HK.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/en_HK.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/en_HK.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/en_HK.UTF-8 OLD_FILES+=usr/share/locale/en_HK.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/en_HK.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/en_HK.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/en_HK.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/en_HK.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/en_HK.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/en_IE.ISO8859-1 OLD_FILES+=usr/share/locale/en_IE.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/en_IE.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/en_IE.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/en_IE.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/en_IE.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/en_IE.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/en_IE.ISO8859-15 OLD_FILES+=usr/share/locale/en_IE.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/en_IE.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/en_IE.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/en_IE.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/en_IE.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/en_IE.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/en_IE.UTF-8 OLD_FILES+=usr/share/locale/en_IE.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/en_IE.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/en_IE.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/en_IE.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/en_IE.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/en_IE.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/en_NZ.ISO8859-1 OLD_FILES+=usr/share/locale/en_NZ.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/en_NZ.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/en_NZ.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/en_NZ.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/en_NZ.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/en_NZ.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/en_NZ.ISO8859-15 OLD_FILES+=usr/share/locale/en_NZ.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/en_NZ.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/en_NZ.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/en_NZ.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/en_NZ.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/en_NZ.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/en_NZ.US-ASCII OLD_FILES+=usr/share/locale/en_NZ.US-ASCII/LC_COLLATE OLD_FILES+=usr/share/locale/en_NZ.US-ASCII/LC_CTYPE OLD_FILES+=usr/share/locale/en_NZ.US-ASCII/LC_MESSAGES OLD_FILES+=usr/share/locale/en_NZ.US-ASCII/LC_MONETARY OLD_FILES+=usr/share/locale/en_NZ.US-ASCII/LC_NUMERIC OLD_FILES+=usr/share/locale/en_NZ.US-ASCII/LC_TIME +OLD_DIRS+=usr/share/locale/en_NZ.UTF-8 OLD_FILES+=usr/share/locale/en_NZ.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/en_NZ.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/en_NZ.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/en_NZ.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/en_NZ.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/en_NZ.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/en_PH.UTF-8 OLD_FILES+=usr/share/locale/en_PH.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/en_PH.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/en_PH.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/en_PH.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/en_PH.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/en_PH.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/en_SG.ISO8859-1 OLD_FILES+=usr/share/locale/en_SG.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/en_SG.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/en_SG.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/en_SG.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/en_SG.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/en_SG.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/en_SG.UTF-8 OLD_FILES+=usr/share/locale/en_SG.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/en_SG.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/en_SG.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/en_SG.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/en_SG.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/en_SG.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/en_US.ISO8859-1 OLD_FILES+=usr/share/locale/en_US.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/en_US.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/en_US.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/en_US.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/en_US.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/en_US.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/en_US.ISO8859-15 OLD_FILES+=usr/share/locale/en_US.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/en_US.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/en_US.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/en_US.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/en_US.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/en_US.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/en_US.US-ASCII OLD_FILES+=usr/share/locale/en_US.US-ASCII/LC_COLLATE OLD_FILES+=usr/share/locale/en_US.US-ASCII/LC_CTYPE OLD_FILES+=usr/share/locale/en_US.US-ASCII/LC_MESSAGES OLD_FILES+=usr/share/locale/en_US.US-ASCII/LC_MONETARY OLD_FILES+=usr/share/locale/en_US.US-ASCII/LC_NUMERIC OLD_FILES+=usr/share/locale/en_US.US-ASCII/LC_TIME +OLD_DIRS+=usr/share/locale/en_US.UTF-8 OLD_FILES+=usr/share/locale/en_US.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/en_US.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/en_US.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/en_US.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/en_US.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/en_US.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/en_ZA.ISO8859-1 OLD_FILES+=usr/share/locale/en_ZA.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/en_ZA.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/en_ZA.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/en_ZA.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/en_ZA.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/en_ZA.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/en_ZA.ISO8859-15 OLD_FILES+=usr/share/locale/en_ZA.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/en_ZA.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/en_ZA.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/en_ZA.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/en_ZA.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/en_ZA.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/en_ZA.US-ASCII OLD_FILES+=usr/share/locale/en_ZA.US-ASCII/LC_COLLATE OLD_FILES+=usr/share/locale/en_ZA.US-ASCII/LC_CTYPE OLD_FILES+=usr/share/locale/en_ZA.US-ASCII/LC_MESSAGES OLD_FILES+=usr/share/locale/en_ZA.US-ASCII/LC_MONETARY OLD_FILES+=usr/share/locale/en_ZA.US-ASCII/LC_NUMERIC OLD_FILES+=usr/share/locale/en_ZA.US-ASCII/LC_TIME +OLD_DIRS+=usr/share/locale/en_ZA.UTF-8 OLD_FILES+=usr/share/locale/en_ZA.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/en_ZA.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/en_ZA.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/en_ZA.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/en_ZA.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/en_ZA.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/es_AR.ISO8859-1 OLD_FILES+=usr/share/locale/es_AR.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/es_AR.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/es_AR.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/es_AR.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/es_AR.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/es_AR.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/es_AR.UTF-8 OLD_FILES+=usr/share/locale/es_AR.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/es_AR.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/es_AR.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/es_AR.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/es_AR.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/es_AR.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/es_CR.UTF-8 OLD_FILES+=usr/share/locale/es_CR.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/es_CR.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/es_CR.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/es_CR.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/es_CR.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/es_CR.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/es_ES.ISO8859-1 OLD_FILES+=usr/share/locale/es_ES.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/es_ES.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/es_ES.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/es_ES.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/es_ES.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/es_ES.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/es_ES.ISO8859-15 OLD_FILES+=usr/share/locale/es_ES.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/es_ES.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/es_ES.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/es_ES.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/es_ES.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/es_ES.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/es_ES.UTF-8 OLD_FILES+=usr/share/locale/es_ES.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/es_ES.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/es_ES.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/es_ES.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/es_ES.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/es_ES.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/es_MX.ISO8859-1 OLD_FILES+=usr/share/locale/es_MX.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/es_MX.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/es_MX.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/es_MX.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/es_MX.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/es_MX.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/es_MX.UTF-8 OLD_FILES+=usr/share/locale/es_MX.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/es_MX.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/es_MX.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/es_MX.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/es_MX.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/es_MX.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/et_EE.ISO8859-1 OLD_FILES+=usr/share/locale/et_EE.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/et_EE.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/et_EE.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/et_EE.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/et_EE.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/et_EE.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/et_EE.ISO8859-15 OLD_FILES+=usr/share/locale/et_EE.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/et_EE.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/et_EE.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/et_EE.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/et_EE.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/et_EE.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/et_EE.UTF-8 OLD_FILES+=usr/share/locale/et_EE.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/et_EE.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/et_EE.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/et_EE.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/et_EE.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/et_EE.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/eu_ES.ISO8859-1 OLD_FILES+=usr/share/locale/eu_ES.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/eu_ES.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/eu_ES.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/eu_ES.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/eu_ES.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/eu_ES.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/eu_ES.ISO8859-15 OLD_FILES+=usr/share/locale/eu_ES.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/eu_ES.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/eu_ES.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/eu_ES.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/eu_ES.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/eu_ES.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/eu_ES.UTF-8 OLD_FILES+=usr/share/locale/eu_ES.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/eu_ES.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/eu_ES.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/eu_ES.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/eu_ES.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/eu_ES.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/fi_FI.ISO8859-1 OLD_FILES+=usr/share/locale/fi_FI.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/fi_FI.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/fi_FI.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/fi_FI.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/fi_FI.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/fi_FI.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/fi_FI.ISO8859-15 OLD_FILES+=usr/share/locale/fi_FI.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/fi_FI.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/fi_FI.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/fi_FI.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/fi_FI.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/fi_FI.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/fi_FI.UTF-8 OLD_FILES+=usr/share/locale/fi_FI.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/fi_FI.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/fi_FI.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/fi_FI.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/fi_FI.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/fi_FI.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/fr_BE.ISO8859-1 OLD_FILES+=usr/share/locale/fr_BE.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/fr_BE.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/fr_BE.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/fr_BE.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/fr_BE.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/fr_BE.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/fr_BE.ISO8859-15 OLD_FILES+=usr/share/locale/fr_BE.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/fr_BE.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/fr_BE.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/fr_BE.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/fr_BE.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/fr_BE.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/fr_BE.UTF-8 OLD_FILES+=usr/share/locale/fr_BE.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/fr_BE.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/fr_BE.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/fr_BE.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/fr_BE.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/fr_BE.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/fr_CA.ISO8859-1 OLD_FILES+=usr/share/locale/fr_CA.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/fr_CA.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/fr_CA.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/fr_CA.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/fr_CA.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/fr_CA.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/fr_CA.ISO8859-15 OLD_FILES+=usr/share/locale/fr_CA.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/fr_CA.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/fr_CA.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/fr_CA.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/fr_CA.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/fr_CA.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/fr_CA.UTF-8 OLD_FILES+=usr/share/locale/fr_CA.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/fr_CA.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/fr_CA.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/fr_CA.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/fr_CA.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/fr_CA.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/fr_CH.ISO8859-1 OLD_FILES+=usr/share/locale/fr_CH.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/fr_CH.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/fr_CH.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/fr_CH.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/fr_CH.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/fr_CH.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/fr_CH.ISO8859-15 OLD_FILES+=usr/share/locale/fr_CH.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/fr_CH.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/fr_CH.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/fr_CH.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/fr_CH.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/fr_CH.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/fr_CH.UTF-8 OLD_FILES+=usr/share/locale/fr_CH.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/fr_CH.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/fr_CH.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/fr_CH.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/fr_CH.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/fr_CH.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/fr_FR.ISO8859-1 OLD_FILES+=usr/share/locale/fr_FR.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/fr_FR.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/fr_FR.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/fr_FR.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/fr_FR.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/fr_FR.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/fr_FR.ISO8859-15 OLD_FILES+=usr/share/locale/fr_FR.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/fr_FR.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/fr_FR.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/fr_FR.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/fr_FR.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/fr_FR.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/fr_FR.UTF-8 OLD_FILES+=usr/share/locale/fr_FR.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/fr_FR.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/fr_FR.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/fr_FR.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/fr_FR.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/fr_FR.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/he_IL.UTF-8 OLD_FILES+=usr/share/locale/he_IL.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/he_IL.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/he_IL.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/he_IL.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/he_IL.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/he_IL.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/hi_IN.ISCII-DEV OLD_FILES+=usr/share/locale/hi_IN.ISCII-DEV/LC_COLLATE OLD_FILES+=usr/share/locale/hi_IN.ISCII-DEV/LC_CTYPE OLD_FILES+=usr/share/locale/hi_IN.ISCII-DEV/LC_MESSAGES OLD_FILES+=usr/share/locale/hi_IN.ISCII-DEV/LC_MONETARY OLD_FILES+=usr/share/locale/hi_IN.ISCII-DEV/LC_NUMERIC OLD_FILES+=usr/share/locale/hi_IN.ISCII-DEV/LC_TIME +OLD_DIRS+=usr/share/locale/hi_IN.UTF-8 OLD_FILES+=usr/share/locale/hi_IN.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/hi_IN.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/hi_IN.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/hi_IN.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/hi_IN.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/hi_IN.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/hr_HR.ISO8859-2 OLD_FILES+=usr/share/locale/hr_HR.ISO8859-2/LC_COLLATE OLD_FILES+=usr/share/locale/hr_HR.ISO8859-2/LC_CTYPE OLD_FILES+=usr/share/locale/hr_HR.ISO8859-2/LC_MESSAGES OLD_FILES+=usr/share/locale/hr_HR.ISO8859-2/LC_MONETARY OLD_FILES+=usr/share/locale/hr_HR.ISO8859-2/LC_NUMERIC OLD_FILES+=usr/share/locale/hr_HR.ISO8859-2/LC_TIME +OLD_DIRS+=usr/share/locale/hr_HR.UTF-8 OLD_FILES+=usr/share/locale/hr_HR.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/hr_HR.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/hr_HR.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/hr_HR.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/hr_HR.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/hr_HR.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/hu_HU.ISO8859-2 OLD_FILES+=usr/share/locale/hu_HU.ISO8859-2/LC_COLLATE OLD_FILES+=usr/share/locale/hu_HU.ISO8859-2/LC_CTYPE OLD_FILES+=usr/share/locale/hu_HU.ISO8859-2/LC_MESSAGES OLD_FILES+=usr/share/locale/hu_HU.ISO8859-2/LC_MONETARY OLD_FILES+=usr/share/locale/hu_HU.ISO8859-2/LC_NUMERIC OLD_FILES+=usr/share/locale/hu_HU.ISO8859-2/LC_TIME +OLD_DIRS+=usr/share/locale/hu_HU.UTF-8 OLD_FILES+=usr/share/locale/hu_HU.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/hu_HU.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/hu_HU.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/hu_HU.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/hu_HU.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/hu_HU.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/hy_AM.ARMSCII-8 OLD_FILES+=usr/share/locale/hy_AM.ARMSCII-8/LC_COLLATE OLD_FILES+=usr/share/locale/hy_AM.ARMSCII-8/LC_CTYPE OLD_FILES+=usr/share/locale/hy_AM.ARMSCII-8/LC_MESSAGES OLD_FILES+=usr/share/locale/hy_AM.ARMSCII-8/LC_MONETARY OLD_FILES+=usr/share/locale/hy_AM.ARMSCII-8/LC_NUMERIC OLD_FILES+=usr/share/locale/hy_AM.ARMSCII-8/LC_TIME +OLD_DIRS+=usr/share/locale/hy_AM.UTF-8 OLD_FILES+=usr/share/locale/hy_AM.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/hy_AM.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/hy_AM.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/hy_AM.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/hy_AM.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/hy_AM.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/is_IS.ISO8859-1 OLD_FILES+=usr/share/locale/is_IS.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/is_IS.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/is_IS.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/is_IS.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/is_IS.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/is_IS.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/is_IS.ISO8859-15 OLD_FILES+=usr/share/locale/is_IS.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/is_IS.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/is_IS.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/is_IS.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/is_IS.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/is_IS.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/is_IS.UTF-8 OLD_FILES+=usr/share/locale/is_IS.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/is_IS.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/is_IS.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/is_IS.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/is_IS.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/is_IS.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/it_CH.ISO8859-1 OLD_FILES+=usr/share/locale/it_CH.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/it_CH.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/it_CH.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/it_CH.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/it_CH.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/it_CH.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/it_CH.ISO8859-15 OLD_FILES+=usr/share/locale/it_CH.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/it_CH.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/it_CH.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/it_CH.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/it_CH.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/it_CH.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/it_CH.UTF-8 OLD_FILES+=usr/share/locale/it_CH.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/it_CH.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/it_CH.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/it_CH.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/it_CH.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/it_CH.UTF-8/LC_TIME +OLD_DIRS+=usr/share/locale/it_IT.ISO8859-1 OLD_FILES+=usr/share/locale/it_IT.ISO8859-1/LC_COLLATE OLD_FILES+=usr/share/locale/it_IT.ISO8859-1/LC_CTYPE OLD_FILES+=usr/share/locale/it_IT.ISO8859-1/LC_MESSAGES OLD_FILES+=usr/share/locale/it_IT.ISO8859-1/LC_MONETARY OLD_FILES+=usr/share/locale/it_IT.ISO8859-1/LC_NUMERIC OLD_FILES+=usr/share/locale/it_IT.ISO8859-1/LC_TIME +OLD_DIRS+=usr/share/locale/it_IT.ISO8859-15 OLD_FILES+=usr/share/locale/it_IT.ISO8859-15/LC_COLLATE OLD_FILES+=usr/share/locale/it_IT.ISO8859-15/LC_CTYPE OLD_FILES+=usr/share/locale/it_IT.ISO8859-15/LC_MESSAGES OLD_FILES+=usr/share/locale/it_IT.ISO8859-15/LC_MONETARY OLD_FILES+=usr/share/locale/it_IT.ISO8859-15/LC_NUMERIC OLD_FILES+=usr/share/locale/it_IT.ISO8859-15/LC_TIME +OLD_DIRS+=usr/share/locale/it_IT.UTF-8 OLD_FILES+=usr/share/locale/it_IT.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/it_IT.UTF-8/LC_CTYPE OLD_FILES+=usr/share/locale/it_IT.UTF-8/LC_MESSAGES OLD_FILES+=usr/share/locale/it_IT.UTF-8/LC_MONETARY OLD_FILES+=usr/share/locale/it_IT.UTF-8/LC_NUMERIC OLD_FILES+=usr/share/locale/it_IT.UTF-8/LC_TIME *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Feb 17 20:04:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D358DCE3DA8; Fri, 17 Feb 2017 20:04:24 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BDF01FDD; Fri, 17 Feb 2017 20:04:24 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HK4NWK087694; Fri, 17 Feb 2017 20:04:23 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HK4NWl087687; Fri, 17 Feb 2017 20:04:23 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201702172004.v1HK4NWl087687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Fri, 17 Feb 2017 20:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313893 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 20:04:24 -0000 Author: ken Date: Fri Feb 17 20:04:22 2017 New Revision: 313893 URL: https://svnweb.freebsd.org/changeset/base/313893 Log: Add task attribute support to camcontrol(8). Users can use the new generic argument, -Q task_attr, to specify a task attribute (simple, ordered, head of queue, aca) for the commands issued. The the default is simple, which works with all SCSI devices that support tagged queueing. This will mostly be useful for debugging target behavior in certain situations. You can try it out by compiling CTL with CTL_IO_DELAY turned on (in sys/cam/ctl/ctl_io.h) and then do something like this with one of the CTL LUNs: ctladm delay 0:0 -l done -t 10 camcontrol tur da34 -v And at then before the 10 second timer is up, in another terminal: camcontrol inquiry da34 -Q ordered -v The Inquiry should complete just after the TUR completes. Ordinarily it would complete first because of the delay injection, but because the task attribute is set to ordered in this case, CTL holds it up until the previous command has completed. sbin/camcontrol/camcontrol.c: Add the new generic argument, -Q, which allows the user to specify a SCSI task attribute. The user can specify task attributes by name or numerically. Add a new task_attr arguments to SCSI sub-functions. sbin/camcontrol/attrib.c, sbin/camcontrol/camcontrol.h, sbin/camcontrol/fwdownload.c, sbin/camcontrol/modeedit.c, sbin/camcontrol/persist.c, sbin/camcontrol/timestamp.c, sbin/camcontrol/zone.c: Add the new task_attr argument to SCSI sub-functions. sbin/camcontrol/camcontrol.8: Document the new -Q option, and add an example. Sponsored by: Spectra Logic MFC after: 1 week Modified: head/sbin/camcontrol/attrib.c head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c head/sbin/camcontrol/camcontrol.h head/sbin/camcontrol/fwdownload.c head/sbin/camcontrol/modeedit.c head/sbin/camcontrol/persist.c head/sbin/camcontrol/timestamp.c head/sbin/camcontrol/zone.c Modified: head/sbin/camcontrol/attrib.c ============================================================================== --- head/sbin/camcontrol/attrib.c Fri Feb 17 20:02:40 2017 (r313892) +++ head/sbin/camcontrol/attrib.c Fri Feb 17 20:04:22 2017 (r313893) @@ -106,7 +106,8 @@ static struct scsi_nv output_format_map[ int scsiattrib(struct cam_device *device, int argc, char **argv, char *combinedopt, - int retry_count, int timeout, int verbosemode, int err_recover) + int task_attr, int retry_count, int timeout, int verbosemode, + int err_recover) { union ccb *ccb = NULL; int attr_num = -1; @@ -317,7 +318,7 @@ scsiattrib(struct cam_device *device, in scsi_read_attribute(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*service_action*/ read_service_action, /*element*/ element_address, /*elem_type*/ element_type, Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Fri Feb 17 20:02:40 2017 (r313892) +++ head/sbin/camcontrol/camcontrol.8 Fri Feb 17 20:04:22 2017 (r313893) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 20, 2017 +.Dd February 17, 2017 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -422,6 +422,17 @@ It may take some other actions, dependin the command. .It Fl n Ar dev_name Specify the device type to operate on, e.g.\& "da", "cd". +.It Fl Q Ar task_attr +.Tn SCSI +task attribute for the command, if it is a +.Tn SCSI +command. +This may be ordered, simple, head, or aca. +In most cases this is not needed. +The default is simple, which works with all +.Tn SCSI +devices. +The task attribute may also be specified numerically. .It Fl t Ar timeout SCSI command timeout in seconds. This overrides the default timeout for @@ -2523,7 +2534,7 @@ information if the command fails since t .Fl v switch was not specified. .Bd -literal -offset indent -camcontrol tur da1 -E -C 4 -t 50 -v +camcontrol tur da1 -E -C 4 -t 50 -Q head -v .Ed .Pp Send a test unit ready command to da1. @@ -2536,6 +2547,9 @@ flag) if the command fails. Since error recovery is turned on, the disk will be spun up if it is not currently spinning. The +.Tn SCSI +task attribute for the command will be set to Head of Queue. +The .Nm utility will report whether the disk is ready. .Bd -literal -offset indent Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Fri Feb 17 20:02:40 2017 (r313892) +++ head/sbin/camcontrol/camcontrol.c Fri Feb 17 20:04:22 2017 (r313893) @@ -171,6 +171,14 @@ struct ata_set_max_pwd u_int16_t reserved2[239]; }; +static struct scsi_nv task_attrs[] = { + { "simple", MSG_SIMPLE_Q_TAG }, + { "head", MSG_HEAD_OF_Q_TAG }, + { "ordered", MSG_ORDERED_Q_TAG }, + { "iwr", MSG_IGN_WIDE_RESIDUE }, + { "aca", MSG_ACA_TASK } +}; + static const char scsicmd_opts[] = "a:c:dfi:o:r"; static const char readdefect_opts[] = "f:GPqsS:X"; static const char negotiate_opts[] = "acD:M:O:qR:T:UW:"; @@ -265,12 +273,14 @@ static int getdevlist(struct cam_device #endif /* MINIMALISTIC */ static int getdevtree(int argc, char **argv, char *combinedopt); #ifndef MINIMALISTIC -static int testunitready(struct cam_device *device, int retry_count, - int timeout, int quiet); +static int testunitready(struct cam_device *device, int task_attr, + int retry_count, int timeout, int quiet); static int scsistart(struct cam_device *device, int startstop, int loadeject, - int retry_count, int timeout); -static int scsiinquiry(struct cam_device *device, int retry_count, int timeout); -static int scsiserial(struct cam_device *device, int retry_count, int timeout); + int task_attr, int retry_count, int timeout); +static int scsiinquiry(struct cam_device *device, int task_attr, + int retry_count, int timeout); +static int scsiserial(struct cam_device *device, int task_attr, + int retry_count, int timeout); #endif /* MINIMALISTIC */ static int parse_btl(char *tstr, path_id_t *bus, target_id_t *target, lun_id_t *lun, cam_argmask *arglst); @@ -280,11 +290,14 @@ static int scanlun_or_reset_dev(path_id_ lun_id_t lun, int scan); #ifndef MINIMALISTIC static int readdefects(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static void modepage(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int scsicmd(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int smpcmd(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); static int smpreportgeneral(struct cam_device *device, int argc, char **argv, @@ -309,16 +322,21 @@ static int get_cpi(struct cam_device *de static int get_cgd(struct cam_device *device, struct ccb_getdev *cgd); static int get_print_cts(struct cam_device *device, int user_settings, int quiet, struct ccb_trans_settings *cts); -static int ratecontrol(struct cam_device *device, int retry_count, - int timeout, int argc, char **argv, char *combinedopt); +static int ratecontrol(struct cam_device *device, int task_attr, + int retry_count, int timeout, int argc, char **argv, + char *combinedopt); static int scsiformat(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int scsisanitize(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int scsireportluns(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int scsireadcapacity(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); static int atapm(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); static int atasecurity(struct cam_device *device, int retry_count, int timeout, @@ -331,8 +349,8 @@ static int scsiprintoneopcode(struct cam static int scsiprintopcodes(struct cam_device *device, int td_req, uint8_t *buf, uint32_t valid_len); static int scsiopcodes(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout, - int verbose); + char *combinedopt, int task_attr, int retry_count, + int timeout, int verbose); static int scsireprobe(struct cam_device *device); #endif /* MINIMALISTIC */ @@ -650,8 +668,8 @@ getdevtree(int argc, char **argv, char * #ifndef MINIMALISTIC static int -testunitready(struct cam_device *device, int retry_count, int timeout, - int quiet) +testunitready(struct cam_device *device, int task_attr, int retry_count, + int timeout, int quiet) { int error = 0; union ccb *ccb; @@ -661,7 +679,7 @@ testunitready(struct cam_device *device, scsi_test_unit_ready(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* sense_len */ SSD_FULL_SIZE, /* timeout */ timeout ? timeout : 5000); @@ -705,7 +723,7 @@ testunitready(struct cam_device *device, static int scsistart(struct cam_device *device, int startstop, int loadeject, - int retry_count, int timeout) + int task_attr, int retry_count, int timeout) { union ccb *ccb; int error = 0; @@ -716,13 +734,19 @@ scsistart(struct cam_device *device, int * If we're stopping, send an ordered tag so the drive in question * will finish any previously queued writes before stopping. If * the device isn't capable of tagged queueing, or if tagged - * queueing is turned off, the tag action is a no-op. - */ + * queueing is turned off, the tag action is a no-op. We override + * the default simple tag, although this also has the effect of + * overriding the user's wishes if he wanted to specify a simple + * tag. + */ + if ((startstop == 0) + && (task_attr == MSG_SIMPLE_Q_TAG)) + task_attr = MSG_ORDERED_Q_TAG; + scsi_start_stop(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ startstop ? MSG_SIMPLE_Q_TAG : - MSG_ORDERED_Q_TAG, + /* tag_action */ task_attr, /* start/stop */ startstop, /* load_eject */ loadeject, /* immediate */ 0, @@ -783,7 +807,7 @@ scsistart(struct cam_device *device, int int scsidoinquiry(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { int c; int error = 0; @@ -812,13 +836,13 @@ scsidoinquiry(struct cam_device *device, arglist |= CAM_ARG_INQ_MASK; if (arglist & CAM_ARG_GET_STDINQ) - error = scsiinquiry(device, retry_count, timeout); + error = scsiinquiry(device, task_attr, retry_count, timeout); if (error != 0) return(error); if (arglist & CAM_ARG_GET_SERIAL) - scsiserial(device, retry_count, timeout); + scsiserial(device, task_attr, retry_count, timeout); if (arglist & CAM_ARG_GET_XFERRATE) error = camxferrate(device); @@ -827,7 +851,8 @@ scsidoinquiry(struct cam_device *device, } static int -scsiinquiry(struct cam_device *device, int retry_count, int timeout) +scsiinquiry(struct cam_device *device, int task_attr, int retry_count, + int timeout) { union ccb *ccb; struct scsi_inquiry_data *inq_buf; @@ -889,7 +914,7 @@ scsiinquiry(struct cam_device *device, i scsi_inquiry(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* inq_buf */ (u_int8_t *)inq_buf, /* inq_len */ SHORT_INQUIRY_LENGTH, /* evpd */ 0, @@ -941,7 +966,8 @@ scsiinquiry(struct cam_device *device, i } static int -scsiserial(struct cam_device *device, int retry_count, int timeout) +scsiserial(struct cam_device *device, int task_attr, int retry_count, + int timeout) { union ccb *ccb; struct scsi_vpd_unit_serial_number *serial_buf; @@ -970,7 +996,7 @@ scsiserial(struct cam_device *device, in scsi_inquiry(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* inq_buf */ (u_int8_t *)serial_buf, /* inq_len */ sizeof(*serial_buf), /* evpd */ 1, @@ -3405,7 +3431,7 @@ static struct scsi_nv defect_list_type_m static int readdefects(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb = NULL; struct scsi_read_defect_data_hdr_10 *hdr10 = NULL; @@ -3547,7 +3573,7 @@ next_batch: scsi_read_defects(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*list_format*/ list_format, /*addr_desc_index*/ starting_offset, /*data_ptr*/ defect_list, @@ -3985,7 +4011,8 @@ reassignblocks(struct cam_device *device #ifndef MINIMALISTIC void mode_sense(struct cam_device *device, int dbd, int pc, int page, int subpage, - int retry_count, int timeout, u_int8_t *data, int datalen) + int task_attr, int retry_count, int timeout, u_int8_t *data, + int datalen) { union ccb *ccb; int retval; @@ -4000,7 +4027,7 @@ mode_sense(struct cam_device *device, in scsi_mode_sense_subpage(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* dbd */ dbd, /* pc */ pc << 6, /* page */ page, @@ -4035,8 +4062,8 @@ mode_sense(struct cam_device *device, in } void -mode_select(struct cam_device *device, int save_pages, int retry_count, - int timeout, u_int8_t *data, int datalen) +mode_select(struct cam_device *device, int save_pages, int task_attr, + int retry_count, int timeout, u_int8_t *data, int datalen) { union ccb *ccb; int retval; @@ -4051,7 +4078,7 @@ mode_select(struct cam_device *device, i scsi_mode_select(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* scsi_page_fmt */ 1, /* save_pages */ save_pages, /* param_buf */ data, @@ -4086,7 +4113,7 @@ mode_select(struct cam_device *device, i void modepage(struct cam_device *device, int argc, char **argv, char *combinedopt, - int retry_count, int timeout) + int task_attr, int retry_count, int timeout) { char *str_subpage; int c, page = -1, subpage = -1, pc = 0; @@ -4133,16 +4160,17 @@ modepage(struct cam_device *device, int errx(1, "you must specify a mode page!"); if (list != 0) { - mode_list(device, dbd, pc, list > 1, retry_count, timeout); + mode_list(device, dbd, pc, list > 1, task_attr, retry_count, + timeout); } else { mode_edit(device, dbd, pc, page, subpage, edit, binary, - retry_count, timeout); + task_attr, retry_count, timeout); } } static int scsicmd(struct cam_device *device, int argc, char **argv, char *combinedopt, - int retry_count, int timeout) + int task_attr, int retry_count, int timeout) { union ccb *ccb; u_int32_t flags = CAM_DIR_NONE; @@ -4387,7 +4415,7 @@ scsicmd(struct cam_device *device, int a /*retries*/ retry_count, /*cbfcnp*/ NULL, /*flags*/ flags, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*data_ptr*/ data_ptr, /*dxfer_len*/ data_bytes, /*sense_len*/ SSD_FULL_SIZE, @@ -5498,8 +5526,8 @@ get_print_cts_bailout: } static int -ratecontrol(struct cam_device *device, int retry_count, int timeout, - int argc, char **argv, char *combinedopt) +ratecontrol(struct cam_device *device, int task_attr, int retry_count, + int timeout, int argc, char **argv, char *combinedopt) { int c; union ccb *ccb; @@ -5829,7 +5857,7 @@ ratecontrol(struct cam_device *device, i } } if (send_tur) { - retval = testunitready(device, retry_count, timeout, + retval = testunitready(device, task_attr, retry_count, timeout, (arglist & CAM_ARG_VERBOSE) ? 0 : 1); /* * If the TUR didn't succeed, just bail. @@ -5854,7 +5882,7 @@ ratecontrol_bailout: static int scsiformat(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; int c; @@ -5903,7 +5931,7 @@ scsiformat(struct cam_device *device, in "following device:\n"); error = scsidoinquiry(device, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); if (error != 0) { warnx("scsiformat: error sending inquiry"); @@ -5975,7 +6003,7 @@ scsiformat(struct cam_device *device, in scsi_format_unit(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* byte2 */ byte2, /* ileave */ 0, /* data_ptr */ data_ptr, @@ -6034,7 +6062,7 @@ doreport: scsi_test_unit_ready(&ccb->csio, /* retries */ 0, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* sense_len */ SSD_FULL_SIZE, /* timeout */ 5000); @@ -6144,7 +6172,7 @@ scsiformat_bailout: static int scsisanitize(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; u_int8_t action = 0; @@ -6309,7 +6337,7 @@ scsisanitize(struct cam_device *device, "following device:\n"); error = scsidoinquiry(device, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); if (error != 0) { warnx("scsisanitize: error sending inquiry"); @@ -6367,7 +6395,7 @@ scsisanitize(struct cam_device *device, scsi_sanitize(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* byte2 */ byte2, /* control */ 0, /* data_ptr */ data_ptr, @@ -6442,7 +6470,7 @@ doreport: scsi_test_unit_ready(&ccb->csio, /* retries */ 0, /* cbfcnp */ NULL, - /* tag_action */ MSG_SIMPLE_Q_TAG, + /* tag_action */ task_attr, /* sense_len */ SSD_FULL_SIZE, /* timeout */ 5000); @@ -6554,7 +6582,7 @@ scsisanitize_bailout: static int scsireportluns(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; int c, countonly, lunsonly; @@ -6631,7 +6659,7 @@ retry: scsi_report_luns(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*select_report*/ report_type, /*rpl_buf*/ lundata, /*alloc_len*/ alloc_len, @@ -6796,7 +6824,7 @@ bailout: static int scsireadcapacity(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout) + char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; int blocksizeonly, humanize, numblocks, quiet, sizeonly, baseten; @@ -6882,7 +6910,7 @@ scsireadcapacity(struct cam_device *devi scsi_read_capacity(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, &rcap, SSD_FULL_SIZE, /*timeout*/ timeout ? timeout : 5000); @@ -6924,7 +6952,7 @@ scsireadcapacity(struct cam_device *devi scsi_read_capacity_16(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*lba*/ 0, /*reladdr*/ 0, /*pmi*/ 0, @@ -8365,8 +8393,8 @@ ataaxm(struct cam_device *device, int ar int scsigetopcodes(struct cam_device *device, int opcode_set, int opcode, int show_sa_errors, int sa_set, int service_action, - int timeout_desc, int retry_count, int timeout, int verbosemode, - uint32_t *fill_len, uint8_t **data_ptr) + int timeout_desc, int task_attr, int retry_count, int timeout, + int verbosemode, uint32_t *fill_len, uint8_t **data_ptr) { union ccb *ccb = NULL; uint8_t *buf = NULL; @@ -8433,7 +8461,7 @@ retry_alloc: scsi_report_supported_opcodes(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, - /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*tag_action*/ task_attr, /*options*/ options, /*req_opcode*/ opcode, /*req_service_action*/ service_action, @@ -8733,7 +8761,8 @@ bailout: static int scsiopcodes(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout, int verbosemode) + char *combinedopt, int task_attr, int retry_count, int timeout, + int verbosemode) { int c; uint32_t opcode = 0, service_action = 0; @@ -8797,8 +8826,9 @@ scsiopcodes(struct cam_device *device, i goto bailout; } retval = scsigetopcodes(device, opcode_set, opcode, show_sa_errors, - sa_set, service_action, td_set, retry_count, - timeout, verbosemode, &valid_len, &buf); + sa_set, service_action, td_set, task_attr, + retry_count, timeout, verbosemode, &valid_len, + &buf); if (retval != 0) goto bailout; @@ -8992,6 +9022,7 @@ usage(int printlong) "-u unit specify unit number, e.g. \"0\", \"5\"\n" "-E have the kernel attempt to perform SCSI error recovery\n" "-C count specify the SCSI command retry count (needs -E to work)\n" +"-Q task_attr specify ordered, simple or head tag type for SCSI cmds\n" "modepage arguments:\n" "-l list all available mode pages\n" "-m page specify the mode page to view or edit\n" @@ -9196,10 +9227,11 @@ main(int argc, char **argv) int timeout = 0, retry_count = 1; camcontrol_optret optreturn; char *tstr; - const char *mainopt = "C:En:t:u:v"; + const char *mainopt = "C:En:Q:t:u:v"; const char *subopt = NULL; char combinedopt[256]; int error = 0, optstart = 2; + int task_attr = MSG_SIMPLE_Q_TAG; int devopen = 1; #ifndef MINIMALISTIC path_id_t bus; @@ -9353,6 +9385,40 @@ main(int argc, char **argv) tstr++; device = (char *)strdup(tstr); break; + case 'Q': { + char *endptr; + int table_entry = 0; + + tstr = optarg; + while (isspace(*tstr) && (*tstr != '\0')) + tstr++; + if (isdigit(*tstr)) { + task_attr = strtol(tstr, &endptr, 0); + if (*endptr != '\0') { + errx(1, "Invalid queue option " + "%s", tstr); + } + } else { + size_t table_size; + scsi_nv_status status; + + table_size = sizeof(task_attrs) / + sizeof(task_attrs[0]); + status = scsi_get_nv(task_attrs, + table_size, tstr, &table_entry, + SCSI_NV_FLAG_IG_CASE); + if (status == SCSI_NV_FOUND) + task_attr = task_attrs[ + table_entry].value; + else { + errx(1, "%s option %s", + (status == SCSI_NV_AMBIGUOUS)? + "ambiguous" : "invalid", + tstr); + } + } + break; + } case 't': timeout = strtol(optarg, NULL, 0); if (timeout < 0) @@ -9418,19 +9484,20 @@ main(int argc, char **argv) break; #ifndef MINIMALISTIC case CAM_CMD_TUR: - error = testunitready(cam_dev, retry_count, timeout, 0); + error = testunitready(cam_dev, task_attr, retry_count, + timeout, 0); break; case CAM_CMD_INQUIRY: error = scsidoinquiry(cam_dev, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); break; case CAM_CMD_IDENTIFY: error = ataidentify(cam_dev, retry_count, timeout); break; case CAM_CMD_STARTSTOP: error = scsistart(cam_dev, arglist & CAM_ARG_START_UNIT, - arglist & CAM_ARG_EJECT, retry_count, - timeout); + arglist & CAM_ARG_EJECT, task_attr, + retry_count, timeout); break; #endif /* MINIMALISTIC */ case CAM_CMD_RESCAN: @@ -9442,15 +9509,15 @@ main(int argc, char **argv) #ifndef MINIMALISTIC case CAM_CMD_READ_DEFECTS: error = readdefects(cam_dev, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); break; case CAM_CMD_MODE_PAGE: modepage(cam_dev, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); break; case CAM_CMD_SCSI_CMD: error = scsicmd(cam_dev, argc, argv, combinedopt, - retry_count, timeout); + task_attr, retry_count, timeout); break; case CAM_CMD_SMP_CMD: error = smpcmd(cam_dev, argc, argv, combinedopt, @@ -9480,22 +9547,23 @@ main(int argc, char **argv) error = tagcontrol(cam_dev, argc, argv, combinedopt); break; case CAM_CMD_RATE: - error = ratecontrol(cam_dev, retry_count, timeout, - argc, argv, combinedopt); + error = ratecontrol(cam_dev, task_attr, retry_count, + timeout, argc, argv, combinedopt); break; case CAM_CMD_FORMAT: error = scsiformat(cam_dev, argc, argv, - combinedopt, retry_count, timeout); + combinedopt, task_attr, retry_count, + timeout); break; case CAM_CMD_REPORTLUNS: error = scsireportluns(cam_dev, argc, argv, - combinedopt, retry_count, - timeout); + combinedopt, task_attr, + retry_count, timeout); break; case CAM_CMD_READCAP: error = scsireadcapacity(cam_dev, argc, argv, - combinedopt, retry_count, - timeout); + combinedopt, task_attr, + retry_count, timeout); break; case CAM_CMD_IDLE: case CAM_CMD_STANDBY: @@ -9514,32 +9582,38 @@ main(int argc, char **argv) break; case CAM_CMD_DOWNLOAD_FW: error = fwdownload(cam_dev, argc, argv, combinedopt, - arglist & CAM_ARG_VERBOSE, retry_count, timeout); + arglist & CAM_ARG_VERBOSE, task_attr, retry_count, + timeout); break; case CAM_CMD_SANITIZE: error = scsisanitize(cam_dev, argc, argv, - combinedopt, retry_count, timeout); + combinedopt, task_attr, + retry_count, timeout); break; case CAM_CMD_PERSIST: error = scsipersist(cam_dev, argc, argv, combinedopt, - retry_count, timeout, arglist & CAM_ARG_VERBOSE, + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE, arglist & CAM_ARG_ERR_RECOVER); break; case CAM_CMD_ATTRIB: error = scsiattrib(cam_dev, argc, argv, combinedopt, - retry_count, timeout, arglist & CAM_ARG_VERBOSE, + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE, arglist & CAM_ARG_ERR_RECOVER); break; case CAM_CMD_OPCODES: error = scsiopcodes(cam_dev, argc, argv, combinedopt, - retry_count, timeout, arglist & CAM_ARG_VERBOSE); + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE); break; case CAM_CMD_REPROBE: error = scsireprobe(cam_dev); break; case CAM_CMD_ZONE: error = zone(cam_dev, argc, argv, combinedopt, - retry_count, timeout, arglist & CAM_ARG_VERBOSE); + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE); break; case CAM_CMD_EPC: error = epc(cam_dev, argc, argv, combinedopt, @@ -9547,7 +9621,8 @@ main(int argc, char **argv) break; case CAM_CMD_TIMESTAMP: error = timestamp(cam_dev, argc, argv, combinedopt, - retry_count, timeout, arglist & CAM_ARG_VERBOSE); + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE); break; #endif /* MINIMALISTIC */ case CAM_CMD_USAGE: Modified: head/sbin/camcontrol/camcontrol.h ============================================================================== --- head/sbin/camcontrol/camcontrol.h Fri Feb 17 20:02:40 2017 (r313892) +++ head/sbin/camcontrol/camcontrol.h Fri Feb 17 20:04:22 2017 (r313893) @@ -75,36 +75,39 @@ int get_ata_status(struct cam_device *de uint8_t *status); int camxferrate(struct cam_device *device); int fwdownload(struct cam_device *device, int argc, char **argv, - char *combinedopt, int printerrors, int retry_count, - int timeout); + char *combinedopt, int printerrors, int task_attr, + int retry_count, int timeout); int zone(struct cam_device *device, int argc, char **argv, char *combinedopt, - int retry_count, int timeout, int verbosemode); + int task_attr, int retry_count, int timeout, int verbosemode); int epc(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout, int verbosemode); int timestamp(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout, + char *combinedopt, int task_attr, int retry_count, int timeout, int verbosemode); void mode_sense(struct cam_device *device, int dbd, int pc, int page, - int subpage, int retry_count, int timeout, uint8_t *data, - int datalen); -void mode_select(struct cam_device *device, int save_pages, int retry_count, - int timeout, u_int8_t *data, int datalen); -void mode_edit(struct cam_device *device, int dbd, int pc, int page, int subpage, - int edit, int binary, int retry_count, int timeout); -void mode_list(struct cam_device *device, int dbd, int pc, int subpages, + int subpage, int task_attr, int retry_count, int timeout, + uint8_t *data, int datalen); +void mode_select(struct cam_device *device, int save_pages, int task_attr, + int retry_count, int timeout, u_int8_t *data, int datalen); +void mode_edit(struct cam_device *device, int dbd, int pc, int page, + int subpage, int edit, int binary, int task_attr, int retry_count, int timeout); +void mode_list(struct cam_device *device, int dbd, int pc, int subpages, + int task_attr, int retry_count, int timeout); int scsidoinquiry(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout); + char *combinedopt, int task_attr, int retry_count, + int timeout); int scsigetopcodes(struct cam_device *device, int opcode_set, int opcode, int show_sa_errors, int sa_set, int service_action, - int timeout_desc, int retry_count, int timeout, - int verbosemode, uint32_t *fill_len, uint8_t **data_ptr); + int timeout_desc, int task_attr, int retry_count, + int timeout, int verbosemode, uint32_t *fill_len, + uint8_t **data_ptr); int scsipersist(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout, int verbose, - int err_recover); + char *combinedopt, int task_attr, int retry_count, + int timeout, int verbose, int err_recover); int scsiattrib(struct cam_device *device, int argc, char **argv, - char *combinedopt, int retry_count, int timeout, int verbose, - int err_recover); + char *combinedopt, int task_attr, int retry_count, int timeout, + int verbose, int err_recover); char *cget(void *hook, char *name); int iget(void *hook, char *name); void arg_put(void *hook, int letter, void *arg, int count, char *name); Modified: head/sbin/camcontrol/fwdownload.c ============================================================================== --- head/sbin/camcontrol/fwdownload.c Fri Feb 17 20:02:40 2017 (r313892) +++ head/sbin/camcontrol/fwdownload.c Fri Feb 17 20:04:22 2017 (r313893) @@ -263,7 +263,7 @@ static const struct fw_timeout_desc fw_t static struct fw_vendor *fw_get_vendor(struct cam_device *cam_dev, struct ata_params *ident_buf); static int fw_get_timeout(struct cam_device *cam_dev, struct fw_vendor *vp, - int retry_count, int timeout); + int task_attr, int retry_count, int timeout); static int fw_validate_ibm(struct cam_device *dev, int retry_count, int timeout, int fd, char *buf, const char *fw_img_path, int quiet); @@ -317,7 +317,7 @@ fw_get_vendor(struct cam_device *cam_dev static int fw_get_timeout(struct cam_device *cam_dev, struct fw_vendor *vp, - int retry_count, int timeout) + int task_attr, int retry_count, int timeout) { struct scsi_report_supported_opcodes_one *one; struct scsi_report_supported_opcodes_timeout *td; @@ -349,6 +349,7 @@ fw_get_timeout(struct cam_device *cam_de /*sa_set*/ 0, /*service_action*/ 0, /*timeout_desc*/ 1, + /*task_attr*/ task_attr, /*retry_count*/ retry_count, /*timeout*/ 10000, /*verbose*/ 0, @@ -919,7 +920,8 @@ bailout: int fwdownload(struct cam_device *device, int argc, char **argv, - char *combinedopt, int printerrors, int retry_count, int timeout) + char *combinedopt, int printerrors, int task_attr, int retry_count, + int timeout) { struct fw_vendor *vp; char *fw_img_path = NULL; @@ -994,7 +996,7 @@ fwdownload(struct cam_device *device, in && (devtype == CC_DT_SCSI)) errx(1, "Unsupported device"); - retval = fw_get_timeout(device, vp, retry_count, timeout); + retval = fw_get_timeout(device, vp, task_attr, retry_count, timeout); if (retval != 0) { warnx("Unable to get a firmware download timeout value"); goto bailout; @@ -1012,8 +1014,8 @@ fwdownload(struct cam_device *device, in " into the following device:\n", fw_img_path); if (devtype == CC_DT_SCSI) { - if (scsidoinquiry(device, argc, argv, combinedopt, 0, - 5000) != 0) { + if (scsidoinquiry(device, argc, argv, combinedopt, + MSG_SIMPLE_Q_TAG, 0, 5000) != 0) { warnx("Error sending inquiry"); retval = 1; goto bailout; Modified: head/sbin/camcontrol/modeedit.c ============================================================================== --- head/sbin/camcontrol/modeedit.c Fri Feb 17 20:02:40 2017 (r313892) +++ head/sbin/camcontrol/modeedit.c Fri Feb 17 20:04:22 2017 (r313893) @@ -106,10 +106,11 @@ static int editentry_set(char *name, c int editonly); static void editlist_populate(struct cam_device *device, int dbd, int pc, int page, int subpage, - int retries, int timeout); + int task_attr, int retries, + int timeout); static void editlist_save(struct cam_device *device, int dbd, int pc, int page, int subpage, - int retries, int timeout); + int task_attr, int retries, int timeout); static void nameentry_create(int page, int subpage, char *name); static struct pagename *nameentry_lookup(int page, int subpage); static int load_format(const char *pagedb_path, int lpage, @@ -118,8 +119,8 @@ static int modepage_write(FILE *file, static int modepage_read(FILE *file); static void modepage_edit(void); static void modepage_dump(struct cam_device *device, int dbd, - int pc, int page, int subpage, int retries, - int timeout); + int pc, int page, int subpage, int task_attr, + int retries, int timeout); static void cleanup_editfile(void); @@ -550,7 +551,7 @@ load_format(const char *pagedb_path, int static void editlist_populate(struct cam_device *device, int dbd, int pc, int page, - int subpage, int retries, int timeout) + int subpage, int task_attr, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ @@ -562,8 +563,8 @@ editlist_populate(struct cam_device *dev STAILQ_INIT(&editlist); /* Fetch changeable values; use to build initial editlist. */ - mode_sense(device, dbd, 1, page, subpage, retries, timeout, data, - sizeof(data)); + mode_sense(device, dbd, 1, page, subpage, task_attr, retries, timeout, + data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; mph = MODE_PAGE_HEADER(mh); @@ -581,14 +582,14 @@ editlist_populate(struct cam_device *dev buff_decode_visit(mode_pars, len, format, editentry_create, 0); /* Fetch the current/saved values; use to set editentry values. */ - mode_sense(device, dbd, pc, page, subpage, retries, timeout, + mode_sense(device, dbd, pc, page, subpage, task_attr, retries, timeout, data, sizeof(data)); buff_decode_visit(mode_pars, len, format, editentry_update, 0); } static void editlist_save(struct cam_device *device, int dbd, int pc, int page, - int subpage, int retries, int timeout) + int subpage, int task_attr, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ @@ -602,7 +603,7 @@ editlist_save(struct cam_device *device, return; /* Preload the CDB buffer with the current mode page data. */ - mode_sense(device, dbd, pc, page, subpage, retries, timeout, + mode_sense(device, dbd, pc, page, subpage, task_attr, retries, timeout, data, sizeof(data)); /* Initial headers & offsets. */ @@ -639,7 +640,8 @@ editlist_save(struct cam_device *device, * recorded. */ mode_select(device, (pc << PAGE_CTRL_SHIFT == SMS_PAGE_CTRL_SAVED), - retries, timeout, (u_int8_t *)mh, sizeof(*mh) + hlen + len); + task_attr, retries, timeout, (u_int8_t *)mh, + sizeof(*mh) + hlen + len); } static int @@ -809,7 +811,7 @@ modepage_edit(void) static void modepage_dump(struct cam_device *device, int dbd, int pc, int page, int subpage, - int retries, int timeout) + int task_attr, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ @@ -818,7 +820,7 @@ modepage_dump(struct cam_device *device, struct scsi_mode_page_header_sp *mphsp; size_t indx, len; - mode_sense(device, dbd, pc, page, subpage, retries, timeout, + mode_sense(device, dbd, pc, page, subpage, task_attr, retries, timeout, data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; @@ -853,7 +855,7 @@ cleanup_editfile(void) void mode_edit(struct cam_device *device, int dbd, int pc, int page, int subpage, - int edit, int binary, int retry_count, int timeout) + int edit, int binary, int task_attr, int retry_count, int timeout) { const char *pagedb_path; /* Path to modepage database. */ @@ -884,8 +886,8 @@ mode_edit(struct cam_device *device, int exit(EX_OSFILE); } - editlist_populate(device, dbd, pc, page, subpage, retry_count, - timeout); + editlist_populate(device, dbd, pc, page, subpage, task_attr, + retry_count, timeout); } if (edit) { @@ -894,10 +896,12 @@ mode_edit(struct cam_device *device, int errx(EX_USAGE, "it only makes sense to edit page 0 " "(current) or page 3 (saved values)"); modepage_edit(); - editlist_save(device, dbd, pc, page, subpage, retry_count, timeout); + editlist_save(device, dbd, pc, page, subpage, task_attr, + retry_count, timeout); } else if (binary || STAILQ_EMPTY(&editlist)) { /* Display without formatting information. */ - modepage_dump(device, dbd, pc, page, subpage, retry_count, timeout); + modepage_dump(device, dbd, pc, page, subpage, task_attr, + retry_count, timeout); } else { /* Display with format. */ modepage_write(stdout, 0); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Feb 17 20:15:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99827CE30D6; Fri, 17 Feb 2017 20:15:28 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60D401754; Fri, 17 Feb 2017 20:15:28 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HKFRrj091727; Fri, 17 Feb 2017 20:15:27 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HKFRnU091726; Fri, 17 Feb 2017 20:15:27 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201702172015.v1HKFRnU091726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Fri, 17 Feb 2017 20:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313895 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 20:15:28 -0000 Author: ken Date: Fri Feb 17 20:15:27 2017 New Revision: 313895 URL: https://svnweb.freebsd.org/changeset/base/313895 Log: Make ctl(4) build with CTL_IO_DELAY defined. sys/cam/ctl/ctl.c: In ctl_datamove(), inside CTL_IO_DELAY, add a lun variable and fill it in before trying to dereference it. MFC after: 3 days Sponsored by: Spectra Logic Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Feb 17 20:07:35 2017 (r313894) +++ head/sys/cam/ctl/ctl.c Fri Feb 17 20:15:27 2017 (r313895) @@ -12405,6 +12405,9 @@ ctl_datamove(union ctl_io *io) if (io->io_hdr.flags & CTL_FLAG_DELAY_DONE) { io->io_hdr.flags &= ~CTL_FLAG_DELAY_DONE; } else { + struct ctl_lun *lun; + + lun = CTL_LUN(io); if ((lun != NULL) && (lun->delay_info.datamove_delay > 0)) { From owner-svn-src-head@freebsd.org Fri Feb 17 20:56:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E599CE3CA1; Fri, 17 Feb 2017 20:56:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AB141FBD; Fri, 17 Feb 2017 20:56:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HKuiJK008292; Fri, 17 Feb 2017 20:56:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HKuifi008291; Fri, 17 Feb 2017 20:56:44 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702172056.v1HKuifi008291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 17 Feb 2017 20:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313897 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 20:56:45 -0000 Author: pfg Date: Fri Feb 17 20:56:43 2017 New Revision: 313897 URL: https://svnweb.freebsd.org/changeset/base/313897 Log: ext2fs: Remove unused assignment. Value is re-assigned a few lines later without being read. Found by: Clang static analyzer MFC after: 1 week Modified: head/sys/fs/ext2fs/ext2_htree.c Modified: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Fri Feb 17 20:19:38 2017 (r313896) +++ head/sys/fs/ext2fs/ext2_htree.c Fri Feb 17 20:56:43 2017 (r313897) @@ -766,7 +766,6 @@ ext2_htree_add_entry(struct vnode *dvp, root_entires = info.h_levels[0].h_entries; newidxblock = malloc(blksize, M_TEMP, M_WAITOK | M_ZERO); dst_node = (struct ext2fs_htree_node *)newidxblock; - dst_entries = dst_node->h_entries; memset(&dst_node->h_fake_dirent, 0, sizeof(dst_node->h_fake_dirent)); dst_node->h_fake_dirent.e2d_reclen = blksize; From owner-svn-src-head@freebsd.org Fri Feb 17 21:08:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1533CE3FFF; Fri, 17 Feb 2017 21:08:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75DD21967; Fri, 17 Feb 2017 21:08:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HL8Weq012674; Fri, 17 Feb 2017 21:08:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HL8WiS012670; Fri, 17 Feb 2017 21:08:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702172108.v1HL8WiS012670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 17 Feb 2017 21:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313898 - in head/sys: amd64/amd64 conf i386/i386 modules/mem x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 21:08:33 -0000 Author: kib Date: Fri Feb 17 21:08:32 2017 New Revision: 313898 URL: https://svnweb.freebsd.org/changeset/base/313898 Log: Merge i386 and amd64 mtrr drivers. Reviewed by: royger, jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D9648 Added: head/sys/x86/x86/x86_mem.c - copied, changed from r313897, head/sys/i386/i386/i686_mem.c Deleted: head/sys/amd64/amd64/amd64_mem.c head/sys/i386/i386/i686_mem.c Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/modules/mem/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Fri Feb 17 20:56:43 2017 (r313897) +++ head/sys/conf/files.amd64 Fri Feb 17 21:08:32 2017 (r313898) @@ -125,7 +125,6 @@ acpi_wakedata.h optional acpi \ no-obj no-implicit-rule before-depend \ clean "acpi_wakedata.h" # -amd64/amd64/amd64_mem.c optional mem #amd64/amd64/apic_vector.S standard amd64/amd64/atomic.c standard amd64/amd64/bios.c standard @@ -667,6 +666,7 @@ x86/x86/io_apic.c standard x86/x86/legacy.c standard x86/x86/local_apic.c standard x86/x86/mca.c standard +x86/x86/x86_mem.c optional mem x86/x86/mptable.c optional mptable x86/x86/mptable_pci.c optional mptable pci x86/x86/mp_x86.c optional smp Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri Feb 17 20:56:43 2017 (r313897) +++ head/sys/conf/files.i386 Fri Feb 17 21:08:32 2017 (r313898) @@ -491,7 +491,6 @@ i386/i386/elf_machdep.c standard i386/i386/exception.s standard i386/i386/gdb_machdep.c optional gdb i386/i386/geode.c optional cpu_geode -i386/i386/i686_mem.c optional mem i386/i386/in_cksum.c optional inet | inet6 i386/i386/initcpu.c standard i386/i386/io.c optional io @@ -634,6 +633,7 @@ x86/x86/io_apic.c optional apic x86/x86/legacy.c standard x86/x86/local_apic.c optional apic x86/x86/mca.c standard +x86/x86/x86_mem.c optional mem x86/x86/mptable.c optional apic x86/x86/mptable_pci.c optional apic pci x86/x86/mp_x86.c optional smp Modified: head/sys/modules/mem/Makefile ============================================================================== --- head/sys/modules/mem/Makefile Fri Feb 17 20:56:43 2017 (r313897) +++ head/sys/modules/mem/Makefile Fri Feb 17 21:08:32 2017 (r313898) @@ -3,14 +3,17 @@ .PATH: ${.CURDIR}/../../dev/mem .PATH: ${.CURDIR}/../../${MACHINE}/${MACHINE} .PATH: ${.CURDIR}/../../${MACHINE_CPUARCH}/${MACHINE_CPUARCH} +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +.PATH: ${.CURDIR}/../../x86/x86 +.endif KMOD= mem SRCS= mem.c memdev.c memutil.c .if ${MACHINE_CPUARCH} == "i386" -SRCS+= i686_mem.c k6_mem.c +SRCS+= x86_mem.c k6_mem.c .endif .if ${MACHINE_CPUARCH} == "amd64" -SRCS+= amd64_mem.c +SRCS+= x86_mem.c .endif SRCS+= bus_if.h device_if.h Copied and modified: head/sys/x86/x86/x86_mem.c (from r313897, head/sys/i386/i386/i686_mem.c) ============================================================================== --- head/sys/i386/i386/i686_mem.c Fri Feb 17 20:56:43 2017 (r313897, copy source) +++ head/sys/x86/x86/x86_mem.c Fri Feb 17 21:08:32 2017 (r313898) @@ -1,7 +1,11 @@ /*- * Copyright (c) 1999 Michael Smith + * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed 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: @@ -35,15 +39,19 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include + #include #include #include /* - * i686 memory range operations + * Pentium Pro+ memory range operations * * This code will probably be impenetrable without reference to the - * Intel Pentium Pro documentation. + * Intel Pentium Pro documentation or x86-64 programmers manual vol 2. */ static char *mem_owner_bios = "BIOS"; @@ -66,19 +74,20 @@ static char *mem_owner_bios = "BIOS"; static int mtrrs_disabled; SYSCTL_INT(_machdep, OID_AUTO, disable_mtrrs, CTLFLAG_RDTUN, - &mtrrs_disabled, 0, "Disable i686 MTRRs."); + &mtrrs_disabled, 0, + "Disable MTRRs."); -static void i686_mrinit(struct mem_range_softc *sc); -static int i686_mrset(struct mem_range_softc *sc, +static void x86_mrinit(struct mem_range_softc *sc); +static int x86_mrset(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg); -static void i686_mrAPinit(struct mem_range_softc *sc); -static void i686_mrreinit(struct mem_range_softc *sc); +static void x86_mrAPinit(struct mem_range_softc *sc); +static void x86_mrreinit(struct mem_range_softc *sc); -static struct mem_range_ops i686_mrops = { - i686_mrinit, - i686_mrset, - i686_mrAPinit, - i686_mrreinit +static struct mem_range_ops x86_mrops = { + x86_mrinit, + x86_mrset, + x86_mrAPinit, + x86_mrreinit }; /* XXX for AP startup hook */ @@ -89,21 +98,21 @@ static u_int64_t mtrr_physmask; static struct mem_range_desc *mem_range_match(struct mem_range_softc *sc, struct mem_range_desc *mrd); -static void i686_mrfetch(struct mem_range_softc *sc); -static int i686_mtrrtype(int flags); -static int i686_mrt2mtrr(int flags, int oldval); -static int i686_mtrrconflict(int flag1, int flag2); -static void i686_mrstore(struct mem_range_softc *sc); -static void i686_mrstoreone(void *arg); -static struct mem_range_desc *i686_mtrrfixsearch(struct mem_range_softc *sc, +static void x86_mrfetch(struct mem_range_softc *sc); +static int x86_mtrrtype(int flags); +static int x86_mrt2mtrr(int flags, int oldval); +static int x86_mtrrconflict(int flag1, int flag2); +static void x86_mrstore(struct mem_range_softc *sc); +static void x86_mrstoreone(void *arg); +static struct mem_range_desc *x86_mtrrfixsearch(struct mem_range_softc *sc, u_int64_t addr); -static int i686_mrsetlow(struct mem_range_softc *sc, +static int x86_mrsetlow(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg); -static int i686_mrsetvariable(struct mem_range_softc *sc, +static int x86_mrsetvariable(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg); -/* i686 MTRR type to memory range type conversion */ -static int i686_mtrrtomrt[] = { +/* ia32 MTRR type to memory range type conversion */ +static int x86_mtrrtomrt[] = { MDF_UNCACHEABLE, MDF_WRITECOMBINE, MDF_UNKNOWN, @@ -113,26 +122,28 @@ static int i686_mtrrtomrt[] = { MDF_WRITEBACK }; -#define MTRRTOMRTLEN nitems(i686_mtrrtomrt) +#define MTRRTOMRTLEN nitems(x86_mtrrtomrt) static int -i686_mtrr2mrt(int val) +x86_mtrr2mrt(int val) { if (val < 0 || val >= MTRRTOMRTLEN) return (MDF_UNKNOWN); - return (i686_mtrrtomrt[val]); + return (x86_mtrrtomrt[val]); } /* - * i686 MTRR conflicts. Writeback and uncachable may overlap. + * x86 MTRR conflicts. Writeback and uncachable may overlap. */ static int -i686_mtrrconflict(int flag1, int flag2) +x86_mtrrconflict(int flag1, int flag2) { flag1 &= MDF_ATTRMASK; flag2 &= MDF_ATTRMASK; + if ((flag1 & MDF_UNKNOWN) || (flag2 & MDF_UNKNOWN)) + return (1); if (flag1 == flag2 || (flag1 == MDF_WRITEBACK && flag2 == MDF_UNCACHEABLE) || (flag2 == MDF_WRITEBACK && flag1 == MDF_UNCACHEABLE)) @@ -157,13 +168,37 @@ mem_range_match(struct mem_range_softc * } /* + * Ensure that the direct map region does not contain any mappings + * that span MTRRs of different types. However, the fixed MTRRs can + * be ignored, because a large page mapping the first 1 MB of physical + * memory is a special case that the processor handles. Invalidate + * any old TLB entries that might hold inconsistent memory type + * information. + */ +static void +x86_mr_split_dmap(struct mem_range_softc *sc __unused) +{ +#ifdef __amd64__ + struct mem_range_desc *mrd; + int i; + + i = (sc->mr_cap & MR686_FIXMTRR) ? MTRR_N64K + MTRR_N16K + MTRR_N4K : 0; + mrd = sc->mr_desc + i; + for (; i < sc->mr_ndesc; i++, mrd++) { + if ((mrd->mr_flags & (MDF_ACTIVE | MDF_BOGUS)) == MDF_ACTIVE) + pmap_demote_DMAP(mrd->mr_base, mrd->mr_len, TRUE); + } +#endif +} + +/* * Fetch the current mtrr settings from the current CPU (assumed to * all be in sync in the SMP case). Note that if we are here, we * assume that MTRRs are enabled, and we may or may not have fixed * MTRRs. */ static void -i686_mrfetch(struct mem_range_softc *sc) +x86_mrfetch(struct mem_range_softc *sc) { struct mem_range_desc *mrd; u_int64_t msrv; @@ -179,31 +214,31 @@ i686_mrfetch(struct mem_range_softc *sc) for (j = 0; j < 8; j++, mrd++) { mrd->mr_flags = (mrd->mr_flags & ~MDF_ATTRMASK) | - i686_mtrr2mrt(msrv & 0xff) | MDF_ACTIVE; + x86_mtrr2mrt(msrv & 0xff) | MDF_ACTIVE; if (mrd->mr_owner[0] == 0) strcpy(mrd->mr_owner, mem_owner_bios); msrv = msrv >> 8; } } msr = MSR_MTRR16kBase; - for (i = 0; i < (MTRR_N16K / 8); i++, msr++) { + for (i = 0; i < MTRR_N16K / 8; i++, msr++) { msrv = rdmsr(msr); for (j = 0; j < 8; j++, mrd++) { mrd->mr_flags = (mrd->mr_flags & ~MDF_ATTRMASK) | - i686_mtrr2mrt(msrv & 0xff) | MDF_ACTIVE; + x86_mtrr2mrt(msrv & 0xff) | MDF_ACTIVE; if (mrd->mr_owner[0] == 0) strcpy(mrd->mr_owner, mem_owner_bios); msrv = msrv >> 8; } } msr = MSR_MTRR4kBase; - for (i = 0; i < (MTRR_N4K / 8); i++, msr++) { + for (i = 0; i < MTRR_N4K / 8; i++, msr++) { msrv = rdmsr(msr); for (j = 0; j < 8; j++, mrd++) { mrd->mr_flags = (mrd->mr_flags & ~MDF_ATTRMASK) | - i686_mtrr2mrt(msrv & 0xff) | MDF_ACTIVE; + x86_mtrr2mrt(msrv & 0xff) | MDF_ACTIVE; if (mrd->mr_owner[0] == 0) strcpy(mrd->mr_owner, mem_owner_bios); msrv = msrv >> 8; @@ -213,10 +248,10 @@ i686_mrfetch(struct mem_range_softc *sc) /* Get remainder which must be variable MTRRs. */ msr = MSR_MTRRVarBase; - for (; (mrd - sc->mr_desc) < sc->mr_ndesc; msr += 2, mrd++) { + for (; mrd - sc->mr_desc < sc->mr_ndesc; msr += 2, mrd++) { msrv = rdmsr(msr); mrd->mr_flags = (mrd->mr_flags & ~MDF_ATTRMASK) | - i686_mtrr2mrt(msrv & MTRR_PHYSBASE_TYPE); + x86_mtrr2mrt(msrv & MTRR_PHYSBASE_TYPE); mrd->mr_base = msrv & mtrr_physmask; msrv = rdmsr(msr + 1); mrd->mr_flags = (msrv & MTRR_PHYSMASK_VALID) ? @@ -225,7 +260,7 @@ i686_mrfetch(struct mem_range_softc *sc) /* Compute the range from the mask. Ick. */ mrd->mr_len = (~(msrv & mtrr_physmask) & - (mtrr_physmask | 0xfffLL)) + 1; + (mtrr_physmask | 0xfffL)) + 1; if (!mrvalid(mrd->mr_base, mrd->mr_len)) mrd->mr_flags |= MDF_BOGUS; @@ -239,27 +274,27 @@ i686_mrfetch(struct mem_range_softc *sc) * Return the MTRR memory type matching a region's flags */ static int -i686_mtrrtype(int flags) +x86_mtrrtype(int flags) { int i; flags &= MDF_ATTRMASK; for (i = 0; i < MTRRTOMRTLEN; i++) { - if (i686_mtrrtomrt[i] == MDF_UNKNOWN) + if (x86_mtrrtomrt[i] == MDF_UNKNOWN) continue; - if (flags == i686_mtrrtomrt[i]) + if (flags == x86_mtrrtomrt[i]) return (i); } return (-1); } static int -i686_mrt2mtrr(int flags, int oldval) +x86_mrt2mtrr(int flags, int oldval) { int val; - if ((val = i686_mtrrtype(flags)) == -1) + if ((val = x86_mtrrtype(flags)) == -1) return (oldval & 0xff); return (val & 0xff); } @@ -271,19 +306,14 @@ i686_mrt2mtrr(int flags, int oldval) * XXX Must be called with interrupts enabled. */ static void -i686_mrstore(struct mem_range_softc *sc) +x86_mrstore(struct mem_range_softc *sc) { + #ifdef SMP - /* - * We should use ipi_all_but_self() to call other CPUs into a - * locking gate, then call a target function to do this work. - * The "proper" solution involves a generalised locking gate - * implementation, not ready yet. - */ - smp_rendezvous(NULL, i686_mrstoreone, NULL, sc); + smp_rendezvous(NULL, x86_mrstoreone, NULL, sc); #else disable_intr(); /* disable interrupts */ - i686_mrstoreone(sc); + x86_mrstoreone(sc); enable_intr(); #endif } @@ -294,7 +324,7 @@ i686_mrstore(struct mem_range_softc *sc) * stuffing one entry; this is simpler (but slower, of course). */ static void -i686_mrstoreone(void *arg) +x86_mrstoreone(void *arg) { struct mem_range_softc *sc = arg; struct mem_range_desc *mrd; @@ -324,36 +354,36 @@ i686_mrstoreone(void *arg) /* Set fixed-range MTRRs. */ if (sc->mr_cap & MR686_FIXMTRR) { msr = MSR_MTRR64kBase; - for (i = 0; i < (MTRR_N64K / 8); i++, msr++) { + for (i = 0; i < MTRR_N64K / 8; i++, msr++) { msrv = 0; omsrv = rdmsr(msr); for (j = 7; j >= 0; j--) { msrv = msrv << 8; - msrv |= i686_mrt2mtrr((mrd + j)->mr_flags, + msrv |= x86_mrt2mtrr((mrd + j)->mr_flags, omsrv >> (j * 8)); } wrmsr(msr, msrv); mrd += 8; } msr = MSR_MTRR16kBase; - for (i = 0; i < (MTRR_N16K / 8); i++, msr++) { + for (i = 0; i < MTRR_N16K / 8; i++, msr++) { msrv = 0; omsrv = rdmsr(msr); for (j = 7; j >= 0; j--) { msrv = msrv << 8; - msrv |= i686_mrt2mtrr((mrd + j)->mr_flags, + msrv |= x86_mrt2mtrr((mrd + j)->mr_flags, omsrv >> (j * 8)); } wrmsr(msr, msrv); mrd += 8; } msr = MSR_MTRR4kBase; - for (i = 0; i < (MTRR_N4K / 8); i++, msr++) { + for (i = 0; i < MTRR_N4K / 8; i++, msr++) { msrv = 0; omsrv = rdmsr(msr); for (j = 7; j >= 0; j--) { msrv = msrv << 8; - msrv |= i686_mrt2mtrr((mrd + j)->mr_flags, + msrv |= x86_mrt2mtrr((mrd + j)->mr_flags, omsrv >> (j * 8)); } wrmsr(msr, msrv); @@ -363,12 +393,12 @@ i686_mrstoreone(void *arg) /* Set remainder which must be variable MTRRs. */ msr = MSR_MTRRVarBase; - for (; (mrd - sc->mr_desc) < sc->mr_ndesc; msr += 2, mrd++) { + for (; mrd - sc->mr_desc < sc->mr_ndesc; msr += 2, mrd++) { /* base/type register */ omsrv = rdmsr(msr); if (mrd->mr_flags & MDF_ACTIVE) { msrv = mrd->mr_base & mtrr_physmask; - msrv |= i686_mrt2mtrr(mrd->mr_flags, omsrv); + msrv |= x86_mrt2mtrr(mrd->mr_flags, omsrv); } else { msrv = 0; } @@ -402,15 +432,15 @@ i686_mrstoreone(void *arg) * Hunt for the fixed MTRR referencing (addr) */ static struct mem_range_desc * -i686_mtrrfixsearch(struct mem_range_softc *sc, u_int64_t addr) +x86_mtrrfixsearch(struct mem_range_softc *sc, u_int64_t addr) { struct mem_range_desc *mrd; int i; - for (i = 0, mrd = sc->mr_desc; i < (MTRR_N64K + MTRR_N16K + MTRR_N4K); + for (i = 0, mrd = sc->mr_desc; i < MTRR_N64K + MTRR_N16K + MTRR_N4K; i++, mrd++) - if ((addr >= mrd->mr_base) && - (addr < (mrd->mr_base + mrd->mr_len))) + if (addr >= mrd->mr_base && + addr < mrd->mr_base + mrd->mr_len) return (mrd); return (NULL); } @@ -427,21 +457,23 @@ i686_mtrrfixsearch(struct mem_range_soft * "busy" ranges. */ static int -i686_mrsetlow(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg) +x86_mrsetlow(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg) { struct mem_range_desc *first_md, *last_md, *curr_md; /* Range check. */ - if (((first_md = i686_mtrrfixsearch(sc, mrd->mr_base)) == NULL) || - ((last_md = i686_mtrrfixsearch(sc, mrd->mr_base + mrd->mr_len - 1)) == NULL)) + if ((first_md = x86_mtrrfixsearch(sc, mrd->mr_base)) == NULL || + (last_md = x86_mtrrfixsearch(sc, mrd->mr_base + mrd->mr_len - 1)) + == NULL) return (EINVAL); /* Check that we aren't doing something risky. */ - if (!(mrd->mr_flags & MDF_FORCE)) + if ((mrd->mr_flags & MDF_FORCE) == 0) { for (curr_md = first_md; curr_md <= last_md; curr_md++) { if ((curr_md->mr_flags & MDF_ATTRMASK) == MDF_UNKNOWN) return (EACCES); } + } /* Set flags, clear set-by-firmware flag. */ for (curr_md = first_md; curr_md <= last_md; curr_md++) { @@ -459,7 +491,7 @@ i686_mrsetlow(struct mem_range_softc *sc * XXX needs to be updated to properly support "busy" ranges. */ static int -i686_mrsetvariable(struct mem_range_softc *sc, struct mem_range_desc *mrd, +x86_mrsetvariable(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg) { struct mem_range_desc *curr_md, *free_md; @@ -479,8 +511,8 @@ i686_mrsetvariable(struct mem_range_soft for (; i < sc->mr_ndesc; i++, curr_md++) { if (curr_md->mr_flags & MDF_ACTIVE) { /* Exact match? */ - if ((curr_md->mr_base == mrd->mr_base) && - (curr_md->mr_len == mrd->mr_len)) { + if (curr_md->mr_base == mrd->mr_base && + curr_md->mr_len == mrd->mr_len) { /* Whoops, owned by someone. */ if (curr_md->mr_flags & MDF_BUSY) @@ -488,8 +520,8 @@ i686_mrsetvariable(struct mem_range_soft /* Check that we aren't doing something risky */ if (!(mrd->mr_flags & MDF_FORCE) && - ((curr_md->mr_flags & MDF_ATTRMASK) == - MDF_UNKNOWN)) + (curr_md->mr_flags & MDF_ATTRMASK) == + MDF_UNKNOWN) return (EACCES); /* Ok, just hijack this entry. */ @@ -500,7 +532,7 @@ i686_mrsetvariable(struct mem_range_soft /* Non-exact overlap? */ if (mroverlap(curr_md, mrd)) { /* Between conflicting region types? */ - if (i686_mtrrconflict(curr_md->mr_flags, + if (x86_mtrrconflict(curr_md->mr_flags, mrd->mr_flags)) return (EINVAL); } @@ -525,31 +557,32 @@ i686_mrsetvariable(struct mem_range_soft * Handle requests to set memory range attributes by manipulating MTRRs. */ static int -i686_mrset(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg) +x86_mrset(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg) { struct mem_range_desc *targ; - int error = 0; + int error; - switch(*arg) { + switch (*arg) { case MEMRANGE_SET_UPDATE: /* * Make sure that what's being asked for is even * possible at all. */ if (!mrvalid(mrd->mr_base, mrd->mr_len) || - i686_mtrrtype(mrd->mr_flags) == -1) + x86_mtrrtype(mrd->mr_flags) == -1) return (EINVAL); -#define FIXTOP ((MTRR_N64K * 0x10000) + (MTRR_N16K * 0x4000) + (MTRR_N4K * 0x1000)) +#define FIXTOP \ + ((MTRR_N64K * 0x10000) + (MTRR_N16K * 0x4000) + (MTRR_N4K * 0x1000)) /* Are the "low memory" conditions applicable? */ - if ((sc->mr_cap & MR686_FIXMTRR) && - ((mrd->mr_base + mrd->mr_len) <= FIXTOP)) { - if ((error = i686_mrsetlow(sc, mrd, arg)) != 0) + if ((sc->mr_cap & MR686_FIXMTRR) != 0 && + mrd->mr_base + mrd->mr_len <= FIXTOP) { + if ((error = x86_mrsetlow(sc, mrd, arg)) != 0) return (error); } else { /* It's time to play with variable MTRRs. */ - if ((error = i686_mrsetvariable(sc, mrd, arg)) != 0) + if ((error = x86_mrsetvariable(sc, mrd, arg)) != 0) return (error); } break; @@ -569,11 +602,13 @@ i686_mrset(struct mem_range_softc *sc, s return (EOPNOTSUPP); } + x86_mr_split_dmap(sc); + /* Update the hardware. */ - i686_mrstore(sc); + x86_mrstore(sc); /* Refetch to see where we're at. */ - i686_mrfetch(sc); + x86_mrfetch(sc); return (0); } @@ -582,16 +617,16 @@ i686_mrset(struct mem_range_softc *sc, s * and fetch the initial settings. */ static void -i686_mrinit(struct mem_range_softc *sc) +x86_mrinit(struct mem_range_softc *sc) { struct mem_range_desc *mrd; - u_int regs[4]; - int i, nmdesc = 0, pabits; + int i, nmdesc; if (sc->mr_desc != NULL) /* Already initialized. */ return; + nmdesc = 0; mtrrcap = rdmsr(MSR_MTRRcap); mtrrdef = rdmsr(MSR_MTRRdefType); @@ -607,17 +642,9 @@ i686_mrinit(struct mem_range_softc *sc) /* * Determine the size of the PhysMask and PhysBase fields in - * the variable range MTRRs. If the extended CPUID 0x80000008 - * is present, use that to figure out how many physical - * address bits the CPU supports. Otherwise, default to 36 - * address bits. + * the variable range MTRRs. */ - if (cpu_exthigh >= 0x80000008) { - do_cpuid(0x80000008, regs); - pabits = regs[0] & 0xff; - } else - pabits = 36; - mtrr_physmask = ((1ULL << pabits) - 1) & ~0xfffULL; + mtrr_physmask = ((1UL << cpu_maxphyaddr) - 1) & ~0xfffUL; /* If fixed MTRRs supported and enabled. */ if ((mtrrcap & MTRR_CAP_FIXED) && (mtrrdef & MTRR_DEF_FIXED_ENABLE)) { @@ -658,22 +685,24 @@ i686_mrinit(struct mem_range_softc *sc) * have been set by the firmware. (XXX has something already * played here?) */ - i686_mrfetch(sc); + x86_mrfetch(sc); mrd = sc->mr_desc; for (i = 0; i < sc->mr_ndesc; i++, mrd++) { if (mrd->mr_flags & MDF_ACTIVE) mrd->mr_flags |= MDF_FIRMWARE; } + + x86_mr_split_dmap(sc); } /* * Initialise MTRRs on an AP after the BSP has run the init code. */ static void -i686_mrAPinit(struct mem_range_softc *sc) +x86_mrAPinit(struct mem_range_softc *sc) { - i686_mrstoreone(sc); + x86_mrstoreone(sc); wrmsr(MSR_MTRRdefType, mtrrdef); } @@ -684,25 +713,20 @@ i686_mrAPinit(struct mem_range_softc *sc * XXX Must be called with interrupts enabled. */ static void -i686_mrreinit(struct mem_range_softc *sc) +x86_mrreinit(struct mem_range_softc *sc) { + #ifdef SMP - /* - * We should use ipi_all_but_self() to call other CPUs into a - * locking gate, then call a target function to do this work. - * The "proper" solution involves a generalised locking gate - * implementation, not ready yet. - */ - smp_rendezvous(NULL, (void *)i686_mrAPinit, NULL, sc); + smp_rendezvous(NULL, (void *)x86_mrAPinit, NULL, sc); #else disable_intr(); /* disable interrupts */ - i686_mrAPinit(sc); + x86_mrAPinit(sc); enable_intr(); #endif } static void -i686_mem_drvinit(void *unused) +x86_mem_drvinit(void *unused) { if (mtrrs_disabled) @@ -719,7 +743,7 @@ i686_mem_drvinit(void *unused) default: return; } - mem_range_softc.mr_op = &i686_mrops; - i686_mrinit(&mem_range_softc); + mem_range_softc.mr_op = &x86_mrops; + x86_mrinit(&mem_range_softc); } -SYSINIT(i686memdev, SI_SUB_CPU, SI_ORDER_ANY, i686_mem_drvinit, NULL); +SYSINIT(x86memdev, SI_SUB_CPU, SI_ORDER_ANY, x86_mem_drvinit, NULL); From owner-svn-src-head@freebsd.org Fri Feb 17 21:25:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3DE8CE3519; Fri, 17 Feb 2017 21:25:25 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 836B015F9; Fri, 17 Feb 2017 21:25:25 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HLPOkG020639; Fri, 17 Feb 2017 21:25:24 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HLPO87020638; Fri, 17 Feb 2017 21:25:24 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201702172125.v1HLPO87020638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 Feb 2017 21:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313899 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 21:25:25 -0000 Author: brooks Date: Fri Feb 17 21:25:24 2017 New Revision: 313899 URL: https://svnweb.freebsd.org/changeset/base/313899 Log: Enable capsicum on MALTA kernels. This adds less that 10K to the kernel and should probably be done in the other std.* configs. Modified: head/sys/mips/conf/std.MALTA Modified: head/sys/mips/conf/std.MALTA ============================================================================== --- head/sys/mips/conf/std.MALTA Fri Feb 17 21:08:32 2017 (r313898) +++ head/sys/mips/conf/std.MALTA Fri Feb 17 21:25:24 2017 (r313899) @@ -26,6 +26,8 @@ options NFSCL #Network Filesystem Cli options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options CAPABILITY_MODE # Capsicum capability mode +options CAPABILITIES # Capsicum capabilities options TMPFS #Efficient memory filesystem From owner-svn-src-head@freebsd.org Fri Feb 17 21:30:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA46CCE35AF; Fri, 17 Feb 2017 21:30:17 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F30F17B7; Fri, 17 Feb 2017 21:30:17 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HLUGxr020959; Fri, 17 Feb 2017 21:30:16 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HLUGnp020958; Fri, 17 Feb 2017 21:30:16 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201702172130.v1HLUGnp020958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 17 Feb 2017 21:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313900 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 21:30:17 -0000 Author: sbruno Date: Fri Feb 17 21:30:16 2017 New Revision: 313900 URL: https://svnweb.freebsd.org/changeset/base/313900 Log: Push max_frame_len back into iflib so that jumbo frame sizes work. Reported by: pho Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Fri Feb 17 21:25:24 2017 (r313899) +++ head/sys/dev/e1000/if_em.c Fri Feb 17 21:30:16 2017 (r313900) @@ -920,7 +920,7 @@ em_if_attach_pre(if_ctx_t ctx) * Set the frame limits assuming * standard ethernet sized frames. */ - adapter->hw.mac.max_frame_size = + scctx->isc_max_frame_size = adapter->hw.mac.max_frame_size = ETHERMTU + ETHER_HDR_LEN + ETHERNET_FCS_SIZE; /* @@ -1117,6 +1117,7 @@ em_if_mtu_set(if_ctx_t ctx, uint32_t mtu int max_frame_size; struct adapter *adapter = iflib_get_softc(ctx); struct ifnet *ifp = iflib_get_ifp(ctx); + if_softc_ctx_t scctx = iflib_get_softc_ctx(ctx); IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFMTU (Set Interface MTU)"); @@ -1147,7 +1148,8 @@ em_if_mtu_set(if_ctx_t ctx, uint32_t mtu return (EINVAL); } - adapter->hw.mac.max_frame_size = if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN; + scctx->isc_max_frame_size = adapter->hw.mac.max_frame_size = + if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN; return (0); } From owner-svn-src-head@freebsd.org Fri Feb 17 22:09:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F6C3CE3EC0; Fri, 17 Feb 2017 22:09:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E362118EA; Fri, 17 Feb 2017 22:09:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HM9tFC037373; Fri, 17 Feb 2017 22:09:55 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HM9tl9037372; Fri, 17 Feb 2017 22:09:55 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702172209.v1HM9tl9037372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 17 Feb 2017 22:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313901 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 22:09:57 -0000 Author: mjg Date: Fri Feb 17 22:09:55 2017 New Revision: 313901 URL: https://svnweb.freebsd.org/changeset/base/313901 Log: sx: fix mips builld after r313855 The namespace in this file really needs cleaning up. In the meantime let inline primitives be defined as long as LOCK_DEBUG is not enabled. Reported by: kib Modified: head/sys/sys/sx.h Modified: head/sys/sys/sx.h ============================================================================== --- head/sys/sys/sx.h Fri Feb 17 21:30:16 2017 (r313900) +++ head/sys/sys/sx.h Fri Feb 17 22:09:55 2017 (r313901) @@ -145,7 +145,7 @@ struct sx_args { * deferred to 'tougher' functions. */ -#if (LOCK_DEBUG == 0) && !defined(SX_NOINLINE) +#if (LOCK_DEBUG == 0) /* Acquire an exclusive lock. */ static __inline int __sx_xlock(struct sx *sx, struct thread *td, int opts, const char *file, From owner-svn-src-head@freebsd.org Fri Feb 17 22:49:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7572ECE29A6; Fri, 17 Feb 2017 22:49:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 353191CAF; Fri, 17 Feb 2017 22:49:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HMnqD6053821; Fri, 17 Feb 2017 22:49:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HMnquY053820; Fri, 17 Feb 2017 22:49:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702172249.v1HMnquY053820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 17 Feb 2017 22:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313902 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 22:49:53 -0000 Author: kib Date: Fri Feb 17 22:49:52 2017 New Revision: 313902 URL: https://svnweb.freebsd.org/changeset/base/313902 Log: smp_rendezvous() works for UP case as well, reduce duplicated code. Also fix cast and remove unneeded XXX in comment. Noted and reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D9657 Modified: head/sys/x86/x86/x86_mem.c Modified: head/sys/x86/x86/x86_mem.c ============================================================================== --- head/sys/x86/x86/x86_mem.c Fri Feb 17 22:09:55 2017 (r313901) +++ head/sys/x86/x86/x86_mem.c Fri Feb 17 22:49:52 2017 (r313902) @@ -303,19 +303,13 @@ x86_mrt2mtrr(int flags, int oldval) * Update running CPU(s) MTRRs to match the ranges in the descriptor * list. * - * XXX Must be called with interrupts enabled. + * Must be called with interrupts enabled. */ static void x86_mrstore(struct mem_range_softc *sc) { -#ifdef SMP smp_rendezvous(NULL, x86_mrstoreone, NULL, sc); -#else - disable_intr(); /* disable interrupts */ - x86_mrstoreone(sc); - enable_intr(); -#endif } /* @@ -710,19 +704,13 @@ x86_mrAPinit(struct mem_range_softc *sc) * Re-initialise running CPU(s) MTRRs to match the ranges in the descriptor * list. * - * XXX Must be called with interrupts enabled. + * Must be called with interrupts enabled. */ static void x86_mrreinit(struct mem_range_softc *sc) { -#ifdef SMP - smp_rendezvous(NULL, (void *)x86_mrAPinit, NULL, sc); -#else - disable_intr(); /* disable interrupts */ - x86_mrAPinit(sc); - enable_intr(); -#endif + smp_rendezvous(NULL, (void (*)(void *))x86_mrAPinit, NULL, sc); } static void From owner-svn-src-head@freebsd.org Fri Feb 17 22:50:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85C53CE2A27; Fri, 17 Feb 2017 22:50:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5590D1E16; Fri, 17 Feb 2017 22:50:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HMofG4054633; Fri, 17 Feb 2017 22:50:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HMofoE054632; Fri, 17 Feb 2017 22:50:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201702172250.v1HMofoE054632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 17 Feb 2017 22:50:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313903 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 22:50:42 -0000 Author: kib Date: Fri Feb 17 22:50:41 2017 New Revision: 313903 URL: https://svnweb.freebsd.org/changeset/base/313903 Log: Rely on CPUID feature only to enable attaching. MTRR are architectural and there is no reason to check cpu family or vendor. Noted by: royger Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D9657 Modified: head/sys/x86/x86/x86_mem.c Modified: head/sys/x86/x86/x86_mem.c ============================================================================== --- head/sys/x86/x86/x86_mem.c Fri Feb 17 22:49:52 2017 (r313902) +++ head/sys/x86/x86/x86_mem.c Fri Feb 17 22:50:41 2017 (r313903) @@ -721,16 +721,6 @@ x86_mem_drvinit(void *unused) return; if (!(cpu_feature & CPUID_MTRR)) return; - if ((cpu_id & 0xf00) != 0x600 && (cpu_id & 0xf00) != 0xf00) - return; - switch (cpu_vendor_id) { - case CPU_VENDOR_INTEL: - case CPU_VENDOR_AMD: - case CPU_VENDOR_CENTAUR: - break; - default: - return; - } mem_range_softc.mr_op = &x86_mrops; x86_mrinit(&mem_range_softc); } From owner-svn-src-head@freebsd.org Fri Feb 17 22:51:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FDABCE2BF6; Fri, 17 Feb 2017 22:51:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F80C1FF9; Fri, 17 Feb 2017 22:51:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HMpLYa056806; Fri, 17 Feb 2017 22:51:21 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HMpLqR056805; Fri, 17 Feb 2017 22:51:21 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201702172251.v1HMpLqR056805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 17 Feb 2017 22:51:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313904 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 22:51:22 -0000 Author: bdrewery Date: Fri Feb 17 22:51:21 2017 New Revision: 313904 URL: https://svnweb.freebsd.org/changeset/base/313904 Log: META_MODE+xdev: Don't rebuild build-tools during normal build. See r297997 for more information. MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Feb 17 22:50:41 2017 (r313903) +++ head/Makefile.inc1 Fri Feb 17 22:51:21 2017 (r313904) @@ -2524,6 +2524,10 @@ CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN} CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN} +.if ${MK_META_MODE} != "no" +# Don't rebuild build-tools targets during normal build. +CD2MAKE+= BUILD_TOOLS_META=.NOMETA_CMP +.endif XDDESTDIR=${DESTDIR}/${XDTP} .if !defined(OSREL) OSREL!= uname -r | sed -e 's/[-(].*//' From owner-svn-src-head@freebsd.org Fri Feb 17 22:51:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07E53CE2C2E; Fri, 17 Feb 2017 22:51:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBC871115; Fri, 17 Feb 2017 22:51:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HMpYTV057521; Fri, 17 Feb 2017 22:51:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HMpY4C057520; Fri, 17 Feb 2017 22:51:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201702172251.v1HMpY4C057520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 17 Feb 2017 22:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313905 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 22:51:36 -0000 Author: bdrewery Date: Fri Feb 17 22:51:34 2017 New Revision: 313905 URL: https://svnweb.freebsd.org/changeset/base/313905 Log: xdev: Build yacc which is needed for recent libpcap updates. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Feb 17 22:51:21 2017 (r313904) +++ head/Makefile.inc1 Fri Feb 17 22:51:34 2017 (r313905) @@ -2547,7 +2547,8 @@ _xb-worldtmp: .PHONY _xb-bootstrap-tools: .PHONY .for _tool in \ ${_clang_tblgen} \ - ${_gperf} + ${_gperf} \ + ${_yacc} ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ obj; \ From owner-svn-src-head@freebsd.org Fri Feb 17 23:20:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AE3ACE32E3; Fri, 17 Feb 2017 23:20:24 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5B751F9A; Fri, 17 Feb 2017 23:20:23 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1HNKMLK066052; Fri, 17 Feb 2017 23:20:22 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HNKMvU066049; Fri, 17 Feb 2017 23:20:22 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201702172320.v1HNKMvU066049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 17 Feb 2017 23:20:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313906 - in head/sys/dev: iwi ral usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 23:20:24 -0000 Author: avos Date: Fri Feb 17 23:20:22 2017 New Revision: 313906 URL: https://svnweb.freebsd.org/changeset/base/313906 Log: iwi, ral, zyd: fix possible use-after-free. MFC after: 5 days Modified: head/sys/dev/iwi/if_iwi.c head/sys/dev/ral/rt2661.c head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Fri Feb 17 22:51:34 2017 (r313905) +++ head/sys/dev/iwi/if_iwi.c Fri Feb 17 23:20:22 2017 (r313906) @@ -1979,9 +1979,9 @@ iwi_start(struct iwi_softc *sc) } ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; if (iwi_tx_start(sc, m, ni, ac) != 0) { - ieee80211_free_node(ni); if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); + ieee80211_free_node(ni); break; } sc->sc_tx_timer = 5; Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Fri Feb 17 22:51:34 2017 (r313905) +++ head/sys/dev/ral/rt2661.c Fri Feb 17 23:20:22 2017 (r313906) @@ -1616,9 +1616,9 @@ rt2661_start(struct rt2661_softc *sc) } ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; if (rt2661_tx_data(sc, m, ni, ac) != 0) { - ieee80211_free_node(ni); if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); + ieee80211_free_node(ni); break; } sc->sc_tx_timer = 5; Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Fri Feb 17 22:51:34 2017 (r313905) +++ head/sys/dev/usb/wlan/if_zyd.c Fri Feb 17 23:20:22 2017 (r313906) @@ -2582,10 +2582,10 @@ zyd_start(struct zyd_softc *sc) while (sc->tx_nfree > 0 && (m = mbufq_dequeue(&sc->sc_snd)) != NULL) { ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; if (zyd_tx_start(sc, m, ni) != 0) { - ieee80211_free_node(ni); m_freem(m); if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); + ieee80211_free_node(ni); break; } } From owner-svn-src-head@freebsd.org Sat Feb 18 00:08:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43916CE3F06; Sat, 18 Feb 2017 00:08:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDDB61AEC; Sat, 18 Feb 2017 00:08:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1I08EEV086791; Sat, 18 Feb 2017 00:08:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1I08EvO086790; Sat, 18 Feb 2017 00:08:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201702180008.v1I08EvO086790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 18 Feb 2017 00:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313907 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 00:08:15 -0000 Author: bdrewery Date: Sat Feb 18 00:08:13 2017 New Revision: 313907 URL: https://svnweb.freebsd.org/changeset/base/313907 Log: xdev: Fix after libc++ update in r300873. The xdev build needed the same fixes as libcompat and external toolchain support needed for handling of --sysroot, -L, -B, etc. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Feb 17 23:20:22 2017 (r313906) +++ head/Makefile.inc1 Sat Feb 18 00:08:13 2017 (r313907) @@ -2514,10 +2514,25 @@ CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREF INSTALL="sh ${.CURDIR}/tools/install.sh" CDENV= ${CDBENV} \ TOOLS_PREFIX=${XDTP} -CD2CFLAGS=-isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib \ - --sysroot=${XDDESTDIR}/ -B${XDDESTDIR}/usr/libexec \ - -B${XDDESTDIR}/usr/bin -B${XDDESTDIR}/usr/lib -CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CFLAGS}" \ + +.if ${WANT_COMPILER_TYPE} == gcc || \ + (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) +# GCC requires -isystem and -L when using a cross-compiler. --sysroot +# won't set header path and -L is used to ensure the base library path +# is added before the port PREFIX library path. +CD2CFLAGS+= -isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib +# GCC requires -B to find /usr/lib/crti.o when using a cross-compiler +# combined with --sysroot. +CD2CFLAGS+= -B${XDDESTDIR}/usr/lib +# Force using libc++ for external GCC. +# XXX: This should be checking MK_GNUCXX == no +.if ${X_COMPILER_VERSION} >= 40800 +CD2CXXFLAGS+= -isystem ${XDDESTDIR}/usr/include/c++/v1 -std=c++11 \ + -nostdinc++ +.endif +.endif +CD2CFLAGS+= --sysroot=${XDDESTDIR}/ +CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CXXFLAGS} ${CD2CFLAGS}" \ CPP="${CPP} ${CD2CFLAGS}" \ MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} From owner-svn-src-head@freebsd.org Sat Feb 18 01:52:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F02C7CE43B5; Sat, 18 Feb 2017 01:52:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAB7325C; Sat, 18 Feb 2017 01:52:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1I1qAFY030863; Sat, 18 Feb 2017 01:52:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1I1qASK030860; Sat, 18 Feb 2017 01:52:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702180152.v1I1qASK030860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 18 Feb 2017 01:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313908 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 01:52:12 -0000 Author: mjg Date: Sat Feb 18 01:52:10 2017 New Revision: 313908 URL: https://svnweb.freebsd.org/changeset/base/313908 Log: mtx: plug the 'opts' argument when not used Modified: head/sys/kern/kern_mutex.c head/sys/sys/lock.h head/sys/sys/mutex.h Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sat Feb 18 00:08:13 2017 (r313907) +++ head/sys/kern/kern_mutex.c Sat Feb 18 01:52:10 2017 (r313908) @@ -429,7 +429,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, const char *file, int line) #else void -__mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, int opts) +__mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid) #endif { struct mtx *m; @@ -471,14 +471,18 @@ __mtx_lock_sleep(volatile uintptr_t *c, (opts & MTX_RECURSE) != 0, ("_mtx_lock_sleep: recursed on non-recursive mutex %s @ %s:%d\n", m->lock_object.lo_name, file, line)); +#if LOCK_DEBUG > 0 opts &= ~MTX_RECURSE; +#endif m->mtx_recurse++; atomic_set_ptr(&m->mtx_lock, MTX_RECURSED); if (LOCK_LOG_TEST(&m->lock_object, opts)) CTR1(KTR_LOCK, "_mtx_lock_sleep: %p recursing", m); return; } +#if LOCK_DEBUG > 0 opts &= ~MTX_RECURSE; +#endif #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); @@ -873,7 +877,7 @@ void __mtx_unlock_sleep(volatile uintptr_t *c, int opts, const char *file, int line) #else void -__mtx_unlock_sleep(volatile uintptr_t *c, int opts) +__mtx_unlock_sleep(volatile uintptr_t *c) #endif { struct mtx *m; Modified: head/sys/sys/lock.h ============================================================================== --- head/sys/sys/lock.h Sat Feb 18 00:08:13 2017 (r313907) +++ head/sys/sys/lock.h Sat Feb 18 01:52:10 2017 (r313908) @@ -154,8 +154,13 @@ struct lock_class { * file - file name * line - line number */ +#if LOCK_DEBUG > 0 #define LOCK_LOG_TEST(lo, flags) \ (((flags) & LOP_QUIET) == 0 && ((lo)->lo_flags & LO_QUIET) == 0) +#else +#define LOCK_LOG_TEST(lo, flags) 0 +#endif + #define LOCK_LOG_LOCK(opname, lo, flags, recurse, file, line) do { \ if (LOCK_LOG_TEST((lo), (flags))) \ Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Sat Feb 18 00:08:13 2017 (r313907) +++ head/sys/sys/mutex.h Sat Feb 18 01:52:10 2017 (r313908) @@ -104,9 +104,8 @@ void __mtx_lock_sleep(volatile uintptr_t void __mtx_unlock_sleep(volatile uintptr_t *c, int opts, const char *file, int line); #else -void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, - int opts); -void __mtx_unlock_sleep(volatile uintptr_t *c, int opts); +void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid); +void __mtx_unlock_sleep(volatile uintptr_t *c); #endif #ifdef SMP @@ -154,9 +153,9 @@ void thread_lock_flags_(struct thread *, __mtx_unlock_sleep(&(m)->mtx_lock, o, f, l) #else #define _mtx_lock_sleep(m, v, t, o, f, l) \ - __mtx_lock_sleep(&(m)->mtx_lock, v, t, o) + __mtx_lock_sleep(&(m)->mtx_lock, v, t) #define _mtx_unlock_sleep(m, o, f, l) \ - __mtx_unlock_sleep(&(m)->mtx_lock, o) + __mtx_unlock_sleep(&(m)->mtx_lock) #endif #ifdef SMP #define _mtx_lock_spin(m, v, t, o, f, l) \ From owner-svn-src-head@freebsd.org Sat Feb 18 05:07:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77C6FCE4038; Sat, 18 Feb 2017 05:07:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C857659; Sat, 18 Feb 2017 05:07:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1I57rDw008705; Sat, 18 Feb 2017 05:07:53 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1I57rOM008704; Sat, 18 Feb 2017 05:07:53 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201702180507.v1I57rOM008704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 18 Feb 2017 05:07:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313909 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 05:07:54 -0000 Author: bdrewery Date: Sat Feb 18 05:07:53 2017 New Revision: 313909 URL: https://svnweb.freebsd.org/changeset/base/313909 Log: Fix panic with unlocked vnode to vrecycle(). MFC after: 2 weeks Modified: head/sys/kern/uipc_mqueue.c Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Sat Feb 18 01:52:10 2017 (r313908) +++ head/sys/kern/uipc_mqueue.c Sat Feb 18 05:07:53 2017 (r313909) @@ -714,7 +714,9 @@ do_recycle(void *context, int pending __ { struct vnode *vp = (struct vnode *)context; + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); vrecycle(vp); + VOP_UNLOCK(vp, 0); vdrop(vp); } From owner-svn-src-head@freebsd.org Sat Feb 18 06:03:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B556CE41D4; Sat, 18 Feb 2017 06:03:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09A07311; Sat, 18 Feb 2017 06:03:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1I63Hdb032845; Sat, 18 Feb 2017 06:03:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1I63HW7032844; Sat, 18 Feb 2017 06:03:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702180603.v1I63HW7032844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 18 Feb 2017 06:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313910 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 06:03:18 -0000 Author: mav Date: Sat Feb 18 06:03:16 2017 New Revision: 313910 URL: https://svnweb.freebsd.org/changeset/base/313910 Log: Change XCOPY memory allocations. Before this change XCOPY code could allocate memory in chunks up to 16-32MB (VMware does XCOPY in 4MB chunks by default), that could be difficult for VM subsystem to do due to KVA fragmentation, that sometimes created huge allocation delays, blocking any I/O for respective LU for that time. This change limits allocations down to TPC_MAX_IO_SIZE, which is 1MB now. 1MB is also not a cookie, but ZFS also can do that for large blocks, so it should be less dramatic. As drawback this increases CPU overhead, but it still look acceptable comparing to time consumed by ZFS read/write. MFC after: 1 week Modified: head/sys/cam/ctl/ctl_tpc.c Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Sat Feb 18 05:07:53 2017 (r313909) +++ head/sys/cam/ctl/ctl_tpc.c Sat Feb 18 06:03:16 2017 (r313910) @@ -85,6 +85,7 @@ struct tpc_io { uint8_t target; uint32_t cscd; uint64_t lun; + uint8_t *buf; struct tpc_list *list; struct runl run; TAILQ_ENTRY(tpc_io) rlinks; @@ -127,7 +128,6 @@ struct tpc_list { off_t curbytes; int curops; int stage; - uint8_t *buf; off_t segsectors; off_t segbytes; int tbdio; @@ -813,9 +813,9 @@ tpc_process_b2b(struct tpc_list *list) while ((tior = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tior, links); ctl_free_io(tior->io); + free(tior->buf, M_CTL); free(tior, M_CTL); } - free(list->buf, M_CTL); if (list->abort) { ctl_set_task_aborted(list->ctsio); return (CTL_RETVAL_ERROR); @@ -874,7 +874,6 @@ tpc_process_b2b(struct tpc_list *list) return (CTL_RETVAL_ERROR); } - list->buf = malloc(numbytes, M_CTL, M_WAITOK); list->segbytes = numbytes; list->segsectors = numbytes / dstblock; donebytes = 0; @@ -894,11 +893,12 @@ tpc_process_b2b(struct tpc_list *list) tior = malloc(sizeof(*tior), M_CTL, M_WAITOK | M_ZERO); TAILQ_INIT(&tior->run); + tior->buf = malloc(roundbytes, M_CTL, M_WAITOK); tior->list = list; TAILQ_INSERT_TAIL(&list->allio, tior, links); tior->io = tpcl_alloc_io(); ctl_scsi_read_write(tior->io, - /*data_ptr*/ &list->buf[donebytes], + /*data_ptr*/ tior->buf, /*data_len*/ roundbytes, /*read_op*/ 1, /*byte2*/ 0, @@ -919,7 +919,7 @@ tpc_process_b2b(struct tpc_list *list) TAILQ_INSERT_TAIL(&list->allio, tiow, links); tiow->io = tpcl_alloc_io(); ctl_scsi_read_write(tiow->io, - /*data_ptr*/ &list->buf[donebytes], + /*data_ptr*/ tior->buf, /*data_len*/ roundbytes, /*read_op*/ 0, /*byte2*/ 0, @@ -1029,9 +1029,9 @@ tpc_process_register_key(struct tpc_list while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tio, links); ctl_free_io(tio->io); + free(tio->buf, M_CTL); free(tio, M_CTL); } - free(list->buf, M_CTL); if (list->abort) { ctl_set_task_aborted(list->ctsio); return (CTL_RETVAL_ERROR); @@ -1064,9 +1064,9 @@ tpc_process_register_key(struct tpc_list TAILQ_INSERT_TAIL(&list->allio, tio, links); tio->io = tpcl_alloc_io(); datalen = sizeof(struct scsi_per_res_out_parms); - list->buf = malloc(datalen, M_CTL, M_WAITOK); + tio->buf = malloc(datalen, M_CTL, M_WAITOK); ctl_scsi_persistent_res_out(tio->io, - list->buf, datalen, SPRO_REGISTER, -1, + tio->buf, datalen, SPRO_REGISTER, -1, scsi_8btou64(seg->res_key), scsi_8btou64(seg->sa_res_key), /*tag_type*/ CTL_TAG_SIMPLE, /*control*/ 0); tio->io->io_hdr.retries = 3; @@ -1166,9 +1166,9 @@ tpc_process_wut(struct tpc_list *list) while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tio, links); ctl_free_io(tio->io); + free(tio->buf, M_CTL); free(tio, M_CTL); } - free(list->buf, M_CTL); if (list->abort) { ctl_set_task_aborted(list->ctsio); return (CTL_RETVAL_ERROR); @@ -1233,8 +1233,6 @@ tpc_process_wut(struct tpc_list *list) return (CTL_RETVAL_ERROR); } - list->buf = malloc(numbytes, M_CTL, M_WAITOK | - (list->token == NULL ? M_ZERO : 0)); list->segbytes = numbytes; list->segsectors = numbytes / dstblock; //printf("Copy chunk of %ju sectors from %ju to %ju\n", list->segsectors, @@ -1257,11 +1255,12 @@ tpc_process_wut(struct tpc_list *list) tior = malloc(sizeof(*tior), M_CTL, M_WAITOK | M_ZERO); TAILQ_INIT(&tior->run); + tior->buf = malloc(roundbytes, M_CTL, M_WAITOK); tior->list = list; TAILQ_INSERT_TAIL(&list->allio, tior, links); tior->io = tpcl_alloc_io(); ctl_scsi_read_write(tior->io, - /*data_ptr*/ &list->buf[donebytes], + /*data_ptr*/ tior->buf, /*data_len*/ roundbytes, /*read_op*/ 1, /*byte2*/ 0, @@ -1280,7 +1279,7 @@ tpc_process_wut(struct tpc_list *list) TAILQ_INSERT_TAIL(&list->allio, tiow, links); tiow->io = tpcl_alloc_io(); ctl_scsi_read_write(tiow->io, - /*data_ptr*/ &list->buf[donebytes], + /*data_ptr*/ tior->buf, /*data_len*/ roundbytes, /*read_op*/ 0, /*byte2*/ 0, From owner-svn-src-head@freebsd.org Sat Feb 18 06:18:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D68ACE45DC; Sat, 18 Feb 2017 06:18:16 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE028BFA; Sat, 18 Feb 2017 06:18:15 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1I6IEaD036950; Sat, 18 Feb 2017 06:18:14 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1I6IEgU036949; Sat, 18 Feb 2017 06:18:14 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201702180618.v1I6IEgU036949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 18 Feb 2017 06:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313911 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 06:18:16 -0000 Author: loos Date: Sat Feb 18 06:18:14 2017 New Revision: 313911 URL: https://svnweb.freebsd.org/changeset/base/313911 Log: Spell VMXNET3_LEGACY_TX correctly. Obtained from: pfSense MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/vmware/vmxnet3/if_vmxvar.h Modified: head/sys/dev/vmware/vmxnet3/if_vmxvar.h ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmxvar.h Sat Feb 18 06:03:16 2017 (r313910) +++ head/sys/dev/vmware/vmxnet3/if_vmxvar.h Sat Feb 18 06:18:14 2017 (r313911) @@ -131,7 +131,7 @@ struct vmxnet3_txq_stats { struct vmxnet3_txqueue { struct mtx vxtxq_mtx; struct vmxnet3_softc *vxtxq_sc; -#ifndef VMXNET3_TX_LEGACY +#ifndef VMXNET3_LEGACY_TX struct buf_ring *vxtxq_br; #endif int vxtxq_id; @@ -142,7 +142,7 @@ struct vmxnet3_txqueue { struct vmxnet3_txq_stats vxtxq_stats; struct vmxnet3_txq_shared *vxtxq_ts; struct sysctl_oid_list *vxtxq_sysctl; -#ifndef VMXNET3_TX_LEGACY +#ifndef VMXNET3_LEGACY_TX struct task vxtxq_defrtask; #endif char vxtxq_name[16]; From owner-svn-src-head@freebsd.org Sat Feb 18 07:21:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E90DCE242B; Sat, 18 Feb 2017 07:21:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B6312E0; Sat, 18 Feb 2017 07:21:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1I7Lo2r064301; Sat, 18 Feb 2017 07:21:50 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1I7LoCa064299; Sat, 18 Feb 2017 07:21:50 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201702180721.v1I7LoCa064299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 18 Feb 2017 07:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313912 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 07:21:51 -0000 Author: dchagin Date: Sat Feb 18 07:21:50 2017 New Revision: 313912 URL: https://svnweb.freebsd.org/changeset/base/313912 Log: Finich r313684. Convert linux_recv(), linux_send() and linux_accept() system call arguments to the register_t type too. PR: 217161 MFC after: 3 days xMFC with: r313284,r313285,r313684 Modified: head/sys/compat/linux/linux_socket.c head/sys/compat/linux/linux_socket.h Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sat Feb 18 06:18:14 2017 (r313911) +++ head/sys/compat/linux/linux_socket.c Sat Feb 18 07:21:50 2017 (r313912) @@ -959,10 +959,10 @@ linux_socketpair(struct thread *td, stru #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) struct linux_send_args { - int s; - l_uintptr_t msg; - int len; - int flags; + register_t s; + register_t msg; + register_t len; + register_t flags; }; static int @@ -987,10 +987,10 @@ linux_send(struct thread *td, struct lin } struct linux_recv_args { - int s; - l_uintptr_t msg; - int len; - int flags; + register_t s; + register_t msg; + register_t len; + register_t flags; }; static int Modified: head/sys/compat/linux/linux_socket.h ============================================================================== --- head/sys/compat/linux/linux_socket.h Sat Feb 18 06:18:14 2017 (r313911) +++ head/sys/compat/linux/linux_socket.h Sat Feb 18 07:21:50 2017 (r313912) @@ -143,9 +143,9 @@ struct l_ucred { #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) struct linux_accept_args { - int s; - l_uintptr_t addr; - l_uintptr_t namelen; + register_t s; + register_t addr; + register_t namelen; }; int linux_accept(struct thread *td, struct linux_accept_args *args); From owner-svn-src-head@freebsd.org Sat Feb 18 09:39:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 414C0CE2BA4; Sat, 18 Feb 2017 09:39:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E4361EB6; Sat, 18 Feb 2017 09:39:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1I9dLfs019487; Sat, 18 Feb 2017 09:39:21 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1I9dL2o019485; Sat, 18 Feb 2017 09:39:21 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201702180939.v1I9dL2o019485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 18 Feb 2017 09:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313913 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 09:39:22 -0000 Author: dchagin Date: Sat Feb 18 09:39:20 2017 New Revision: 313913 URL: https://svnweb.freebsd.org/changeset/base/313913 Log: Initialize cap_rights before use. MFC after: 1 week Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sat Feb 18 07:21:50 2017 (r313912) +++ head/sys/compat/linux/linux_socket.c Sat Feb 18 09:39:20 2017 (r313913) @@ -843,7 +843,8 @@ linux_accept_common(struct thread *td, i if (error == EFAULT && namelen != sizeof(struct sockaddr_in)) return (EINVAL); if (error == EINVAL) { - error1 = getsock_cap(td, s, &rights, &fp, NULL, NULL); + error1 = getsock_cap(td, s, + cap_rights_init(&rights, CAP_ACCEPT), &fp, NULL, NULL); if (error1 != 0) return (error1); so = fp->f_data; From owner-svn-src-head@freebsd.org Sat Feb 18 10:01:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80F20CE31DA; Sat, 18 Feb 2017 10:01:18 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F8341A03; Sat, 18 Feb 2017 10:01:18 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1IA1HVV028556; Sat, 18 Feb 2017 10:01:17 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1IA1HuY028555; Sat, 18 Feb 2017 10:01:17 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201702181001.v1IA1HuY028555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 18 Feb 2017 10:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313914 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 10:01:18 -0000 Author: dchagin Date: Sat Feb 18 10:01:17 2017 New Revision: 313914 URL: https://svnweb.freebsd.org/changeset/base/313914 Log: Style(9), some XXX comments fix. No functional changes. MFC after: 1 week Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Sat Feb 18 09:39:20 2017 (r313913) +++ head/sys/compat/linux/linux_socket.c Sat Feb 18 10:01:17 2017 (r313914) @@ -505,7 +505,7 @@ linux_sa_put(struct osockaddr *osa) * not changed. */ error = copyin(osa, &sa, sizeof(sa.sa_family)); - if (error) + if (error != 0) return (error); bdom = bsd_to_linux_domain(sa.sa_family); @@ -613,7 +613,7 @@ linux_sendit(struct thread *td, int s, s if (mp->msg_name != NULL) { error = linux_getsockaddr(&to, mp->msg_name, mp->msg_namelen); - if (error) + if (error != 0) return (error); mp->msg_name = to; } else @@ -637,7 +637,7 @@ linux_check_hdrincl(struct thread *td, i size_val = sizeof(optval); error = kern_getsockopt(td, s, IPPROTO_IP, IP_HDRINCL, &optval, UIO_SYSSPACE, &size_val); - if (error) + if (error != 0) return (error); return (optval == 0); @@ -753,7 +753,7 @@ linux_bind(struct thread *td, struct lin error = linux_getsockaddr(&sa, PTRIN(args->name), args->namelen); - if (error) + if (error != 0) return (error); error = kern_bindat(td, AT_FDCWD, args->s, sa); @@ -775,7 +775,7 @@ linux_connect(struct thread *td, struct error = linux_getsockaddr(&sa, (struct osockaddr *)PTRIN(args->name), args->namelen); - if (error) + if (error != 0) return (error); error = kern_connectat(td, AT_FDCWD, args->s, sa); @@ -830,16 +830,15 @@ linux_accept_common(struct thread *td, i int error, error1; bsd_args.s = s; - /* XXX: */ bsd_args.name = (struct sockaddr * __restrict)PTRIN(addr); - bsd_args.anamelen = PTRIN(namelen);/* XXX */ + bsd_args.anamelen = PTRIN(namelen); bsd_args.flags = 0; error = linux_set_socket_flags(flags, &bsd_args.flags); if (error != 0) return (error); error = sys_accept4(td, &bsd_args); bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.name); - if (error) { + if (error != 0) { if (error == EFAULT && namelen != sizeof(struct sockaddr_in)) return (EINVAL); if (error == EINVAL) { @@ -858,7 +857,7 @@ linux_accept_common(struct thread *td, i } if (addr) error = linux_sa_put(PTRIN(addr)); - if (error) { + if (error != 0) { (void)kern_close(td, td->td_retval[0]); td->td_retval[0] = 0; } @@ -892,12 +891,11 @@ linux_getsockname(struct thread *td, str int error; bsd_args.fdes = args->s; - /* XXX: */ bsd_args.asa = (struct sockaddr * __restrict)PTRIN(args->addr); - bsd_args.alen = PTRIN(args->namelen); /* XXX */ + bsd_args.alen = PTRIN(args->namelen); error = sys_getsockname(td, &bsd_args); bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.asa); - if (error) + if (error != 0) return (error); return (linux_sa_put(PTRIN(args->addr))); } @@ -917,7 +915,7 @@ linux_getpeername(struct thread *td, str bsd_args.alen = (socklen_t *)PTRIN(args->namelen); error = sys_getpeername(td, &bsd_args); bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.asa); - if (error) + if (error != 0) return (error); return (linux_sa_put(PTRIN(args->addr))); } @@ -1414,12 +1412,12 @@ linux_recvmsg_common(struct thread *td, linux_cmsg->cmsg_len = LINUX_CMSG_LEN(datalen); error = copyout(linux_cmsg, outbuf, L_CMSG_HDRSZ); - if (error) + if (error != 0) goto bad; outbuf += L_CMSG_HDRSZ; error = copyout(data, outbuf, datalen); - if (error) + if (error != 0) goto bad; outbuf += LINUX_CMSG_ALIGN(datalen); @@ -1542,7 +1540,7 @@ linux_setsockopt(struct thread *td, stru case SO_SNDTIMEO: error = copyin(PTRIN(args->optval), &linux_tv, sizeof(linux_tv)); - if (error) + if (error != 0) return (error); tv.tv_sec = linux_tv.tv_sec; tv.tv_usec = linux_tv.tv_usec; @@ -1614,7 +1612,7 @@ linux_getsockopt(struct thread *td, stru tv_len = sizeof(tv); error = kern_getsockopt(td, args->s, bsd_args.level, name, &tv, UIO_SYSSPACE, &tv_len); - if (error) + if (error != 0) return (error); linux_tv.tv_sec = tv.tv_sec; linux_tv.tv_usec = tv.tv_usec; @@ -1628,7 +1626,7 @@ linux_getsockopt(struct thread *td, stru xulen = sizeof(xu); error = kern_getsockopt(td, args->s, bsd_args.level, name, &xu, UIO_SYSSPACE, &xulen); - if (error) + if (error != 0) return (error); /* * XXX Use 0 for pid as the FreeBSD does not cache peer pid. @@ -1643,7 +1641,7 @@ linux_getsockopt(struct thread *td, stru len = sizeof(newval); error = kern_getsockopt(td, args->s, bsd_args.level, name, &newval, UIO_SYSSPACE, &len); - if (error) + if (error != 0) return (error); newval = -SV_ABI_ERRNO(td->td_proc, newval); return (copyout(&newval, PTRIN(args->optval), len)); From owner-svn-src-head@freebsd.org Sat Feb 18 11:43:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23DC2CE4E08; Sat, 18 Feb 2017 11:43:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCF5818A2; Sat, 18 Feb 2017 11:43:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1IBhDxJ075094; Sat, 18 Feb 2017 11:43:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1IBhDvw075093; Sat, 18 Feb 2017 11:43:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201702181143.v1IBhDvw075093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 18 Feb 2017 11:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313915 - head/sbin/fsck X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 11:43:15 -0000 Author: trasz Date: Sat Feb 18 11:43:13 2017 New Revision: 313915 URL: https://svnweb.freebsd.org/changeset/base/313915 Log: Make fsck(8) default to "ufs", like eg mount(8) does. Approved by: imp Discussed with: kib MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9621 Modified: head/sbin/fsck/fsck.c Modified: head/sbin/fsck/fsck.c ============================================================================== --- head/sbin/fsck/fsck.c Sat Feb 18 10:01:17 2017 (r313914) +++ head/sbin/fsck/fsck.c Sat Feb 18 11:43:13 2017 (r313915) @@ -215,7 +215,7 @@ main(int argc, char *argv[]) if (vfstype == NULL) vfstype = getfstype(spec); if (vfstype == NULL) - errx(1, "Could not determine filesystem type"); + vfstype = "ufs"; type = vfstype; devcheck(spec); } else { From owner-svn-src-head@freebsd.org Sat Feb 18 12:18:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 068FCCE4DBE for ; Sat, 18 Feb 2017 12:18:15 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-76.reflexion.net [208.70.210.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA9F417D0 for ; Sat, 18 Feb 2017 12:18:14 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 18916 invoked from network); 18 Feb 2017 12:18:06 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 18 Feb 2017 12:18:06 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.30.0) with SMTP; Sat, 18 Feb 2017 07:18:06 -0500 (EST) Received: (qmail 24895 invoked from network); 18 Feb 2017 12:18:06 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 18 Feb 2017 12:18:06 -0000 Received: from [192.168.1.111] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id E5578EC7EC3; Sat, 18 Feb 2017 04:18:05 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r313268 - head/sys/kern [through -r313271 for atomic_fcmpset use and later: fails on PowerMac G5 "Quad Core"; -r313266 works] Message-Id: <2FD12B8F-2255-470A-98D4-2DCE9C7495F5@dsl-only.net> Date: Sat, 18 Feb 2017 04:18:05 -0800 Cc: Nathan Whitehorn To: mjg@freebsd.org, Justin Hibbits , svn-src-head@freebsd.org, FreeBSD PowerPC ML , FreeBSD Current X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 12:18:15 -0000 [Note: I experiment with clang based powerpc64 builds, reporting problems that I find. Justin is familiar with this, as is Nathan.] I tried to update the PowerMac G5 (a so-called "Quad Core") that I have access to from head -r312761 to -r313864 and ended up with random panics and hang ups in fairly short order after booting. Some approximate bisecting for the kernel lead to: (sometimes getting part way into a buildkernel attempt for a different version before a failure happens) -r313266: works (just before use of atomic_fcmpset) vs. -r313271: fails (last of the "use atomic_fcmpset" check-ins) (I did not try -r313268 through -r313270 as the use was gradually added.) So I'm currently running a -r313864 world with a -r313266 kernel. No kernel that I tried that was from before -r313266 had the problems. Any kernel that I tried that was from after -r313271 had the problems. Of course I did not try them all in other direction. :) === Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Sat Feb 18 18:24:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68D74CE4C9E; Sat, 18 Feb 2017 18:24:04 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3875511E9; Sat, 18 Feb 2017 18:24:04 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1IIO3A7039163; Sat, 18 Feb 2017 18:24:03 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1IIO3Te039162; Sat, 18 Feb 2017 18:24:03 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201702181824.v1IIO3Te039162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 18 Feb 2017 18:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313917 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 18:24:04 -0000 Author: ian Date: Sat Feb 18 18:24:03 2017 New Revision: 313917 URL: https://svnweb.freebsd.org/changeset/base/313917 Log: Change the naming of imx{5,6} gpio pins to exactly match the names used in the chip reference manuals: GPIOn_IOnn. Modified: head/sys/arm/freescale/imx/imx_gpio.c Modified: head/sys/arm/freescale/imx/imx_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpio.c Sat Feb 18 14:44:14 2017 (r313916) +++ head/sys/arm/freescale/imx/imx_gpio.c Sat Feb 18 18:24:03 2017 (r313917) @@ -727,7 +727,7 @@ imx51_gpio_attach(device_t dev) (READ4(sc, IMX_GPIO_OE_REG) & (1U << i)) ? GPIO_PIN_OUTPUT : GPIO_PIN_INPUT; snprintf(sc->gpio_pins[i].gp_name, GPIOMAXNAME, - "imx_gpio%d.%d", unit, i); + "GPIO%d_IO%02d", unit + 1, i); } #ifdef INTRNG From owner-svn-src-head@freebsd.org Sat Feb 18 18:27:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4B80CE4D3F; Sat, 18 Feb 2017 18:27:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1FF4135B; Sat, 18 Feb 2017 18:27:29 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1IIRSf6039318; Sat, 18 Feb 2017 18:27:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1IIRS38039317; Sat, 18 Feb 2017 18:27:28 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201702181827.v1IIRS38039317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 18 Feb 2017 18:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313918 - head/sys/dev/ffec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 18:27:30 -0000 Author: ian Date: Sat Feb 18 18:27:28 2017 New Revision: 313918 URL: https://svnweb.freebsd.org/changeset/base/313918 Log: Add definitions for the IEEE-1588 registers. Modified: head/sys/dev/ffec/if_ffecreg.h Modified: head/sys/dev/ffec/if_ffecreg.h ============================================================================== --- head/sys/dev/ffec/if_ffecreg.h Sat Feb 18 18:24:03 2017 (r313917) +++ head/sys/dev/ffec/if_ffecreg.h Sat Feb 18 18:27:28 2017 (r313918) @@ -186,6 +186,27 @@ __FBSDID("$FreeBSD$"); #define FEC_RACC_PADREM (1 << 0) /* + * IEEE-1588 timer registers + */ + +#define FEC_ATCR_REG 0x0400 +#define FEC_ATCR_SLAVE (1u << 13) +#define FEC_ATCR_CAPTURE (1u << 11) +#define FEC_ATCR_RESTART (1u << 9) +#define FEC_ATCR_PINPER (1u << 7) +#define FEC_ATCR_PEREN (1u << 4) +#define FEC_ATCR_OFFRST (1u << 3) +#define FEC_ATCR_OFFEN (1u << 2) +#define FEC_ATCR_EN (1u << 0) + +#define FEC_ATVR_REG 0x0404 +#define FEC_ATOFF_REG 0x0408 +#define FEC_ATPER_REG 0x040c +#define FEC_ATCOR_REG 0x0410 +#define FEC_ATINC_REG 0x0414 +#define FEC_ATSTMP_REG 0x0418 + +/* * Statistics registers */ #define FEC_RMON_T_DROP 0x200 From owner-svn-src-head@freebsd.org Sat Feb 18 18:31:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F8ACCE4F05; Sat, 18 Feb 2017 18:31:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6701B1702; Sat, 18 Feb 2017 18:31:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1IIVgQE042448; Sat, 18 Feb 2017 18:31:42 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1IIVgXr042447; Sat, 18 Feb 2017 18:31:42 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201702181831.v1IIVgXr042447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 18 Feb 2017 18:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313919 - head/sys/modules/dtb/imx6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 18:31:43 -0000 Author: ian Date: Sat Feb 18 18:31:42 2017 New Revision: 313919 URL: https://svnweb.freebsd.org/changeset/base/313919 Log: Add dtb files for Boundary Devices Nitrogen 6 family boards. FreeBSD runs on a nitrogen6x quad 2gb, and is expected to run on all the imx6 boards in the nitrogen6 family. Modified: head/sys/modules/dtb/imx6/Makefile Modified: head/sys/modules/dtb/imx6/Makefile ============================================================================== --- head/sys/modules/dtb/imx6/Makefile Sat Feb 18 18:27:28 2017 (r313918) +++ head/sys/modules/dtb/imx6/Makefile Sat Feb 18 18:31:42 2017 (r313919) @@ -5,6 +5,11 @@ DTS= \ imx6q-cubox-i.dts \ imx6dl-hummingboard.dts \ imx6q-hummingboard.dts \ + imx6dl-nitrogen6x.dts \ + imx6q-nitrogen6_max.dts \ + imx6q-nitrogen6x.dts \ + imx6qp-nitrogen6_max.dts \ + imx6sx-nitrogen6sx.dts \ imx6dl-riotboard.dts \ imx6dl-wandboard.dts \ imx6q-wandboard.dts From owner-svn-src-head@freebsd.org Sat Feb 18 18:57:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24AB4CE430D; Sat, 18 Feb 2017 18:57:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA3FF101C; Sat, 18 Feb 2017 18:57:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1IIvT2m051507; Sat, 18 Feb 2017 18:57:29 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1IIvTUJ051506; Sat, 18 Feb 2017 18:57:29 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201702181857.v1IIvTUJ051506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 18 Feb 2017 18:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313920 - head/sbin/kldload X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 18:57:31 -0000 Author: glebius Date: Sat Feb 18 18:57:29 2017 New Revision: 313920 URL: https://svnweb.freebsd.org/changeset/base/313920 Log: Fix the last case when kldload(8) wasn't printing the name of the module that failed to load. Modified: head/sbin/kldload/kldload.c Modified: head/sbin/kldload/kldload.c ============================================================================== --- head/sbin/kldload/kldload.c Sat Feb 18 18:31:42 2017 (r313919) +++ head/sbin/kldload/kldload.c Sat Feb 18 18:57:29 2017 (r313920) @@ -177,9 +177,9 @@ main(int argc, char** argv) break; case ENOEXEC: warnx("an error occurred while " - "loading the module. " + "loading module %s. " "Please check dmesg(8) for " - "more details."); + "more details.", argv[0]); break; default: warn("can't load %s", argv[0]); From owner-svn-src-head@freebsd.org Sat Feb 18 19:53:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 436CBCE52AD; Sat, 18 Feb 2017 19:53:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 130D9FE0; Sat, 18 Feb 2017 19:53:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1IJrctY079536; Sat, 18 Feb 2017 19:53:38 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1IJrc3k079535; Sat, 18 Feb 2017 19:53:38 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201702181953.v1IJrc3k079535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 18 Feb 2017 19:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313922 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 19:53:39 -0000 Author: ae Date: Sat Feb 18 19:53:37 2017 New Revision: 313922 URL: https://svnweb.freebsd.org/changeset/base/313922 Log: For translated packets do not adjust UDP checksum if it is zero. In case when decrypted and decapsulated packet is an UDP datagram, check that its checksum is not zero before doing incremental checksum adjustment. Reported by: Eugene Grosbein Tested by: Eugene Grosbein Modified: head/sys/netipsec/udpencap.c Modified: head/sys/netipsec/udpencap.c ============================================================================== --- head/sys/netipsec/udpencap.c Sat Feb 18 19:19:08 2017 (r313921) +++ head/sys/netipsec/udpencap.c Sat Feb 18 19:53:37 2017 (r313922) @@ -266,6 +266,9 @@ udp_ipsec_adjust_cksum(struct mbuf *m, s /* Incrementally recompute. */ m_copydata(m, skip + off, sizeof(cksum), (caddr_t)&cksum); + /* Do not adjust UDP checksum if it is zero. */ + if (proto == IPPROTO_UDP && cksum == 0) + return; cksum = in_addword(cksum, sav->natt->cksum); } else { /* No OA from IKEd. */ From owner-svn-src-head@freebsd.org Sat Feb 18 20:49:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2767CE31C2 for ; Sat, 18 Feb 2017 20:49:33 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-75.reflexion.net [208.70.210.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91B85C92 for ; Sat, 18 Feb 2017 20:49:32 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 26631 invoked from network); 18 Feb 2017 20:49:31 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 18 Feb 2017 20:49:31 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.30.0) with SMTP; Sat, 18 Feb 2017 15:49:31 -0500 (EST) Received: (qmail 11745 invoked from network); 18 Feb 2017 20:49:31 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 18 Feb 2017 20:49:31 -0000 Received: from [192.168.1.111] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 59599EC807D; Sat, 18 Feb 2017 12:49:30 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r313268 - head/sys/kern [through -r313271 for atomic_fcmpset use and later: fails on PowerMac G5 "Quad Core"; -r313266 works] From: Mark Millard In-Reply-To: <2FD12B8F-2255-470A-98D4-2DCE9C7495F5@dsl-only.net> Date: Sat, 18 Feb 2017 12:49:29 -0800 Cc: svn-src-head@freebsd.org, FreeBSD PowerPC ML , FreeBSD Current Content-Transfer-Encoding: 7bit Message-Id: References: <2FD12B8F-2255-470A-98D4-2DCE9C7495F5@dsl-only.net> To: mjg@freebsd.org, Justin Hibbits X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 20:49:34 -0000 On 2017-Feb-18, at 4:18 AM, Mark Millard wrote: > [Note: I experiment with clang based powerpc64 builds, > reporting problems that I find. Justin is familiar > with this, as is Nathan.] > > I tried to update the PowerMac G5 (a so-called "Quad Core") > that I have access to from head -r312761 to -r313864 and > ended up with random panics and hang ups in fairly short > order after booting. > > Some approximate bisecting for the kernel lead to: > (sometimes getting part way into a buildkernel attempt > for a different version before a failure happens) > > -r313266: works (just before use of atomic_fcmpset) > vs. > -r313271: fails (last of the "use atomic_fcmpset" check-ins) > > (I did not try -r313268 through -r313270 as the use was > gradually added.) > > So I'm currently running a -r313864 world with a -r313266 > kernel. > > No kernel that I tried that was from before -r313266 had the > problems. > > Any kernel that I tried that was from after -r313271 had the > problems. > > Of course I did not try them all in other direction. :) [Of course: "either direction".] I'll note that the -r313864 buildworld was without MALLOC_PRODUCTION being defined. (Unusual for me but I'm testing if a jemalloc assert problem on arm64 also happens on powerpc64.) By contrast the buildkernels were production style (as is normal for me unless I'm trying to track something down that I think might be exposed by the extra checks). === Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Sat Feb 18 20:58:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95D28CE35D2; Sat, 18 Feb 2017 20:58:32 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lf0-x241.google.com (mail-lf0-x241.google.com [IPv6:2a00:1450:4010:c07::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16A56119D; Sat, 18 Feb 2017 20:58:32 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lf0-x241.google.com with SMTP id z134so42630lff.3; Sat, 18 Feb 2017 12:58:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rt53Xsm9IestMXEo0DfjcrGdtqEWo922J6ohJKIDsgc=; b=sm7ajQQRNNj+ZgR+fPvubXlunyxKdqMPmjTdVGCuk/J/bibQbkLUZmo2qkh174+f/V wDILeiTQ0w/urSGz2b2/GRL+waooWk3trHQKBwegD+daupxhpAewTajfG08umMagrKNM G07AKM4bhqlpdQeYC1d/kg1F4EHGZfmJZDovlZIsOUOMHX4P5aKiLn2Err73Y8yf50YG vFL+lm/YFYCmqAA8wV+P41X2E20k3v9if6vPvugQoQmveNeTUXrFHrCbPICJ5N+Lmnum 9cvj+Klpmcc8F9aWcwYk004ORN4V6Q476WsFvSy/V6CbbErttmKGYjYjXTJXyhCnORHy MLYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=rt53Xsm9IestMXEo0DfjcrGdtqEWo922J6ohJKIDsgc=; b=ApAzPdsUHnl3CUtVzeo37+MUdcof8SkH/+15WDfRQEtJzJKD2+2wlwpEyWmdLheVve 1oy0P0puuBmQPxWV2IT5x4JaqMwvwIpvbHpFWkati9/nAlSmFo1SnW0zjuxx2NO0LXJ6 sK0hifC54wcT39dyhamAdh2ViG90j6penp4YhURAPqMde//XhPOgHcvPN2ys6TfsZWWm o97b6g0XyW7qB6EcDve+EOzp5M3XqCQdPO8Jurx4UQbEFd09R3C4nqNsOA21J8mAflDx 4pGy9YrMRmV4OsAky5mo2tBEjKT8HB8Tqi2jBmOl1kJ/RpSldHl39U91d1hIE0E+oaC5 2QtQ== X-Gm-Message-State: AMke39kEFb/GoCSJkNPJcTS2XaT6t10c1ZAjdPaIz/FvKskp+LpfyfTkIMQ6f0Hi1VLkEA== X-Received: by 10.25.153.69 with SMTP id b66mr2789241lfe.85.1487451509645; Sat, 18 Feb 2017 12:58:29 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id a71sm3776775lfe.36.2017.02.18.12.58.28 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sat, 18 Feb 2017 12:58:29 -0800 (PST) Date: Sat, 18 Feb 2017 21:58:25 +0100 From: Mateusz Guzik To: Mark Millard Cc: mjg@freebsd.org, Justin Hibbits , svn-src-head@freebsd.org, FreeBSD PowerPC ML , FreeBSD Current Subject: Re: svn commit: r313268 - head/sys/kern [through -r313271 for atomic_fcmpset use and later: fails on PowerMac G5 "Quad Core"; -r313266 works] Message-ID: <20170218205825.GA24384@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , Mark Millard , mjg@freebsd.org, Justin Hibbits , svn-src-head@freebsd.org, FreeBSD PowerPC ML , FreeBSD Current References: <2FD12B8F-2255-470A-98D4-2DCE9C7495F5@dsl-only.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 20:58:32 -0000 On Sat, Feb 18, 2017 at 12:49:29PM -0800, Mark Millard wrote: > On 2017-Feb-18, at 4:18 AM, Mark Millard wrote: > > > [Note: I experiment with clang based powerpc64 builds, > > reporting problems that I find. Justin is familiar > > with this, as is Nathan.] > > > > I tried to update the PowerMac G5 (a so-called "Quad Core") > > that I have access to from head -r312761 to -r313864 and > > ended up with random panics and hang ups in fairly short > > order after booting. > > > > Some approximate bisecting for the kernel lead to: > > (sometimes getting part way into a buildkernel attempt > > for a different version before a failure happens) > > > > -r313266: works (just before use of atomic_fcmpset) > > vs. > > -r313271: fails (last of the "use atomic_fcmpset" check-ins) > > > > (I did not try -r313268 through -r313270 as the use was > > gradually added.) > > > > So I'm currently running a -r313864 world with a -r313266 > > kernel. > > > > No kernel that I tried that was from before -r313266 had the > > problems. > > > > Any kernel that I tried that was from after -r313271 had the > > problems. > > > > Of course I did not try them all in other direction. :) > > [Of course: "either direction".] > > I'll note that the -r313864 buildworld was without > MALLOC_PRODUCTION being defined. (Unusual for me but > I'm testing if a jemalloc assert problem on arm64 > also happens on powerpc64.) > > By contrast the buildkernels were production style > (as is normal for me unless I'm trying to track > something down that I think might be exposed by > the extra checks). > Well either the primitive itself is buggy or the somewhat (now) unusual condition of not providing the failed value (but possibly a stale one) is not handled correctly in locking code. That said, I would start with putting barriers "on both sides" of powerpc's fcmpset for debugging purposes and if the problem persists I can add some debugs to locking priitmives. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Feb 18 21:08:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2E6CCE390B; Sat, 18 Feb 2017 21:08:10 +0000 (UTC) (envelope-from mmokhi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FE64177A; Sat, 18 Feb 2017 21:08:10 +0000 (UTC) (envelope-from mmokhi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1IL89Dg009307; Sat, 18 Feb 2017 21:08:09 GMT (envelope-from mmokhi@FreeBSD.org) Received: (from mmokhi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1IL89eE009306; Sat, 18 Feb 2017 21:08:09 GMT (envelope-from mmokhi@FreeBSD.org) Message-Id: <201702182108.v1IL89eE009306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmokhi set sender to mmokhi@FreeBSD.org using -f From: Mahdi Mokhtari Date: Sat, 18 Feb 2017 21:08:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313923 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 21:08:10 -0000 Author: mmokhi (ports committer) Date: Sat Feb 18 21:08:09 2017 New Revision: 313923 URL: https://svnweb.freebsd.org/changeset/base/313923 Log: Add new catrigl.c (r313761) APIs to include/complex.h Reviewed by: bde, emaste Approved by: bde, emaste (src committers) Differential Revision: https://reviews.freebsd.org/D9615 Modified: head/include/complex.h Modified: head/include/complex.h ============================================================================== --- head/include/complex.h Sat Feb 18 19:53:37 2017 (r313922) +++ head/include/complex.h Sat Feb 18 21:08:09 2017 (r313923) @@ -67,6 +67,10 @@ double complex cacos(double complex); float complex cacosf(float complex); double complex cacosh(double complex); float complex cacoshf(float complex); +long double complex + cacoshl(long double complex); +long double complex + cacosl(long double complex); double carg(double complex); float cargf(float complex); long double cargl(long double complex); @@ -74,10 +78,18 @@ double complex casin(double complex); float complex casinf(float complex); double complex casinh(double complex); float complex casinhf(float complex); +long double complex + casinhl(long double complex); +long double complex + casinl(long double complex); double complex catan(double complex); float complex catanf(float complex); double complex catanh(double complex); float complex catanhf(float complex); +long double complex + catanhl(long double complex); +long double complex + catanl(long double complex); double complex ccos(double complex); float complex ccosf(float complex); double complex ccosh(double complex); From owner-svn-src-head@freebsd.org Sat Feb 18 21:41:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 958CECE45FE; Sat, 18 Feb 2017 21:41:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6269310A1; Sat, 18 Feb 2017 21:41:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1ILfotS023209; Sat, 18 Feb 2017 21:41:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1ILfo9e023208; Sat, 18 Feb 2017 21:41:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702182141.v1ILfo9e023208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 18 Feb 2017 21:41:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313924 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 21:41:51 -0000 Author: ngie Date: Sat Feb 18 21:41:50 2017 New Revision: 313924 URL: https://svnweb.freebsd.org/changeset/base/313924 Log: Quote path to doxygen/kyua in test(1) -x check This is a basic stopgap against ${LOCALBASE} containing spaces in it MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Feb 18 21:08:09 2017 (r313923) +++ head/Makefile.inc1 Sat Feb 18 21:41:50 2017 (r313924) @@ -1499,7 +1499,7 @@ sign-packages: _pkgbootstrap .PHONY # Run test suite on installed world. # checkworld: .PHONY - @if [ ! -x ${LOCALBASE}/bin/kyua ]; then \ + @if [ ! -x "${LOCALBASE}/bin/kyua" ]; then \ echo "You need kyua (devel/kyua) to run the test suite." | /usr/bin/fmt; \ exit 1; \ fi @@ -1512,7 +1512,7 @@ checkworld: .PHONY # Build the API documentation with doxygen # doxygen: .PHONY - @if [ ! -x ${LOCALBASE}/bin/doxygen ]; then \ + @if [ ! -x "${LOCALBASE}/bin/doxygen" ]; then \ echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \ exit 1; \ fi From owner-svn-src-head@freebsd.org Sat Feb 18 21:47:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70481CE484F; Sat, 18 Feb 2017 21:47:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32BB513D9; Sat, 18 Feb 2017 21:47:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1ILlWr7025542; Sat, 18 Feb 2017 21:47:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1ILlWHI025541; Sat, 18 Feb 2017 21:47:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201702182147.v1ILlWHI025541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 18 Feb 2017 21:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313925 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 21:47:33 -0000 Author: ngie Date: Sat Feb 18 21:47:32 2017 New Revision: 313925 URL: https://svnweb.freebsd.org/changeset/base/313925 Log: Include ${LOCALBASE}/bin in $PATH when running "make checkworld" Some of the tests in devel/atf // devel/kyua rely on the tools being in $PATH, which means that the tests fail when run via "make checkworld" because $PATH is restricted to exclude directory elements like "${LOCALBASE}/bin". MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Feb 18 21:41:50 2017 (r313924) +++ head/Makefile.inc1 Sat Feb 18 21:47:32 2017 (r313925) @@ -1503,7 +1503,7 @@ checkworld: .PHONY echo "You need kyua (devel/kyua) to run the test suite." | /usr/bin/fmt; \ exit 1; \ fi - ${_+_}${LOCALBASE}/bin/kyua test -k ${TESTSBASE}/Kyuafile + ${_+_}PATH="$$PATH:${LOCALBASE}/bin" kyua test -k ${TESTSBASE}/Kyuafile # # From owner-svn-src-head@freebsd.org Sat Feb 18 21:58:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1443CE4AEE for ; Sat, 18 Feb 2017 21:58:58 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-72.reflexion.net [208.70.210.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F3E91A8C for ; Sat, 18 Feb 2017 21:58:57 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 29685 invoked from network); 18 Feb 2017 21:58:51 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 18 Feb 2017 21:58:51 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.30.0) with SMTP; Sat, 18 Feb 2017 16:58:51 -0500 (EST) Received: (qmail 6976 invoked from network); 18 Feb 2017 21:58:51 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 18 Feb 2017 21:58:51 -0000 Received: from [192.168.1.111] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 719EDEC8AB7; Sat, 18 Feb 2017 13:58:50 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r313268 - head/sys/kern [through -r313271 for atomic_fcmpset use and later: fails on PowerMac G5 "Quad Core"; -r313266 works] From: Mark Millard In-Reply-To: <20170218205825.GA24384@dft-labs.eu> Date: Sat, 18 Feb 2017 13:58:49 -0800 Cc: mjg@freebsd.org, Justin Hibbits , svn-src-head@freebsd.org, FreeBSD PowerPC ML , FreeBSD Current Content-Transfer-Encoding: 7bit Message-Id: References: <2FD12B8F-2255-470A-98D4-2DCE9C7495F5@dsl-only.net> <20170218205825.GA24384@dft-labs.eu> To: Mateusz Guzik X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 21:58:59 -0000 On 2017-Feb-18, at 12:58 PM, Mateusz Guzik wrote: > On Sat, Feb 18, 2017 at 12:49:29PM -0800, Mark Millard wrote: >> On 2017-Feb-18, at 4:18 AM, Mark Millard wrote: >> >>> [Note: I experiment with clang based powerpc64 builds, >>> reporting problems that I find. Justin is familiar >>> with this, as is Nathan.] >>> >>> I tried to update the PowerMac G5 (a so-called "Quad Core") >>> that I have access to from head -r312761 to -r313864 and >>> ended up with random panics and hang ups in fairly short >>> order after booting. >>> >>> Some approximate bisecting for the kernel lead to: >>> (sometimes getting part way into a buildkernel attempt >>> for a different version before a failure happens) >>> >>> -r313266: works (just before use of atomic_fcmpset) >>> vs. >>> -r313271: fails (last of the "use atomic_fcmpset" check-ins) >>> >>> (I did not try -r313268 through -r313270 as the use was >>> gradually added.) >>> >>> So I'm currently running a -r313864 world with a -r313266 >>> kernel. >>> >>> No kernel that I tried that was from before -r313266 had the >>> problems. >>> >>> Any kernel that I tried that was from after -r313271 had the >>> problems. >>> >>> Of course I did not try them all in other direction. :) >> >> [Of course: "either direction".] >> >> I'll note that the -r313864 buildworld was without >> MALLOC_PRODUCTION being defined. (Unusual for me but >> I'm testing if a jemalloc assert problem on arm64 >> also happens on powerpc64.) >> >> By contrast the buildkernels were production style >> (as is normal for me unless I'm trying to track >> something down that I think might be exposed by >> the extra checks). >> > > Well either the primitive itself is buggy or the somewhat (now) unusual > condition of not providing the failed value (but possibly a stale one) > is not handled correctly in locking code. > > That said, I would start with putting barriers "on both sides" of > powerpc's fcmpset for debugging purposes and if the problem persists I > can add some debugs to locking priitmives. > > -- > Mateusz Guzik I currently have the only powerpc64 that I have access to for now doing a test that will likely finish tonight sometime (if it has no problems). Also I'm not so familiar with powerpc64 details as to be able insert proper barriers and the like off the top of my head: It is more of a research subject for me. Side note: It looks like contexts like __rw_wlock_hard(c,v,tid,file,line) now needs the caller to do an equivalent of: __rw_wlock_hard(c,RW_READ_VALUE(rwlock2rw(c)),file,line) in order for the code behavior to match the old behavior that was based on the original local-v's initialization before v was used: rw = rwlock2rw(c); v = RW_READ_VALUE(rw); /* this line no longer exists */ This means that checking for equivalence is no longer local to the routine but involves checking all the usage of the routine. I've not done such so for all I know such usage is always in place: This is not a claim of a problem. The other routines in kern_rwlock.c still have local variables and the original initializations. I just thought that this was interesting. I've not looked at other files yet. === Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Sat Feb 18 22:06:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59EE3CE4F4D; Sat, 18 Feb 2017 22:06:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31CBF6BE; Sat, 18 Feb 2017 22:06:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1IM64CL034229; Sat, 18 Feb 2017 22:06:04 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1IM64it034226; Sat, 18 Feb 2017 22:06:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702182206.v1IM64it034226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 18 Feb 2017 22:06:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313928 - 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 22:06:05 -0000 Author: mjg Date: Sat Feb 18 22:06:03 2017 New Revision: 313928 URL: https://svnweb.freebsd.org/changeset/base/313928 Log: locks: clean up trylock primitives In particular thius reduces accesses of the lock itself. Modified: head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sat Feb 18 21:59:19 2017 (r313927) +++ head/sys/kern/kern_mutex.c Sat Feb 18 22:06:03 2017 (r313928) @@ -374,13 +374,18 @@ int _mtx_trylock_flags_(volatile uintptr_t *c, int opts, const char *file, int line) { struct mtx *m; + struct thread *td; + uintptr_t tid, v; #ifdef LOCK_PROFILING uint64_t waittime = 0; int contested = 0; #endif int rval; + bool recursed; - if (SCHEDULER_STOPPED()) + td = curthread; + tid = (uintptr_t)td; + if (SCHEDULER_STOPPED_TD(td)) return (1); m = mtxlock2mtx(c); @@ -394,13 +399,21 @@ _mtx_trylock_flags_(volatile uintptr_t * ("mtx_trylock() of spin mutex %s @ %s:%d", m->lock_object.lo_name, file, line)); - if (mtx_owned(m) && ((m->lock_object.lo_flags & LO_RECURSABLE) != 0 || - (opts & MTX_RECURSE) != 0)) { - m->mtx_recurse++; - atomic_set_ptr(&m->mtx_lock, MTX_RECURSED); - rval = 1; - } else - rval = _mtx_obtain_lock(m, (uintptr_t)curthread); + rval = 1; + recursed = false; + v = MTX_UNOWNED; + if (!_mtx_obtain_lock_fetch(m, &v, tid)) { + if (v == tid && + ((m->lock_object.lo_flags & LO_RECURSABLE) != 0 || + (opts & MTX_RECURSE) != 0)) { + m->mtx_recurse++; + atomic_set_ptr(&m->mtx_lock, MTX_RECURSED); + recursed = true; + } else { + rval = 0; + } + } + opts &= ~MTX_RECURSE; LOCK_LOG_TRY("LOCK", &m->lock_object, opts, rval, file, line); @@ -408,10 +421,9 @@ _mtx_trylock_flags_(volatile uintptr_t * WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE | LOP_TRYLOCK, file, line); TD_LOCKS_INC(curthread); - if (m->mtx_recurse == 0) + if (!recursed) LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(adaptive__acquire, m, contested, waittime, file, line); - } return (rval); Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sat Feb 18 21:59:19 2017 (r313927) +++ head/sys/kern/kern_rwlock.c Sat Feb 18 22:06:03 2017 (r313928) @@ -293,9 +293,14 @@ int __rw_try_wlock(volatile uintptr_t *c, const char *file, int line) { struct rwlock *rw; + struct thread *td; + uintptr_t tid, v; int rval; + bool recursed; - if (SCHEDULER_STOPPED()) + td = curthread; + tid = (uintptr_t)td; + if (SCHEDULER_STOPPED_TD(td)) return (1); rw = rwlock2rw(c); @@ -306,20 +311,23 @@ __rw_try_wlock(volatile uintptr_t *c, co KASSERT(rw->rw_lock != RW_DESTROYED, ("rw_try_wlock() of destroyed rwlock @ %s:%d", file, line)); - if (rw_wlocked(rw) && - (rw->lock_object.lo_flags & LO_RECURSABLE) != 0) { - rw->rw_recurse++; - atomic_set_ptr(&rw->rw_lock, RW_LOCK_WRITER_RECURSED); - rval = 1; - } else - rval = atomic_cmpset_acq_ptr(&rw->rw_lock, RW_UNLOCKED, - (uintptr_t)curthread); + rval = 1; + recursed = false; + v = RW_UNLOCKED; + if (!atomic_fcmpset_acq_ptr(&rw->rw_lock, &v, tid)) { + if (v == tid && (rw->lock_object.lo_flags & LO_RECURSABLE)) { + rw->rw_recurse++; + atomic_set_ptr(&rw->rw_lock, RW_LOCK_WRITER_RECURSED); + } else { + rval = 0; + } + } LOCK_LOG_TRY("WLOCK", &rw->lock_object, 0, rval, file, line); if (rval) { WITNESS_LOCK(&rw->lock_object, LOP_EXCLUSIVE | LOP_TRYLOCK, file, line); - if (!rw_recursed(rw)) + if (!recursed) LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire, rw, 0, 0, file, line, LOCKSTAT_WRITER); TD_LOCKS_INC(curthread); @@ -637,13 +645,13 @@ __rw_try_rlock(volatile uintptr_t *c, co ("rw_try_rlock() by idle thread %p on rwlock %s @ %s:%d", curthread, rw->lock_object.lo_name, file, line)); + x = rw->rw_lock; for (;;) { - x = rw->rw_lock; KASSERT(rw->rw_lock != RW_DESTROYED, ("rw_try_rlock() of destroyed rwlock @ %s:%d", file, line)); if (!(x & RW_LOCK_READ)) break; - if (atomic_cmpset_acq_ptr(&rw->rw_lock, x, x + RW_ONE_READER)) { + if (atomic_fcmpset_acq_ptr(&rw->rw_lock, &x, x + RW_ONE_READER)) { LOCK_LOG_TRY("RLOCK", &rw->lock_object, 0, 1, file, line); WITNESS_LOCK(&rw->lock_object, LOP_TRYLOCK, file, line); Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sat Feb 18 21:59:19 2017 (r313927) +++ head/sys/kern/kern_sx.c Sat Feb 18 22:06:03 2017 (r313928) @@ -269,13 +269,13 @@ sx_try_slock_(struct sx *sx, const char ("sx_try_slock() by idle thread %p on sx %s @ %s:%d", curthread, sx->lock_object.lo_name, file, line)); + x = sx->sx_lock; for (;;) { - x = sx->sx_lock; KASSERT(x != SX_LOCK_DESTROYED, ("sx_try_slock() of destroyed sx @ %s:%d", file, line)); if (!(x & SX_LOCK_SHARED)) break; - if (atomic_cmpset_acq_ptr(&sx->sx_lock, x, x + SX_ONE_SHARER)) { + if (atomic_fcmpset_acq_ptr(&sx->sx_lock, &x, x + SX_ONE_SHARER)) { LOCK_LOG_TRY("SLOCK", &sx->lock_object, 0, 1, file, line); WITNESS_LOCK(&sx->lock_object, LOP_TRYLOCK, file, line); LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, @@ -322,9 +322,14 @@ _sx_xlock(struct sx *sx, int opts, const int sx_try_xlock_(struct sx *sx, const char *file, int line) { + struct thread *td; + uintptr_t tid, x; int rval; + bool recursed; - if (SCHEDULER_STOPPED()) + td = curthread; + tid = (uintptr_t)td; + if (SCHEDULER_STOPPED_TD(td)) return (1); KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread), @@ -333,19 +338,23 @@ sx_try_xlock_(struct sx *sx, const char KASSERT(sx->sx_lock != SX_LOCK_DESTROYED, ("sx_try_xlock() of destroyed sx @ %s:%d", file, line)); - if (sx_xlocked(sx) && - (sx->lock_object.lo_flags & LO_RECURSABLE) != 0) { - sx->sx_recurse++; - atomic_set_ptr(&sx->sx_lock, SX_LOCK_RECURSED); - rval = 1; - } else - rval = atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, - (uintptr_t)curthread); + rval = 1; + recursed = false; + x = SX_LOCK_UNLOCKED; + if (!atomic_fcmpset_acq_ptr(&sx->sx_lock, &x, tid)) { + if (x == tid && (sx->lock_object.lo_flags & LO_RECURSABLE)) { + sx->sx_recurse++; + atomic_set_ptr(&sx->sx_lock, SX_LOCK_RECURSED); + } else { + rval = 0; + } + } + LOCK_LOG_TRY("XLOCK", &sx->lock_object, 0, rval, file, line); if (rval) { WITNESS_LOCK(&sx->lock_object, LOP_EXCLUSIVE | LOP_TRYLOCK, file, line); - if (!sx_recursed(sx)) + if (!recursed) LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, sx, 0, 0, file, line, LOCKSTAT_WRITER); TD_LOCKS_INC(curthread); From owner-svn-src-head@freebsd.org Sat Feb 18 22:59:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B81E3CE5A0B; Sat, 18 Feb 2017 22:59:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E12E1D87; Sat, 18 Feb 2017 22:59:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr0-x243.google.com with SMTP id q39so8557367wrb.2; Sat, 18 Feb 2017 14:59:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Xws76ODFOvxKhlWJVz2K0OnEKHYLRgsxuNXguUb3WaU=; b=riyFnzfzL2hULu2rgp9kiOP8/ODJC0CscYOz6boRBhc7YTiCzbfT/gYWSXdJnwNTpa A0oGw2dDiAggdJY+4oHzTG94g7io78mUzECG/UJ1ZL6F2qfg2uDynQaEneddT2e1VHBm 68dVhn4GfALV1LNtmTUAlSvdXkTgdF/HuvXN5VWioxIiRznwjq2WTJ0ZbNwXAZuj43R4 FpeXxlPI0/6jLg4Zn5eJRSFkpW2h8OaAJ0wpOkGfaSqQ55lZsLAWdX5VVk8uY4epDzf7 P0ZZhCXCbqLdmXsdDTGeMFJtwrv0mnRMic1fud9aLniSGSx7abcT63/X6e/vsrg0KNmE N4+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=Xws76ODFOvxKhlWJVz2K0OnEKHYLRgsxuNXguUb3WaU=; b=ZYZkV5dvokkN8SagGQefpl88qDgkoKDxFjIGbuephdjzSFfbBb0znS7zM0yl7H6clQ vuad3HCQ+KFp+0ftZ1LBtrSLq5CAZg7xBXihL6acX+JG1VMdb8gAJIjX2Te1JVXpNuhR 4vzaMgp6gVDnuZ20Ahv/LjKmSyLoyMIDvSrMUl7lQnd3o3JVV5u7G/ZYiwLzrl4litue 3sneRqBSgh6PKzqOKwGLZK00vRkDMKOdri9IiUAt6+oyX4yhilD+BsElSz0yJdMGThub M95arM8vknY8KHiJcHbf5HIcEClGMeIrHtex+QmET8k4R9E7MLzPgv3P2EKnxMzyV84n DLzg== X-Gm-Message-State: AMke39kfIPZ9h9w6lzdieIkiOt5xOUEYiDWc/Pn0qMGVwa+hbC/o5NfvWJdgvRcrRnNnBA== X-Received: by 10.223.150.110 with SMTP id c43mr4244778wra.5.1487458783727; Sat, 18 Feb 2017 14:59:43 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id 40sm18541534wry.22.2017.02.18.14.59.42 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sat, 18 Feb 2017 14:59:42 -0800 (PST) Date: Sat, 18 Feb 2017 23:59:40 +0100 From: Mateusz Guzik To: Mark Millard Cc: mjg@freebsd.org, Justin Hibbits , svn-src-head@freebsd.org, FreeBSD PowerPC ML , FreeBSD Current Subject: Re: svn commit: r313268 - head/sys/kern [through -r313271 for atomic_fcmpset use and later: fails on PowerMac G5 "Quad Core"; -r313266 works] Message-ID: <20170218225940.GB24384@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , Mark Millard , mjg@freebsd.org, Justin Hibbits , svn-src-head@freebsd.org, FreeBSD PowerPC ML , FreeBSD Current References: <2FD12B8F-2255-470A-98D4-2DCE9C7495F5@dsl-only.net> <20170218205825.GA24384@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2017 22:59:46 -0000 On Sat, Feb 18, 2017 at 01:58:49PM -0800, Mark Millard wrote: > On 2017-Feb-18, at 12:58 PM, Mateusz Guzik wrote: > > Well either the primitive itself is buggy or the somewhat (now) unusual > > condition of not providing the failed value (but possibly a stale one) > > is not handled correctly in locking code. > > > > That said, I would start with putting barriers "on both sides" of > > powerpc's fcmpset for debugging purposes and if the problem persists I > > can add some debugs to locking priitmives. > > > > I currently have the only powerpc64 that I have access > to for now doing a test that will likely finish tonight > sometime (if it has no problems). > > Also I'm not so familiar with powerpc64 details as to be > able insert proper barriers and the like off the top of > my head: It is more of a research subject for me. > This was a suggestion to jhibbits@. Looking at the code it is not hard to slap them in for testing purposes, or maybe there is an "obvious now that I look at it" braino in there, or maybe he has a better idea. Now that I wrote it I can get myself access to powerpc boxes. While I wont be able to run bsd on them, I can hack around in userapce and see. That's unless jhibbits@ steps in. I have no clue about ppc. > It looks like contexts like __rw_wlock_hard(c,v,tid,file,line) > now needs the caller to do an equivalent of: > > __rw_wlock_hard(c,RW_READ_VALUE(rwlock2rw(c)),file,line) > > in order for the code behavior to match the old behavior > that was based on the original local-v's initialization > before v was used: > > rw = rwlock2rw(c); > v = RW_READ_VALUE(rw); /* this line no longer exists */ > > This means that checking for equivalence is no longer > local to the routine but involves checking all the > usage of the routine. > Not reading the argument locally was the entire point of introducing fcmpset. Otherwise the 'v' argument would be a waste of time. Some primitives can attempt grabbing the lock and if they fail, we have the lock value to work with (e.g. check who owns the lock and see if they are running). In particular amd64 will give us the value it found. An explicit read requires whoever owns the cachelilne to lose the exclusive ownership and if the lock is contended (multiple cpus doing fcmpset), this makes the cachelilne ping-pong between cores. This destroys performance especially on systems with many cores and especially so with multiple numa nodes. Other primitives don't have inline variants. This concerns read-write locks which try to: retry: r = lock_value(lock); if (!locked(r)) { if (!cmpset(lock, r, r + ONE_READER)) goto retry; } That is, if multiple cpus try to get the lock for reading, one will fail and willl lbe forced to compute the new value to be set. The longer the time between attempts the more likely it is other core showed up trying to do the same thing with the same value, causing another failed attempt. So here there are no inlilnes so that the time is shorter and fcmpset alllows NOT reading the lock value explicitely - it was already provided by hardware. Note this is still significantly slower than it has to be in principle - the lock can 'blilndly increment by ONE_READER and see what happens', but that requires several changes and is a subject for another e-mail. I'm working on it though. -- Mateusz Guzik