From owner-svn-src-all@freebsd.org Sun Dec 20 00:37:02 2015 Return-Path: Delivered-To: svn-src-all@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 34575A142F0; Sun, 20 Dec 2015 00:37:02 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) by mx1.freebsd.org (Postfix) with ESMTP id E28901DDA; Sun, 20 Dec 2015 00:37:01 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id ARx3a3Ad6kK49ARx4aiaJT; Sat, 19 Dec 2015 17:34:19 -0700 X-Authority-Analysis: v=2.1 cv=AMkI9oPf c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=BWvPGDcYAAAA:8 a=VxmjJ2MpAAAA:8 a=kj9zAlcOel0A:10 a=wUQvQvOEmiQA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=qTJaa604SLfFJteShtAA:9 a=UgVQh8T7JsGlqokE:21 a=k9KvWr_rbpaJxweD:21 a=zIP56-oHwJjErm3M:21 a=CjuIK1q_8ugA:10 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 0988D309F1; Sat, 19 Dec 2015 16:34:17 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id tBK0YGFx080939; Sat, 19 Dec 2015 16:34:16 -0800 (PST) (envelope-from Cy.Schubert@komquats.com) Message-Id: <201512200034.tBK0YGFx080939@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.komquats.com/ To: "George V. Neville-Neil" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290383 - in head/sys: net netinet In-Reply-To: Message from "George V. Neville-Neil" of "Thu, 05 Nov 2015 07:26:32 +0000." <201511050726.tA57QXlu074213@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 19 Dec 2015 16:34:16 -0800 X-CMAE-Envelope: MS4wfCOmoSbeE/xxkdfJM1JHi1Ve45hvNyFcwpztltnilWwenhL9t99CyP8/Sp1eHnR/k6mJiUAoy46irO73c8rR0iDkKHxvDpyxosCHa7U6UHpQ4+J2Kmte UmrhwR2IJBvXTlZh2xnFW2EgvkYM3vV4A3i/wkXaJTwZbdRxHPvruHEvfWPm0FGh3gr2tF8v5C/oqNIG2B1LEZYWWQETQ/mXzscyv9Sm+HVWJpCkWpzsPtjK n2ShhPpUG2z02TRqH1EF1QTQX346sGuLch4G0DRKwkUGw3QiAw33lbchspoT4DiS X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 00:37:02 -0000 In message <201511050726.tA57QXlu074213@repo.freebsd.org>, "George V. Neville-N eil" writes: > Author: gnn > Date: Thu Nov 5 07:26:32 2015 > New Revision: 290383 > URL: https://svnweb.freebsd.org/changeset/base/290383 > > Log: > Replace the fastforward path with tryforward which does not require a > sysctl and will always be on. The former split between default and > fast forwarding is removed by this commit while preserving the ability > to use all network stack features. > > Differential Revision: https://reviews.freebsd.org/D4042 > Reviewed by: ae, melifaro, olivier, rwatson > MFC after: 1 month > Sponsored by: Rubicon Communications (Netgate) > > Modified: > head/sys/net/if_arcsubr.c > head/sys/net/if_ethersubr.c > head/sys/net/if_fddisubr.c > head/sys/net/if_fwsubr.c > head/sys/net/if_iso88025subr.c > head/sys/netinet/in_var.h > head/sys/netinet/ip_fastfwd.c > head/sys/netinet/ip_input.c > > Modified: head/sys/net/if_arcsubr.c > ============================================================================= > = > --- head/sys/net/if_arcsubr.c Thu Nov 5 04:16:03 2015 (r290382) > +++ head/sys/net/if_arcsubr.c Thu Nov 5 07:26:32 2015 (r290383) > @@ -550,15 +550,11 @@ arc_input(struct ifnet *ifp, struct mbuf > #ifdef INET > case ARCTYPE_IP: > m_adj(m, ARC_HDRNEWLEN); > - if ((m = ip_fastforward(m)) == NULL) > - return; > isr = NETISR_IP; > break; > > case ARCTYPE_IP_OLD: > m_adj(m, ARC_HDRLEN); > - if ((m = ip_fastforward(m)) == NULL) > - return; > isr = NETISR_IP; > break; > > > Modified: head/sys/net/if_ethersubr.c > ============================================================================= > = > --- head/sys/net/if_ethersubr.c Thu Nov 5 04:16:03 2015 (r29038 > 2) > +++ head/sys/net/if_ethersubr.c Thu Nov 5 07:26:32 2015 (r29038 > 3) > @@ -722,8 +722,6 @@ ether_demux(struct ifnet *ifp, struct mb > switch (ether_type) { > #ifdef INET > case ETHERTYPE_IP: > - if ((m = ip_fastforward(m)) == NULL) > - return; > isr = NETISR_IP; > break; > > > Modified: head/sys/net/if_fddisubr.c > ============================================================================= > = > --- head/sys/net/if_fddisubr.c Thu Nov 5 04:16:03 2015 (r29038 > 2) > +++ head/sys/net/if_fddisubr.c Thu Nov 5 07:26:32 2015 (r29038 > 3) > @@ -429,8 +429,6 @@ fddi_input(ifp, m) > switch (type) { > #ifdef INET > case ETHERTYPE_IP: > - if ((m = ip_fastforward(m)) == NULL) > - return; > isr = NETISR_IP; > break; > > > Modified: head/sys/net/if_fwsubr.c > ============================================================================= > = > --- head/sys/net/if_fwsubr.c Thu Nov 5 04:16:03 2015 (r290382) > +++ head/sys/net/if_fwsubr.c Thu Nov 5 07:26:32 2015 (r290383) > @@ -605,8 +605,6 @@ firewire_input(struct ifnet *ifp, struct > switch (type) { > #ifdef INET > case ETHERTYPE_IP: > - if ((m = ip_fastforward(m)) == NULL) > - return; > isr = NETISR_IP; > break; > > > Modified: head/sys/net/if_iso88025subr.c > ============================================================================= > = > --- head/sys/net/if_iso88025subr.c Thu Nov 5 04:16:03 2015 (r29038 > 2) > +++ head/sys/net/if_iso88025subr.c Thu Nov 5 07:26:32 2015 (r29038 > 3) > @@ -519,8 +519,6 @@ iso88025_input(ifp, m) > #ifdef INET > case ETHERTYPE_IP: > th->iso88025_shost[0] &= ~(TR_RII); > - if ((m = ip_fastforward(m)) == NULL) > - return; > isr = NETISR_IP; > break; > > > Modified: head/sys/netinet/in_var.h > ============================================================================= > = > --- head/sys/netinet/in_var.h Thu Nov 5 04:16:03 2015 (r290382) > +++ head/sys/netinet/in_var.h Thu Nov 5 07:26:32 2015 (r290383) > @@ -380,7 +380,7 @@ int in_scrubprefix(struct in_ifaddr *, u > void ip_input(struct mbuf *); > void ip_direct_input(struct mbuf *); > void in_ifadown(struct ifaddr *ifa, int); > -struct mbuf *ip_fastforward(struct mbuf *); > +struct mbuf *ip_tryforward(struct mbuf *); > void *in_domifattach(struct ifnet *); > void in_domifdetach(struct ifnet *, void *); > > > Modified: head/sys/netinet/ip_fastfwd.c > ============================================================================= > = > --- head/sys/netinet/ip_fastfwd.c Thu Nov 5 04:16:03 2015 (r29038 > 2) > +++ head/sys/netinet/ip_fastfwd.c Thu Nov 5 07:26:32 2015 (r29038 > 3) > @@ -108,12 +108,6 @@ __FBSDID("$FreeBSD$"); > > #include > > -static VNET_DEFINE(int, ipfastforward_active); > -#define V_ipfastforward_active VNET(ipfastforward_active) > - > -SYSCTL_INT(_net_inet_ip, OID_AUTO, fastforwarding, CTLFLAG_VNET | CTLFLAG_RW > , > - &VNET_NAME(ipfastforward_active), 0, "Enable fast IP forwarding"); > - > static struct sockaddr_in * > ip_findroute(struct route *ro, struct in_addr dest, struct mbuf *m) > { > @@ -158,7 +152,7 @@ ip_findroute(struct route *ro, struct in > * to ip_input for full processing. > */ > struct mbuf * > -ip_fastforward(struct mbuf *m) > +ip_tryforward(struct mbuf *m) > { > struct ip *ip; > struct mbuf *m0 = NULL; > @@ -166,119 +160,20 @@ ip_fastforward(struct mbuf *m) > struct sockaddr_in *dst = NULL; > struct ifnet *ifp; > struct in_addr odest, dest; > - uint16_t sum, ip_len, ip_off; > + uint16_t ip_len, ip_off; > int error = 0; > - int hlen, mtu; > + int mtu; > struct m_tag *fwd_tag = NULL; > > /* > * Are we active and forwarding packets? > */ > - if (!V_ipfastforward_active || !V_ipforwarding) > - return m; > > M_ASSERTVALID(m); > M_ASSERTPKTHDR(m); > > bzero(&ro, sizeof(ro)); > > - /* > - * Step 1: check for packet drop conditions (and sanity checks) > - */ > - > - /* > - * Is entire packet big enough? > - */ > - if (m->m_pkthdr.len < sizeof(struct ip)) { > - IPSTAT_INC(ips_tooshort); > - goto drop; > - } > - > - /* > - * Is first mbuf large enough for ip header and is header present? > - */ > - if (m->m_len < sizeof (struct ip) && > - (m = m_pullup(m, sizeof (struct ip))) == NULL) { > - IPSTAT_INC(ips_toosmall); > - return NULL; /* mbuf already free'd */ > - } > - > - ip = mtod(m, struct ip *); > - > - /* > - * Is it IPv4? > - */ > - if (ip->ip_v != IPVERSION) { > - IPSTAT_INC(ips_badvers); > - goto drop; > - } > - > - /* > - * Is IP header length correct and is it in first mbuf? > - */ > - hlen = ip->ip_hl << 2; > - if (hlen < sizeof(struct ip)) { /* minimum header length */ > - IPSTAT_INC(ips_badhlen); > - goto drop; > - } > - if (hlen > m->m_len) { > - if ((m = m_pullup(m, hlen)) == NULL) { > - IPSTAT_INC(ips_badhlen); > - return NULL; /* mbuf already free'd */ > - } > - ip = mtod(m, struct ip *); > - } > - > - /* > - * Checksum correct? > - */ > - if (m->m_pkthdr.csum_flags & CSUM_IP_CHECKED) > - sum = !(m->m_pkthdr.csum_flags & CSUM_IP_VALID); > - else { > - if (hlen == sizeof(struct ip)) > - sum = in_cksum_hdr(ip); > - else > - sum = in_cksum(m, hlen); > - } > - if (sum) { > - IPSTAT_INC(ips_badsum); > - goto drop; > - } > - > - /* > - * Remember that we have checked the IP header and found it valid. > - */ > - m->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); > - > - ip_len = ntohs(ip->ip_len); > - > - /* > - * Is IP length longer than packet we have got? > - */ > - if (m->m_pkthdr.len < ip_len) { > - IPSTAT_INC(ips_tooshort); > - goto drop; > - } > - > - /* > - * Is packet longer than IP header tells us? If yes, truncate packet. > - */ > - if (m->m_pkthdr.len > ip_len) { > - if (m->m_len == m->m_pkthdr.len) { > - m->m_len = ip_len; > - m->m_pkthdr.len = ip_len; > - } else > - m_adj(m, ip_len - m->m_pkthdr.len); > - } > - > - /* > - * Is packet from or to 127/8? > - */ > - if ((ntohl(ip->ip_dst.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET || > - (ntohl(ip->ip_src.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) { > - IPSTAT_INC(ips_badaddr); > - goto drop; > - } > > #ifdef ALTQ > /* > @@ -289,12 +184,10 @@ ip_fastforward(struct mbuf *m) > #endif > > /* > - * Step 2: fallback conditions to normal ip_input path processing > - */ > - > - /* > * Only IP packets without options > */ > + ip = mtod(m, struct ip *); > + > if (ip->ip_hl != (sizeof(struct ip) >> 2)) { > if (V_ip_doopts == 1) > return m; > > Modified: head/sys/netinet/ip_input.c > ============================================================================= > = > --- head/sys/netinet/ip_input.c Thu Nov 5 04:16:03 2015 (r29038 > 2) > +++ head/sys/netinet/ip_input.c Thu Nov 5 07:26:32 2015 (r29038 > 3) > @@ -79,6 +79,8 @@ __FBSDID("$FreeBSD$"); > #include > #ifdef IPSEC > #include > +#include > +#include > #endif /* IPSEC */ > #include > > @@ -500,12 +502,22 @@ tooshort: > m_adj(m, ip_len - m->m_pkthdr.len); > } > > + /* Try to forward the packet, but if we fail continue */ > #ifdef IPSEC > + /* For now we do not handle IPSEC in tryforward. */ > + if (!key_havesp(IPSEC_DIR_INBOUND) && !key_havesp(IPSEC_DIR_OUTBOUND) & > & > + (V_ipforwarding == 1)) > + if (ip_tryforward(m) == NULL) > + return; > /* > * Bypass packet filtering for packets previously handled by IPsec. > */ > if (ip_ipsec_filtertunnel(m)) > goto passin; > +#else > + if (V_ipforwarding == 1) > + if (ip_tryforward(m) == NULL) > + return; > #endif /* IPSEC */ > > /* > > Hi George, Sorry for the lateness of this reply, I finally got some time off for Christmas and have time to myself to boot. This breaks ipfilter's ipnat. I want to let you know before anyone MFCs this. -- Cheers, Cy Schubert or FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sun Dec 20 00:40:35 2015 Return-Path: Delivered-To: svn-src-all@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 1F430A14532; Sun, 20 Dec 2015 00:40:35 +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 E1C341078; Sun, 20 Dec 2015 00:40:34 +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 tBK0eXqk013671; Sun, 20 Dec 2015 00:40:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK0eXP3013670; Sun, 20 Dec 2015 00:40:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200040.tBK0eXP3013670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 00:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292481 - stable/10/lib/libc/regex/grot X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 00:40:35 -0000 Author: ngie Date: Sun Dec 20 00:40:33 2015 New Revision: 292481 URL: https://svnweb.freebsd.org/changeset/base/292481 Log: MFC r292153: Add -static to CFLAGS to unbreak the tests by using a libc.a with the xlocale private symbols exposed which aren't exposed publicly via the DSO PR: 191354 Sponsored by: EMC / Isilon Storage Division Modified: stable/10/lib/libc/regex/grot/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/regex/grot/Makefile ============================================================================== --- stable/10/lib/libc/regex/grot/Makefile Sat Dec 19 23:02:18 2015 (r292480) +++ stable/10/lib/libc/regex/grot/Makefile Sun Dec 20 00:40:33 2015 (r292481) @@ -8,7 +8,7 @@ PATHS= ${.CURDIR}/.. ${.CURDIR}/../../locale ${.CURDIR}/../../../../include .PATH: ${PATHS} -CFLAGS+= -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS) +CFLAGS+= -static -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS) .for incpath in ${PATHS} CFLAGS+= -I${incpath} .endfor From owner-svn-src-all@freebsd.org Sun Dec 20 00:45:36 2015 Return-Path: Delivered-To: svn-src-all@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 4A2D4A148E2; Sun, 20 Dec 2015 00:45:36 +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 1945A137D; Sun, 20 Dec 2015 00:45:36 +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 tBK0jZd0016464; Sun, 20 Dec 2015 00:45:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK0jZnr016463; Sun, 20 Dec 2015 00:45:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200045.tBK0jZnr016463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 00:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292482 - stable/9/lib/libc/regex/grot X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 00:45:36 -0000 Author: ngie Date: Sun Dec 20 00:45:34 2015 New Revision: 292482 URL: https://svnweb.freebsd.org/changeset/base/292482 Log: MFstable/10 r292481: MFC r292153: Add -static to CFLAGS to unbreak the tests by using a libc.a with the xlocale private symbols exposed which aren't exposed publicly via the DSO PR: 191354 Sponsored by: EMC / Isilon Storage Division Modified: stable/9/lib/libc/regex/grot/Makefile Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/regex/grot/Makefile ============================================================================== --- stable/9/lib/libc/regex/grot/Makefile Sun Dec 20 00:40:33 2015 (r292481) +++ stable/9/lib/libc/regex/grot/Makefile Sun Dec 20 00:45:34 2015 (r292482) @@ -8,7 +8,7 @@ PATHS= ${.CURDIR}/.. ${.CURDIR}/../../locale ${.CURDIR}/../../../../include .PATH: ${PATHS} -CFLAGS+= -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS) +CFLAGS+= -static -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS) .for incpath in ${PATHS} CFLAGS+= -I${incpath} .endfor From owner-svn-src-all@freebsd.org Sun Dec 20 00:58:23 2015 Return-Path: Delivered-To: svn-src-all@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 7840CA4B171; Sun, 20 Dec 2015 00:58:23 +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 554611AE0; Sun, 20 Dec 2015 00:58:23 +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 tBK0wMw7019483; Sun, 20 Dec 2015 00:58:22 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK0wM5g019482; Sun, 20 Dec 2015 00:58:22 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201512200058.tBK0wM5g019482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 20 Dec 2015 00:58:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292483 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 00:58:23 -0000 Author: gonzo Date: Sun Dec 20 00:58:22 2015 New Revision: 292483 URL: https://svnweb.freebsd.org/changeset/base/292483 Log: Add dev.fb.X.resync sysctl to resync ARM framebuffer with VideoCore Some applications (e.g. Kodi) use tvservice APIs to manage HDMI modes, power state, EDID etc. directly through VideoCore. After these manipulations VideoCore may loose its state and needs to be resynced with ARM. Under Linux this problem is worked around using fbset utility that recreates framebuffer. Since there is no fbset utility in FreeBSD we provide sysctl for userland apps to get system back into normal mode. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Sun Dec 20 00:45:34 2015 (r292482) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c Sun Dec 20 00:58:22 2015 (r292483) @@ -59,13 +59,130 @@ __FBSDID("$FreeBSD$"); #define FB_DEPTH 24 struct bcmsc_softc { - struct fb_info *info; + struct fb_info info; + int fbswap; + struct bcm2835_fb_config fb; + device_t dev; }; static int bcm_fb_probe(device_t); static int bcm_fb_attach(device_t); static int +bcm_fb_init(struct bcmsc_softc *sc, struct bcm2835_fb_config *fb) +{ + int err; + + err = 0; + + memset(fb, 0, sizeof(*fb)); + if (bcm2835_mbox_fb_get_w_h(fb) != 0) + return (ENXIO); + fb->bpp = FB_DEPTH; + + if ((err = bcm2835_mbox_fb_init(fb)) != 0) { + device_printf(sc->dev, "bcm2835_mbox_fb_init failed, err=%d\n", err); + return (ENXIO); + } + + return (0); +} + +static int +bcm_fb_setup_fbd(struct bcmsc_softc *sc) +{ + struct bcm2835_fb_config fb; + device_t fbd; + int err; + + err = bcm_fb_init(sc, &fb); + if (err) + return (err); + + memset(&sc->info, 0, sizeof(sc->info)); + sc->info.fb_name = device_get_nameunit(sc->dev); + + sc->info.fb_vbase = (intptr_t)pmap_mapdev(fb.base, fb.size); + sc->info.fb_pbase = fb.base; + sc->info.fb_size = fb.size; + sc->info.fb_bpp = sc->info.fb_depth = fb.bpp; + sc->info.fb_stride = fb.pitch; + sc->info.fb_width = fb.xres; + sc->info.fb_height = fb.yres; + + if (sc->fbswap) { + switch (sc->info.fb_bpp) { + case 24: + vt_generate_cons_palette(sc->info.fb_cmap, + COLOR_FORMAT_RGB, 0xff, 0, 0xff, 8, 0xff, 16); + sc->info.fb_cmsize = 16; + break; + case 32: + vt_generate_cons_palette(sc->info.fb_cmap, + COLOR_FORMAT_RGB, 0xff, 16, 0xff, 8, 0xff, 0); + sc->info.fb_cmsize = 16; + break; + } + } + + fbd = device_add_child(sc->dev, "fbd", device_get_unit(sc->dev)); + if (fbd == NULL) { + device_printf(sc->dev, "Failed to add fbd child\n"); + pmap_unmapdev(sc->info.fb_vbase, sc->info.fb_size); + return (ENXIO); + } else if (device_probe_and_attach(fbd) != 0) { + device_printf(sc->dev, "Failed to attach fbd device\n"); + device_delete_child(sc->dev, fbd); + pmap_unmapdev(sc->info.fb_vbase, sc->info.fb_size); + return (ENXIO); + } + + device_printf(sc->dev, "%dx%d(%dx%d@%d,%d) %dbpp\n", fb.xres, fb.yres, + fb.vxres, fb.vyres, fb.xoffset, fb.yoffset, fb.bpp); + device_printf(sc->dev, + "fbswap: %d, pitch %d, base 0x%08x, screen_size %d\n", + sc->fbswap, fb.pitch, fb.base, fb.size); + + return (0); +} + +static int +bcm_fb_resync_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct bcmsc_softc *sc = arg1; + struct bcm2835_fb_config fb; + int val; + int err; + + val = 0; + err = sysctl_handle_int(oidp, &val, 0, req); + if (err || !req->newptr) /* error || read request */ + return (err); + + bcm_fb_init(sc, &fb); + + return (0); +} + +static void +bcm_fb_sysctl_init(struct bcmsc_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree_node; + struct sysctl_oid_list *tree; + + /* + * Add system sysctl tree/handlers. + */ + ctx = device_get_sysctl_ctx(sc->dev); + tree_node = device_get_sysctl_tree(sc->dev); + tree = SYSCTL_CHILDREN(tree_node); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "resync", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_fb_resync_sysctl, "IU", "Set to resync framebuffer with VC"); +} + +static int bcm_fb_probe(device_t dev) { if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-fb")) @@ -80,36 +197,15 @@ static int bcm_fb_attach(device_t dev) { char bootargs[2048], *n, *p, *v; - device_t fbd; - int fbswap, err; + int err; phandle_t chosen; - struct bcm2835_fb_config fb; struct bcmsc_softc *sc; - struct fb_info *info; sc = device_get_softc(dev); - memset(&fb, 0, sizeof(fb)); - if (bcm2835_mbox_fb_get_w_h(&fb) != 0) - return (ENXIO); - fb.bpp = FB_DEPTH; - if ((err = bcm2835_mbox_fb_init(&fb)) != 0) { - device_printf(dev, "bcm2835_mbox_fb_init failed, err=%d\n", err); - return (ENXIO); - } - - info = malloc(sizeof(struct fb_info), M_DEVBUF, M_WAITOK | M_ZERO); - info->fb_name = device_get_nameunit(dev); - info->fb_vbase = (intptr_t)pmap_mapdev(fb.base, fb.size); - info->fb_pbase = fb.base; - info->fb_size = fb.size; - info->fb_bpp = info->fb_depth = fb.bpp; - info->fb_stride = fb.pitch; - info->fb_width = fb.xres; - info->fb_height = fb.yres; - sc->info = info; + sc->dev = dev; /* Newer firmware versions needs an inverted color palette. */ - fbswap = 0; + sc->fbswap = 0; chosen = OF_finddevice("/chosen"); if (chosen != 0 && OF_getprop(chosen, "bootargs", &bootargs, sizeof(bootargs)) > 0) { @@ -120,41 +216,15 @@ bcm_fb_attach(device_t dev) n = strsep(&v, "="); if (strcmp(n, "bcm2708_fb.fbswap") == 0 && v != NULL) if (*v == '1') - fbswap = 1; + sc->fbswap = 1; } } - if (fbswap) { - switch (info->fb_bpp) { - case 24: - vt_generate_cons_palette(info->fb_cmap, - COLOR_FORMAT_RGB, 0xff, 0, 0xff, 8, 0xff, 16); - info->fb_cmsize = 16; - break; - case 32: - vt_generate_cons_palette(info->fb_cmap, - COLOR_FORMAT_RGB, 0xff, 16, 0xff, 8, 0xff, 0); - info->fb_cmsize = 16; - break; - } - } - fbd = device_add_child(dev, "fbd", device_get_unit(dev)); - if (fbd == NULL) { - device_printf(dev, "Failed to add fbd child\n"); - free(info, M_DEVBUF); - return (ENXIO); - } else if (device_probe_and_attach(fbd) != 0) { - device_printf(dev, "Failed to attach fbd device\n"); - device_delete_child(dev, fbd); - free(info, M_DEVBUF); - return (ENXIO); - } + bcm_fb_sysctl_init(sc); - device_printf(dev, "%dx%d(%dx%d@%d,%d) %dbpp\n", fb.xres, fb.yres, - fb.vxres, fb.vyres, fb.xoffset, fb.yoffset, fb.bpp); - device_printf(dev, - "fbswap: %d, pitch %d, base 0x%08x, screen_size %d\n", - fbswap, fb.pitch, fb.base, fb.size); + err = bcm_fb_setup_fbd(sc); + if (err) + return (err); return (0); } @@ -166,7 +236,7 @@ bcm_fb_helper_getinfo(device_t dev) sc = device_get_softc(dev); - return (sc->info); + return (&sc->info); } static device_method_t bcm_fb_methods[] = { From owner-svn-src-all@freebsd.org Sun Dec 20 02:05:35 2015 Return-Path: Delivered-To: svn-src-all@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 928E8A4C358; Sun, 20 Dec 2015 02:05:35 +0000 (UTC) (envelope-from jtl@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 6BC3E1DFA; Sun, 20 Dec 2015 02:05:35 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBK25Y8u039548; Sun, 20 Dec 2015 02:05:34 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK25Y2H039542; Sun, 20 Dec 2015 02:05:34 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201512200205.tBK25Y2H039542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Sun, 20 Dec 2015 02:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292484 - in head: share/man/man9 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 02:05:35 -0000 Author: jtl Date: Sun Dec 20 02:05:33 2015 New Revision: 292484 URL: https://svnweb.freebsd.org/changeset/base/292484 Log: Add a safety net to reclaim mbufs when one of the mbuf zones become exhausted. It is possible for a bug in the code (or, theoretically, even unusual network conditions) to exhaust all possible mbufs or mbuf clusters. When this occurs, things can grind to a halt fairly quickly. However, we currently do not call mb_reclaim() unless the entire system is experiencing a low-memory condition. While it is best to try to prevent exhaustion of one of the mbuf zones, it would also be useful to have a mechanism to attempt to recover from these situations by freeing "expendable" mbufs. This patch makes two changes: a) The patch adds a generic API to the UMA zone allocator to set a function that should be called when an allocation fails because the zone limit has been reached. Because of the way this function can be called, it really should do minimal work. b) The patch uses this API to try to free mbufs when an allocation fails from one of the mbuf zones because the zone limit has been reached. The function schedules a callout to run mb_reclaim(). Differential Revision: https://reviews.freebsd.org/D3864 Reviewed by: gnn Comments by: rrs, glebius MFC after: 2 weeks Sponsored by: Juniper Networks Modified: head/share/man/man9/Makefile head/share/man/man9/zone.9 head/sys/kern/kern_mbuf.c head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Dec 20 00:58:22 2015 (r292483) +++ head/share/man/man9/Makefile Sun Dec 20 02:05:33 2015 (r292484) @@ -1911,6 +1911,7 @@ MLINKS+=zone.9 uma.9 \ zone.9 uma_zone_get_cur.9 \ zone.9 uma_zone_get_max.9 \ zone.9 uma_zone_set_max.9 \ - zone.9 uma_zone_set_warning.9 + zone.9 uma_zone_set_warning.9 \ + zone.9 uma_zone_set_maxaction.9 .include Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Sun Dec 20 00:58:22 2015 (r292483) +++ head/share/man/man9/zone.9 Sun Dec 20 02:05:33 2015 (r292484) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2014 +.Dd December 20, 2015 .Dt ZONE 9 .Os .Sh NAME @@ -39,7 +39,8 @@ .Nm uma_zone_set_max, .Nm uma_zone_get_max, .Nm uma_zone_get_cur, -.Nm uma_zone_set_warning +.Nm uma_zone_set_warning, +.Nm uma_zone_set_maxaction .Nd zone allocator .Sh SYNOPSIS .In sys/param.h @@ -71,6 +72,8 @@ .Fn uma_zone_get_cur "uma_zone_t zone" .Ft void .Fn uma_zone_set_warning "uma_zone_t zone" "const char *warning" +.Ft void +.Fn uma_zone_set_maxaction "uma_zone_t zone" "void (*maxaction)(uma_zone_t)" .In sys/sysctl.h .Fn SYSCTL_UMA_MAX parent nbr name access zone descr .Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr @@ -307,13 +310,21 @@ The .Fn uma_zone_set_warning function sets a warning that will be printed on the system console when the given zone becomes full and fails to allocate an item. -The warning will be printed not often than every five minutes. +The warning will be printed no more often than every five minutes. Warnings can be turned off globally by setting the .Va vm.zone_warnings sysctl tunable to .Va 0 . .Pp The +.Fn uma_zone_set_maxaction +function sets a function that will be called when the given zone becomes full +and fails to allocate an item. +The function will be called with the zone locked. Also, the function +that called the allocation function may have held additional locks. Therefore, +this function should do very little work (similar to a signal handler). +.Pp +The .Fn SYSCTL_UMA_MAX parent nbr name access zone descr macro declares a static .Xr sysctl Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sun Dec 20 00:58:22 2015 (r292483) +++ head/sys/kern/kern_mbuf.c Sun Dec 20 02:05:33 2015 (r292484) @@ -32,11 +32,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include +#include +#include #include #include #include @@ -272,6 +275,12 @@ uma_zone_t zone_jumbo16; uma_zone_t zone_ext_refcnt; /* + * Callout to assist us in freeing mbufs. + */ +static struct callout mb_reclaim_callout; +static struct mtx mb_reclaim_callout_mtx; + +/* * Local prototypes. */ static int mb_ctor_mbuf(void *, int, void *, int); @@ -285,6 +294,7 @@ static void mb_zfini_pack(void *, int); static void mb_reclaim(void *); static void *mbuf_jumbo_alloc(uma_zone_t, vm_size_t, uint8_t *, int); +static void mb_maxaction(uma_zone_t); /* Ensure that MSIZE is a power of 2. */ CTASSERT((((MSIZE - 1) ^ MSIZE) + 1) >> 1 == MSIZE); @@ -310,6 +320,7 @@ mbuf_init(void *dummy) if (nmbufs > 0) nmbufs = uma_zone_set_max(zone_mbuf, nmbufs); uma_zone_set_warning(zone_mbuf, "kern.ipc.nmbufs limit reached"); + uma_zone_set_maxaction(zone_mbuf, mb_maxaction); zone_clust = uma_zcreate(MBUF_CLUSTER_MEM_NAME, MCLBYTES, mb_ctor_clust, mb_dtor_clust, @@ -322,6 +333,7 @@ mbuf_init(void *dummy) if (nmbclusters > 0) nmbclusters = uma_zone_set_max(zone_clust, nmbclusters); uma_zone_set_warning(zone_clust, "kern.ipc.nmbclusters limit reached"); + uma_zone_set_maxaction(zone_clust, mb_maxaction); zone_pack = uma_zsecond_create(MBUF_PACKET_MEM_NAME, mb_ctor_pack, mb_dtor_pack, mb_zinit_pack, mb_zfini_pack, zone_mbuf); @@ -338,6 +350,7 @@ mbuf_init(void *dummy) if (nmbjumbop > 0) nmbjumbop = uma_zone_set_max(zone_jumbop, nmbjumbop); uma_zone_set_warning(zone_jumbop, "kern.ipc.nmbjumbop limit reached"); + uma_zone_set_maxaction(zone_jumbop, mb_maxaction); zone_jumbo9 = uma_zcreate(MBUF_JUMBO9_MEM_NAME, MJUM9BYTES, mb_ctor_clust, mb_dtor_clust, @@ -351,6 +364,7 @@ mbuf_init(void *dummy) if (nmbjumbo9 > 0) nmbjumbo9 = uma_zone_set_max(zone_jumbo9, nmbjumbo9); uma_zone_set_warning(zone_jumbo9, "kern.ipc.nmbjumbo9 limit reached"); + uma_zone_set_maxaction(zone_jumbo9, mb_maxaction); zone_jumbo16 = uma_zcreate(MBUF_JUMBO16_MEM_NAME, MJUM16BYTES, mb_ctor_clust, mb_dtor_clust, @@ -364,6 +378,7 @@ mbuf_init(void *dummy) if (nmbjumbo16 > 0) nmbjumbo16 = uma_zone_set_max(zone_jumbo16, nmbjumbo16); uma_zone_set_warning(zone_jumbo16, "kern.ipc.nmbjumbo16 limit reached"); + uma_zone_set_maxaction(zone_jumbo16, mb_maxaction); zone_ext_refcnt = uma_zcreate(MBUF_EXTREFCNT_MEM_NAME, sizeof(u_int), NULL, NULL, @@ -372,6 +387,11 @@ mbuf_init(void *dummy) /* uma_prealloc() goes here... */ + /* Initialize the mb_reclaim() callout. */ + mtx_init(&mb_reclaim_callout_mtx, "mb_reclaim_callout_mtx", NULL, + MTX_DEF); + callout_init(&mb_reclaim_callout, 1); + /* * Hook event handler for low-memory situation, used to * drain protocols and push data back to the caches (UMA @@ -678,3 +698,61 @@ mb_reclaim(void *junk) if (pr->pr_drain != NULL) (*pr->pr_drain)(); } + +/* + * This is the function called by the mb_reclaim_callout, which is + * used when we hit the maximum for a zone. + * + * (See mb_maxaction() below.) + */ +static void +mb_reclaim_timer(void *junk __unused) +{ + + mtx_lock(&mb_reclaim_callout_mtx); + + /* + * Avoid running this function extra times by skipping this invocation + * if the callout has already been rescheduled. + */ + if (callout_pending(&mb_reclaim_callout) || + !callout_active(&mb_reclaim_callout)) { + mtx_unlock(&mb_reclaim_callout_mtx); + return; + } + mtx_unlock(&mb_reclaim_callout_mtx); + + mb_reclaim(NULL); + + mtx_lock(&mb_reclaim_callout_mtx); + callout_deactivate(&mb_reclaim_callout); + mtx_unlock(&mb_reclaim_callout_mtx); +} + +/* + * This function is called when we hit the maximum for a zone. + * + * At that point, we want to call the protocol drain routine to free up some + * mbufs. However, we will use the callout routines to schedule this to + * occur in another thread. (The thread calling this function holds the + * zone lock.) + */ +static void +mb_maxaction(uma_zone_t zone __unused) +{ + + /* + * If we can't immediately obtain the lock, either the callout + * is currently running, or another thread is scheduling the + * callout. + */ + if (!mtx_trylock(&mb_reclaim_callout_mtx)) + return; + + /* If not already scheduled/running, schedule the callout. */ + if (!callout_active(&mb_reclaim_callout)) { + callout_reset(&mb_reclaim_callout, 1, mb_reclaim_timer, NULL); + } + + mtx_unlock(&mb_reclaim_callout_mtx); +} Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Sun Dec 20 00:58:22 2015 (r292483) +++ head/sys/vm/uma.h Sun Dec 20 02:05:33 2015 (r292484) @@ -521,6 +521,19 @@ int uma_zone_get_max(uma_zone_t zone); void uma_zone_set_warning(uma_zone_t zone, const char *warning); /* + * Sets a function to run when limit is reached + * + * Arguments: + * zone The zone to which this applies + * fx The function ro run + * + * Returns: + * Nothing + */ +typedef void (*uma_maxaction_t)(uma_zone_t); +void uma_zone_set_maxaction(uma_zone_t zone, uma_maxaction_t); + +/* * Obtains the approximate current number of items allocated from a zone * * Arguments: Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sun Dec 20 00:58:22 2015 (r292483) +++ head/sys/vm/uma_core.c Sun Dec 20 02:05:33 2015 (r292484) @@ -431,6 +431,13 @@ zone_log_warning(uma_zone_t zone) printf("[zone: %s] %s\n", zone->uz_name, zone->uz_warning); } +static inline void +zone_maxaction(uma_zone_t zone) +{ + if (zone->uz_maxaction) + (*zone->uz_maxaction)(zone); +} + static void zone_foreach_keg(uma_zone_t zone, void (*kegfn)(uma_keg_t)) { @@ -1578,6 +1585,7 @@ zone_ctor(void *mem, int size, void *uda zone->uz_flags = 0; zone->uz_warning = NULL; timevalclear(&zone->uz_ratecheck); + zone->uz_maxaction = NULL; keg = arg->keg; ZONE_LOCK_INIT(zone, (arg->flags & UMA_ZONE_MTXCLASS)); @@ -2382,6 +2390,7 @@ keg_fetch_slab(uma_keg_t keg, uma_zone_t if ((zone->uz_flags & UMA_ZFLAG_MULTI) == 0) { zone->uz_flags |= UMA_ZFLAG_FULL; zone_log_warning(zone); + zone_maxaction(zone); } if (flags & M_NOWAIT) break; @@ -2501,6 +2510,7 @@ zone_fetch_slab_multi(uma_zone_t zone, u zone->uz_flags |= UMA_ZFLAG_FULL; zone->uz_sleeps++; zone_log_warning(zone); + zone_maxaction(zone); msleep(zone, zone->uz_lockptr, PVM, "zonelimit", hz/100); zone->uz_flags &= ~UMA_ZFLAG_FULL; @@ -3007,6 +3017,16 @@ uma_zone_set_warning(uma_zone_t zone, co } /* See uma.h */ +void +uma_zone_set_maxaction(uma_zone_t zone, uma_maxaction_t maxaction) +{ + + ZONE_LOCK(zone); + zone->uz_maxaction = maxaction; + ZONE_UNLOCK(zone); +} + +/* See uma.h */ int uma_zone_get_cur(uma_zone_t zone) { Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Sun Dec 20 00:58:22 2015 (r292483) +++ head/sys/vm/uma_int.h Sun Dec 20 02:05:33 2015 (r292484) @@ -303,10 +303,12 @@ struct uma_zone { uint16_t uz_count; /* Amount of items in full bucket */ uint16_t uz_count_min; /* Minimal amount of items there */ - /* The next three fields are used to print a rate-limited warnings. */ + /* The next two fields are used to print a rate-limited warnings. */ const char *uz_warning; /* Warning to print on failure */ struct timeval uz_ratecheck; /* Warnings rate-limiting */ + uma_maxaction_t uz_maxaction; /* Function to run when at limit */ + /* * This HAS to be the last item because we adjust the zone size * based on NCPU and then allocate the space for the zones. From owner-svn-src-all@freebsd.org Sun Dec 20 02:36:31 2015 Return-Path: Delivered-To: svn-src-all@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 986AFA4BABC; Sun, 20 Dec 2015 02:36:31 +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 688361EF6; Sun, 20 Dec 2015 02:36:31 +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 tBK2aUub048312; Sun, 20 Dec 2015 02:36:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK2aUvC048311; Sun, 20 Dec 2015 02:36:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200236.tBK2aUvC048311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 02:36:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292485 - head/share/examples/tests/tests/atf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 02:36:31 -0000 Author: ngie Date: Sun Dec 20 02:36:30 2015 New Revision: 292485 URL: https://svnweb.freebsd.org/changeset/base/292485 Log: Add missing return statement to atf/printf_test to make the example complete and correct, and mute a compiler warning from clang MFC after: 3 days Reported by: Jenkins Sponsored by: EMC / Isilon Storage Division Modified: head/share/examples/tests/tests/atf/printf_test.c Modified: head/share/examples/tests/tests/atf/printf_test.c ============================================================================== --- head/share/examples/tests/tests/atf/printf_test.c Sun Dec 20 02:05:33 2015 (r292484) +++ head/share/examples/tests/tests/atf/printf_test.c Sun Dec 20 02:36:30 2015 (r292485) @@ -152,4 +152,6 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, snprintf__two_formatters); ATF_TP_ADD_TC(tp, snprintf__overflow); ATF_TP_ADD_TC(tp, fprintf__simple_string); + + return (atf_no_error()); } From owner-svn-src-all@freebsd.org Sun Dec 20 02:46:53 2015 Return-Path: Delivered-To: svn-src-all@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 47B02A14326; Sun, 20 Dec 2015 02:46:53 +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 148141468; Sun, 20 Dec 2015 02:46:53 +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 tBK2kqLm051268; Sun, 20 Dec 2015 02:46:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK2kqjY051267; Sun, 20 Dec 2015 02:46:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200246.tBK2kqjY051267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 02:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292486 - head/sys/boot/i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 02:46:53 -0000 Author: ngie Date: Sun Dec 20 02:46:51 2015 New Revision: 292486 URL: https://svnweb.freebsd.org/changeset/base/292486 Log: Add missing smbios.h #include to mute a -Wimplicit-function-declaration warning after r279222 Reported by: Jenkins Sponsored by: EMC / Isilon Storage Division Modified: head/sys/boot/i386/libi386/biosmem.c Modified: head/sys/boot/i386/libi386/biosmem.c ============================================================================== --- head/sys/boot/i386/libi386/biosmem.c Sun Dec 20 02:36:30 2015 (r292485) +++ head/sys/boot/i386/libi386/biosmem.c Sun Dec 20 02:46:51 2015 (r292486) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libi386.h" #include "btxv86.h" +#include "smbios.h" vm_offset_t memtop, memtop_copyin, high_heap_base; uint32_t bios_basemem, bios_extmem, high_heap_size; From owner-svn-src-all@freebsd.org Sun Dec 20 03:06:31 2015 Return-Path: Delivered-To: svn-src-all@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 44CC1A4C337; Sun, 20 Dec 2015 03:06:31 +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 11CAC12D4; Sun, 20 Dec 2015 03:06:30 +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 tBK36UnW057692; Sun, 20 Dec 2015 03:06:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK36UTf057691; Sun, 20 Dec 2015 03:06:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200306.tBK36UTf057691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 03:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292487 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 03:06:31 -0000 Author: ngie Date: Sun Dec 20 03:06:29 2015 New Revision: 292487 URL: https://svnweb.freebsd.org/changeset/base/292487 Log: Update the test list after r292328 Add test-invtrig to the list of tests Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/lib/msun/Makefile Modified: head/tools/regression/lib/msun/Makefile ============================================================================== --- head/tools/regression/lib/msun/Makefile Sun Dec 20 02:46:51 2015 (r292486) +++ head/tools/regression/lib/msun/Makefile Sun Dec 20 03:06:29 2015 (r292487) @@ -1,8 +1,8 @@ # $FreeBSD$ TESTS= test-ctrig \ - test-exponential test-fma \ - test-lround test-nearbyint test-next test-rem test-trig + test-exponential test-fma test-invtrig \ + test-lround CFLAGS+= -O0 -lm -Wno-unknown-pragmas .PHONY: tests From owner-svn-src-all@freebsd.org Sun Dec 20 03:34:31 2015 Return-Path: Delivered-To: svn-src-all@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 54E0FA405C5; Sun, 20 Dec 2015 03:34:31 +0000 (UTC) (envelope-from cem@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 22E6C1D74; Sun, 20 Dec 2015 03:34:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBK3YUEh066153; Sun, 20 Dec 2015 03:34:30 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK3YUOK066152; Sun, 20 Dec 2015 03:34:30 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201512200334.tBK3YUOK066152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 20 Dec 2015 03:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292488 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 03:34:31 -0000 Author: cem Date: Sun Dec 20 03:34:30 2015 New Revision: 292488 URL: https://svnweb.freebsd.org/changeset/base/292488 Log: x86: Detect feature flags "AVX512DQ", "AVX512IFMA", "AVX512BW", "AVX512VBMI" Documented in Intel Architecture Set Extensions Programming Reference (319433-023). Sponsored by: EMC / Isilon Storage Division Modified: head/sys/x86/x86/identcpu.c Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Sun Dec 20 03:06:29 2015 (r292487) +++ head/sys/x86/x86/identcpu.c Sun Dec 20 03:34:30 2015 (r292488) @@ -910,12 +910,14 @@ printcpuinfo(void) "\017MPX" /* AVX512 Foundation */ "\021AVX512F" + "\022AVX512DQ" /* Enhanced NRBG */ "\023RDSEED" /* ADCX + ADOX */ "\024ADX" /* Supervisor Mode Access Prevention */ "\025SMAP" + "\026AVX512IFMA" "\027PCOMMIT" "\030CLFLUSHOPT" "\031CLWB" @@ -924,6 +926,7 @@ printcpuinfo(void) "\034AVX512ER" "\035AVX512CD" "\036SHA" + "\037AVX512BW" ); } @@ -932,6 +935,7 @@ printcpuinfo(void) cpu_stdext_feature2, "\020" "\001PREFETCHWT1" + "\002AVX512VBMI" "\004PKU" "\005OSPKE" ); From owner-svn-src-all@freebsd.org Sun Dec 20 04:06:31 2015 Return-Path: Delivered-To: svn-src-all@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 EB6A4A14ACD; Sun, 20 Dec 2015 04:06:31 +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 BBA2419C7; Sun, 20 Dec 2015 04:06:31 +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 tBK46UXY074929; Sun, 20 Dec 2015 04:06:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK46Ug0074928; Sun, 20 Dec 2015 04:06:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200406.tBK46Ug0074928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 04:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292489 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 04:06:32 -0000 Author: ngie Date: Sun Dec 20 04:06:30 2015 New Revision: 292489 URL: https://svnweb.freebsd.org/changeset/base/292489 Log: Disable test-ctrig.t testcases which fail assertions on i386 Tested on: stable/10 (amd64/i386), head (amd64/i386) PR: 205446 MFC after: 1 week X-MFC to: stable/10 Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/lib/msun/test-ctrig.c Modified: head/tools/regression/lib/msun/test-ctrig.c ============================================================================== --- head/tools/regression/lib/msun/test-ctrig.c Sun Dec 20 03:34:30 2015 (r292488) +++ head/tools/regression/lib/msun/test-ctrig.c Sun Dec 20 04:06:30 2015 (r292489) @@ -427,6 +427,7 @@ test_large(void) test_odd_tol(ctanh, z, CMPLXL(1.0, 8.95257245135025991216632140458264468e-309L), DBL_ULP()); +#if !defined(__i386__) z = CMPLXL(30, 0x1p1023L); test_odd_tol(ctanh, z, CMPLXL(1.0, -1.62994325413993477997492170229268382e-26L), @@ -436,6 +437,7 @@ test_large(void) CMPLXL(0.878606311888306869546254022621986509L, -0.225462792499754505792678258169527424L), DBL_ULP()); +#endif z = CMPLXL(710.6, 0.78539816339744830961566084581987572L); test_odd_tol(csinh, z, From owner-svn-src-all@freebsd.org Sun Dec 20 04:12:13 2015 Return-Path: Delivered-To: svn-src-all@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 A14A0A14F13; Sun, 20 Dec 2015 04:12:13 +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 71F931D6F; Sun, 20 Dec 2015 04:12:13 +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 tBK4CCEq077618; Sun, 20 Dec 2015 04:12:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK4CCpE077617; Sun, 20 Dec 2015 04:12:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200412.tBK4CCpE077617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 04:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292490 - stable/10/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 04:12:13 -0000 Author: ngie Date: Sun Dec 20 04:12:12 2015 New Revision: 292490 URL: https://svnweb.freebsd.org/changeset/base/292490 Log: MFC r291892: Remove redundant default TESTSDIR that is already defined in bsd.test.mk after r289158 Sponsored by: EMC / Isilon Storage Division Modified: stable/10/share/mk/suite.test.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/suite.test.mk ============================================================================== --- stable/10/share/mk/suite.test.mk Sun Dec 20 04:06:30 2015 (r292489) +++ stable/10/share/mk/suite.test.mk Sun Dec 20 04:12:12 2015 (r292490) @@ -8,10 +8,6 @@ .error suite.test.mk cannot be included directly. .endif -# Directory in which to install tests defined by the current Makefile. -# Makefiles have to override this to point to a subdirectory of TESTSBASE. -TESTSDIR?= . - # Name of the test suite these tests belong to. Should rarely be changed for # Makefiles built into the FreeBSD src tree. TESTSUITE?= FreeBSD From owner-svn-src-all@freebsd.org Sun Dec 20 04:17:55 2015 Return-Path: Delivered-To: svn-src-all@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 E786FA4B2FA; Sun, 20 Dec 2015 04:17:55 +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 9D8AD1FB7; Sun, 20 Dec 2015 04:17:55 +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 tBK4HsTe077829; Sun, 20 Dec 2015 04:17:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK4Hs3a077828; Sun, 20 Dec 2015 04:17:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200417.tBK4Hs3a077828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 04:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292491 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 04:17:56 -0000 Author: ngie Date: Sun Dec 20 04:17:54 2015 New Revision: 292491 URL: https://svnweb.freebsd.org/changeset/base/292491 Log: Disable test-ctrig.t testcases which fail assertions on i386 [*] Also, don't compile the exp2l(3) testcases on platforms that don't support the libcall (technically only x86 right now). This makes this test buildable on arm*/mips*/powerpc* Tested on: stable/10 (amd64/i386), head (amd64/i386) PR: 205446 [*] MFC after: 1 week X-MFC to: stable/10 Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/lib/msun/test-exponential.c Modified: head/tools/regression/lib/msun/test-exponential.c ============================================================================== --- head/tools/regression/lib/msun/test-exponential.c Sun Dec 20 04:12:12 2015 (r292490) +++ head/tools/regression/lib/msun/test-exponential.c Sun Dec 20 04:17:54 2015 (r292491) @@ -66,13 +66,22 @@ __FBSDID("$FreeBSD$"); } while (0) /* Test all the functions that compute b^x. */ -#define testall0(x, result, exceptmask, excepts) do { \ +#define _testall0(x, result, exceptmask, excepts) do { \ test(exp, x, result, exceptmask, excepts); \ test(expf, x, result, exceptmask, excepts); \ test(exp2, x, result, exceptmask, excepts); \ test(exp2f, x, result, exceptmask, excepts); \ +} while (0) + +/* Skip over exp2l on platforms that don't support it. */ +#if LDBL_PREC == 53 +#define testall0 _testall0 +#else +#define testall0(x, result, exceptmask, excepts) do { \ + _testall0(x, result, exceptmask, excepts); \ test(exp2l, x, result, exceptmask, excepts); \ } while (0) +#endif /* Test all the functions that compute b^x - 1. */ #define testall1(x, result, exceptmask, excepts) do { \ @@ -102,12 +111,14 @@ run_generic_tests(void) testall0(-INFINITY, 0.0, ALL_STD_EXCEPT, 0); testall1(-INFINITY, -1.0, ALL_STD_EXCEPT, 0); +#if !defined(__i386__) /* exp(big) == Inf, overflow exception */ testall0(50000.0, INFINITY, ALL_STD_EXCEPT & ~FE_INEXACT, FE_OVERFLOW); testall1(50000.0, INFINITY, ALL_STD_EXCEPT & ~FE_INEXACT, FE_OVERFLOW); /* exp(small) == 0, underflow and inexact exceptions */ testall0(-50000.0, 0.0, ALL_STD_EXCEPT, FE_UNDERFLOW | FE_INEXACT); +#endif testall1(-50000.0, -1.0, ALL_STD_EXCEPT, FE_INEXACT); } From owner-svn-src-all@freebsd.org Sun Dec 20 04:28:38 2015 Return-Path: Delivered-To: svn-src-all@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 D2FC6A4BAC3; Sun, 20 Dec 2015 04:28:38 +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 8A75114A4; Sun, 20 Dec 2015 04:28:38 +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 tBK4Sb8P080667; Sun, 20 Dec 2015 04:28:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK4Sb68080666; Sun, 20 Dec 2015 04:28:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200428.tBK4Sb68080666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 04:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292492 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 04:28:38 -0000 Author: ngie Date: Sun Dec 20 04:28:37 2015 New Revision: 292492 URL: https://svnweb.freebsd.org/changeset/base/292492 Log: - Use nitems instead of handrolling the macro - Use a separate variable for tracking the testcase count instead of hardcoding the offset for the testcases MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/lib/msun/test-fma.c Modified: head/tools/regression/lib/msun/test-fma.c ============================================================================== --- head/tools/regression/lib/msun/test-fma.c Sun Dec 20 04:17:54 2015 (r292491) +++ head/tools/regression/lib/msun/test-fma.c Sun Dec 20 04:28:37 2015 (r292492) @@ -31,6 +31,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -473,44 +474,50 @@ int main(int argc, char *argv[]) { int rmodes[] = { FE_TONEAREST, FE_UPWARD, FE_DOWNWARD, FE_TOWARDZERO }; - int i; + int i, j; printf("1..19\n"); - for (i = 0; i < 4; i++) { + for (i = 0; i < nitems(rmodes); i++, j++) { + printf("rmode = %d\n", rmodes[i]); fesetround(rmodes[i]); test_zeroes(); printf("ok %d - fma zeroes\n", i + 1); } - for (i = 0; i < 4; i++) { + for (i = 0; i < nitems(rmodes); i++, j++) { + printf("rmode = %d\n", rmodes[i]); fesetround(rmodes[i]); test_infinities(); - printf("ok %d - fma infinities\n", i + 5); + printf("ok %d - fma infinities\n", j); } fesetround(FE_TONEAREST); test_nans(); printf("ok 9 - fma NaNs\n"); - for (i = 0; i < 4; i++) { + for (i = 0; i < nitems(rmodes); i++, j++) { + printf("rmode = %d\n", rmodes[i]); fesetround(rmodes[i]); test_small_z(); - printf("ok %d - fma small z\n", i + 10); + printf("ok %d - fma small z\n", j); } - for (i = 0; i < 4; i++) { + for (i = 0; i < nitems(rmodes); i++, j++) { + printf("rmode = %d\n", rmodes[i]); fesetround(rmodes[i]); test_big_z(); - printf("ok %d - fma big z\n", i + 14); + printf("ok %d - fma big z\n", j); } fesetround(FE_TONEAREST); test_accuracy(); - printf("ok 18 - fma accuracy\n"); + printf("ok %d - fma accuracy\n", j); + j++; test_double_rounding(); - printf("ok 19 - fma double rounding\n"); + printf("ok %d - fma double rounding\n", j); + j++; /* * TODO: From owner-svn-src-all@freebsd.org Sun Dec 20 04:32:31 2015 Return-Path: Delivered-To: svn-src-all@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 6DCC4A4BE74; Sun, 20 Dec 2015 04:32:31 +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 3DB4D19F4; Sun, 20 Dec 2015 04:32:31 +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 tBK4WUJ3083412; Sun, 20 Dec 2015 04:32:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK4WUPP083411; Sun, 20 Dec 2015 04:32:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200432.tBK4WUPP083411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 04:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292493 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 04:32:31 -0000 Author: ngie Date: Sun Dec 20 04:32:30 2015 New Revision: 292493 URL: https://svnweb.freebsd.org/changeset/base/292493 Log: Don't run test-fma on i386 It completely fails all assertions on i386 on both stable/9 and stable/10 PR: 205448 MFC after: 1 week X-MFC to: stable/10 Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/lib/msun/test-fma.c Modified: head/tools/regression/lib/msun/test-fma.c ============================================================================== --- head/tools/regression/lib/msun/test-fma.c Sun Dec 20 04:28:37 2015 (r292492) +++ head/tools/regression/lib/msun/test-fma.c Sun Dec 20 04:32:30 2015 (r292493) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "test-utils.h" @@ -476,6 +477,11 @@ main(int argc, char *argv[]) int rmodes[] = { FE_TONEAREST, FE_UPWARD, FE_DOWNWARD, FE_TOWARDZERO }; int i, j; +#if defined(__i386__) + printf("1..0 # SKIP all testcases fail on i386\n"); + exit(0); +#endif + printf("1..19\n"); for (i = 0; i < nitems(rmodes); i++, j++) { From owner-svn-src-all@freebsd.org Sun Dec 20 04:41:19 2015 Return-Path: Delivered-To: svn-src-all@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 05716A40614; Sun, 20 Dec 2015 04:41:19 +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 C208C1E23; Sun, 20 Dec 2015 04:41:18 +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 tBK4fHUS086311; Sun, 20 Dec 2015 04:41:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK4fH2A086310; Sun, 20 Dec 2015 04:41:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200441.tBK4fH2A086310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 04:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292494 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 04:41:19 -0000 Author: ngie Date: Sun Dec 20 04:41:17 2015 New Revision: 292494 URL: https://svnweb.freebsd.org/changeset/base/292494 Log: Skip infinities testcases that fail assertions on amd64 only on CURRENT PR: 205448 MFC after: never Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/lib/msun/test-fma.c Modified: head/tools/regression/lib/msun/test-fma.c ============================================================================== --- head/tools/regression/lib/msun/test-fma.c Sun Dec 20 04:32:30 2015 (r292493) +++ head/tools/regression/lib/msun/test-fma.c Sun Dec 20 04:41:17 2015 (r292494) @@ -492,6 +492,11 @@ main(int argc, char *argv[]) } for (i = 0; i < nitems(rmodes); i++, j++) { +#if defined(__amd64__) + printf("ok %d # SKIP testcase fails assertion on " + "amd64\n", j); + continue; +#endif printf("rmode = %d\n", rmodes[i]); fesetround(rmodes[i]); test_infinities(); From owner-svn-src-all@freebsd.org Sun Dec 20 04:42:56 2015 Return-Path: Delivered-To: svn-src-all@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 C73A3A40760; Sun, 20 Dec 2015 04:42:56 +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 9427710AE; Sun, 20 Dec 2015 04:42:56 +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 tBK4gtDl086416; Sun, 20 Dec 2015 04:42:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK4gtEq086415; Sun, 20 Dec 2015 04:42:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200442.tBK4gtEq086415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 04:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292495 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 04:42:56 -0000 Author: ngie Date: Sun Dec 20 04:42:55 2015 New Revision: 292495 URL: https://svnweb.freebsd.org/changeset/base/292495 Log: Initialize j so it doesn't print out a garbage index Use it consistently instead of i in the first loop MFC after: 3 days X-MFC with: 292492 Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/lib/msun/test-fma.c Modified: head/tools/regression/lib/msun/test-fma.c ============================================================================== --- head/tools/regression/lib/msun/test-fma.c Sun Dec 20 04:41:17 2015 (r292494) +++ head/tools/regression/lib/msun/test-fma.c Sun Dec 20 04:42:55 2015 (r292495) @@ -482,13 +482,15 @@ main(int argc, char *argv[]) exit(0); #endif + j = 1; + printf("1..19\n"); for (i = 0; i < nitems(rmodes); i++, j++) { printf("rmode = %d\n", rmodes[i]); fesetround(rmodes[i]); test_zeroes(); - printf("ok %d - fma zeroes\n", i + 1); + printf("ok %d - fma zeroes\n", j); } for (i = 0; i < nitems(rmodes); i++, j++) { From owner-svn-src-all@freebsd.org Sun Dec 20 04:52:54 2015 Return-Path: Delivered-To: svn-src-all@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 5DD22A40F61; Sun, 20 Dec 2015 04:52:54 +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 1FEE217CB; Sun, 20 Dec 2015 04:52:54 +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 tBK4qrGe089334; Sun, 20 Dec 2015 04:52:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK4qraH089333; Sun, 20 Dec 2015 04:52:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200452.tBK4qraH089333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 04:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292496 - head/tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 04:52:54 -0000 Author: ngie Date: Sun Dec 20 04:52:53 2015 New Revision: 292496 URL: https://svnweb.freebsd.org/changeset/base/292496 Log: Skip the testcases on i386 (all the assertions fail) [*] Also, don't compile the ldexpl(3) testcases on platforms that don't support the libcall (technically only x86 right now). This makes this test buildable on arm*/mips*/powerpc* PR: 205449 [*] MFC after: 1 week Tested on: stable/10 (amd64/i386), head (amd64/i386) Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/lib/msun/test-invtrig.c Modified: head/tools/regression/lib/msun/test-invtrig.c ============================================================================== --- head/tools/regression/lib/msun/test-invtrig.c Sun Dec 20 04:42:55 2015 (r292495) +++ head/tools/regression/lib/msun/test-invtrig.c Sun Dec 20 04:52:53 2015 (r292496) @@ -61,14 +61,23 @@ __FBSDID("$FreeBSD$"); #define test(func, x, result, excepts) \ test_tol(func, (x), (result), 0, (excepts)) -#define testall_tol(prefix, x, result, tol, excepts) do { \ +#define _testall_tol(prefix, x, result, tol, excepts) do { \ test_tol(prefix, (double)(x), (double)(result), \ (tol) * ldexp(1.0, 1 - DBL_MANT_DIG), (excepts)); \ test_tol(prefix##f, (float)(x), (float)(result), \ (tol) * ldexpf(1.0, 1 - FLT_MANT_DIG), (excepts)); \ +} while (0) + +#if LDBL_PREC == 53 +#define testall_tol _testall_tol +#else +#define testall_tol(prefix, x, result, tol, excepts) do { \ + _testall_tol(prefix, x, result, tol, excepts); \ test_tol(prefix##l, (x), (result), \ (tol) * ldexpl(1.0, 1 - LDBL_MANT_DIG), (excepts)); \ } while (0) +#endif + #define testall(prefix, x, result, excepts) \ testall_tol(prefix, (x), (result), 0, (excepts)) @@ -81,14 +90,23 @@ __FBSDID("$FreeBSD$"); #define test2(func, y, x, result, excepts) \ test2_tol(func, (y), (x), (result), 0, (excepts)) -#define testall2_tol(prefix, y, x, result, tol, excepts) do { \ +#define _testall2_tol(prefix, y, x, result, tol, excepts) do { \ test2_tol(prefix, (double)(y), (double)(x), (double)(result), \ (tol) * ldexp(1.0, 1 - DBL_MANT_DIG), (excepts)); \ test2_tol(prefix##f, (float)(y), (float)(x), (float)(result), \ (tol) * ldexpf(1.0, 1 - FLT_MANT_DIG), (excepts)); \ +} while (0) + +#if LDBL_PREC == 53 +#define testall2_tol _testall2_tol +#else +#define testall2_tol(prefix, y, x, result, tol, excepts) do { \ + _testall2_tol(prefix, y, x, result, tol, excepts); \ test2_tol(prefix##l, (y), (x), (result), \ (tol) * ldexpl(1.0, 1 - LDBL_MANT_DIG), (excepts)); \ } while (0) +#endif + #define testall2(prefix, y, x, result, excepts) \ testall2_tol(prefix, (y), (x), (result), 0, (excepts)) @@ -429,6 +447,11 @@ int main(int argc, char *argv[]) { +#if defined(__i386__) + printf("1..0 # SKIP fails all assertions on i386\n"); + return (0); +#endif + printf("1..7\n"); test_special(); From owner-svn-src-all@freebsd.org Sun Dec 20 05:06:46 2015 Return-Path: Delivered-To: svn-src-all@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 11C17A4D795; Sun, 20 Dec 2015 05:06:46 +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 CB38B1FFB; Sun, 20 Dec 2015 05:06:45 +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 tBK56jDI092465; Sun, 20 Dec 2015 05:06:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK56ik1092460; Sun, 20 Dec 2015 05:06:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200506.tBK56ik1092460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 05:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292497 - in head: lib/msun/tests tools/regression/lib/msun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 05:06:46 -0000 Author: ngie Date: Sun Dec 20 05:06:44 2015 New Revision: 292497 URL: https://svnweb.freebsd.org/changeset/base/292497 Log: Integrate the remaining tools/regression/lib/msun testcases into the FreeBSD test suite under lib/msun/tests MFC after: 3 weeks X-MFC with: r292328 Sponsored by: EMC / Isilon Storage Division Added: head/lib/msun/tests/ctrig_test.c - copied unchanged from r292496, head/tools/regression/lib/msun/test-ctrig.c head/lib/msun/tests/exponential_test.c - copied unchanged from r292496, head/tools/regression/lib/msun/test-exponential.c head/lib/msun/tests/fma_test.c - copied unchanged from r292496, head/tools/regression/lib/msun/test-fma.c head/lib/msun/tests/invtrig_test.c - copied unchanged from r292496, head/tools/regression/lib/msun/test-invtrig.c head/lib/msun/tests/lround_test.c - copied unchanged from r292496, head/tools/regression/lib/msun/test-lround.c head/lib/msun/tests/lround_test.t - copied unchanged from r292496, head/tools/regression/lib/msun/test-lround.t head/lib/msun/tests/test-utils.h - copied unchanged from r292496, head/tools/regression/lib/msun/test-utils.h Deleted: head/tools/regression/lib/msun/ Modified: head/lib/msun/tests/Makefile Modified: head/lib/msun/tests/Makefile ============================================================================== --- head/lib/msun/tests/Makefile Sun Dec 20 04:52:53 2015 (r292496) +++ head/lib/msun/tests/Makefile Sun Dec 20 05:06:44 2015 (r292497) @@ -39,12 +39,19 @@ NETBSD_ATF_TESTS_C+= tanh_test TAP_TESTS_C+= cexp_test TAP_TESTS_C+= conj_test TAP_TESTS_C+= csqrt_test +TAP_TESTS_C+= ctrig_test +TAP_TESTS_C+= exponential_test TAP_TESTS_C+= fenv_test +TAP_TESTS_C+= fma_test TAP_TESTS_C+= fmaxmin_test TAP_TESTS_C+= ilogb_test +TAP_TESTS_C+= invtrig_test TAP_TESTS_C+= invctrig_test TAP_TESTS_C+= logarithm_test TAP_TESTS_C+= lrint_test +# XXX: the testcase crashes on all platforms, but only on head +# (bug 205451) +#TAP_TESTS_C+= lround_test TAP_TESTS_C+= nan_test TAP_TESTS_C+= nearbyint_test TAP_TESTS_C+= next_test @@ -53,7 +60,6 @@ TAP_TESTS_C+= trig_test .for t in ${TAP_TESTS_C} CFLAGS.$t+= -O0 -CFLAGS.$t+= -I${SRCTOP}/tools/regression/lib/msun .endfor CSTD= c99 Copied: head/lib/msun/tests/ctrig_test.c (from r292496, head/tools/regression/lib/msun/test-ctrig.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/tests/ctrig_test.c Sun Dec 20 05:06:44 2015 (r292497, copy of r292496, head/tools/regression/lib/msun/test-ctrig.c) @@ -0,0 +1,482 @@ +/*- + * Copyright (c) 2008-2011 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Tests for csin[h](), ccos[h](), and ctan[h](). + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include "test-utils.h" + +#pragma STDC FENV_ACCESS ON +#pragma STDC CX_LIMITED_RANGE OFF + +/* + * Test that a function returns the correct value and sets the + * exception flags correctly. The exceptmask specifies which + * exceptions we should check. We need to be lenient for several + * reasons, but mainly because on some architectures it's impossible + * to raise FE_OVERFLOW without raising FE_INEXACT. + * + * These are macros instead of functions so that assert provides more + * meaningful error messages. + * + * XXX The volatile here is to avoid gcc's bogus constant folding and work + * around the lack of support for the FENV_ACCESS pragma. + */ +#define test_p(func, z, result, exceptmask, excepts, checksign) do { \ + volatile long double complex _d = z; \ + debug(" testing %s(%Lg + %Lg I) == %Lg + %Lg I\n", #func, \ + creall(_d), cimagl(_d), creall(result), cimagl(result)); \ + assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ + assert(cfpequal_cs((func)(_d), (result), (checksign))); \ + assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ +} while (0) + +/* + * Test within a given tolerance. The tolerance indicates relative error + * in ulps. If result is 0, however, it measures absolute error in units + * of _EPSILON. + */ +#define test_p_tol(func, z, result, tol) do { \ + volatile long double complex _d = z; \ + debug(" testing %s(%Lg + %Lg I) ~= %Lg + %Lg I\n", #func, \ + creall(_d), cimagl(_d), creall(result), cimagl(result)); \ + assert(cfpequal_tol((func)(_d), (result), (tol), FPE_ABS_ZERO)); \ +} while (0) + +/* These wrappers apply the identities f(conj(z)) = conj(f(z)). */ +#define test(func, z, result, exceptmask, excepts, checksign) do { \ + test_p(func, z, result, exceptmask, excepts, checksign); \ + test_p(func, conjl(z), conjl(result), exceptmask, excepts, checksign); \ +} while (0) +#define test_tol(func, z, result, tol) do { \ + test_p_tol(func, z, result, tol); \ + test_p_tol(func, conjl(z), conjl(result), tol); \ +} while (0) +#define test_odd_tol(func, z, result, tol) do { \ + test_tol(func, z, result, tol); \ + test_tol(func, -(z), -(result), tol); \ +} while (0) +#define test_even_tol(func, z, result, tol) do { \ + test_tol(func, z, result, tol); \ + test_tol(func, -(z), result, tol); \ +} while (0) + +/* Test the given function in all precisions. */ +#define testall(func, x, result, exceptmask, excepts, checksign) do { \ + test(func, x, result, exceptmask, excepts, checksign); \ + test(func##f, x, result, exceptmask, excepts, checksign); \ +} while (0) +#define testall_odd(func, x, result, exceptmask, excepts, checksign) do { \ + testall(func, x, result, exceptmask, excepts, checksign); \ + testall(func, -x, -result, exceptmask, excepts, checksign); \ +} while (0) +#define testall_even(func, x, result, exceptmask, excepts, checksign) do { \ + testall(func, x, result, exceptmask, excepts, checksign); \ + testall(func, -x, result, exceptmask, excepts, checksign); \ +} while (0) + +/* + * Test the given function in all precisions, within a given tolerance. + * The tolerance is specified in ulps. + */ +#define testall_tol(func, x, result, tol) do { \ + test_tol(func, x, result, tol * DBL_ULP()); \ + test_tol(func##f, x, result, tol * FLT_ULP()); \ +} while (0) +#define testall_odd_tol(func, x, result, tol) do { \ + test_odd_tol(func, x, result, tol * DBL_ULP()); \ + test_odd_tol(func##f, x, result, tol * FLT_ULP()); \ +} while (0) +#define testall_even_tol(func, x, result, tol) do { \ + test_even_tol(func, x, result, tol * DBL_ULP()); \ + test_even_tol(func##f, x, result, tol * FLT_ULP()); \ +} while (0) + + +/* Tests for 0 */ +void +test_zero(void) +{ + long double complex zero = CMPLXL(0.0, 0.0); + + /* csinh(0) = ctanh(0) = 0; ccosh(0) = 1 (no exceptions raised) */ + testall_odd(csinh, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); + testall_odd(csin, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); + testall_even(ccosh, zero, 1.0, ALL_STD_EXCEPT, 0, CS_BOTH); + testall_even(ccos, zero, CMPLXL(1.0, -0.0), ALL_STD_EXCEPT, 0, CS_BOTH); + testall_odd(ctanh, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); + testall_odd(ctan, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH); +} + +/* + * Tests for NaN inputs. + */ +void +test_nan() +{ + long double complex nan_nan = CMPLXL(NAN, NAN); + long double complex z; + + /* + * IN CSINH CCOSH CTANH + * NaN,NaN NaN,NaN NaN,NaN NaN,NaN + * finite,NaN NaN,NaN [inval] NaN,NaN [inval] NaN,NaN [inval] + * NaN,finite NaN,NaN [inval] NaN,NaN [inval] NaN,NaN [inval] + * NaN,Inf NaN,NaN [inval] NaN,NaN [inval] NaN,NaN [inval] + * Inf,NaN +-Inf,NaN Inf,NaN 1,+-0 + * 0,NaN +-0,NaN NaN,+-0 NaN,NaN [inval] + * NaN,0 NaN,0 NaN,+-0 NaN,0 + */ + z = nan_nan; + testall_odd(csinh, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall_even(ccosh, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall_odd(ctanh, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall_odd(csin, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall_even(ccos, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + testall_odd(ctan, z, nan_nan, ALL_STD_EXCEPT, 0, 0); + + z = CMPLXL(42, NAN); + testall_odd(csinh, z, nan_nan, OPT_INVALID, 0, 0); + testall_even(ccosh, z, nan_nan, OPT_INVALID, 0, 0); + /* XXX We allow a spurious inexact exception here. */ + testall_odd(ctanh, z, nan_nan, OPT_INVALID & ~FE_INEXACT, 0, 0); + testall_odd(csin, z, nan_nan, OPT_INVALID, 0, 0); + testall_even(ccos, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(ctan, z, nan_nan, OPT_INVALID, 0, 0); + + z = CMPLXL(NAN, 42); + testall_odd(csinh, z, nan_nan, OPT_INVALID, 0, 0); + testall_even(ccosh, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(ctanh, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(csin, z, nan_nan, OPT_INVALID, 0, 0); + testall_even(ccos, z, nan_nan, OPT_INVALID, 0, 0); + /* XXX We allow a spurious inexact exception here. */ + testall_odd(ctan, z, nan_nan, OPT_INVALID & ~FE_INEXACT, 0, 0); + + z = CMPLXL(NAN, INFINITY); + testall_odd(csinh, z, nan_nan, OPT_INVALID, 0, 0); + testall_even(ccosh, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(ctanh, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(csin, z, CMPLXL(NAN, INFINITY), ALL_STD_EXCEPT, 0, 0); + testall_even(ccos, z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, + CS_IMAG); + testall_odd(ctan, z, CMPLXL(0, 1), ALL_STD_EXCEPT, 0, CS_IMAG); + + z = CMPLXL(INFINITY, NAN); + testall_odd(csinh, z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, 0); + testall_even(ccosh, z, CMPLXL(INFINITY, NAN), ALL_STD_EXCEPT, 0, + CS_REAL); + testall_odd(ctanh, z, CMPLXL(1, 0), ALL_STD_EXCEPT, 0, CS_REAL); + testall_odd(csin, z, nan_nan, OPT_INVALID, 0, 0); + testall_even(ccos, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(ctan, z, nan_nan, OPT_INVALID, 0, 0); + + z = CMPLXL(0, NAN); + testall_odd(csinh, z, CMPLXL(0, NAN), ALL_STD_EXCEPT, 0, 0); + testall_even(ccosh, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, 0); + testall_odd(ctanh, z, nan_nan, OPT_INVALID, 0, 0); + testall_odd(csin, z, CMPLXL(0, NAN), ALL_STD_EXCEPT, 0, CS_REAL); + testall_even(ccos, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, 0); + testall_odd(ctan, z, CMPLXL(0, NAN), ALL_STD_EXCEPT, 0, CS_REAL); + + z = CMPLXL(NAN, 0); + testall_odd(csinh, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, CS_IMAG); + testall_even(ccosh, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, 0); + testall_odd(ctanh, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, CS_IMAG); + testall_odd(csin, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, 0); + testall_even(ccos, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, 0); + testall_odd(ctan, z, nan_nan, OPT_INVALID, 0, 0); +} + +void +test_inf(void) +{ + static const long double finites[] = { + 0, M_PI / 4, 3 * M_PI / 4, 5 * M_PI / 4, + }; + long double complex z, c, s; + int i; + + /* + * IN CSINH CCOSH CTANH + * Inf,Inf +-Inf,NaN inval +-Inf,NaN inval 1,+-0 + * Inf,finite Inf cis(finite) Inf cis(finite) 1,0 sin(2 finite) + * 0,Inf +-0,NaN inval NaN,+-0 inval NaN,NaN inval + * finite,Inf NaN,NaN inval NaN,NaN inval NaN,NaN inval + */ + z = CMPLXL(INFINITY, INFINITY); + testall_odd(csinh, z, CMPLXL(INFINITY, NAN), + ALL_STD_EXCEPT, FE_INVALID, 0); + testall_even(ccosh, z, CMPLXL(INFINITY, NAN), + ALL_STD_EXCEPT, FE_INVALID, 0); + testall_odd(ctanh, z, CMPLXL(1, 0), ALL_STD_EXCEPT, 0, CS_REAL); + testall_odd(csin, z, CMPLXL(NAN, INFINITY), + ALL_STD_EXCEPT, FE_INVALID, 0); + testall_even(ccos, z, CMPLXL(INFINITY, NAN), + ALL_STD_EXCEPT, FE_INVALID, 0); + testall_odd(ctan, z, CMPLXL(0, 1), ALL_STD_EXCEPT, 0, CS_REAL); + + /* XXX We allow spurious inexact exceptions here (hard to avoid). */ + for (i = 0; i < sizeof(finites) / sizeof(finites[0]); i++) { + z = CMPLXL(INFINITY, finites[i]); + c = INFINITY * cosl(finites[i]); + s = finites[i] == 0 ? finites[i] : INFINITY * sinl(finites[i]); + testall_odd(csinh, z, CMPLXL(c, s), OPT_INEXACT, 0, CS_BOTH); + testall_even(ccosh, z, CMPLXL(c, s), OPT_INEXACT, 0, CS_BOTH); + testall_odd(ctanh, z, CMPLXL(1, 0 * sin(finites[i] * 2)), + OPT_INEXACT, 0, CS_BOTH); + z = CMPLXL(finites[i], INFINITY); + testall_odd(csin, z, CMPLXL(s, c), OPT_INEXACT, 0, CS_BOTH); + testall_even(ccos, z, CMPLXL(c, -s), OPT_INEXACT, 0, CS_BOTH); + testall_odd(ctan, z, CMPLXL(0 * sin(finites[i] * 2), 1), + OPT_INEXACT, 0, CS_BOTH); + } + + z = CMPLXL(0, INFINITY); + testall_odd(csinh, z, CMPLXL(0, NAN), ALL_STD_EXCEPT, FE_INVALID, 0); + testall_even(ccosh, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, FE_INVALID, 0); + testall_odd(ctanh, z, CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 0); + z = CMPLXL(INFINITY, 0); + testall_odd(csin, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, FE_INVALID, 0); + testall_even(ccos, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, FE_INVALID, 0); + testall_odd(ctan, z, CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 0); + + z = CMPLXL(42, INFINITY); + testall_odd(csinh, z, CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 0); + testall_even(ccosh, z, CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 0); + /* XXX We allow a spurious inexact exception here. */ + testall_odd(ctanh, z, CMPLXL(NAN, NAN), OPT_INEXACT, FE_INVALID, 0); + z = CMPLXL(INFINITY, 42); + testall_odd(csin, z, CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 0); + testall_even(ccos, z, CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 0); + /* XXX We allow a spurious inexact exception here. */ + testall_odd(ctan, z, CMPLXL(NAN, NAN), OPT_INEXACT, FE_INVALID, 0); +} + +/* Tests along the real and imaginary axes. */ +void +test_axes(void) +{ + static const long double nums[] = { + M_PI / 4, M_PI / 2, 3 * M_PI / 4, + 5 * M_PI / 4, 3 * M_PI / 2, 7 * M_PI / 4, + }; + long double complex z; + int i; + + for (i = 0; i < sizeof(nums) / sizeof(nums[0]); i++) { + /* Real axis */ + z = CMPLXL(nums[i], 0.0); + test_odd_tol(csinh, z, CMPLXL(sinh(nums[i]), 0), DBL_ULP()); + test_even_tol(ccosh, z, CMPLXL(cosh(nums[i]), 0), DBL_ULP()); + test_odd_tol(ctanh, z, CMPLXL(tanh(nums[i]), 0), DBL_ULP()); + test_odd_tol(csin, z, CMPLXL(sin(nums[i]), + copysign(0, cos(nums[i]))), DBL_ULP()); + test_even_tol(ccos, z, CMPLXL(cos(nums[i]), + -copysign(0, sin(nums[i]))), DBL_ULP()); + test_odd_tol(ctan, z, CMPLXL(tan(nums[i]), 0), DBL_ULP()); + + test_odd_tol(csinhf, z, CMPLXL(sinhf(nums[i]), 0), FLT_ULP()); + test_even_tol(ccoshf, z, CMPLXL(coshf(nums[i]), 0), FLT_ULP()); + printf("%a %a\n", creal(z), cimag(z)); + printf("%a %a\n", creal(ctanhf(z)), cimag(ctanhf(z))); + printf("%a\n", nextafterf(tanhf(nums[i]), INFINITY)); + test_odd_tol(ctanhf, z, CMPLXL(tanhf(nums[i]), 0), + 1.3 * FLT_ULP()); + test_odd_tol(csinf, z, CMPLXL(sinf(nums[i]), + copysign(0, cosf(nums[i]))), FLT_ULP()); + test_even_tol(ccosf, z, CMPLXL(cosf(nums[i]), + -copysign(0, sinf(nums[i]))), 2 * FLT_ULP()); + test_odd_tol(ctanf, z, CMPLXL(tanf(nums[i]), 0), FLT_ULP()); + + /* Imaginary axis */ + z = CMPLXL(0.0, nums[i]); + test_odd_tol(csinh, z, CMPLXL(copysign(0, cos(nums[i])), + sin(nums[i])), DBL_ULP()); + test_even_tol(ccosh, z, CMPLXL(cos(nums[i]), + copysign(0, sin(nums[i]))), DBL_ULP()); + test_odd_tol(ctanh, z, CMPLXL(0, tan(nums[i])), DBL_ULP()); + test_odd_tol(csin, z, CMPLXL(0, sinh(nums[i])), DBL_ULP()); + test_even_tol(ccos, z, CMPLXL(cosh(nums[i]), -0.0), DBL_ULP()); + test_odd_tol(ctan, z, CMPLXL(0, tanh(nums[i])), DBL_ULP()); + + test_odd_tol(csinhf, z, CMPLXL(copysign(0, cosf(nums[i])), + sinf(nums[i])), FLT_ULP()); + test_even_tol(ccoshf, z, CMPLXL(cosf(nums[i]), + copysign(0, sinf(nums[i]))), FLT_ULP()); + test_odd_tol(ctanhf, z, CMPLXL(0, tanf(nums[i])), FLT_ULP()); + test_odd_tol(csinf, z, CMPLXL(0, sinhf(nums[i])), FLT_ULP()); + test_even_tol(ccosf, z, CMPLXL(coshf(nums[i]), -0.0), + FLT_ULP()); + test_odd_tol(ctanf, z, CMPLXL(0, tanhf(nums[i])), + 1.3 * FLT_ULP()); + } +} + +void +test_small(void) +{ + /* + * z = 0.5 + i Pi/4 + * sinh(z) = (sinh(0.5) + i cosh(0.5)) * sqrt(2)/2 + * cosh(z) = (cosh(0.5) + i sinh(0.5)) * sqrt(2)/2 + * tanh(z) = (2cosh(0.5)sinh(0.5) + i) / (2 cosh(0.5)**2 - 1) + * z = -0.5 + i Pi/2 + * sinh(z) = cosh(0.5) + * cosh(z) = -i sinh(0.5) + * tanh(z) = -coth(0.5) + * z = 1.0 + i 3Pi/4 + * sinh(z) = (-sinh(1) + i cosh(1)) * sqrt(2)/2 + * cosh(z) = (-cosh(1) + i sinh(1)) * sqrt(2)/2 + * tanh(z) = (2cosh(1)sinh(1) - i) / (2cosh(1)**2 - 1) + */ + static const struct { + long double a, b; + long double sinh_a, sinh_b; + long double cosh_a, cosh_b; + long double tanh_a, tanh_b; + } tests[] = { + { 0.5L, + 0.78539816339744830961566084581987572L, + 0.36847002415910435172083660522240710L, + 0.79735196663945774996093142586179334L, + 0.79735196663945774996093142586179334L, + 0.36847002415910435172083660522240710L, + 0.76159415595576488811945828260479359L, + 0.64805427366388539957497735322615032L }, + { -0.5L, + 1.57079632679489661923132169163975144L, + 0.0L, + 1.12762596520638078522622516140267201L, + 0.0L, + -0.52109530549374736162242562641149156L, + -2.16395341373865284877000401021802312L, + 0.0L }, + { 1.0L, + 2.35619449019234492884698253745962716L, + -0.83099273328405698212637979852748608L, + 1.09112278079550143030545602018565236L, + -1.09112278079550143030545602018565236L, + 0.83099273328405698212637979852748609L, + 0.96402758007581688394641372410092315L, + -0.26580222883407969212086273981988897L } + }; + long double complex z; + int i; + + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) { + z = CMPLXL(tests[i].a, tests[i].b); + testall_odd_tol(csinh, z, + CMPLXL(tests[i].sinh_a, tests[i].sinh_b), 1.1); + testall_even_tol(ccosh, z, + CMPLXL(tests[i].cosh_a, tests[i].cosh_b), 1.1); + testall_odd_tol(ctanh, z, + CMPLXL(tests[i].tanh_a, tests[i].tanh_b), 1.4); + } +} + +/* Test inputs that might cause overflow in a sloppy implementation. */ +void +test_large(void) +{ + long double complex z; + + /* tanh() uses a threshold around x=22, so check both sides. */ + z = CMPLXL(21, 0.78539816339744830961566084581987572L); + testall_odd_tol(ctanh, z, + CMPLXL(1.0, 1.14990445285871196133287617611468468e-18L), 1.2); + z++; + testall_odd_tol(ctanh, z, + CMPLXL(1.0, 1.55622644822675930314266334585597964e-19L), 1); + + z = CMPLXL(355, 0.78539816339744830961566084581987572L); + test_odd_tol(ctanh, z, + CMPLXL(1.0, 8.95257245135025991216632140458264468e-309L), + DBL_ULP()); +#if !defined(__i386__) + z = CMPLXL(30, 0x1p1023L); + test_odd_tol(ctanh, z, + CMPLXL(1.0, -1.62994325413993477997492170229268382e-26L), + DBL_ULP()); + z = CMPLXL(1, 0x1p1023L); + test_odd_tol(ctanh, z, + CMPLXL(0.878606311888306869546254022621986509L, + -0.225462792499754505792678258169527424L), + DBL_ULP()); +#endif + + z = CMPLXL(710.6, 0.78539816339744830961566084581987572L); + test_odd_tol(csinh, z, + CMPLXL(1.43917579766621073533185387499658944e308L, + 1.43917579766621073533185387499658944e308L), DBL_ULP()); + test_even_tol(ccosh, z, + CMPLXL(1.43917579766621073533185387499658944e308L, + 1.43917579766621073533185387499658944e308L), DBL_ULP()); + + z = CMPLXL(1500, 0.78539816339744830961566084581987572L); + testall_odd(csinh, z, CMPLXL(INFINITY, INFINITY), OPT_INEXACT, + FE_OVERFLOW, CS_BOTH); + testall_even(ccosh, z, CMPLXL(INFINITY, INFINITY), OPT_INEXACT, + FE_OVERFLOW, CS_BOTH); +} + +int +main(int argc, char *argv[]) +{ + + printf("1..6\n"); + + test_zero(); + printf("ok 1 - ctrig zero\n"); + + test_nan(); + printf("ok 2 - ctrig nan\n"); + + test_inf(); + printf("ok 3 - ctrig inf\n"); + + test_axes(); + printf("ok 4 - ctrig axes\n"); + + test_small(); + printf("ok 5 - ctrig small\n"); + + test_large(); + printf("ok 6 - ctrig large\n"); + + return (0); +} Copied: head/lib/msun/tests/exponential_test.c (from r292496, head/tools/regression/lib/msun/test-exponential.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/tests/exponential_test.c Sun Dec 20 05:06:44 2015 (r292497, copy of r292496, head/tools/regression/lib/msun/test-exponential.c) @@ -0,0 +1,169 @@ +/*- + * Copyright (c) 2008 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Tests for corner cases in exp*(). + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#ifdef __i386__ +#include +#endif + +#include "test-utils.h" + +#pragma STDC FENV_ACCESS ON + +/* + * Test that a function returns the correct value and sets the + * exception flags correctly. The exceptmask specifies which + * exceptions we should check. We need to be lenient for several + * reasoons, but mainly because on some architectures it's impossible + * to raise FE_OVERFLOW without raising FE_INEXACT. + * + * These are macros instead of functions so that assert provides more + * meaningful error messages. + * + * XXX The volatile here is to avoid gcc's bogus constant folding and work + * around the lack of support for the FENV_ACCESS pragma. + */ +#define test(func, x, result, exceptmask, excepts) do { \ + volatile long double _d = x; \ + assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ + assert(fpequal((func)(_d), (result))); \ + assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ +} while (0) + +/* Test all the functions that compute b^x. */ +#define _testall0(x, result, exceptmask, excepts) do { \ + test(exp, x, result, exceptmask, excepts); \ + test(expf, x, result, exceptmask, excepts); \ + test(exp2, x, result, exceptmask, excepts); \ + test(exp2f, x, result, exceptmask, excepts); \ +} while (0) + +/* Skip over exp2l on platforms that don't support it. */ +#if LDBL_PREC == 53 +#define testall0 _testall0 +#else +#define testall0(x, result, exceptmask, excepts) do { \ + _testall0(x, result, exceptmask, excepts); \ + test(exp2l, x, result, exceptmask, excepts); \ +} while (0) +#endif + +/* Test all the functions that compute b^x - 1. */ +#define testall1(x, result, exceptmask, excepts) do { \ + test(expm1, x, result, exceptmask, excepts); \ + test(expm1f, x, result, exceptmask, excepts); \ +} while (0) + +void +run_generic_tests(void) +{ + + /* exp(0) == 1, no exceptions raised */ + testall0(0.0, 1.0, ALL_STD_EXCEPT, 0); + testall1(0.0, 0.0, ALL_STD_EXCEPT, 0); + testall0(-0.0, 1.0, ALL_STD_EXCEPT, 0); + testall1(-0.0, -0.0, ALL_STD_EXCEPT, 0); + + /* exp(NaN) == NaN, no exceptions raised */ + testall0(NAN, NAN, ALL_STD_EXCEPT, 0); + testall1(NAN, NAN, ALL_STD_EXCEPT, 0); + + /* exp(Inf) == Inf, no exceptions raised */ + testall0(INFINITY, INFINITY, ALL_STD_EXCEPT, 0); + testall1(INFINITY, INFINITY, ALL_STD_EXCEPT, 0); + + /* exp(-Inf) == 0, no exceptions raised */ + testall0(-INFINITY, 0.0, ALL_STD_EXCEPT, 0); + testall1(-INFINITY, -1.0, ALL_STD_EXCEPT, 0); + +#if !defined(__i386__) + /* exp(big) == Inf, overflow exception */ + testall0(50000.0, INFINITY, ALL_STD_EXCEPT & ~FE_INEXACT, FE_OVERFLOW); + testall1(50000.0, INFINITY, ALL_STD_EXCEPT & ~FE_INEXACT, FE_OVERFLOW); + + /* exp(small) == 0, underflow and inexact exceptions */ + testall0(-50000.0, 0.0, ALL_STD_EXCEPT, FE_UNDERFLOW | FE_INEXACT); +#endif + testall1(-50000.0, -1.0, ALL_STD_EXCEPT, FE_INEXACT); +} + +void +run_exp2_tests(void) +{ + int i; + + /* + * We should insist that exp2() return exactly the correct + * result and not raise an inexact exception for integer + * arguments. + */ + feclearexcept(FE_ALL_EXCEPT); + for (i = FLT_MIN_EXP - FLT_MANT_DIG; i < FLT_MAX_EXP; i++) { + assert(exp2f(i) == ldexpf(1.0, i)); + assert(fetestexcept(ALL_STD_EXCEPT) == 0); + } + for (i = DBL_MIN_EXP - DBL_MANT_DIG; i < DBL_MAX_EXP; i++) { + assert(exp2(i) == ldexp(1.0, i)); + assert(fetestexcept(ALL_STD_EXCEPT) == 0); + } + for (i = LDBL_MIN_EXP - LDBL_MANT_DIG; i < LDBL_MAX_EXP; i++) { + assert(exp2l(i) == ldexpl(1.0, i)); + assert(fetestexcept(ALL_STD_EXCEPT) == 0); + } +} + +int +main(int argc, char *argv[]) +{ + + printf("1..3\n"); + + run_generic_tests(); + printf("ok 1 - exponential\n"); + +#ifdef __i386__ + fpsetprec(FP_PE); + run_generic_tests(); +#endif + printf("ok 2 - exponential\n"); + + run_exp2_tests(); + printf("ok 3 - exponential\n"); + + return (0); +} Copied: head/lib/msun/tests/fma_test.c (from r292496, head/tools/regression/lib/msun/test-fma.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/tests/fma_test.c Sun Dec 20 05:06:44 2015 (r292497, copy of r292496, head/tools/regression/lib/msun/test-fma.c) @@ -0,0 +1,542 @@ +/*- + * Copyright (c) 2008 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Tests for fma{,f,l}(). + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include "test-utils.h" + +#pragma STDC FENV_ACCESS ON + +/* + * Test that a function returns the correct value and sets the + * exception flags correctly. The exceptmask specifies which + * exceptions we should check. We need to be lenient for several + * reasons, but mainly because on some architectures it's impossible + * to raise FE_OVERFLOW without raising FE_INEXACT. + * + * These are macros instead of functions so that assert provides more + * meaningful error messages. + */ +#define test(func, x, y, z, result, exceptmask, excepts) do { \ + volatile long double _vx = (x), _vy = (y), _vz = (z); \ + assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ + assert(fpequal((func)(_vx, _vy, _vz), (result))); \ + assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ +} while (0) + +#define testall(x, y, z, result, exceptmask, excepts) do { \ + test(fma, (double)(x), (double)(y), (double)(z), \ + (double)(result), (exceptmask), (excepts)); \ + test(fmaf, (float)(x), (float)(y), (float)(z), \ + (float)(result), (exceptmask), (excepts)); \ + test(fmal, (x), (y), (z), (result), (exceptmask), (excepts)); \ +} while (0) + +/* Test in all rounding modes. */ +#define testrnd(func, x, y, z, rn, ru, rd, rz, exceptmask, excepts) do { \ + fesetround(FE_TONEAREST); \ + test((func), (x), (y), (z), (rn), (exceptmask), (excepts)); \ + fesetround(FE_UPWARD); \ + test((func), (x), (y), (z), (ru), (exceptmask), (excepts)); \ + fesetround(FE_DOWNWARD); \ + test((func), (x), (y), (z), (rd), (exceptmask), (excepts)); \ + fesetround(FE_TOWARDZERO); \ + test((func), (x), (y), (z), (rz), (exceptmask), (excepts)); \ +} while (0) + +/* + * This is needed because clang constant-folds fma in ways that are incorrect + * in rounding modes other than FE_TONEAREST. + */ +volatile double one = 1.0; + +static void +test_zeroes(void) +{ + const int rd = (fegetround() == FE_DOWNWARD); + + testall(0.0, 0.0, 0.0, 0.0, ALL_STD_EXCEPT, 0); + testall(1.0, 0.0, 0.0, 0.0, ALL_STD_EXCEPT, 0); + testall(0.0, 1.0, 0.0, 0.0, ALL_STD_EXCEPT, 0); + testall(0.0, 0.0, 1.0, 1.0, ALL_STD_EXCEPT, 0); + + testall(-0.0, 0.0, 0.0, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(0.0, -0.0, 0.0, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(-0.0, -0.0, 0.0, 0.0, ALL_STD_EXCEPT, 0); + testall(0.0, 0.0, -0.0, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(-0.0, -0.0, -0.0, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + + testall(-0.0, 0.0, -0.0, -0.0, ALL_STD_EXCEPT, 0); + testall(0.0, -0.0, -0.0, -0.0, ALL_STD_EXCEPT, 0); + + testall(-one, one, one, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(one, -one, one, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + testall(-one, -one, -one, rd ? -0.0 : 0.0, ALL_STD_EXCEPT, 0); + + switch (fegetround()) { + case FE_TONEAREST: + case FE_TOWARDZERO: + test(fmaf, -FLT_MIN, FLT_MIN, 0.0, -0.0, + ALL_STD_EXCEPT, FE_INEXACT | FE_UNDERFLOW); + test(fma, -DBL_MIN, DBL_MIN, 0.0, -0.0, + ALL_STD_EXCEPT, FE_INEXACT | FE_UNDERFLOW); + test(fmal, -LDBL_MIN, LDBL_MIN, 0.0, -0.0, + ALL_STD_EXCEPT, FE_INEXACT | FE_UNDERFLOW); + } +} + +static void +test_infinities(void) +{ + + testall(INFINITY, 1.0, -1.0, INFINITY, ALL_STD_EXCEPT, 0); + testall(-1.0, INFINITY, 0.0, -INFINITY, ALL_STD_EXCEPT, 0); + testall(0.0, 0.0, INFINITY, INFINITY, ALL_STD_EXCEPT, 0); + testall(1.0, 1.0, INFINITY, INFINITY, ALL_STD_EXCEPT, 0); + testall(1.0, 1.0, -INFINITY, -INFINITY, ALL_STD_EXCEPT, 0); + + testall(INFINITY, -INFINITY, 1.0, -INFINITY, ALL_STD_EXCEPT, 0); + testall(INFINITY, INFINITY, 1.0, INFINITY, ALL_STD_EXCEPT, 0); + testall(-INFINITY, -INFINITY, INFINITY, INFINITY, ALL_STD_EXCEPT, 0); + + testall(0.0, INFINITY, 1.0, NAN, ALL_STD_EXCEPT, FE_INVALID); + testall(INFINITY, 0.0, -0.0, NAN, ALL_STD_EXCEPT, FE_INVALID); + + /* The invalid exception is optional in this case. */ + testall(INFINITY, 0.0, NAN, NAN, ALL_STD_EXCEPT & ~FE_INVALID, 0); + + testall(INFINITY, INFINITY, -INFINITY, NAN, + ALL_STD_EXCEPT, FE_INVALID); + testall(-INFINITY, INFINITY, INFINITY, NAN, + ALL_STD_EXCEPT, FE_INVALID); + testall(INFINITY, -1.0, INFINITY, NAN, + ALL_STD_EXCEPT, FE_INVALID); + + test(fmaf, FLT_MAX, FLT_MAX, -INFINITY, -INFINITY, ALL_STD_EXCEPT, 0); + test(fma, DBL_MAX, DBL_MAX, -INFINITY, -INFINITY, ALL_STD_EXCEPT, 0); + test(fmal, LDBL_MAX, LDBL_MAX, -INFINITY, -INFINITY, + ALL_STD_EXCEPT, 0); + test(fmaf, FLT_MAX, -FLT_MAX, INFINITY, INFINITY, ALL_STD_EXCEPT, 0); + test(fma, DBL_MAX, -DBL_MAX, INFINITY, INFINITY, ALL_STD_EXCEPT, 0); + test(fmal, LDBL_MAX, -LDBL_MAX, INFINITY, INFINITY, + ALL_STD_EXCEPT, 0); +} + +static void +test_nans(void) +{ + + testall(NAN, 0.0, 0.0, NAN, ALL_STD_EXCEPT, 0); + testall(1.0, NAN, 1.0, NAN, ALL_STD_EXCEPT, 0); + testall(1.0, -1.0, NAN, NAN, ALL_STD_EXCEPT, 0); + testall(0.0, 0.0, NAN, NAN, ALL_STD_EXCEPT, 0); + testall(NAN, NAN, NAN, NAN, ALL_STD_EXCEPT, 0); + + /* x*y should not raise an inexact/overflow/underflow if z is NaN. */ + testall(M_PI, M_PI, NAN, NAN, ALL_STD_EXCEPT, 0); + test(fmaf, FLT_MIN, FLT_MIN, NAN, NAN, ALL_STD_EXCEPT, 0); + test(fma, DBL_MIN, DBL_MIN, NAN, NAN, ALL_STD_EXCEPT, 0); + test(fmal, LDBL_MIN, LDBL_MIN, NAN, NAN, ALL_STD_EXCEPT, 0); + test(fmaf, FLT_MAX, FLT_MAX, NAN, NAN, ALL_STD_EXCEPT, 0); + test(fma, DBL_MAX, DBL_MAX, NAN, NAN, ALL_STD_EXCEPT, 0); + test(fmal, LDBL_MAX, LDBL_MAX, NAN, NAN, ALL_STD_EXCEPT, 0); +} + +/* + * Tests for cases where z is very small compared to x*y. + */ +static void +test_small_z(void) +{ + + /* x*y positive, z positive */ + if (fegetround() == FE_UPWARD) { + test(fmaf, one, one, 0x1.0p-100, 1.0 + FLT_EPSILON, + ALL_STD_EXCEPT, FE_INEXACT); + test(fma, one, one, 0x1.0p-200, 1.0 + DBL_EPSILON, + ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, one, one, 0x1.0p-200, 1.0 + LDBL_EPSILON, + ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(0x1.0p100, one, 0x1.0p-100, 0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } + + /* x*y negative, z negative */ + if (fegetround() == FE_DOWNWARD) { + test(fmaf, -one, one, -0x1.0p-100, -(1.0 + FLT_EPSILON), + ALL_STD_EXCEPT, FE_INEXACT); + test(fma, -one, one, -0x1.0p-200, -(1.0 + DBL_EPSILON), + ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, -one, one, -0x1.0p-200, -(1.0 + LDBL_EPSILON), + ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(0x1.0p100, -one, -0x1.0p-100, -0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } + + /* x*y positive, z negative */ + if (fegetround() == FE_DOWNWARD || fegetround() == FE_TOWARDZERO) { + test(fmaf, one, one, -0x1.0p-100, 1.0 - FLT_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + test(fma, one, one, -0x1.0p-200, 1.0 - DBL_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, one, one, -0x1.0p-200, 1.0 - LDBL_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(0x1.0p100, one, -0x1.0p-100, 0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } + + /* x*y negative, z positive */ + if (fegetround() == FE_UPWARD || fegetround() == FE_TOWARDZERO) { + test(fmaf, -one, one, 0x1.0p-100, -1.0 + FLT_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + test(fma, -one, one, 0x1.0p-200, -1.0 + DBL_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, -one, one, 0x1.0p-200, -1.0 + LDBL_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(-0x1.0p100, one, 0x1.0p-100, -0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } +} + +/* + * Tests for cases where z is very large compared to x*y. + */ +static void +test_big_z(void) +{ + + /* z positive, x*y positive */ + if (fegetround() == FE_UPWARD) { + test(fmaf, 0x1.0p-50, 0x1.0p-50, 1.0, 1.0 + FLT_EPSILON, + ALL_STD_EXCEPT, FE_INEXACT); + test(fma, 0x1.0p-100, 0x1.0p-100, 1.0, 1.0 + DBL_EPSILON, + ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, 0x1.0p-100, 0x1.0p-100, 1.0, 1.0 + LDBL_EPSILON, + ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(-0x1.0p-50, -0x1.0p-50, 0x1.0p100, 0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } + + /* z negative, x*y negative */ + if (fegetround() == FE_DOWNWARD) { + test(fmaf, -0x1.0p-50, 0x1.0p-50, -1.0, -(1.0 + FLT_EPSILON), + ALL_STD_EXCEPT, FE_INEXACT); + test(fma, -0x1.0p-100, 0x1.0p-100, -1.0, -(1.0 + DBL_EPSILON), + ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, -0x1.0p-100, 0x1.0p-100, -1.0, -(1.0 + LDBL_EPSILON), + ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(0x1.0p-50, -0x1.0p-50, -0x1.0p100, -0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } + + /* z negative, x*y positive */ + if (fegetround() == FE_UPWARD || fegetround() == FE_TOWARDZERO) { + test(fmaf, -0x1.0p-50, -0x1.0p-50, -1.0, + -1.0 + FLT_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); + test(fma, -0x1.0p-100, -0x1.0p-100, -1.0, + -1.0 + DBL_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, -0x1.0p-100, -0x1.0p-100, -1.0, + -1.0 + LDBL_EPSILON / 2, ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(0x1.0p-50, 0x1.0p-50, -0x1.0p100, -0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } + + /* z positive, x*y negative */ + if (fegetround() == FE_DOWNWARD || fegetround() == FE_TOWARDZERO) { + test(fmaf, 0x1.0p-50, -0x1.0p-50, 1.0, 1.0 - FLT_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + test(fma, 0x1.0p-100, -0x1.0p-100, 1.0, 1.0 - DBL_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + test(fmal, 0x1.0p-100, -0x1.0p-100, 1.0, 1.0 - LDBL_EPSILON / 2, + ALL_STD_EXCEPT, FE_INEXACT); + } else { + testall(-0x1.0p-50, 0x1.0p-50, 0x1.0p100, 0x1.0p100, + ALL_STD_EXCEPT, FE_INEXACT); + } +} + +static void +test_accuracy(void) +{ + + /* ilogb(x*y) - ilogb(z) = 20 */ + testrnd(fmaf, -0x1.c139d8p-51, -0x1.600e7ap32, 0x1.26558cp-38, + 0x1.34e48ap-18, 0x1.34e48cp-18, 0x1.34e48ap-18, 0x1.34e48ap-18, + ALL_STD_EXCEPT, FE_INEXACT); + testrnd(fma, -0x1.c139d7b84f1a3p-51, -0x1.600e7a2a16484p32, + 0x1.26558cac31580p-38, 0x1.34e48a78aae97p-18, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Dec 20 05:22:00 2015 Return-Path: Delivered-To: svn-src-all@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 8D0A6A4D061; Sun, 20 Dec 2015 05:22: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 5A77418DC; Sun, 20 Dec 2015 05:22: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 tBK5Lx5c096288; Sun, 20 Dec 2015 05:21:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK5LxM1096287; Sun, 20 Dec 2015 05:21:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201512200521.tBK5LxM1096287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 20 Dec 2015 05:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292499 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 05:22:00 -0000 Author: markj Date: Sun Dec 20 05:21:59 2015 New Revision: 292499 URL: https://svnweb.freebsd.org/changeset/base/292499 Log: Bump __FreeBSD_version for r292469. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Dec 20 05:20:52 2015 (r292498) +++ head/sys/sys/param.h Sun Dec 20 05:21:59 2015 (r292499) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100091 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100092 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Sun Dec 20 05:38:07 2015 Return-Path: Delivered-To: svn-src-all@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 D904CA4DA5E; Sun, 20 Dec 2015 05:38:07 +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 9181A10A1; Sun, 20 Dec 2015 05:38:07 +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 tBK5c6pQ001574; Sun, 20 Dec 2015 05:38:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK5c6d2001573; Sun, 20 Dec 2015 05:38:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200538.tBK5c6d2001573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 05:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292500 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 05:38:07 -0000 Author: ngie Date: Sun Dec 20 05:38:06 2015 New Revision: 292500 URL: https://svnweb.freebsd.org/changeset/base/292500 Log: Simplify Kyuafile generation logic with KYUAFILE == auto and related complexity with variables MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff) Reviewed by: emaste, Evan Cramer Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/suite.test.mk Modified: head/share/mk/suite.test.mk ============================================================================== --- head/share/mk/suite.test.mk Sun Dec 20 05:21:59 2015 (r292499) +++ head/share/mk/suite.test.mk Sun Dec 20 05:38:06 2015 (r292500) @@ -52,24 +52,20 @@ KYUAFILE?= auto # hierarchy specified by this variable. KYUA_PREFIX?= /usr/local -.if ${KYUAFILE:tl} == "yes" +.if ${KYUAFILE:tl} != "no" FILES+= Kyuafile FILESDIR_Kyuafile= ${TESTSDIR} +.endif -CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp -.elif ${KYUAFILE:tl} == "auto" -FILES+= Kyuafile.auto -FILESDIR_Kyuafile.auto= ${TESTSDIR} -FILESNAME_Kyuafile.auto= Kyuafile - -CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp +.if ${KYUAFILE:tl} == "auto" +CLEANFILES+= Kyuafile Kyuafile.auto.tmp +.endif .for _T in ${_TESTS} _TEST_METADATA.${_T}= ${TEST_METADATA} ${TEST_METADATA.${_T}} .endfor -.NOPATH: Kyuafile.auto -Kyuafile.auto: Makefile +Kyuafile: Makefile @{ \ echo '-- Automatically generated by bsd.test.mk.'; \ echo; \ @@ -77,15 +73,15 @@ Kyuafile.auto: Makefile echo; \ echo 'test_suite("${TESTSUITE}")'; \ echo; \ - } >Kyuafile.auto.tmp + } > ${.TARGET}.tmp .for _T in ${_TESTS} @echo '${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${_TEST_METADATA.${_T}:C/$/,/:tW:C/^/, /W:C/,$//W}}' \ - >>Kyuafile.auto.tmp + >>${.TARGET}.tmp .endfor .for _T in ${TESTS_SUBDIRS:N.WAIT} - @echo "include(\"${_T}/Kyuafile\")" >>Kyuafile.auto.tmp + @echo "include(\"${_T}/Kyuafile\")" >>${.TARGET}.tmp .endfor - @mv Kyuafile.auto.tmp Kyuafile.auto + @mv ${.TARGET}.tmp ${.TARGET} .endif KYUA?= ${KYUA_PREFIX}/bin/kyua From owner-svn-src-all@freebsd.org Sun Dec 20 05:41:13 2015 Return-Path: Delivered-To: svn-src-all@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 9CDA6A4DD14; Sun, 20 Dec 2015 05:41:13 +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 6E2E113B4; Sun, 20 Dec 2015 05:41:13 +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 tBK5fCf5004165; Sun, 20 Dec 2015 05:41:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK5fCDh004164; Sun, 20 Dec 2015 05:41:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200541.tBK5fCDh004164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 05:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292501 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 05:41:13 -0000 Author: ngie Date: Sun Dec 20 05:41:12 2015 New Revision: 292501 URL: https://svnweb.freebsd.org/changeset/base/292501 Log: Fix typo in r292500 by adding missing conditional statement MFC after: 1 week X-MFC with: r292500 Pointyhat to: ngie Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff) Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/suite.test.mk Modified: head/share/mk/suite.test.mk ============================================================================== --- head/share/mk/suite.test.mk Sun Dec 20 05:38:06 2015 (r292500) +++ head/share/mk/suite.test.mk Sun Dec 20 05:41:12 2015 (r292501) @@ -65,6 +65,7 @@ CLEANFILES+= Kyuafile Kyuafile.auto.tmp _TEST_METADATA.${_T}= ${TEST_METADATA} ${TEST_METADATA.${_T}} .endfor +.if ${KYUAFILE:tl} == "auto" Kyuafile: Makefile @{ \ echo '-- Automatically generated by bsd.test.mk.'; \ From owner-svn-src-all@freebsd.org Sun Dec 20 05:52:04 2015 Return-Path: Delivered-To: svn-src-all@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 8C075A143CD; Sun, 20 Dec 2015 05:52:04 +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 56DE61A69; Sun, 20 Dec 2015 05:52:04 +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 tBK5q3Kc007139; Sun, 20 Dec 2015 05:52:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK5q3l5007138; Sun, 20 Dec 2015 05:52:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200552.tBK5q3l5007138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 05:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292502 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 05:52:04 -0000 Author: ngie Date: Sun Dec 20 05:52:03 2015 New Revision: 292502 URL: https://svnweb.freebsd.org/changeset/base/292502 Log: Always expose LOCALBASE, not just when CROSS_TOOLCHAIN is defined Instead of using which(1) to look for doxygen, look for it in /bin . $PATH gets mangled by make buildenv, etc so it's better to just be explicit about the path if someone uses that for instance. Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff) Reviewed by: emaste, Evan Cramer Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Dec 20 05:41:12 2015 (r292501) +++ head/Makefile.inc1 Sun Dec 20 05:52:03 2015 (r292502) @@ -48,10 +48,11 @@ .error "Both TARGET and TARGET_ARCH must be defined." .endif +LOCALBASE?= /usr/local + # Cross toolchain changes must be in effect before bsd.compiler.mk # so that gets the right CC, and pass CROSS_TOOLCHAIN to submakes. .if defined(CROSS_TOOLCHAIN) -LOCALBASE?= /usr/local .include "${LOCALBASE}/share/toolchains/${CROSS_TOOLCHAIN}.mk" CROSSENV+=CROSS_TOOLCHAIN="${CROSS_TOOLCHAIN}" .endif @@ -1314,7 +1315,7 @@ packagekernel: # Build the API documentation with doxygen # doxygen: .PHONY - @if [ ! -x `/usr/bin/which 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-all@freebsd.org Sun Dec 20 06:01:54 2015 Return-Path: Delivered-To: svn-src-all@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 EFA5FA14A5D; Sun, 20 Dec 2015 06:01:54 +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 C0BC41EA9; Sun, 20 Dec 2015 06:01:54 +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 tBK61rE8007590; Sun, 20 Dec 2015 06:01:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK61ruc007589; Sun, 20 Dec 2015 06:01:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200601.tBK61ruc007589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 06:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292504 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 06:01:55 -0000 Author: ngie Date: Sun Dec 20 06:01:53 2015 New Revision: 292504 URL: https://svnweb.freebsd.org/changeset/base/292504 Log: Deal with another hardcoded reference to Kyuafile in the KYUAFILE == auto case Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff) Reviewed by: emaste, Evan Cramer Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/suite.test.mk Modified: head/share/mk/suite.test.mk ============================================================================== --- head/share/mk/suite.test.mk Sun Dec 20 05:59:46 2015 (r292503) +++ head/share/mk/suite.test.mk Sun Dec 20 06:01:53 2015 (r292504) @@ -80,7 +80,7 @@ Kyuafile: Makefile >>${.TARGET}.tmp .endfor .for _T in ${TESTS_SUBDIRS:N.WAIT} - @echo "include(\"${_T}/Kyuafile\")" >>${.TARGET}.tmp + @echo "include(\"${_T}/${.TARGET}\")" >>${.TARGET}.tmp .endfor @mv ${.TARGET}.tmp ${.TARGET} .endif From owner-svn-src-all@freebsd.org Sun Dec 20 06:26:16 2015 Return-Path: Delivered-To: svn-src-all@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 B0E8DA40C3B; Sun, 20 Dec 2015 06:26:16 +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 684741C4E; Sun, 20 Dec 2015 06:26:16 +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 tBK6QFYp016104; Sun, 20 Dec 2015 06:26:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK6QFCN016101; Sun, 20 Dec 2015 06:26:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200626.tBK6QFCN016101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 06:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292507 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 06:26:16 -0000 Author: ngie Date: Sun Dec 20 06:26:15 2015 New Revision: 292507 URL: https://svnweb.freebsd.org/changeset/base/292507 Log: - Use LOCALBASE instead of KYUA_PREFIX for the --prefix to kyua(1) - Use LOCALBASE instead of hardcoding /usr/local for perl MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff) Reviewed by: emaste, Evan Cramer Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.test.mk head/share/mk/suite.test.mk head/share/mk/tap.test.mk Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Sun Dec 20 06:13:18 2015 (r292506) +++ head/share/mk/bsd.test.mk Sun Dec 20 06:26:15 2015 (r292507) @@ -10,6 +10,9 @@ ____: +# Third-party software (kyua, etc) prefix. +LOCALBASE?= /usr/local + # Tests install directory TESTSDIR?= ${TESTSBASE}/${RELDIR:H} Modified: head/share/mk/suite.test.mk ============================================================================== --- head/share/mk/suite.test.mk Sun Dec 20 06:13:18 2015 (r292506) +++ head/share/mk/suite.test.mk Sun Dec 20 06:26:15 2015 (r292507) @@ -45,13 +45,6 @@ KYUAFILE?= auto # unqualified TEST_METADATA variable. #TEST_METADATA.+= key="value" -# Path to the prefix of the installed Kyua CLI, if any. -# -# If kyua is installed from ports, we automatically define a realtest target -# below to run the tests using this tool. The tools are searched for in the -# hierarchy specified by this variable. -KYUA_PREFIX?= /usr/local - .if ${KYUAFILE:tl} != "no" FILES+= Kyuafile FILESDIR_Kyuafile= ${TESTSDIR} @@ -85,7 +78,7 @@ Kyuafile: Makefile @mv ${.TARGET}.tmp ${.TARGET} .endif -KYUA?= ${KYUA_PREFIX}/bin/kyua +KYUA= ${LOCALBASE}/bin/kyua .if exists(${KYUA}) # Definition of the "make test" target and supporting variables. # Modified: head/share/mk/tap.test.mk ============================================================================== --- head/share/mk/tap.test.mk Sun Dec 20 06:13:18 2015 (r292506) +++ head/share/mk/tap.test.mk Sun Dec 20 06:26:15 2015 (r292507) @@ -26,7 +26,7 @@ TAP_TESTS_PERL?= TAP_TESTS_SH?= # Perl interpreter to use for test programs written in this language. -TAP_PERL_INTERPRETER?= /usr/local/bin/perl +TAP_PERL_INTERPRETER?= ${LOCALBASE}/bin/perl .if !empty(TAP_TESTS_C) PROGS+= ${TAP_TESTS_C} From owner-svn-src-all@freebsd.org Sun Dec 20 06:27:37 2015 Return-Path: Delivered-To: svn-src-all@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 D7CB6A40D50; Sun, 20 Dec 2015 06:27:37 +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 A8F711DB5; Sun, 20 Dec 2015 06:27:37 +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 tBK6Ra42016186; Sun, 20 Dec 2015 06:27:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK6Ra4b016185; Sun, 20 Dec 2015 06:27:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200627.tBK6Ra4b016185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 06:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292508 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 06:27:37 -0000 Author: ngie Date: Sun Dec 20 06:27:36 2015 New Revision: 292508 URL: https://svnweb.freebsd.org/changeset/base/292508 Log: Document LOCALBASE in the bsd.test.mk section MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff) Reviewed by: emaste, Evan Cramer Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Sun Dec 20 06:26:15 2015 (r292507) +++ head/share/mk/bsd.README Sun Dec 20 06:27:36 2015 (r292508) @@ -492,6 +492,10 @@ KYUAFILE If 'auto' (the default), genera subdirectories providing helper programs or data files only). +LOCALBASE The --prefix for the kyua package. + + The value of LOCALBASE defaults to /usr/local . + ATF_TESTS_C The names of the ATF C test programs to build. ATF_TESTS_CXX The names of the ATF C++ test programs to build. From owner-svn-src-all@freebsd.org Sun Dec 20 06:29:05 2015 Return-Path: Delivered-To: svn-src-all@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 4EF5CA40E8D; Sun, 20 Dec 2015 06:29:05 +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 1EDB11F3C; Sun, 20 Dec 2015 06:29:05 +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 tBK6T4QY016278; Sun, 20 Dec 2015 06:29:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBK6T41h016277; Sun, 20 Dec 2015 06:29:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512200629.tBK6T41h016277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 20 Dec 2015 06:29:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292509 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 06:29:05 -0000 Author: ngie Date: Sun Dec 20 06:29:03 2015 New Revision: 292509 URL: https://svnweb.freebsd.org/changeset/base/292509 Log: Clean up Kyuafile.tmp, not Kyuafile.auto.tmp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4406 (part of a larger diff) Reviewed by: emaste, Evan Cramer Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/suite.test.mk Modified: head/share/mk/suite.test.mk ============================================================================== --- head/share/mk/suite.test.mk Sun Dec 20 06:27:36 2015 (r292508) +++ head/share/mk/suite.test.mk Sun Dec 20 06:29:03 2015 (r292509) @@ -51,7 +51,7 @@ FILESDIR_Kyuafile= ${TESTSDIR} .endif .if ${KYUAFILE:tl} == "auto" -CLEANFILES+= Kyuafile Kyuafile.auto.tmp +CLEANFILES+= Kyuafile Kyuafile.tmp .endif .for _T in ${_TESTS} From owner-svn-src-all@freebsd.org Sun Dec 20 11:55:40 2015 Return-Path: Delivered-To: svn-src-all@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 D60E0A4DD96; Sun, 20 Dec 2015 11:55: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 A6D5D1179; Sun, 20 Dec 2015 11:55: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 tBKBtdhe013193; Sun, 20 Dec 2015 11:55:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKBtdEx013192; Sun, 20 Dec 2015 11:55:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512201155.tBKBtdEx013192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 20 Dec 2015 11:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292510 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 11:55:40 -0000 Author: kib Date: Sun Dec 20 11:55:39 2015 New Revision: 292510 URL: https://svnweb.freebsd.org/changeset/base/292510 Log: Fix lockf(3) cancellation behaviour. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/gen/lockf.c Modified: head/lib/libc/gen/lockf.c ============================================================================== --- head/lib/libc/gen/lockf.c Sun Dec 20 06:29:03 2015 (r292509) +++ head/lib/libc/gen/lockf.c Sun Dec 20 11:55:39 2015 (r292510) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "libc_private.h" int lockf(int filedes, int function, off_t size) @@ -62,9 +63,12 @@ lockf(int filedes, int function, off_t s break; case F_TEST: fl.l_type = F_WRLCK; - if (_fcntl(filedes, F_GETLK, &fl) == -1) + if (((int (*)(int, int, ...)) + __libc_interposing[INTERPOS_fcntl])(filedes, F_GETLK, &fl) + == -1) return (-1); - if (fl.l_type == F_UNLCK || (fl.l_sysid == 0 && fl.l_pid == getpid())) + if (fl.l_type == F_UNLCK || (fl.l_sysid == 0 && + fl.l_pid == getpid())) return (0); errno = EAGAIN; return (-1); @@ -75,5 +79,6 @@ lockf(int filedes, int function, off_t s /* NOTREACHED */ } - return (_fcntl(filedes, cmd, &fl)); + return (((int (*)(int, int, ...)) + __libc_interposing[INTERPOS_fcntl])(filedes, cmd, &fl)); } From owner-svn-src-all@freebsd.org Sun Dec 20 13:02:22 2015 Return-Path: Delivered-To: svn-src-all@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 2FD65A4BDDC; Sun, 20 Dec 2015 13:02:22 +0000 (UTC) (envelope-from kristof@sigsegv.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC6B21EA3; Sun, 20 Dec 2015 13:02:21 +0000 (UTC) (envelope-from kristof@sigsegv.be) Received: from voyager.saturn.sigsegv.be (78-22-43-218.access.telenet.be [78.22.43.218]) by venus.codepro.be (Postfix) with ESMTPSA id 2E2508C4E; Sun, 20 Dec 2015 14:02:17 +0100 (CET) Subject: Re: svn commit: r292309 - in head/sys: modules modules/tcp modules/tcp/fastpath netinet netinet/tcp_stacks Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: text/plain; charset=us-ascii From: Kristof Provost X-Checked-By-Nsa: Probably In-Reply-To: Date: Sun, 20 Dec 2015 14:02:19 +0100 Cc: Randall Stewart , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: 7bit Message-Id: <64CFAD8D-926E-4F45-B441-FDD52D841BFC@sigsegv.be> References: <201512160056.tBG0ujqA067178@repo.freebsd.org> <3E097253-0E8E-4A50-B1BD-8C9A280E6CD0@sigsegv.be> To: "Jonathan T. Looney" X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 13:02:22 -0000 > On 19 Dec 2015, at 19:53, Jonathan T. Looney wrote: > > On 12/18/15, 3:54 PM, "owner-src-committers@freebsd.org on behalf of > Kristof Provost" kristof@sigsegv.be> wrote: > >> >>> On 16 Dec 2015, at 01:56, Randall Stewart wrote: >>> >>> Author: rrs >>> Date: Wed Dec 16 00:56:45 2015 >>> New Revision: 292309 >>> URL: https://svnweb.freebsd.org/changeset/base/292309 >>> >>> Log: >>> First cut of the modularization of our TCP stack. Still >>> to do is to clean up the timer handling using the async-drain. >>> Other optimizations may be coming to go with this. Whats here >>> will allow differnet tcp implementations (one included). >>> Reviewed by: jtl, hiren, transports >>> Sponsored by: Netflix Inc. >>> Differential Revision: D4055 >> >> I suspect this commit broke my machine. I run VIMAGE jails, and see the >> following panic as soon as the first jails starts: > > I think Randall is now (or soon will be) on holiday. Can you try the patch > from https://reviews.freebsd.org/D4645 (also attached) and let me know if > that fixes the problem? Thanks for the patch. The system now boots and seems to be working correctly. I hope everyone enjoys their holidays ;) Regards, Kristof From owner-svn-src-all@freebsd.org Sun Dec 20 13:41:07 2015 Return-Path: Delivered-To: svn-src-all@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 C25AAA4D6EE; Sun, 20 Dec 2015 13:41:07 +0000 (UTC) (envelope-from jilles@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 9302B1C8B; Sun, 20 Dec 2015 13:41:07 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBKDf6xa042356; Sun, 20 Dec 2015 13:41:06 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKDf6jT042355; Sun, 20 Dec 2015 13:41:06 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201512201341.tBKDf6jT042355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 20 Dec 2015 13:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292511 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 13:41:07 -0000 Author: jilles Date: Sun Dec 20 13:41:06 2015 New Revision: 292511 URL: https://svnweb.freebsd.org/changeset/base/292511 Log: MFC r292130: exec(3): Fix COMPATIBILITY section: default path does not contain cwd. Modified: stable/10/lib/libc/gen/exec.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/exec.3 ============================================================================== --- stable/10/lib/libc/gen/exec.3 Sun Dec 20 11:55:39 2015 (r292510) +++ stable/10/lib/libc/gen/exec.3 Sun Dec 20 13:41:06 2015 (r292511) @@ -28,7 +28,7 @@ .\" @(#)exec.3 8.3 (Berkeley) 1/24/94 .\" $FreeBSD$ .\" -.Dd January 24, 1994 +.Dd December 12, 2015 .Dt EXEC 3 .Os .Sh NAME @@ -223,7 +223,7 @@ and .Fn execvp functions was .Dq Pa :/bin:/usr/bin . -This was changed to place the current directory last to enhance system +This was changed to remove the current directory to enhance system security. .Pp The behavior of From owner-svn-src-all@freebsd.org Sun Dec 20 14:59:31 2015 Return-Path: Delivered-To: svn-src-all@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 B9DBBA4DD2A; Sun, 20 Dec 2015 14:59:31 +0000 (UTC) (envelope-from ume@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 7ABA41765; Sun, 20 Dec 2015 14:59:31 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBKExUHB064853; Sun, 20 Dec 2015 14:59:30 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKExUGV064847; Sun, 20 Dec 2015 14:59:30 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512201459.tBKExUGV064847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Sun, 20 Dec 2015 14:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292512 - in head: share/timedef tools/tools/locale/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 14:59:31 -0000 Author: ume Date: Sun Dec 20 14:59:30 2015 New Revision: 292512 URL: https://svnweb.freebsd.org/changeset/base/292512 Log: Restore a day of the week in date(1) output for Japanese locales. It was lost by recent locale change. Modified: head/share/timedef/ja_JP.SJIS.src head/share/timedef/ja_JP.UTF-8.src head/share/timedef/ja_JP.eucJP.src head/tools/tools/locale/tools/cldr2def.pl Modified: head/share/timedef/ja_JP.SJIS.src ============================================================================== --- head/share/timedef/ja_JP.SJIS.src Sun Dec 20 13:41:06 2015 (r292511) +++ head/share/timedef/ja_JP.SJIS.src Sun Dec 20 14:59:30 2015 (r292512) @@ -63,7 +63,7 @@ ŒßŒã # # date_fmt -%Y”N%mŒŽ%e“ú %H:%M:%S %Z +%Y”N%mŒŽ%e“ú %A %H:%M:%S %Z # # Long month names (without case ending) 1ŒŽ Modified: head/share/timedef/ja_JP.UTF-8.src ============================================================================== --- head/share/timedef/ja_JP.UTF-8.src Sun Dec 20 13:41:06 2015 (r292511) +++ head/share/timedef/ja_JP.UTF-8.src Sun Dec 20 14:59:30 2015 (r292512) @@ -56,14 +56,14 @@ %Y/%m/%d # # c_fmt -%Yå¹´%m月%eæ—¥ %H:%M:%S +%Yå¹´%m月%eæ—¥ %A %H:%M:%S # # AM/PM åˆå‰ åˆå¾Œ # # date_fmt -%Yå¹´%m月%eæ—¥ %H:%M:%S %Z +%Yå¹´%m月%eæ—¥ %A %H:%M:%S %Z # # Long month names (without case ending) 1月 Modified: head/share/timedef/ja_JP.eucJP.src ============================================================================== --- head/share/timedef/ja_JP.eucJP.src Sun Dec 20 13:41:06 2015 (r292511) +++ head/share/timedef/ja_JP.eucJP.src Sun Dec 20 14:59:30 2015 (r292512) @@ -56,14 +56,14 @@ %Y/%m/%d # # c_fmt -%Yǯ%m·î%eÆü %H:%M:%S +%Yǯ%m·î%eÆü %A %H:%M:%S # # AM/PM ¸áÁ° ¸á¸å # # date_fmt -%Yǯ%m·î%eÆü %H:%M:%S %Z +%Yǯ%m·î%eÆü %A %H:%M:%S %Z # # Long month names (without case ending) 1·î Modified: head/tools/tools/locale/tools/cldr2def.pl ============================================================================== --- head/tools/tools/locale/tools/cldr2def.pl Sun Dec 20 13:41:06 2015 (r292511) +++ head/tools/tools/locale/tools/cldr2def.pl Sun Dec 20 14:59:30 2015 (r292512) @@ -67,6 +67,7 @@ my %callback = ( mdorder => \&callback_mdorder, altmon => \&callback_altmon, cformat => \&callback_cformat, + dtformat => \&callback_dtformat, cbabmon => \&callback_abmon, data => undef, ); @@ -184,7 +185,7 @@ if ($TYPE eq "timedef") { "c_fmt" => " "as", "d_fmt" => "s", - "d_t_fmt" => "s", + "d_t_fmt" => " " " "s", @@ -201,6 +202,16 @@ sub callback_cformat { return $s; }; +sub callback_dtformat { + my $s = shift; + my $nl = $callback{data}{l} . "_" . $callback{data}{c}; + + if ($nl eq 'ja_JP') { + $s =~ s/(> )(%H)/$1%A $2/; + } + return $s; +}; + sub callback_mdorder { my $s = shift; return undef if (!defined $s); From owner-svn-src-all@freebsd.org Sun Dec 20 15:11:12 2015 Return-Path: Delivered-To: svn-src-all@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 B96E9A4C529; Sun, 20 Dec 2015 15:11:12 +0000 (UTC) (envelope-from jilles@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 6FA831CB0; Sun, 20 Dec 2015 15:11:12 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBKFBBiL069691; Sun, 20 Dec 2015 15:11:11 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKFBB0P069689; Sun, 20 Dec 2015 15:11:11 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201512201511.tBKFBB0P069689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 20 Dec 2015 15:11:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292513 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 15:11:12 -0000 Author: jilles Date: Sun Dec 20 15:11:11 2015 New Revision: 292513 URL: https://svnweb.freebsd.org/changeset/base/292513 Log: clock_gettime(2),gettimeofday(2): Remove [EFAULT] error. Depending on system configuration and parameters, clock_gettime() and gettimeofday() may not be system calls. If so, passing an invalid pointer will cause a signal and not an [EFAULT] error. From a standards perspective, this is OK since passing an invalid pointer is undefined behaviour. MFC after: 1 week Modified: head/lib/libc/sys/clock_gettime.2 head/lib/libc/sys/gettimeofday.2 Modified: head/lib/libc/sys/clock_gettime.2 ============================================================================== --- head/lib/libc/sys/clock_gettime.2 Sun Dec 20 14:59:30 2015 (r292512) +++ head/lib/libc/sys/clock_gettime.2 Sun Dec 20 15:11:11 2015 (r292513) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 29, 2009 +.Dd December 20, 2015 .Dt CLOCK_GETTIME 2 .Os .Sh NAME @@ -136,10 +136,6 @@ The .Fa clock_id argument was not a valid value. -.It Bq Er EFAULT -The -.Fa *tp -argument address referenced invalid memory. .It Bq Er EPERM A user other than the super-user attempted to set the time. .El Modified: head/lib/libc/sys/gettimeofday.2 ============================================================================== --- head/lib/libc/sys/gettimeofday.2 Sun Dec 20 14:59:30 2015 (r292512) +++ head/lib/libc/sys/gettimeofday.2 Sun Dec 20 15:11:11 2015 (r292513) @@ -28,7 +28,7 @@ .\" @(#)gettimeofday.2 8.2 (Berkeley) 5/26/95 .\" $FreeBSD$ .\" -.Dd May 26, 1995 +.Dd December 20, 2015 .Dt GETTIMEOFDAY 2 .Os .Sh NAME @@ -110,8 +110,6 @@ system call even when the system is secu The following error codes may be set in .Va errno : .Bl -tag -width Er -.It Bq Er EFAULT -An argument address referenced invalid memory. .It Bq Er EPERM A user other than the super-user attempted to set the time. .El From owner-svn-src-all@freebsd.org Sun Dec 20 15:16:48 2015 Return-Path: Delivered-To: svn-src-all@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 EE740A4C93B; Sun, 20 Dec 2015 15:16:48 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (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 8B1F11FF0; Sun, 20 Dec 2015 15:16:48 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id p187so40559930wmp.1; Sun, 20 Dec 2015 07:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=OfmXKihJ2ut+Kt2LRYdf26O03jJGiUhaaYNcFifAacc=; b=tRUmLigtfvbUJN5NcZL6Dd9fijYNq5IuJ8NWDsuA4JYZGqnujbN5Ach7ztPogKkYXe Dywcw1jTn3TpgZuhp771EjCK6zKnReHuMZsCSMn/wTgsSuSc6WO0bxf7E6A3YDi8iFBN XWPgvUmcxCGu7qpvyUWOJqlUqb6P/mjBeRy+IBme0gRggNXCWdsoed+zJPB9JJKewyJ2 jLsLDhX37+UCE9sIfi5uIkh6lWKHxJuT4PcCCQJZFyEbz1r00kOEoPTDex5TCH/q/g6j M6/f9y9CX15FBPPksZFSHAuLL9hkgWNs0i23GTylLrIXxjO1MGwtGICubx2Ql7iWlj7B Rhog== X-Received: by 10.194.87.39 with SMTP id u7mr15273706wjz.11.1450624606902; Sun, 20 Dec 2015 07:16:46 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id v129sm15717450wmg.21.2015.12.20.07.16.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Dec 2015 07:16:46 -0800 (PST) Sender: Baptiste Daroussin Date: Sun, 20 Dec 2015 16:16:44 +0100 From: Baptiste Daroussin To: Hajimu UMEMOTO Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292512 - in head: share/timedef tools/tools/locale/tools Message-ID: <20151220151644.GG41161@ivaldir.etoilebsd.net> References: <201512201459.tBKExUGV064847@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WR+jf/RUebEcofwt" Content-Disposition: inline In-Reply-To: <201512201459.tBKExUGV064847@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 15:16:49 -0000 --WR+jf/RUebEcofwt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 20, 2015 at 02:59:30PM +0000, Hajimu UMEMOTO wrote: > Author: ume > Date: Sun Dec 20 14:59:30 2015 > New Revision: 292512 > URL: https://svnweb.freebsd.org/changeset/base/292512 >=20 > Log: > Restore a day of the week in date(1) output for Japanese locales. > It was lost by recent locale change. >=20 Thanks! Might be interesting to report that upstream: http://cldr.unicode.org/ the = less we have specific code the better we are :) Best regards, Bapt --WR+jf/RUebEcofwt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWdsZcAAoJEGOJi9zxtz5aMQEP/jqPWbT2WATyUxSxs2E2BuEI P83nAN8xI2IU2TUXzaGQBPAOgJbi3g5mgTuwXu3H4i9FgALBQ8n3cowpVONXg1By PbHU3ZFCIefXAmRIhENYhw9zBj+wySoszWebMdpubgJANiI71NQvJJ4YbzqxdHrb +cyNElr1xHH/c4BH6hUpMn5OGuyPEgIRBhoKyRTqD/oAebmUfYy7FNxG/RxafeGI RFgVDTC+M3CXo3rp45IujDYDbva4esJ0hAPww5jB9y2fR7V1SXARrJKPOY71AWXl koGM6ne/rMrfNjTOm4p3CExXCtM5sgNK82ik1Ywsa4N++rQgtyxr+MsZWTpjIZ2B z0sGKV+dqFrYFTYtV9LeUMcfFl2cXriYrCuVqhbPucbBeEUqVgWLtQoQVzyekpky +xd2v1rJQIbH36PyEp21hAdDqTuoFgE56mqY0LrW9539GNEbqNX3uzHgbkhk+MB/ TP3bU7ucWSB6yE4eV7sFXc280wOk3nj2GztI53ip08hnuqrUhr4N3P0ohqph37gM S80zqdMN239IlKTn2ekNycR5wl+iPgfGy0R3lgOyTdfjgHQcSMArDDaJEu4RAlfX 8Gvcm7TE/iPGewoqlUIw2sZqLv2qWSxfumpozvRsO2z/KT9oiv31bVcoFtwlF4Oo TvgA0jgA2PLGJp0mIXKr =szYB -----END PGP SIGNATURE----- --WR+jf/RUebEcofwt-- From owner-svn-src-all@freebsd.org Sun Dec 20 15:18:52 2015 Return-Path: Delivered-To: svn-src-all@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 65859A4CAF3; Sun, 20 Dec 2015 15:18:52 +0000 (UTC) (envelope-from ume@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 19B4C11D9; Sun, 20 Dec 2015 15:18:52 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBKFIp9R070571; Sun, 20 Dec 2015 15:18:51 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKFIpDc070569; Sun, 20 Dec 2015 15:18:51 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512201518.tBKFIpDc070569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Sun, 20 Dec 2015 15:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292514 - in head: include 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 15:18:52 -0000 Author: ume Date: Sun Dec 20 15:18:50 2015 New Revision: 292514 URL: https://svnweb.freebsd.org/changeset/base/292514 Log: addrinfo.ai_family is an address family, not a protocol family. PR: 162434 MFC after: 1 week Modified: head/include/netdb.h head/lib/libc/net/getaddrinfo.3 Modified: head/include/netdb.h ============================================================================== --- head/include/netdb.h Sun Dec 20 15:11:11 2015 (r292513) +++ head/include/netdb.h Sun Dec 20 15:18:50 2015 (r292514) @@ -122,7 +122,7 @@ struct protoent { struct addrinfo { int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */ - int ai_family; /* PF_xxx */ + int ai_family; /* AF_xxx */ int ai_socktype; /* SOCK_xxx */ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ socklen_t ai_addrlen; /* length of ai_addr */ Modified: head/lib/libc/net/getaddrinfo.3 ============================================================================== --- head/lib/libc/net/getaddrinfo.3 Sun Dec 20 15:11:11 2015 (r292513) +++ head/lib/libc/net/getaddrinfo.3 Sun Dec 20 15:18:50 2015 (r292514) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 19, 2015 +.Dd December 21, 2015 .Dt GETADDRINFO 3 .Os .Sh NAME @@ -79,7 +79,7 @@ as defined by .Bd -literal struct addrinfo { int ai_flags; /* input flags */ - int ai_family; /* protocol family for socket */ + int ai_family; /* address family for socket */ int ai_socktype; /* socket type */ int ai_protocol; /* protocol for socket */ socklen_t ai_addrlen; /* length of socket-address */ @@ -95,12 +95,12 @@ The caller can supply the following stru .Fa hints : .Bl -tag -width "ai_socktypeXX" .It Fa ai_family -The protocol family that should be used. +The address family that should be used. When .Fa ai_family is set to -.Dv PF_UNSPEC , -it means the caller will accept any protocol family supported by the +.Dv AF_UNSPEC , +it means the caller will accept any address family supported by the operating system. .It Fa ai_socktype Denotes the type of socket that is wanted: @@ -268,7 +268,7 @@ behaves as if the caller provided a with .Fa ai_family set to -.Dv PF_UNSPEC +.Dv AF_UNSPEC and all other elements set to zero or .Dv NULL . .Pp @@ -380,7 +380,7 @@ int s; const char *cause = NULL; memset(&hints, 0, sizeof(hints)); -hints.ai_family = PF_UNSPEC; +hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; error = getaddrinfo("www.kame.net", "http", &hints, &res0); if (error) { @@ -423,7 +423,7 @@ int nsock; const char *cause = NULL; memset(&hints, 0, sizeof(hints)); -hints.ai_family = PF_UNSPEC; +hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; error = getaddrinfo(NULL, "http", &hints, &res0); From owner-svn-src-all@freebsd.org Sun Dec 20 16:07:10 2015 Return-Path: Delivered-To: svn-src-all@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 7F582A4D89C; Sun, 20 Dec 2015 16:07:10 +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 3C2221D43; Sun, 20 Dec 2015 16:07:10 +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 tBKG79Pi085937; Sun, 20 Dec 2015 16:07:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKG796K085936; Sun, 20 Dec 2015 16:07:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512201607.tBKG796K085936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 20 Dec 2015 16:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292515 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 16:07:10 -0000 Author: emaste Date: Sun Dec 20 16:07:09 2015 New Revision: 292515 URL: https://svnweb.freebsd.org/changeset/base/292515 Log: loader.efi: refresh size in GetMemoryMap retry loop If ExitBootServices fails due to a changed efi_mapkey then GetMemoryMap must be called again. In this case it is also possible for the memory map to grow, so repeat the initial GetMemoryMap call to fetch the new size. Also roll bi_add_efi_data_and_exit into bi_load_efi_data as there's no need for it to be a separate function. PR: 202455 Reported by: Berislav Purgar Tested by: Berislav Purgar Reviewed by: kib MFC after: 1 week MFC with: r292338 Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4621 Modified: head/sys/boot/efi/loader/bootinfo.c Modified: head/sys/boot/efi/loader/bootinfo.c ============================================================================== --- head/sys/boot/efi/loader/bootinfo.c Sun Dec 20 15:18:50 2015 (r292514) +++ head/sys/boot/efi/loader/bootinfo.c Sun Dec 20 16:07:09 2015 (r292515) @@ -234,44 +234,6 @@ bi_copymodules(vm_offset_t addr) } static int -bi_add_efi_data_and_exit(struct preloaded_file *kfp, - struct efi_map_header *efihdr, size_t efisz, EFI_MEMORY_DESCRIPTOR *mm, - UINTN sz) -{ - UINTN efi_mapkey; - UINTN mmsz; - UINT32 mmver; - EFI_STATUS status; - UINTN retry; - - /* - * It is possible that the first call to ExitBootServices may change - * the map key. Fetch a new map key and retry ExitBootServices in that - * case. - */ - for (retry = 2; retry > 0; retry--) { - status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &mmsz, &mmver); - if (EFI_ERROR(status)) { - printf("%s: GetMemoryMap error %lu\n", __func__, - (unsigned long)(status & ~EFI_ERROR_MASK)); - return (EINVAL); - } - status = BS->ExitBootServices(IH, efi_mapkey); - if (EFI_ERROR(status) == 0) { - efihdr->memory_size = sz; - efihdr->descriptor_size = mmsz; - efihdr->descriptor_version = mmver; - file_addmetadata(kfp, MODINFOMD_EFI_MAP, efisz + sz, - efihdr); - return (0); - } - } - printf("ExitBootServices error %lu\n", - (unsigned long)(status & ~EFI_ERROR_MASK)); - return (EINVAL); -} - -static int bi_load_efi_data(struct preloaded_file *kfp) { EFI_MEMORY_DESCRIPTOR *mm; @@ -279,7 +241,7 @@ bi_load_efi_data(struct preloaded_file * EFI_STATUS status; size_t efisz; UINTN efi_mapkey; - UINTN mmsz, pages, sz; + UINTN mmsz, pages, retry, sz; UINT32 mmver; struct efi_map_header *efihdr; @@ -304,37 +266,63 @@ bi_load_efi_data(struct preloaded_file * efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; /* - * Allocate enough pages to hold the bootinfo block and the memory - * map EFI will return to us. The memory map has an unknown size, - * so we have to determine that first. Note that the AllocatePages - * call can itself modify the memory map, so we have to take that - * into account as well. The changes to the memory map are caused - * by splitting a range of free memory into two (AFAICT), so that - * one is marked as being loader data. + * It is possible that the first call to ExitBootServices may change + * the map key. Fetch a new map key and retry ExitBootServices in that + * case. */ - sz = 0; - BS->GetMemoryMap(&sz, NULL, &efi_mapkey, &mmsz, &mmver); - sz += mmsz; - sz = (sz + 0xf) & ~0xf; - pages = EFI_SIZE_TO_PAGES(sz + efisz); - status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, pages, - &addr); - if (EFI_ERROR(status)) { - printf("%s: AllocatePages error %lu\n", __func__, - (unsigned long)(status & ~EFI_ERROR_MASK)); - return (ENOMEM); - } + for (retry = 2; retry > 0; retry--) { + /* + * Allocate enough pages to hold the bootinfo block and the + * memory map EFI will return to us. The memory map has an + * unknown size, so we have to determine that first. Note that + * the AllocatePages call can itself modify the memory map, so + * we have to take that into account as well. The changes to + * the memory map are caused by splitting a range of free + * memory into two (AFAICT), so that one is marked as being + * loader data. + */ + sz = 0; + BS->GetMemoryMap(&sz, NULL, &efi_mapkey, &mmsz, &mmver); + sz += mmsz; + sz = (sz + 0xf) & ~0xf; + pages = EFI_SIZE_TO_PAGES(sz + efisz); + status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, + pages, &addr); + if (EFI_ERROR(status)) { + printf("%s: AllocatePages error %lu\n", __func__, + (unsigned long)(status & ~EFI_ERROR_MASK)); + return (ENOMEM); + } - /* - * Read the memory map and stash it after bootinfo. Align the - * memory map on a 16-byte boundary (the bootinfo block is page - * aligned). - */ - efihdr = (struct efi_map_header *)addr; - mm = (void *)((uint8_t *)efihdr + efisz); - sz = (EFI_PAGE_SIZE * pages) - efisz; + /* + * Read the memory map and stash it after bootinfo. Align the + * memory map on a 16-byte boundary (the bootinfo block is page + * aligned). + */ + efihdr = (struct efi_map_header *)addr; + mm = (void *)((uint8_t *)efihdr + efisz); + sz = (EFI_PAGE_SIZE * pages) - efisz; - return (bi_add_efi_data_and_exit(kfp, efihdr, efisz, mm, sz)); + status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &mmsz, &mmver); + if (EFI_ERROR(status)) { + printf("%s: GetMemoryMap error %lu\n", __func__, + (unsigned long)(status & ~EFI_ERROR_MASK)); + return (EINVAL); + } + status = BS->ExitBootServices(IH, efi_mapkey); + if (EFI_ERROR(status) == 0) { + efihdr->memory_size = sz; + efihdr->descriptor_size = mmsz; + efihdr->descriptor_version = mmver; + file_addmetadata(kfp, MODINFOMD_EFI_MAP, efisz + sz, + efihdr); + return (0); + } + BS->FreePages(addr, pages); + } + printf("ExitBootServices error %lu\n", + (unsigned long)(status & ~EFI_ERROR_MASK)); + return (EINVAL); } /* From owner-svn-src-all@freebsd.org Sun Dec 20 16:33:57 2015 Return-Path: Delivered-To: svn-src-all@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 7FF30A4DA6A; Sun, 20 Dec 2015 16:33:57 +0000 (UTC) (envelope-from jilles@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 4F8561ACE; Sun, 20 Dec 2015 16:33:57 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBKGXu72094274; Sun, 20 Dec 2015 16:33:56 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKGXuR9094272; Sun, 20 Dec 2015 16:33:56 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201512201633.tBKGXuR9094272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 20 Dec 2015 16:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292516 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 16:33:57 -0000 Author: jilles Date: Sun Dec 20 16:33:56 2015 New Revision: 292516 URL: https://svnweb.freebsd.org/changeset/base/292516 Log: libthr: Don't use both __sys_open() and __sys_openat(). Modified: head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Sun Dec 20 16:07:09 2015 (r292515) +++ head/lib/libthr/thread/thr_init.c Sun Dec 20 16:33:56 2015 (r292516) @@ -332,7 +332,7 @@ _libpthread_init(struct pthread *curthre PANIC("Can't set session ID"); if (revoke(_PATH_CONSOLE) != 0) PANIC("Can't revoke console"); - if ((fd = __sys_open(_PATH_CONSOLE, O_RDWR)) < 0) + if ((fd = __sys_openat(AT_FDCWD, _PATH_CONSOLE, O_RDWR)) < 0) PANIC("Can't open console"); if (setlogin("root") == -1) PANIC("Can't set login to root"); Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Sun Dec 20 16:07:09 2015 (r292515) +++ head/lib/libthr/thread/thr_private.h Sun Dec 20 16:33:56 2015 (r292516) @@ -803,7 +803,6 @@ void _pthread_cancel_leave(int maycance /* #include */ #ifdef _SYS_FCNTL_H_ int __sys_fcntl(int, int, ...); -int __sys_open(const char *, int, ...); int __sys_openat(int, const char *, int, ...); #endif From owner-svn-src-all@freebsd.org Sun Dec 20 16:40:38 2015 Return-Path: Delivered-To: svn-src-all@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 1BF01A4DEA7; Sun, 20 Dec 2015 16:40:38 +0000 (UTC) (envelope-from jilles@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 C59C71E25; Sun, 20 Dec 2015 16:40:37 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBKGeaT1094644; Sun, 20 Dec 2015 16:40:36 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKGeavj094643; Sun, 20 Dec 2015 16:40:36 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201512201640.tBKGeavj094643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 20 Dec 2015 16:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292517 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 16:40:38 -0000 Author: jilles Date: Sun Dec 20 16:40:36 2015 New Revision: 292517 URL: https://svnweb.freebsd.org/changeset/base/292517 Log: sh/mknodes: Close files and check for errors when writing. This is a build tool only and does not affect run time. PR: 204951 MFC after: 1 week Modified: head/bin/sh/mknodes.c Modified: head/bin/sh/mknodes.c ============================================================================== --- head/bin/sh/mknodes.c Sun Dec 20 16:33:56 2015 (r292516) +++ head/bin/sh/mknodes.c Sun Dec 20 16:40:36 2015 (r292517) @@ -89,7 +89,6 @@ static struct str *nodestr[MAXTYPES]; /* static int nstr; /* number of structures */ static struct str str[MAXTYPES]; /* the structures */ static struct str *curstr; /* current structure */ -static FILE *infp; static char line[1024]; static int linno; static char *linep; @@ -102,7 +101,7 @@ static void outfunc(FILE *, int); static void indent(int, FILE *); static int nextfield(char *); static void skipbl(void); -static int readline(void); +static int readline(FILE *); static void error(const char *, ...) __printf0like(1, 2) __dead2; static char *savestr(const char *); @@ -110,17 +109,19 @@ static char *savestr(const char *); int main(int argc, char *argv[]) { + FILE *infp; + if (argc != 3) error("usage: mknodes file"); - infp = stdin; if ((infp = fopen(argv[1], "r")) == NULL) error("Can't open %s: %s", argv[1], strerror(errno)); - while (readline()) { + while (readline(infp)) { if (line[0] == ' ' || line[0] == '\t') parsefield(); else if (line[0] != '\0') parsenode(); } + fclose(infp); output(argv[2]); exit(0); } @@ -253,6 +254,10 @@ output(char *file) fputs("union node *getfuncnode(struct funcdef *);\n", hfile); fputs("void reffunc(struct funcdef *);\n", hfile); fputs("void unreffunc(struct funcdef *);\n", hfile); + if (ferror(hfile)) + error("Can't write to nodes.h"); + if (fclose(hfile)) + error("Can't close nodes.h"); fputs(writer, cfile); while (fgets(line, sizeof line, patfile) != NULL) { @@ -266,6 +271,11 @@ output(char *file) else fputs(line, cfile); } + fclose(patfile); + if (ferror(cfile)) + error("Can't write to nodes.c"); + if (fclose(cfile)) + error("Can't close nodes.c"); } @@ -401,7 +411,7 @@ skipbl(void) static int -readline(void) +readline(FILE *infp) { char *p; From owner-svn-src-all@freebsd.org Sun Dec 20 18:02:14 2015 Return-Path: Delivered-To: svn-src-all@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 9C00DA4E483; Sun, 20 Dec 2015 18:02:14 +0000 (UTC) (envelope-from cy@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 6D18E10B4; Sun, 20 Dec 2015 18:02:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBKI2Dgq021187; Sun, 20 Dec 2015 18:02:13 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKI2DnC021186; Sun, 20 Dec 2015 18:02:13 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201512201802.tBKI2DnC021186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 20 Dec 2015 18:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292518 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 18:02:14 -0000 Author: cy Date: Sun Dec 20 18:02:13 2015 New Revision: 292518 URL: https://svnweb.freebsd.org/changeset/base/292518 Log: Don't assume checksums will be calculated later when fastfoward is enabled (by default in r290383). PR: 72210 MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Sun Dec 20 16:40:36 2015 (r292517) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Sun Dec 20 18:02:13 2015 (r292518) @@ -5123,7 +5123,7 @@ ipf_nat_out(fin, nat, natadd, nflags) ipf_fix_outcksum(0, &fin->fin_ip->ip_sum, msumd, 0); } #if !defined(_KERNEL) || defined(MENTAT) || defined(__sgi) || \ - defined(linux) || defined(BRIDGE_IPF) + defined(linux) || defined(BRIDGE_IPF) || defined(__FreeBSD__) else { /* * Strictly speaking, this isn't necessary on BSD @@ -5235,7 +5235,7 @@ ipf_nat_out(fin, nat, natadd, nflags) uh->uh_ulen += fin->fin_plen; uh->uh_ulen = htons(uh->uh_ulen); #if !defined(_KERNEL) || defined(MENTAT) || defined(__sgi) || \ - defined(linux) || defined(BRIDGE_IPF) + defined(linux) || defined(BRIDGE_IPF) || defined(__FreeBSD) ipf_fix_outcksum(0, &ip->ip_sum, sumd, 0); #endif From owner-svn-src-all@freebsd.org Sun Dec 20 18:02:56 2015 Return-Path: Delivered-To: svn-src-all@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 43388A4E515; Sun, 20 Dec 2015 18:02:56 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) by mx1.freebsd.org (Postfix) with ESMTP id EFB42129C; Sun, 20 Dec 2015 18:02:55 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id AiJiakJvJdBaTAiJjai6Fl; Sun, 20 Dec 2015 11:02:49 -0700 X-Authority-Analysis: v=2.1 cv=He60Nnw8 c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=BWvPGDcYAAAA:8 a=VxmjJ2MpAAAA:8 a=kj9zAlcOel0A:10 a=wUQvQvOEmiQA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=aj5JEJwgZ28hkEG5-6wA:9 a=AYUUHTOSHlmIKRr7:21 a=HM222aAO5w_xC_7-:21 a=-x0AuQ5L8kJXOgZ1:21 a=CjuIK1q_8ugA:10 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 9A70013751; Sun, 20 Dec 2015 10:02:46 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id tBKI2jpx051586; Sun, 20 Dec 2015 10:02:45 -0800 (PST) (envelope-from Cy.Schubert@komquats.com) Message-Id: <201512201802.tBKI2jpx051586@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.komquats.com/ To: Cy Schubert cc: "George V. Neville-Neil" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290383 - in head/sys: net netinet In-Reply-To: Message from Cy Schubert of "Sat, 19 Dec 2015 16:34:16 -0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 20 Dec 2015 10:02:45 -0800 X-CMAE-Envelope: MS4wfIdT1aNJyBcjOHw1cC7y9vJufVf4bz7UAffNvFCf39lqdWNled3FMHc4kJmoDfrgf92DI+xfox3SrSHVnJwl59Fvw5yB0LgoFkMtJMTkxCqfTwFFjLJY I+TA5z39zHwsDsnE2lKA9xARBAMRk2M39wKNQ4mb+7cAtYlTqZhaScY644kuBCTTBoxne9+ZEPMx+tQBfVo9j7hR3h+oLT6VN7S/Fm1mFZ+1o2rRhTnLDn5X C1taoHkaK9EzC2OhYhIRkuDYZuMzwg6f3udadoxZOm+PAxwABU4ZWjkQGPur3q7y X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 18:02:56 -0000 Cy Schubert writes: > In message <201511050726.tA57QXlu074213@repo.freebsd.org>, "George V. > Neville-N > eil" writes: > > Author: gnn > > Date: Thu Nov 5 07:26:32 2015 > > New Revision: 290383 > > URL: https://svnweb.freebsd.org/changeset/base/290383 > > > > Log: > > Replace the fastforward path with tryforward which does not require a > > sysctl and will always be on. The former split between default and > > fast forwarding is removed by this commit while preserving the ability > > to use all network stack features. > > > > Differential Revision: https://reviews.freebsd.org/D4042 > > Reviewed by: ae, melifaro, olivier, rwatson > > MFC after: 1 month > > Sponsored by: Rubicon Communications (Netgate) > > > > Modified: > > head/sys/net/if_arcsubr.c > > head/sys/net/if_ethersubr.c > > head/sys/net/if_fddisubr.c > > head/sys/net/if_fwsubr.c > > head/sys/net/if_iso88025subr.c > > head/sys/netinet/in_var.h > > head/sys/netinet/ip_fastfwd.c > > head/sys/netinet/ip_input.c > > > > Modified: head/sys/net/if_arcsubr.c > > =========================================================================== > == > > = > > --- head/sys/net/if_arcsubr.c Thu Nov 5 04:16:03 2015 (r29038 > 2) > > +++ head/sys/net/if_arcsubr.c Thu Nov 5 07:26:32 2015 (r29038 > 3) > > @@ -550,15 +550,11 @@ arc_input(struct ifnet *ifp, struct mbuf > > #ifdef INET > > case ARCTYPE_IP: > > m_adj(m, ARC_HDRNEWLEN); > > - if ((m = ip_fastforward(m)) == NULL) > > - return; > > isr = NETISR_IP; > > break; > > > > case ARCTYPE_IP_OLD: > > m_adj(m, ARC_HDRLEN); > > - if ((m = ip_fastforward(m)) == NULL) > > - return; > > isr = NETISR_IP; > > break; > > > > > > Modified: head/sys/net/if_ethersubr.c > > =========================================================================== > == > > = > > --- head/sys/net/if_ethersubr.c Thu Nov 5 04:16:03 2015 (r29038 > > 2) > > +++ head/sys/net/if_ethersubr.c Thu Nov 5 07:26:32 2015 (r29038 > > 3) > > @@ -722,8 +722,6 @@ ether_demux(struct ifnet *ifp, struct mb > > switch (ether_type) { > > #ifdef INET > > case ETHERTYPE_IP: > > - if ((m = ip_fastforward(m)) == NULL) > > - return; > > isr = NETISR_IP; > > break; > > > > > > Modified: head/sys/net/if_fddisubr.c > > =========================================================================== > == > > = > > --- head/sys/net/if_fddisubr.c Thu Nov 5 04:16:03 2015 (r29038 > > 2) > > +++ head/sys/net/if_fddisubr.c Thu Nov 5 07:26:32 2015 (r29038 > > 3) > > @@ -429,8 +429,6 @@ fddi_input(ifp, m) > > switch (type) { > > #ifdef INET > > case ETHERTYPE_IP: > > - if ((m = ip_fastforward(m)) == NULL) > > - return; > > isr = NETISR_IP; > > break; > > > > > > Modified: head/sys/net/if_fwsubr.c > > =========================================================================== > == > > = > > --- head/sys/net/if_fwsubr.c Thu Nov 5 04:16:03 2015 (r29038 > 2) > > +++ head/sys/net/if_fwsubr.c Thu Nov 5 07:26:32 2015 (r29038 > 3) > > @@ -605,8 +605,6 @@ firewire_input(struct ifnet *ifp, struct > > switch (type) { > > #ifdef INET > > case ETHERTYPE_IP: > > - if ((m = ip_fastforward(m)) == NULL) > > - return; > > isr = NETISR_IP; > > break; > > > > > > Modified: head/sys/net/if_iso88025subr.c > > =========================================================================== > == > > = > > --- head/sys/net/if_iso88025subr.c Thu Nov 5 04:16:03 2015 (r29038 > > 2) > > +++ head/sys/net/if_iso88025subr.c Thu Nov 5 07:26:32 2015 (r29038 > > 3) > > @@ -519,8 +519,6 @@ iso88025_input(ifp, m) > > #ifdef INET > > case ETHERTYPE_IP: > > th->iso88025_shost[0] &= ~(TR_RII); > > - if ((m = ip_fastforward(m)) == NULL) > > - return; > > isr = NETISR_IP; > > break; > > > > > > Modified: head/sys/netinet/in_var.h > > =========================================================================== > == > > = > > --- head/sys/netinet/in_var.h Thu Nov 5 04:16:03 2015 (r29038 > 2) > > +++ head/sys/netinet/in_var.h Thu Nov 5 07:26:32 2015 (r29038 > 3) > > @@ -380,7 +380,7 @@ int in_scrubprefix(struct in_ifaddr *, u > > void ip_input(struct mbuf *); > > void ip_direct_input(struct mbuf *); > > void in_ifadown(struct ifaddr *ifa, int); > > -struct mbuf *ip_fastforward(struct mbuf *); > > +struct mbuf *ip_tryforward(struct mbuf *); > > void *in_domifattach(struct ifnet *); > > void in_domifdetach(struct ifnet *, void *); > > > > > > Modified: head/sys/netinet/ip_fastfwd.c > > =========================================================================== > == > > = > > --- head/sys/netinet/ip_fastfwd.c Thu Nov 5 04:16:03 2015 (r29038 > > 2) > > +++ head/sys/netinet/ip_fastfwd.c Thu Nov 5 07:26:32 2015 (r29038 > > 3) > > @@ -108,12 +108,6 @@ __FBSDID("$FreeBSD$"); > > > > #include > > > > -static VNET_DEFINE(int, ipfastforward_active); > > -#define V_ipfastforward_active VNET(ipfastforward_active) > > - > > -SYSCTL_INT(_net_inet_ip, OID_AUTO, fastforwarding, CTLFLAG_VNET | CTLFLAG_ > RW > > , > > - &VNET_NAME(ipfastforward_active), 0, "Enable fast IP forwarding"); > > - > > static struct sockaddr_in * > > ip_findroute(struct route *ro, struct in_addr dest, struct mbuf *m) > > { > > @@ -158,7 +152,7 @@ ip_findroute(struct route *ro, struct in > > * to ip_input for full processing. > > */ > > struct mbuf * > > -ip_fastforward(struct mbuf *m) > > +ip_tryforward(struct mbuf *m) > > { > > struct ip *ip; > > struct mbuf *m0 = NULL; > > @@ -166,119 +160,20 @@ ip_fastforward(struct mbuf *m) > > struct sockaddr_in *dst = NULL; > > struct ifnet *ifp; > > struct in_addr odest, dest; > > - uint16_t sum, ip_len, ip_off; > > + uint16_t ip_len, ip_off; > > int error = 0; > > - int hlen, mtu; > > + int mtu; > > struct m_tag *fwd_tag = NULL; > > > > /* > > * Are we active and forwarding packets? > > */ > > - if (!V_ipfastforward_active || !V_ipforwarding) > > - return m; > > > > M_ASSERTVALID(m); > > M_ASSERTPKTHDR(m); > > > > bzero(&ro, sizeof(ro)); > > > > - /* > > - * Step 1: check for packet drop conditions (and sanity checks) > > - */ > > - > > - /* > > - * Is entire packet big enough? > > - */ > > - if (m->m_pkthdr.len < sizeof(struct ip)) { > > - IPSTAT_INC(ips_tooshort); > > - goto drop; > > - } > > - > > - /* > > - * Is first mbuf large enough for ip header and is header present? > > - */ > > - if (m->m_len < sizeof (struct ip) && > > - (m = m_pullup(m, sizeof (struct ip))) == NULL) { > > - IPSTAT_INC(ips_toosmall); > > - return NULL; /* mbuf already free'd */ > > - } > > - > > - ip = mtod(m, struct ip *); > > - > > - /* > > - * Is it IPv4? > > - */ > > - if (ip->ip_v != IPVERSION) { > > - IPSTAT_INC(ips_badvers); > > - goto drop; > > - } > > - > > - /* > > - * Is IP header length correct and is it in first mbuf? > > - */ > > - hlen = ip->ip_hl << 2; > > - if (hlen < sizeof(struct ip)) { /* minimum header length */ > > - IPSTAT_INC(ips_badhlen); > > - goto drop; > > - } > > - if (hlen > m->m_len) { > > - if ((m = m_pullup(m, hlen)) == NULL) { > > - IPSTAT_INC(ips_badhlen); > > - return NULL; /* mbuf already free'd */ > > - } > > - ip = mtod(m, struct ip *); > > - } > > - > > - /* > > - * Checksum correct? > > - */ > > - if (m->m_pkthdr.csum_flags & CSUM_IP_CHECKED) > > - sum = !(m->m_pkthdr.csum_flags & CSUM_IP_VALID); > > - else { > > - if (hlen == sizeof(struct ip)) > > - sum = in_cksum_hdr(ip); > > - else > > - sum = in_cksum(m, hlen); > > - } > > - if (sum) { > > - IPSTAT_INC(ips_badsum); > > - goto drop; > > - } > > - > > - /* > > - * Remember that we have checked the IP header and found it valid. > > - */ > > - m->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); > > - > > - ip_len = ntohs(ip->ip_len); > > - > > - /* > > - * Is IP length longer than packet we have got? > > - */ > > - if (m->m_pkthdr.len < ip_len) { > > - IPSTAT_INC(ips_tooshort); > > - goto drop; > > - } > > - > > - /* > > - * Is packet longer than IP header tells us? If yes, truncate packet. > > - */ > > - if (m->m_pkthdr.len > ip_len) { > > - if (m->m_len == m->m_pkthdr.len) { > > - m->m_len = ip_len; > > - m->m_pkthdr.len = ip_len; > > - } else > > - m_adj(m, ip_len - m->m_pkthdr.len); > > - } > > - > > - /* > > - * Is packet from or to 127/8? > > - */ > > - if ((ntohl(ip->ip_dst.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET || > > - (ntohl(ip->ip_src.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) { > > - IPSTAT_INC(ips_badaddr); > > - goto drop; > > - } > > > > #ifdef ALTQ > > /* > > @@ -289,12 +184,10 @@ ip_fastforward(struct mbuf *m) > > #endif > > > > /* > > - * Step 2: fallback conditions to normal ip_input path processing > > - */ > > - > > - /* > > * Only IP packets without options > > */ > > + ip = mtod(m, struct ip *); > > + > > if (ip->ip_hl != (sizeof(struct ip) >> 2)) { > > if (V_ip_doopts == 1) > > return m; > > > > Modified: head/sys/netinet/ip_input.c > > =========================================================================== > == > > = > > --- head/sys/netinet/ip_input.c Thu Nov 5 04:16:03 2015 (r29038 > > 2) > > +++ head/sys/netinet/ip_input.c Thu Nov 5 07:26:32 2015 (r29038 > > 3) > > @@ -79,6 +79,8 @@ __FBSDID("$FreeBSD$"); > > #include > > #ifdef IPSEC > > #include > > +#include > > +#include > > #endif /* IPSEC */ > > #include > > > > @@ -500,12 +502,22 @@ tooshort: > > m_adj(m, ip_len - m->m_pkthdr.len); > > } > > > > + /* Try to forward the packet, but if we fail continue */ > > #ifdef IPSEC > > + /* For now we do not handle IPSEC in tryforward. */ > > + if (!key_havesp(IPSEC_DIR_INBOUND) && !key_havesp(IPSEC_DIR_OUTBOUND) & > > & > > + (V_ipforwarding == 1)) > > + if (ip_tryforward(m) == NULL) > > + return; > > /* > > * Bypass packet filtering for packets previously handled by IPsec. > > */ > > if (ip_ipsec_filtertunnel(m)) > > goto passin; > > +#else > > + if (V_ipforwarding == 1) > > + if (ip_tryforward(m) == NULL) > > + return; > > #endif /* IPSEC */ > > > > /* > > > > > > Hi George, > > Sorry for the lateness of this reply, I finally got some time off for > Christmas and have time to myself to boot. > > This breaks ipfilter's ipnat. I want to let you know before anyone MFCs > this. A fix to ipfilter has been committed to head and will be MFCed in a week. -- Cheers, Cy Schubert or FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sun Dec 20 19:09:14 2015 Return-Path: Delivered-To: svn-src-all@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 31CACA4EA50; Sun, 20 Dec 2015 19:09:14 +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 025FE1E40; Sun, 20 Dec 2015 19:09:13 +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 tBKJ9Dwj038613; Sun, 20 Dec 2015 19:09:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKJ9DVS038612; Sun, 20 Dec 2015 19:09:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512201909.tBKJ9DVS038612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 20 Dec 2015 19:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292519 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 19:09:14 -0000 Author: ian Date: Sun Dec 20 19:09:12 2015 New Revision: 292519 URL: https://svnweb.freebsd.org/changeset/base/292519 Log: Tidy up mips ofw_machdep.h. Don't include openfirm.h because openfirm.h is what includes machine/ofw_machdep.h. Don't declare OF_decode_addr(); it isn't implemented yet on mips and the declaration for it is about to be commonized into openfirm.h. Modified: head/sys/mips/include/ofw_machdep.h Modified: head/sys/mips/include/ofw_machdep.h ============================================================================== --- head/sys/mips/include/ofw_machdep.h Sun Dec 20 18:02:13 2015 (r292518) +++ head/sys/mips/include/ofw_machdep.h Sun Dec 20 19:09:12 2015 (r292519) @@ -32,7 +32,6 @@ #include #include #include -#include typedef uint32_t cell_t; struct mem_region { @@ -40,8 +39,6 @@ struct mem_region { vm_size_t mr_size; }; - -int OF_decode_addr(phandle_t, int, bus_space_tag_t *, bus_space_handle_t *); void OF_getetheraddr(device_t dev, u_char *addr); void OF_initial_setup(void *fdt_ptr, void *junk, int (*openfirm)(void *)); From owner-svn-src-all@freebsd.org Sun Dec 20 20:58:50 2015 Return-Path: Delivered-To: svn-src-all@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 BB13AA4ECED; Sun, 20 Dec 2015 20:58:50 +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 8C19E1FFE; Sun, 20 Dec 2015 20:58:50 +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 tBKKwnwL070739; Sun, 20 Dec 2015 20:58:49 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKKwnc3070738; Sun, 20 Dec 2015 20:58:49 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201512202058.tBKKwnc3070738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sun, 20 Dec 2015 20:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292520 - stable/9/share/man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 20:58:50 -0000 Author: vangyzen Date: Sun Dec 20 20:58:49 2015 New Revision: 292520 URL: https://svnweb.freebsd.org/changeset/base/292520 Log: MFC r289315 (reprise) MFC the man page change from r289315. Thanks for the attention to detail, Jeremy. Pointed out by: Jeremy Chadwick Sponsored by: Dell Inc. Modified: stable/9/share/man/man5/resolver.5 Directory Properties: stable/9/share/man/man5/ (props changed) Modified: stable/9/share/man/man5/resolver.5 ============================================================================== --- stable/9/share/man/man5/resolver.5 Sun Dec 20 19:09:12 2015 (r292519) +++ stable/9/share/man/man5/resolver.5 Sun Dec 20 20:58:49 2015 (r292520) @@ -32,7 +32,7 @@ .\" @(#)resolver.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd September 9, 2004 +.Dd October 12, 2015 .Dt RESOLVER 5 .Os .Sh NAME @@ -179,6 +179,19 @@ the resolver from obeying the standard and .Sy search rules with the given name. +.It Sy reload-period: Ns Ar n +The resolver checks the modification time of +.Pa /etc/resolv.conf +every +.Ar n +seconds. +If +.Pa /etc/resolv.conf +has changed, it is automatically reloaded. +The default for +.Ar n +is two seconds. +Setting it to zero disables the file check. .El .Pp Options may also be specified as a space or tab separated list using the @@ -195,8 +208,7 @@ If more than one instance of these keywo the last instance will override. .Pp The keyword and value must appear on a single line, and the keyword -(e.g.\& -.Sy nameserver ) +.Pq for example, Sy nameserver must start the line. The value follows the keyword, separated by white space. .Sh FILES From owner-svn-src-all@freebsd.org Sun Dec 20 22:29:22 2015 Return-Path: Delivered-To: svn-src-all@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 B7DF3A4E22A for ; Sun, 20 Dec 2015 22:29:22 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (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 450C017D6 for ; Sun, 20 Dec 2015 22:29:22 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x236.google.com with SMTP id p187so46783460wmp.0 for ; Sun, 20 Dec 2015 14:29:22 -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:date:message-id:subject:from:to :cc:content-type; bh=TP41phaSeAHlWbaLEPRZTmQz+q0F528HNasoKkWLvGA=; b=ejW1vo/ELY4gk+u09Bg4bJ2G6OLSe8kG1MAETISHY/XnVoiofBYj/pB2JYjnYL5Bfz WUzg38sv/osPjpvc/ZlHUug8+heq+8UBY1NCEUwRwMBH6X51yuxHhvl/gmlQLpa151lm n0SQgvNCJKqmgAVcGBfqPE8j7I6voo7RcIS/g82LDRldFEwIQMGzMblsU/SIAMeCOc1y QxP41upjFYyTaZV4BxF962WkJpLJyvIKogaenhv8qiP92I3EO9+6NYzhp7Ry2GbM7ynM i85yl4h3DF9Py8EzeusRfpN433ptfEoO3VaJ4pSqEC37V6GzzIBm5/dPrxlDB7eq8/6b mMiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=TP41phaSeAHlWbaLEPRZTmQz+q0F528HNasoKkWLvGA=; b=D70R/K5dBUQbQaF6mm80I0y7jFDgSRuPR/iSQLbaWQjD03lp3yGISAXHlFzWhbBkUe FyMNRfyO3yIewpe60rOA1Emmj7tKx2Z1IHe6UfNv8FWDQiabsrZUygP2I4JO4fYOsRUQ 7GJmBR6g14yf4UTR5WixzMWb2L5f198hH6KSwKIFx9izPqS5QhlZKcDL7lCDzRPf5oHP iv7sF+RmkbfIqNE+wg8hrx5Qv7WVUeKbW/9DunZbjebKy2pINbeGCdj2MUH6tafnS/y+ RfIgwUZQaSrFG7SdrW/I6XD9fhMigib+aUqBYAAtnOEBfQxj3BDqeT9QJwMUjnSaWwkq yrOA== X-Gm-Message-State: ALoCoQnbBXaJg6588I3cuV4kQXS/IG0NrtPCDwVac2ME1D/QuzGOYkFXHwFhMNme2Q7jkeK96z9z6+SuihTBf1Lf+KVLhCHIZ8cIo6oxmga8sw9F2oP7Yg4= MIME-Version: 1.0 X-Received: by 10.194.178.70 with SMTP id cw6mr16783166wjc.73.1450650559812; Sun, 20 Dec 2015 14:29:19 -0800 (PST) Received: by 10.194.85.167 with HTTP; Sun, 20 Dec 2015 14:29:19 -0800 (PST) In-Reply-To: References: <201508051932.t75JWa43099865@repo.freebsd.org> <1438803660.4365.13.camel@hardenedbsd.org> <3E3DCB20-264A-4348-B7D1-5F451B275FF0@FreeBSD.org> Date: Sun, 20 Dec 2015 23:29:19 +0100 Message-ID: Subject: Re: svn commit: r286337 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Oliver Pinter To: gavin@freebsd.org Cc: Renato Botelho , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Shawn Webb , "src-committers@freebsd.org" , =?UTF-8?Q?Ermal_Lu=C3=A7i?= , avos@freebsd.org, Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 22:29:22 -0000 Add gavin@ to thread On 11/8/15, Oliver Pinter wrote: > On Sun, Nov 8, 2015 at 8:24 PM, Adrian Chadd wrote: >> i'm burnt out and still too busy fixing issues introduced into -head >> (both wifi and low-memory platform support.) > > That's bad to read. :( > >> >> Someone else at this stage has to MFC things :( > > Renato, Avos anyone else? > >> >> Sorry, >> >> >> -a >> >> >> On 8 November 2015 at 10:49, Oliver Pinter >> wrote: >>> On 8/19/15, Renato Botelho wrote: >>>>> On Aug 19, 2015, at 18:31, Adrian Chadd wrote: >>>>> >>>>> jim asked me again to do the MFC, so once I've finished doing some >>>>> more tidying up of bits and pieces I'll do the MFC. >>> >>> What's the status of this MFC? You need a tester or you have a patch? >>> >>>> >>>> Thank you very much! >>>> >>>> -- >>>> Renato Botelho >>>> >>>> > From owner-svn-src-all@freebsd.org Sun Dec 20 23:05:21 2015 Return-Path: Delivered-To: svn-src-all@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 EEC5AA4D78D; Sun, 20 Dec 2015 23:05:21 +0000 (UTC) (envelope-from jilles@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 A9A75195A; Sun, 20 Dec 2015 23:05:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBKN5KQK008236; Sun, 20 Dec 2015 23:05:20 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKN5KL7008232; Sun, 20 Dec 2015 23:05:20 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201512202305.tBKN5KL7008232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 20 Dec 2015 23:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292521 - in head/lib/libc: gen iconv net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 23:05:22 -0000 Author: jilles Date: Sun Dec 20 23:05:20 2015 New Revision: 292521 URL: https://svnweb.freebsd.org/changeset/base/292521 Log: libc: Use namespace.h in a few more files. libc now no longer calls fstat(), socketpair() and wait(), only the underscore-prefixed versions (_waitpid() instead of wait()). Modified: head/lib/libc/gen/getpeereid.c head/lib/libc/gen/sysconf.c head/lib/libc/iconv/citrus_mmap.c head/lib/libc/net/rcmdsh.c Modified: head/lib/libc/gen/getpeereid.c ============================================================================== --- head/lib/libc/gen/getpeereid.c Sun Dec 20 20:58:49 2015 (r292520) +++ head/lib/libc/gen/getpeereid.c Sun Dec 20 23:05:20 2015 (r292521) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include "namespace.h" #include #include #include @@ -34,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "un-namespace.h" int getpeereid(int s, uid_t *euid, gid_t *egid) @@ -43,7 +45,7 @@ getpeereid(int s, uid_t *euid, gid_t *eg int error; xuclen = sizeof(xuc); - error = getsockopt(s, 0, LOCAL_PEERCRED, &xuc, &xuclen); + error = _getsockopt(s, 0, LOCAL_PEERCRED, &xuc, &xuclen); if (error != 0) return (error); if (xuc.cr_version != XUCRED_VERSION) Modified: head/lib/libc/gen/sysconf.c ============================================================================== --- head/lib/libc/gen/sysconf.c Sun Dec 20 20:58:49 2015 (r292520) +++ head/lib/libc/gen/sysconf.c Sun Dec 20 23:05:20 2015 (r292521) @@ -36,6 +36,7 @@ static char sccsid[] = "@(#)sysconf.c 8. #include __FBSDID("$FreeBSD$"); +#include "namespace.h" #include #include #include @@ -49,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include /* we just need the limits */ #include #include +#include "un-namespace.h" #include "../stdlib/atexit.h" #include "tzfile.h" /* from ../../../contrib/tzcode/stdtime */ @@ -575,10 +577,10 @@ yesno: case _SC_IPV6: #if _POSIX_IPV6 == 0 sverrno = errno; - value = socket(PF_INET6, SOCK_DGRAM, 0); + value = _socket(PF_INET6, SOCK_DGRAM, 0); errno = sverrno; if (value >= 0) { - close(value); + _close(value); return (200112L); } else return (0); Modified: head/lib/libc/iconv/citrus_mmap.c ============================================================================== --- head/lib/libc/iconv/citrus_mmap.c Sun Dec 20 20:58:49 2015 (r292520) +++ head/lib/libc/iconv/citrus_mmap.c Sun Dec 20 23:05:20 2015 (r292521) @@ -27,6 +27,7 @@ * SUCH DAMAGE. */ +#include "namespace.h" #include #include #include @@ -40,6 +41,7 @@ #include #include #include +#include "un-namespace.h" #include "citrus_namespace.h" #include "citrus_region.h" @@ -57,10 +59,10 @@ _citrus_map_file(struct _citrus_region * _region_init(r, NULL, 0); - if ((fd = open(path, O_RDONLY | O_CLOEXEC)) == -1) + if ((fd = _open(path, O_RDONLY | O_CLOEXEC)) == -1) return (errno); - if (fstat(fd, &st) == -1) { + if (_fstat(fd, &st) == -1) { ret = errno; goto error; } @@ -78,7 +80,7 @@ _citrus_map_file(struct _citrus_region * _region_init(r, head, (size_t)st.st_size); error: - (void)close(fd); + (void)_close(fd); return (ret); } Modified: head/lib/libc/net/rcmdsh.c ============================================================================== --- head/lib/libc/net/rcmdsh.c Sun Dec 20 20:58:49 2015 (r292520) +++ head/lib/libc/net/rcmdsh.c Sun Dec 20 23:05:20 2015 (r292521) @@ -36,6 +36,7 @@ #include __FBSDID("$FreeBSD$"); +#include "namespace.h" #include #include #include @@ -48,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include "un-namespace.h" /* * This is a replacement rcmd() function that uses the rsh(1) @@ -99,7 +101,7 @@ rcmdsh(char **ahost, int rport, const ch } /* Get a socketpair we'll use for stdin and stdout. */ - if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, sp) == -1) { + if (_socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, sp) == -1) { perror("rcmdsh: socketpair"); return (-1); } @@ -112,8 +114,8 @@ rcmdsh(char **ahost, int rport, const ch /* * Child. We use sp[1] to be stdin/stdout, and close sp[0]. */ - (void)close(sp[0]); - if (dup2(sp[1], 0) == -1 || dup2(0, 1) == -1) { + (void)_close(sp[0]); + if (_dup2(sp[1], 0) == -1 || _dup2(0, 1) == -1) { perror("rcmdsh: dup2 failed"); _exit(255); } @@ -156,9 +158,9 @@ rcmdsh(char **ahost, int rport, const ch _exit(255); } else { /* Parent. close sp[1], return sp[0]. */ - (void)close(sp[1]); + (void)_close(sp[1]); /* Reap child. */ - (void)wait(NULL); + (void)_waitpid(cpid, NULL, 0); return (sp[0]); } /* NOTREACHED */ From owner-svn-src-all@freebsd.org Sun Dec 20 23:22:06 2015 Return-Path: Delivered-To: svn-src-all@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 EC882A4E0DC; Sun, 20 Dec 2015 23:22:06 +0000 (UTC) (envelope-from brueffer@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 A7A13111A; Sun, 20 Dec 2015 23:22:06 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBKNM53s013818; Sun, 20 Dec 2015 23:22:05 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKNM41A013805; Sun, 20 Dec 2015 23:22:04 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512202322.tBKNM41A013805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Sun, 20 Dec 2015 23:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292522 - in head/sys: bsm security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 23:22:07 -0000 Author: brueffer Date: Sun Dec 20 23:22:04 2015 New Revision: 292522 URL: https://svnweb.freebsd.org/changeset/base/292522 Log: Merge from contrib/openbsm to bring the kernel audit bits up to date with OpenBSM 1.2 alpha 4: - remove $P4$ - fix a comment Modified: head/sys/bsm/audit.h head/sys/bsm/audit_domain.h head/sys/bsm/audit_errno.h head/sys/bsm/audit_fcntl.h head/sys/bsm/audit_internal.h head/sys/bsm/audit_kevents.h head/sys/bsm/audit_record.h head/sys/bsm/audit_socket_type.h head/sys/security/audit/bsm_domain.c head/sys/security/audit/bsm_errno.c head/sys/security/audit/bsm_fcntl.c head/sys/security/audit/bsm_socket_type.c head/sys/security/audit/bsm_token.c Modified: head/sys/bsm/audit.h ============================================================================== --- head/sys/bsm/audit.h Sun Dec 20 23:05:20 2015 (r292521) +++ head/sys/bsm/audit.h Sun Dec 20 23:22:04 2015 (r292522) @@ -26,7 +26,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit.h#10 * $FreeBSD$ */ Modified: head/sys/bsm/audit_domain.h ============================================================================== --- head/sys/bsm/audit_domain.h Sun Dec 20 23:05:20 2015 (r292521) +++ head/sys/bsm/audit_domain.h Sun Dec 20 23:22:04 2015 (r292522) @@ -26,7 +26,6 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_domain.h#2 * $FreeBSD$ */ Modified: head/sys/bsm/audit_errno.h ============================================================================== --- head/sys/bsm/audit_errno.h Sun Dec 20 23:05:20 2015 (r292521) +++ head/sys/bsm/audit_errno.h Sun Dec 20 23:22:04 2015 (r292522) @@ -26,7 +26,6 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_errno.h#7 * $FreeBSD$ */ Modified: head/sys/bsm/audit_fcntl.h ============================================================================== --- head/sys/bsm/audit_fcntl.h Sun Dec 20 23:05:20 2015 (r292521) +++ head/sys/bsm/audit_fcntl.h Sun Dec 20 23:22:04 2015 (r292522) @@ -26,7 +26,6 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_fcntl.h#2 * $FreeBSD$ */ Modified: head/sys/bsm/audit_internal.h ============================================================================== --- head/sys/bsm/audit_internal.h Sun Dec 20 23:05:20 2015 (r292521) +++ head/sys/bsm/audit_internal.h Sun Dec 20 23:22:04 2015 (r292522) @@ -30,7 +30,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_internal.h#6 * $FreeBSD$ */ Modified: head/sys/bsm/audit_kevents.h ============================================================================== --- head/sys/bsm/audit_kevents.h Sun Dec 20 23:05:20 2015 (r292521) +++ head/sys/bsm/audit_kevents.h Sun Dec 20 23:22:04 2015 (r292522) @@ -26,7 +26,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_kevents.h#7 * $FreeBSD$ */ @@ -34,7 +33,7 @@ #define _BSM_AUDIT_KEVENTS_H_ /* - * The reserved event numbers for kernel events are 1...2047 and 43001..44900. + * The reserved event numbers for kernel events are 1...2047 and 43001..44999. */ #define AUE_IS_A_KEVENT(e) (((e) > 0 && (e) < 2048) || \ ((e) > 43000 && (e) < 45000)) Modified: head/sys/bsm/audit_record.h ============================================================================== --- head/sys/bsm/audit_record.h Sun Dec 20 23:05:20 2015 (r292521) +++ head/sys/bsm/audit_record.h Sun Dec 20 23:22:04 2015 (r292522) @@ -26,7 +26,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_record.h#10 * $FreeBSD$ */ Modified: head/sys/bsm/audit_socket_type.h ============================================================================== --- head/sys/bsm/audit_socket_type.h Sun Dec 20 23:05:20 2015 (r292521) +++ head/sys/bsm/audit_socket_type.h Sun Dec 20 23:22:04 2015 (r292522) @@ -26,7 +26,6 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_socket_type.h#1 * $FreeBSD$ */ Modified: head/sys/security/audit/bsm_domain.c ============================================================================== --- head/sys/security/audit/bsm_domain.c Sun Dec 20 23:05:20 2015 (r292521) +++ head/sys/security/audit/bsm_domain.c Sun Dec 20 23:22:04 2015 (r292522) @@ -25,8 +25,6 @@ * 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. - * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_domain.c#3 */ #include Modified: head/sys/security/audit/bsm_errno.c ============================================================================== --- head/sys/security/audit/bsm_errno.c Sun Dec 20 23:05:20 2015 (r292521) +++ head/sys/security/audit/bsm_errno.c Sun Dec 20 23:22:04 2015 (r292522) @@ -25,8 +25,6 @@ * 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. - * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_errno.c#22 */ #include Modified: head/sys/security/audit/bsm_fcntl.c ============================================================================== --- head/sys/security/audit/bsm_fcntl.c Sun Dec 20 23:05:20 2015 (r292521) +++ head/sys/security/audit/bsm_fcntl.c Sun Dec 20 23:22:04 2015 (r292522) @@ -25,8 +25,6 @@ * 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. - * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_fcntl.c#2 */ #include Modified: head/sys/security/audit/bsm_socket_type.c ============================================================================== --- head/sys/security/audit/bsm_socket_type.c Sun Dec 20 23:05:20 2015 (r292521) +++ head/sys/security/audit/bsm_socket_type.c Sun Dec 20 23:22:04 2015 (r292522) @@ -25,8 +25,6 @@ * 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. - * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_socket_type.c#1 */ #include Modified: head/sys/security/audit/bsm_token.c ============================================================================== --- head/sys/security/audit/bsm_token.c Sun Dec 20 23:05:20 2015 (r292521) +++ head/sys/security/audit/bsm_token.c Sun Dec 20 23:22:04 2015 (r292522) @@ -29,8 +29,6 @@ * 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. - * - * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#99 */ #include From owner-svn-src-all@freebsd.org Sun Dec 20 23:31:13 2015 Return-Path: Delivered-To: svn-src-all@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 148BDA4E4B4; Sun, 20 Dec 2015 23:31:13 +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 C7F561449; Sun, 20 Dec 2015 23:31:12 +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 tBKNVB53016686; Sun, 20 Dec 2015 23:31:11 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKNVBJm016685; Sun, 20 Dec 2015 23:31:11 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512202331.tBKNVBJm016685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 20 Dec 2015 23:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292523 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 23:31:13 -0000 Author: ian Date: Sun Dec 20 23:31:11 2015 New Revision: 292523 URL: https://svnweb.freebsd.org/changeset/base/292523 Log: Allow armv4/5 kernels to be loaded on any 2MB boundary, like armv6/7. This eliminates the reliance on PHYSADDR and KERNPHYSADDR compile-time symbols (except when the rom-copy code is enabled) by using the current PC and the assumption that the entry-point routine is in the first 1MB section of the text segment. Other cleanups done: - Reduce the initarm() stack size back to 2K. It got increased to 4 * 2K when this file was supporting multicore armv6, but that support is now in locore-v6.S. - When building the temporary startup page tables, map the entire 4GB address space as VA=PA before mapping the kernel at its loaded location. This allows access to boot parameters stored somewhere in ram by the bootloader, regardless of where that may be. - When building the page table entry for supporting EARLY_PRINTF, map the section as uncached unbuffered, since it is presumably device registers. Note that this restores the ability to use loader(8)/ubldr on armv4/5 kernels. That was broken in r283035, the point at which ubldr started loading an arm kernel at any 2MB boundary. Also note that after this, there is no reason to set KERNVIRTADDR to anything other than 0xc0000000, and no need for PHYSADDR or KERNPHYSADDR symbols at all. Modified: head/sys/arm/arm/locore-v4.S Modified: head/sys/arm/arm/locore-v4.S ============================================================================== --- head/sys/arm/arm/locore-v4.S Sun Dec 20 23:22:04 2015 (r292522) +++ head/sys/arm/arm/locore-v4.S Sun Dec 20 23:31:11 2015 (r292523) @@ -42,19 +42,8 @@ __FBSDID("$FreeBSD$"); -/* - * Sanity check the configuration. - * FLASHADDR and LOADERRAMADDR depend on PHYSADDR in some cases. - * ARMv4 and ARMv5 make assumptions on where they are loaded. - * - * TODO: Fix the ARMv4/v5 case. - */ -#ifndef PHYSADDR -#error PHYSADDR must be defined for this configuration -#endif - -/* What size should this really be ? It is only used by initarm() */ -#define INIT_ARM_STACK_SIZE (2048 * 4) +/* 2K initial stack is plenty, it is only used by initarm() */ +#define INIT_ARM_STACK_SIZE 2048 #define CPWAIT_BRANCH \ sub pc, pc, #4 @@ -109,6 +98,16 @@ ASENTRY_NP(_start) msr cpsr_c, r7 #if defined (FLASHADDR) && defined(LOADERRAMADDR) +/* + * Sanity check the configuration. + * FLASHADDR and LOADERRAMADDR depend on PHYSADDR in some cases. + * ARMv4 and ARMv5 make assumptions on where they are loaded. + * TODO: Fix the ARMv4/v5 case. + */ +#ifndef PHYSADDR +#error PHYSADDR must be defined for this configuration +#endif + /* Check if we're running from flash. */ ldr r7, =FLASHADDR /* @@ -164,37 +163,45 @@ Lunmapped: * Build page table from scratch. */ - /* Find the delta between VA and PA */ + /* + * Figure out the physical address we're loaded at by assuming this + * entry point code is in the first L1 section and so if we clear the + * offset bits of the pc that will give us the section-aligned load + * address, which remains in r5 throughout all the following code. + */ + ldr r2, =(L1_S_OFFSET) + bic r5, pc, r2 + + /* Find the delta between VA and PA, result stays in r0 throughout. */ adr r0, Lpagetable bl translate_va_to_pa - /* - * Some of the older ports (the various XScale, mostly) assume - * that the memory before the kernel is mapped, and use it for - * the various stacks, page tables, etc. For those CPUs, map the - * 64 first MB of RAM, as it used to be. - */ - /* - * Map PA == VA + /* + * First map the entire 4GB address space as VA=PA. It's mapped as + * normal (cached) memory because it's for things like accessing the + * parameters passed in from the bootloader, which might be at any + * physical address, different for every platform. */ - ldr r5, =PHYSADDR - mov r1, r5 - mov r2, r5 - /* Map 64MiB, preserved over calls to build_pagetables */ - mov r3, #64 + mov r1, #0 + mov r2, #0 + mov r3, #4096 bl build_pagetables - /* Create the kernel map to jump to */ + /* + * Next we do 64MiB starting at the physical load address, mapped to + * the VA the kernel is linked for. + */ mov r1, r5 - ldr r2, =(KERNBASE) + ldr r2, =(KERNVIRTADDR) + mov r3, #64 bl build_pagetables - ldr r5, =(KERNPHYSADDR) + /* Create a device mapping for early_printf if specified. */ #if defined(SOCDEV_PA) && defined(SOCDEV_VA) - /* Create the custom map */ ldr r1, =SOCDEV_PA ldr r2, =SOCDEV_VA - bl build_pagetables + mov r3, #1 + bl build_device_pagetables #endif mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ @@ -205,9 +212,6 @@ Lunmapped: mcr p15, 0, r0, c3, c0, 0 /* * Enable MMU. - * On armv6 enable extended page tables, and set alignment checking - * to modulo-4 (CPU_CONTROL_UNAL_ENABLE) for the ldrd/strd - * instructions emitted by clang. */ mrc p15, 0, r0, c1, c0, 0 orr r0, r0, #(CPU_CONTROL_MMU_ENABLE) @@ -217,6 +221,9 @@ Lunmapped: nop CPWAIT(r0) + /* Transition the PC from physical to virtual addressing. */ + ldr pc,=mmu_done + mmu_done: nop adr r1, .Lstart @@ -227,7 +234,6 @@ mmu_done: str r3, [r1], #0x0004 /* get zero init data */ subs r2, r2, #4 bgt .L1 - ldr pc, .Lvirt_done virt_done: mov r1, #28 /* loader info size is 28 bytes also second arg */ @@ -301,21 +307,25 @@ translate_va_to_pa: * * Addresses must be 1MiB aligned */ +build_device_pagetables: + ldr r4, =(L1_TYPE_S|L1_S_AP(AP_KRW)) + b 1f build_pagetables: /* Set the required page attributed */ ldr r4, =(L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) +1: orr r1, r4 /* Move the virtual address to the correct bit location */ lsr r2, #(L1_S_SHIFT - 2) mov r4, r3 -1: +2: str r1, [r0, r2] add r2, r2, #4 add r1, r1, #(L1_S_SIZE) adds r4, r4, #-1 - bhi 1b + bhi 2b RET From owner-svn-src-all@freebsd.org Sun Dec 20 23:38:15 2015 Return-Path: Delivered-To: svn-src-all@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 5DF20A4E8FF; Sun, 20 Dec 2015 23:38:15 +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 2D1491A2E; Sun, 20 Dec 2015 23:38:15 +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 tBKNcEPB017211; Sun, 20 Dec 2015 23:38:14 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBKNcE4j017210; Sun, 20 Dec 2015 23:38:14 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512202338.tBKNcE4j017210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 20 Dec 2015 23:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292524 - head/sys/arm/mv/kirkwood X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 23:38:15 -0000 Author: ian Date: Sun Dec 20 23:38:14 2015 New Revision: 292524 URL: https://svnweb.freebsd.org/changeset/base/292524 Log: Change KERNVIRTADDR to 0xc0000000 since the low-order bits no longer need to match the physical load address. Remove the *PHYSADDR symbols which are no longer necessary. Also remove a bunch of comments, most of which which have been wrong for quite some time now, and the rest of which are mooted by these changes. All that's left in this file is assigning a single symbol to its cannonical value, not much to comment on anymore. Modified: head/sys/arm/mv/kirkwood/std.kirkwood Modified: head/sys/arm/mv/kirkwood/std.kirkwood ============================================================================== --- head/sys/arm/mv/kirkwood/std.kirkwood Sun Dec 20 23:31:11 2015 (r292523) +++ head/sys/arm/mv/kirkwood/std.kirkwood Sun Dec 20 23:38:14 2015 (r292524) @@ -1,14 +1,4 @@ # $FreeBSD$ -# kernel gets loaded at 0x00900000 by the loader, but runs at virtual address -# 0xc0900000. RAM starts at 0. We put the pagetable at a reasonable place -# in memory, but may need to bounce it higher if there's a problem with this. -# We could paper over this by loading the kernel at 0xc0000000 virtual, but -# that leads to other complications, so we'll just reclaim the lower region of -# ram after we're loaded. Put the page tables for startup at 1MB. -makeoptions KERNPHYSADDR=0x00900000 -makeoptions KERNVIRTADDR=0xc0900000 - -options KERNPHYSADDR=0x00900000 -options KERNVIRTADDR=0xc0900000 -options PHYSADDR=0x00000000 +makeoptions KERNVIRTADDR=0xc0000000 +options KERNVIRTADDR=0xc0000000 From owner-svn-src-all@freebsd.org Mon Dec 21 01:14:56 2015 Return-Path: Delivered-To: svn-src-all@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 59317A4E3A6; Mon, 21 Dec 2015 01:14:56 +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 196DB1815; Mon, 21 Dec 2015 01:14:56 +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 tBL1Et3A046319; Mon, 21 Dec 2015 01:14:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBL1EsOi046314; Mon, 21 Dec 2015 01:14:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512210114.tBL1EsOi046314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Dec 2015 01:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292525 - in head/sys/arm/xscale: i80321 i8134x ixp425 pxa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 01:14:56 -0000 Author: ian Date: Mon Dec 21 01:14:54 2015 New Revision: 292525 URL: https://svnweb.freebsd.org/changeset/base/292525 Log: Replace some references to KERNPHYSADDR with the equivelent value passed in from the bootloader. Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c head/sys/arm/xscale/i80321/iq31244_machdep.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/pxa/pxa_machdep.c Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/ep80219_machdep.c Sun Dec 20 23:38:14 2015 (r292524) +++ head/sys/arm/xscale/i80321/ep80219_machdep.c Mon Dec 21 01:14:54 2015 (r292525) @@ -343,9 +343,9 @@ initarm(struct arm_boot_params *abp) * Prepare the list of physical memory available to the vm subsystem. */ arm_physmem_hardware_region(IQ80321_SDRAM_START, memsize); - arm_physmem_exclude_region(freemem_pt, KERNPHYSADDR - + arm_physmem_exclude_region(freemem_pt, abp->abp_physaddr - freemem_pt, EXFLAG_NOALLOC); - arm_physmem_exclude_region(freemempos, KERNPHYSADDR - 0x100000 - + arm_physmem_exclude_region(freemempos, abp->abp_physaddr - 0x100000 - freemempos, EXFLAG_NOALLOC); arm_physmem_exclude_region(abp->abp_physaddr, virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/iq31244_machdep.c Sun Dec 20 23:38:14 2015 (r292524) +++ head/sys/arm/xscale/i80321/iq31244_machdep.c Mon Dec 21 01:14:54 2015 (r292525) @@ -345,9 +345,9 @@ initarm(struct arm_boot_params *abp) * Prepare the list of physical memory available to the vm subsystem. */ arm_physmem_hardware_region(SDRAM_START, memsize); - arm_physmem_exclude_region(freemem_pt, KERNPHYSADDR - + arm_physmem_exclude_region(freemem_pt, abp->abp_physaddr - freemem_pt, EXFLAG_NOALLOC); - arm_physmem_exclude_region(freemempos, KERNPHYSADDR - 0x100000 - + arm_physmem_exclude_region(freemempos, abp->abp_physaddr - 0x100000 - freemempos, EXFLAG_NOALLOC); arm_physmem_exclude_region(abp->abp_physaddr, virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Sun Dec 20 23:38:14 2015 (r292524) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Mon Dec 21 01:14:54 2015 (r292525) @@ -325,9 +325,9 @@ initarm(struct arm_boot_params *abp) * Prepare the list of physical memory available to the vm subsystem. */ arm_physmem_hardware_region(SDRAM_START, memsize); - arm_physmem_exclude_region(freemem_pt, KERNPHYSADDR - + arm_physmem_exclude_region(freemem_pt, abp->abp_physaddr - freemem_pt, EXFLAG_NOALLOC); - arm_physmem_exclude_region(freemempos, KERNPHYSADDR - 0x100000 - + arm_physmem_exclude_region(freemempos, abp->abp_physaddr - 0x100000 - freemempos, EXFLAG_NOALLOC); arm_physmem_exclude_region(abp->abp_physaddr, virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Sun Dec 20 23:38:14 2015 (r292524) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Mon Dec 21 01:14:54 2015 (r292525) @@ -415,9 +415,9 @@ initarm(struct arm_boot_params *abp) * Prepare the list of physical memory available to the vm subsystem. */ arm_physmem_hardware_region(PHYSADDR, memsize); - arm_physmem_exclude_region(freemem_pt, KERNPHYSADDR - + arm_physmem_exclude_region(freemem_pt, abp->abp_physaddr - freemem_pt, EXFLAG_NOALLOC); - arm_physmem_exclude_region(freemempos, KERNPHYSADDR - 0x100000 - + arm_physmem_exclude_region(freemempos, abp->abp_physaddr - 0x100000 - freemempos, EXFLAG_NOALLOC); arm_physmem_exclude_region(abp->abp_physaddr, virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); Modified: head/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_machdep.c Sun Dec 20 23:38:14 2015 (r292524) +++ head/sys/arm/xscale/pxa/pxa_machdep.c Mon Dec 21 01:14:54 2015 (r292525) @@ -336,9 +336,9 @@ initarm(struct arm_boot_params *abp) if (memsize[j] > 0) arm_physmem_hardware_region(memstart[j], memsize[j]); } - arm_physmem_exclude_region(freemem_pt, KERNPHYSADDR - + arm_physmem_exclude_region(freemem_pt, abp->abp_physaddr - freemem_pt, EXFLAG_NOALLOC); - arm_physmem_exclude_region(freemempos, KERNPHYSADDR - 0x100000 - + arm_physmem_exclude_region(freemempos, abp->abp_physaddr - 0x100000 - freemempos, EXFLAG_NOALLOC); arm_physmem_exclude_region(abp->abp_physaddr, virtual_avail - KERNVIRTADDR, EXFLAG_NOALLOC); From owner-svn-src-all@freebsd.org Mon Dec 21 01:48:17 2015 Return-Path: Delivered-To: svn-src-all@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 5D979A4D5C8; Mon, 21 Dec 2015 01:48:17 +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 2ADB71606; Mon, 21 Dec 2015 01:48:17 +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 tBL1mGiN055215; Mon, 21 Dec 2015 01:48:16 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBL1mG8e055214; Mon, 21 Dec 2015 01:48:16 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512210148.tBL1mG8e055214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 21 Dec 2015 01:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292526 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 01:48:17 -0000 Author: adrian Date: Mon Dec 21 01:48:16 2015 New Revision: 292526 URL: https://svnweb.freebsd.org/changeset/base/292526 Log: [mips] print out l2 cache configuration if it exists. The Ingenic JZ7480 SoC that is on the Imagination Technologies CI20 board has an L2 cache: Cache info: picache_stride = 4096 picache_loopcount = 8 pdcache_stride = 4096 pdcache_loopcount = 8 cpu0: Ingenic Xburst processor v79.2 MMU: Standard TLB, 32 entries L1 i-cache: 8 ways of 128 sets, 32 bytes per line L1 d-cache: 8 ways of 128 sets, 32 bytes per line L2 cache: 8 ways of 256 sets, 128 bytes per line, 256 KiB total size Config1=0xbe67338b Config2=0x80000267 Config3=0x20 Modified: head/sys/mips/mips/cpu.c Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Mon Dec 21 01:14:54 2015 (r292525) +++ head/sys/mips/mips/cpu.c Mon Dec 21 01:48:16 2015 (r292526) @@ -318,6 +318,18 @@ cpu_identify(void) cpuinfo.l1.dc_nsets, cpuinfo.l1.dc_linesize); } + printf(" L2 cache: "); + if (cpuinfo.l2.dc_linesize == 0) { + printf("disabled"); + } else { + printf("%d ways of %d sets, %d bytes per line, " + "%d KiB total size\n", + cpuinfo.l2.dc_nways, + cpuinfo.l2.dc_nsets, + cpuinfo.l2.dc_linesize, + cpuinfo.l2.dc_size / 1024); + } + cfg0 = mips_rd_config(); /* If config register selection 1 does not exist, exit. */ if (!(cfg0 & MIPS_CONFIG_CM)) @@ -335,6 +347,7 @@ cpu_identify(void) * Config2 contains no useful information other then Config3 * existence flag */ + printf(" Config2=0x%08x\n", cfg2); /* If config register selection 3 does not exist, exit. */ if (!(cfg2 & MIPS_CONFIG_CM)) From owner-svn-src-all@freebsd.org Mon Dec 21 02:02:44 2015 Return-Path: Delivered-To: svn-src-all@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 E4BEAA4DED0; Mon, 21 Dec 2015 02:02:44 +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 B86B41ECF; Mon, 21 Dec 2015 02:02:44 +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 tBL22h8T060823; Mon, 21 Dec 2015 02:02:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBL22hZP060821; Mon, 21 Dec 2015 02:02:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512210202.tBL22hZP060821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Dec 2015 02:02:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292527 - head/sys/boot/libstand32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 02:02:45 -0000 Author: ian Date: Mon Dec 21 02:02:43 2015 New Revision: 292527 URL: https://svnweb.freebsd.org/changeset/base/292527 Log: Add strlcat() and strlcpy() to libstand32. This should have been part of r292234, but I forgot there was a libstand32. Submitted by: martymac Pointy hat: ian Modified: head/sys/boot/libstand32/Makefile Modified: head/sys/boot/libstand32/Makefile ============================================================================== --- head/sys/boot/libstand32/Makefile Mon Dec 21 01:48:16 2015 (r292526) +++ head/sys/boot/libstand32/Makefile Mon Dec 21 02:02:43 2015 (r292527) @@ -41,8 +41,8 @@ SRCS+= ntoh.c .PATH: ${LIBC_SRC}/string SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ - strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \ - strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c + strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ + strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .if ${MACHINE_CPUARCH} == "arm" .PATH: ${LIBC_SRC}/arm/gen From owner-svn-src-all@freebsd.org Mon Dec 21 03:32:11 2015 Return-Path: Delivered-To: svn-src-all@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 61187A4EC28; Mon, 21 Dec 2015 03:32:11 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-oi0-x236.google.com (mail-oi0-x236.google.com [IPv6:2607:f8b0:4003:c06::236]) (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 288531205; Mon, 21 Dec 2015 03:32:11 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-oi0-x236.google.com with SMTP id l9so57239474oia.2; Sun, 20 Dec 2015 19:32:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=4TxSK8jCGMtonFFfghkzRwrHxYGxrqpL2DwvTZAmTS0=; b=fpoKN+hNV1BfJeg06sthaeEA0Vjvr8YevJgIqCVAX1Ja5u5BSlXEGeyInb52iMp8Gw AybmPP//bY8qi2zBGCZ9EwEAsni2benCDXHtm1ze3hZNmxgeQdoFfdDmHnGQoRltoZ+r QvI6Tqiio70TxSbz/FCu2RXPH8YNhgg9wOd81gEfZH9aGTarhCChFwdIlVAjHnh4xznR mAo5lLsrp19V0SLOrQm3oalHjXOUCzfOFf0PNpr1EcGx+RB/56MrfbdZv36BYQd9wa/u YWPEVjut4XyacUMknbeqEuqZB3M6EcReSOtcW8YtmsK5PNsyM1IAEWDlGeHH7lLc6/Zu iJKw== MIME-Version: 1.0 X-Received: by 10.202.173.9 with SMTP id w9mr6168696oie.79.1450668730359; Sun, 20 Dec 2015 19:32:10 -0800 (PST) Received: by 10.182.7.33 with HTTP; Sun, 20 Dec 2015 19:32:10 -0800 (PST) Reply-To: araujo@FreeBSD.org In-Reply-To: <3897533.TozUtTrSHk@ralph.baldwin.cx> References: <201512172042.tBHKg5bM091931@repo.freebsd.org> <30CD0290-06B9-4024-8EEE-F25090608D46@gmail.com> <3897533.TozUtTrSHk@ralph.baldwin.cx> Date: Mon, 21 Dec 2015 11:32:10 +0800 Message-ID: Subject: Re: svn commit: r292410 - head/usr.sbin/boot0cfg From: Marcelo Araujo To: John Baldwin Cc: Garrett Cooper , luke , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 03:32:11 -0000 2015-12-19 1:50 GMT+08:00 John Baldwin : > On Friday, December 18, 2015 02:17:16 PM Marcelo Araujo wrote: > > 2015-12-18 13:53 GMT+08:00 Garrett Cooper : > > > > > > > > > On Dec 17, 2015, at 21:36, luke wrote: > > > > > > > >> On Fri, Dec 18, 2015 at 4:42 AM, John Baldwin > wrote: > > > >> Author: jhb > > > >> Date: Thu Dec 17 20:42:05 2015 > > > >> New Revision: 292410 > > > >> URL: https://svnweb.freebsd.org/changeset/base/292410 > > > >> > > > >> Log: > > > >> Exit cleanly if malloc() fails to allocate a buffer for a copy of > the > > > >> current MBR. > > > >> > > > >> PR: 205322 > > > >> Submitted by: Alexander Kuleshov > > > >> MFC after: 1 week > > > >> > > > >> Modified: > > > >> head/usr.sbin/boot0cfg/boot0cfg.c > > > >> > > > >> Modified: head/usr.sbin/boot0cfg/boot0cfg.c > > > >> > > > > ============================================================================== > > > >> --- head/usr.sbin/boot0cfg/boot0cfg.c Thu Dec 17 20:33:20 2015 > > > (r292409) > > > >> +++ head/usr.sbin/boot0cfg/boot0cfg.c Thu Dec 17 20:42:05 2015 > > > (r292410) > > > >> @@ -337,6 +337,8 @@ read_mbr(const char *disk, u_int8_t **mb > > > >> return (mbr_size); > > > >> } > > > >> *mbr = malloc(sizeof(buf)); > > > >> + if (mbr == NULL) > > > >> + errx(1, "%s: unable to allocate MBR buffer", disk); > > > >> memcpy(*mbr, buf, sizeof(buf)); > > > >> close(fd); > > > > > > > > > > Hi, > > > > > > > > Should the check be against *mbr ? > > > > + if (*mbr == NULL) > > > > + errx(1, "%s: unable to allocate MBR buffer", disk); > > > > > > Yup! > > > > > > > +1 > > > > Could be write as: > > if ((*mbr = malloc(sizeof(buf))) == NULL) > > errx(1, "%s: unable to allocate MBR buffer", disk); > > Yes, but I don't like side effects in conditionals. > > OTOH, changing away from that is how I fubar'd the original patch. :-/ > > Understandable reason, but all the rest of the code is using that style, bde@ has mentioned about it too. In other hand, the change is too small to have another ci to fix it. Best, -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@freebsd.org Mon Dec 21 04:42:59 2015 Return-Path: Delivered-To: svn-src-all@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 A9930A4EED4; Mon, 21 Dec 2015 04:42:59 +0000 (UTC) (envelope-from cem@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 7A6961C20; Mon, 21 Dec 2015 04:42:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBL4gwhL007630; Mon, 21 Dec 2015 04:42:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBL4gw6T007629; Mon, 21 Dec 2015 04:42:58 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201512210442.tBL4gw6T007629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 21 Dec 2015 04:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292528 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 04:42:59 -0000 Author: cem Date: Mon Dec 21 04:42:58 2015 New Revision: 292528 URL: https://svnweb.freebsd.org/changeset/base/292528 Log: x86: Add CPUID_STDEXT_* macros for CPU feature bits A follow-up to r292478 and r292488. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Mon Dec 21 02:02:43 2015 (r292527) +++ head/sys/x86/include/specialreg.h Mon Dec 21 04:42:58 2015 (r292528) @@ -342,15 +342,20 @@ #define CPUID_STDEXT_RTM 0x00000800 #define CPUID_STDEXT_MPX 0x00004000 #define CPUID_STDEXT_AVX512F 0x00010000 +#define CPUID_STDEXT_AVX512DQ 0x00020000 #define CPUID_STDEXT_RDSEED 0x00040000 #define CPUID_STDEXT_ADX 0x00080000 #define CPUID_STDEXT_SMAP 0x00100000 +#define CPUID_STDEXT_AVX512IFMA 0x00200000 +#define CPUID_STDEXT_PCOMMIT 0x00400000 #define CPUID_STDEXT_CLFLUSHOPT 0x00800000 +#define CPUID_STDEXT_CLWB 0x01000000 #define CPUID_STDEXT_PROCTRACE 0x02000000 #define CPUID_STDEXT_AVX512PF 0x04000000 #define CPUID_STDEXT_AVX512ER 0x08000000 #define CPUID_STDEXT_AVX512CD 0x10000000 #define CPUID_STDEXT_SHA 0x20000000 +#define CPUID_STDEXT_AVX512BW 0x40000000 /* * CPUID manufacturers identifiers From owner-svn-src-all@freebsd.org Mon Dec 21 05:08:21 2015 Return-Path: Delivered-To: svn-src-all@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 F19A2A4BEF0; Mon, 21 Dec 2015 05:08:21 +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 C383417CE; Mon, 21 Dec 2015 05:08:21 +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 tBL58KkV013632; Mon, 21 Dec 2015 05:08:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBL58KD8013631; Mon, 21 Dec 2015 05:08:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512210508.tBL58KD8013631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 21 Dec 2015 05:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292529 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 05:08:22 -0000 Author: imp Date: Mon Dec 21 05:08:20 2015 New Revision: 292529 URL: https://svnweb.freebsd.org/changeset/base/292529 Log: There's no such program as [-n :(. Add the missing space. Also, work when the object directory doesn't exist yet. realpath hates us, so use the backup of the realpath arg when that happens. Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Mon Dec 21 04:42:58 2015 (r292528) +++ head/tools/tools/nanobsd/embedded/common Mon Dec 21 05:08:20 2015 (r292529) @@ -86,7 +86,7 @@ NANO_CFG_BASE=$(pwd) NANO_CFG_BASE=$(realpath ${NANO_CFG_BASE}/..) NANO_SRC=$(realpath ${NANO_CFG_BASE}/../../..) #### XXX share obj -NANO_OBJ=$(realpath ${NANO_SRC}/../$NANO_NAME/obj) +NANO_OBJ=$(realpath ${NANO_SRC}/../$NANO_NAME/obj || echo ${NANO_SRC}/../$NANO_NAME/obj) # Where cust_pkg() finds packages to install #XXX: Is this the right place? #NANO_PORTS=$(realpath ${NANO_SRC}/../ports) @@ -297,7 +297,7 @@ create_diskimage_mbr ( ) ( done # Populate the FAT partition, if needed - if [-n "${NANO_SLICE_FAT}" ]; then + if [ -n "${NANO_SLICE_FAT}" ]; then echo Creating MSDOS partition for kernel newfs_msdos -C ${NANO_SLICE_FAT_SIZE} -F 16 -L ${NANO_NAME} \ ${NANO_OBJ}/_.${NANO_SLICE_FAT} From owner-svn-src-all@freebsd.org Mon Dec 21 07:04:02 2015 Return-Path: Delivered-To: svn-src-all@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 A1BB7A4EE62; Mon, 21 Dec 2015 07:04:02 +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 6269F1998; Mon, 21 Dec 2015 07:04:02 +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 tBL741DD047818; Mon, 21 Dec 2015 07:04:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBL741w4047817; Mon, 21 Dec 2015 07:04:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512210704.tBL741w4047817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 21 Dec 2015 07:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292530 - head/tools/regression/mac/mac_bsdextended X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 07:04:02 -0000 Author: ngie Date: Mon Dec 21 07:04:01 2015 New Revision: 292530 URL: https://svnweb.freebsd.org/changeset/base/292530 Log: - Use 1 for an exit code instead of -1 with err, errx, and exit - Add unistd.h for getuid(3) - Sort #includes MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/mac/mac_bsdextended/test_ugidfw.c Modified: head/tools/regression/mac/mac_bsdextended/test_ugidfw.c ============================================================================== --- head/tools/regression/mac/mac_bsdextended/test_ugidfw.c Mon Dec 21 05:08:20 2015 (r292529) +++ head/tools/regression/mac/mac_bsdextended/test_ugidfw.c Mon Dec 21 07:04:01 2015 (r292530) @@ -35,10 +35,11 @@ #include #include #include -#include #include #include #include +#include +#include /* * Starting point for a regression test for mac_bsdextended(4) and the @@ -49,7 +50,7 @@ usage(void) { fprintf(stderr, "test_ugidfw\n"); - exit(-1); + exit(1); } /* @@ -159,13 +160,13 @@ test_libugidfw_strings(void) for (i = 0; i < test_users_len; i++) { if (getpwnam(test_users[i]) == NULL) - err(-1, "test_libugidfw_strings: getpwnam: %s", + err(1, "test_libugidfw_strings: getpwnam: %s", test_users[i]); } for (i = 0; i < test_groups_len; i++) { if (getgrnam(test_groups[i]) == NULL) - err(-1, "test_libugidfw_strings: getgrnam: %s", + err(1, "test_libugidfw_strings: getgrnam: %s", test_groups[i]); } @@ -173,15 +174,15 @@ test_libugidfw_strings(void) error = bsde_parse_rule_string(test_strings[i], &rule, sizeof(errorstr), errorstr); if (error == -1) - errx(-1, "bsde_parse_rule_string: '%s' (%d): %s", + errx(1, "bsde_parse_rule_string: '%s' (%d): %s", test_strings[i], i, errorstr); error = bsde_rule_to_string(&rule, rulestr, sizeof(rulestr)); if (error < 0) - errx(-1, "bsde_rule_to_string: rule for '%s' " + errx(1, "bsde_rule_to_string: rule for '%s' " "returned %d", test_strings[i], error); if (strcmp(test_strings[i], rulestr) != 0) - errx(-1, "test_libugidfw: '%s' in, '%s' out", + errx(1, "test_libugidfw: '%s' in, '%s' out", test_strings[i], rulestr); } } @@ -210,12 +211,12 @@ main(int argc, char *argv[]) switch (mac_is_present("bsdextended")) { case -1: - err(-1, "mac_is_present"); + err(1, "mac_is_present"); case 1: break; case 0: default: - errx(-1, "mac_bsdextended not loaded"); + errx(1, "mac_bsdextended not loaded"); } /* @@ -226,13 +227,13 @@ main(int argc, char *argv[]) */ count = bsde_get_rule_count(sizeof(errorstr), errorstr); if (count == -1) - errx(-1, "bsde_get_rule_count: %s", errorstr); + errx(1, "bsde_get_rule_count: %s", errorstr); if (count != 0) - errx(-1, "bsde_get_rule_count: %d rules", count); + errx(1, "bsde_get_rule_count: %d rules", count); slots = bsde_get_rule_slots(sizeof(errorstr), errorstr); if (slots == -1) - errx(-1, "bsde_get_rule_slots: %s", errorstr); + errx(1, "bsde_get_rule_slots: %s", errorstr); return (0); } From owner-svn-src-all@freebsd.org Mon Dec 21 08:14:47 2015 Return-Path: Delivered-To: svn-src-all@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 26C87A4D535; Mon, 21 Dec 2015 08:14:47 +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 032F511C1; Mon, 21 Dec 2015 08:14:46 +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 tBL8Ekui067657; Mon, 21 Dec 2015 08:14:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBL8Ekx2067656; Mon, 21 Dec 2015 08:14:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512210814.tBL8Ekx2067656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 21 Dec 2015 08:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292531 - head/tools/regression/mac/mac_bsdextended X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 08:14:47 -0000 Author: ngie Date: Mon Dec 21 08:14:45 2015 New Revision: 292531 URL: https://svnweb.freebsd.org/changeset/base/292531 Log: Make test_matches.sh into a series of TAP testcases Use temporary filesystems / memory disks instead of a hardcoded path which doesn't exist on test systems MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/mac/mac_bsdextended/test_matches.sh Modified: head/tools/regression/mac/mac_bsdextended/test_matches.sh ============================================================================== --- head/tools/regression/mac/mac_bsdextended/test_matches.sh Mon Dec 21 07:04:01 2015 (r292530) +++ head/tools/regression/mac/mac_bsdextended/test_matches.sh Mon Dec 21 08:14:45 2015 (r292531) @@ -10,158 +10,185 @@ uidoutrange="daemon" gidinrange="nobody" # We expect $uidinrange in this group gidoutrange="daemon" # We expect $uidinrange in this group -playground="/stuff/nobody/" # Must not be on root fs - # # Setup # -rm -f $playground/test* + +: ${TMPDIR=/tmp} +if [ $(id -u) -ne 0 ]; then + echo "1..0 # SKIP test must be run as root" + exit 0 +fi +if ! playground=$(mktemp -d $TMPDIR/tmp.XXXXXXX); then + echo "1..0 # SKIP failed to create temporary directory" + exit 0 +fi +trap "rmdir $playground" EXIT INT TERM +if ! mdmfs -s 25m md $playground; then + echo "1..0 # SKIP failed to mount md device" + exit 0 +fi +chmod a+rwx $playground +md_device=$(mount -p | grep "$playground" | awk '{ gsub(/^\/dev\//, "", $1); print $1 }') +trap "umount -f $playground; mdconfig -d -u $md_device; rmdir $playground" EXIT INT TERM +if [ -z "$md_device" ]; then + mount -p | grep $playground + echo "1..0 # md device not properly attached to the system" +fi + ugidfw remove 1 file1=$playground/test-$uidinrange file2=$playground/test-$uidoutrange -cat < $playground/test-script.pl -if (open(F, ">" . shift)) { exit 0; } else { exit 1; } +cat > $playground/test-script.sh <<'EOF' +#!/bin/sh +: > $1 EOF -command1="perl $playground/test-script.pl $file1" -command2="perl $playground/test-script.pl $file2" +if [ $? -ne 0 ]; then + echo "1..0 # SKIP failed to create test script" + exit 0 +fi +echo "1..30" + +command1="sh $playground/test-script.sh $file1" +command2="sh $playground/test-script.sh $file2" -echo -n "$uidinrange file: " -su -m $uidinrange -c "$command1 && echo good" +echo "# $uidinrange file:" +su -m $uidinrange -c "if $command1; then echo ok; else echo not ok; fi" chown "$uidinrange":"$gidinrange" $file1 chmod a+w $file1 -echo -n "$uidoutrange file: " -$command2 && echo good +echo "# $uidoutrange file:" +if $command2; then echo ok; else echo not ok; fi chown "$uidoutrange":"$gidoutrange" $file2 chmod a+w $file2 # # No rules # -echo -n "no rules $uidinrange: " -su -fm $uidinrange -c "$command1 && echo good" -echo -n "no rules $uidoutrange: " -su -fm $uidoutrange -c "$command1 && echo good" +echo "# no rules $uidinrange:" +su -fm $uidinrange -c "if $command1; then echo ok; else echo not ok; fi" +echo "# no rules $uidoutrange:" +su -fm $uidoutrange -c "if $command1; then echo ok; else echo not ok; fi" # # Subject Match on uid # ugidfw set 1 subject uid $uidrange object mode rasx -echo -n "subject uid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "subject uid out range: " -su -fm $uidoutrange -c "$command1 && echo good" +echo "# subject uid in range:" +su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" +echo "# subject uid out range:" +su -fm $uidoutrange -c "if $command1; then echo ok; else echo not ok; fi" # # Subject Match on gid # ugidfw set 1 subject gid $gidrange object mode rasx -echo -n "subject gid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "subject gid out range: " -su -fm $uidoutrange -c "$command1 && echo good" +echo "# subject gid in range:" +su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" +echo "# subject gid out range:" +su -fm $uidoutrange -c "if $command1; then echo ok; else echo not ok; fi" # # Subject Match on jail # -echo -n "subject matching jailid: " rm -f $playground/test-jail -jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 3; touch $playground/test-jail) &"` +echo "# subject matching jailid:" +jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` ugidfw set 1 subject jailid $jailid object mode rasx -sleep 6 -if [ ! -f $playground/test-jail ] ; then echo good ; fi +sleep 10 +if [ -f $playground/test-jail ]; then echo not ok; else echo ok; fi -echo -n "subject nonmatching jailid: " rm -f $playground/test-jail -jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 3; touch $playground/test-jail) &"` -sleep 6 -if [ -f $playground/test-jail ] ; then echo good ; fi +echo "# subject nonmatching jailid:" +jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` +sleep 10 +if [ -f $playground/test-jail ]; then echo ok; else echo not ok; fi # # Object uid # ugidfw set 1 subject object uid $uidrange mode rasx -echo -n "object uid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "object uid out range: " -su -fm $uidinrange -c "$command2 && echo good" +echo "# object uid in range:" +su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" +echo "# object uid out range:" +su -fm $uidinrange -c "if $command2; then echo ok; else echo not ok; fi" ugidfw set 1 subject object uid $uidrange mode rasx -echo -n "object uid in range (differennt subject): " -su -fm $uidoutrange -c "$command1 || echo good" -echo -n "object uid out range (differennt subject): " -su -fm $uidoutrange -c "$command2 && echo good" +echo "# object uid in range (differennt subject):" +su -fm $uidoutrange -c "if $command1; then echo not ok; else echo ok; fi" +echo "# object uid out range (differennt subject):" +su -fm $uidoutrange -c "if $command2; then echo ok; else echo not ok; fi" # # Object gid # ugidfw set 1 subject object gid $uidrange mode rasx -echo -n "object gid in range: " -su -fm $uidinrange -c "$command1 || echo good" -echo -n "object gid out range: " -su -fm $uidinrange -c "$command2 && echo good" -echo -n "object gid in range (differennt subject): " -su -fm $uidoutrange -c "$command1 || echo good" -echo -n "object gid out range (differennt subject): " -su -fm $uidoutrange -c "$command2 && echo good" +echo "# object gid in range:" +su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" +echo "# object gid out range:" +su -fm $uidinrange -c "if $command2; then echo ok; else echo not ok; fi" +echo "# object gid in range (different subject):" +su -fm $uidoutrange -c "if $command1; then echo not ok; else echo ok; fi" +echo "# object gid out range (different subject):" +su -fm $uidoutrange -c "if $command2; then echo ok; else echo not ok; fi" # # Object filesys # ugidfw set 1 subject uid $uidrange object filesys / mode rasx -echo -n "object out of filesys: " -su -fm $uidinrange -c "$command1 && echo good" +echo "# object out of filesys:" +su -fm $uidinrange -c "if $command1; then echo ok; else echo not ok; fi" ugidfw set 1 subject uid $uidrange object filesys $playground mode rasx -echo -n "object in filesys: " -su -fm $uidinrange -c "$command1 || echo good" +echo "# object in filesys:" +su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" # # Object suid # ugidfw set 1 subject uid $uidrange object suid mode rasx -echo -n "object notsuid: " -su -fm $uidinrange -c "$command1 && echo good" +echo "# object notsuid:" +su -fm $uidinrange -c "if $command1; then echo ok; else echo not ok; fi" chmod u+s $file1 -echo -n "object suid: " -su -fm $uidinrange -c "$command1 || echo good" +echo "# object suid:" +su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" chmod u-s $file1 # # Object sgid # ugidfw set 1 subject uid $uidrange object sgid mode rasx -echo -n "object notsgid: " -su -fm $uidinrange -c "$command1 && echo good" +echo "# object notsgid:" +su -fm $uidinrange -c "if $command1; then echo ok; else echo not ok; fi" chmod g+s $file1 -echo -n "object sgid: " -su -fm $uidinrange -c "$command1 || echo good" +echo "# object sgid:" +su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" chmod g-s $file1 # # Object uid matches subject # ugidfw set 1 subject uid $uidrange object uid_of_subject mode rasx -echo -n "object uid notmatches subject: " -su -fm $uidinrange -c "$command2 && echo good" -echo -n "object uid matches subject: " -su -fm $uidinrange -c "$command1 || echo good" +echo "# object uid notmatches subject:" +su -fm $uidinrange -c "if $command2; then echo ok; else echo not ok; fi" +echo "# object uid matches subject:" +su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" # # Object gid matches subject # ugidfw set 1 subject uid $uidrange object gid_of_subject mode rasx -echo -n "object gid notmatches subject: " -su -fm $uidinrange -c "$command2 && echo good" -echo -n "object gid matches subject: " -su -fm $uidinrange -c "$command1 || echo good" +echo "# object gid notmatches subject:" +su -fm $uidinrange -c "if $command2; then echo ok; else echo not ok; fi" +echo "# object gid matches subject:" +su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" # # Object type # ugidfw set 1 subject uid $uidrange object type dbclsp mode rasx -echo -n "object not type: " -su -fm $uidinrange -c "$command1 && echo good" +echo "# object not type:" +su -fm $uidinrange -c "if $command1; then echo ok; else echo not ok; fi" ugidfw set 1 subject uid $uidrange object type r mode rasx -echo -n "object type: " -su -fm $uidinrange -c "$command1 || echo good" +echo "# object type:" +su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" From owner-svn-src-all@freebsd.org Mon Dec 21 08:53:28 2015 Return-Path: Delivered-To: svn-src-all@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 20714A4EBB1; Mon, 21 Dec 2015 08:53:28 +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 E3D1F112C; Mon, 21 Dec 2015 08:53:27 +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 tBL8rRRY079193; Mon, 21 Dec 2015 08:53:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBL8rRcM079192; Mon, 21 Dec 2015 08:53:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512210853.tBL8rRcM079192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 21 Dec 2015 08:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292532 - head/tools/regression/mac/mac_bsdextended X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 08:53:28 -0000 Author: ngie Date: Mon Dec 21 08:53:26 2015 New Revision: 292532 URL: https://svnweb.freebsd.org/changeset/base/292532 Log: Mark `subject matching jailid` testcase as an unexpected failure with TODO to ensure that the testcase isn't marked as a failure PR: 205481 MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/mac/mac_bsdextended/test_matches.sh Modified: head/tools/regression/mac/mac_bsdextended/test_matches.sh ============================================================================== --- head/tools/regression/mac/mac_bsdextended/test_matches.sh Mon Dec 21 08:14:45 2015 (r292531) +++ head/tools/regression/mac/mac_bsdextended/test_matches.sh Mon Dec 21 08:53:26 2015 (r292532) @@ -97,7 +97,7 @@ echo "# subject matching jailid:" jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` ugidfw set 1 subject jailid $jailid object mode rasx sleep 10 -if [ -f $playground/test-jail ]; then echo not ok; else echo ok; fi +if [ -f $playground/test-jail ]; then echo "not ok # TODO this testcase is buggy (see bug # 205481)"; else echo ok; fi rm -f $playground/test-jail echo "# subject nonmatching jailid:" From owner-svn-src-all@freebsd.org Mon Dec 21 08:58:16 2015 Return-Path: Delivered-To: svn-src-all@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 539B2A4EDF0; Mon, 21 Dec 2015 08:58:16 +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 20E9D137D; Mon, 21 Dec 2015 08:58:16 +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 tBL8wF6w079408; Mon, 21 Dec 2015 08:58:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBL8wFQu079407; Mon, 21 Dec 2015 08:58:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512210858.tBL8wFQu079407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 21 Dec 2015 08:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292533 - head/tools/regression/mac/mac_bsdextended X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 08:58:16 -0000 Author: ngie Date: Mon Dec 21 08:58:14 2015 New Revision: 292533 URL: https://svnweb.freebsd.org/changeset/base/292533 Log: Skip the testcases if mac_bsdextended(4) isn't detected on the system MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/mac/mac_bsdextended/test_matches.sh Modified: head/tools/regression/mac/mac_bsdextended/test_matches.sh ============================================================================== --- head/tools/regression/mac/mac_bsdextended/test_matches.sh Mon Dec 21 08:53:26 2015 (r292532) +++ head/tools/regression/mac/mac_bsdextended/test_matches.sh Mon Dec 21 08:58:14 2015 (r292533) @@ -19,6 +19,10 @@ if [ $(id -u) -ne 0 ]; then echo "1..0 # SKIP test must be run as root" exit 0 fi +if ! sysctl -N security.mac.bsdextended >/dev/null 2>&1; then + echo "1..0 # SKIP mac_bsdextended(4) support isn't available" + exit 0 +fi if ! playground=$(mktemp -d $TMPDIR/tmp.XXXXXXX); then echo "1..0 # SKIP failed to create temporary directory" exit 0 From owner-svn-src-all@freebsd.org Mon Dec 21 09:34:47 2015 Return-Path: Delivered-To: svn-src-all@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 0C7A6A1458E; Mon, 21 Dec 2015 09:34:47 +0000 (UTC) (envelope-from brueffer@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 D160212FC; Mon, 21 Dec 2015 09:34:46 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBL9YjGC090864; Mon, 21 Dec 2015 09:34:45 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBL9YjYS090863; Mon, 21 Dec 2015 09:34:45 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512210934.tBL9YjYS090863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 21 Dec 2015 09:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292534 - stable/10/usr.sbin/ctm/ctm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 09:34:47 -0000 Author: brueffer Date: Mon Dec 21 09:34:45 2015 New Revision: 292534 URL: https://svnweb.freebsd.org/changeset/base/292534 Log: MFH: r292212 Flesh out the SEE ALSO section. PR: 202929 Submitted by: jhs@berklix.com Modified: stable/10/usr.sbin/ctm/ctm/ctm.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctm/ctm/ctm.1 ============================================================================== --- stable/10/usr.sbin/ctm/ctm/ctm.1 Mon Dec 21 08:58:14 2015 (r292533) +++ stable/10/usr.sbin/ctm/ctm/ctm.1 Mon Dec 21 09:34:45 2015 (r292534) @@ -12,7 +12,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 1995 +.Dd December 14, 2015 .Dt CTM 1 .Os .Sh NAME @@ -303,8 +303,19 @@ and .Fl V options. .Sh SEE ALSO +.Xr ctm_dequeue 1 , .Xr ctm_rmail 1 , +.Xr ctm_smail 1 , .Xr ctm 5 +.Rs +.%B "The FreeBSD Handbook" +.%T "Using CTM" +.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/ctm.html +.Re +.Rs +.%T "Miscellaneous CTM on FreeBSD Resources" +.%U http://ctm.berklix.org +.Re .Sh HISTORY Initial trials were run during the work on .Fx 1.1.5 , From owner-svn-src-all@freebsd.org Mon Dec 21 09:36:46 2015 Return-Path: Delivered-To: svn-src-all@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 C5EFAA1470B; Mon, 21 Dec 2015 09:36:46 +0000 (UTC) (envelope-from brueffer@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 963E414B8; Mon, 21 Dec 2015 09:36:46 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBL9aj07090999; Mon, 21 Dec 2015 09:36:45 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBL9aj6t090998; Mon, 21 Dec 2015 09:36:45 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512210936.tBL9aj6t090998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 21 Dec 2015 09:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292535 - stable/9/usr.sbin/ctm/ctm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 09:36:46 -0000 Author: brueffer Date: Mon Dec 21 09:36:45 2015 New Revision: 292535 URL: https://svnweb.freebsd.org/changeset/base/292535 Log: MFH: r292212 Flesh out the SEE ALSO section. PR: 202929 Submitted by: jhs@berklix.com Modified: stable/9/usr.sbin/ctm/ctm/ctm.1 Directory Properties: stable/9/usr.sbin/ctm/ctm/ (props changed) Modified: stable/9/usr.sbin/ctm/ctm/ctm.1 ============================================================================== --- stable/9/usr.sbin/ctm/ctm/ctm.1 Mon Dec 21 09:34:45 2015 (r292534) +++ stable/9/usr.sbin/ctm/ctm/ctm.1 Mon Dec 21 09:36:45 2015 (r292535) @@ -12,7 +12,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 1995 +.Dd December 14, 2015 .Dt CTM 1 .Os .Sh NAME @@ -303,8 +303,19 @@ and .Fl V options. .Sh SEE ALSO +.Xr ctm_dequeue 1 , .Xr ctm_rmail 1 , +.Xr ctm_smail 1 , .Xr ctm 5 +.Rs +.%B "The FreeBSD Handbook" +.%T "Using CTM" +.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/ctm.html +.Re +.Rs +.%T "Miscellaneous CTM on FreeBSD Resources" +.%U http://ctm.berklix.org +.Re .Sh HISTORY Initial trials were run during the work on .Fx 1.1.5 , From owner-svn-src-all@freebsd.org Mon Dec 21 09:38:47 2015 Return-Path: Delivered-To: svn-src-all@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 37920A148D5; Mon, 21 Dec 2015 09:38:47 +0000 (UTC) (envelope-from uqs@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 055961748; Mon, 21 Dec 2015 09:38:46 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBL9ckQa091124; Mon, 21 Dec 2015 09:38:46 GMT (envelope-from uqs@FreeBSD.org) Received: (from uqs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBL9ckSf091123; Mon, 21 Dec 2015 09:38:46 GMT (envelope-from uqs@FreeBSD.org) Message-Id: <201512210938.tBL9ckSf091123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: uqs set sender to uqs@FreeBSD.org using -f From: Ulrich Spoerlein Date: Mon, 21 Dec 2015 09:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292536 - head/sys/modules/tcp/fastpath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 09:38:47 -0000 Author: uqs Date: Mon Dec 21 09:38:45 2015 New Revision: 292536 URL: https://svnweb.freebsd.org/changeset/base/292536 Log: Fix 'make depend' Modified: head/sys/modules/tcp/fastpath/Makefile Modified: head/sys/modules/tcp/fastpath/Makefile ============================================================================== --- head/sys/modules/tcp/fastpath/Makefile Mon Dec 21 09:36:45 2015 (r292535) +++ head/sys/modules/tcp/fastpath/Makefile Mon Dec 21 09:38:45 2015 (r292536) @@ -7,6 +7,9 @@ KMOD= fastpath SRCS= fastpath.c +SRCS+= opt_ipfw.h opt_inet.h opt_inet6.h opt_ipsec.h opt_kdtrace.h +SRCS+= opt_tcpdebug.h + # # Enable full debugging # From owner-svn-src-all@freebsd.org Mon Dec 21 10:56:39 2015 Return-Path: Delivered-To: svn-src-all@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 975E9A4D743; Mon, 21 Dec 2015 10:56:39 +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 675081A86; Mon, 21 Dec 2015 10:56:39 +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 tBLAucHV014268; Mon, 21 Dec 2015 10:56:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLAucMt014267; Mon, 21 Dec 2015 10:56:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512211056.tBLAucMt014267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 21 Dec 2015 10:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292537 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 10:56:39 -0000 Author: hselasky Date: Mon Dec 21 10:56:38 2015 New Revision: 292537 URL: https://svnweb.freebsd.org/changeset/base/292537 Log: Implement ACCESS_ONCE(), WRITE_ONCE() and READ_ONCE(). MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/compiler.h Mon Dec 21 09:38:45 2015 (r292536) +++ head/sys/compat/linuxkpi/common/include/linux/compiler.h Mon Dec 21 10:56:38 2015 (r292537) @@ -72,4 +72,20 @@ #define barrier() __asm__ __volatile__("": : :"memory") +#define ACCESS_ONCE(x) (*(volatile __typeof(x) *)&(x)) + +#define WRITE_ONCE(x,v) do { \ + barrier(); \ + ACCESS_ONCE(x) = (v); \ + barrier(); \ +} while (0) + +#define READ_ONCE(x) ({ \ + __typeof(x) __var; \ + barrier(); \ + __var = ACCESS_ONCE(x); \ + barrier(); \ + __var; \ +}) + #endif /* _LINUX_COMPILER_H_ */ From owner-svn-src-all@freebsd.org Mon Dec 21 11:03:14 2015 Return-Path: Delivered-To: svn-src-all@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 2EF4DA4DC7C; Mon, 21 Dec 2015 11:03:14 +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 E3B991E9F; Mon, 21 Dec 2015 11:03:13 +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 tBLB3DX7017080; Mon, 21 Dec 2015 11:03:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLB3Ddd017079; Mon, 21 Dec 2015 11:03:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512211103.tBLB3Ddd017079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 21 Dec 2015 11:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292538 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 11:03:14 -0000 Author: hselasky Date: Mon Dec 21 11:03:12 2015 New Revision: 292538 URL: https://svnweb.freebsd.org/changeset/base/292538 Log: Implement sleepable RCU mechanism using shared exclusive locks. MFC after: 1 week Sponsored by: Mellanox Technologies Added: head/sys/compat/linuxkpi/common/include/linux/srcu.h (contents, props changed) Added: head/sys/compat/linuxkpi/common/include/linux/srcu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/srcu.h Mon Dec 21 11:03:12 2015 (r292538) @@ -0,0 +1,72 @@ +/*- + * Copyright (c) 2015 Mellanox Technologies, Ltd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _LINUX_SRCU_H_ +#define _LINUX_SRCU_H_ + +#include +#include +#include + +struct srcu_struct { + struct sx sx; +}; + +static inline int +init_srcu_struct(struct srcu_struct *srcu) +{ + sx_init(&srcu->sx, "SleepableRCU"); + return (0); +} + +static inline void +cleanup_srcu_struct(struct srcu_struct *srcu) +{ + sx_destroy(&srcu->sx); +} + +static inline int +srcu_read_lock(struct srcu_struct *srcu) +{ + sx_slock(&srcu->sx); + return (0); +} + +static inline void +srcu_read_unlock(struct srcu_struct *srcu, int key) +{ + sx_sunlock(&srcu->sx); +} + +static inline void +synchronize_srcu(struct srcu_struct *srcu) +{ + sx_xlock(&srcu->sx); + sx_xunlock(&srcu->sx); +} + +#endif /* _LINUX_SRCU_H_ */ From owner-svn-src-all@freebsd.org Mon Dec 21 11:24:15 2015 Return-Path: Delivered-To: svn-src-all@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 789D9A4E809; Mon, 21 Dec 2015 11:24:15 +0000 (UTC) (envelope-from ume@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 4A4B51A54; Mon, 21 Dec 2015 11:24:15 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBLBOEkU023056; Mon, 21 Dec 2015 11:24:14 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLBOEOR023055; Mon, 21 Dec 2015 11:24:14 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512211124.tBLBOEOR023055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Mon, 21 Dec 2015 11:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292539 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 11:24:15 -0000 Author: ume Date: Mon Dec 21 11:24:14 2015 New Revision: 292539 URL: https://svnweb.freebsd.org/changeset/base/292539 Log: If we end up following a CNAME chain that does not find any data return that instead of internal error. PR: 156684 Obtained from: NetBSD MFC after: 1 week Modified: head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Mon Dec 21 11:03:12 2015 (r292538) +++ head/lib/libc/net/getaddrinfo.c Mon Dec 21 11:24:14 2015 (r292539) @@ -2164,7 +2164,11 @@ getanswer(const querybuf *answer, int an return sentinel.ai_next; } - RES_SET_H_ERRNO(res, NO_RECOVERY); + /* + * We could have walked a CNAME chain, but the ultimate target + * may not have what we looked for. + */ + RES_SET_H_ERRNO(res, ntohs(hp->ancount) > 0 ? NO_DATA : NO_RECOVERY); return NULL; } @@ -2341,6 +2345,7 @@ _dns_getaddrinfo(void *rv, void *cb_data if (sentinel.ai_next == NULL) switch (res->res_h_errno) { case HOST_NOT_FOUND: + case NO_DATA: return NS_NOTFOUND; case TRY_AGAIN: return NS_TRYAGAIN; From owner-svn-src-all@freebsd.org Mon Dec 21 11:44:55 2015 Return-Path: Delivered-To: svn-src-all@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 BA1A4A4D347; Mon, 21 Dec 2015 11:44:55 +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 8B29513C8; Mon, 21 Dec 2015 11:44:55 +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 tBLBisLS029030; Mon, 21 Dec 2015 11:44:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLBisj0029029; Mon, 21 Dec 2015 11:44:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512211144.tBLBisj0029029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Dec 2015 11:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292540 - stable/10/sys/ufs/ufs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 11:44:55 -0000 Author: kib Date: Mon Dec 21 11:44:54 2015 New Revision: 292540 URL: https://svnweb.freebsd.org/changeset/base/292540 Log: MFC r291936: Update ctime when atime or birthtime are updated. Cleanup setting of ctime/mtime/birthtime. Modified: stable/10/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/10/sys/ufs/ufs/ufs_vnops.c Mon Dec 21 11:24:14 2015 (r292539) +++ stable/10/sys/ufs/ufs/ufs_vnops.c Mon Dec 21 11:44:54 2015 (r292540) @@ -640,19 +640,14 @@ ufs_setattr(ap) error = vn_utimes_perm(vp, vap, cred, td); if (error != 0) return (error); - if (vap->va_atime.tv_sec != VNOVAL) - ip->i_flag |= IN_ACCESS; - if (vap->va_mtime.tv_sec != VNOVAL) - ip->i_flag |= IN_CHANGE | IN_UPDATE; - if (vap->va_birthtime.tv_sec != VNOVAL && - ip->i_ump->um_fstype == UFS2) - ip->i_flag |= IN_MODIFIED; - ufs_itimes(vp); + ip->i_flag |= IN_CHANGE | IN_MODIFIED; if (vap->va_atime.tv_sec != VNOVAL) { + ip->i_flag &= ~IN_ACCESS; DIP_SET(ip, i_atime, vap->va_atime.tv_sec); DIP_SET(ip, i_atimensec, vap->va_atime.tv_nsec); } if (vap->va_mtime.tv_sec != VNOVAL) { + ip->i_flag &= ~IN_UPDATE; DIP_SET(ip, i_mtime, vap->va_mtime.tv_sec); DIP_SET(ip, i_mtimensec, vap->va_mtime.tv_nsec); } From owner-svn-src-all@freebsd.org Mon Dec 21 11:50:33 2015 Return-Path: Delivered-To: svn-src-all@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 D9A24A4D5CC; Mon, 21 Dec 2015 11:50: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 8BB591605; Mon, 21 Dec 2015 11:50: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 tBLBoWhN029259; Mon, 21 Dec 2015 11:50:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLBoW6D029258; Mon, 21 Dec 2015 11:50:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512211150.tBLBoW6D029258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 21 Dec 2015 11:50:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292541 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 11:50:33 -0000 Author: kib Date: Mon Dec 21 11:50:32 2015 New Revision: 292541 URL: https://svnweb.freebsd.org/changeset/base/292541 Log: Recheck curthread->td_su after the VFS_SYNC() call, and re-sync if the ast was rescheduled during VFS_SYNC(). It is possible that enough parallel writes or slow/hung volume result in VFS_SYNC() deferring to the ast flushing of workqueue. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Dec 21 11:44:54 2015 (r292540) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Dec 21 11:50:32 2015 (r292541) @@ -13301,43 +13301,43 @@ softdep_ast_cleanup_proc(void) bool req; td = curthread; - mp = td->td_su; - if (mp == NULL) - return; - td->td_su = NULL; - error = vfs_busy(mp, MBF_NOWAIT); - vfs_rel(mp); - if (error != 0) - return; - if (ffs_own_mount(mp) && MOUNTEDSOFTDEP(mp)) { - ump = VFSTOUFS(mp); - for (;;) { - req = false; - ACQUIRE_LOCK(ump); - if (softdep_excess_items(ump, D_INODEDEP)) { - req = true; - request_cleanup(mp, FLUSH_INODES); - } - if (softdep_excess_items(ump, D_DIRREM)) { - req = true; - request_cleanup(mp, FLUSH_BLOCKS); - } - FREE_LOCK(ump); - if (softdep_excess_items(ump, D_NEWBLK) || - softdep_excess_items(ump, D_ALLOCDIRECT) || - softdep_excess_items(ump, D_ALLOCINDIR)) { - error = vn_start_write(NULL, &mp, V_WAIT); - if (error == 0) { + while ((mp = td->td_su) != NULL) { + td->td_su = NULL; + error = vfs_busy(mp, MBF_NOWAIT); + vfs_rel(mp); + if (error != 0) + return; + if (ffs_own_mount(mp) && MOUNTEDSOFTDEP(mp)) { + ump = VFSTOUFS(mp); + for (;;) { + req = false; + ACQUIRE_LOCK(ump); + if (softdep_excess_items(ump, D_INODEDEP)) { req = true; - VFS_SYNC(mp, MNT_WAIT); - vn_finished_write(mp); + request_cleanup(mp, FLUSH_INODES); } + if (softdep_excess_items(ump, D_DIRREM)) { + req = true; + request_cleanup(mp, FLUSH_BLOCKS); + } + FREE_LOCK(ump); + if (softdep_excess_items(ump, D_NEWBLK) || + softdep_excess_items(ump, D_ALLOCDIRECT) || + softdep_excess_items(ump, D_ALLOCINDIR)) { + error = vn_start_write(NULL, &mp, + V_WAIT); + if (error == 0) { + req = true; + VFS_SYNC(mp, MNT_WAIT); + vn_finished_write(mp); + } + } + if ((td->td_pflags & TDP_KTHREAD) != 0 || !req) + break; } - if ((td->td_pflags & TDP_KTHREAD) != 0 || !req) - break; } + vfs_unbusy(mp); } - vfs_unbusy(mp); } /* From owner-svn-src-all@freebsd.org Mon Dec 21 11:59:01 2015 Return-Path: Delivered-To: svn-src-all@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 1FC97A4DB41; Mon, 21 Dec 2015 11:59:01 +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 EEB121B3E; Mon, 21 Dec 2015 11:59:00 +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 tBLBx06q032116; Mon, 21 Dec 2015 11:59:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLBwxRb032110; Mon, 21 Dec 2015 11:58:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512211158.tBLBwxRb032110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 21 Dec 2015 11:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292542 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 11:59:01 -0000 Author: hselasky Date: Mon Dec 21 11:58:59 2015 New Revision: 292542 URL: https://svnweb.freebsd.org/changeset/base/292542 Log: Minor workqueue cleanup: - Make some functions global instead of inline to ease debugging. - Fix some minor style issues. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/workqueue.h Mon Dec 21 11:50:32 2015 (r292541) +++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h Mon Dec 21 11:58:59 2015 (r292542) @@ -55,6 +55,12 @@ struct delayed_work { struct callout timer; }; +extern void linux_work_fn(void *, int); +extern void linux_flush_fn(void *, int); +extern void linux_delayed_work_fn(void *); +extern struct workqueue_struct *linux_create_workqueue_common(const char *, int); +extern void destroy_workqueue(struct workqueue_struct *); + static inline struct delayed_work * to_delayed_work(struct work_struct *work) { @@ -62,21 +68,11 @@ to_delayed_work(struct work_struct *work return container_of(work, struct delayed_work, work); } - -static inline void -_work_fn(void *context, int pending) -{ - struct work_struct *work; - - work = context; - work->fn(work); -} - #define INIT_WORK(work, func) \ do { \ (work)->fn = (func); \ (work)->taskqueue = NULL; \ - TASK_INIT(&(work)->work_task, 0, _work_fn, (work)); \ + TASK_INIT(&(work)->work_task, 0, linux_work_fn, (work)); \ } while (0) #define INIT_DELAYED_WORK(_work, func) \ @@ -85,7 +81,7 @@ do { \ callout_init(&(_work)->timer, 1); \ } while (0) -#define INIT_DEFERRABLE_WORK INIT_DELAYED_WORK +#define INIT_DEFERRABLE_WORK(...) INIT_DELAYED_WORK(__VA_ARGS__) #define schedule_work(work) \ do { \ @@ -95,20 +91,12 @@ do { \ #define flush_scheduled_work() flush_taskqueue(taskqueue_thread) -static inline int queue_work(struct workqueue_struct *q, struct work_struct *work) -{ - (work)->taskqueue = (q)->taskqueue; - /* Return opposite val to align with Linux logic */ - return !taskqueue_enqueue((q)->taskqueue, &(work)->work_task); -} - -static inline void -_delayed_work_fn(void *arg) +static inline int +queue_work(struct workqueue_struct *wq, struct work_struct *work) { - struct delayed_work *work; - - work = arg; - taskqueue_enqueue(work->work.taskqueue, &work->work.work_task); + work->taskqueue = wq->taskqueue; + /* Return opposite value to align with Linux logic */ + return (!taskqueue_enqueue(wq->taskqueue, &work->work_task)); } static inline int @@ -120,68 +108,44 @@ queue_delayed_work(struct workqueue_stru pending = work->work.work_task.ta_pending; work->work.taskqueue = wq->taskqueue; if (delay != 0) - callout_reset(&work->timer, delay, _delayed_work_fn, work); + callout_reset(&work->timer, delay, linux_delayed_work_fn, work); else - _delayed_work_fn((void *)work); + linux_delayed_work_fn((void *)work); return (!pending); } -static inline bool schedule_delayed_work(struct delayed_work *dwork, - unsigned long delay) -{ - struct workqueue_struct wq; - wq.taskqueue = taskqueue_thread; - return queue_delayed_work(&wq, dwork, delay); -} - -static inline struct workqueue_struct * -_create_workqueue_common(char *name, int cpus) +static inline bool +schedule_delayed_work(struct delayed_work *dwork, + unsigned long delay) { - struct workqueue_struct *wq; - - wq = kmalloc(sizeof(*wq), M_WAITOK); - wq->taskqueue = taskqueue_create((name), M_WAITOK, - taskqueue_thread_enqueue, &wq->taskqueue); - taskqueue_start_threads(&wq->taskqueue, cpus, PWAIT, "%s", name); + struct workqueue_struct wq; - return (wq); + wq.taskqueue = taskqueue_thread; + return (queue_delayed_work(&wq, dwork, delay)); } - #define create_singlethread_workqueue(name) \ - _create_workqueue_common(name, 1) + linux_create_workqueue_common(name, 1) #define create_workqueue(name) \ - _create_workqueue_common(name, MAXCPU) + linux_create_workqueue_common(name, MAXCPU) #define alloc_ordered_workqueue(name, flags) \ - _create_workqueue_common(name, 1) + linux_create_workqueue_common(name, 1) #define alloc_workqueue(name, flags, max_active) \ - _create_workqueue_common(name, max_active) - -static inline void -destroy_workqueue(struct workqueue_struct *wq) -{ - taskqueue_free(wq->taskqueue); - kfree(wq); -} + linux_create_workqueue_common(name, max_active) #define flush_workqueue(wq) flush_taskqueue((wq)->taskqueue) static inline void -_flush_fn(void *context, int pending) -{ -} - -static inline void flush_taskqueue(struct taskqueue *tq) { struct task flushtask; PHOLD(curproc); - TASK_INIT(&flushtask, 0, _flush_fn, NULL); + TASK_INIT(&flushtask, 0, linux_flush_fn, NULL); taskqueue_enqueue(tq, &flushtask); taskqueue_drain(tq, &flushtask); PRELE(curproc); @@ -223,7 +187,7 @@ cancel_delayed_work_sync(struct delayed_ static inline bool mod_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork, - unsigned long delay) + unsigned long delay) { cancel_delayed_work(dwork); queue_delayed_work(wq, dwork, delay); Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Mon Dec 21 11:50:32 2015 (r292541) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Mon Dec 21 11:58:59 2015 (r292542) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -913,6 +914,49 @@ linux_completion_done(struct completion return (isdone); } +void +linux_delayed_work_fn(void *arg) +{ + struct delayed_work *work; + + work = arg; + taskqueue_enqueue(work->work.taskqueue, &work->work.work_task); +} + +void +linux_work_fn(void *context, int pending) +{ + struct work_struct *work; + + work = context; + work->fn(work); +} + +void +linux_flush_fn(void *context, int pending) +{ +} + +struct workqueue_struct * +linux_create_workqueue_common(const char *name, int cpus) +{ + struct workqueue_struct *wq; + + wq = kmalloc(sizeof(*wq), M_WAITOK); + wq->taskqueue = taskqueue_create(name, M_WAITOK, + taskqueue_thread_enqueue, &wq->taskqueue); + taskqueue_start_threads(&wq->taskqueue, cpus, PWAIT, "%s", name); + + return (wq); +} + +void +destroy_workqueue(struct workqueue_struct *wq) +{ + taskqueue_free(wq->taskqueue); + kfree(wq); +} + static void linux_compat_init(void *arg) { From owner-svn-src-all@freebsd.org Mon Dec 21 12:13:04 2015 Return-Path: Delivered-To: svn-src-all@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 C3D91A4E848; Mon, 21 Dec 2015 12:13:04 +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 9231A1578; Mon, 21 Dec 2015 12:13:04 +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 tBLCD3Ig037611; Mon, 21 Dec 2015 12:13:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLCD3Gl037610; Mon, 21 Dec 2015 12:13:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512211213.tBLCD3Gl037610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 21 Dec 2015 12:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292543 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 12:13:04 -0000 Author: hselasky Date: Mon Dec 21 12:13:03 2015 New Revision: 292543 URL: https://svnweb.freebsd.org/changeset/base/292543 Log: In the zero delay case in queue_delayed_work() use the return value from taskqueue_enqueue() instead of reading "ta_pending" unlocked and also ensure the callout is stopped before proceeding. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/workqueue.h Mon Dec 21 11:58:59 2015 (r292542) +++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h Mon Dec 21 12:13:03 2015 (r292543) @@ -105,13 +105,15 @@ queue_delayed_work(struct workqueue_stru { int pending; - pending = work->work.work_task.ta_pending; work->work.taskqueue = wq->taskqueue; - if (delay != 0) + if (delay != 0) { + pending = work->work.work_task.ta_pending; callout_reset(&work->timer, delay, linux_delayed_work_fn, work); - else - linux_delayed_work_fn((void *)work); - + } else { + callout_stop(&work->timer); + pending = taskqueue_enqueue(work->work.taskqueue, + &work->work.work_task); + } return (!pending); } From owner-svn-src-all@freebsd.org Mon Dec 21 12:20:03 2015 Return-Path: Delivered-To: svn-src-all@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 CC0E3A4EA56; Mon, 21 Dec 2015 12:20:03 +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 8F65718D3; Mon, 21 Dec 2015 12:20:03 +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 tBLCK2qp037878; Mon, 21 Dec 2015 12:20:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLCK2gI037876; Mon, 21 Dec 2015 12:20:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512211220.tBLCK2gI037876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 21 Dec 2015 12:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292544 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 12:20:04 -0000 Author: hselasky Date: Mon Dec 21 12:20:02 2015 New Revision: 292544 URL: https://svnweb.freebsd.org/changeset/base/292544 Log: Implement drain_workqueue() function. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/workqueue.h Mon Dec 21 12:13:03 2015 (r292543) +++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h Mon Dec 21 12:20:02 2015 (r292544) @@ -36,10 +36,13 @@ #include #include +#include + #include struct workqueue_struct { struct taskqueue *taskqueue; + atomic_t draining; }; struct work_struct { @@ -95,6 +98,9 @@ static inline int queue_work(struct workqueue_struct *wq, struct work_struct *work) { work->taskqueue = wq->taskqueue; + /* Check for draining */ + if (atomic_read(&wq->draining) != 0) + return (!work->work_task.ta_pending); /* Return opposite value to align with Linux logic */ return (!taskqueue_enqueue(wq->taskqueue, &work->work_task)); } @@ -106,7 +112,9 @@ queue_delayed_work(struct workqueue_stru int pending; work->work.taskqueue = wq->taskqueue; - if (delay != 0) { + if (atomic_read(&wq->draining) != 0) { + pending = work->work.work_task.ta_pending; + } else if (delay != 0) { pending = work->work.work_task.ta_pending; callout_reset(&work->timer, delay, linux_delayed_work_fn, work); } else { @@ -124,6 +132,7 @@ schedule_delayed_work(struct delayed_wor struct workqueue_struct wq; wq.taskqueue = taskqueue_thread; + atomic_set(&wq.draining, 0); return (queue_delayed_work(&wq, dwork, delay)); } @@ -153,6 +162,14 @@ flush_taskqueue(struct taskqueue *tq) PRELE(curproc); } +static inline void +drain_workqueue(struct workqueue_struct *wq) +{ + atomic_inc(&wq->draining); + flush_taskqueue(wq->taskqueue); + atomic_dec(&wq->draining); +} + static inline int cancel_work_sync(struct work_struct *work) { Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Mon Dec 21 12:13:03 2015 (r292543) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Mon Dec 21 12:20:02 2015 (r292544) @@ -945,6 +945,7 @@ linux_create_workqueue_common(const char wq = kmalloc(sizeof(*wq), M_WAITOK); wq->taskqueue = taskqueue_create(name, M_WAITOK, taskqueue_thread_enqueue, &wq->taskqueue); + atomic_set(&wq->draining, 0); taskqueue_start_threads(&wq->taskqueue, cpus, PWAIT, "%s", name); return (wq); From owner-svn-src-all@freebsd.org Mon Dec 21 12:39:17 2015 Return-Path: Delivered-To: svn-src-all@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 769E1A4D153; Mon, 21 Dec 2015 12:39:17 +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 444C41390; Mon, 21 Dec 2015 12:39:17 +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 tBLCdGKA044062; Mon, 21 Dec 2015 12:39:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLCdGDK044061; Mon, 21 Dec 2015 12:39:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512211239.tBLCdGDK044061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 21 Dec 2015 12:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292545 - head/tools/regression/mac/mac_bsdextended X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 12:39:17 -0000 Author: ngie Date: Mon Dec 21 12:39:16 2015 New Revision: 292545 URL: https://svnweb.freebsd.org/changeset/base/292545 Log: Redo the TAP integration so it works with Kyua Kyua needs numbers in the TAP results :/, but prove doesn't MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/mac/mac_bsdextended/test_matches.sh Modified: head/tools/regression/mac/mac_bsdextended/test_matches.sh ============================================================================== --- head/tools/regression/mac/mac_bsdextended/test_matches.sh Mon Dec 21 12:20:02 2015 (r292544) +++ head/tools/regression/mac/mac_bsdextended/test_matches.sh Mon Dec 21 12:39:16 2015 (r292545) @@ -10,6 +10,19 @@ uidoutrange="daemon" gidinrange="nobody" # We expect $uidinrange in this group gidoutrange="daemon" # We expect $uidinrange in this group +test_num=1 +pass() +{ + echo "ok $test_num # $@" + : $(( test_num += 1 )) +} + +fail() +{ + echo "not ok $test_num # $@" + : $(( test_num += 1 )) +} + # # Setup # @@ -37,7 +50,7 @@ md_device=$(mount -p | grep "$playground trap "umount -f $playground; mdconfig -d -u $md_device; rmdir $playground" EXIT INT TERM if [ -z "$md_device" ]; then mount -p | grep $playground - echo "1..0 # md device not properly attached to the system" + echo "1..0 # SKIP md device not properly attached to the system" fi ugidfw remove 1 @@ -57,142 +70,284 @@ echo "1..30" command1="sh $playground/test-script.sh $file1" command2="sh $playground/test-script.sh $file2" -echo "# $uidinrange file:" -su -m $uidinrange -c "if $command1; then echo ok; else echo not ok; fi" +desc="$uidinrange file" +if su -m $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + chown "$uidinrange":"$gidinrange" $file1 chmod a+w $file1 -echo "# $uidoutrange file:" -if $command2; then echo ok; else echo not ok; fi +desc="$uidoutrange file" +if $command2; then + pass $desc +else + fail $desc +fi + chown "$uidoutrange":"$gidoutrange" $file2 chmod a+w $file2 # # No rules # -echo "# no rules $uidinrange:" -su -fm $uidinrange -c "if $command1; then echo ok; else echo not ok; fi" -echo "# no rules $uidoutrange:" -su -fm $uidoutrange -c "if $command1; then echo ok; else echo not ok; fi" +desc="no rules $uidinrange" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + +desc="no rules $uidoutrange" +if su -fm $uidoutrange -c "$command1"; then + pass $desc +else + fail $desc +fi # # Subject Match on uid # ugidfw set 1 subject uid $uidrange object mode rasx -echo "# subject uid in range:" -su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" -echo "# subject uid out range:" -su -fm $uidoutrange -c "if $command1; then echo ok; else echo not ok; fi" +desc="subject uid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="subject uid out range" +if su -fm $uidoutrange -c "$command1"; then + pass $desc +else + fail $desc +fi # # Subject Match on gid # ugidfw set 1 subject gid $gidrange object mode rasx -echo "# subject gid in range:" -su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" -echo "# subject gid out range:" -su -fm $uidoutrange -c "if $command1; then echo ok; else echo not ok; fi" + +desc="subject gid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="subject gid out range" +if su -fm $uidoutrange -c "$command1"; then + pass $desc +else + fail $desc +fi # # Subject Match on jail # rm -f $playground/test-jail -echo "# subject matching jailid:" + +desc="subject matching jailid" jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` ugidfw set 1 subject jailid $jailid object mode rasx sleep 10 -if [ -f $playground/test-jail ]; then echo "not ok # TODO this testcase is buggy (see bug # 205481)"; else echo ok; fi + +if [ -f $playground/test-jail ]; then + fail "TODO $desc: this testcase fails (see bug # 205481)" +else + pass $desc +fi rm -f $playground/test-jail -echo "# subject nonmatching jailid:" +desc="subject nonmatching jailid" jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` sleep 10 -if [ -f $playground/test-jail ]; then echo ok; else echo not ok; fi +if [ -f $playground/test-jail ]; then + pass $desc +else + fail $desc +fi # # Object uid # ugidfw set 1 subject object uid $uidrange mode rasx -echo "# object uid in range:" -su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" -echo "# object uid out range:" -su -fm $uidinrange -c "if $command2; then echo ok; else echo not ok; fi" + +desc="object uid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object uid out range" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi ugidfw set 1 subject object uid $uidrange mode rasx -echo "# object uid in range (differennt subject):" -su -fm $uidoutrange -c "if $command1; then echo not ok; else echo ok; fi" -echo "# object uid out range (differennt subject):" -su -fm $uidoutrange -c "if $command2; then echo ok; else echo not ok; fi" + +desc="object uid in range (different subject)" +if su -fm $uidoutrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object uid out range (different subject)" +if su -fm $uidoutrange -c "$command2"; then + pass $desc +else + fail $desc +fi # # Object gid # ugidfw set 1 subject object gid $uidrange mode rasx -echo "# object gid in range:" -su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" -echo "# object gid out range:" -su -fm $uidinrange -c "if $command2; then echo ok; else echo not ok; fi" -echo "# object gid in range (different subject):" -su -fm $uidoutrange -c "if $command1; then echo not ok; else echo ok; fi" -echo "# object gid out range (different subject):" -su -fm $uidoutrange -c "if $command2; then echo ok; else echo not ok; fi" + +desc="object gid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object gid out range" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi +desc="object gid in range (different subject)" +if su -fm $uidoutrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object gid out range (different subject)" +if su -fm $uidoutrange -c "$command2"; then + pass $desc +else + fail $desc +fi # # Object filesys # ugidfw set 1 subject uid $uidrange object filesys / mode rasx -echo "# object out of filesys:" -su -fm $uidinrange -c "if $command1; then echo ok; else echo not ok; fi" +desc="object out of filesys" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + ugidfw set 1 subject uid $uidrange object filesys $playground mode rasx -echo "# object in filesys:" -su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" +desc="object in filesys" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi # # Object suid # ugidfw set 1 subject uid $uidrange object suid mode rasx -echo "# object notsuid:" -su -fm $uidinrange -c "if $command1; then echo ok; else echo not ok; fi" +desc="object notsuid" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + chmod u+s $file1 -echo "# object suid:" -su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" +desc="object suid" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi chmod u-s $file1 # # Object sgid # ugidfw set 1 subject uid $uidrange object sgid mode rasx -echo "# object notsgid:" -su -fm $uidinrange -c "if $command1; then echo ok; else echo not ok; fi" +desc="object notsgid" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + chmod g+s $file1 -echo "# object sgid:" -su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" +desc="object sgid" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi chmod g-s $file1 # # Object uid matches subject # ugidfw set 1 subject uid $uidrange object uid_of_subject mode rasx -echo "# object uid notmatches subject:" -su -fm $uidinrange -c "if $command2; then echo ok; else echo not ok; fi" -echo "# object uid matches subject:" -su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" + +desc="object uid notmatches subject" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi + +desc="object uid matches subject" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi # # Object gid matches subject # ugidfw set 1 subject uid $uidrange object gid_of_subject mode rasx -echo "# object gid notmatches subject:" -su -fm $uidinrange -c "if $command2; then echo ok; else echo not ok; fi" -echo "# object gid matches subject:" -su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" + +desc="object gid notmatches subject" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi + +desc="object gid matches subject" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi # # Object type # +desc="object not type" ugidfw set 1 subject uid $uidrange object type dbclsp mode rasx -echo "# object not type:" -su -fm $uidinrange -c "if $command1; then echo ok; else echo not ok; fi" -ugidfw set 1 subject uid $uidrange object type r mode rasx -echo "# object type:" -su -fm $uidinrange -c "if $command1; then echo not ok; else echo ok; fi" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi +desc="object type" +ugidfw set 1 subject uid $uidrange object type r mode rasx +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi From owner-svn-src-all@freebsd.org Mon Dec 21 12:43:05 2015 Return-Path: Delivered-To: svn-src-all@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 AC23AA4D466; Mon, 21 Dec 2015 12:43:05 +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 6AD9F18BE; Mon, 21 Dec 2015 12:43:05 +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 tBLCh4IB046779; Mon, 21 Dec 2015 12:43:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLCh4ks046778; Mon, 21 Dec 2015 12:43:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512211243.tBLCh4ks046778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 21 Dec 2015 12:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292546 - head/tools/regression/mac/mac_bsdextended X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 12:43:05 -0000 Author: ngie Date: Mon Dec 21 12:43:04 2015 New Revision: 292546 URL: https://svnweb.freebsd.org/changeset/base/292546 Log: - Convert testcase to TAP format - Use nitems(x) instead of handrolled sizeof(x) / sizeof(*x) macro - Do not mark count != 0 case with bsde_get_rule_count as a failure; this generates false positives on systems with ugidfw rules set on it MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/mac/mac_bsdextended/test_ugidfw.c Modified: head/tools/regression/mac/mac_bsdextended/test_ugidfw.c ============================================================================== --- head/tools/regression/mac/mac_bsdextended/test_ugidfw.c Mon Dec 21 12:39:16 2015 (r292545) +++ head/tools/regression/mac/mac_bsdextended/test_ugidfw.c Mon Dec 21 12:43:04 2015 (r292546) @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -45,13 +46,6 @@ * Starting point for a regression test for mac_bsdextended(4) and the * supporting libugidfw(3). */ -void -usage(void) -{ - - fprintf(stderr, "test_ugidfw\n"); - exit(1); -} /* * This section of the regression test passes some test cases through the @@ -69,7 +63,6 @@ static const char *test_users[] = { "operator", "bin", }; -static const int test_users_len = sizeof(test_users) / sizeof(char *); static const char *test_groups[] = { "wheel", @@ -77,7 +70,8 @@ static const char *test_groups[] = { "operator", "bin", }; -static const int test_groups_len = sizeof(test_groups) / sizeof(char *); + +int test_num; /* * List of test strings that must go in (and come out) of libugidfw intact. @@ -148,7 +142,6 @@ static const char *test_strings[] = { "object ! uid root:daemon gid daemon filesys / suid sgid uid_of_subject gid_of_subject ! type r " "mode rsx", }; -static const int test_strings_len = sizeof(test_strings) / sizeof(char *); static void test_libugidfw_strings(void) @@ -156,52 +149,68 @@ test_libugidfw_strings(void) struct mac_bsdextended_rule rule; char errorstr[256]; char rulestr[256]; - int i, error; + int error, i; - for (i = 0; i < test_users_len; i++) { + for (i = 0; i < nitems(test_users); i++, test_num++) { if (getpwnam(test_users[i]) == NULL) - err(1, "test_libugidfw_strings: getpwnam: %s", - test_users[i]); + printf("not ok %d # test_libugidfw_strings: getpwnam(%s) " + "failed: %s\n", test_num, test_users[i], strerror(errno)); + else + printf("ok %d\n", test_num); } - for (i = 0; i < test_groups_len; i++) { + for (i = 0; i < nitems(test_groups); i++, test_num++) { if (getgrnam(test_groups[i]) == NULL) - err(1, "test_libugidfw_strings: getgrnam: %s", - test_groups[i]); + printf("not ok %d # test_libugidfw_strings: getgrnam(%s) " + "failed: %s\n", test_num, test_groups[i], strerror(errno)); + else + printf("ok %d\n", test_num); } - for (i = 0; i < test_strings_len; i++) { + for (i = 0; i < nitems(test_strings); i++) { error = bsde_parse_rule_string(test_strings[i], &rule, sizeof(errorstr), errorstr); if (error == -1) - errx(1, "bsde_parse_rule_string: '%s' (%d): %s", - test_strings[i], i, errorstr); + printf("not ok %d # bsde_parse_rule_string: '%s' (%d) " + "failed: %s\n", test_num, test_strings[i], i, errorstr); + else + printf("ok %d\n", test_num); + test_num++; + error = bsde_rule_to_string(&rule, rulestr, sizeof(rulestr)); if (error < 0) - errx(1, "bsde_rule_to_string: rule for '%s' " - "returned %d", test_strings[i], error); + printf("not ok %d # bsde_rule_to_string: rule for '%s' " + "returned %d\n", test_num, test_strings[i], error); + else + printf("ok %d\n", test_num); + test_num++; if (strcmp(test_strings[i], rulestr) != 0) - errx(1, "test_libugidfw: '%s' in, '%s' out", - test_strings[i], rulestr); + printf("not ok %d # test_libugidfw: '%s' in, '%s' " + "out\n", test_num, test_strings[i], rulestr); + else + printf("ok %d\n", test_num); + test_num++; } } int -main(int argc, char *argv[]) +main(void) { char errorstr[256]; int count, slots; - if (argc != 1) - usage(); + test_num = 1; /* Print an error if a non-root user attemps to run the tests. */ if (getuid() != 0) { - fprintf(stderr, "Error! Only root may run this utility\n"); - return (EXIT_FAILURE); + printf("1..0 # SKIP you must be root\n"); + return (0); } + printf("1..%lu\n", nitems(test_users) + nitems(test_groups) + + 3 * nitems(test_strings) + 2); + /* * We can test some parts of the library without the MAC Framework * and policy loaded, so run those tests before calling @@ -211,12 +220,15 @@ main(int argc, char *argv[]) switch (mac_is_present("bsdextended")) { case -1: - err(1, "mac_is_present"); + printf("1..0 # SKIP mac_is_present failed: %s\n", + strerror(errno)); + return (0); case 1: break; case 0: default: - errx(1, "mac_bsdextended not loaded"); + printf("1..0 # SKIP mac_bsdextended not loaded\n"); + return (0); } /* @@ -227,13 +239,19 @@ main(int argc, char *argv[]) */ count = bsde_get_rule_count(sizeof(errorstr), errorstr); if (count == -1) - errx(1, "bsde_get_rule_count: %s", errorstr); - if (count != 0) - errx(1, "bsde_get_rule_count: %d rules", count); + printf("not ok %d # bsde_get_rule_count: %s\n", test_num, + errorstr); + else + printf("ok %d\n", test_num); + + test_num++; slots = bsde_get_rule_slots(sizeof(errorstr), errorstr); if (slots == -1) - errx(1, "bsde_get_rule_slots: %s", errorstr); + printf("not ok %d # bsde_get_rule_slots: %s\n", test_num, + errorstr); + else + printf("ok %d\n", test_num); return (0); } From owner-svn-src-all@freebsd.org Mon Dec 21 14:32:31 2015 Return-Path: Delivered-To: svn-src-all@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 E90E8A4DCC1; Mon, 21 Dec 2015 14:32:30 +0000 (UTC) (envelope-from araujo@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 C0DB7195D; Mon, 21 Dec 2015 14:32:30 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBLEWTRB080636; Mon, 21 Dec 2015 14:32:29 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLEWTRs080635; Mon, 21 Dec 2015 14:32:29 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201512211432.tBLEWTRs080635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Mon, 21 Dec 2015 14:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292547 - stable/10/lib/libc/yp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 14:32:31 -0000 Author: araujo Date: Mon Dec 21 14:32:29 2015 New Revision: 292547 URL: https://svnweb.freebsd.org/changeset/base/292547 Log: MFC: r291073 If a NIS server has long entries on its database that is bigger than 1024 specified on YPMAXRECORD the ypmatch can get in an infinite retry loop when is requesting the information from the NIS server. The ypmatch(1) will return an error until the command receives an kill(1). To avoid this problem, we check the MAX_RETRIES that is by default set to 20 and avoid get in infinet loop at the client side. NOTE: FreeBSD nis(8) server doesn't present this issue. Submitted by: Ravi Pokala , Lakshmi N. Sundararajan , Lewis, Fred , Pushkar Kothavade Modified: stable/10/lib/libc/yp/yplib.c Modified: stable/10/lib/libc/yp/yplib.c ============================================================================== --- stable/10/lib/libc/yp/yplib.c Mon Dec 21 12:43:04 2015 (r292546) +++ stable/10/lib/libc/yp/yplib.c Mon Dec 21 14:32:29 2015 (r292547) @@ -655,7 +655,7 @@ yp_match(char *indomain, char *inmap, co struct timeval tv; struct ypreq_key yprk; int r; - + int retries = 0; *outval = NULL; *outvallen = 0; @@ -700,6 +700,11 @@ yp_match(char *indomain, char *inmap, co #endif again: + if (retries > MAX_RETRIES) { + YPUNLOCK(); + return (YPERR_RPC); + } + if (_yp_dobind(indomain, &ysd) != 0) { YPUNLOCK(); return (YPERR_DOMAIN); @@ -716,6 +721,7 @@ again: if (r != RPC_SUCCESS) { clnt_perror(ysd->dom_client, "yp_match: clnt_call"); _yp_unbind(ysd); + retries++; goto again; } @@ -772,7 +778,7 @@ yp_first(char *indomain, char *inmap, ch struct dom_binding *ysd; struct timeval tv; int r; - + int retries = 0; /* Sanity check */ if (indomain == NULL || !strlen(indomain) || @@ -784,6 +790,11 @@ yp_first(char *indomain, char *inmap, ch YPLOCK(); again: + if (retries > MAX_RETRIES) { + YPUNLOCK(); + return (YPERR_RPC); + } + if (_yp_dobind(indomain, &ysd) != 0) { YPUNLOCK(); return (YPERR_DOMAIN); @@ -802,6 +813,7 @@ again: if (r != RPC_SUCCESS) { clnt_perror(ysd->dom_client, "yp_first: clnt_call"); _yp_unbind(ysd); + retries++; goto again; } if (!(r = ypprot_err(yprkv.stat))) { @@ -844,7 +856,7 @@ yp_next(char *indomain, char *inmap, cha struct dom_binding *ysd; struct timeval tv; int r; - + int retries = 0; /* Sanity check */ if (inkey == NULL || !strlen(inkey) || inkeylen <= 0 || @@ -857,6 +869,11 @@ yp_next(char *indomain, char *inmap, cha YPLOCK(); again: + if (retries > MAX_RETRIES) { + YPUNLOCK(); + return (YPERR_RPC); + } + if (_yp_dobind(indomain, &ysd) != 0) { YPUNLOCK(); return (YPERR_DOMAIN); @@ -877,6 +894,7 @@ again: if (r != RPC_SUCCESS) { clnt_perror(ysd->dom_client, "yp_next: clnt_call"); _yp_unbind(ysd); + retries++; goto again; } if (!(r = ypprot_err(yprkv.stat))) { @@ -920,7 +938,7 @@ yp_all(char *indomain, char *inmap, stru CLIENT *clnt; u_long status, savstat; int clnt_sock; - + int retries = 0; /* Sanity check */ if (indomain == NULL || !strlen(indomain) || @@ -929,6 +947,10 @@ yp_all(char *indomain, char *inmap, stru YPLOCK(); again: + if (retries > MAX_RETRIES) { + YPUNLOCK(); + return (YPERR_RPC); + } if (_yp_dobind(indomain, &ysd) != 0) { YPUNLOCK(); @@ -958,9 +980,10 @@ again: if (clnt_call(clnt, YPPROC_ALL, (xdrproc_t)xdr_ypreq_nokey, &yprnk, (xdrproc_t)xdr_ypresp_all_seq, &status, tv) != RPC_SUCCESS) { - clnt_perror(ysd->dom_client, "yp_all: clnt_call"); + clnt_perror(clnt, "yp_all: clnt_call"); clnt_destroy(clnt); _yp_unbind(ysd); + retries++; goto again; } From owner-svn-src-all@freebsd.org Mon Dec 21 15:13:17 2015 Return-Path: Delivered-To: svn-src-all@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 2F6F9A4EA74; Mon, 21 Dec 2015 15:13:17 +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 EDDCD14A7; Mon, 21 Dec 2015 15:13:16 +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 tBLFDGj3093733; Mon, 21 Dec 2015 15:13:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLFDGNx093732; Mon, 21 Dec 2015 15:13:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512211513.tBLFDGNx093732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Dec 2015 15:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292548 - stable/10/tools/build/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 15:13:17 -0000 Author: emaste Date: Mon Dec 21 15:13:15 2015 New Revision: 292548 URL: https://svnweb.freebsd.org/changeset/base/292548 Log: MFC r292355: Remove lldb(1) files if WITHOUT_LLDB is set Sponsored by: The FreeBSD Foundation Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Mon Dec 21 14:32:29 2015 (r292547) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Mon Dec 21 15:13:15 2015 (r292548) @@ -3487,6 +3487,11 @@ OLD_DIRS+=usr/include/c++/v1 # to be filled in #.endif +.if ${MK_LLDB} == no +OLD_FILES+=usr/bin/lldb +OLD_FILES+=usr/share/man/man1/lldb.1.gz +.endif + #.if ${MK_LOCALES} == no # to be filled in #.endif From owner-svn-src-all@freebsd.org Mon Dec 21 16:12:42 2015 Return-Path: Delivered-To: svn-src-all@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 EEE85A4E3F5; Mon, 21 Dec 2015 16:12:42 +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 BFDEF1B39; Mon, 21 Dec 2015 16:12:42 +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 tBLGCfZl012018; Mon, 21 Dec 2015 16:12:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLGCfBK012017; Mon, 21 Dec 2015 16:12:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512211612.tBLGCfBK012017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Dec 2015 16:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292549 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 16:12:43 -0000 Author: emaste Date: Mon Dec 21 16:12:41 2015 New Revision: 292549 URL: https://svnweb.freebsd.org/changeset/base/292549 Log: makefs: use ENTRY macro for diff reduction with NetBSD Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/makefs/makefs.c Modified: head/usr.sbin/makefs/makefs.c ============================================================================== --- head/usr.sbin/makefs/makefs.c Mon Dec 21 15:13:15 2015 (r292548) +++ head/usr.sbin/makefs/makefs.c Mon Dec 21 16:12:41 2015 (r292549) @@ -66,9 +66,12 @@ typedef struct { } fstype_t; static fstype_t fstypes[] = { - { "ffs", ffs_prep_opts, ffs_parse_opts, ffs_cleanup_opts, ffs_makefs }, - { "cd9660", cd9660_prep_opts, cd9660_parse_opts, cd9660_cleanup_opts, - cd9660_makefs}, +#define ENTRY(name) { \ + # name, name ## _prep_opts, name ## _parse_opts, \ + name ## _cleanup_opts, name ## _makefs \ +} + ENTRY(ffs), + ENTRY(cd9660), { .type = NULL }, }; From owner-svn-src-all@freebsd.org Mon Dec 21 16:55:38 2015 Return-Path: Delivered-To: svn-src-all@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 40FC1A4E3A4; Mon, 21 Dec 2015 16:55:38 +0000 (UTC) (envelope-from ume@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 0EAD41C08; Mon, 21 Dec 2015 16:55:37 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBLGtbgl024721; Mon, 21 Dec 2015 16:55:37 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLGtbxi024720; Mon, 21 Dec 2015 16:55:37 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512211655.tBLGtbxi024720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Mon, 21 Dec 2015 16:55:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292550 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 16:55:38 -0000 Author: ume Date: Mon Dec 21 16:55:36 2015 New Revision: 292550 URL: https://svnweb.freebsd.org/changeset/base/292550 Log: Simplify _map_v4v6_address(). Suggested by: hrs MFC after: 1 week Modified: head/lib/libc/net/map_v4v6.c Modified: head/lib/libc/net/map_v4v6.c ============================================================================== --- head/lib/libc/net/map_v4v6.c Mon Dec 21 16:12:41 2015 (r292549) +++ head/lib/libc/net/map_v4v6.c Mon Dec 21 16:55:36 2015 (r292550) @@ -78,19 +78,15 @@ typedef union { void _map_v4v6_address(const char *src, char *dst) { - u_char *p = (u_char *)dst; char tmp[NS_INADDRSZ]; - int i; /* Stash a temporary copy so our caller can update in place. */ memcpy(tmp, src, NS_INADDRSZ); /* Mark this ipv6 addr as a mapped ipv4. */ - for (i = 0; i < 10; i++) - *p++ = 0x00; - *p++ = 0xff; - *p++ = 0xff; + memset(&dst[0], 0, 10); + memset(&dst[10], 0xff, 2); /* Retrieve the saved copy and we're done. */ - memcpy((void*)p, tmp, NS_INADDRSZ); + memcpy(&dst[12], tmp, NS_INADDRSZ); } void From owner-svn-src-all@freebsd.org Mon Dec 21 17:07:41 2015 Return-Path: Delivered-To: svn-src-all@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 6E99EA4EC1D; Mon, 21 Dec 2015 17:07:41 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 080BA14E9; Mon, 21 Dec 2015 17:07:41 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 58C9FB8068; Mon, 21 Dec 2015 18:07:38 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 42C4328494; Mon, 21 Dec 2015 18:07:38 +0100 (CET) Date: Mon, 21 Dec 2015 18:07:38 +0100 From: Jilles Tjoelker To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290197 - in head: etc/defaults etc/rc.d sys/kern Message-ID: <20151221170738.GA19579@stack.nl> References: <201510301552.t9UFqAtv073641@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201510301552.t9UFqAtv073641@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 17:07:41 -0000 On Fri, Oct 30, 2015 at 03:52:10PM +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Fri Oct 30 15:52:10 2015 > New Revision: 290197 > URL: https://svnweb.freebsd.org/changeset/base/290197 > Log: > After r290196, the kernel won't wait for stuff like gmirror nodes > if they are not required for mounting rootfs. However, it's possible > that some setups try to mount them in mountcritlocal (ie from fstab). > Export the list of current root mount holds using a new sysctl, > vfs.root_mount_hold, and make mountcritlocal retry if "mount -a" fails > and the list is not empty. > MFC after: 1 month > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D3709 I like the faster startup, but the rc.d script clearly will not wait as intended. See below. > Modified: > head/etc/defaults/rc.conf > head/etc/rc.d/mountcritlocal > head/sys/kern/vfs_mountroot.c > [snip] > Modified: head/etc/rc.d/mountcritlocal > ============================================================================== > --- head/etc/rc.d/mountcritlocal Fri Oct 30 15:35:04 2015 (r290196) > +++ head/etc/rc.d/mountcritlocal Fri Oct 30 15:52:10 2015 (r290197) > @@ -15,7 +15,7 @@ stop_cmd=sync > > mountcritlocal_start() > { > - local err > + local err holders waited > > # Set up the list of network filesystem types for which mounting > # should be delayed until after network initialization. > @@ -35,8 +35,42 @@ mountcritlocal_start() > mount_excludes="${mount_excludes}${fstype}," > done > mount_excludes=${mount_excludes%,} > + > + # Originally, root mount hold had to be released before mounting the root > + # filesystem. This delayed the boot, so it was changed to only wait if > + # the root device isn't readily available. This can result in this script > + # executing before all the devices - such as graid(8) - are available. > + # Thus, should the mount fail, we will wait for the root mount hold release > + # and retry. These lines are a bit too long. > mount -a -t ${mount_excludes} > err=$? > + if [ $? -ne 0 ]; then The assignment will set $? to 0, so the new code will never be executed. "$err" should be tested instead of $?. > + echo > + echo 'Mounting /etc/fstab filesystems failed,' \ > + 'will retry after root mount hold release' > + > + waited=0 > + while [ ${waited} -lt ${root_hold_delay} ]; do > + holders="$(sysctl -n vfs.root_mount_hold)" > + if [ -z "${holders}" ]; then > + break; > + fi > + if [ ${waited} -eq 0 ]; then > + echo -n "Waiting ${root_hold_delay}s" \ > + "for the root mount holders: ${holders}" > + else > + echo -n . > + fi > + if [ ${waited} -eq ${root_hold_delay} ]; then > + break 2 > + fi > + sleep 1 > + waited=$(($waited + 1)) > + done > + mount -a -t ${mount_excludes} > + err=$? > + fi > + > check_startmsgs && echo '.' > > case ${err} in > @@ -44,7 +78,7 @@ mountcritlocal_start() > ;; > *) > echo 'Mounting /etc/fstab filesystems failed,' \ > - ' startup aborted' > + 'startup aborted' > stop_boot true > ;; > esac > [snip] -- Jilles Tjoelker From owner-svn-src-all@freebsd.org Mon Dec 21 17:15:05 2015 Return-Path: Delivered-To: svn-src-all@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 28A51A4E2BA; Mon, 21 Dec 2015 17:15:05 +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 032271DB8; Mon, 21 Dec 2015 17:15:04 +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 tBLHF4E4031068; Mon, 21 Dec 2015 17:15:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLHF4Oo031067; Mon, 21 Dec 2015 17:15:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201512211715.tBLHF4Oo031067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 21 Dec 2015 17:15:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292551 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 17:15:05 -0000 Author: dim Date: Mon Dec 21 17:15:03 2015 New Revision: 292551 URL: https://svnweb.freebsd.org/changeset/base/292551 Log: MFC r277735 (by royger): amd64: allow base memory segment to start at address different than 0 Current code requires that the first physical memory segment starts at 0, but this is not really needed. We only need to make sure the bootstrap code and page tables for APs are allocated below 4GB. This patch removes this requirement and allows booting a Dell R710 from UEFI, where the first physical memory segment starts at 0x10000. Sponsored by: Citrix Systems R&D Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D1417 Modified: stable/10/sys/amd64/amd64/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/machdep.c Mon Dec 21 16:55:36 2015 (r292550) +++ stable/10/sys/amd64/amd64/machdep.c Mon Dec 21 17:15:03 2015 (r292551) @@ -1344,8 +1344,10 @@ add_physmap_entry(uint64_t base, uint64_ /* * Find insertion point while checking for overlap. Start off by * assuming the new entry will be added to the end. + * + * NB: physmap_idx points to the next free slot. */ - insert_idx = physmap_idx + 2; + insert_idx = physmap_idx; for (i = 0; i <= physmap_idx; i += 2) { if (base < physmap[i + 1]) { if (base + length <= physmap[i]) { @@ -1383,7 +1385,7 @@ add_physmap_entry(uint64_t base, uint64_ * Move the last 'N' entries down to make room for the new * entry if needed. */ - for (i = physmap_idx; i > insert_idx; i -= 2) { + for (i = (physmap_idx - 2); i > insert_idx; i -= 2) { physmap[i] = physmap[i - 2]; physmap[i + 1] = physmap[i - 1]; } @@ -1548,7 +1550,6 @@ getmemsize(caddr_t kmdp, u_int64_t first int page_counter; bzero(physmap, sizeof(physmap)); - basemem = 0; physmap_idx = 0; efihdr = (struct efi_map_header *)preload_search_info(kmdp, @@ -1566,21 +1567,29 @@ getmemsize(caddr_t kmdp, u_int64_t first panic("No BIOS smap or EFI map info from loader!"); } + physmap_idx -= 2; + /* * Find the 'base memory' segment for SMP */ basemem = 0; for (i = 0; i <= physmap_idx; i += 2) { - if (physmap[i] == 0x00000000) { + if (physmap[i] <= 0xA0000) { basemem = physmap[i + 1] / 1024; break; } } - if (basemem == 0) - panic("BIOS smap did not include a basemem segment!"); + if (basemem == 0 || basemem > 640) { + if (bootverbose) + printf( + "Memory map doesn't contain a basemem segment, faking it"); + basemem = 640; + } #ifdef SMP /* make hole for AP bootstrap code */ + if (physmap[1] >= 0x100000000) + panic("Basemem segment is not suitable for AP bootstrap code!"); physmap[1] = mp_bootaddress(physmap[1] / 1024); #endif @@ -1634,12 +1643,14 @@ getmemsize(caddr_t kmdp, u_int64_t first */ physmem_start = (vm_guest > VM_GUEST_NO ? 1 : 16) << PAGE_SHIFT; TUNABLE_ULONG_FETCH("hw.physmem.start", &physmem_start); - if (physmem_start < PAGE_SIZE) - physmap[0] = PAGE_SIZE; - else if (physmem_start >= physmap[1]) - physmap[0] = round_page(physmap[1] - PAGE_SIZE); - else - physmap[0] = round_page(physmem_start); + if (physmap[0] < physmem_start) { + if (physmem_start < PAGE_SIZE) + physmap[0] = PAGE_SIZE; + else if (physmem_start >= physmap[1]) + physmap[0] = round_page(physmap[1] - PAGE_SIZE); + else + physmap[0] = round_page(physmem_start); + } pa_indx = 0; da_indx = 1; phys_avail[pa_indx++] = physmap[0]; From owner-svn-src-all@freebsd.org Mon Dec 21 17:17:01 2015 Return-Path: Delivered-To: svn-src-all@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 7B104A4E3EE; Mon, 21 Dec 2015 17:17:01 +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 306301F95; Mon, 21 Dec 2015 17:17:01 +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 tBLHH0xK031173; Mon, 21 Dec 2015 17:17:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLHH0HK031172; Mon, 21 Dec 2015 17:17:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512211717.tBLHH0HK031172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Dec 2015 17:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292552 - head/contrib/smbfs/lib/smb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 17:17:01 -0000 Author: ian Date: Mon Dec 21 17:17:00 2015 New Revision: 292552 URL: https://svnweb.freebsd.org/changeset/base/292552 Log: Avoid unaligned memory accesses when encoding netbios names in libsmb. The current code for encoding a netbios name converts each byte to a 16-bit value and stores the result by casting a char* to u_short*, resulting in alignment faults on strict-alignment platforms. This change reimplements the encoding routine using only byte accesses to memory. There is no particular reason to work with 16-bit values just because the encoding process creates two bytes of output for every byte of input. Working a byte at at time also avoids endian problems for big-endian platforms. PR: 180438 PR: 189415 Differential Revision: https://reviews.freebsd.org/D4622 Modified: head/contrib/smbfs/lib/smb/nb_name.c Modified: head/contrib/smbfs/lib/smb/nb_name.c ============================================================================== --- head/contrib/smbfs/lib/smb/nb_name.c Mon Dec 21 17:15:03 2015 (r292551) +++ head/contrib/smbfs/lib/smb/nb_name.c Mon Dec 21 17:17:00 2015 (r292552) @@ -143,15 +143,13 @@ nb_encname_len(const char *str) return len; } -#define NBENCODE(c) (htole16((u_short)(((u_char)(c) >> 4) | \ - (((u_char)(c) & 0xf) << 8)) + 0x4141)) - -static void -memsetw(char *dst, int n, u_short word) +static inline void +nb_char_encode(u_char **ptr, u_char c, int n) { + while (n--) { - *(u_short*)dst = word; - dst += 2; + *(*ptr)++ = 0x41 + (c >> 4); + *(*ptr)++ = 0x41 + (c & 0x0f); } } @@ -165,19 +163,15 @@ nb_name_encode(struct nb_name *np, u_cha *cp++ = NB_ENCNAMELEN; name = np->nn_name; if (name[0] == '*' && name[1] == 0) { - *(u_short*)cp = NBENCODE('*'); - memsetw(cp + 2, NB_NAMELEN - 1, NBENCODE(' ')); - cp += NB_ENCNAMELEN; + nb_char_encode(&cp, '*', 1); + nb_char_encode(&cp, ' ', NB_NAMELEN - 1); } else { - for (i = 0; *name && i < NB_NAMELEN - 1; i++, cp += 2, name++) - *(u_short*)cp = NBENCODE(toupper(*name)); - i = NB_NAMELEN - i - 1; - if (i > 0) { - memsetw(cp, i, NBENCODE(' ')); - cp += i * 2; - } - *(u_short*)cp = NBENCODE(np->nn_type); - cp += 2; + for (i = 0; i < NB_NAMELEN - 1; i++) + if (*name != 0) + nb_char_encode(&cp, toupper(*name++), 1); + else + nb_char_encode(&cp, ' ', 1); + nb_char_encode(&cp, np->nn_type, 1); } *cp = 0; if (np->nn_scope == NULL) From owner-svn-src-all@freebsd.org Mon Dec 21 17:41:10 2015 Return-Path: Delivered-To: svn-src-all@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 B3010A4D319; Mon, 21 Dec 2015 17:41:10 +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 8D6A91CDE; Mon, 21 Dec 2015 17:41:10 +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 tBLHf93m037136; Mon, 21 Dec 2015 17:41:09 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLHf9Dj037129; Mon, 21 Dec 2015 17:41:09 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512211741.tBLHf9Dj037129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Dec 2015 17:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292553 - in head: lib usr.sbin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 17:41:10 -0000 Author: ian Date: Mon Dec 21 17:41:08 2015 New Revision: 292553 URL: https://svnweb.freebsd.org/changeset/base/292553 Log: Make the building of libsmb and mount_smbfs unconditional, now that r292552 has eliminated alignment and endian problems that were making it fail on some platforms. PR: 180438 PR: 189415 Modified: head/lib/Makefile head/usr.sbin/Makefile head/usr.sbin/Makefile.amd64 head/usr.sbin/Makefile.arm head/usr.sbin/Makefile.i386 head/usr.sbin/Makefile.powerpc head/usr.sbin/Makefile.sparc64 Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Dec 21 17:17:00 2015 (r292552) +++ head/lib/Makefile Mon Dec 21 17:41:08 2015 (r292553) @@ -91,7 +91,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libsbuf \ ${_libsdp} \ ${_libsm} \ - ${_libsmb} \ + libsmb \ ${_libsmdb} \ ${_libsmutil} \ libsqlite3 \ @@ -243,7 +243,6 @@ _libypclnt= libypclnt .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -_libsmb= libsmb _libvgl= libvgl _libproc= libproc _librtld_db= librtld_db @@ -263,15 +262,9 @@ _librtld_db= librtld_db .if ${MACHINE_CPUARCH} == "powerpc" _libproc= libproc _librtld_db= librtld_db -_libsmb= libsmb -.endif - -.if ${MACHINE_CPUARCH} == "sparc64" -_libsmb= libsmb .endif .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" -_libsmb= libsmb _libproc= libproc _librtld_db= librtld_db .endif Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Mon Dec 21 17:17:00 2015 (r292552) +++ head/usr.sbin/Makefile Mon Dec 21 17:41:08 2015 (r292553) @@ -46,6 +46,7 @@ SUBDIR= adduser \ mixer \ mlxcontrol \ mountd \ + mount_smbfs \ mpsutil \ mptutil \ mtest \ Modified: head/usr.sbin/Makefile.amd64 ============================================================================== --- head/usr.sbin/Makefile.amd64 Mon Dec 21 17:17:00 2015 (r292552) +++ head/usr.sbin/Makefile.amd64 Mon Dec 21 17:41:08 2015 (r292553) @@ -25,7 +25,6 @@ SUBDIR+= hyperv .endif SUBDIR+= kgmon SUBDIR+= lptcontrol -SUBDIR+= mount_smbfs SUBDIR+= mptable .if ${MK_NDIS} != "no" SUBDIR+= ndiscvt Modified: head/usr.sbin/Makefile.arm ============================================================================== --- head/usr.sbin/Makefile.arm Mon Dec 21 17:17:00 2015 (r292552) +++ head/usr.sbin/Makefile.arm Mon Dec 21 17:41:08 2015 (r292553) @@ -1,5 +1,4 @@ # $FreeBSD$ SUBDIR+= kgmon -SUBDIR+= mount_smbfs SUBDIR+= ofwdump Modified: head/usr.sbin/Makefile.i386 ============================================================================== --- head/usr.sbin/Makefile.i386 Mon Dec 21 17:17:00 2015 (r292552) +++ head/usr.sbin/Makefile.i386 Mon Dec 21 17:41:08 2015 (r292553) @@ -12,7 +12,6 @@ SUBDIR+= cpucontrol SUBDIR+= kgmon SUBDIR+= kgzip SUBDIR+= lptcontrol -SUBDIR+= mount_smbfs SUBDIR+= mptable .if ${MK_NDIS} != "no" SUBDIR+= ndiscvt Modified: head/usr.sbin/Makefile.powerpc ============================================================================== --- head/usr.sbin/Makefile.powerpc Mon Dec 21 17:17:00 2015 (r292552) +++ head/usr.sbin/Makefile.powerpc Mon Dec 21 17:41:08 2015 (r292553) @@ -1,5 +1,4 @@ # $FreeBSD$ -SUBDIR+= mount_smbfs SUBDIR+= nvram SUBDIR+= ofwdump Modified: head/usr.sbin/Makefile.sparc64 ============================================================================== --- head/usr.sbin/Makefile.sparc64 Mon Dec 21 17:17:00 2015 (r292552) +++ head/usr.sbin/Makefile.sparc64 Mon Dec 21 17:41:08 2015 (r292553) @@ -1,5 +1,4 @@ # $FreeBSD$ SUBDIR+= eeprom -SUBDIR+= mount_smbfs SUBDIR+= ofwdump From owner-svn-src-all@freebsd.org Mon Dec 21 17:54:24 2015 Return-Path: Delivered-To: svn-src-all@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 690CEA4DD9B; Mon, 21 Dec 2015 17:54:24 +0000 (UTC) (envelope-from ume@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 39DAD13D9; Mon, 21 Dec 2015 17:54:24 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBLHsNf7042719; Mon, 21 Dec 2015 17:54:23 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLHsNWj042718; Mon, 21 Dec 2015 17:54:23 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512211754.tBLHsNWj042718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Mon, 21 Dec 2015 17:54:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292554 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 17:54:24 -0000 Author: ume Date: Mon Dec 21 17:54:23 2015 New Revision: 292554 URL: https://svnweb.freebsd.org/changeset/base/292554 Log: Use _map_v4v6_address(). MFC after: 1 week Modified: head/lib/libc/net/name6.c Modified: head/lib/libc/net/name6.c ============================================================================== --- head/lib/libc/net/name6.c Mon Dec 21 17:41:08 2015 (r292553) +++ head/lib/libc/net/name6.c Mon Dec 21 17:54:23 2015 (r292554) @@ -794,10 +794,9 @@ match_addrselectpolicy(struct sockaddr * memset(&key, 0, sizeof(key)); key.sin6_family = AF_INET6; key.sin6_len = sizeof(key); - key.sin6_addr.s6_addr[10] = 0xff; - key.sin6_addr.s6_addr[11] = 0xff; - memcpy(&key.sin6_addr.s6_addr[12], - &((struct sockaddr_in *)addr)->sin_addr, 4); + _map_v4v6_address( + (char *)&((struct sockaddr_in *)addr)->sin_addr, + (char *)&key.sin6_addr); break; default: return(NULL); From owner-svn-src-all@freebsd.org Mon Dec 21 18:07:35 2015 Return-Path: Delivered-To: svn-src-all@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 E0653A4E52F; Mon, 21 Dec 2015 18:07:34 +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 AE5C01AA5; Mon, 21 Dec 2015 18:07:34 +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 tBLI7Xr5045818; Mon, 21 Dec 2015 18:07:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLI7WtW045808; Mon, 21 Dec 2015 18:07:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512211807.tBLI7WtW045808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Dec 2015 18:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292555 - in head/sys: arm/arm arm/include conf dev/ofw powerpc/include powerpc/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 18:07:35 -0000 Author: ian Date: Mon Dec 21 18:07:32 2015 New Revision: 292555 URL: https://svnweb.freebsd.org/changeset/base/292555 Log: Implement OF_decode_addr() for arm. Move most of powerpc's implementation into a new function that other platforms can share. This creates a new ofw_reg_to_paddr() function (in a new ofw_subr.c file) that contains most of the existing ppc implementation, mostly unchanged. The ppc code now calls the new MI code from the MD code, then creates a ppc-specific bus_space mapping from the results. The new arm implementation does the same in an arm-specific way. This also moves the declaration of OF_decode_addr() from ofw_machdep.h to openfirm.h, except on sparc64 which uses a different function signature. This will help all FDT platforms to set up early console access using OF_decode_addr(). Added: head/sys/arm/arm/ofw_machdep.c (contents, props changed) head/sys/dev/ofw/ofw_subr.c (contents, props changed) head/sys/dev/ofw/ofw_subr.h (contents, props changed) Modified: head/sys/arm/include/ofw_machdep.h head/sys/conf/files head/sys/conf/files.arm head/sys/conf/files.powerpc head/sys/dev/ofw/openfirm.h head/sys/powerpc/include/ofw_machdep.h head/sys/powerpc/ofw/ofw_machdep.c Added: head/sys/arm/arm/ofw_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/ofw_machdep.c Mon Dec 21 18:07:32 2015 (r292555) @@ -0,0 +1,71 @@ +/*- + * Copyright (c) 2015 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include + +#include +#include + +int +OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag, + bus_space_handle_t *handle) +{ + bus_addr_t addr; + bus_size_t size; + pcell_t pci_hi; + int flags, res; + + res = ofw_reg_to_paddr(dev, regno, &addr, &size, &pci_hi); + if (res < 0) + return (res); + + /* + * Nothing special to do for PCI busses right now. + * This may need to be handled per-platform when it does come up. + */ +#ifdef notyet + if (pci_hi == OFW_PADDR_NOT_PCI) { + *tag = fdtbus_bs_tag; + flags = 0; + } else { + *tag = fdtbus_bs_tag; + flags = (pci_hi & OFW_PCI_PHYS_HI_PREFETCHABLE) ? + BUS_SPACE_MAP_PREFETCHABLE: 0; + } +#else + *tag = fdtbus_bs_tag; + flags = 0; +#endif + return (bus_space_map(*tag, addr, size, flags, handle)); +} + Modified: head/sys/arm/include/ofw_machdep.h ============================================================================== --- head/sys/arm/include/ofw_machdep.h Mon Dec 21 17:54:23 2015 (r292554) +++ head/sys/arm/include/ofw_machdep.h Mon Dec 21 18:07:32 2015 (r292555) @@ -32,6 +32,9 @@ #ifndef _MACHINE_OFW_MACHDEP_H_ #define _MACHINE_OFW_MACHDEP_H_ +#include +#include +#include #include typedef uint32_t cell_t; Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Dec 21 17:54:23 2015 (r292554) +++ head/sys/conf/files Mon Dec 21 18:07:32 2015 (r292555) @@ -2094,6 +2094,7 @@ dev/ofw/ofw_bus_subr.c optional fdt dev/ofw/ofw_fdt.c optional fdt dev/ofw/ofw_if.m optional fdt dev/ofw/ofw_iicbus.c optional fdt iicbus +dev/ofw/ofw_subr.c optional fdt dev/ofw/ofwbus.c optional fdt dev/ofw/openfirm.c optional fdt dev/ofw/openfirmio.c optional fdt Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Mon Dec 21 17:54:23 2015 (r292554) +++ head/sys/conf/files.arm Mon Dec 21 18:07:32 2015 (r292555) @@ -55,6 +55,7 @@ arm/arm/minidump_machdep.c optional mem arm/arm/mp_machdep.c optional smp arm/arm/mpcore_timer.c optional mpcore_timer arm/arm/nexus.c standard +arm/arm/ofw_machdep.c optional fdt arm/arm/physmem.c standard kern/pic_if.m optional arm_intrng arm/arm/pl190.c optional pl190 Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon Dec 21 17:54:23 2015 (r292554) +++ head/sys/conf/files.powerpc Mon Dec 21 18:07:32 2015 (r292555) @@ -58,6 +58,7 @@ dev/ofw/ofw_disk.c optional ofwd aim dev/ofw/ofw_iicbus.c optional iicbus aim dev/ofw/ofwbus.c optional aim | fdt dev/ofw/ofw_standard.c optional aim powerpc +dev/ofw/ofw_subr.c optional aim powerpc dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac dev/quicc/quicc_bfe_fdt.c optional quicc mpc85xx dev/scc/scc_bfe_macio.c optional scc powermac Added: head/sys/dev/ofw/ofw_subr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ofw/ofw_subr.c Mon Dec 21 18:07:32 2015 (r292555) @@ -0,0 +1,177 @@ +/*- + * Copyright (c) 2015 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The initial ofw_reg_to_paddr() implementation has been copied from powerpc + * ofw_machdep.c OF_decode_addr(). It was added by Marcel Moolenaar, who did not + * assert copyright with the addition but still deserves credit for the work. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#include +#include +#include + +static void +get_addr_props(phandle_t node, uint32_t *addrp, uint32_t *sizep, int *pcip) +{ + char type[64]; + uint32_t addr, size; + int pci, res; + + res = OF_getencprop(node, "#address-cells", &addr, sizeof(addr)); + if (res == -1) + addr = 2; + res = OF_getencprop(node, "#size-cells", &size, sizeof(size)); + if (res == -1) + size = 1; + pci = 0; + if (addr == 3 && size == 2) { + res = OF_getprop(node, "device_type", type, sizeof(type)); + if (res != -1) { + type[sizeof(type) - 1] = '\0'; + pci = (strcmp(type, "pci") == 0) ? 1 : 0; + } + } + if (addrp != NULL) + *addrp = addr; + if (sizep != NULL) + *sizep = size; + if (pcip != NULL) + *pcip = pci; +} + +int +ofw_reg_to_paddr(phandle_t dev, int regno, bus_addr_t *paddr, + bus_size_t *psize, pcell_t *ppci_hi) +{ + pcell_t cell[32], pci_hi; + bus_addr_t addr, raddr, baddr; + bus_size_t size, rsize; + uint32_t c, nbridge, naddr, nsize; + phandle_t bridge, parent; + u_int spc, rspc; + int pci, pcib, res; + + /* Sanity checking. */ + if (dev == 0) + return (EINVAL); + bridge = OF_parent(dev); + if (bridge == 0) + return (EINVAL); + if (regno < 0) + return (EINVAL); + if (paddr == NULL || psize == NULL) + return (EINVAL); + + get_addr_props(bridge, &naddr, &nsize, &pci); + res = OF_getencprop(dev, (pci) ? "assigned-addresses" : "reg", + cell, sizeof(cell)); + if (res == -1) + return (ENXIO); + if (res % sizeof(cell[0])) + return (ENXIO); + res /= sizeof(cell[0]); + regno *= naddr + nsize; + if (regno + naddr + nsize > res) + return (EINVAL); + pci_hi = pci ? cell[regno] : OFW_PADDR_NOT_PCI; + spc = pci_hi & OFW_PCI_PHYS_HI_SPACEMASK; + addr = 0; + for (c = 0; c < naddr; c++) + addr = ((uint64_t)addr << 32) | cell[regno++]; + size = 0; + for (c = 0; c < nsize; c++) + size = ((uint64_t)size << 32) | cell[regno++]; + /* + * Map the address range in the bridge's decoding window as given + * by the "ranges" property. If a node doesn't have such property + * or the property is empty, we assume an identity mapping. The + * standard says a missing property indicates no possible mapping. + * This code is more liberal since the intended use is to get a + * console running early, and a printf to warn of malformed data + * is probably futile before the console is fully set up. + */ + parent = OF_parent(bridge); + while (parent != 0) { + get_addr_props(parent, &nbridge, NULL, &pcib); + res = OF_getencprop(bridge, "ranges", cell, sizeof(cell)); + if (res < 1) + goto next; + if (res % sizeof(cell[0])) + return (ENXIO); + /* Capture pci_hi if we just transitioned onto a PCI bus. */ + if (pcib && pci_hi == OFW_PADDR_NOT_PCI) { + pci_hi = cell[0]; + spc = pci_hi & OFW_PCI_PHYS_HI_SPACEMASK; + } + res /= sizeof(cell[0]); + regno = 0; + while (regno < res) { + rspc = (pci) + ? cell[regno] & OFW_PCI_PHYS_HI_SPACEMASK + : OFW_PADDR_NOT_PCI; + if (rspc != spc) { + regno += naddr + nbridge + nsize; + continue; + } + raddr = 0; + for (c = 0; c < naddr; c++) + raddr = ((uint64_t)raddr << 32) | cell[regno++]; + rspc = (pcib) + ? cell[regno] & OFW_PCI_PHYS_HI_SPACEMASK + : OFW_PADDR_NOT_PCI; + baddr = 0; + for (c = 0; c < nbridge; c++) + baddr = ((uint64_t)baddr << 32) | cell[regno++]; + rsize = 0; + for (c = 0; c < nsize; c++) + rsize = ((uint64_t)rsize << 32) | cell[regno++]; + if (addr < raddr || addr >= raddr + rsize) + continue; + addr = addr - raddr + baddr; + if (rspc != OFW_PADDR_NOT_PCI) + spc = rspc; + } + next: + bridge = parent; + parent = OF_parent(bridge); + get_addr_props(bridge, &naddr, &nsize, &pci); + } + + *paddr = addr; + *psize = size; + if (ppci_hi != NULL) + *ppci_hi = pci_hi; + + return (0); +} Added: head/sys/dev/ofw/ofw_subr.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ofw/ofw_subr.h Mon Dec 21 18:07:32 2015 (r292555) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2015 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_OFW_OFW_SUBR_H_ +#define _DEV_OFW_OFW_SUBR_H_ + +/* + * Translate an address from the Nth tuple of a device node's reg properties to + * a physical memory address, by applying the range mappings from all ancestors. + * This assumes that all ancestor ranges are simple numerical offsets for which + * addition and subtraction operations will perform the required mapping (the + * bit-options in the high word of standard PCI properties are also handled). + * After the call, *pci_hi (if non-NULL) contains the phys.hi cell of the + * device's parent PCI bus, or OFW_PADDR_NOT_PCI if no PCI bus is involved. + * + * This is intended to be a helper function called by the platform-specific + * implementation of OF_decode_addr(), and not for direct use by device drivers. + */ +#define OFW_PADDR_NOT_PCI (~0) + +int ofw_reg_to_paddr(phandle_t _dev, int _regno, bus_addr_t *_paddr, + bus_size_t *_size, pcell_t *_pci_hi); + +#endif Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Mon Dec 21 17:54:23 2015 (r292554) +++ head/sys/dev/ofw/openfirm.h Mon Dec 21 18:07:32 2015 (r292555) @@ -167,5 +167,16 @@ void OF_exit(void) __attribute__((noret /* User interface functions */ int OF_interpret(const char *cmd, int nreturns, ...); +/* + * Decode the Nth register property of the given device node and create a bus + * space tag and handle for accessing it. This is for use in setting up things + * like early console output before newbus is available. The implementation is + * machine-dependent, and sparc uses a different function signature as well. + */ +#ifndef __sparc64__ +int OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *ptag, + bus_space_handle_t *phandle); +#endif + #endif /* _KERNEL */ #endif /* _DEV_OPENFIRM_H_ */ Modified: head/sys/powerpc/include/ofw_machdep.h ============================================================================== --- head/sys/powerpc/include/ofw_machdep.h Mon Dec 21 17:54:23 2015 (r292554) +++ head/sys/powerpc/include/ofw_machdep.h Mon Dec 21 18:07:32 2015 (r292555) @@ -37,7 +37,6 @@ typedef uint32_t cell_t; -int OF_decode_addr(phandle_t, int, bus_space_tag_t *, bus_space_handle_t *); void OF_getetheraddr(device_t dev, u_char *addr); void OF_initial_setup(void *fdt_ptr, void *junk, int (*openfirm)(void *)); Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Mon Dec 21 17:54:23 2015 (r292554) +++ head/sys/powerpc/ofw/ofw_machdep.c Mon Dec 21 18:07:32 2015 (r292555) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -565,135 +566,28 @@ OF_getetheraddr(device_t dev, u_char *ad * register in the address space of its parent and recursively walk * the device tree upward this way. */ -static void -OF_get_addr_props(phandle_t node, uint32_t *addrp, uint32_t *sizep, int *pcip) -{ - char type[64]; - uint32_t addr, size; - int pci, res; - - res = OF_getencprop(node, "#address-cells", &addr, sizeof(addr)); - if (res == -1) - addr = 2; - res = OF_getencprop(node, "#size-cells", &size, sizeof(size)); - if (res == -1) - size = 1; - pci = 0; - if (addr == 3 && size == 2) { - res = OF_getprop(node, "device_type", type, sizeof(type)); - if (res != -1) { - type[sizeof(type) - 1] = '\0'; - pci = (strcmp(type, "pci") == 0) ? 1 : 0; - } - } - if (addrp != NULL) - *addrp = addr; - if (sizep != NULL) - *sizep = size; - if (pcip != NULL) - *pcip = pci; -} - int OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag, bus_space_handle_t *handle) { - uint32_t cell[32]; - bus_addr_t addr, raddr, baddr; - bus_size_t size, rsize; - uint32_t c, nbridge, naddr, nsize; - phandle_t bridge, parent; - u_int spc, rspc, prefetch; - int pci, pcib, res; - - /* Sanity checking. */ - if (dev == 0) - return (EINVAL); - bridge = OF_parent(dev); - if (bridge == 0) - return (EINVAL); - if (regno < 0) - return (EINVAL); - if (tag == NULL || handle == NULL) - return (EINVAL); - - /* Assume big-endian unless we find a PCI device */ - *tag = &bs_be_tag; - - /* Get the requested register. */ - OF_get_addr_props(bridge, &naddr, &nsize, &pci); - if (pci) + bus_addr_t addr; + bus_size_t size; + pcell_t pci_hi; + int flags, res; + + res = ofw_reg_to_paddr(dev, regno, &addr, &size, &pci_hi); + if (res < 0) + return (res); + + if (pci_hi == OFW_PADDR_NOT_PCI) { + *tag = &bs_be_tag; + flags = 0; + } else { *tag = &bs_le_tag; - res = OF_getencprop(dev, (pci) ? "assigned-addresses" : "reg", - cell, sizeof(cell)); - if (res == -1) - return (ENXIO); - if (res % sizeof(cell[0])) - return (ENXIO); - res /= sizeof(cell[0]); - regno *= naddr + nsize; - if (regno + naddr + nsize > res) - return (EINVAL); - spc = (pci) ? cell[regno] & OFW_PCI_PHYS_HI_SPACEMASK : ~0; - prefetch = (pci) ? cell[regno] & OFW_PCI_PHYS_HI_PREFETCHABLE : 0; - addr = 0; - for (c = 0; c < naddr; c++) - addr = ((uint64_t)addr << 32) | cell[regno++]; - size = 0; - for (c = 0; c < nsize; c++) - size = ((uint64_t)size << 32) | cell[regno++]; - - /* - * Map the address range in the bridge's decoding window as given - * by the "ranges" property. If a node doesn't have such property - * then no mapping is done. - */ - parent = OF_parent(bridge); - while (parent != 0) { - OF_get_addr_props(parent, &nbridge, NULL, &pcib); - if (pcib) - *tag = &bs_le_tag; - res = OF_getencprop(bridge, "ranges", cell, sizeof(cell)); - if (res == -1) - goto next; - if (res % sizeof(cell[0])) - return (ENXIO); - res /= sizeof(cell[0]); - regno = 0; - while (regno < res) { - rspc = (pci) - ? cell[regno] & OFW_PCI_PHYS_HI_SPACEMASK - : ~0; - if (rspc != spc) { - regno += naddr + nbridge + nsize; - continue; - } - raddr = 0; - for (c = 0; c < naddr; c++) - raddr = ((uint64_t)raddr << 32) | cell[regno++]; - rspc = (pcib) - ? cell[regno] & OFW_PCI_PHYS_HI_SPACEMASK - : ~0; - baddr = 0; - for (c = 0; c < nbridge; c++) - baddr = ((uint64_t)baddr << 32) | cell[regno++]; - rsize = 0; - for (c = 0; c < nsize; c++) - rsize = ((uint64_t)rsize << 32) | cell[regno++]; - if (addr < raddr || addr >= raddr + rsize) - continue; - addr = addr - raddr + baddr; - if (rspc != ~0) - spc = rspc; - } - - next: - bridge = parent; - parent = OF_parent(bridge); - OF_get_addr_props(bridge, &naddr, &nsize, &pci); + flags = (pci_hi & OFW_PCI_PHYS_HI_PREFETCHABLE) ? + BUS_SPACE_MAP_PREFETCHABLE: 0; } - return (bus_space_map(*tag, addr, size, - prefetch ? BUS_SPACE_MAP_PREFETCHABLE : 0, handle)); + return (bus_space_map(*tag, addr, size, flags, handle)); } From owner-svn-src-all@freebsd.org Mon Dec 21 18:10:53 2015 Return-Path: Delivered-To: svn-src-all@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 95650A4E778 for ; Mon, 21 Dec 2015 18:10:53 +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 7993A1D7D for ; Mon, 21 Dec 2015 18:10:53 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 21 Dec 2015 18:11:00 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tBLIAjSP034365; Mon, 21 Dec 2015 11:10:45 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1450721445.25138.147.camel@freebsd.org> Subject: Re: svn commit: r292555 - in head/sys: arm/arm arm/include conf dev/ofw powerpc/include powerpc/ofw From: Ian Lepore To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 21 Dec 2015 11:10:45 -0700 In-Reply-To: <201512211807.tBLI7WtW045808@repo.freebsd.org> References: <201512211807.tBLI7WtW045808@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 18:10:53 -0000 On Mon, 2015-12-21 at 18:07 +0000, Ian Lepore wrote: > Author: ian > Date: Mon Dec 21 18:07:32 2015 > New Revision: 292555 > URL: https://svnweb.freebsd.org/changeset/base/292555 > > Log: > Implement OF_decode_addr() for arm. Move most of powerpc's implementation > into a new function that other platforms can share. > > This creates a new ofw_reg_to_paddr() function (in a new ofw_subr.c file) > that contains most of the existing ppc implementation, mostly unchanged. > The ppc code now calls the new MI code from the MD code, then creates a > ppc-specific bus_space mapping from the results. The new arm implementation > does the same in an arm-specific way. > > This also moves the declaration of OF_decode_addr() from ofw_machdep.h to > openfirm.h, except on sparc64 which uses a different function signature. > > This will help all FDT platforms to set up early console access using > OF_decode_addr(). > > Added: > head/sys/arm/arm/ofw_machdep.c (contents, props changed) > head/sys/dev/ofw/ofw_subr.c (contents, props changed) > head/sys/dev/ofw/ofw_subr.h (contents, props changed) > Modified: > head/sys/arm/include/ofw_machdep.h > head/sys/conf/files > head/sys/conf/files.arm > head/sys/conf/files.powerpc > head/sys/dev/ofw/openfirm.h > head/sys/powerpc/include/ofw_machdep.h > head/sys/powerpc/ofw/ofw_machdep.c Forgot to add Differential Revision: https://reviews.freebsd.org/D4664 -- Ian From owner-svn-src-all@freebsd.org Mon Dec 21 18:19:15 2015 Return-Path: Delivered-To: svn-src-all@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 5D7A7A4EDAA; Mon, 21 Dec 2015 18:19:15 +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 37F771384; Mon, 21 Dec 2015 18:19:15 +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 tBLIJErJ050690; Mon, 21 Dec 2015 18:19:14 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLIJE54050688; Mon, 21 Dec 2015 18:19:14 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512211819.tBLIJE54050688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Dec 2015 18:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292556 - in head/sys: conf mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 18:19:15 -0000 Author: ian Date: Mon Dec 21 18:19:14 2015 New Revision: 292556 URL: https://svnweb.freebsd.org/changeset/base/292556 Log: Add a mips implementation of OF_decode_addr(). Added: head/sys/mips/mips/ofw_machdep.c (contents, props changed) Modified: head/sys/conf/files.mips Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Mon Dec 21 18:07:32 2015 (r292555) +++ head/sys/conf/files.mips Mon Dec 21 18:19:14 2015 (r292556) @@ -30,6 +30,7 @@ mips/mips/minidump_machdep.c standard mips/mips/mp_machdep.c optional smp mips/mips/mpboot.S optional smp mips/mips/nexus.c standard +mips/mips/ofw_machdep.c optional fdt mips/mips/pm_machdep.c standard mips/mips/pmap.c standard mips/mips/ptrace_machdep.c standard Added: head/sys/mips/mips/ofw_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mips/ofw_machdep.c Mon Dec 21 18:19:14 2015 (r292556) @@ -0,0 +1,70 @@ +/*- + * Copyright (c) 2015 Ian Lepore + * All rights excluded. + * + * 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 + +int +OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag, + bus_space_handle_t *handle) +{ + bus_addr_t addr; + bus_size_t size; + pcell_t pci_hi; + int flags, res; + + res = ofw_reg_to_paddr(dev, regno, &addr, &size, &pci_hi); + if (res < 0) + return (res); + + /* + * Nothing special to do for PCI busses right now. + * This may need to be handled per-platform when it does come up. + */ +#ifdef notyet + if (pci_hi == OFW_PADDR_NOT_PCI) { + *tag = fdtbus_bs_tag; + flags = 0; + } else { + *tag = fdtbus_bs_tag; + flags = (pci_hi & OFW_PCI_PHYS_HI_PREFETCHABLE) ? + BUS_SPACE_MAP_PREFETCHABLE: 0; + } +#else + *tag = fdtbus_bs_tag; + flags = 0; +#endif + return (bus_space_map(*tag, addr, size, flags, handle)); +} From owner-svn-src-all@freebsd.org Mon Dec 21 18:27:52 2015 Return-Path: Delivered-To: svn-src-all@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 A9AD2A4E29A; Mon, 21 Dec 2015 18:27:52 +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 5EC931AE5; Mon, 21 Dec 2015 18:27:52 +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 tBLIRpTg053741; Mon, 21 Dec 2015 18:27:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLIRpLf053739; Mon, 21 Dec 2015 18:27:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512211827.tBLIRpLf053739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 21 Dec 2015 18:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292557 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 18:27:52 -0000 Author: imp Date: Mon Dec 21 18:27:51 2015 New Revision: 292557 URL: https://svnweb.freebsd.org/changeset/base/292557 Log: Configure the Atmel eval boards to boot the same way. This gives them the same layout as other embedded systems. Modified: head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9G20EK Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Mon Dec 21 18:19:14 2015 (r292556) +++ head/sys/arm/conf/SAM9260EK Mon Dec 21 18:27:51 2015 (r292557) @@ -103,8 +103,10 @@ options PRINTF_BUFR_SIZE=128 # Prevent #options BOOTP_NFSV3 #options BOOTP_WIRED_TO=macb0 -# alternatively, boot from a MMC/SD memory card -# s1 is FAT on this platform. +# s3 because s1 is reserved for the DOS parittions sometimes needed to +# boot off SD cards on the G20 and newer chips. s2 is reserved for +# nanobsd's config partition. s3 and s4 are for the ping-pong upgrade +# path. 9260 doesn't boot off SD, but let's keep things sane. options ROOTDEVNAME=\"ufs:/dev/mmcsd0s3a\" # Alternatively, boot from a USB card. Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Mon Dec 21 18:19:14 2015 (r292556) +++ head/sys/arm/conf/SAM9G20EK Mon Dec 21 18:27:51 2015 (r292557) @@ -82,9 +82,11 @@ options DDB # Enable the kernel debug #options BOOTP_NFSV3 #options BOOTP_WIRED_TO=ate0 -# s2 because s1 is reserved for the DOS parittions sometimes needed to -# boot off SD cards on the G20 and newer chips. -options ROOTDEVNAME=\"ufs:/dev/mmcsd0s2a\" +# s3 because s1 is reserved for the DOS parittions sometimes needed to +# boot off SD cards on the G20 and newer chips. s2 is reserved for +# nanobsd's config partition. s3 and s4 are for the ping-pong upgrade +# path. +options ROOTDEVNAME=\"ufs:/dev/mmcsd0s3a\" # kernel/memory size reduction options MUTEX_NOINLINE From owner-svn-src-all@freebsd.org Mon Dec 21 18:52:03 2015 Return-Path: Delivered-To: svn-src-all@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 A674AA4F8F6; Mon, 21 Dec 2015 18:52:03 +0000 (UTC) (envelope-from tuexen@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 72EF21EBC; Mon, 21 Dec 2015 18:52:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBLIq2og066689; Mon, 21 Dec 2015 18:52:02 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLIq217066688; Mon, 21 Dec 2015 18:52:02 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201512211852.tBLIq217066688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 21 Dec 2015 18:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292558 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 18:52:03 -0000 Author: tuexen Date: Mon Dec 21 18:52:02 2015 New Revision: 292558 URL: https://svnweb.freebsd.org/changeset/base/292558 Log: Stop processing of a SACK when the association has been aborted. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Mon Dec 21 18:27:51 2015 (r292557) +++ head/sys/netinet/sctp_indata.c Mon Dec 21 18:52:02 2015 (r292558) @@ -3994,6 +3994,7 @@ again: op_err = sctp_generate_cause(SCTP_CAUSE_USER_INITIATED_ABT, ""); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_26; sctp_abort_an_association(stcb->sctp_ep, stcb, op_err, SCTP_SO_NOT_LOCKED); + return; } else { struct sctp_nets *netp; From owner-svn-src-all@freebsd.org Mon Dec 21 19:15:07 2015 Return-Path: Delivered-To: svn-src-all@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 D05F1A4E60D; Mon, 21 Dec 2015 19:15:07 +0000 (UTC) (envelope-from jhb@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 AB3081DE1; Mon, 21 Dec 2015 19:15:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBLJF6ag072841; Mon, 21 Dec 2015 19:15:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLJF6IK072840; Mon, 21 Dec 2015 19:15:06 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512211915.tBLJF6IK072840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 21 Dec 2015 19:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292559 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 19:15:08 -0000 Author: jhb Date: Mon Dec 21 19:15:06 2015 New Revision: 292559 URL: https://svnweb.freebsd.org/changeset/base/292559 Log: As previously noted in r290409, purge old entries from MAINTAINERS. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Mon Dec 21 18:52:02 2015 (r292558) +++ head/MAINTAINERS Mon Dec 21 19:15:06 2015 (r292559) @@ -87,72 +87,3 @@ sys/netpfil/pf kp,glebius Pre-commit rev tests freebsd-testing,ngie Pre-commit review requested. usr.sbin/pkg pkg@ Please coordinate behavior or flag changes with pkg team. vmm(4) neel,grehan Pre-commit review requested. ----- OLD ---- -libc/posix1e rwatson Pre-commit review requested. -POSIX.1e ACLs rwatson Pre-commit review requested. -UFS EAs rwatson Pre-commit review requested. -MAC Framework rwatson Pre-commit review requested. -MAC Modules rwatson Pre-commit review requested. -contrib/openbsm rwatson Pre-commit review requested. -sys/security/audit rwatson Pre-commit review requested. -ahc(4) gibbs Pre-commit review requested. -ahd(4) gibbs Pre-commit review requested. -cdboot jhb Pre-commit review requested. -pxeboot jhb Pre-commit review requested. -witness jhb Pre-commit review requested. -CAM gibbs, - ken Pre-commit review requested. send to scsi@freebsd.org -devstat(9) ken Pre-commit review requested. -camcontrol(8) ken Pre-commit review requested. -libcam ken Pre-commit review requested. -libdevstat ken Pre-commit review requested. -iostat(8) ken Pre-commit review requested. -cd(4) ken Pre-commit review requested. -pass(4) ken Pre-commit review requested. -ch(4) ken Pre-commit review requested. -em(4) jfv Pre-commit review requested. -nvi peter Try not to break it. -libz peter Try not to break it. -groff ru Recommends pre-commit review. -ipfw ipfw Pre-commit review preferred. send to ipfw@freebsd.org -drm rnoland Just keep me informed of changes, try not to break it. -unifdef(1) fanf Pre-commit review requested. -ntp roberto Pre-commit review requested. -inetd dwmalone Recommends pre-commit review. -contrib/smbfs bp Open for in-tree committs. In case of functional - changes pre-commit review requested. -file obrien Insists to keep file blocked from other's unapproved - commits -contrib/bzip2 obrien Pre-commit review required. -geom freebsd-geom@FreeBSD.org -geom_concat pjd Pre-commit review preferred. -geom_gate pjd Pre-commit review preferred. -geom_label pjd Pre-commit review preferred. -geom_mirror pjd Pre-commit review preferred. -geom_nop pjd Pre-commit review preferred. -geom_raid3 pjd Pre-commit review preferred. -geom_shsec pjd Pre-commit review preferred. -geom_stripe pjd Pre-commit review preferred. -geom_zero pjd Pre-commit review preferred. -sbin/geom pjd Pre-commit review preferred. -zfs freebsd-fs@FreeBSD.org -linux emul emulation Please discuss changes here. -bs{diff,patch} cperciva Pre-commit review requested. -portsnap cperciva Pre-commit review requested. -freebsd-update cperciva Pre-commit review requested. -sys/netgraph/bluetooth emax Pre-commit review preferred. -lib/libbluetooth emax Pre-commit review preferred. -lib/libsdp emax Pre-commit review preferred. -usr.bin/bluetooth emax Pre-commit review preferred. -usr.sbin/bluetooth emax Pre-commit review preferred. -share/zoneinfo edwin Heads-up appreciated, since our data is coming - from a third party source. -usr.sbin/zic edwin Heads-up appreciated, since this code is - maintained by a third party source. -lib/libc/stdtime edwin Heads-up appreciated, since parts of this code - is maintained by a third party source. -sbin/routed bms Pre-commit review; notify vendor at rhyolite.com -cmx daniel@roe.ch Pre-commit review preferred. -filemon obrien Pre-commit review preferred. -sysdoc trhodes Pre-commit review preferred. - From owner-svn-src-all@freebsd.org Mon Dec 21 19:25:29 2015 Return-Path: Delivered-To: svn-src-all@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 4854AA4ECD5; Mon, 21 Dec 2015 19:25: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 EF13B138B; Mon, 21 Dec 2015 19:25:28 +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 tBLJPS00075884; Mon, 21 Dec 2015 19:25:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLJPRZu075882; Mon, 21 Dec 2015 19:25:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512211925.tBLJPRZu075882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Dec 2015 19:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292560 - in stable/10/sys/boot: amd64/efi efi/libefi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 19:25:29 -0000 Author: emaste Date: Mon Dec 21 19:25:27 2015 New Revision: 292560 URL: https://svnweb.freebsd.org/changeset/base/292560 Log: MFC r280047: build x86-specific files in amd64 loader.efi This was originally done for the arm and arm64 loader.efi and is MFC'd here to ease future UEFI loader MFCs. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/boot/amd64/efi/Makefile stable/10/sys/boot/efi/libefi/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/amd64/efi/Makefile ============================================================================== --- stable/10/sys/boot/amd64/efi/Makefile Mon Dec 21 19:15:06 2015 (r292559) +++ stable/10/sys/boot/amd64/efi/Makefile Mon Dec 21 19:25:27 2015 (r292560) @@ -26,6 +26,8 @@ SRCS= autoload.c \ vers.c SRCS+= amd64_tramp.S \ start.S +SRCS+= nullconsole.c \ + comconsole.c CFLAGS+= -fPIC CFLAGS+= -I. @@ -53,7 +55,7 @@ CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGIN # Always add MI sources .PATH: ${.CURDIR}/../../common -# For smbios.c +# For smbios.c, nullconsole.c, comconsole.c .PATH: ${.CURDIR}/../../i386/libi386 .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common Modified: stable/10/sys/boot/efi/libefi/Makefile ============================================================================== --- stable/10/sys/boot/efi/libefi/Makefile Mon Dec 21 19:15:06 2015 (r292559) +++ stable/10/sys/boot/efi/libefi/Makefile Mon Dec 21 19:25:27 2015 (r292560) @@ -5,8 +5,6 @@ INTERNALLIB= SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ libefi.c time.c -.PATH: ${.CURDIR}/../../i386/libi386 -SRCS+= nullconsole.c comconsole.c .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -fPIC -mno-red-zone @@ -18,8 +16,6 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li # Pick up the bootstrap header for some interface items CFLAGS+= -I${.CURDIR}/../../common -CFLAGS+= -DNO_PCI - # Suppress warning from clang for FreeBSD %b and %D formats CFLAGS+= -fformat-extensions From owner-svn-src-all@freebsd.org Mon Dec 21 19:40:34 2015 Return-Path: Delivered-To: svn-src-all@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 29F9EA4F15E; Mon, 21 Dec 2015 19:40:34 +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 D85271BFE; Mon, 21 Dec 2015 19:40: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 tBLJeXtF079199; Mon, 21 Dec 2015 19:40:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLJeWuR079197; Mon, 21 Dec 2015 19:40:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512211940.tBLJeWuR079197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Dec 2015 19:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292561 - in stable/10/sys/boot/amd64: boot1.efi efi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 19:40:34 -0000 Author: emaste Date: Mon Dec 21 19:40:32 2015 New Revision: 292561 URL: https://svnweb.freebsd.org/changeset/base/292561 Log: MFC r276146: Use explicit --output-target to set EFI file format According to objcopy(1) --target is for use where the input and output formats are the same ("no translation"). In practice it does detect the input format in any case, but be explicit that we're specifying the output format as we are translating from ELF to EFI PE format. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/boot/amd64/boot1.efi/Makefile stable/10/sys/boot/amd64/efi/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/amd64/boot1.efi/Makefile ============================================================================== --- stable/10/sys/boot/amd64/boot1.efi/Makefile Mon Dec 21 19:25:27 2015 (r292560) +++ stable/10/sys/boot/amd64/boot1.efi/Makefile Mon Dec 21 19:40:32 2015 (r292561) @@ -51,7 +51,7 @@ boot1.efi: loader.sym ${OBJCOPY} -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ - --target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} + --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} CFLAGS+= -I${.CURDIR}/../../common Modified: stable/10/sys/boot/amd64/efi/Makefile ============================================================================== --- stable/10/sys/boot/amd64/efi/Makefile Mon Dec 21 19:25:27 2015 (r292560) +++ stable/10/sys/boot/amd64/efi/Makefile Mon Dec 21 19:40:32 2015 (r292561) @@ -92,7 +92,7 @@ loader.efi: loader.sym ${OBJCOPY} -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ - --target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} + --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} LIBEFI= ${.OBJDIR}/../../efi/libefi/libefi.a CFLAGS+= -I${.CURDIR}/../../common From owner-svn-src-all@freebsd.org Mon Dec 21 19:49:02 2015 Return-Path: Delivered-To: svn-src-all@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 48226A4F414; Mon, 21 Dec 2015 19:49:02 +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 16D1E10E5; Mon, 21 Dec 2015 19:49:02 +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 tBLJn1Va082089; Mon, 21 Dec 2015 19:49:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLJn12O082088; Mon, 21 Dec 2015 19:49:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512211949.tBLJn12O082088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Dec 2015 19:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292562 - stable/10/sys/boot/amd64/boot1.efi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 19:49:02 -0000 Author: emaste Date: Mon Dec 21 19:49:00 2015 New Revision: 292562 URL: https://svnweb.freebsd.org/changeset/base/292562 Log: MFC r279738, r281307: boot1.efi: add error reporting Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/boot/amd64/boot1.efi/boot1.c Directory Properties: stable/10/ (props changed) stable/10/sys/gnu/dts/ (props changed) Modified: stable/10/sys/boot/amd64/boot1.efi/boot1.c ============================================================================== --- stable/10/sys/boot/amd64/boot1.efi/boot1.c Mon Dec 21 19:40:32 2015 (r292561) +++ stable/10/sys/boot/amd64/boot1.efi/boot1.c Mon Dec 21 19:49:00 2015 (r292562) @@ -307,12 +307,19 @@ load(const char *fname) /* XXX: For secure boot, we need our own loader here */ status = systab->BootServices->LoadImage(TRUE, image, bootdevpath, buffer, bufsize, &loaderhandle); + if (EFI_ERROR(status)) + printf("LoadImage failed with error %lx\n", status); status = systab->BootServices->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image); + if (EFI_ERROR(status)) + printf("HandleProtocol failed with error %lx\n", status); + loaded_image->DeviceHandle = bootdevhandle; status = systab->BootServices->StartImage(loaderhandle, NULL, NULL); + if (EFI_ERROR(status)) + printf("StartImage failed with error %lx\n", status); } static void From owner-svn-src-all@freebsd.org Mon Dec 21 19:56:13 2015 Return-Path: Delivered-To: svn-src-all@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 3B9FBA4F6FF; Mon, 21 Dec 2015 19:56:13 +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 E07AA1A23; Mon, 21 Dec 2015 19:56:12 +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 tBLJuCja085175; Mon, 21 Dec 2015 19:56:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLJuBLv085172; Mon, 21 Dec 2015 19:56:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512211956.tBLJuBLv085172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Dec 2015 19:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292563 - in head/sys/boot/efi/loader: . arch/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 19:56:13 -0000 Author: emaste Date: Mon Dec 21 19:56:11 2015 New Revision: 292563 URL: https://svnweb.freebsd.org/changeset/base/292563 Log: loader.efi: strip trailing whitespace Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/efi/loader/Makefile head/sys/boot/efi/loader/arch/amd64/framebuffer.c head/sys/boot/efi/loader/devicename.c Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Mon Dec 21 19:49:00 2015 (r292562) +++ head/sys/boot/efi/loader/Makefile Mon Dec 21 19:56:11 2015 (r292563) @@ -67,7 +67,7 @@ HAVE_BCACHE= yes CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE} .endif -# Always add MI sources +# Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/framebuffer.c Mon Dec 21 19:49:00 2015 (r292562) +++ head/sys/boot/efi/loader/arch/amd64/framebuffer.c Mon Dec 21 19:56:11 2015 (r292563) @@ -303,7 +303,7 @@ efifb_from_uga(struct efi_fb *efifb, EFI * offset within the frame buffer of the visible region, nor * the stride. Our only option is to look at the system and * fill in the blanks based on that. Luckily, UGA was mostly - * only used on Apple hardware. + * only used on Apple hardware. */ offset = -1; ev = getenv("smbios.system.maker"); Modified: head/sys/boot/efi/loader/devicename.c ============================================================================== --- head/sys/boot/efi/loader/devicename.c Mon Dec 21 19:49:00 2015 (r292562) +++ head/sys/boot/efi/loader/devicename.c Mon Dec 21 19:56:11 2015 (r292563) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); static int efi_parsedev(struct devdesc **, const char *, const char **); -/* +/* * Point (dev) at an allocated device specifier for the device matching the * path in (devspec). If it contains an explicit device specification, * use that. If not, use the default device. From owner-svn-src-all@freebsd.org Mon Dec 21 20:14:41 2015 Return-Path: Delivered-To: svn-src-all@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 A74D3A4FB15; Mon, 21 Dec 2015 20:14:41 +0000 (UTC) (envelope-from jlh@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 6FA6F10F8; Mon, 21 Dec 2015 20:14:41 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBLKEe8i090961; Mon, 21 Dec 2015 20:14:40 GMT (envelope-from jlh@FreeBSD.org) Received: (from jlh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLKEeIE090960; Mon, 21 Dec 2015 20:14:40 GMT (envelope-from jlh@FreeBSD.org) Message-Id: <201512212014.tBLKEeIE090960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jlh set sender to jlh@FreeBSD.org using -f From: Jeremie Le Hen Date: Mon, 21 Dec 2015 20:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292564 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 20:14:41 -0000 Author: jlh Date: Mon Dec 21 20:14:40 2015 New Revision: 292564 URL: https://svnweb.freebsd.org/changeset/base/292564 Log: Add port for IRC over TLS/SSL, as noted in RFC 7194. PR: 192505 Submitted by: loic.blot@unix-experience.fr MFC after: 3 days Modified: head/etc/services Modified: head/etc/services ============================================================================== --- head/etc/services Mon Dec 21 19:56:11 2015 (r292563) +++ head/etc/services Mon Dec 21 20:14:40 2015 (r292564) @@ -2401,6 +2401,7 @@ xdsxdm 6558/udp sane-port 6566/tcp #Scanner Access Now Easy (SANE) Control Port sane-port 6566/udp #Scanner Access Now Easy (SANE) Control Port ircd 6667/tcp #Internet Relay Chat (unofficial) +ircs-u 6697/tcp #Internet Relay Chat over TLS/SSL frc-hp 6704/sctp #ForCES HP (High Priority) channel frc-mp 6705/sctp #ForCES MP (Medium Priority) channel frc-lp 6706/sctp #ForCES LP (Low priority) channel From owner-svn-src-all@freebsd.org Mon Dec 21 20:17:26 2015 Return-Path: Delivered-To: svn-src-all@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 20140A4FBDE; Mon, 21 Dec 2015 20:17:26 +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 F03961329; Mon, 21 Dec 2015 20:17:25 +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 tBLKHPwH091112; Mon, 21 Dec 2015 20:17:25 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLKHOam091109; Mon, 21 Dec 2015 20:17:24 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201512212017.tBLKHOam091109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 21 Dec 2015 20:17:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292565 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 20:17:26 -0000 Author: gonzo Date: Mon Dec 21 20:17:24 2015 New Revision: 292565 URL: https://svnweb.freebsd.org/changeset/base/292565 Log: Add CCM functions to enable HDMI framer and IPU units (video controller) Reviewed by: andrew, ian Differential Revision: https://reviews.freebsd.org/D4168 Modified: head/sys/arm/freescale/imx/imx6_ccm.c head/sys/arm/freescale/imx/imx6_ccmreg.h head/sys/arm/freescale/imx/imx_ccmvar.h Modified: head/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccm.c Mon Dec 21 20:14:40 2015 (r292564) +++ head/sys/arm/freescale/imx/imx6_ccm.c Mon Dec 21 20:17:24 2015 (r292565) @@ -348,6 +348,43 @@ imx_ccm_ahb_hz(void) return (132000000); } +void +imx_ccm_ipu_enable(int ipu) +{ + struct ccm_softc *sc; + uint32_t reg; + + sc = ccm_sc; + reg = RD4(sc, CCM_CCGR3); + if (ipu == 1) + reg |= CCGR3_IPU1_IPU | CCGR3_IPU1_DI0; + else + reg |= CCGR3_IPU2_IPU | CCGR3_IPU2_DI0; + WR4(sc, CCM_CCGR3, reg); +} + +void +imx_ccm_hdmi_enable(void) +{ + struct ccm_softc *sc; + uint32_t reg; + + sc = ccm_sc; + reg = RD4(sc, CCM_CCGR2); + reg |= CCGR2_HDMI_TX | CCGR2_HDMI_TX_ISFR; + WR4(sc, CCM_CCGR2, reg); + + /* Set HDMI clock to 280MHz */ + reg = RD4(sc, CCM_CHSCCDR); + reg &= ~(CHSCCDR_IPU1_DI0_PRE_CLK_SEL_MASK | + CHSCCDR_IPU1_DI0_PODF_MASK | CHSCCDR_IPU1_DI0_CLK_SEL_MASK); + reg |= (CHSCCDR_PODF_DIVIDE_BY_3 << CHSCCDR_IPU1_DI0_PODF_SHIFT); + reg |= (CHSCCDR_IPU_PRE_CLK_540M_PFD << CHSCCDR_IPU1_DI0_PRE_CLK_SEL_SHIFT); + WR4(sc, CCM_CHSCCDR, reg); + reg |= (CHSCCDR_CLK_SEL_LDB_DI0 << CHSCCDR_IPU1_DI0_CLK_SEL_SHIFT); + WR4(sc, CCM_CHSCCDR, reg); +} + uint32_t imx_ccm_get_cacrr(void) { Modified: head/sys/arm/freescale/imx/imx6_ccmreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccmreg.h Mon Dec 21 20:14:40 2015 (r292564) +++ head/sys/arm/freescale/imx/imx6_ccmreg.h Mon Dec 21 20:17:24 2015 (r292565) @@ -30,6 +30,9 @@ #define IMX6_CCMREG_H #define CCM_CACCR 0x010 +#define CCM_CBCDR 0x014 +#define CBCDR_MMDC_CH1_AXI_PODF_SHIFT 3 +#define CBCDR_MMDC_CH1_AXI_PODF_MASK (7 << 3) #define CCM_CSCMR1 0x01C #define SSI1_CLK_SEL_S 10 #define SSI2_CLK_SEL_S 12 @@ -39,6 +42,7 @@ #define SSI_CLK_SEL_454_PFD 1 #define SSI_CLK_SEL_PLL4 2 #define CCM_CSCMR2 0x020 +#define CSCMR2_LDB_DI0_IPU_DIV_SHIFT 10 #define CCM_CS1CDR 0x028 #define SSI1_CLK_PODF_SHIFT 0 #define SSI1_CLK_PRED_SHIFT 6 @@ -49,6 +53,18 @@ #define CCM_CS2CDR 0x02C #define SSI2_CLK_PODF_SHIFT 0 #define SSI2_CLK_PRED_SHIFT 6 +#define LDB_DI0_CLK_SEL_SHIFT 9 +#define LDB_DI0_CLK_SEL_MASK (3 << LDB_DI0_CLK_SEL_SHIFT) +#define CCM_CHSCCDR 0x034 +#define CHSCCDR_IPU1_DI0_PRE_CLK_SEL_MASK (0x7 << 6) +#define CHSCCDR_IPU1_DI0_PRE_CLK_SEL_SHIFT 6 +#define CHSCCDR_IPU1_DI0_PODF_MASK (0x7 << 3) +#define CHSCCDR_IPU1_DI0_PODF_SHIFT 3 +#define CHSCCDR_IPU1_DI0_CLK_SEL_MASK (0x7) +#define CHSCCDR_IPU1_DI0_CLK_SEL_SHIFT 0 +#define CHSCCDR_CLK_SEL_LDB_DI0 3 +#define CHSCCDR_PODF_DIVIDE_BY_3 2 +#define CHSCCDR_IPU_PRE_CLK_540M_PFD 5 #define CCM_CSCDR2 0x038 #define CCM_CLPCR 0x054 #define CCM_CLPCR_LPM_MASK 0x03 Modified: head/sys/arm/freescale/imx/imx_ccmvar.h ============================================================================== --- head/sys/arm/freescale/imx/imx_ccmvar.h Mon Dec 21 20:14:40 2015 (r292564) +++ head/sys/arm/freescale/imx/imx_ccmvar.h Mon Dec 21 20:17:24 2015 (r292565) @@ -52,6 +52,8 @@ uint32_t imx_ccm_ahb_hz(void); void imx_ccm_usb_enable(device_t _usbdev); void imx_ccm_usbphy_enable(device_t _phydev); void imx_ccm_ssi_configure(device_t _ssidev); +void imx_ccm_hdmi_enable(void); +void imx_ccm_ipu_enable(int ipu); /* Routines to get and set the arm clock root divisor register. */ uint32_t imx_ccm_get_cacrr(void); From owner-svn-src-all@freebsd.org Mon Dec 21 20:29:57 2015 Return-Path: Delivered-To: svn-src-all@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 25830A4FE86; Mon, 21 Dec 2015 20:29:57 +0000 (UTC) (envelope-from kp@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 DEACA1958; Mon, 21 Dec 2015 20:29:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBLKTtLN094007; Mon, 21 Dec 2015 20:29:55 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLKTtxZ094006; Mon, 21 Dec 2015 20:29:55 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201512212029.tBLKTtxZ094006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 21 Dec 2015 20:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292566 - stable/10/sys/netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 20:29:57 -0000 Author: kp Date: Mon Dec 21 20:29:55 2015 New Revision: 292566 URL: https://svnweb.freebsd.org/changeset/base/292566 Log: MFC r292219: inet6: Do not assume every interface has ip6 enabled. Certain interfaces (e.g. pfsync0) do not have ip6 addresses (in other words, ifp->if_afdata[AF_INET6] is NULL). Ensure we don't panic when the MTU is updated. pfsync interfaces will never have ip6 support, because it's explicitly disabled in in6_domifattach(). PR: 205194 Modified: stable/10/sys/netinet6/nd6.c Modified: stable/10/sys/netinet6/nd6.c ============================================================================== --- stable/10/sys/netinet6/nd6.c Mon Dec 21 20:17:24 2015 (r292565) +++ stable/10/sys/netinet6/nd6.c Mon Dec 21 20:29:55 2015 (r292566) @@ -227,6 +227,8 @@ nd6_ifdetach(struct nd_ifinfo *nd) void nd6_setmtu(struct ifnet *ifp) { + if (ifp->if_afdata[AF_INET6] == NULL) + return; nd6_setmtu0(ifp, ND_IFINFO(ifp)); } From owner-svn-src-all@freebsd.org Mon Dec 21 20:36:03 2015 Return-Path: Delivered-To: svn-src-all@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 1EDF6A4E1AB; Mon, 21 Dec 2015 20:36:03 +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 E423E1E07; Mon, 21 Dec 2015 20:36:02 +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 tBLKa2xf096853; Mon, 21 Dec 2015 20:36:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLKa14l096849; Mon, 21 Dec 2015 20:36:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512212036.tBLKa14l096849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 21 Dec 2015 20:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292567 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 20:36:03 -0000 Author: imp Date: Mon Dec 21 20:36:01 2015 New Revision: 292567 URL: https://svnweb.freebsd.org/changeset/base/292567 Log: Revert this change. It broke the trampoline build. Until I'm sure nothing else is broken, I'm reverting. Modified: head/sys/conf/Makefile.mips head/sys/conf/kern.mk head/sys/conf/kmod.mk Modified: head/sys/conf/Makefile.mips ============================================================================== --- head/sys/conf/Makefile.mips Mon Dec 21 20:29:55 2015 (r292566) +++ head/sys/conf/Makefile.mips Mon Dec 21 20:36:01 2015 (r292567) @@ -42,7 +42,7 @@ TRAMPLOADADDR?=0x807963c0 # We default to the MIPS32 ISA, if none specified in the # kernel configuration file. ARCH_FLAGS?=-march=mips32 -EXTRA_FLAGS=-DKERNLOADADDR=${KERNLOADADDR} +EXTRA_FLAGS=-fno-pic -mno-abicalls -G0 -DKERNLOADADDR=${KERNLOADADDR} HACK_EXTRA_FLAGS=-shared Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Mon Dec 21 20:29:55 2015 (r292566) +++ head/sys/conf/kern.mk Mon Dec 21 20:36:01 2015 (r292567) @@ -160,7 +160,6 @@ CFLAGS.gcc+= -mcall-aixdesc # For MIPS we also tell gcc to use floating point emulation # .if ${MACHINE_CPUARCH} == "mips" -CFLAGS+= -fno-pic -mno-abicalls -G0 CFLAGS+= -msoft-float INLINE_LIMIT?= 8000 .endif Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Mon Dec 21 20:29:55 2015 (r292566) +++ head/sys/conf/kmod.mk Mon Dec 21 20:36:01 2015 (r292567) @@ -130,7 +130,7 @@ CFLAGS+= -mlongcall -fno-omit-frame-poin .endif .if ${MACHINE_CPUARCH} == mips -CFLAGS+= -mlong-calls +CFLAGS+= -G0 -fno-pic -mno-abicalls -mlong-calls .endif .if defined(DEBUG) || defined(DEBUG_FLAGS) From owner-svn-src-all@freebsd.org Mon Dec 21 20:39:00 2015 Return-Path: Delivered-To: svn-src-all@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 04C72A4E279; Mon, 21 Dec 2015 20:39:00 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9C991FB0; Mon, 21 Dec 2015 20:38:59 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id 5D222B96E; Mon, 21 Dec 2015 15:38:58 -0500 (EST) From: John Baldwin To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292472 - in head/sys: amd64/amd64 sys Date: Mon, 21 Dec 2015 12:38:15 -0800 Message-ID: <1777356.pH0Cpe84Od@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201512191901.tBJJ1hEP013786@repo.freebsd.org> References: <201512191901.tBJJ1hEP013786@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.2.7 (bigwig.baldwin.cx); Mon, 21 Dec 2015 15:38:58 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 20:39:00 -0000 On Saturday, December 19, 2015 07:01:43 PM Warner Losh wrote: > Author: imp > Date: Sat Dec 19 19:01:43 2015 > New Revision: 292472 > URL: https://svnweb.freebsd.org/changeset/base/292472 > > Log: > Save the physical address passed into the kernel of the UEFI system > table. > > Modified: > head/sys/amd64/amd64/machdep.c > head/sys/sys/efi.h > > Modified: head/sys/amd64/amd64/machdep.c > ============================================================================== > --- head/sys/amd64/amd64/machdep.c Sat Dec 19 19:01:42 2015 (r292471) > +++ head/sys/amd64/amd64/machdep.c Sat Dec 19 19:01:43 2015 (r292472) > @@ -1615,6 +1622,8 @@ hammer_time(u_int64_t modulep, u_int64_t > /* > * Use vt(4) by default for UEFI boot (during the sc(4)/vt(4) > * transition). > + * Once bootblocks have updated, we can test directly for > + * efi_systbl != NULL here... > */ > if (preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP) > != NULL) This part doesn't seem worth changing since the EFI map is always going to be there and works for both old and new loaders? -- John Baldwin From owner-svn-src-all@freebsd.org Mon Dec 21 20:40:18 2015 Return-Path: Delivered-To: svn-src-all@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 D548BA4E337; Mon, 21 Dec 2015 20:40:18 +0000 (UTC) (envelope-from jhb@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 A675711A0; Mon, 21 Dec 2015 20:40:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBLKeHQ0097046; Mon, 21 Dec 2015 20:40:17 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLKeHHW097045; Mon, 21 Dec 2015 20:40:17 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512212040.tBLKeHHW097045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 21 Dec 2015 20:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292568 - stable/10/sys/dev/vmware/vmxnet3 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 20:40:18 -0000 Author: jhb Date: Mon Dec 21 20:40:17 2015 New Revision: 292568 URL: https://svnweb.freebsd.org/changeset/base/292568 Log: MFC 290948: Only use a power of 2 for the number of receive and transmit queues. Using other values causes VMXNET3_CMD_ENABLE to fail. The Linux driver also enforces this restriction. Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Mon Dec 21 20:36:01 2015 (r292567) +++ stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Mon Dec 21 20:40:17 2015 (r292568) @@ -511,6 +511,13 @@ vmxnet3_check_version(struct vmxnet3_sof return (0); } +static int +trunc_powerof2(int val) +{ + + return (1U << (fls(val) - 1)); +} + static void vmxnet3_initial_config(struct vmxnet3_softc *sc) { @@ -521,14 +528,14 @@ vmxnet3_initial_config(struct vmxnet3_so nqueue = VMXNET3_DEF_TX_QUEUES; if (nqueue > mp_ncpus) nqueue = mp_ncpus; - sc->vmx_max_ntxqueues = nqueue; + sc->vmx_max_ntxqueues = trunc_powerof2(nqueue); nqueue = vmxnet3_tunable_int(sc, "rxnqueue", vmxnet3_default_rxnqueue); if (nqueue > VMXNET3_MAX_RX_QUEUES || nqueue < 1) nqueue = VMXNET3_DEF_RX_QUEUES; if (nqueue > mp_ncpus) nqueue = mp_ncpus; - sc->vmx_max_nrxqueues = nqueue; + sc->vmx_max_nrxqueues = trunc_powerof2(nqueue); if (vmxnet3_tunable_int(sc, "mq_disable", vmxnet3_mq_disable)) { sc->vmx_max_nrxqueues = 1; From owner-svn-src-all@freebsd.org Mon Dec 21 20:57:29 2015 Return-Path: Delivered-To: svn-src-all@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 C6C69A4EA45; Mon, 21 Dec 2015 20:57:29 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp004.me.com (mr11p00im-asmtp004.me.com [17.110.69.135]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B49891DE3; Mon, 21 Dec 2015 20:57:29 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from [172.17.133.77] (dip-cali.panasas.com [64.80.217.3]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0NZQ00EJP7JMCF20@mr11p00im-asmtp004.me.com>; Mon, 21 Dec 2015 20:57:23 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-12-21_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1512210376 User-Agent: Microsoft-MacOutlook/0.0.0.151105 Date: Mon, 21 Dec 2015 12:57:22 -0800 Subject: Re: svn commit: r292528 - head/sys/x86/include From: Ravi Pokala Sender: "Pokala, Ravi" To: "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <9D7D1132-ED42-4F37-BEFD-AD62FB6321C7@panasas.com> Thread-topic: svn commit: r292528 - head/sys/x86/include References: <201512210442.tBL4gw6T007629@repo.freebsd.org> In-reply-to: <201512210442.tBL4gw6T007629@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 20:57:29 -0000 -----Original Message----- From: on behalf of "Conrad E. Meyer" Date: 2015-12-20, Sunday at 20:42 To: , , Subject: svn commit: r292528 - head/sys/x86/include >Author: cem >Date: Mon Dec 21 04:42:58 2015 >New Revision: 292528 >URL: https://svnweb.freebsd.org/changeset/base/292528 > >Log: > x86: Add CPUID_STDEXT_* macros for CPU feature bits > > A follow-up to r292478 and r292488. Hi Conrad, Between those two changes, you added recognition for CLWB, PCOMMIT, AVX512DQ, AVX512IFMA, AVX512BW, and AVX512VBMI; this change adds macros for the first five, but it looks like you forgot about AVX512VBMI. -Ravi (rpokala@) From owner-svn-src-all@freebsd.org Mon Dec 21 21:15:25 2015 Return-Path: Delivered-To: svn-src-all@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 3DB36A4F0C8; Mon, 21 Dec 2015 21:15:25 +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 EE89819F2; Mon, 21 Dec 2015 21:15:24 +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 tBLLFOLa008833; Mon, 21 Dec 2015 21:15:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLLFN7U008830; Mon, 21 Dec 2015 21:15:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512212115.tBLLFN7U008830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 21 Dec 2015 21:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292569 - head/tools/regression/mac/mac_portacl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 21:15:25 -0000 Author: ngie Date: Mon Dec 21 21:15:23 2015 New Revision: 292569 URL: https://svnweb.freebsd.org/changeset/base/292569 Log: Make the mac_portacl testcases work / more robust - A trap(1) call has been added to the test scripts to better ensure that the tests do a better job at trying to restore the test host state at the end of the tests (if the test was interrupted before it would leave the system in an odd state, potentially making the test results for subsequent runs non-deterministic). - Add root user checks - Fix nc(1) usage: -- -o is deprecated -- Using `-w 10` will make the call timeout after 10 seconds so it doesn't block indefinitely - Use local variables - Be more terse in the error messages - Parameterize out "127.0.0.1" MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/mac/mac_portacl/misc.sh head/tools/regression/mac/mac_portacl/nobody.t head/tools/regression/mac/mac_portacl/root.t Modified: head/tools/regression/mac/mac_portacl/misc.sh ============================================================================== --- head/tools/regression/mac/mac_portacl/misc.sh Mon Dec 21 20:40:17 2015 (r292568) +++ head/tools/regression/mac/mac_portacl/misc.sh Mon Dec 21 21:15:23 2015 (r292569) @@ -6,10 +6,18 @@ if [ $? -ne 0 ]; then echo "1..0 # SKIP MAC_PORTACL is unavailable." exit 0 fi +if [ $(id -u) -ne 0 ]; then + echo "1..0 # SKIP testcases must be run as root" + exit 0 +fi ntest=1 check_bind() { + local host idtype name proto port udpflag + + host="127.0.0.1" + idtype=${1} name=${2} proto=${3} @@ -17,10 +25,10 @@ check_bind() { [ "${proto}" = "udp" ] && udpflag="-u" - out=`( + out=$( case "${idtype}" in uid|gid) - ( echo -n | su -m ${name} -c "nc ${udpflag} -o -l 127.0.0.1 $port" 2>&1 ) & + ( echo -n | su -m ${name} -c "nc ${udpflag} -l -w 10 $host $port" 2>&1 ) & ;; jail) kill $$ @@ -29,9 +37,9 @@ check_bind() { kill $$ esac sleep 0.3 - echo | nc ${udpflag} -o 127.0.0.1 $port >/dev/null 2>&1 + echo | nc ${udpflag} -w 10 $host $port >/dev/null 2>&1 wait - )` + ) case "${out}" in "nc: Permission denied"*|"nc: Operation not permitted"*) echo fl @@ -46,6 +54,8 @@ check_bind() { } bind_test() { + local expect_without_rule expect_with_rule idtype name proto port + expect_without_rule=${1} expect_with_rule=${2} idtype=${3} @@ -54,40 +64,40 @@ bind_test() { port=${6} sysctl security.mac.portacl.rules= >/dev/null - out=`check_bind ${idtype} ${name} ${proto} ${port}` + out=$(check_bind ${idtype} ${name} ${proto} ${port}) if [ "${out}" = "${expect_without_rule}" ]; then echo "ok ${ntest}" elif [ "${out}" = "ok" -o "${out}" = "fl" ]; then - echo "not ok ${ntest}" + echo "not ok ${ntest} # '${out}' != '${expect_without_rule}'" else - echo "not ok ${ntest} # ${out}" + echo "not ok ${ntest} # unexpected output: '${out}'" fi - ntest=$((ntest+1)) + : $(( ntest += 1 )) if [ "${idtype}" = "uid" ]; then - idstr=`id -u ${name}` + idstr=$(id -u ${name}) elif [ "${idtype}" = "gid" ]; then - idstr=`id -g ${name}` + idstr=$(id -g ${name}) else idstr=${name} fi sysctl security.mac.portacl.rules=${idtype}:${idstr}:${proto}:${port} >/dev/null - out=`check_bind ${idtype} ${name} ${proto} ${port}` + out=$(check_bind ${idtype} ${name} ${proto} ${port}) if [ "${out}" = "${expect_with_rule}" ]; then echo "ok ${ntest}" elif [ "${out}" = "ok" -o "${out}" = "fl" ]; then - echo "not ok ${ntest}" + echo "not ok ${ntest} # '${out}' != '${expect_with_rule}'" else - echo "not ok ${ntest} # ${out}" + echo "not ok ${ntest} # unexpected output: '${out}'" fi - ntest=$((ntest+1)) + : $(( ntest += 1 )) sysctl security.mac.portacl.rules= >/dev/null } -reserved_high=`sysctl -n net.inet.ip.portrange.reservedhigh` -suser_exempt=`sysctl -n security.mac.portacl.suser_exempt` -port_high=`sysctl -n security.mac.portacl.port_high` +reserved_high=$(sysctl -n net.inet.ip.portrange.reservedhigh) +suser_exempt=$(sysctl -n security.mac.portacl.suser_exempt) +port_high=$(sysctl -n security.mac.portacl.port_high) restore_settings() { sysctl -n net.inet.ip.portrange.reservedhigh=${reserved_high} >/dev/null Modified: head/tools/regression/mac/mac_portacl/nobody.t ============================================================================== --- head/tools/regression/mac/mac_portacl/nobody.t Mon Dec 21 20:40:17 2015 (r292568) +++ head/tools/regression/mac/mac_portacl/nobody.t Mon Dec 21 21:15:23 2015 (r292569) @@ -10,6 +10,8 @@ echo "1..64" # behaviour. # mac_portacl has no impact on ports <= net.inet.ip.portrange.reservedhigh. +trap restore_settings EXIT INT TERM + sysctl security.mac.portacl.suser_exempt=1 >/dev/null sysctl net.inet.ip.portrange.reservedhigh=78 >/dev/null @@ -63,5 +65,3 @@ bind_test fl ok gid nobody tcp 77 bind_test ok ok gid nobody tcp 7777 bind_test fl ok gid nobody udp 77 bind_test ok ok gid nobody udp 7777 - -restore_settings Modified: head/tools/regression/mac/mac_portacl/root.t ============================================================================== --- head/tools/regression/mac/mac_portacl/root.t Mon Dec 21 20:40:17 2015 (r292568) +++ head/tools/regression/mac/mac_portacl/root.t Mon Dec 21 21:15:23 2015 (r292569) @@ -8,6 +8,8 @@ echo "1..48" # Verify if security.mac.portacl.suser_exempt=1 really exempts super-user. +trap restore_settings EXIT INT TERM + sysctl security.mac.portacl.suser_exempt=1 >/dev/null bind_test ok ok uid root tcp 77 @@ -47,5 +49,3 @@ bind_test fl ok gid root tcp 77 bind_test fl ok gid root tcp 7777 bind_test fl ok gid root udp 77 bind_test fl ok gid root udp 7777 - -restore_settings From owner-svn-src-all@freebsd.org Mon Dec 21 21:24:06 2015 Return-Path: Delivered-To: svn-src-all@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 DFCBEA4F320; Mon, 21 Dec 2015 21:24:05 +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 8CC741E47; Mon, 21 Dec 2015 21:24:05 +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 tBLLO4wq011727; Mon, 21 Dec 2015 21:24:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLLO3l8011715; Mon, 21 Dec 2015 21:24:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512212124.tBLLO3l8011715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 21 Dec 2015 21:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292570 - in head: etc/mtree tests/sys tests/sys/mac tests/sys/mac/bsdextended tests/sys/mac/portacl tools/regression/mac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 21:24:06 -0000 Author: ngie Date: Mon Dec 21 21:24:03 2015 New Revision: 292570 URL: https://svnweb.freebsd.org/changeset/base/292570 Log: Integrate tools/regression/mac/mac_bsdextended and tools/regression/mac/mac_portacl into the FreeBSD test suite as tests/sys/mac/bsdextended and tests/sys/mac/portacl, respectively MFC after: 1 month Sponsored by: EMC / Isilon Storage Division Added: head/tests/sys/mac/ head/tests/sys/mac/Makefile (contents, props changed) head/tests/sys/mac/bsdextended/ head/tests/sys/mac/bsdextended/Makefile (contents, props changed) head/tests/sys/mac/bsdextended/matches_test.sh - copied unchanged from r292569, head/tools/regression/mac/mac_bsdextended/test_matches.sh head/tests/sys/mac/bsdextended/ugidfw_test.c - copied unchanged from r292569, head/tools/regression/mac/mac_bsdextended/test_ugidfw.c head/tests/sys/mac/portacl/ head/tests/sys/mac/portacl/LICENSE - copied unchanged from r292569, head/tools/regression/mac/mac_portacl/LICENSE head/tests/sys/mac/portacl/Makefile (contents, props changed) head/tests/sys/mac/portacl/misc.sh - copied unchanged from r292569, head/tools/regression/mac/mac_portacl/misc.sh head/tests/sys/mac/portacl/nobody_test.sh - copied unchanged from r292569, head/tools/regression/mac/mac_portacl/nobody.t head/tests/sys/mac/portacl/root_test.sh - copied unchanged from r292569, head/tools/regression/mac/mac_portacl/root.t Deleted: head/tools/regression/mac/ Modified: head/etc/mtree/BSD.tests.dist head/tests/sys/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Dec 21 21:15:23 2015 (r292569) +++ head/etc/mtree/BSD.tests.dist Mon Dec 21 21:24:03 2015 (r292570) @@ -386,6 +386,12 @@ .. kqueue .. + mac + bsdextended + .. + portacl + .. + .. mqueue .. netinet Modified: head/tests/sys/Makefile ============================================================================== --- head/tests/sys/Makefile Mon Dec 21 21:15:23 2015 (r292569) +++ head/tests/sys/Makefile Mon Dec 21 21:24:03 2015 (r292570) @@ -10,6 +10,7 @@ TESTS_SUBDIRS+= fifo TESTS_SUBDIRS+= file TESTS_SUBDIRS+= kern TESTS_SUBDIRS+= kqueue +TESTS_SUBDIRS+= mac TESTS_SUBDIRS+= mqueue TESTS_SUBDIRS+= netinet TESTS_SUBDIRS+= opencrypto Added: head/tests/sys/mac/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/mac/Makefile Mon Dec 21 21:24:03 2015 (r292570) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sys/mac + +TESTS_SUBDIRS+= bsdextended +TESTS_SUBDIRS+= portacl + +.include Added: head/tests/sys/mac/bsdextended/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/mac/bsdextended/Makefile Mon Dec 21 21:24:03 2015 (r292570) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sys/mac/bsdextended + +TAP_TESTS_C+= ugidfw_test +TAP_TESTS_SH+= matches_test + +LIBADD.ugidfw_test+= ugidfw + +TEST_METADATA.matches_test+= required_user="root" +TEST_METADATA.ugidfw_test+= required_user="root" + +.include Copied: head/tests/sys/mac/bsdextended/matches_test.sh (from r292569, head/tools/regression/mac/mac_bsdextended/test_matches.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/mac/bsdextended/matches_test.sh Mon Dec 21 21:24:03 2015 (r292570, copy of r292569, head/tools/regression/mac/mac_bsdextended/test_matches.sh) @@ -0,0 +1,353 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +uidrange="60000:100000" +gidrange="60000:100000" +uidinrange="nobody" +uidoutrange="daemon" +gidinrange="nobody" # We expect $uidinrange in this group +gidoutrange="daemon" # We expect $uidinrange in this group + +test_num=1 +pass() +{ + echo "ok $test_num # $@" + : $(( test_num += 1 )) +} + +fail() +{ + echo "not ok $test_num # $@" + : $(( test_num += 1 )) +} + +# +# Setup +# + +: ${TMPDIR=/tmp} +if [ $(id -u) -ne 0 ]; then + echo "1..0 # SKIP test must be run as root" + exit 0 +fi +if ! sysctl -N security.mac.bsdextended >/dev/null 2>&1; then + echo "1..0 # SKIP mac_bsdextended(4) support isn't available" + exit 0 +fi +if ! playground=$(mktemp -d $TMPDIR/tmp.XXXXXXX); then + echo "1..0 # SKIP failed to create temporary directory" + exit 0 +fi +trap "rmdir $playground" EXIT INT TERM +if ! mdmfs -s 25m md $playground; then + echo "1..0 # SKIP failed to mount md device" + exit 0 +fi +chmod a+rwx $playground +md_device=$(mount -p | grep "$playground" | awk '{ gsub(/^\/dev\//, "", $1); print $1 }') +trap "umount -f $playground; mdconfig -d -u $md_device; rmdir $playground" EXIT INT TERM +if [ -z "$md_device" ]; then + mount -p | grep $playground + echo "1..0 # SKIP md device not properly attached to the system" +fi + +ugidfw remove 1 + +file1=$playground/test-$uidinrange +file2=$playground/test-$uidoutrange +cat > $playground/test-script.sh <<'EOF' +#!/bin/sh +: > $1 +EOF +if [ $? -ne 0 ]; then + echo "1..0 # SKIP failed to create test script" + exit 0 +fi +echo "1..30" + +command1="sh $playground/test-script.sh $file1" +command2="sh $playground/test-script.sh $file2" + +desc="$uidinrange file" +if su -m $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + +chown "$uidinrange":"$gidinrange" $file1 +chmod a+w $file1 + +desc="$uidoutrange file" +if $command2; then + pass $desc +else + fail $desc +fi + +chown "$uidoutrange":"$gidoutrange" $file2 +chmod a+w $file2 + +# +# No rules +# +desc="no rules $uidinrange" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + +desc="no rules $uidoutrange" +if su -fm $uidoutrange -c "$command1"; then + pass $desc +else + fail $desc +fi + +# +# Subject Match on uid +# +ugidfw set 1 subject uid $uidrange object mode rasx +desc="subject uid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="subject uid out range" +if su -fm $uidoutrange -c "$command1"; then + pass $desc +else + fail $desc +fi + +# +# Subject Match on gid +# +ugidfw set 1 subject gid $gidrange object mode rasx + +desc="subject gid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="subject gid out range" +if su -fm $uidoutrange -c "$command1"; then + pass $desc +else + fail $desc +fi + +# +# Subject Match on jail +# +rm -f $playground/test-jail + +desc="subject matching jailid" +jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` +ugidfw set 1 subject jailid $jailid object mode rasx +sleep 10 + +if [ -f $playground/test-jail ]; then + fail "TODO $desc: this testcase fails (see bug # 205481)" +else + pass $desc +fi + +rm -f $playground/test-jail +desc="subject nonmatching jailid" +jailid=`jail -i / localhost 127.0.0.1 /usr/sbin/daemon -f /bin/sh -c "(sleep 5; touch $playground/test-jail) &"` +sleep 10 +if [ -f $playground/test-jail ]; then + pass $desc +else + fail $desc +fi + +# +# Object uid +# +ugidfw set 1 subject object uid $uidrange mode rasx + +desc="object uid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object uid out range" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi +ugidfw set 1 subject object uid $uidrange mode rasx + +desc="object uid in range (different subject)" +if su -fm $uidoutrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object uid out range (different subject)" +if su -fm $uidoutrange -c "$command2"; then + pass $desc +else + fail $desc +fi + +# +# Object gid +# +ugidfw set 1 subject object gid $uidrange mode rasx + +desc="object gid in range" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object gid out range" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi +desc="object gid in range (different subject)" +if su -fm $uidoutrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +desc="object gid out range (different subject)" +if su -fm $uidoutrange -c "$command2"; then + pass $desc +else + fail $desc +fi + +# +# Object filesys +# +ugidfw set 1 subject uid $uidrange object filesys / mode rasx +desc="object out of filesys" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + +ugidfw set 1 subject uid $uidrange object filesys $playground mode rasx +desc="object in filesys" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +# +# Object suid +# +ugidfw set 1 subject uid $uidrange object suid mode rasx +desc="object notsuid" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + +chmod u+s $file1 +desc="object suid" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi +chmod u-s $file1 + +# +# Object sgid +# +ugidfw set 1 subject uid $uidrange object sgid mode rasx +desc="object notsgid" +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + +chmod g+s $file1 +desc="object sgid" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi +chmod g-s $file1 + +# +# Object uid matches subject +# +ugidfw set 1 subject uid $uidrange object uid_of_subject mode rasx + +desc="object uid notmatches subject" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi + +desc="object uid matches subject" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +# +# Object gid matches subject +# +ugidfw set 1 subject uid $uidrange object gid_of_subject mode rasx + +desc="object gid notmatches subject" +if su -fm $uidinrange -c "$command2"; then + pass $desc +else + fail $desc +fi + +desc="object gid matches subject" +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi + +# +# Object type +# +desc="object not type" +ugidfw set 1 subject uid $uidrange object type dbclsp mode rasx +if su -fm $uidinrange -c "$command1"; then + pass $desc +else + fail $desc +fi + +desc="object type" +ugidfw set 1 subject uid $uidrange object type r mode rasx +if su -fm $uidinrange -c "$command1"; then + fail $desc +else + pass $desc +fi Copied: head/tests/sys/mac/bsdextended/ugidfw_test.c (from r292569, head/tools/regression/mac/mac_bsdextended/test_ugidfw.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/mac/bsdextended/ugidfw_test.c Mon Dec 21 21:24:03 2015 (r292570, copy of r292569, head/tools/regression/mac/mac_bsdextended/test_ugidfw.c) @@ -0,0 +1,257 @@ +/*- + * Copyright (c) 2005 McAfee, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Starting point for a regression test for mac_bsdextended(4) and the + * supporting libugidfw(3). + */ + +/* + * This section of the regression test passes some test cases through the + * rule<->string routines to confirm they work approximately as desired. + */ + +/* + * List of users and groups we must check exists before we can begin, since + * they are used in the string test rules. We use users and groups that will + * always exist in a default install used for regression testing. + */ +static const char *test_users[] = { + "root", + "daemon", + "operator", + "bin", +}; + +static const char *test_groups[] = { + "wheel", + "daemon", + "operator", + "bin", +}; + +int test_num; + +/* + * List of test strings that must go in (and come out) of libugidfw intact. + */ +static const char *test_strings[] = { + /* Variations on subject and object uids. */ + "subject uid root object uid root mode n", + "subject uid root object uid daemon mode n", + "subject uid daemon object uid root mode n", + "subject uid daemon object uid daemon mode n", + /* Variations on mode. */ + "subject uid root object uid root mode a", + "subject uid root object uid root mode r", + "subject uid root object uid root mode s", + "subject uid root object uid root mode w", + "subject uid root object uid root mode x", + "subject uid root object uid root mode arswx", + /* Variations on subject and object gids. */ + "subject gid wheel object gid wheel mode n", + "subject gid wheel object gid daemon mode n", + "subject gid daemon object gid wheel mode n", + "subject gid daemon object gid daemon mode n", + /* Subject uids and subject gids. */ + "subject uid bin gid daemon object uid operator gid wheel mode n", + /* Not */ + "subject not uid operator object uid bin mode n", + "subject uid bin object not uid operator mode n", + "subject not uid daemon object not uid operator mode n", + /* Ranges */ + "subject uid root:operator object gid wheel:bin mode n", + /* Jail ID */ + "subject jailid 1 object uid root mode n", + /* Filesys */ + "subject uid root object filesys / mode n", + "subject uid root object filesys /dev mode n", + /* S/UGID */ + "subject not uid root object sgid mode n", + "subject not uid root object sgid mode n", + /* Matching uid/gid */ + "subject not uid root:operator object not uid_of_subject mode n", + "subject not gid wheel:bin object not gid_of_subject mode n", + /* Object types */ + "subject uid root object type a mode a", + "subject uid root object type r mode a", + "subject uid root object type d mode a", + "subject uid root object type b mode a", + "subject uid root object type c mode a", + "subject uid root object type l mode a", + "subject uid root object type s mode a", + "subject uid root object type rbc mode a", + "subject uid root object type dls mode a", + /* Empty rules always match */ + "subject object mode a", + /* Partial negations */ + "subject ! uid root object mode n", + "subject ! gid wheel object mode n", + "subject ! jailid 2 object mode n", + "subject object ! uid root mode n", + "subject object ! gid wheel mode n", + "subject object ! filesys / mode n", + "subject object ! suid mode n", + "subject object ! sgid mode n", + "subject object ! uid_of_subject mode n", + "subject object ! gid_of_subject mode n", + "subject object ! type d mode n", + /* All out nonsense */ + "subject uid root ! gid wheel:bin ! jailid 1 " + "object ! uid root:daemon gid daemon filesys / suid sgid uid_of_subject gid_of_subject ! type r " + "mode rsx", +}; + +static void +test_libugidfw_strings(void) +{ + struct mac_bsdextended_rule rule; + char errorstr[256]; + char rulestr[256]; + int error, i; + + for (i = 0; i < nitems(test_users); i++, test_num++) { + if (getpwnam(test_users[i]) == NULL) + printf("not ok %d # test_libugidfw_strings: getpwnam(%s) " + "failed: %s\n", test_num, test_users[i], strerror(errno)); + else + printf("ok %d\n", test_num); + } + + for (i = 0; i < nitems(test_groups); i++, test_num++) { + if (getgrnam(test_groups[i]) == NULL) + printf("not ok %d # test_libugidfw_strings: getgrnam(%s) " + "failed: %s\n", test_num, test_groups[i], strerror(errno)); + else + printf("ok %d\n", test_num); + } + + for (i = 0; i < nitems(test_strings); i++) { + error = bsde_parse_rule_string(test_strings[i], &rule, + sizeof(errorstr), errorstr); + if (error == -1) + printf("not ok %d # bsde_parse_rule_string: '%s' (%d) " + "failed: %s\n", test_num, test_strings[i], i, errorstr); + else + printf("ok %d\n", test_num); + test_num++; + + error = bsde_rule_to_string(&rule, rulestr, sizeof(rulestr)); + if (error < 0) + printf("not ok %d # bsde_rule_to_string: rule for '%s' " + "returned %d\n", test_num, test_strings[i], error); + else + printf("ok %d\n", test_num); + test_num++; + + if (strcmp(test_strings[i], rulestr) != 0) + printf("not ok %d # test_libugidfw: '%s' in, '%s' " + "out\n", test_num, test_strings[i], rulestr); + else + printf("ok %d\n", test_num); + test_num++; + } +} + +int +main(void) +{ + char errorstr[256]; + int count, slots; + + test_num = 1; + + /* Print an error if a non-root user attemps to run the tests. */ + if (getuid() != 0) { + printf("1..0 # SKIP you must be root\n"); + return (0); + } + + printf("1..%lu\n", nitems(test_users) + nitems(test_groups) + + 3 * nitems(test_strings) + 2); + + /* + * We can test some parts of the library without the MAC Framework + * and policy loaded, so run those tests before calling + * mac_is_present(). + */ + test_libugidfw_strings(); + + switch (mac_is_present("bsdextended")) { + case -1: + printf("1..0 # SKIP mac_is_present failed: %s\n", + strerror(errno)); + return (0); + case 1: + break; + case 0: + default: + printf("1..0 # SKIP mac_bsdextended not loaded\n"); + return (0); + } + + /* + * Some simple up-front checks to see if we're able to query the + * policy for basic state. We want the rule count to be 0 before + * starting, but "slots" is a property of prior runs and so we ignore + * the return value. + */ + count = bsde_get_rule_count(sizeof(errorstr), errorstr); + if (count == -1) + printf("not ok %d # bsde_get_rule_count: %s\n", test_num, + errorstr); + else + printf("ok %d\n", test_num); + + test_num++; + + slots = bsde_get_rule_slots(sizeof(errorstr), errorstr); + if (slots == -1) + printf("not ok %d # bsde_get_rule_slots: %s\n", test_num, + errorstr); + else + printf("ok %d\n", test_num); + + return (0); +} Copied: head/tests/sys/mac/portacl/LICENSE (from r292569, head/tools/regression/mac/mac_portacl/LICENSE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/mac/portacl/LICENSE Mon Dec 21 21:24:03 2015 (r292570, copy of r292569, head/tools/regression/mac/mac_portacl/LICENSE) @@ -0,0 +1,27 @@ +$FreeBSD$ + +License for all mac_portacl regression tests: + +Copyright (c) 2009 Pawel Jakub Dawidek +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 AUTHORS 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 AUTHORS 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. Added: head/tests/sys/mac/portacl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/mac/portacl/Makefile Mon Dec 21 21:24:03 2015 (r292570) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/sys/mac/portacl +BINDIR= ${TESTSDIR} + +FILES+= misc.sh + +TAP_TESTS_SH+= nobody_test +TAP_TESTS_SH+= root_test + +.for t in ${TAP_TESTS_SH} +TEST_METADATA.$t+= required_user="root" +TEST_METADATA.$t+= timeout="450" +.endfor + +.include Copied: head/tests/sys/mac/portacl/misc.sh (from r292569, head/tools/regression/mac/mac_portacl/misc.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/mac/portacl/misc.sh Mon Dec 21 21:24:03 2015 (r292570, copy of r292569, head/tools/regression/mac/mac_portacl/misc.sh) @@ -0,0 +1,106 @@ +#!/bin/sh +# $FreeBSD$ + +sysctl security.mac.portacl >/dev/null 2>&1 +if [ $? -ne 0 ]; then + echo "1..0 # SKIP MAC_PORTACL is unavailable." + exit 0 +fi +if [ $(id -u) -ne 0 ]; then + echo "1..0 # SKIP testcases must be run as root" + exit 0 +fi + +ntest=1 + +check_bind() { + local host idtype name proto port udpflag + + host="127.0.0.1" + + idtype=${1} + name=${2} + proto=${3} + port=${4} + + [ "${proto}" = "udp" ] && udpflag="-u" + + out=$( + case "${idtype}" in + uid|gid) + ( echo -n | su -m ${name} -c "nc ${udpflag} -l -w 10 $host $port" 2>&1 ) & + ;; + jail) + kill $$ + ;; + *) + kill $$ + esac + sleep 0.3 + echo | nc ${udpflag} -w 10 $host $port >/dev/null 2>&1 + wait + ) + case "${out}" in + "nc: Permission denied"*|"nc: Operation not permitted"*) + echo fl + ;; + "") + echo ok + ;; + *) + echo ${out} + ;; + esac +} + +bind_test() { + local expect_without_rule expect_with_rule idtype name proto port + + expect_without_rule=${1} + expect_with_rule=${2} + idtype=${3} + name=${4} + proto=${5} + port=${6} + + sysctl security.mac.portacl.rules= >/dev/null + out=$(check_bind ${idtype} ${name} ${proto} ${port}) + if [ "${out}" = "${expect_without_rule}" ]; then + echo "ok ${ntest}" + elif [ "${out}" = "ok" -o "${out}" = "fl" ]; then + echo "not ok ${ntest} # '${out}' != '${expect_without_rule}'" + else + echo "not ok ${ntest} # unexpected output: '${out}'" + fi + : $(( ntest += 1 )) + + if [ "${idtype}" = "uid" ]; then + idstr=$(id -u ${name}) + elif [ "${idtype}" = "gid" ]; then + idstr=$(id -g ${name}) + else + idstr=${name} + fi + sysctl security.mac.portacl.rules=${idtype}:${idstr}:${proto}:${port} >/dev/null + out=$(check_bind ${idtype} ${name} ${proto} ${port}) + if [ "${out}" = "${expect_with_rule}" ]; then + echo "ok ${ntest}" + elif [ "${out}" = "ok" -o "${out}" = "fl" ]; then + echo "not ok ${ntest} # '${out}' != '${expect_with_rule}'" + else + echo "not ok ${ntest} # unexpected output: '${out}'" + fi + : $(( ntest += 1 )) + + sysctl security.mac.portacl.rules= >/dev/null +} + +reserved_high=$(sysctl -n net.inet.ip.portrange.reservedhigh) +suser_exempt=$(sysctl -n security.mac.portacl.suser_exempt) +port_high=$(sysctl -n security.mac.portacl.port_high) + +restore_settings() { + sysctl -n net.inet.ip.portrange.reservedhigh=${reserved_high} >/dev/null + sysctl -n security.mac.portacl.suser_exempt=${suser_exempt} >/dev/null + sysctl -n security.mac.portacl.port_high=${port_high} >/dev/null +} Copied: head/tests/sys/mac/portacl/nobody_test.sh (from r292569, head/tools/regression/mac/mac_portacl/nobody.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/mac/portacl/nobody_test.sh Mon Dec 21 21:24:03 2015 (r292570, copy of r292569, head/tools/regression/mac/mac_portacl/nobody.t) @@ -0,0 +1,67 @@ +#!/bin/sh +# $FreeBSD$ + +dir=`dirname $0` +. ${dir}/misc.sh + +echo "1..64" + +# security.mac.portacl.suser_exempt value doesn't affect unprivileged users +# behaviour. +# mac_portacl has no impact on ports <= net.inet.ip.portrange.reservedhigh. + +trap restore_settings EXIT INT TERM + +sysctl security.mac.portacl.suser_exempt=1 >/dev/null +sysctl net.inet.ip.portrange.reservedhigh=78 >/dev/null + +bind_test fl fl uid nobody tcp 77 +bind_test ok ok uid nobody tcp 7777 +bind_test fl fl uid nobody udp 77 +bind_test ok ok uid nobody udp 7777 + +bind_test fl fl gid nobody tcp 77 +bind_test ok ok gid nobody tcp 7777 +bind_test fl fl gid nobody udp 77 +bind_test ok ok gid nobody udp 7777 + +sysctl security.mac.portacl.suser_exempt=0 >/dev/null + +bind_test fl fl uid nobody tcp 77 +bind_test ok ok uid nobody tcp 7777 +bind_test fl fl uid nobody udp 77 +bind_test ok ok uid nobody udp 7777 + +bind_test fl fl gid nobody tcp 77 +bind_test ok ok gid nobody tcp 7777 +bind_test fl fl gid nobody udp 77 +bind_test ok ok gid nobody udp 7777 + +# Verify if security.mac.portacl.port_high works. + +sysctl security.mac.portacl.port_high=7778 >/dev/null + +bind_test fl fl uid nobody tcp 77 +bind_test fl ok uid nobody tcp 7777 +bind_test fl fl uid nobody udp 77 +bind_test fl ok uid nobody udp 7777 + +bind_test fl fl gid nobody tcp 77 +bind_test fl ok gid nobody tcp 7777 +bind_test fl fl gid nobody udp 77 +bind_test fl ok gid nobody udp 7777 + +# Verify if mac_portacl rules work. + +sysctl net.inet.ip.portrange.reservedhigh=76 >/dev/null +sysctl security.mac.portacl.port_high=7776 >/dev/null + +bind_test fl ok uid nobody tcp 77 +bind_test ok ok uid nobody tcp 7777 +bind_test fl ok uid nobody udp 77 +bind_test ok ok uid nobody udp 7777 + +bind_test fl ok gid nobody tcp 77 +bind_test ok ok gid nobody tcp 7777 +bind_test fl ok gid nobody udp 77 +bind_test ok ok gid nobody udp 7777 Copied: head/tests/sys/mac/portacl/root_test.sh (from r292569, head/tools/regression/mac/mac_portacl/root.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/mac/portacl/root_test.sh Mon Dec 21 21:24:03 2015 (r292570, copy of r292569, head/tools/regression/mac/mac_portacl/root.t) @@ -0,0 +1,51 @@ +#!/bin/sh +# $FreeBSD$ + +dir=`dirname $0` +. ${dir}/misc.sh + +echo "1..48" + +# Verify if security.mac.portacl.suser_exempt=1 really exempts super-user. + +trap restore_settings EXIT INT TERM + +sysctl security.mac.portacl.suser_exempt=1 >/dev/null + +bind_test ok ok uid root tcp 77 +bind_test ok ok uid root tcp 7777 +bind_test ok ok uid root udp 77 +bind_test ok ok uid root udp 7777 + +bind_test ok ok gid root tcp 77 +bind_test ok ok gid root tcp 7777 +bind_test ok ok gid root udp 77 +bind_test ok ok gid root udp 7777 + +# Verify if security.mac.portacl.suser_exempt=0 really doesn't exempt super-user. + +sysctl security.mac.portacl.suser_exempt=0 >/dev/null + +bind_test fl ok uid root tcp 77 +bind_test ok ok uid root tcp 7777 +bind_test fl ok uid root udp 77 +bind_test ok ok uid root udp 7777 + +bind_test fl ok gid root tcp 77 +bind_test ok ok gid root tcp 7777 +bind_test fl ok gid root udp 77 +bind_test ok ok gid root udp 7777 + +# Verify if security.mac.portacl.port_high works for super-user. + +sysctl security.mac.portacl.port_high=7778 >/dev/null + +bind_test fl ok uid root tcp 77 +bind_test fl ok uid root tcp 7777 +bind_test fl ok uid root udp 77 +bind_test fl ok uid root udp 7777 + +bind_test fl ok gid root tcp 77 +bind_test fl ok gid root tcp 7777 +bind_test fl ok gid root udp 77 +bind_test fl ok gid root udp 7777 From owner-svn-src-all@freebsd.org Mon Dec 21 21:24:13 2015 Return-Path: Delivered-To: svn-src-all@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 4CE06A4F340; Mon, 21 Dec 2015 21:24:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C6F621F26; Mon, 21 Dec 2015 21:24:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.15.2/8.15.2) with ESMTPS id tBLLO9j6092737 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 22 Dec 2015 00:24:09 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.15.2/8.15.2/Submit) id tBLLO9IQ092736; Tue, 22 Dec 2015 00:24:09 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 22 Dec 2015 00:24:09 +0300 From: Gleb Smirnoff To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292460 - head/sys/powerpc/pseries Message-ID: <20151221212409.GB92531@FreeBSD.org> References: <201512190216.tBJ2Gclo017183@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201512190216.tBJ2Gclo017183@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 21:24:13 -0000 Nathan, On Sat, Dec 19, 2015 at 02:16:38AM +0000, Nathan Whitehorn wrote: N> Author: nwhitehorn N> Date: Sat Dec 19 02:16:38 2015 N> New Revision: 292460 N> URL: https://svnweb.freebsd.org/changeset/base/292460 N> N> Log: N> Provide link state reporting so that ifconfig_llan0="DHCP" works. The N> reported link state is fictional (always up) since the hypervisor does N> not provide this information. N> N> MFC after: 1 week Does dhclient require working ifmedia, or only the link state? For the latter rolling over a fake ifmedia support isn't required. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Mon Dec 21 21:35:02 2015 Return-Path: Delivered-To: svn-src-all@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 68A27A4F74F; Mon, 21 Dec 2015 21:35:02 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57B80182B; Mon, 21 Dec 2015 21:35:02 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net ([32.210.31.157]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id tBLLYrFR015452 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 21 Dec 2015 13:34:54 -0800 Subject: Re: svn commit: r292460 - head/sys/powerpc/pseries To: Gleb Smirnoff References: <201512190216.tBJ2Gclo017183@repo.freebsd.org> <20151221212409.GB92531@FreeBSD.org> Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Nathan Whitehorn Message-ID: <5678707D.3060905@freebsd.org> Date: Mon, 21 Dec 2015 13:34:53 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151221212409.GB92531@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVZXGcMF9m5H03lgV7ooM4vws3savx8aCXflZLb0KO7NC0D7w4piQCFXdXlUDcCHNuU0qe0Cn4FKBdelxvV07/erlSXlTgvn7xI= X-Sonic-ID: C;OsJMrCqo5RGwfcgxU3XIUw== M;DgjTrCqo5RGwfcgxU3XIUw== X-Spam-Flag: No X-Sonic-Spam-Details: 3.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 21:35:02 -0000 On 12/21/15 13:24, Gleb Smirnoff wrote: > Nathan, > > On Sat, Dec 19, 2015 at 02:16:38AM +0000, Nathan Whitehorn wrote: > N> Author: nwhitehorn > N> Date: Sat Dec 19 02:16:38 2015 > N> New Revision: 292460 > N> URL: https://svnweb.freebsd.org/changeset/base/292460 > N> > N> Log: > N> Provide link state reporting so that ifconfig_llan0="DHCP" works. The > N> reported link state is fictional (always up) since the hypervisor does > N> not provide this information. > N> > N> MFC after: 1 week > > Does dhclient require working ifmedia, or only the link state? For the > latter rolling over a fake ifmedia support isn't required. > It needed a reply to SIOCGIFMEDIA. I'm not sure which part of that was required, but a fake ifmedia made it easy. -Nathan From owner-svn-src-all@freebsd.org Mon Dec 21 21:40:17 2015 Return-Path: Delivered-To: svn-src-all@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 5EA89A4F840; Mon, 21 Dec 2015 21:40:17 +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 215A01A3B; Mon, 21 Dec 2015 21:40:17 +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 tBLLeGb6014736; Mon, 21 Dec 2015 21:40:16 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLLeGxF014731; Mon, 21 Dec 2015 21:40:16 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201512212140.tBLLeGxF014731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 21 Dec 2015 21:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292571 - in head/sys/arm: conf freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 21:40:17 -0000 Author: gonzo Date: Mon Dec 21 21:40:15 2015 New Revision: 292571 URL: https://svnweb.freebsd.org/changeset/base/292571 Log: - Add driver for i.MX 6 HDMI framer - Enable HDMI driver in IMX6 config Reviewed by: andrew, ian, mmel Differential Revision: https://reviews.freebsd.org/D4174 Added: head/sys/arm/freescale/imx/imx6_hdmi.c (contents, props changed) head/sys/arm/freescale/imx/imx6_hdmireg.h (contents, props changed) head/sys/arm/freescale/imx/imx_iomuxreg.h (contents, props changed) Modified: head/sys/arm/conf/IMX6 head/sys/arm/freescale/imx/files.imx6 Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Mon Dec 21 21:24:03 2015 (r292570) +++ head/sys/arm/conf/IMX6 Mon Dec 21 21:40:15 2015 (r292571) @@ -133,6 +133,9 @@ device u3g # USB modems #options SC_DFLT_FONT # compile font in #makeoptions SC_DFLT_FONT=cp437 +device videomode +device hdmi + # Flattened Device Tree options FDT # Configure using FDT/DTB data makeoptions MODULES_EXTRA=dtb/imx6 Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Mon Dec 21 21:24:03 2015 (r292570) +++ head/sys/arm/freescale/imx/files.imx6 Mon Dec 21 21:40:15 2015 (r292571) @@ -24,6 +24,9 @@ arm/freescale/imx/imx6_sdma.c optional arm/freescale/imx/imx6_audmux.c optional sound arm/freescale/imx/imx6_ssi.c optional sound +arm/arm/hdmi_if.m optional hdmi +arm/freescale/imx/imx6_hdmi.c optional hdmi + # # Optional devices. # Added: head/sys/arm/freescale/imx/imx6_hdmi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_hdmi.c Mon Dec 21 21:40:15 2015 (r292571) @@ -0,0 +1,768 @@ +/*- + * Copyright (c) 2015 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * HDMI core module + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include "hdmi_if.h" + +#define I2C_DDC_ADDR (0x50 << 1) +#define EDID_LENGTH 0x80 + +struct imx_hdmi_softc { + device_t sc_dev; + struct resource *sc_mem_res; + int sc_mem_rid; + struct intr_config_hook sc_mode_hook; + struct videomode sc_mode; + uint8_t *sc_edid; + uint8_t sc_edid_len; + phandle_t sc_i2c_xref; +}; + +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6dl-hdmi", 1}, + {"fsl,imx6q-hdmi", 1}, + {NULL, 0} +}; + +static inline uint8_t +RD1(struct imx_hdmi_softc *sc, bus_size_t off) +{ + + return (bus_read_1(sc->sc_mem_res, off)); +} + +static inline void +WR1(struct imx_hdmi_softc *sc, bus_size_t off, uint8_t val) +{ + + bus_write_1(sc->sc_mem_res, off, val); +} + +static void +imx_hdmi_phy_wait_i2c_done(struct imx_hdmi_softc *sc, int msec) +{ + uint8_t val; + + val = RD1(sc, HDMI_IH_I2CMPHY_STAT0) & + (HDMI_IH_I2CMPHY_STAT0_DONE | HDMI_IH_I2CMPHY_STAT0_ERROR); + while (val == 0) { + pause("HDMI_PHY", hz/100); + msec -= 10; + if (msec <= 0) + return; + val = RD1(sc, HDMI_IH_I2CMPHY_STAT0) & + (HDMI_IH_I2CMPHY_STAT0_DONE | HDMI_IH_I2CMPHY_STAT0_ERROR); + } +} + +static void +imx_hdmi_phy_i2c_write(struct imx_hdmi_softc *sc, unsigned short data, + unsigned char addr) +{ + + /* clear DONE and ERROR flags */ + WR1(sc, HDMI_IH_I2CMPHY_STAT0, + HDMI_IH_I2CMPHY_STAT0_DONE | HDMI_IH_I2CMPHY_STAT0_ERROR); + WR1(sc, HDMI_PHY_I2CM_ADDRESS_ADDR, addr); + WR1(sc, HDMI_PHY_I2CM_DATAO_1_ADDR, ((data >> 8) & 0xff)); + WR1(sc, HDMI_PHY_I2CM_DATAO_0_ADDR, ((data >> 0) & 0xff)); + WR1(sc, HDMI_PHY_I2CM_OPERATION_ADDR, HDMI_PHY_I2CM_OPERATION_ADDR_WRITE); + imx_hdmi_phy_wait_i2c_done(sc, 1000); +} + +static void +imx_hdmi_disable_overflow_interrupts(struct imx_hdmi_softc *sc) +{ + WR1(sc, HDMI_IH_MUTE_FC_STAT2, HDMI_IH_MUTE_FC_STAT2_OVERFLOW_MASK); + WR1(sc, HDMI_FC_MASK2, + HDMI_FC_MASK2_LOW_PRI | HDMI_FC_MASK2_HIGH_PRI); +} + +static void +imx_hdmi_av_composer(struct imx_hdmi_softc *sc) +{ + uint8_t inv_val; + int is_dvi; + int hblank, vblank, hsync_len, hbp, vbp; + + /* Set up HDMI_FC_INVIDCONF */ + inv_val = ((sc->sc_mode.flags & VID_NVSYNC) ? + HDMI_FC_INVIDCONF_VSYNC_IN_POLARITY_ACTIVE_LOW : + HDMI_FC_INVIDCONF_VSYNC_IN_POLARITY_ACTIVE_HIGH); + + inv_val |= ((sc->sc_mode.flags & VID_NHSYNC) ? + HDMI_FC_INVIDCONF_HSYNC_IN_POLARITY_ACTIVE_LOW : + HDMI_FC_INVIDCONF_HSYNC_IN_POLARITY_ACTIVE_HIGH); + + inv_val |= HDMI_FC_INVIDCONF_DE_IN_POLARITY_ACTIVE_HIGH; + + inv_val |= ((sc->sc_mode.flags & VID_INTERLACE) ? + HDMI_FC_INVIDCONF_R_V_BLANK_IN_OSC_ACTIVE_HIGH : + HDMI_FC_INVIDCONF_R_V_BLANK_IN_OSC_ACTIVE_LOW); + + inv_val |= ((sc->sc_mode.flags & VID_INTERLACE) ? + HDMI_FC_INVIDCONF_IN_I_P_INTERLACED : + HDMI_FC_INVIDCONF_IN_I_P_PROGRESSIVE); + + /* TODO: implement HDMI part */ + is_dvi = 1; + inv_val |= (is_dvi ? + HDMI_FC_INVIDCONF_DVI_MODEZ_DVI_MODE : + HDMI_FC_INVIDCONF_DVI_MODEZ_HDMI_MODE); + + WR1(sc, HDMI_FC_INVIDCONF, inv_val); + + /* Set up horizontal active pixel region width */ + WR1(sc, HDMI_FC_INHACTV1, sc->sc_mode.hdisplay >> 8); + WR1(sc, HDMI_FC_INHACTV0, sc->sc_mode.hdisplay); + + /* Set up vertical blanking pixel region width */ + WR1(sc, HDMI_FC_INVACTV1, sc->sc_mode.vdisplay >> 8); + WR1(sc, HDMI_FC_INVACTV0, sc->sc_mode.vdisplay); + + /* Set up horizontal blanking pixel region width */ + hblank = sc->sc_mode.htotal - sc->sc_mode.hdisplay; + WR1(sc, HDMI_FC_INHBLANK1, hblank >> 8); + WR1(sc, HDMI_FC_INHBLANK0, hblank); + + /* Set up vertical blanking pixel region width */ + vblank = sc->sc_mode.vtotal - sc->sc_mode.vdisplay; + WR1(sc, HDMI_FC_INVBLANK, vblank); + + /* Set up HSYNC active edge delay width (in pixel clks) */ + hbp = sc->sc_mode.htotal - sc->sc_mode.hsync_end; + WR1(sc, HDMI_FC_HSYNCINDELAY1, hbp >> 8); + WR1(sc, HDMI_FC_HSYNCINDELAY0, hbp); + + /* Set up VSYNC active edge delay (in pixel clks) */ + vbp = sc->sc_mode.vtotal - sc->sc_mode.vsync_end; + WR1(sc, HDMI_FC_VSYNCINDELAY, vbp); + + hsync_len = (sc->sc_mode.hsync_end - sc->sc_mode.hsync_start); + /* Set up HSYNC active pulse width (in pixel clks) */ + WR1(sc, HDMI_FC_HSYNCINWIDTH1, hsync_len >> 8); + WR1(sc, HDMI_FC_HSYNCINWIDTH0, hsync_len); + + /* Set up VSYNC active edge delay (in pixel clks) */ + WR1(sc, HDMI_FC_VSYNCINWIDTH, (sc->sc_mode.vsync_end - sc->sc_mode.vsync_start)); +} + +static void +imx_hdmi_phy_enable_power(struct imx_hdmi_softc *sc, uint8_t enable) +{ + uint8_t reg; + + reg = RD1(sc, HDMI_PHY_CONF0); + reg &= ~HDMI_PHY_CONF0_PDZ_MASK; + reg |= (enable << HDMI_PHY_CONF0_PDZ_OFFSET); + WR1(sc, HDMI_PHY_CONF0, reg); +} + +static void +imx_hdmi_phy_enable_tmds(struct imx_hdmi_softc *sc, uint8_t enable) +{ + uint8_t reg; + + reg = RD1(sc, HDMI_PHY_CONF0); + reg &= ~HDMI_PHY_CONF0_ENTMDS_MASK; + reg |= (enable << HDMI_PHY_CONF0_ENTMDS_OFFSET); + WR1(sc, HDMI_PHY_CONF0, reg); +} + +static void +imx_hdmi_phy_gen2_pddq(struct imx_hdmi_softc *sc, uint8_t enable) +{ + uint8_t reg; + + reg = RD1(sc, HDMI_PHY_CONF0); + reg &= ~HDMI_PHY_CONF0_GEN2_PDDQ_MASK; + reg |= (enable << HDMI_PHY_CONF0_GEN2_PDDQ_OFFSET); + WR1(sc, HDMI_PHY_CONF0, reg); +} + +static void +imx_hdmi_phy_gen2_txpwron(struct imx_hdmi_softc *sc, uint8_t enable) +{ + uint8_t reg; + + reg = RD1(sc, HDMI_PHY_CONF0); + reg &= ~HDMI_PHY_CONF0_GEN2_TXPWRON_MASK; + reg |= (enable << HDMI_PHY_CONF0_GEN2_TXPWRON_OFFSET); + WR1(sc, HDMI_PHY_CONF0, reg); +} + +static void +imx_hdmi_phy_sel_data_en_pol(struct imx_hdmi_softc *sc, uint8_t enable) +{ + uint8_t reg; + + reg = RD1(sc, HDMI_PHY_CONF0); + reg &= ~HDMI_PHY_CONF0_SELDATAENPOL_MASK; + reg |= (enable << HDMI_PHY_CONF0_SELDATAENPOL_OFFSET); + WR1(sc, HDMI_PHY_CONF0, reg); +} + +static void +imx_hdmi_phy_sel_interface_control(struct imx_hdmi_softc *sc, uint8_t enable) +{ + uint8_t reg; + + reg = RD1(sc, HDMI_PHY_CONF0); + reg &= ~HDMI_PHY_CONF0_SELDIPIF_MASK; + reg |= (enable << HDMI_PHY_CONF0_SELDIPIF_OFFSET); + WR1(sc, HDMI_PHY_CONF0, reg); +} + +static inline void +imx_hdmi_phy_test_clear(struct imx_hdmi_softc *sc, unsigned char bit) +{ + uint8_t val; + + val = RD1(sc, HDMI_PHY_TST0); + val &= ~HDMI_PHY_TST0_TSTCLR_MASK; + val |= (bit << HDMI_PHY_TST0_TSTCLR_OFFSET) & + HDMI_PHY_TST0_TSTCLR_MASK; + WR1(sc, HDMI_PHY_TST0, val); +} + +static void +imx_hdmi_clear_overflow(struct imx_hdmi_softc *sc) +{ + int count; + uint8_t val; + + /* TMDS software reset */ + WR1(sc, HDMI_MC_SWRSTZ, (uint8_t)~HDMI_MC_SWRSTZ_TMDSSWRST_REQ); + + val = RD1(sc, HDMI_FC_INVIDCONF); + + for (count = 0 ; count < 5 ; count++) + WR1(sc, HDMI_FC_INVIDCONF, val); +} + +static int +imx_hdmi_phy_configure(struct imx_hdmi_softc *sc) +{ + uint8_t val; + uint8_t msec; + + WR1(sc, HDMI_MC_FLOWCTRL, HDMI_MC_FLOWCTRL_FEED_THROUGH_OFF_CSC_BYPASS); + + /* gen2 tx power off */ + imx_hdmi_phy_gen2_txpwron(sc, 0); + + /* gen2 pddq */ + imx_hdmi_phy_gen2_pddq(sc, 1); + + /* PHY reset */ + WR1(sc, HDMI_MC_PHYRSTZ, HDMI_MC_PHYRSTZ_DEASSERT); + WR1(sc, HDMI_MC_PHYRSTZ, HDMI_MC_PHYRSTZ_ASSERT); + + WR1(sc, HDMI_MC_HEACPHY_RST, HDMI_MC_HEACPHY_RST_ASSERT); + + imx_hdmi_phy_test_clear(sc, 1); + WR1(sc, HDMI_PHY_I2CM_SLAVE_ADDR, HDMI_PHY_I2CM_SLAVE_ADDR_PHY_GEN2); + imx_hdmi_phy_test_clear(sc, 0); + + /* + * Following initialization are for 8bit per color case + */ + + /* + * PLL/MPLL config, see section 24.7.22 in TRM + * config, see section 24.7.22 + */ + if (sc->sc_mode.dot_clock*1000 <= 45250000) { + imx_hdmi_phy_i2c_write(sc, CPCE_CTRL_45_25, HDMI_PHY_I2C_CPCE_CTRL); + imx_hdmi_phy_i2c_write(sc, GMPCTRL_45_25, HDMI_PHY_I2C_GMPCTRL); + } else if (sc->sc_mode.dot_clock*1000 <= 92500000) { + imx_hdmi_phy_i2c_write(sc, CPCE_CTRL_92_50, HDMI_PHY_I2C_CPCE_CTRL); + imx_hdmi_phy_i2c_write(sc, GMPCTRL_92_50, HDMI_PHY_I2C_GMPCTRL); + } else if (sc->sc_mode.dot_clock*1000 <= 185000000) { + imx_hdmi_phy_i2c_write(sc, CPCE_CTRL_185, HDMI_PHY_I2C_CPCE_CTRL); + imx_hdmi_phy_i2c_write(sc, GMPCTRL_185, HDMI_PHY_I2C_GMPCTRL); + } else { + imx_hdmi_phy_i2c_write(sc, CPCE_CTRL_370, HDMI_PHY_I2C_CPCE_CTRL); + imx_hdmi_phy_i2c_write(sc, GMPCTRL_370, HDMI_PHY_I2C_GMPCTRL); + } + + /* + * Values described in TRM section 34.9.2 PLL/MPLL Generic + * Configuration Settings. Table 34-23. + */ + if (sc->sc_mode.dot_clock*1000 <= 54000000) { + imx_hdmi_phy_i2c_write(sc, 0x091c, HDMI_PHY_I2C_CURRCTRL); + } else if (sc->sc_mode.dot_clock*1000 <= 58400000) { + imx_hdmi_phy_i2c_write(sc, 0x091c, HDMI_PHY_I2C_CURRCTRL); + } else if (sc->sc_mode.dot_clock*1000 <= 72000000) { + imx_hdmi_phy_i2c_write(sc, 0x06dc, HDMI_PHY_I2C_CURRCTRL); + } else if (sc->sc_mode.dot_clock*1000 <= 74250000) { + imx_hdmi_phy_i2c_write(sc, 0x06dc, HDMI_PHY_I2C_CURRCTRL); + } else if (sc->sc_mode.dot_clock*1000 <= 118800000) { + imx_hdmi_phy_i2c_write(sc, 0x091c, HDMI_PHY_I2C_CURRCTRL); + } else if (sc->sc_mode.dot_clock*1000 <= 216000000) { + imx_hdmi_phy_i2c_write(sc, 0x06dc, HDMI_PHY_I2C_CURRCTRL); + } else { + panic("Unsupported mode\n"); + } + + imx_hdmi_phy_i2c_write(sc, 0x0000, HDMI_PHY_I2C_PLLPHBYCTRL); + imx_hdmi_phy_i2c_write(sc, MSM_CTRL_FB_CLK, HDMI_PHY_I2C_MSM_CTRL); + /* RESISTANCE TERM 133 Ohm */ + imx_hdmi_phy_i2c_write(sc, TXTERM_133, HDMI_PHY_I2C_TXTERM); + + /* REMOVE CLK TERM */ + imx_hdmi_phy_i2c_write(sc, CKCALCTRL_OVERRIDE, HDMI_PHY_I2C_CKCALCTRL); + + if (sc->sc_mode.dot_clock*1000 > 148500000) { + imx_hdmi_phy_i2c_write(sc,CKSYMTXCTRL_OVERRIDE | CKSYMTXCTRL_TX_SYMON | + CKSYMTXCTRL_TX_TRBON | CKSYMTXCTRL_TX_CK_SYMON, HDMI_PHY_I2C_CKSYMTXCTRL); + imx_hdmi_phy_i2c_write(sc, VLEVCTRL_TX_LVL(9) | VLEVCTRL_CK_LVL(9), + HDMI_PHY_I2C_VLEVCTRL); + } else { + imx_hdmi_phy_i2c_write(sc,CKSYMTXCTRL_OVERRIDE | CKSYMTXCTRL_TX_SYMON | + CKSYMTXCTRL_TX_TRAON | CKSYMTXCTRL_TX_CK_SYMON, HDMI_PHY_I2C_CKSYMTXCTRL); + imx_hdmi_phy_i2c_write(sc, VLEVCTRL_TX_LVL(13) | VLEVCTRL_CK_LVL(13), + HDMI_PHY_I2C_VLEVCTRL); + } + + imx_hdmi_phy_enable_power(sc, 1); + + /* toggle TMDS enable */ + imx_hdmi_phy_enable_tmds(sc, 0); + imx_hdmi_phy_enable_tmds(sc, 1); + + /* gen2 tx power on */ + imx_hdmi_phy_gen2_txpwron(sc, 1); + imx_hdmi_phy_gen2_pddq(sc, 0); + + /*Wait for PHY PLL lock */ + msec = 4; + val = RD1(sc, HDMI_PHY_STAT0) & HDMI_PHY_TX_PHY_LOCK; + while (val == 0) { + DELAY(1000); + if (msec-- == 0) { + device_printf(sc->sc_dev, "PHY PLL not locked\n"); + return (-1); + } + val = RD1(sc, HDMI_PHY_STAT0) & HDMI_PHY_TX_PHY_LOCK; + } + + return true; +} + +static void +imx_hdmi_phy_init(struct imx_hdmi_softc *sc) +{ + int i; + + /* HDMI Phy spec says to do the phy initialization sequence twice */ + for (i = 0 ; i < 2 ; i++) { + imx_hdmi_phy_sel_data_en_pol(sc, 1); + imx_hdmi_phy_sel_interface_control(sc, 0); + imx_hdmi_phy_enable_tmds(sc, 0); + imx_hdmi_phy_enable_power(sc, 0); + + /* Enable CSC */ + imx_hdmi_phy_configure(sc); + } +} + +static void +imx_hdmi_enable_video_path(struct imx_hdmi_softc *sc) +{ + uint8_t clkdis; + + /* + * Control period timing + * Values are minimal according to HDMI spec 1.4a + */ + WR1(sc, HDMI_FC_CTRLDUR, 12); + WR1(sc, HDMI_FC_EXCTRLDUR, 32); + WR1(sc, HDMI_FC_EXCTRLSPAC, 1); + + /* + * Bits to fill data lines not used to transmit preamble + * for channels 0, 1, and 2 respectively + */ + WR1(sc, HDMI_FC_CH0PREAM, 0x0B); + WR1(sc, HDMI_FC_CH1PREAM, 0x16); + WR1(sc, HDMI_FC_CH2PREAM, 0x21); + + /* Save CEC clock */ + clkdis = RD1(sc, HDMI_MC_CLKDIS) & HDMI_MC_CLKDIS_CECCLK_DISABLE; + clkdis |= ~HDMI_MC_CLKDIS_CECCLK_DISABLE; + + /* Enable pixel clock and tmds data path */ + clkdis &= ~HDMI_MC_CLKDIS_PIXELCLK_DISABLE; + WR1(sc, HDMI_MC_CLKDIS, clkdis); + + clkdis &= ~HDMI_MC_CLKDIS_TMDSCLK_DISABLE; + WR1(sc, HDMI_MC_CLKDIS, clkdis); +} + +static void +imx_hdmi_video_packetize(struct imx_hdmi_softc *sc) +{ + unsigned int color_depth = 0; + unsigned int remap_size = HDMI_VP_REMAP_YCC422_16BIT; + unsigned int output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_PP; + uint8_t val; + + output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_BYPASS; + color_depth = 0; + + /* set the packetizer registers */ + val = ((color_depth << HDMI_VP_PR_CD_COLOR_DEPTH_OFFSET) & + HDMI_VP_PR_CD_COLOR_DEPTH_MASK); + WR1(sc, HDMI_VP_PR_CD, val); + + val = RD1(sc, HDMI_VP_STUFF); + val &= ~HDMI_VP_STUFF_PR_STUFFING_MASK; + val |= HDMI_VP_STUFF_PR_STUFFING_STUFFING_MODE; + WR1(sc, HDMI_VP_STUFF, val); + + val = RD1(sc, HDMI_VP_CONF); + val &= ~(HDMI_VP_CONF_PR_EN_MASK | + HDMI_VP_CONF_BYPASS_SELECT_MASK); + val |= HDMI_VP_CONF_PR_EN_DISABLE | + HDMI_VP_CONF_BYPASS_SELECT_VID_PACKETIZER; + WR1(sc, HDMI_VP_CONF, val); + + val = RD1(sc, HDMI_VP_STUFF); + val &= ~HDMI_VP_STUFF_IDEFAULT_PHASE_MASK; + val |= 1 << HDMI_VP_STUFF_IDEFAULT_PHASE_OFFSET; + WR1(sc, HDMI_VP_STUFF, val); + + WR1(sc, HDMI_VP_REMAP, remap_size); + + if (output_select == HDMI_VP_CONF_OUTPUT_SELECTOR_PP) { + val = RD1(sc, HDMI_VP_CONF); + val &= ~(HDMI_VP_CONF_BYPASS_EN_MASK | + HDMI_VP_CONF_PP_EN_ENMASK | + HDMI_VP_CONF_YCC422_EN_MASK); + val |= HDMI_VP_CONF_BYPASS_EN_DISABLE | + HDMI_VP_CONF_PP_EN_ENABLE | + HDMI_VP_CONF_YCC422_EN_DISABLE; + WR1(sc, HDMI_VP_CONF, val); + } else if (output_select == HDMI_VP_CONF_OUTPUT_SELECTOR_YCC422) { + val = RD1(sc, HDMI_VP_CONF); + val &= ~(HDMI_VP_CONF_BYPASS_EN_MASK | + HDMI_VP_CONF_PP_EN_ENMASK | + HDMI_VP_CONF_YCC422_EN_MASK); + val |= HDMI_VP_CONF_BYPASS_EN_DISABLE | + HDMI_VP_CONF_PP_EN_DISABLE | + HDMI_VP_CONF_YCC422_EN_ENABLE; + WR1(sc, HDMI_VP_CONF, val); + } else if (output_select == HDMI_VP_CONF_OUTPUT_SELECTOR_BYPASS) { + val = RD1(sc, HDMI_VP_CONF); + val &= ~(HDMI_VP_CONF_BYPASS_EN_MASK | + HDMI_VP_CONF_PP_EN_ENMASK | + HDMI_VP_CONF_YCC422_EN_MASK); + val |= HDMI_VP_CONF_BYPASS_EN_ENABLE | + HDMI_VP_CONF_PP_EN_DISABLE | + HDMI_VP_CONF_YCC422_EN_DISABLE; + WR1(sc, HDMI_VP_CONF, val); + } else { + return; + } + + val = RD1(sc, HDMI_VP_STUFF); + val &= ~(HDMI_VP_STUFF_PP_STUFFING_MASK | + HDMI_VP_STUFF_YCC422_STUFFING_MASK); + val |= HDMI_VP_STUFF_PP_STUFFING_STUFFING_MODE | + HDMI_VP_STUFF_YCC422_STUFFING_STUFFING_MODE; + WR1(sc, HDMI_VP_STUFF, val); + + val = RD1(sc, HDMI_VP_CONF); + val &= ~HDMI_VP_CONF_OUTPUT_SELECTOR_MASK; + val |= output_select; + WR1(sc, HDMI_VP_CONF, val); +} + +static void +imx_hdmi_video_sample(struct imx_hdmi_softc *sc) +{ + int color_format; + uint8_t val; + + color_format = 0x01; + val = HDMI_TX_INVID0_INTERNAL_DE_GENERATOR_DISABLE | + ((color_format << HDMI_TX_INVID0_VIDEO_MAPPING_OFFSET) & + HDMI_TX_INVID0_VIDEO_MAPPING_MASK); + WR1(sc, HDMI_TX_INVID0, val); + + /* Enable TX stuffing: When DE is inactive, fix the output data to 0 */ + val = HDMI_TX_INSTUFFING_BDBDATA_STUFFING_ENABLE | + HDMI_TX_INSTUFFING_RCRDATA_STUFFING_ENABLE | + HDMI_TX_INSTUFFING_GYDATA_STUFFING_ENABLE; + WR1(sc, HDMI_TX_INSTUFFING, val); + WR1(sc, HDMI_TX_GYDATA0, 0x0); + WR1(sc, HDMI_TX_GYDATA1, 0x0); + WR1(sc, HDMI_TX_RCRDATA0, 0x0); + WR1(sc, HDMI_TX_RCRDATA1, 0x0); + WR1(sc, HDMI_TX_BCBDATA0, 0x0); + WR1(sc, HDMI_TX_BCBDATA1, 0x0); +} + +static int +imx_hdmi_set_mode(struct imx_hdmi_softc *sc) +{ + + imx_hdmi_disable_overflow_interrupts(sc); + imx_hdmi_av_composer(sc); + imx_hdmi_phy_init(sc); + imx_hdmi_enable_video_path(sc); + /* TODO: AVI infoframes */ + imx_hdmi_video_packetize(sc); + /* TODO: imx_hdmi_video_csc(sc); */ + imx_hdmi_video_sample(sc); + imx_hdmi_clear_overflow(sc); + + return (0); +} + +static int +hdmi_edid_read(struct imx_hdmi_softc *sc, uint8_t **edid, uint32_t *edid_len) +{ + device_t i2c_dev; + int result; + uint8_t addr = 0; + struct iic_msg msg[] = { + { 0, IIC_M_WR, 1, &addr }, + { 0, IIC_M_RD, EDID_LENGTH, NULL} + }; + + *edid = NULL; + *edid_len = 0; + + if (sc->sc_i2c_xref == 0) + return (ENXIO); + + i2c_dev = OF_device_from_xref(sc->sc_i2c_xref); + if (!i2c_dev) { + device_printf(sc->sc_dev, + "no actual device for \"ddc-i2c-bus\" property (handle=%x)\n", sc->sc_i2c_xref); + return (ENXIO); + } + + device_printf(sc->sc_dev, "reading EDID from %s, addr %02x\n", + device_get_nameunit(i2c_dev), I2C_DDC_ADDR/2); + + msg[0].slave = I2C_DDC_ADDR; + msg[1].slave = I2C_DDC_ADDR; + msg[1].buf = sc->sc_edid; + + result = iicbus_request_bus(i2c_dev, sc->sc_dev, IIC_INTRWAIT); + + if (result) { + device_printf(sc->sc_dev, "failed to request i2c bus: %d\n", result); + return (result); + } + + result = iicbus_transfer(i2c_dev, msg, 2); + iicbus_release_bus(i2c_dev, sc->sc_dev); + + if (result) { + device_printf(sc->sc_dev, "i2c transfer failed: %d\n", result); + return (result); + } else { + *edid_len = sc->sc_edid_len; + *edid = sc->sc_edid; + } + + return (result); +} + +static void +imx_hdmi_detect_cable(void *arg) +{ + struct imx_hdmi_softc *sc; + + sc = arg; + EVENTHANDLER_INVOKE(hdmi_event, sc->sc_dev, HDMI_EVENT_CONNECTED); + /* Finished with the interrupt hook */ + config_intrhook_disestablish(&sc->sc_mode_hook); +} + +static int +imx_hdmi_detach(device_t dev) +{ + struct imx_hdmi_softc *sc; + + sc = device_get_softc(dev); + + if (sc->sc_mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, + sc->sc_mem_rid, sc->sc_mem_res); + + return (0); +} + +static int +imx_hdmi_attach(device_t dev) +{ + struct imx_hdmi_softc *sc; + int err; + uint32_t gpr3; + phandle_t node, i2c_xref; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + err = 0; + + /* Allocate memory resources. */ + sc->sc_mem_rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_mem_rid, + RF_ACTIVE); + if (sc->sc_mem_res == NULL) { + device_printf(dev, "Cannot allocate memory resources\n"); + err = ENXIO; + goto out; + } + + sc->sc_mode_hook.ich_func = imx_hdmi_detect_cable; + sc->sc_mode_hook.ich_arg = sc; + + if (config_intrhook_establish(&sc->sc_mode_hook) != 0) { + err = ENOMEM; + goto out; + } + + node = ofw_bus_get_node(dev); + if (OF_getencprop(node, "ddc-i2c-bus", &i2c_xref, sizeof(i2c_xref)) == -1) + sc->sc_i2c_xref = 0; + else + sc->sc_i2c_xref = i2c_xref; + + sc->sc_edid = malloc(EDID_LENGTH, M_DEVBUF, M_WAITOK | M_ZERO); + sc->sc_edid_len = EDID_LENGTH; + + imx_ccm_hdmi_enable(); + + device_printf(sc->sc_dev, "HDMI controller %02x:%02x:%02x:%02x\n", + RD1(sc, HDMI_DESIGN_ID), RD1(sc, HDMI_REVISION_ID), + RD1(sc, HDMI_PRODUCT_ID0), RD1(sc, HDMI_PRODUCT_ID1)); + + + gpr3 = imx_iomux_gpr_get(IOMUXC_GPR3); + gpr3 &= ~(IOMUXC_GPR3_HDMI_MASK); + gpr3 |= IOMUXC_GPR3_HDMI_IPU1_DI0; + imx_iomux_gpr_set(IOMUXC_GPR3, gpr3); + + WR1(sc, HDMI_PHY_POL0, HDMI_PHY_HPD); + WR1(sc, HDMI_IH_PHY_STAT0, HDMI_IH_PHY_STAT0_HPD); + +out: + + if (err != 0) + imx_hdmi_detach(dev); + + return (err); +} + +static int +imx_hdmi_probe(device_t dev) +{ + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Freescale i.MX6 HDMI core"); + + return (BUS_PROBE_DEFAULT); +} + +static int +imx_hdmi_get_edid(device_t dev, uint8_t **edid, uint32_t *edid_len) +{ + + return (hdmi_edid_read(device_get_softc(dev), edid, edid_len)); +} + +static int +imx_hdmi_set_videomode(device_t dev, const struct videomode *mode) +{ + struct imx_hdmi_softc *sc; + + sc = device_get_softc(dev); + memcpy(&sc->sc_mode, mode, sizeof(*mode)); + imx_hdmi_set_mode(sc); + + return (0); +} + +static device_method_t imx_hdmi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, imx_hdmi_probe), + DEVMETHOD(device_attach, imx_hdmi_attach), + DEVMETHOD(device_detach, imx_hdmi_detach), + + /* HDMI methods */ + DEVMETHOD(hdmi_get_edid, imx_hdmi_get_edid), + DEVMETHOD(hdmi_set_videomode, imx_hdmi_set_videomode), + + DEVMETHOD_END +}; + +static driver_t imx_hdmi_driver = { + "hdmi", + imx_hdmi_methods, + sizeof(struct imx_hdmi_softc) +}; + +static devclass_t imx_hdmi_devclass; + +DRIVER_MODULE(hdmi, simplebus, imx_hdmi_driver, imx_hdmi_devclass, 0, 0); Added: head/sys/arm/freescale/imx/imx6_hdmireg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_hdmireg.h Mon Dec 21 21:40:15 2015 (r292571) @@ -0,0 +1,651 @@ +/*- + * Copyright (c) 2015 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __IMX6__HDMI_REGS_H__ +#define __IMX6__HDMI_REGS_H__ +#define HDMI_DESIGN_ID 0x0000 +#define HDMI_REVISION_ID 0x0001 +#define HDMI_PRODUCT_ID0 0x0002 +#define HDMI_PRODUCT_ID1 0x0003 + +/* Interrupt Registers */ +#define HDMI_IH_FC_STAT0 0x0100 +#define HDMI_IH_FC_STAT1 0x0101 +#define HDMI_IH_FC_STAT2 0x0102 +#define HDMI_IH_AS_STAT0 0x0103 +#define HDMI_IH_PHY_STAT0 0x0104 +#define HDMI_IH_PHY_STAT0_HPD (1 << 0) +#define HDMI_IH_I2CM_STAT0 0x0105 +#define HDMI_IH_CEC_STAT0 0x0106 +#define HDMI_IH_VP_STAT0 0x0107 +#define HDMI_IH_I2CMPHY_STAT0 0x0108 +#define HDMI_IH_I2CMPHY_STAT0_DONE (1 << 1) +#define HDMI_IH_I2CMPHY_STAT0_ERROR (1 << 0) +#define HDMI_IH_AHBDMAAUD_STAT0 0x0109 + +#define HDMI_IH_MUTE_FC_STAT0 0x0180 +#define HDMI_IH_MUTE_FC_STAT1 0x0181 +#define HDMI_IH_MUTE_FC_STAT2 0x0182 +#define HDMI_IH_MUTE_FC_STAT2_OVERFLOW_MASK (0x3) +#define HDMI_IH_MUTE_AS_STAT0 0x0183 +#define HDMI_IH_MUTE_PHY_STAT0 0x0184 +#define HDMI_IH_MUTE_I2CM_STAT0 0x0185 +#define HDMI_IH_MUTE_CEC_STAT0 0x0186 +#define HDMI_IH_MUTE_VP_STAT0 0x0187 +#define HDMI_IH_MUTE_I2CMPHY_STAT0 0x0188 +#define HDMI_IH_MUTE_AHBDMAAUD_STAT0 0x0189 +#define HDMI_IH_MUTE 0x01FF +#define HDMI_IH_MUTE_MUTE_WAKEUP_INTERRUPT (1<<1) +#define HDMI_IH_MUTE_MUTE_ALL_INTERRUPT (1<<0) + +/* Video Sample Registers */ +#define HDMI_TX_INVID0 0x0200 +#define HDMI_TX_INVID0_INTERNAL_DE_GENERATOR_MASK 0x80 +#define HDMI_TX_INVID0_INTERNAL_DE_GENERATOR_ENABLE 0x80 +#define HDMI_TX_INVID0_INTERNAL_DE_GENERATOR_DISABLE 0x00 +#define HDMI_TX_INVID0_VIDEO_MAPPING_MASK 0x1F +#define HDMI_TX_INVID0_VIDEO_MAPPING_OFFSET 0 +#define HDMI_TX_INSTUFFING 0x0201 +#define HDMI_TX_INSTUFFING_BDBDATA_STUFFING_MASK 0x4 +#define HDMI_TX_INSTUFFING_BDBDATA_STUFFING_ENABLE 0x4 +#define HDMI_TX_INSTUFFING_BDBDATA_STUFFING_DISABLE 0x0 +#define HDMI_TX_INSTUFFING_RCRDATA_STUFFING_MASK 0x2 +#define HDMI_TX_INSTUFFING_RCRDATA_STUFFING_ENABLE 0x2 +#define HDMI_TX_INSTUFFING_RCRDATA_STUFFING_DISABLE 0x0 +#define HDMI_TX_INSTUFFING_GYDATA_STUFFING_MASK 0x1 +#define HDMI_TX_INSTUFFING_GYDATA_STUFFING_ENABLE 0x1 +#define HDMI_TX_INSTUFFING_GYDATA_STUFFING_DISABLE 0x0 +#define HDMI_TX_GYDATA0 0x0202 +#define HDMI_TX_GYDATA1 0x0203 +#define HDMI_TX_RCRDATA0 0x0204 +#define HDMI_TX_RCRDATA1 0x0205 +#define HDMI_TX_BCBDATA0 0x0206 +#define HDMI_TX_BCBDATA1 0x0207 + +/* Video Packetizer Registers */ +#define HDMI_VP_STATUS 0x0800 +#define HDMI_VP_PR_CD 0x0801 +#define HDMI_VP_PR_CD_COLOR_DEPTH_MASK 0xF0 +#define HDMI_VP_PR_CD_COLOR_DEPTH_OFFSET 4 +#define HDMI_VP_PR_CD_DESIRED_PR_FACTOR_MASK 0x0F +#define HDMI_VP_PR_CD_DESIRED_PR_FACTOR_OFFSET 0 + +#define HDMI_VP_STUFF 0x0802 +#define HDMI_VP_STUFF_IDEFAULT_PHASE_MASK 0x20 +#define HDMI_VP_STUFF_IDEFAULT_PHASE_OFFSET 5 +#define HDMI_VP_STUFF_IFIX_PP_TO_LAST_MASK 0x10 +#define HDMI_VP_STUFF_IFIX_PP_TO_LAST_OFFSET 4 +#define HDMI_VP_STUFF_ICX_GOTO_P0_ST_MASK 0x8 +#define HDMI_VP_STUFF_ICX_GOTO_P0_ST_OFFSET 3 +#define HDMI_VP_STUFF_YCC422_STUFFING_MASK 0x4 +#define HDMI_VP_STUFF_YCC422_STUFFING_STUFFING_MODE 0x4 +#define HDMI_VP_STUFF_YCC422_STUFFING_DIRECT_MODE 0x0 +#define HDMI_VP_STUFF_PP_STUFFING_MASK 0x2 +#define HDMI_VP_STUFF_PP_STUFFING_STUFFING_MODE 0x2 +#define HDMI_VP_STUFF_PP_STUFFING_DIRECT_MODE 0x0 +#define HDMI_VP_STUFF_PR_STUFFING_MASK 0x1 +#define HDMI_VP_STUFF_PR_STUFFING_STUFFING_MODE 0x1 +#define HDMI_VP_STUFF_PR_STUFFING_DIRECT_MODE 0x0 +#define HDMI_VP_REMAP 0x0803 +#define HDMI_VP_REMAP_MASK 0x3 +#define HDMI_VP_REMAP_YCC422_24BIT 0x2 +#define HDMI_VP_REMAP_YCC422_20BIT 0x1 +#define HDMI_VP_REMAP_YCC422_16BIT 0x0 +#define HDMI_VP_CONF 0x0804 +#define HDMI_VP_CONF_BYPASS_EN_MASK 0x40 +#define HDMI_VP_CONF_BYPASS_EN_ENABLE 0x40 +#define HDMI_VP_CONF_BYPASS_EN_DISABLE 0x00 +#define HDMI_VP_CONF_PP_EN_ENMASK 0x20 +#define HDMI_VP_CONF_PP_EN_ENABLE 0x20 +#define HDMI_VP_CONF_PP_EN_DISABLE 0x00 +#define HDMI_VP_CONF_PR_EN_MASK 0x10 +#define HDMI_VP_CONF_PR_EN_ENABLE 0x10 +#define HDMI_VP_CONF_PR_EN_DISABLE 0x00 +#define HDMI_VP_CONF_YCC422_EN_MASK 0x8 +#define HDMI_VP_CONF_YCC422_EN_ENABLE 0x8 +#define HDMI_VP_CONF_YCC422_EN_DISABLE 0x0 +#define HDMI_VP_CONF_BYPASS_SELECT_MASK 0x4 +#define HDMI_VP_CONF_BYPASS_SELECT_VID_PACKETIZER 0x4 +#define HDMI_VP_CONF_BYPASS_SELECT_PIX_REPEATER 0x0 +#define HDMI_VP_CONF_OUTPUT_SELECTOR_MASK 0x3 +#define HDMI_VP_CONF_OUTPUT_SELECTOR_BYPASS 0x3 +#define HDMI_VP_CONF_OUTPUT_SELECTOR_YCC422 0x1 +#define HDMI_VP_CONF_OUTPUT_SELECTOR_PP 0x0 +#define HDMI_VP_STAT 0x0805 +#define HDMI_VP_INT 0x0806 +#define HDMI_VP_MASK 0x0807 +#define HDMI_VP_POL 0x0808 + +/* Frame Composer Registers */ +#define HDMI_FC_INVIDCONF 0x1000 +#define HDMI_FC_INVIDCONF_VSYNC_IN_POLARITY_ACTIVE_HIGH 0x40 +#define HDMI_FC_INVIDCONF_VSYNC_IN_POLARITY_ACTIVE_LOW 0x00 +#define HDMI_FC_INVIDCONF_HSYNC_IN_POLARITY_ACTIVE_HIGH 0x20 +#define HDMI_FC_INVIDCONF_HSYNC_IN_POLARITY_ACTIVE_LOW 0x00 +#define HDMI_FC_INVIDCONF_DE_IN_POLARITY_ACTIVE_HIGH 0x10 +#define HDMI_FC_INVIDCONF_DE_IN_POLARITY_ACTIVE_LOW 0x00 +#define HDMI_FC_INVIDCONF_DVI_MODEZ_HDMI_MODE 0x8 +#define HDMI_FC_INVIDCONF_DVI_MODEZ_DVI_MODE 0x0 +#define HDMI_FC_INVIDCONF_R_V_BLANK_IN_OSC_ACTIVE_HIGH 0x2 +#define HDMI_FC_INVIDCONF_R_V_BLANK_IN_OSC_ACTIVE_LOW 0x0 +#define HDMI_FC_INVIDCONF_IN_I_P_INTERLACED 0x1 +#define HDMI_FC_INVIDCONF_IN_I_P_PROGRESSIVE 0x0 +#define HDMI_FC_INHACTV0 0x1001 +#define HDMI_FC_INHACTV1 0x1002 +#define HDMI_FC_INHBLANK0 0x1003 +#define HDMI_FC_INHBLANK1 0x1004 +#define HDMI_FC_INVACTV0 0x1005 +#define HDMI_FC_INVACTV1 0x1006 +#define HDMI_FC_INVBLANK 0x1007 +#define HDMI_FC_HSYNCINDELAY0 0x1008 +#define HDMI_FC_HSYNCINDELAY1 0x1009 +#define HDMI_FC_HSYNCINWIDTH0 0x100A +#define HDMI_FC_HSYNCINWIDTH1 0x100B +#define HDMI_FC_VSYNCINDELAY 0x100C +#define HDMI_FC_VSYNCINWIDTH 0x100D +#define HDMI_FC_INFREQ0 0x100E +#define HDMI_FC_INFREQ1 0x100F +#define HDMI_FC_INFREQ2 0x1010 +#define HDMI_FC_CTRLDUR 0x1011 +#define HDMI_FC_EXCTRLDUR 0x1012 +#define HDMI_FC_EXCTRLSPAC 0x1013 +#define HDMI_FC_CH0PREAM 0x1014 +#define HDMI_FC_CH1PREAM 0x1015 +#define HDMI_FC_CH2PREAM 0x1016 +#define HDMI_FC_AVICONF3 0x1017 +#define HDMI_FC_GCP 0x1018 +#define HDMI_FC_AVICONF0 0x1019 +#define HDMI_FC_AVICONF1 0x101A +#define HDMI_FC_AVICONF2 0x101B +#define HDMI_FC_AVIVID 0x101C +#define HDMI_FC_AVIETB0 0x101D +#define HDMI_FC_AVIETB1 0x101E +#define HDMI_FC_AVISBB0 0x101F +#define HDMI_FC_AVISBB1 0x1020 +#define HDMI_FC_AVIELB0 0x1021 +#define HDMI_FC_AVIELB1 0x1022 +#define HDMI_FC_AVISRB0 0x1023 +#define HDMI_FC_AVISRB1 0x1024 +#define HDMI_FC_AUDICONF0 0x1025 +#define HDMI_FC_AUDICONF1 0x1026 +#define HDMI_FC_AUDICONF2 0x1027 +#define HDMI_FC_AUDICONF3 0x1028 +#define HDMI_FC_VSDIEEEID0 0x1029 +#define HDMI_FC_VSDSIZE 0x102A +#define HDMI_FC_VSDIEEEID1 0x1030 +#define HDMI_FC_VSDIEEEID2 0x1031 +#define HDMI_FC_VSDPAYLOAD0 0x1032 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Dec 21 21:41:43 2015 Return-Path: Delivered-To: svn-src-all@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 48961A4F967; Mon, 21 Dec 2015 21:41:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f175.google.com (mail-yk0-f175.google.com [209.85.160.175]) (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 114191C60; Mon, 21 Dec 2015 21:41:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yk0-f175.google.com with SMTP id v6so144210313ykc.2; Mon, 21 Dec 2015 13:41:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=d2qMqnnI62HzYj859YR6gZ22QDPqVyDLS7WL56CZr+0=; b=g9GiWm2+rgQ/8deYyg76Y4ri9HnjdQyrICy8LCeJ7PYhUVU+f1chzWNmaT261/Aw0o GexD0PHBjD51Wd9iF2YvQ3xFpyg76V8UAhjdxF1K90BqsKE7GNfuxZxfdBomLD/21FY0 o2ysTySA8uZ5dHz32OF/0kKSUbaZ1/v1py8ek4Q88uh0heKDRlwYU1i3H6g40pv/+GsI stFzgH36LHwZ6CxSdMOvw7D1JjSql/xRE6FtLuDRLMCDTGFP8xy9AEuRs0mIM/1KazP7 4gtx0CV9AYlcNWOB3xRhp1rvy5PFZugA9aWEsmYGeUxfhoocnFLDMVrjH4nkTEGfj50P 5aXg== X-Received: by 10.13.223.21 with SMTP id i21mr16811925ywe.20.1450734095757; Mon, 21 Dec 2015 13:41:35 -0800 (PST) Received: from mail-yk0-f177.google.com (mail-yk0-f177.google.com. [209.85.160.177]) by smtp.gmail.com with ESMTPSA id 204sm30519685ywz.39.2015.12.21.13.41.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Dec 2015 13:41:35 -0800 (PST) Received: by mail-yk0-f177.google.com with SMTP id v6so144210024ykc.2; Mon, 21 Dec 2015 13:41:35 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.32.70 with SMTP id g67mr16471110ywg.73.1450734095255; Mon, 21 Dec 2015 13:41:35 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.4.69 with HTTP; Mon, 21 Dec 2015 13:41:35 -0800 (PST) In-Reply-To: <9D7D1132-ED42-4F37-BEFD-AD62FB6321C7@panasas.com> References: <201512210442.tBL4gw6T007629@repo.freebsd.org> <9D7D1132-ED42-4F37-BEFD-AD62FB6321C7@panasas.com> Date: Mon, 21 Dec 2015 13:41:35 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r292528 - head/sys/x86/include From: Conrad Meyer To: Ravi Pokala 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 21:41:43 -0000 No, I didn't forget. AVX512VBMI is a flag in ECX ("cpu_stdext_feature2") rather than EBX ("cpu_stdext_feature"), and there aren't any macros for any of the ECX flags yet (PREFETCHWT1, AVX512VBMI, PKU, and OSPKE). Best, Conrad On Mon, Dec 21, 2015 at 12:57 PM, Ravi Pokala wrote: > -----Original Message----- > > > From: on behalf of "Conrad E. Meyer" > Date: 2015-12-20, Sunday at 20:42 > To: , , > Subject: svn commit: r292528 - head/sys/x86/include > >>Author: cem >>Date: Mon Dec 21 04:42:58 2015 >>New Revision: 292528 >>URL: https://svnweb.freebsd.org/changeset/base/292528 >> >>Log: >> x86: Add CPUID_STDEXT_* macros for CPU feature bits >> >> A follow-up to r292478 and r292488. > > Hi Conrad, > > Between those two changes, you added recognition for CLWB, PCOMMIT, AVX512DQ, AVX512IFMA, AVX512BW, and AVX512VBMI; this change adds macros for the first five, but it looks like you forgot about AVX512VBMI. > > -Ravi (rpokala@) > From owner-svn-src-all@freebsd.org Mon Dec 21 22:16:11 2015 Return-Path: Delivered-To: svn-src-all@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 1827CA4E1E3; Mon, 21 Dec 2015 22:16:11 +0000 (UTC) (envelope-from jhb@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 C2D261A34; Mon, 21 Dec 2015 22:16:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBLMG9mG026700; Mon, 21 Dec 2015 22:16:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLMG9pr026699; Mon, 21 Dec 2015 22:16:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512212216.tBLMG9pr026699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 21 Dec 2015 22:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292572 - stable/10/sys/i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 22:16:11 -0000 Author: jhb Date: Mon Dec 21 22:16:09 2015 New Revision: 292572 URL: https://svnweb.freebsd.org/changeset/base/292572 Log: MFC 291947: Set %esp correctly in the extended TSS. The pcb is saved at the top of the kernel stack on x86 platforms. The initial kenrel stack pointer is set in the TSS so that the trapframe from user -> kernel transitions begins directly below the pcb and grows down. The XSAVE changes moved the FPU save area out of the pcb and into a variable-sized area after the pcb. This required updating the expressions to calculate the initial stack pointer from 'stacktop - sizeof(pcb)' to 'stacktop - sizeof(pcb) + FPU save area size'. The i386_set_ioperm() system call allows user applications to access individual I/O ports via the I/O port permission bitmap in the TSS. On FreeBSD this requires allocating a custom per-process TSS instead of using the shared per-CPU TSS. The expression to initialize the initial kernel stack pointer in the per-process TSS created for i386_set_ioperm() was not properly updated after the XSAVE changes. Processes that used i386_set_ioperm() would trash the trapframe during subsequent context switches resulting in panics from memory corruption. This changes fixes the kernel stack pointer calculation for the per-process TSS. Modified: stable/10/sys/i386/i386/sys_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/i386/sys_machdep.c ============================================================================== --- stable/10/sys/i386/i386/sys_machdep.c Mon Dec 21 21:40:15 2015 (r292571) +++ stable/10/sys/i386/i386/sys_machdep.c Mon Dec 21 22:16:09 2015 (r292572) @@ -304,8 +304,7 @@ i386_extend_pcb(struct thread *td) ext = (struct pcb_ext *)kmem_malloc(kernel_arena, ctob(IOPAGES+1), M_WAITOK | M_ZERO); /* -16 is so we can convert a trapframe into vm86trapframe inplace */ - ext->ext_tss.tss_esp0 = td->td_kstack + ctob(KSTACK_PAGES) - - sizeof(struct pcb) - 16; + ext->ext_tss.tss_esp0 = (vm_offset_t)td->td_pcb - 16; ext->ext_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL); /* * The last byte of the i/o map must be followed by an 0xff byte. From owner-svn-src-all@freebsd.org Mon Dec 21 22:19:23 2015 Return-Path: Delivered-To: svn-src-all@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 D5C74A4E32D; Mon, 21 Dec 2015 22:19:23 +0000 (UTC) (envelope-from asomers@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 A63091BEF; Mon, 21 Dec 2015 22:19:23 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBLMJMjS026840; Mon, 21 Dec 2015 22:19:22 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLMJMNI026839; Mon, 21 Dec 2015 22:19:22 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201512212219.tBLMJMNI026839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 21 Dec 2015 22:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292573 - head/sbin/mount X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 22:19:23 -0000 Author: asomers Date: Mon Dec 21 22:19:22 2015 New Revision: 292573 URL: https://svnweb.freebsd.org/changeset/base/292573 Log: Fix "mount -a" for NFS and ZFS filesystems with shared mountpoints sbin/mount.c Check whether an fstab entry has the same fstype as a mounted filesystem before declaring it to be mounted. This will allow NFS filesystems that share a mountpoint with a local filesystem to be automatically mounted at boot. This is not such an unusual situation. For example, if somebody uses the standard installer with a ZFS root, he'll get a /usr/home filesystem, even though he may choose to mount /usr/home over NFS. Reviewed by: trasz MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4556 Modified: head/sbin/mount/mount.c Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Mon Dec 21 22:16:09 2015 (r292572) +++ head/sbin/mount/mount.c Mon Dec 21 22:19:22 2015 (r292573) @@ -485,10 +485,18 @@ ismounted(struct fstab *fs, struct statf strlcpy(realfsfile, fs->fs_file, sizeof(realfsfile)); } + /* + * Consider the filesystem to be mounted if: + * It has the same mountpoint as a mounted filesytem, and + * It has the same type as that same mounted filesystem, and + * It has the same device name as that same mounted filesystem, OR + * It is a nonremountable filesystem + */ for (i = mntsize - 1; i >= 0; --i) if (strcmp(realfsfile, mntbuf[i].f_mntonname) == 0 && + strcmp(fs->fs_vfstype, mntbuf[i].f_fstypename) == 0 && (!isremountable(fs->fs_vfstype) || - strcmp(fs->fs_spec, mntbuf[i].f_mntfromname) == 0)) + (strcmp(fs->fs_spec, mntbuf[i].f_mntfromname) == 0))) return (1); return (0); } From owner-svn-src-all@freebsd.org Mon Dec 21 22:25:37 2015 Return-Path: Delivered-To: svn-src-all@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 5A94CA4E5FC; Mon, 21 Dec 2015 22:25: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 20D041021; Mon, 21 Dec 2015 22:25: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 tBLMPaXr029655; Mon, 21 Dec 2015 22:25:36 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLMPaLw029652; Mon, 21 Dec 2015 22:25:36 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201512212225.tBLMPaLw029652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 21 Dec 2015 22:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292574 - in head/sys/arm: conf freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 22:25:37 -0000 Author: gonzo Date: Mon Dec 21 22:25:35 2015 New Revision: 292574 URL: https://svnweb.freebsd.org/changeset/base/292574 Log: Add i.MX 6 IPU driver and enable it in IMX6 config Current functionality is somewhat limited: driver assumes that there is only one active IPU unit (IPU1) and that video output is DI0 and video mode is 1024x768. For more advanced functionality driver requires proper clock management which is work in progress. At the moment driver assumes that pixel clock is configured by u-boot for 1026x768 mode. Reviewed by: andrew, ian, mmel Differential Revision: https://reviews.freebsd.org/D4168 Added: head/sys/arm/freescale/imx/imx6_ipu.c (contents, props changed) Modified: head/sys/arm/conf/IMX6 head/sys/arm/freescale/imx/files.imx6 Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Mon Dec 21 22:19:22 2015 (r292573) +++ head/sys/arm/conf/IMX6 Mon Dec 21 22:25:35 2015 (r292574) @@ -133,6 +133,9 @@ device u3g # USB modems #options SC_DFLT_FONT # compile font in #makeoptions SC_DFLT_FONT=cp437 +device vt +device kbdmux +device ukbd device videomode device hdmi Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Mon Dec 21 22:19:22 2015 (r292573) +++ head/sys/arm/freescale/imx/files.imx6 Mon Dec 21 22:25:35 2015 (r292574) @@ -27,6 +27,8 @@ arm/freescale/imx/imx6_ssi.c optional s arm/arm/hdmi_if.m optional hdmi arm/freescale/imx/imx6_hdmi.c optional hdmi +arm/freescale/imx/imx6_ipu.c optional vt + # # Optional devices. # Added: head/sys/arm/freescale/imx/imx6_ipu.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_ipu.c Mon Dec 21 22:25:35 2015 (r292574) @@ -0,0 +1,1203 @@ +/*- + * Copyright 2015 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include "fb_if.h" +#include "hdmi_if.h" + +#define EDID_DEBUG_not + +static int have_ipu = 0; + +#define LDB_CLOCK_RATE 280000000 + +#define MODE_HBP(mode) ((mode)->htotal - (mode)->hsync_end) +#define MODE_HFP(mode) ((mode)->hsync_start - (mode)->hdisplay) +#define MODE_HSW(mode) ((mode)->hsync_end - (mode)->hsync_start) +#define MODE_VBP(mode) ((mode)->vtotal - (mode)->vsync_end) +#define MODE_VFP(mode) ((mode)->vsync_start - (mode)->vdisplay) +#define MODE_VSW(mode) ((mode)->vsync_end - (mode)->vsync_start) + +#define MODE_BPP 16 +#define MODE_PIXEL_CLOCK_INVERT 1 + +#define M(nm,hr,vr,clk,hs,he,ht,vs,ve,vt,f) \ + { clk, hr, hs, he, ht, vr, vs, ve, vt, f, nm } + +static struct videomode mode1024x768 = M("1024x768x60",1024,768,65000,1048,1184,1344,771,777,806,VID_NHSYNC|VID_PHSYNC); + +#define DMA_CHANNEL 23 +#define DC_CHAN5 5 +#define DI_PORT 0 + +#define IPU_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define IPU_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define IPU_LOCK_INIT(_sc) mtx_init(&(_sc)->sc_mtx, \ + device_get_nameunit(_sc->sc_dev), "ipu", MTX_DEF) +#define IPU_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx) + +#define IPU_READ4(_sc, reg) bus_read_4((_sc)->sc_mem_res, (reg)) +#define IPU_WRITE4(_sc, reg, value) \ + bus_write_4((_sc)->sc_mem_res, (reg), (value)) + +#define CPMEM_BASE 0x300000 +#define DC_TEMPL_BASE 0x380000 + +/* Microcode */ +/* Word 1 */ +#define TEMPLATE_SYNC(v) ((v) << 0) +#define TEMPLATE_GLUELOGIC(v) ((v) << 4) +#define TEMPLATE_MAPPING(v) ((v) << 15) +#define TEMPLATE_WAVEFORM(v) ((v) << 11) +#define GLUELOGIC_KEEP_ASSERTED (1 << 3) +#define GLUELOGIC_KEEP_NEGATED (1 << 2) +/* Word 2 */ +#define TEMPLATE_OPCODE(v) ((v) << 4) +#define OPCODE_WROD 0x18 +#define TEMPLATE_STOP (1 << 9) + +#define IPU_CONF 0x200000 +#define IPU_CONF_DMFC_EN (1 << 10) +#define IPU_CONF_DC_EN (1 << 9) +#define IPU_CONF_DI1_EN (1 << 7) +#define IPU_CONF_DI0_EN (1 << 6) +#define IPU_CONF_DP_EN (1 << 5) +#define IPU_DISP_GEN 0x2000C4 +#define DISP_GEN_DI1_CNTR_RELEASE (1 << 25) +#define DISP_GEN_DI0_CNTR_RELEASE (1 << 24) +#define DISP_GEN_MCU_MAX_BURST_STOP (1 << 22) +#define DISP_GEN_MCU_T_SHIFT 18 +#define IPU_MEM_RST 0x2000DC +#define IPU_MEM_RST_START (1 << 31) +#define IPU_MEM_RST_ALL 0x807FFFFF +#define IPU_CH_DB_MODE_SEL_0 0x200150 +#define IPU_CH_DB_MODE_SEL_1 0x200154 +#define IPU_CUR_BUF_0 0x20023C +#define IPU_CUR_BUF_1 0x200240 + +#define IPU_IDMAC_CH_EN_1 0x208004 +#define IPU_IDMAC_CH_EN_2 0x208008 +#define IPU_IDMAC_CH_PRI_1 0x208014 +#define IPU_IDMAC_CH_PRI_2 0x208018 + +#define IPU_DI0_GENERAL 0x240000 +#define DI_CLOCK_EXTERNAL (1 << 20) +#define DI_GENERAL_POL_CLK (1 << 17) +#define DI_GENERAL_POLARITY_3 (1 << 2) +#define DI_GENERAL_POLARITY_2 (1 << 1) +#define IPU_DI0_BS_CLKGEN0 0x240004 +#define DI_BS_CLKGEN0(_int, _frac) (((_int) << 4) | (_frac)) +#define IPU_DI0_BS_CLKGEN1 0x240008 +#define DI_BS_CLKGEN1_DOWN(_int, _frac) ((((_int) << 1) | (_frac)) << 16) +#define IPU_DI0_SW_GEN0_1 0x24000C +#define DI_RUN_VALUE_M1(v) ((v) << 19) +#define DI_RUN_RESOLUTION(v) ((v) << 16) +#define DI_OFFSET_VALUE(v) ((v) << 3) +#define IPU_DI0_SW_GEN1_1 0x240030 +#define DI_CNT_POLARITY_GEN_EN(v) ((v) << 29) +#define DI_CNT_AUTO_RELOAD (1 << 28) +#define DI_CNT_CLR_SEL(v) ((v) << 25) +#define DI_CNT_DOWN(v) ((v) << 16) +#define DI_CNT_POLARITY_TRIGGER_SEL(v) ((v) << 12) +#define DI_CNT_POLARITY_CLR_SEL(v) ((v) << 9) +#define IPU_DI0_SYNC_AS_GEN 0x240054 +#define SYNC_AS_GEN_VSYNC_SEL(v) ((v) << 13) +#define SYNC_AS_GEN_SYNC_START(v) ((v) << 0) +#define IPU_DI0_DW_GEN_0 0x240058 +#define DW_GEN_DI_ACCESS_SIZE(v) ((v) << 24) +#define DW_GEN_DI_COMPONENT_SIZE(v) ((v) << 16) +#define DW_GEN_DI_SET_MASK 3 +#define DW_GEN_DI_PIN_15_SET(v) ((v) << 8) +#define IPU_DI0_DW_SET3_0 0x240118 +#define DW_SET_DATA_CNT_DOWN(v) ((v) << 16) +#define DW_SET_DATA_CNT_UP(v) ((v) << 0) +#define IPU_DI0_STP_REP 0x240148 +#define IPU_DI0_POL 0x240164 +#define DI_POL_DRDY_POLARITY_15 (1 << 4) +#define IPU_DI0_SCR_CONF 0x240170 + +#define IPU_DI1_GENERAL 0x248000 +#define IPU_DI1_BS_CLKGEN0 0x248004 +#define IPU_DI1_BS_CLKGEN1 0x248008 +#define IPU_DI1_SW_GEN0_1 0x24800C +#define IPU_DI1_SW_GEN1_1 0x248030 +#define IPU_DI1_SYNC_AS_GEN 0x248054 +#define IPU_DI1_DW_GEN_0 0x248058 +#define IPU_DI1_POL 0x248164 +#define IPU_DI1_DW_SET3_0 0x248118 +#define IPU_DI1_STP_REP 0x248148 +#define IPU_DI1_SCR_CONF 0x248170 +#define DMFC_RD_CHAN 0x260000 +#define DMFC_WR_CHAN 0x260004 +#define DMFC_WR_CHAN_BURST_SIZE_32 (0 << 6) +#define DMFC_WR_CHAN_BURST_SIZE_16 (1 << 6) +#define DMFC_WR_CHAN_BURST_SIZE_8 (2 << 6) +#define DMFC_WR_CHAN_BURST_SIZE_4 (3 << 6) +#define DMFC_WR_CHAN_BURST_SIZE_4 (3 << 6) +#define DMFC_WR_CHAN_FIFO_SIZE_128 (2 << 3) +#define DMFC_WR_CHAN_DEF 0x260008 +#define DMFC_WR_CHAN_DEF_WM_CLR_2C(v) ((v) << 29) +#define DMFC_WR_CHAN_DEF_WM_CLR_1C(v) ((v) << 21) +#define DMFC_WR_CHAN_DEF_WM_CLR_2(v) ((v) << 13) +#define DMFC_WR_CHAN_DEF_WM_CLR_1(v) ((v) << 5) +#define DMFC_WR_CHAN_DEF_WM_SET_1(v) ((v) << 2) +#define DMFC_WR_CHAN_DEF_WM_EN_1 (1 << 1) +#define DMFC_DP_CHAN 0x26000C +#define DMFC_DP_CHAN_BURST_SIZE_8 2 +#define DMFC_DP_CHAN_FIFO_SIZE_256 1 +#define DMFC_DP_CHAN_FIFO_SIZE_128 2 +#define DMFC_DP_CHAN_BURST_SIZE_5F(v) ((v) << 14) +#define DMFC_DP_CHAN_FIFO_SIZE_5F(v) ((v) << 11) +#define DMFC_DP_CHAN_ST_ADDR_SIZE_5F(v) ((v) << 8) +#define DMFC_DP_CHAN_BURST_SIZE_5B(v) ((v) << 6) +#define DMFC_DP_CHAN_FIFO_SIZE_5B(v) ((v) << 3) +#define DMFC_DP_CHAN_ST_ADDR_SIZE_5B(v) ((v) << 0) +#define DMFC_DP_CHAN_DEF 0x260010 +#define DMFC_DP_CHAN_DEF_WM_CLR_6F(v) ((v) << 29) +#define DMFC_DP_CHAN_DEF_WM_CLR_6B(v) ((v) << 21) +#define DMFC_DP_CHAN_DEF_WM_CLR_5F(v) ((v) << 13) +#define DMFC_DP_CHAN_DEF_WM_SET_5F(v) ((v) << 10) +#define DMFC_DP_CHAN_DEF_WM_EN_5F (1 << 9) +#define DMFC_DP_CHAN_DEF_WM_CLR_5B(v) ((v) << 5) +#define DMFC_DP_CHAN_DEF_WM_SET_5B(v) ((v) << 2) +#define DMFC_DP_CHAN_DEF_WM_EN_5B (1 << 1) +#define DMFC_GENERAL_1 0x260014 +#define DMFC_GENERAL_1_WAIT4EOT_5B (1 << 20) +#define DMFC_IC_CTRL 0x26001C +#define DMFC_IC_CTRL_DISABLED 0x2 + +#define DC_WRITE_CH_CONF_1 0x0025801C +#define WRITE_CH_CONF_PROG_CHAN_TYP_MASK (7 << 5) +#define WRITE_CH_CONF_PROG_CHAN_NORMAL (4 << 5) +#define DC_WRITE_CH_ADDR_1 0x00258020 +#define DC_WRITE_CH_CONF_5 0x0025805C +#define WRITE_CH_CONF_PROG_DISP_ID(v) ((v) << 3) +#define WRITE_CH_CONF_PROG_DI_ID(v) ((v) << 2) +#define WRITE_CH_CONF_PROG_W_SIZE(v) (v) +#define DC_WRITE_CH_ADDR_5 0x00258060 +#define DC_RL0_CH_5 0x00258064 +#define DC_GEN 0x002580D4 +#define DC_GEN_SYNC_PRIORITY (1 << 7) +#define DC_GEN_ASYNC (0 << 1) +#define DC_GEN_SYNC (2 << 1) +#define DC_DISP_CONF2(di) (0x002580E8 + (di) * 4) +#define DC_MAP_CONF_0 0x00258108 +#define DC_MAP_CONF_15 0x00258144 +#define DC_MAP_CONF_VAL(map) (DC_MAP_CONF_15 + ((map) / 2) * sizeof(uint32_t)) +#define MAP_CONF_VAL_MASK 0xffff +#define DC_MAP_CONF_PTR(ptr) (DC_MAP_CONF_0 + ((ptr) / 2) * sizeof(uint32_t)) +#define MAP_CONF_PTR_MASK 0x1f + +#define DI_COUNTER_INT_HSYNC 1 +#define DI_COUNTER_HSYNC 2 +#define DI_COUNTER_VSYNC 3 +#define DI_COUNTER_AD_0 4 +#define DI_COUNTER_AD_1 5 + +#define DI_SYNC_NONE 0 +#define DI_SYNC_CLK 1 +#define DI_SYNC_COUNTER(c) ((c) + 1) + +struct ipu_cpmem_word { + uint32_t data[5]; + uint32_t padding[3]; +}; + +struct ipu_cpmem_ch_param { + struct ipu_cpmem_word word[2]; +}; + +#define CH_PARAM_RESET(param) memset(param, 0, sizeof(*param)) +#define IPU_READ_CH_PARAM(_sc, ch, param) bus_read_region_4( \ + (_sc)->sc_mem_res, CPMEM_BASE + ch * (sizeof(*param)),\ + (uint32_t*)param, sizeof(*param) / 4) +#define IPU_WRITE_CH_PARAM(_sc, ch, param) bus_write_region_4( \ + (_sc)->sc_mem_res, CPMEM_BASE + ch * (sizeof(*param)),\ + (uint32_t*)param, sizeof(*param) / 4) + +#define CH_PARAM_SET_FW(param, v) ipu_ch_param_set_value((param), \ + 0, 125, 13, (v)) +#define CH_PARAM_SET_FH(param, v) ipu_ch_param_set_value((param), \ + 0, 138, 12, (v)) +#define CH_PARAM_SET_SLY(param, v) ipu_ch_param_set_value((param), \ + 1, 102, 14, (v)) +#define CH_PARAM_SET_EBA0(param, v) ipu_ch_param_set_value((param), \ + 1, 0, 29, (v)) +#define CH_PARAM_SET_EBA1(param, v) ipu_ch_param_set_value((param), \ + 1, 29, 29, (v)) +#define CH_PARAM_SET_BPP(param, v) ipu_ch_param_set_value((param), \ + 0, 107, 3, (v)) +#define CH_PARAM_SET_PFS(param, v) ipu_ch_param_set_value((param), \ + 1, 85, 4, (v)) +#define CH_PARAM_SET_NPB(param, v) ipu_ch_param_set_value((param), \ + 1, 78, 7, (v)) +#define CH_PARAM_SET_UBO(param, v) ipu_ch_param_set_value((param), \ + 0, 46, 22, (v)) +#define CH_PARAM_SET_VBO(param, v) ipu_ch_param_set_value((param), \ + 0, 68, 22, (v)) + +#define CH_PARAM_SET_RED_WIDTH(param, v) ipu_ch_param_set_value((param), \ + 1, 116, 3, (v)) +#define CH_PARAM_SET_RED_OFFSET(param, v) ipu_ch_param_set_value((param), \ + 1, 128, 5, (v)) + +#define CH_PARAM_SET_GREEN_WIDTH(param, v) ipu_ch_param_set_value((param), \ + 1, 119, 3, (v)) +#define CH_PARAM_SET_GREEN_OFFSET(param, v) ipu_ch_param_set_value((param), \ + 1, 133, 5, (v)) + +#define CH_PARAM_SET_BLUE_WIDTH(param, v) ipu_ch_param_set_value((param), \ + 1, 122, 3, (v)) +#define CH_PARAM_SET_BLUE_OFFSET(param, v) ipu_ch_param_set_value((param), \ + 1, 138, 5, (v)) + +#define CH_PARAM_SET_ALPHA_WIDTH(param, v) ipu_ch_param_set_value((param), \ + 1, 125, 3, (v)) +#define CH_PARAM_SET_ALPHA_OFFSET(param, v) ipu_ch_param_set_value((param), \ + 1, 143, 5, (v)) + +#define CH_PARAM_GET_FW(param) ipu_ch_param_get_value((param), \ + 0, 125, 13) +#define CH_PARAM_GET_FH(param) ipu_ch_param_get_value((param), \ + 0, 138, 12) +#define CH_PARAM_GET_SLY(param) ipu_ch_param_get_value((param), \ + 1, 102, 14) +#define CH_PARAM_GET_EBA0(param) ipu_ch_param_get_value((param), \ + 1, 0, 29) +#define CH_PARAM_GET_EBA1(param) ipu_ch_param_get_value((param), \ + 1, 29, 29) +#define CH_PARAM_GET_BPP(param) ipu_ch_param_get_value((param), \ + 0, 107, 3) +#define CH_PARAM_GET_PFS(param) ipu_ch_param_get_value((param), \ + 1, 85, 4) +#define CH_PARAM_GET_NPB(param) ipu_ch_param_get_value((param), \ + 1, 78, 7) +#define CH_PARAM_GET_UBO(param) ipu_ch_param_get_value((param), \ + 0, 46, 22) +#define CH_PARAM_GET_VBO(param) ipu_ch_param_get_value((param), \ + 0, 68, 22) + +#define CH_PARAM_GET_RED_WIDTH(param) ipu_ch_param_get_value((param), \ + 1, 116, 3) +#define CH_PARAM_GET_RED_OFFSET(param) ipu_ch_param_get_value((param), \ + 1, 128, 5) + +#define CH_PARAM_GET_GREEN_WIDTH(param) ipu_ch_param_get_value((param), \ + 1, 119, 3) +#define CH_PARAM_GET_GREEN_OFFSET(param) ipu_ch_param_get_value((param), \ + 1, 133, 5) + +#define CH_PARAM_GET_BLUE_WIDTH(param) ipu_ch_param_get_value((param), \ + 1, 122, 3) +#define CH_PARAM_GET_BLUE_OFFSET(param) ipu_ch_param_get_value((param), \ + 1, 138, 5) + +#define CH_PARAM_GET_ALPHA_WIDTH(param) ipu_ch_param_get_value((param), \ + 1, 125, 3) +#define CH_PARAM_GET_ALPHA_OFFSET(param) ipu_ch_param_get_value((param), \ + 1, 143, 5) + +#define IPU_PIX_FORMAT_BPP_32 0 +#define IPU_PIX_FORMAT_BPP_24 1 +#define IPU_PIX_FORMAT_BPP_18 2 +#define IPU_PIX_FORMAT_BPP_16 3 +#define IPU_PIX_FORMAT_BPP_12 4 +#define IPU_PIX_FORMAT_BPP_8 5 +#define IPU_PIX_FORMAT_BPP_ + +#define IPU_PIX_FORMAT_RGB 7 + +enum dc_event_t { + DC_EVENT_NF = 0, + DC_EVENT_NL, + DC_EVENT_EOF, + DC_EVENT_NFIELD, + DC_EVENT_EOL, + DC_EVENT_EOFIELD, + DC_EVENT_NEW_ADDR, + DC_EVENT_NEW_CHAN, + DC_EVENT_NEW_DATA +}; + +struct ipu_softc { + device_t sc_dev; + struct resource *sc_mem_res; + int sc_mem_rid; + struct resource *sc_irq_res; + int sc_irq_rid; + void *sc_intr_hl; + struct mtx sc_mtx; + struct fb_info sc_fb_info; + struct videomode *sc_mode; + + /* Framebuffer */ + bus_dma_tag_t sc_dma_tag; + bus_dmamap_t sc_dma_map; + size_t sc_fb_size; + bus_addr_t sc_fb_phys; + uint8_t *sc_fb_base; + + /* HDMI */ + eventhandler_tag sc_hdmi_evh; +}; + +static void +ipu_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) +{ + bus_addr_t *addr; + + if (err) + return; + + addr = (bus_addr_t*)arg; + *addr = segs[0].ds_addr; +} + +static void +ipu_ch_param_set_value(struct ipu_cpmem_ch_param *param, + int word, unsigned int offset, int len, uint32_t value) +{ + uint32_t datapos, bitpos, mask; + uint32_t data, data2; + + KASSERT((len <= 32), ("%s: field len is more than 32", __func__)); + + datapos = offset / 32; + bitpos = offset % 32; + + mask = (1 << len) - 1; + data = param->word[word].data[datapos]; + data &= ~(mask << bitpos); + data |= (value << bitpos); + param->word[word].data[datapos] = data; + + if ((bitpos + len) > 32) { + len = bitpos + len - 32; + mask = (1UL << len) - 1; + data2 = param->word[word].data[datapos + 1]; + data2 &= mask; + data2 |= (value >> (32 - bitpos)); + param->word[word].data[datapos + 1] = data2; + } +} + +#ifdef DEBUG +static uint32_t +ipu_ch_param_get_value(struct ipu_cpmem_ch_param *param, + int word, unsigned int offset, int len) +{ + uint32_t datapos, bitpos, mask; + uint32_t data, data2; + + KASSERT((len <= 32), ("%s: field len is more than 32", __func__)); + + datapos = offset / 32; + bitpos = offset % 32; + mask = (1UL << len) - 1; + data = param->word[word].data[datapos]; + data = data >> bitpos; + data &= mask; + if ((bitpos + len) > 32) { + len = bitpos + len - 32; + mask = (1UL << len) - 1; + data2 = param->word[word].data[datapos + 1]; + data2 &= mask; + data |= (data2 << (32 - bitpos)); + } + + return (data); +} + +static void +ipu_print_channel(struct ipu_cpmem_ch_param *param) +{ + int offset0[] = {0, 10, 19, 32, 44, 45, 46, 68, 90, 94, 95, 113, 114, 117, 119, 120, 121, 122, 123, 124, 125, 138, 150, 151, -1}; + int offset1[] = {0, 29, 58, 78, 85, 89, 90, 93, 95, 102, 116, 119, 122, 125, 128, 133, 138, 143, 148, 149, 150, -1}; + printf("WORD0: %08x %08x %08x %08x %08x\n", + param->word[0].data[0], param->word[0].data[1], + param->word[0].data[2], param->word[0].data[3], + param->word[0].data[4]); + printf("WORD1: %08x %08x %08x %08x %08x\n", + param->word[1].data[0], param->word[1].data[1], + param->word[1].data[2], param->word[1].data[3], + param->word[1].data[4]); + + for (int i = 0; offset0[i + 1] != -1; i++) { + int len = offset0[i + 1] - offset0[i]; + printf("W0[%d:%d] = %d\n", offset0[i], + offset0[i] + len - 1, + ipu_ch_param_get_value(param, 0, offset0[i], len) + ); + } + + for (int i = 0; offset1[i + 1] != -1; i++) { + int len = offset1[i + 1] - offset1[i]; + printf("W1[%d:%d] = %d\n", offset1[i], + offset1[i] + len - 1, + ipu_ch_param_get_value(param, 1, offset1[i], len) + ); + } + + printf("FW: %d\n", CH_PARAM_GET_FW(param)); + printf("FH: %d\n", CH_PARAM_GET_FH(param)); + printf("SLY: %d\n", CH_PARAM_GET_SLY(param)); + printf("EBA0: 0x%08x\n", CH_PARAM_GET_EBA0(param)); + printf("EBA1: 0x%08x\n", CH_PARAM_GET_EBA1(param)); + printf("BPP: %d\n", CH_PARAM_GET_BPP(param)); + printf("PFS: %d\n", CH_PARAM_GET_PFS(param)); + printf("NPB: %d\n", CH_PARAM_GET_NPB(param)); + printf("UBO: %d\n", CH_PARAM_GET_UBO(param)); + printf("VBO: %d\n", CH_PARAM_GET_VBO(param)); + printf("RED: %d bits @%d\n", CH_PARAM_GET_RED_WIDTH(param) + 1, + CH_PARAM_GET_RED_OFFSET(param)); + printf("GREEN: %d bits @%d\n", CH_PARAM_GET_GREEN_WIDTH(param) + 1, + CH_PARAM_GET_GREEN_OFFSET(param)); + printf("BLUE: %d bits @%d\n", CH_PARAM_GET_BLUE_WIDTH(param) + 1, + CH_PARAM_GET_BLUE_OFFSET(param)); + printf("ALPHA: %d bits @%d\n", CH_PARAM_GET_ALPHA_WIDTH(param) + 1, + CH_PARAM_GET_ALPHA_OFFSET(param)); +} +#endif + +static void +ipu_di_enable(struct ipu_softc *sc, int di) +{ + uint32_t flag, reg; + + flag = di ? DISP_GEN_DI1_CNTR_RELEASE : DISP_GEN_DI0_CNTR_RELEASE; + reg = IPU_READ4(sc, IPU_DISP_GEN); + reg |= flag; + IPU_WRITE4(sc, IPU_DISP_GEN, reg); +} + +static void +ipu_config_wave_gen_0(struct ipu_softc *sc, int di, + int wave_gen, int run_value, int run_res, + int offset_value, int offset_res) +{ + uint32_t addr, reg; + + addr = (di ? IPU_DI1_SW_GEN0_1 : IPU_DI0_SW_GEN0_1) + + (wave_gen - 1) * sizeof(uint32_t); + reg = DI_RUN_VALUE_M1(run_value) | + DI_RUN_RESOLUTION(run_res) | + DI_OFFSET_VALUE(offset_value) | offset_res; + IPU_WRITE4(sc, addr, reg); +} + +static void +ipu_config_wave_gen_1(struct ipu_softc *sc, int di, int wave_gen, + int repeat_count, int cnt_clr_src, + int cnt_polarity_gen_en, + int cnt_polarity_clr_src, + int cnt_polarity_trigger_src, + int cnt_up, int cnt_down) +{ + uint32_t addr, reg; + + addr = (di ? IPU_DI1_SW_GEN1_1 : IPU_DI0_SW_GEN1_1) + + (wave_gen - 1) * sizeof(uint32_t); + reg = DI_CNT_POLARITY_GEN_EN(cnt_polarity_gen_en) | + DI_CNT_CLR_SEL(cnt_clr_src) | + DI_CNT_POLARITY_TRIGGER_SEL(cnt_polarity_trigger_src) | + DI_CNT_POLARITY_CLR_SEL(cnt_polarity_clr_src); + reg |= DI_CNT_DOWN(cnt_down) | cnt_up; + if (repeat_count == 0) + reg |= DI_CNT_AUTO_RELOAD; + IPU_WRITE4(sc, addr, reg); + + addr = (di ? IPU_DI1_STP_REP : IPU_DI0_STP_REP) + + (wave_gen - 1) / 2 * sizeof(uint32_t); + reg = IPU_READ4(sc, addr); + if (wave_gen % 2) { + reg &= ~(0xffff); + reg |= repeat_count; + } + else { + reg &= ~(0xffff << 16); + reg |= (repeat_count << 16); + } + IPU_WRITE4(sc, addr, reg); +} + +static void +ipu_reset_wave_gen(struct ipu_softc *sc, int di, + int wave_gen) +{ + uint32_t addr, reg; + + addr = (di ? IPU_DI1_SW_GEN0_1 : IPU_DI0_SW_GEN0_1) + + (wave_gen - 1) * sizeof(uint32_t); + IPU_WRITE4(sc, addr, 0); + + addr = (di ? IPU_DI1_SW_GEN1_1 : IPU_DI0_SW_GEN1_1) + + (wave_gen - 1) * sizeof(uint32_t); + IPU_WRITE4(sc, addr, 0); + + addr = (di ? IPU_DI1_STP_REP : IPU_DI0_STP_REP) + + (wave_gen - 1) / 2 * sizeof(uint32_t); + reg = IPU_READ4(sc, addr); + if (wave_gen % 2) + reg &= ~(0xffff); + else + reg &= ~(0xffff << 16); + IPU_WRITE4(sc, addr, reg); +} + +static void +ipu_init_microcode_template(struct ipu_softc *sc, int di, int map) +{ + uint32_t addr; + uint32_t w1, w2; + int i, word; + int glue; + + word = di ? 2 : 5; + + for (i = 0; i < 3; i++) { + if (i == 0) + glue = GLUELOGIC_KEEP_ASSERTED; + else if (i == 1) + glue = GLUELOGIC_KEEP_NEGATED; + else if (i == 2) + glue = 0; + + w1 = TEMPLATE_SYNC(5) | + TEMPLATE_GLUELOGIC(glue) | + TEMPLATE_WAVEFORM(1) | /* wave unit 0 */ + TEMPLATE_MAPPING(map + 1); + /* operand is zero */ + + /* Write data to DI and Hold data in register */ + w2 = TEMPLATE_OPCODE(OPCODE_WROD) | + TEMPLATE_STOP; + + addr = DC_TEMPL_BASE + (word + i) * 2 * sizeof(uint32_t); + IPU_WRITE4(sc, addr, w1); + IPU_WRITE4(sc, addr + sizeof(uint32_t), w2); + } +} + +static void +ipu_config_timing(struct ipu_softc *sc, int di) +{ + int div; + uint32_t di_scr_conf; + uint32_t gen_offset, gen; + uint32_t as_gen_offset, as_gen; + uint32_t dw_gen_offset, dw_gen; + uint32_t dw_set_offset, dw_set; + uint32_t bs_clkgen_offset; + int map; + + /* TODO: check mode restrictions / fixup */ + /* TODO: enable timers, get divisors */ + div = 1; + map = 0; + + bs_clkgen_offset = di ? IPU_DI1_BS_CLKGEN0 : IPU_DI0_BS_CLKGEN0; + IPU_WRITE4(sc, bs_clkgen_offset, DI_BS_CLKGEN0(div, 0)); + /* half of the divider */ + IPU_WRITE4(sc, bs_clkgen_offset + 4, DI_BS_CLKGEN1_DOWN(div / 2, div % 2)); + + /* + * TODO: Configure LLDB clock by changing following fields + * in CCM fields: + * CS2CDR_LDB_DI0_CLK_SEL + * CSCMR2_LDB_DI0_IPU_DIV + * CBCDR_MMDC_CH1_AXI_PODF + */ + + /* Setup wave generator */ + dw_gen_offset = di ? IPU_DI1_DW_GEN_0 : IPU_DI0_DW_GEN_0; + dw_gen = DW_GEN_DI_ACCESS_SIZE(div - 1) | DW_GEN_DI_COMPONENT_SIZE(div - 1); + dw_gen &= ~DW_GEN_DI_PIN_15_SET(DW_GEN_DI_SET_MASK); + dw_gen |= DW_GEN_DI_PIN_15_SET(3); /* set 3*/ + IPU_WRITE4(sc, dw_gen_offset, dw_gen); + + dw_set_offset = di ? IPU_DI1_DW_SET3_0 : IPU_DI0_DW_SET3_0; + dw_set = DW_SET_DATA_CNT_DOWN(div * 2) | DW_SET_DATA_CNT_UP(0); + IPU_WRITE4(sc, dw_set_offset, dw_set); + + /* DI_COUNTER_INT_HSYNC */ + ipu_config_wave_gen_0(sc, di, DI_COUNTER_INT_HSYNC, + sc->sc_mode->htotal - 1, DI_SYNC_CLK, 0, DI_SYNC_NONE); + ipu_config_wave_gen_1(sc, di, DI_COUNTER_INT_HSYNC, + 0, DI_SYNC_NONE, 0, DI_SYNC_NONE, DI_SYNC_NONE, 0, 0); + + /* DI_COUNTER_HSYNC */ + ipu_config_wave_gen_0(sc, di, DI_COUNTER_HSYNC, + sc->sc_mode->htotal - 1, DI_SYNC_CLK, 0, DI_SYNC_CLK); + ipu_config_wave_gen_1(sc, di, DI_COUNTER_HSYNC, + 0, DI_SYNC_NONE, 1, DI_SYNC_NONE, DI_SYNC_CLK, + 0, MODE_HSW(sc->sc_mode) * 2); + + /* DI_COUNTER_VSYNC */ + ipu_config_wave_gen_0(sc, di, DI_COUNTER_VSYNC, + sc->sc_mode->vtotal - 1, DI_SYNC_COUNTER(DI_COUNTER_INT_HSYNC), + 0, DI_SYNC_NONE); + ipu_config_wave_gen_1(sc, di, DI_COUNTER_VSYNC, + 0, DI_SYNC_NONE, 1, DI_SYNC_NONE, + DI_SYNC_COUNTER(DI_COUNTER_INT_HSYNC), + 0, MODE_VSW(sc->sc_mode) * 2); + + di_scr_conf = di ? IPU_DI1_SCR_CONF : IPU_DI0_SCR_CONF; + IPU_WRITE4(sc, di_scr_conf, sc->sc_mode->vtotal - 1); + + /* TODO: update DI_SCR_CONF */ + + /* Active Data 0 */ + ipu_config_wave_gen_0(sc, di, DI_COUNTER_AD_0, + 0, DI_SYNC_COUNTER(DI_COUNTER_HSYNC), + MODE_VSW(sc->sc_mode) + MODE_VFP(sc->sc_mode), DI_SYNC_COUNTER(DI_COUNTER_HSYNC)); + ipu_config_wave_gen_1(sc, di, DI_COUNTER_AD_0, + sc->sc_mode->vdisplay, DI_SYNC_COUNTER(DI_COUNTER_VSYNC), + 0, DI_SYNC_NONE, DI_SYNC_NONE, 0, 0); + + ipu_config_wave_gen_0(sc, di, DI_COUNTER_AD_1, + 0, DI_SYNC_CLK, MODE_HSW(sc->sc_mode) + MODE_HFP(sc->sc_mode), DI_SYNC_CLK); + ipu_config_wave_gen_1(sc, di, DI_COUNTER_AD_1, + sc->sc_mode->hdisplay, DI_SYNC_COUNTER(DI_COUNTER_AD_0), + 0, DI_SYNC_NONE, DI_SYNC_NONE, 0, 0); + + ipu_reset_wave_gen(sc, di, 6); + ipu_reset_wave_gen(sc, di, 7); + ipu_reset_wave_gen(sc, di, 8); + ipu_reset_wave_gen(sc, di, 9); + + ipu_init_microcode_template(sc, di, map); + + gen_offset = di ? IPU_DI1_GENERAL : IPU_DI0_GENERAL; + gen = IPU_READ4(sc, gen_offset); + + if (sc->sc_mode->flags & VID_NHSYNC) + gen &= ~DI_GENERAL_POLARITY_2; + else /* active high */ + gen |= DI_GENERAL_POLARITY_2; + + if (sc->sc_mode->flags & VID_NVSYNC) + gen &= ~DI_GENERAL_POLARITY_3; + else /* active high */ + gen |= DI_GENERAL_POLARITY_3; + + if (MODE_PIXEL_CLOCK_INVERT) + gen &= ~DI_GENERAL_POL_CLK; + else + gen |= DI_GENERAL_POL_CLK; + + /* Use LDB clock to drive pixel clock */ + gen |= DI_CLOCK_EXTERNAL; + + IPU_WRITE4(sc, gen_offset, gen); + + as_gen_offset = di ? IPU_DI1_SYNC_AS_GEN : IPU_DI0_SYNC_AS_GEN; + as_gen = SYNC_AS_GEN_VSYNC_SEL(DI_COUNTER_VSYNC - 1) | + SYNC_AS_GEN_SYNC_START(2); + IPU_WRITE4(sc, as_gen_offset, as_gen); + + IPU_WRITE4(sc, (di ? IPU_DI1_POL : IPU_DI0_POL), DI_POL_DRDY_POLARITY_15); + + IPU_WRITE4(sc, DC_DISP_CONF2(di), sc->sc_mode->hdisplay); +} + +static void +ipu_dc_enable(struct ipu_softc *sc) +{ + uint32_t conf; + + /* channel 1 uses DI1 */ + IPU_WRITE4(sc, DC_WRITE_CH_CONF_1, WRITE_CH_CONF_PROG_DI_ID(1)); + + conf = IPU_READ4(sc, DC_WRITE_CH_CONF_5); + conf &= ~WRITE_CH_CONF_PROG_CHAN_TYP_MASK; + conf |= WRITE_CH_CONF_PROG_CHAN_NORMAL; + IPU_WRITE4(sc, DC_WRITE_CH_CONF_5, conf); + + /* TODO: enable clock */ +} + +static void +ipu_dc_link_event(struct ipu_softc *sc, int event, int addr, int priority) +{ + uint32_t reg; + int offset; + int shift; + + if (event % 2) + shift = 16; + else + shift = 0; + + offset = DC_RL0_CH_5 + (event / 2) * sizeof(uint32_t); + + reg = IPU_READ4(sc, offset); + reg &= ~(0xFFFF << shift); + reg |= ((addr << 8) | priority) << shift; + IPU_WRITE4(sc, offset, reg); +} + +static void +ipu_dc_setup_map(struct ipu_softc *sc, int map, + int byte, int offset, int mask) +{ + uint32_t reg, shift, ptr; + + ptr = map * 3 + byte; + + reg = IPU_READ4(sc, DC_MAP_CONF_VAL(ptr)); + if (ptr & 1) + shift = 16; + else + shift = 0; + reg &= ~(0xffff << shift); + reg |= ((offset << 8) | mask) << shift; + IPU_WRITE4(sc, DC_MAP_CONF_VAL(ptr), reg); + + reg = IPU_READ4(sc, DC_MAP_CONF_PTR(map)); + if (map & 1) + shift = 16 + 5 * byte; + else + shift = 5 * byte; + reg &= ~(MAP_CONF_PTR_MASK << shift); + reg |= (ptr) << shift; + IPU_WRITE4(sc, DC_MAP_CONF_PTR(map), reg); +} + +static void +ipu_dc_reset_map(struct ipu_softc *sc, int map) +{ + uint32_t reg, shift; + + reg = IPU_READ4(sc, DC_MAP_CONF_VAL(map)); + if (map & 1) + shift = 16; + else + shift = 0; + reg &= ~(MAP_CONF_VAL_MASK << shift); + IPU_WRITE4(sc, DC_MAP_CONF_VAL(map), reg); +} + +static void +ipu_dc_init(struct ipu_softc *sc, int di_port) +{ + int addr; + uint32_t conf; + + if (di_port) + addr = 2; + else + addr = 5; + + ipu_dc_link_event(sc, DC_EVENT_NL, addr, 3); + ipu_dc_link_event(sc, DC_EVENT_EOL, addr + 1, 2); + ipu_dc_link_event(sc, DC_EVENT_NEW_DATA, addr + 2, 1); + ipu_dc_link_event(sc, DC_EVENT_NF, 0, 0); + ipu_dc_link_event(sc, DC_EVENT_NFIELD, 0, 0); + ipu_dc_link_event(sc, DC_EVENT_EOF, 0, 0); + ipu_dc_link_event(sc, DC_EVENT_EOFIELD, 0, 0); + ipu_dc_link_event(sc, DC_EVENT_NEW_CHAN, 0, 0); + ipu_dc_link_event(sc, DC_EVENT_NEW_ADDR, 0, 0); + + conf = WRITE_CH_CONF_PROG_W_SIZE(0x02) | + WRITE_CH_CONF_PROG_DISP_ID(DI_PORT) | + WRITE_CH_CONF_PROG_DI_ID(DI_PORT); + + IPU_WRITE4(sc, DC_WRITE_CH_CONF_5, conf); + IPU_WRITE4(sc, DC_WRITE_CH_ADDR_5, 0x00000000); + IPU_WRITE4(sc, DC_GEN, DC_GEN_SYNC_PRIORITY | DC_GEN_SYNC); /* High priority, sync */ +} + +static void +ipu_init_buffer(struct ipu_softc *sc) +{ + struct ipu_cpmem_ch_param param; + uint32_t stride; + uint32_t reg, db_mode_sel, cur_buf; + + stride = sc->sc_mode->hdisplay * MODE_BPP / 8; + + /* init channel paramters */ + CH_PARAM_RESET(¶m); + /* XXX: interlaced modes are not supported yet */ + CH_PARAM_SET_FW(¶m, sc->sc_mode->hdisplay - 1); + CH_PARAM_SET_FH(¶m, sc->sc_mode->vdisplay - 1); + CH_PARAM_SET_SLY(¶m, stride - 1); + + CH_PARAM_SET_EBA0(¶m, (sc->sc_fb_phys >> 3)); + CH_PARAM_SET_EBA1(¶m, (sc->sc_fb_phys >> 3)); + + CH_PARAM_SET_BPP(¶m, IPU_PIX_FORMAT_BPP_16); + CH_PARAM_SET_PFS(¶m, IPU_PIX_FORMAT_RGB); + /* 16 pixels per burst access */ + CH_PARAM_SET_NPB(¶m, 16 - 1); + + CH_PARAM_SET_RED_OFFSET(¶m, 0); + CH_PARAM_SET_RED_WIDTH(¶m, 5 - 1); + CH_PARAM_SET_GREEN_OFFSET(¶m, 5); + CH_PARAM_SET_GREEN_WIDTH(¶m, 6 - 1); + CH_PARAM_SET_BLUE_OFFSET(¶m, 11); + CH_PARAM_SET_BLUE_WIDTH(¶m, 5 - 1); + CH_PARAM_SET_ALPHA_OFFSET(¶m, 16); + CH_PARAM_SET_ALPHA_WIDTH(¶m, 8 - 1); + + CH_PARAM_SET_UBO(¶m, 0); + CH_PARAM_SET_VBO(¶m, 0); + + IPU_WRITE_CH_PARAM(sc, DMA_CHANNEL, ¶m); +#ifdef DEBUG + ipu_print_channel(¶m); +#endif + + /* init DMFC */ + IPU_WRITE4(sc, DMFC_IC_CTRL, DMFC_IC_CTRL_DISABLED); + /* High resolution DP */ + IPU_WRITE4(sc, DMFC_WR_CHAN, DMFC_WR_CHAN_BURST_SIZE_8 | + DMFC_WR_CHAN_FIFO_SIZE_128); + IPU_WRITE4(sc, DMFC_WR_CHAN_DEF, DMFC_WR_CHAN_DEF_WM_CLR_2C(1) | + DMFC_WR_CHAN_DEF_WM_CLR_1C(1) | + DMFC_WR_CHAN_DEF_WM_CLR_2(1) | + DMFC_WR_CHAN_DEF_WM_CLR_1(7) | + DMFC_WR_CHAN_DEF_WM_SET_1(5) | + DMFC_WR_CHAN_DEF_WM_EN_1); + + IPU_WRITE4(sc, DMFC_DP_CHAN, + DMFC_DP_CHAN_BURST_SIZE_5F(DMFC_DP_CHAN_BURST_SIZE_8) | + DMFC_DP_CHAN_FIFO_SIZE_5F(DMFC_DP_CHAN_FIFO_SIZE_128) | + DMFC_DP_CHAN_ST_ADDR_SIZE_5F(6) /* segment 6 */ | + DMFC_DP_CHAN_BURST_SIZE_5B(DMFC_DP_CHAN_BURST_SIZE_8) | + DMFC_DP_CHAN_FIFO_SIZE_5B(DMFC_DP_CHAN_FIFO_SIZE_256) | + DMFC_DP_CHAN_ST_ADDR_SIZE_5B(2) /* segment 2 */); + + IPU_WRITE4(sc, DMFC_DP_CHAN_DEF, DMFC_DP_CHAN_DEF_WM_CLR_6F(1) | + DMFC_DP_CHAN_DEF_WM_CLR_6B(1) | + DMFC_DP_CHAN_DEF_WM_CLR_5F(7) | + DMFC_DP_CHAN_DEF_WM_SET_5F(5) | + DMFC_DP_CHAN_DEF_WM_EN_5F | + DMFC_DP_CHAN_DEF_WM_CLR_5B(7) | + DMFC_DP_CHAN_DEF_WM_SET_5B(5) | + DMFC_DP_CHAN_DEF_WM_EN_5B); + + reg = IPU_READ4(sc, DMFC_GENERAL_1); + reg &= ~(DMFC_GENERAL_1_WAIT4EOT_5B); + IPU_WRITE4(sc, DMFC_GENERAL_1, reg); + + /* XXX: set priority? */ + + /* Set single buffer mode */ + if (DMA_CHANNEL < 32) { + db_mode_sel = IPU_CH_DB_MODE_SEL_0; + cur_buf = IPU_CUR_BUF_0; + } else { + db_mode_sel = IPU_CH_DB_MODE_SEL_1; + cur_buf = IPU_CUR_BUF_1; + } + + reg = IPU_READ4(sc, db_mode_sel); + reg |= (1UL << (DMA_CHANNEL & 0x1f)); + IPU_WRITE4(sc, db_mode_sel, reg); + + IPU_WRITE4(sc, cur_buf, (1UL << (DMA_CHANNEL & 0x1f))); +} + +static int +ipu_init(struct ipu_softc *sc) +{ + uint32_t reg, off; + int i, err; + size_t dma_size; + + IPU_WRITE4(sc, IPU_CONF, DI_PORT ? IPU_CONF_DI1_EN : IPU_CONF_DI0_EN); + + IPU_WRITE4(sc, IPU_MEM_RST, IPU_MEM_RST_ALL); + i = 1000; + while (i-- > 0) { + if (!(IPU_READ4(sc, IPU_MEM_RST) & IPU_MEM_RST_START)) + break; + DELAY(1); + } + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Dec 21 22:40:30 2015 Return-Path: Delivered-To: svn-src-all@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 81A58A4EAA9; Mon, 21 Dec 2015 22:40:30 +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 50BDB17B9; Mon, 21 Dec 2015 22:40:30 +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 tBLMeTST032722; Mon, 21 Dec 2015 22:40:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLMeT8s032721; Mon, 21 Dec 2015 22:40:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512212240.tBLMeT8s032721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Dec 2015 22:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292575 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 22:40:30 -0000 Author: emaste Date: Mon Dec 21 22:40:29 2015 New Revision: 292575 URL: https://svnweb.freebsd.org/changeset/base/292575 Log: rtld: Use common NT_FREEBSD_* note types introduced in r291909 Sponsored by: The FreeBSD Foundation Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Dec 21 22:25:35 2015 (r292574) +++ head/libexec/rtld-elf/rtld.c Mon Dec 21 22:40:29 2015 (r292575) @@ -1362,22 +1362,22 @@ digest_notes(Obj_Entry *obj, Elf_Addr no if (note->n_namesz != sizeof(NOTE_FREEBSD_VENDOR) || note->n_descsz != sizeof(int32_t)) continue; - if (note->n_type != ABI_NOTETYPE && - note->n_type != CRT_NOINIT_NOTETYPE) + if (note->n_type != NT_FREEBSD_ABI_TAG && + note->n_type != NT_FREEBSD_NOINIT_TAG) continue; note_name = (const char *)(note + 1); if (strncmp(NOTE_FREEBSD_VENDOR, note_name, sizeof(NOTE_FREEBSD_VENDOR)) != 0) continue; switch (note->n_type) { - case ABI_NOTETYPE: + case NT_FREEBSD_ABI_TAG: /* FreeBSD osrel note */ p = (uintptr_t)(note + 1); p += roundup2(note->n_namesz, sizeof(Elf32_Addr)); obj->osrel = *(const int32_t *)(p); dbg("note osrel %d", obj->osrel); break; - case CRT_NOINIT_NOTETYPE: + case NT_FREEBSD_NOINIT_TAG: /* FreeBSD 'crt does not call init' note */ obj->crt_no_init = true; dbg("note crt_no_init"); From owner-svn-src-all@freebsd.org Mon Dec 21 22:42:04 2015 Return-Path: Delivered-To: svn-src-all@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 BEAE5A4EC64; Mon, 21 Dec 2015 22:42:04 +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 8F7161ABA; Mon, 21 Dec 2015 22:42:04 +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 tBLMg3H9035363; Mon, 21 Dec 2015 22:42:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLMg3IH035362; Mon, 21 Dec 2015 22:42:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512212242.tBLMg3IH035362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Dec 2015 22:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292576 - head/sys/boot/efi/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 22:42:04 -0000 Author: emaste Date: Mon Dec 21 22:42:03 2015 New Revision: 292576 URL: https://svnweb.freebsd.org/changeset/base/292576 Log: boot1.efi: show EFI error number, not full status value EFI return values set the high bit to indicate an error. The log messages changed here are printed only in the case of an error, so including the error bit is redundant. Also switch to decimal to match the error definitions (in sys/boot/efi/include/efierr.h). MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/efi/boot1/boot1.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Mon Dec 21 22:40:29 2015 (r292575) +++ head/sys/boot/efi/boot1/boot1.c Mon Dec 21 22:42:03 2015 (r292576) @@ -330,18 +330,21 @@ load(const char *fname) status = systab->BootServices->LoadImage(TRUE, image, bootdevpath, buffer, bufsize, &loaderhandle); if (EFI_ERROR(status)) - printf("LoadImage failed with error %lx\n", status); + printf("LoadImage failed with error %lu\n", + status & ~EFI_ERROR_MASK); status = systab->BootServices->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image); if (EFI_ERROR(status)) - printf("HandleProtocol failed with error %lx\n", status); + printf("HandleProtocol failed with error %lu\n", + status & ~EFI_ERROR_MASK); loaded_image->DeviceHandle = bootdevhandle; status = systab->BootServices->StartImage(loaderhandle, NULL, NULL); if (EFI_ERROR(status)) - printf("StartImage failed with error %lx\n", status); + printf("StartImage failed with error %lu\n", + status & ~EFI_ERROR_MASK); } static void From owner-svn-src-all@freebsd.org Mon Dec 21 23:26:48 2015 Return-Path: Delivered-To: svn-src-all@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 A97BFA4FB83; Mon, 21 Dec 2015 23:26:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 852A1115D; Mon, 21 Dec 2015 23:26:48 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id BABFBB96E; Mon, 21 Dec 2015 18:26:45 -0500 (EST) From: John Baldwin To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292576 - head/sys/boot/efi/boot1 Date: Mon, 21 Dec 2015 15:26:43 -0800 Message-ID: <6789662.X7p9Lo7J5l@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201512212242.tBLMg3IH035362@repo.freebsd.org> References: <201512212242.tBLMg3IH035362@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.2.7 (bigwig.baldwin.cx); Mon, 21 Dec 2015 18:26:45 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 23:26:48 -0000 On Monday, December 21, 2015 10:42:03 PM Ed Maste wrote: > Author: emaste > Date: Mon Dec 21 22:42:03 2015 > New Revision: 292576 > URL: https://svnweb.freebsd.org/changeset/base/292576 > > Log: > boot1.efi: show EFI error number, not full status value > > EFI return values set the high bit to indicate an error. The log > messages changed here are printed only in the case of an error, > so including the error bit is redundant. Also switch to decimal to > match the error definitions (in sys/boot/efi/include/efierr.h). > > MFC after: 1 week > Sponsored by: The FreeBSD Foundation Perhaps it would be useful to have a shared 'EFI_ERROR_NUM()' macro? -- John Baldwin From owner-svn-src-all@freebsd.org Mon Dec 21 23:47:51 2015 Return-Path: Delivered-To: svn-src-all@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 2A666A4E14E; Mon, 21 Dec 2015 23:47:51 +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 F238F1BF1; Mon, 21 Dec 2015 23:47:50 +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 tBLNloA0052905; Mon, 21 Dec 2015 23:47:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBLNloeo052904; Mon, 21 Dec 2015 23:47:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512212347.tBLNloeo052904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Dec 2015 23:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292577 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 23:47:51 -0000 Author: ian Date: Mon Dec 21 23:47:49 2015 New Revision: 292577 URL: https://svnweb.freebsd.org/changeset/base/292577 Log: Include machine/_bus.h so that bus_space_[tag|handle]_t will be available. It appears that all platforms except aarch64 are getting the file via various header pollution, and ensuring _bus.h is included before any openfirmware headers in every consumer of ofw/fdt stuff seems like more of a career path than a task, so I'm taking this easy way out. Modified: head/sys/dev/ofw/openfirm.h Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Mon Dec 21 22:42:03 2015 (r292576) +++ head/sys/dev/ofw/openfirm.h Mon Dec 21 23:47:49 2015 (r292577) @@ -61,6 +61,7 @@ #define _DEV_OPENFIRM_H_ #include +#include /* * Prototypes for Open Firmware Interface Routines From owner-svn-src-all@freebsd.org Tue Dec 22 00:43:24 2015 Return-Path: Delivered-To: svn-src-all@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 0BE969D55AF; Tue, 22 Dec 2015 00:43:24 +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 B467D1354; Tue, 22 Dec 2015 00:43:23 +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 tBM0hM0e070151; Tue, 22 Dec 2015 00:43:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM0hMxo070149; Tue, 22 Dec 2015 00:43:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512220043.tBM0hMxo070149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Dec 2015 00:43:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292578 - in head/contrib/netbsd-tests/lib/libc: gen ssp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 00:43:24 -0000 Author: ngie Date: Tue Dec 22 00:43:22 2015 New Revision: 292578 URL: https://svnweb.freebsd.org/changeset/base/292578 Log: Don't dump core files with lib/libc/ssp/ssp_test and lib/libc/gen/assert_test The default `sysctl kern.corefile` value is compatible with `kyua test` (FreeBSD will dump to the current directory). If it's set to an absolute path however, `kyua test` will not be able to clean up the corefiles after the fact The corefiles have little value when testing the behavior of feature behavior, so just disable corefile generation MFC after: 1 week Obtained from: Isilon OneFS (^/onefs/head@r511419) Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libc/gen/t_assert.c head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh Modified: head/contrib/netbsd-tests/lib/libc/gen/t_assert.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_assert.c Mon Dec 21 23:47:49 2015 (r292577) +++ head/contrib/netbsd-tests/lib/libc/gen/t_assert.c Tue Dec 22 00:43:22 2015 (r292578) @@ -40,6 +40,23 @@ __RCSID("$NetBSD: t_assert.c,v 1.2 2011/ #include #include +#ifdef __FreeBSD__ +#include +#include +#include + +static void +disable_corefile(void) +{ + struct rlimit limits; + + limits.rlim_cur = 0; + limits.rlim_max = 0; + + ATF_REQUIRE(setrlimit(RLIMIT_CORE, &limits) == 0); +} +#endif + static void handler(int); static void @@ -65,6 +82,9 @@ ATF_TC_BODY(assert_false, tc) if (pid == 0) { +#ifdef __FreeBSD__ + disable_corefile(); +#endif (void)closefrom(0); (void)memset(&sa, 0, sizeof(struct sigaction)); @@ -102,6 +122,9 @@ ATF_TC_BODY(assert_true, tc) if (pid == 0) { +#ifdef __FreeBSD__ + disable_corefile(); +#endif (void)closefrom(0); (void)memset(&sa, 0, sizeof(struct sigaction)); Modified: head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh ============================================================================== --- head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh Mon Dec 21 23:47:49 2015 (r292577) +++ head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh Tue Dec 22 00:43:22 2015 (r292578) @@ -35,6 +35,7 @@ h_fail() { echo "Executing command [ $2$1 ]" # Begin FreeBSD + ulimit -c 0 if true; then eval $2 atf_check -s signal -o ignore -e ignore $1 else From owner-svn-src-all@freebsd.org Tue Dec 22 00:53:20 2015 Return-Path: Delivered-To: svn-src-all@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 D05419D59E7; Tue, 22 Dec 2015 00:53:20 +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 A14F21980; Tue, 22 Dec 2015 00:53:20 +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 tBM0rJW2072948; Tue, 22 Dec 2015 00:53:19 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM0rJ7K072947; Tue, 22 Dec 2015 00:53:19 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512220053.tBM0rJ7K072947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 22 Dec 2015 00:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292579 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 00:53:20 -0000 Author: ian Date: Tue Dec 22 00:53:19 2015 New Revision: 292579 URL: https://svnweb.freebsd.org/changeset/base/292579 Log: Fix the detection of IO/memory space changing across busses when the bus is not pci (and thus where, ironically, the whole situation is meaningless). This was not an error in the original code, it was introduced during my refactoring to commonize the routine. A small change a few lines above drove the need to make this change, and the error didn't show up on the platforms I initially tested with. Modified: head/sys/dev/ofw/ofw_subr.c Modified: head/sys/dev/ofw/ofw_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_subr.c Tue Dec 22 00:43:22 2015 (r292578) +++ head/sys/dev/ofw/ofw_subr.c Tue Dec 22 00:53:19 2015 (r292579) @@ -137,9 +137,8 @@ ofw_reg_to_paddr(phandle_t dev, int regn res /= sizeof(cell[0]); regno = 0; while (regno < res) { - rspc = (pci) - ? cell[regno] & OFW_PCI_PHYS_HI_SPACEMASK - : OFW_PADDR_NOT_PCI; + rspc = (pci ? cell[regno] : OFW_PADDR_NOT_PCI) & + OFW_PCI_PHYS_HI_SPACEMASK; if (rspc != spc) { regno += naddr + nbridge + nsize; continue; From owner-svn-src-all@freebsd.org Tue Dec 22 00:58:36 2015 Return-Path: Delivered-To: svn-src-all@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 E869E9D5BB2; Tue, 22 Dec 2015 00:58:36 +0000 (UTC) (envelope-from rodrigc@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 BA2711C17; Tue, 22 Dec 2015 00:58:36 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBM0wZPB073175; Tue, 22 Dec 2015 00:58:35 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM0wZ0C073172; Tue, 22 Dec 2015 00:58:35 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201512220058.tBM0wZ0C073172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Tue, 22 Dec 2015 00:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292580 - head/usr.sbin/jls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 00:58:37 -0000 Author: rodrigc Date: Tue Dec 22 00:58:35 2015 New Revision: 292580 URL: https://svnweb.freebsd.org/changeset/base/292580 Log: Add libxo support to jls PR: 200746 Submitted by: Emmanuel Vadot Reviewed by: allanjude Relnotes: yes Differential Revision: https://reviews.freebsd.org/D4452 Modified: head/usr.sbin/jls/Makefile head/usr.sbin/jls/jls.8 head/usr.sbin/jls/jls.c Modified: head/usr.sbin/jls/Makefile ============================================================================== --- head/usr.sbin/jls/Makefile Tue Dec 22 00:53:19 2015 (r292579) +++ head/usr.sbin/jls/Makefile Tue Dec 22 00:58:35 2015 (r292580) @@ -4,7 +4,7 @@ PROG= jls MAN= jls.8 -LIBADD= jail +LIBADD= jail xo .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 Modified: head/usr.sbin/jls/jls.8 ============================================================================== --- head/usr.sbin/jls/jls.8 Tue Dec 22 00:53:19 2015 (r292579) +++ head/usr.sbin/jls/jls.8 Tue Dec 22 00:58:35 2015 (r292580) @@ -33,6 +33,7 @@ .Nd "list jails" .Sh SYNOPSIS .Nm +.Op Fl -libxo .Op Fl dhNnqsv .Op Fl j Ar jail .Op Ar parameter ... @@ -62,6 +63,13 @@ and path (path). .Pp The following options are available: .Bl -tag -width indent +.It Fl -libxo +Generate output via +.Xr libxo 3 +in a selection of different human and machine readable formats. +See +.Xr xo_parse_args 3 +for details on command line arguments. .It Fl d List .Va dying @@ -106,7 +114,9 @@ Without this option, all active jails wi .Sh SEE ALSO .Xr jail_get 2 , .Xr jail 8 , -.Xr jexec 8 +.Xr jexec 8 , +.Xr libxo 3 , +.Xr xo_parse_args 3 .Sh HISTORY The .Nm @@ -114,3 +124,5 @@ utility was added in .Fx 5.1 . Extensible jail parameters were introduced in .Fx 8.0 . +libxo support was added in +.Fx 11.0 . Modified: head/usr.sbin/jls/jls.c ============================================================================== --- head/usr.sbin/jls/jls.c Tue Dec 22 00:53:19 2015 (r292579) +++ head/usr.sbin/jls/jls.c Tue Dec 22 00:58:35 2015 (r292580) @@ -2,6 +2,7 @@ * Copyright (c) 2003 Mike Barcroft * Copyright (c) 2008 Bjoern A. Zeeb * Copyright (c) 2009 James Gritton + * Copyright (c) 2015 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,10 +46,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define JP_USER 0x01000000 #define JP_OPT 0x02000000 +#define JLS_XO_VERSION "1" + #define PRINT_DEFAULT 0x01 #define PRINT_HEADER 0x02 #define PRINT_NAMEVAL 0x04 @@ -73,7 +77,7 @@ static int sort_param(const void *a, con static char *noname(const char *name); static char *nononame(const char *name); static int print_jail(int pflags, int jflags); -static void quoted_print(char *str); +static void quoted_print(int pflags, char *name, char *value); int main(int argc, char **argv) @@ -81,6 +85,11 @@ main(int argc, char **argv) char *dot, *ep, *jname, *pname; int c, i, jflags, jid, lastjid, pflags, spc; + argc = xo_parse_args(argc, argv); + if (argc < 0) + exit(1); + + xo_set_version(JLS_XO_VERSION); jname = NULL; pflags = jflags = jid = 0; while ((c = getopt(argc, argv, "adj:hNnqsv")) >= 0) @@ -119,7 +128,7 @@ main(int argc, char **argv) PRINT_VERBOSE; break; default: - errx(1, "usage: jls [-dhNnqv] [-j jail] [param ...]"); + xo_errx(1, "usage: jls [-dhNnqv] [-j jail] [param ...]"); } #ifdef INET6 @@ -196,42 +205,48 @@ main(int argc, char **argv) add_param("lastjid", &lastjid, sizeof(lastjid), NULL, 0); /* Print a header line if requested. */ - if (pflags & PRINT_VERBOSE) - printf(" JID Hostname Path\n" - " Name State\n" - " CPUSetID\n" - " IP Address(es)\n"); + if (pflags & PRINT_VERBOSE) { + xo_emit("{T:/%3s}{T:JID}{P: }{T:Hostname}{Pd:/%22s}{T:Path}\n", + "", ""); + xo_emit("{P:/%8s}{T:Name}{Pd:/%26s}{T:State}\n", "", ""); + xo_emit("{P:/%8s}{T:CPUSetID}\n", ""); + xo_emit("{P:/%8s}{T:IP Address(es)}\n", ""); + } else if (pflags & PRINT_DEFAULT) if (pflags & PRINT_JAIL_NAME) - printf(" JID IP Address " - "Hostname Path\n"); + xo_emit("{P: }{T:JID/%-15s}{P: }{T:IP Address/%-15s}" + "{P: }{T:Hostname/%-29s}{P: }{T:Path}\n"); else - printf(" JID IP Address " - "Hostname Path\n"); + xo_emit("{T:JID/%6s}{P: }{T:IP Address}{P:/%6s}" + "{T:Hostname}{P:/%22s}{T:Path}\n", "", ""); else if (pflags & PRINT_HEADER) { for (i = spc = 0; i < nparams; i++) if (params[i].jp_flags & JP_USER) { if (spc) - putchar(' '); + xo_emit("{P: }"); else spc = 1; - fputs(params[i].jp_name, stdout); + xo_emit(params[i].jp_name); } - putchar('\n'); + xo_emit("{P:\n}"); } + xo_open_container("jail-information"); + xo_open_list("jail"); /* Fetch the jail(s) and print the parameters. */ if (jid != 0 || jname != NULL) { if (print_jail(pflags, jflags) < 0) - errx(1, "%s", jail_errmsg); + xo_errx(1, "%s", jail_errmsg); } else { for (lastjid = 0; (lastjid = print_jail(pflags, jflags)) >= 0; ) ; if (errno != 0 && errno != ENOENT) - errx(1, "%s", jail_errmsg); + xo_errx(1, "%s", jail_errmsg); } - + xo_close_list("jail"); + xo_close_container("jail-information"); + xo_finish(); return (0); } @@ -248,7 +263,7 @@ add_param(const char *name, void *value, if (!strcmp(name, "all")) { tnparams = jailparam_all(&tparams); if (tnparams < 0) - errx(1, "%s", jail_errmsg); + xo_errx(1, "%s", jail_errmsg); qsort(tparams, (size_t)tnparams, sizeof(struct jailparam), sort_param); for (i = 0; i < tnparams; i++) @@ -263,7 +278,7 @@ add_param(const char *name, void *value, if (!strcmp(name, params[i].jp_name)) { if (value != NULL && jailparam_import_raw(params + i, value, valuelen) < 0) - errx(1, "%s", jail_errmsg); + xo_errx(1, "%s", jail_errmsg); params[i].jp_flags |= flags; if (source != NULL) jailparam_free(source, 1); @@ -276,14 +291,14 @@ add_param(const char *name, void *value, params = malloc(paramlistsize * sizeof(*params)); param_parent = malloc(paramlistsize * sizeof(*param_parent)); if (params == NULL || param_parent == NULL) - err(1, "malloc"); + xo_err(1, "malloc"); } else if (nparams >= paramlistsize) { paramlistsize *= 2; params = realloc(params, paramlistsize * sizeof(*params)); param_parent = realloc(param_parent, paramlistsize * sizeof(*param_parent)); if (params == NULL || param_parent == NULL) - err(1, "realloc"); + xo_err(1, "realloc"); } /* Look up the parameter. */ @@ -301,7 +316,7 @@ add_param(const char *name, void *value, nparams--; return (-1); } - errx(1, "%s", jail_errmsg); + xo_errx(1, "%s", jail_errmsg); } param->jp_flags = flags; return param - params; @@ -332,7 +347,7 @@ noname(const char *name) nname = malloc(strlen(name) + 3); if (nname == NULL) - err(1, "malloc"); + xo_err(1, "malloc"); p = strrchr(name, '.'); if (p != NULL) sprintf(nname, "%.*s.no%s", (int)(p - name), name, p + 1); @@ -351,7 +366,7 @@ nononame(const char *name) return NULL; nname = malloc(strlen(name) - 1); if (nname == NULL) - err(1, "malloc"); + xo_err(1, "malloc"); if (p != NULL) sprintf(nname, "%.*s.%s", (int)(p - name), name, p + 3); else @@ -362,7 +377,7 @@ nononame(const char *name) static int print_jail(int pflags, int jflags) { - char *nname; + char *nname, *xo_nname; char **param_values; int i, ai, jid, count, n, spc; char ipbuf[INET6_ADDRSTRLEN]; @@ -370,18 +385,19 @@ print_jail(int pflags, int jflags) jid = jailparam_get(params, nparams, jflags); if (jid < 0) return jid; + + xo_open_instance("jail"); + if (pflags & PRINT_VERBOSE) { - printf("%6d %-29.29s %.74s\n" - "%6s %-29.29s %.74s\n" - "%6s %-6d\n", + xo_emit("{:jid/%6d}{P: }{:hostname/%-29.29s/%s}{P: }" + "{:path/%.74s/%s}\n", *(int *)params[0].jp_value, (char *)params[1].jp_value, - (char *)params[2].jp_value, - "", + (char *)params[2].jp_value); + xo_emit("{P: }{:name/%-29.29s/%s}{P: }{:state/%.74s}\n", (char *)params[3].jp_value, - *(int *)params[4].jp_value ? "DYING" : "ACTIVE", - "", - *(int *)params[5].jp_value); + *(int *)params[4].jp_value ? "DYING" : "ACTIVE"); + xo_emit("{P: }{:cpusetid/%d}\n", *(int *)params[5].jp_value); n = 6; #ifdef INET if (ip4_ok && !strcmp(params[n].jp_name, "ip4.addr")) { @@ -390,9 +406,10 @@ print_jail(int pflags, int jflags) if (inet_ntop(AF_INET, &((struct in_addr *)params[n].jp_value)[ai], ipbuf, sizeof(ipbuf)) == NULL) - err(1, "inet_ntop"); - else - printf("%6s %-15.15s\n", "", ipbuf); + xo_err(1, "inet_ntop"); + else { + xo_emit("{P: }{l:ipv4_addrs}{P:\n}", ipbuf); + } n++; } #endif @@ -404,20 +421,21 @@ print_jail(int pflags, int jflags) &((struct in6_addr *) params[n].jp_value)[ai], ipbuf, sizeof(ipbuf)) == NULL) - err(1, "inet_ntop"); + xo_err(1, "inet_ntop"); else - printf("%6s %s\n", "", ipbuf); + xo_emit("{P: }{l:ipv6_addrs}{P:\n}", ipbuf); n++; } #endif } else if (pflags & PRINT_DEFAULT) { if (pflags & PRINT_JAIL_NAME) - printf(" %-15s ", (char *)params[0].jp_value); + xo_emit("{P: }{:name/%-15s/%s}{P: }", + (char *)params[0].jp_value); else - printf("%6d ", *(int *)params[0].jp_value); - printf("%-15.15s %-29.29s %.74s\n", + xo_emit("{:jid/%6d}{P: }", *(int *)params[0].jp_value); + xo_emit("{:ipv4/%-15.15s/%s}{P: }{:hostname/%-29.29s/%s}{P: }{:path/%.74s/%s}\n", #ifdef INET - (!ip4_ok || params[1].jp_valuelen == 0) ? "-" + (!ip4_ok || params[1].jp_valuelen == 0) ? "" : inet_ntoa(*(struct in_addr *)params[1].jp_value), (char *)params[2-!ip4_ok].jp_value, (char *)params[3-!ip4_ok].jp_value); @@ -433,7 +451,7 @@ print_jail(int pflags, int jflags) continue; param_values[i] = jailparam_export(params + i); if (param_values[i] == NULL) - errx(1, "%s", jail_errmsg); + xo_errx(1, "%s", jail_errmsg); } for (i = spc = 0; i < nparams; i++) { if (!(params[i].jp_flags & JP_USER)) @@ -446,7 +464,7 @@ print_jail(int pflags, int jflags) JAIL_SYS_NEW))) continue; if (spc) - putchar(' '); + xo_emit("{P: }"); else spc = 1; if (pflags & PRINT_NAMEVAL) { @@ -456,63 +474,82 @@ print_jail(int pflags, int jflags) */ if (params[i].jp_flags & (JP_BOOL | JP_NOBOOL)) { - if (*(int *)params[i].jp_value) - printf("%s", params[i].jp_name); + if (*(int *)params[i].jp_value) { + asprintf(&xo_nname, "{en:%s/true}", params[i].jp_name); + xo_emit(xo_nname); + xo_emit("{d:/%s}", params[i].jp_name); + } else { nname = (params[i].jp_flags & JP_NOBOOL) ? nononame(params[i].jp_name) : noname(params[i].jp_name); - printf("%s", nname); + if (params[i].jp_flags & JP_NOBOOL) { + asprintf(&xo_nname, "{en:%s/true}", params[i].jp_name); + xo_emit(xo_nname); + } else { + asprintf(&xo_nname, "{en:%s/false}", params[i].jp_name); + xo_emit(xo_nname); + } + xo_emit("{d:/%s}", nname); free(nname); } + free(xo_nname); continue; } - printf("%s=", params[i].jp_name); + xo_emit("{d:%s}=", params[i].jp_name); } if (params[i].jp_valuelen == 0) { if (pflags & PRINT_QUOTED) - printf("\"\""); + xo_emit("{P:\"\"}"); else if (!(pflags & PRINT_NAMEVAL)) - putchar('-'); - } else - quoted_print(param_values[i]); + xo_emit("{P:-}"); + } else { + quoted_print(pflags, params[i].jp_name, param_values[i]); + } } - putchar('\n'); + xo_emit("{P:\n}"); for (i = 0; i < nparams; i++) if (params[i].jp_flags & JP_USER) free(param_values[i]); } + + xo_close_instance("jail"); return (jid); } static void -quoted_print(char *str) +quoted_print(int pflags, char *name, char *value) { - int c, qc; - char *p = str; + int qc; + char *p = value; + char *param_name_value; /* An empty string needs quoting. */ if (!*p) { - fputs("\"\"", stdout); + asprintf(¶m_name_value, "{k:%s}{d:%s/\"\"}", name, name); + xo_emit(param_name_value); + free(param_name_value); return; } + asprintf(¶m_name_value, "{:%s/%%s}", name); /* * The value will be surrounded by quotes if it contains spaces * or quotes. */ qc = strchr(p, '\'') ? '"' - : strchr(p, '"') ? '\'' - : strchr(p, ' ') || strchr(p, '\t') ? '"' - : 0; - if (qc) - putchar(qc); - while ((c = *p++)) { - if (c == '\\' || c == qc) - putchar('\\'); - putchar(c); - } - if (qc) - putchar(qc); + : strchr(p, '"') ? '\'' + : strchr(p, ' ') || strchr(p, '\t') ? '"' + : 0; + + if (qc && pflags & PRINT_QUOTED) + xo_emit("{P:/%c}", qc); + + xo_emit(param_name_value, value); + + free(param_name_value); + + if (qc && pflags & PRINT_QUOTED) + xo_emit("{P:/%c}", qc); } From owner-svn-src-all@freebsd.org Tue Dec 22 01:21:28 2015 Return-Path: Delivered-To: svn-src-all@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 D82EBA4E20C; Tue, 22 Dec 2015 01:21:28 +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 A57281738; Tue, 22 Dec 2015 01:21:28 +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 tBM1LR3g081060; Tue, 22 Dec 2015 01:21:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM1LRuZ081058; Tue, 22 Dec 2015 01:21:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512220121.tBM1LRuZ081058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Dec 2015 01:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292581 - head/contrib/netbsd-tests/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 01:21:28 -0000 Author: ngie Date: Tue Dec 22 01:21:27 2015 New Revision: 292581 URL: https://svnweb.freebsd.org/changeset/base/292581 Log: Use stable output to a test file instead of depending on the OS name being grep'able in /bin/sh This fixes the situation where the OS has been rebranded to something other than `FreeBSD` MFC after: 1 week Obtained from: Isilon OneFS (^/onefs/head@r511419) Reviewed by: cem, Daniel O'Connor Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/usr.bin/grep/d_binary.out head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Modified: head/contrib/netbsd-tests/usr.bin/grep/d_binary.out ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/d_binary.out Tue Dec 22 00:58:35 2015 (r292580) +++ head/contrib/netbsd-tests/usr.bin/grep/d_binary.out Tue Dec 22 01:21:27 2015 (r292581) @@ -1 +1 @@ -Binary file /bin/sh matches +Binary file test.file matches Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Tue Dec 22 00:58:35 2015 (r292580) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Tue Dec 22 01:21:27 2015 (r292581) @@ -43,7 +43,20 @@ binary_head() } binary_body() { + # Begin FreeBSD + # + # Generate stable output instead of depending on uname to match the + # branded OS name of /bin/sh + if true; then + dd if=/dev/zero count=1 of=test.file + echo -n "foobar" >> test.file + atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep foobar test.file + else + # End FreeBSD atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep $(uname) /bin/sh + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case recurse From owner-svn-src-all@freebsd.org Tue Dec 22 02:10:32 2015 Return-Path: Delivered-To: svn-src-all@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 7492AA4F4D6; Tue, 22 Dec 2015 02:10:32 +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 452841B3D; Tue, 22 Dec 2015 02:10:32 +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 tBM2AVlQ093562; Tue, 22 Dec 2015 02:10:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM2AV5s093561; Tue, 22 Dec 2015 02:10:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512220210.tBM2AV5s093561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Dec 2015 02:10:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292582 - head/tests/sys/file X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 02:10:32 -0000 Author: ngie Date: Tue Dec 22 02:10:31 2015 New Revision: 292582 URL: https://svnweb.freebsd.org/changeset/base/292582 Log: Dump out the output from flock_helper on failure so failures with the test app can be debugged MFC after: 1 week Obtained from: Isilon OneFS (^/onefs/head@r511419) Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/file/flock_test.sh Modified: head/tests/sys/file/flock_test.sh ============================================================================== --- head/tests/sys/file/flock_test.sh Tue Dec 22 01:21:27 2015 (r292581) +++ head/tests/sys/file/flock_test.sh Tue Dec 22 02:10:31 2015 (r292582) @@ -43,10 +43,11 @@ for n in `seq 1 $last_testcase`; do todomsg=" # TODO: racy testcase" fi - $(dirname $0)/flock_helper . $n | grep -q SUCCEED - if [ $? -eq 0 ]; then + output=$($(dirname $0)/flock_helper . $n) + if echo "$output" | grep -q SUCCEED; then echo "ok $n$todomsg" else echo "not ok $n$todomsg" + echo "$output" >&2 fi done From owner-svn-src-all@freebsd.org Tue Dec 22 03:02:53 2015 Return-Path: Delivered-To: svn-src-all@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 9F22BA4E484; Tue, 22 Dec 2015 03:02:53 +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 5E3DD1378; Tue, 22 Dec 2015 03:02:53 +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 tBM32qXw011479; Tue, 22 Dec 2015 03:02:52 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM32qwZ011478; Tue, 22 Dec 2015 03:02:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512220302.tBM32qwZ011478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 22 Dec 2015 03:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292583 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 03:02:53 -0000 Author: ian Date: Tue Dec 22 03:02:52 2015 New Revision: 292583 URL: https://svnweb.freebsd.org/changeset/base/292583 Log: Allow dhcp/bootp server-provided values to be overriden from environment variables in loader(8) and other libstand applications. Sometimes a dhcp server provides incorrect information along with the IP address. It would be useful to have a way to override this with locally-supplied information, such as command line parameters passed from a prior-stage bootloader. This change allows pre-existing env vars to take precedence over values delivered by the dhcp or bootp server. The bootp/dhcp code in libstand automatically creates environment variables from the data provided by the server (dhcp.root-path, dhcp.domain-name, etc). It also transcribes the values to some global variables such as 'rootpath' and 'hostname'. This change does two things: When adding dhcp.* vars to the environment, don't replace existing vars/values. When setting the global vars rootpath and hostname, use the dhcp.root-path and dhcp.host-name env var values if they exist. This allows the platform-specific part of loader(8) to obtain override values in some platform-specific way and store them in the environment before opening the network device. The set of values that can be overriden is currently limited to just string options. The values that are delivered as binary data are things that probably shouldn't be overridden (IP, netmask, gateway, etc). The original patch this evolved from was submitted by martymac@ PR: 202098 Differential Revision: https://reviews.freebsd.org/D4559 Modified: head/lib/libstand/bootp.c Modified: head/lib/libstand/bootp.c ============================================================================== --- head/lib/libstand/bootp.c Tue Dec 22 02:10:31 2015 (r292582) +++ head/lib/libstand/bootp.c Tue Dec 22 03:02:52 2015 (r292583) @@ -354,6 +354,7 @@ vend_rfc1048(cp, len) u_char *ep; int size; u_char tag; + const char *val; #ifdef BOOTP_DEBUG if (debug) @@ -380,15 +381,17 @@ vend_rfc1048(cp, len) } if (tag == TAG_SWAPSERVER) { /* let it override bp_siaddr */ - bcopy(cp, &rootip.s_addr, sizeof(swapip.s_addr)); + bcopy(cp, &rootip.s_addr, sizeof(rootip.s_addr)); } if (tag == TAG_ROOTPATH) { - strncpy(rootpath, (char *)cp, sizeof(rootpath)); - rootpath[size] = '\0'; + if ((val = getenv("dhcp.root-path")) == NULL) + val = (const char *)cp; + strlcpy(rootpath, val, sizeof(rootpath)); } if (tag == TAG_HOSTNAME) { - strncpy(hostname, (char *)cp, sizeof(hostname)); - hostname[size] = '\0'; + if ((val = getenv("dhcp.host-name")) == NULL) + val = (const char *)cp; + strlcpy(hostname, val, sizeof(hostname)); } #ifdef SUPPORT_DHCP if (tag == TAG_DHCP_MSGTYPE) { @@ -730,7 +733,11 @@ setenv_(u_char *cp, u_char *ep, struct sprintf(env, op->desc, opts[0].desc, tag); else sprintf(env, "%s%s", opts[0].desc, op->desc); - setenv(env, buf, 1); + /* + * Do not replace existing values in the environment, so that + * locally-obtained values can override server-provided values. + */ + setenv(env, buf, 0); } } if (tp != tags) { From owner-svn-src-all@freebsd.org Tue Dec 22 03:07:39 2015 Return-Path: Delivered-To: svn-src-all@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 A49F6A4E696; Tue, 22 Dec 2015 03:07:39 +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 785191767; Tue, 22 Dec 2015 03:07:39 +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 tBM37cD3011830; Tue, 22 Dec 2015 03:07:38 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM37cJU011829; Tue, 22 Dec 2015 03:07:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512220307.tBM37cJU011829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 22 Dec 2015 03:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292584 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 03:07:39 -0000 Author: ian Date: Tue Dec 22 03:07:38 2015 New Revision: 292584 URL: https://svnweb.freebsd.org/changeset/base/292584 Log: Set env vars from values on the efi loader command line. Examine each cmdline arg and if it contains an '=' convert it to ascii and pass it to putenv(). This allows var=value settings to come in on the command line. This will allow overriding dhcp server-provided data in loader(8), as discussed in PR 202098 PR: 202098 Differential Revision: https://reviews.freebsd.org/D4561 Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Tue Dec 22 03:02:52 2015 (r292583) +++ head/sys/boot/efi/loader/main.c Tue Dec 22 03:07:38 2015 (r292584) @@ -64,10 +64,10 @@ EFI_GUID fdtdtb = FDT_TABLE_GUID; EFI_STATUS main(int argc, CHAR16 *argv[]) { - char vendor[128]; + char var[128]; EFI_LOADED_IMAGE *img; EFI_GUID *guid; - int i; + int i, j, vargood; /* * XXX Chicken-and-egg problem; we want to have console output @@ -77,6 +77,29 @@ main(int argc, CHAR16 *argv[]) */ cons_probe(); + /* + * Loop through the args, and for each one that contains an '=' that is + * not the first character, add it to the environment. This allows + * loader and kernel env vars to be passed on the command line. Convert + * args from UCS-2 to ASCII (16 to 8 bit) as they are copied. + */ + for (i = 1; i < argc; i++) { + vargood = 0; + for (j = 0; argv[i][j] != 0; j++) { + if (j == sizeof(var)) { + vargood = 0; + break; + } + if (j > 0 && argv[i][j] == '=') + vargood = 1; + var[j] = (char)argv[i][j]; + } + if (vargood) { + var[j] = 0; + putenv(var); + } + } + if (efi_copy_init()) { printf("failed to allocate staging area\n"); return (EFI_BUFFER_TOO_SMALL); From owner-svn-src-all@freebsd.org Tue Dec 22 04:13:23 2015 Return-Path: Delivered-To: svn-src-all@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 DC066A4CA4F; Tue, 22 Dec 2015 04:13:23 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (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 B7A761253; Tue, 22 Dec 2015 04:13:23 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id e126so175346609ioa.1; Mon, 21 Dec 2015 20:13:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=q4yWIbtP0rzezGKN3tv4+WJXgpVL3z1VG68tJR3x8Dg=; b=MNXW+Ruo6rjyRaybpcKLJ54zpUmf14Q/as6WttMEVCI8iBYnQMc3FNulkgUIXL18uc 024auFUetb1bkGYhbLhFFKMS4jwulfk1xTKVfQGLjX+z3IOXtyVUqYrTYs25XzZNCNdP xSEhR+kL0v7TfNuZDBcwis1a+VAwm8O4uOEsgCLSCTAurz9UamuzkrcgGVd8VQ5pCQJH coT/pso0PWsu1IPVM6ccIUa8S54RxKbQ6egz/HFCa6SH6nlAv0F/AayQdKvY1wz4EK+Z 0mE4ETbAsus0LoRvZRd4XsYIkL9ocfzL7gT4Bok+vwUB/Z7cjQ31BuhxL1zugLJ6mY6J sLLw== X-Received: by 10.107.30.80 with SMTP id e77mr23509543ioe.180.1450757603115; Mon, 21 Dec 2015 20:13:23 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.163.66 with HTTP; Mon, 21 Dec 2015 20:13:03 -0800 (PST) In-Reply-To: <6789662.X7p9Lo7J5l@ralph.baldwin.cx> References: <201512212242.tBLMg3IH035362@repo.freebsd.org> <6789662.X7p9Lo7J5l@ralph.baldwin.cx> From: Ed Maste Date: Tue, 22 Dec 2015 04:13:03 +0000 X-Google-Sender-Auth: _rrLshet9uXowJKp-rwZyyZofPw Message-ID: Subject: Re: svn commit: r292576 - head/sys/boot/efi/boot1 To: John Baldwin 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 04:13:24 -0000 On 21 December 2015 at 23:26, John Baldwin wrote: > > Perhaps it would be useful to have a shared 'EFI_ERROR_NUM()' macro? Yes, or perhaps even an efi_err() similar to err(3). My immediate goal is to bring the UEFI fixes from HEAD into stable/10 for 10.3, but will add EFI_ERROR_NUM or efi_err in a bit. From owner-svn-src-all@freebsd.org Tue Dec 22 05:57:24 2015 Return-Path: Delivered-To: svn-src-all@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 A9B2FA4EA6F; Tue, 22 Dec 2015 05:57:24 +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 7364F1D16; Tue, 22 Dec 2015 05:57:24 +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 tBM5vNCF062785; Tue, 22 Dec 2015 05:57:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM5vNJF062784; Tue, 22 Dec 2015 05:57:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512220557.tBM5vNJF062784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Dec 2015 05:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292585 - head/usr.sbin/uhsoctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 05:57:24 -0000 Author: ngie Date: Tue Dec 22 05:57:23 2015 New Revision: 292585 URL: https://svnweb.freebsd.org/changeset/base/292585 Log: Prevent use-after-free with ctx->ns in set_nameservers(..), which could occur if the memory wasn't allocated again later on Reported by: Coverity Submitted by: Miles Ohlrich MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/uhsoctl/uhsoctl.c Modified: head/usr.sbin/uhsoctl/uhsoctl.c ============================================================================== --- head/usr.sbin/uhsoctl/uhsoctl.c Tue Dec 22 03:07:38 2015 (r292584) +++ head/usr.sbin/uhsoctl/uhsoctl.c Tue Dec 22 05:57:23 2015 (r292585) @@ -452,6 +452,7 @@ set_nameservers(struct ctx *ctx, const c free(ctx->ns[i]); } free(ctx->ns); + ctx->ns = NULL; } fd = open(respath, O_RDWR | O_CREAT | O_NOFOLLOW, 0666); From owner-svn-src-all@freebsd.org Tue Dec 22 06:36:02 2015 Return-Path: Delivered-To: svn-src-all@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 33EECA4C429; Tue, 22 Dec 2015 06:36: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 DF5BA19F6; Tue, 22 Dec 2015 06:36: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 tBM6a1fp074197; Tue, 22 Dec 2015 06:36:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM6a1Tj074196; Tue, 22 Dec 2015 06:36:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512220636.tBM6a1Tj074196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 22 Dec 2015 06:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292586 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 06:36:02 -0000 Author: imp Date: Tue Dec 22 06:36:00 2015 New Revision: 292586 URL: https://svnweb.freebsd.org/changeset/base/292586 Log: For embedded platforms that require it, use mtools to copy the appropriate u-boot port's files into the fat part. Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Tue Dec 22 05:57:23 2015 (r292585) +++ head/tools/tools/nanobsd/embedded/common Tue Dec 22 06:36:00 2015 (r292586) @@ -86,7 +86,7 @@ NANO_CFG_BASE=$(pwd) NANO_CFG_BASE=$(realpath ${NANO_CFG_BASE}/..) NANO_SRC=$(realpath ${NANO_CFG_BASE}/../../..) #### XXX share obj -NANO_OBJ=$(realpath ${NANO_SRC}/../$NANO_NAME/obj || echo ${NANO_SRC}/../$NANO_NAME/obj) +NANO_OBJ=${NANO_SRC}/../$NANO_NAME/obj # Where cust_pkg() finds packages to install #XXX: Is this the right place? #NANO_PORTS=$(realpath ${NANO_SRC}/../ports) @@ -100,6 +100,9 @@ unset MAKEOBJDIRPREFIX NANO_PORTS=${NANO_PORTS:-/usr/ports} mkdir -p ${NANO_OBJ} +NANO_OBJ=$(realpath ${NANO_OBJ}) + +NANO_FAT_DIR=${NANO_OBJ}/_.fat customize_cmd cust_allow_ssh_root @@ -301,8 +304,11 @@ create_diskimage_mbr ( ) ( echo Creating MSDOS partition for kernel newfs_msdos -C ${NANO_SLICE_FAT_SIZE} -F 16 -L ${NANO_NAME} \ ${NANO_OBJ}/_.${NANO_SLICE_FAT} - # Need to copy files from ${NANO_FATDIR} with mtools, or use - # makefs -t msdos once that's supported + if [ -d ${NANO_FAT_DIR} ]; then + # Need to copy files from ${NANO_FATDIR} with mtools, or use + # makefs -t msdos once that's supported + mcopy -i ${NANO_OBJ}/_.${NANO_SLICE_FAT} ${NANO_FAT_DIR}/* :: + fi fi # Populate the Powerpc boot image, if needed @@ -440,7 +446,7 @@ save_build ( ) } customize_cmd save_build -shrink_md_fbsize() +shrink_md_fbsize ( ) { # We have a lot of little files on our memory disks. Let's decrease # the block and frag size to fit more little files on them (this @@ -454,8 +460,28 @@ customize_cmd shrink_md_fbsize customize_cmd cust_comconsole -product_custom() -{ +dos_boot_part ( ) +( + local d=/usr/local/share/u-boot/${NANO_BOOT_PKG} + + mkdir ${NANO_FAT_DIR} + cp ${d}/* ${NANO_FAT_DIR} +) + +if [ -n "$NANO_BOOT_PKG" ]; then + if [ ! -d ${d} ]; then + echo ${NANO_BOOT_PKG} not installed. Sadly, it must be. + exit 1 + fi + if [ ! -x /usr/local/bin/mcopy ]; then + echo mtools not installed. Sadly, we gotta have it. + exit 1 + fi + customize_cmd dos_boot_part +fi + +product_custom ( ) +( # not quie ready to tweak these in nopriv build if [ -z ${NANO_NOPRIV_BUILD} ]; then # Last second tweaks -- generally not needed @@ -467,7 +493,7 @@ product_custom() chown root:wheel ${NANO_WORLDDIR}/ chown root:wheel ${NANO_WORLDDIR}/usr fi -} +) late_customize_cmd product_custom # From owner-svn-src-all@freebsd.org Tue Dec 22 08:03:25 2015 Return-Path: Delivered-To: svn-src-all@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 172A2A14958; Tue, 22 Dec 2015 08:03:25 +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 D02A41A87; Tue, 22 Dec 2015 08:03:24 +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 tBM83OLV001426; Tue, 22 Dec 2015 08:03:24 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM83NQ2001422; Tue, 22 Dec 2015 08:03:23 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201512220803.tBM83NQ2001422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 22 Dec 2015 08:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292588 - in stable/10: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 08:03:25 -0000 Author: delphij Date: Tue Dec 22 08:03:23 2015 New Revision: 292588 URL: https://svnweb.freebsd.org/changeset/base/292588 Log: MFC: xz 5.2.2. Relnotes: yes Added: stable/10/contrib/xz/src/liblzma/api/lzma/lzma12.h - copied unchanged from r278433, head/contrib/xz/src/liblzma/api/lzma/lzma12.h stable/10/contrib/xz/src/liblzma/common/block_buffer_encoder.h - copied unchanged from r278433, head/contrib/xz/src/liblzma/common/block_buffer_encoder.h stable/10/contrib/xz/src/liblzma/common/hardware_cputhreads.c - copied unchanged from r278433, head/contrib/xz/src/liblzma/common/hardware_cputhreads.c stable/10/contrib/xz/src/liblzma/common/memcmplen.h - copied, changed from r278433, head/contrib/xz/src/liblzma/common/memcmplen.h stable/10/contrib/xz/src/liblzma/common/outqueue.c - copied unchanged from r278433, head/contrib/xz/src/liblzma/common/outqueue.c stable/10/contrib/xz/src/liblzma/common/outqueue.h - copied unchanged from r278433, head/contrib/xz/src/liblzma/common/outqueue.h stable/10/contrib/xz/src/liblzma/common/stream_encoder_mt.c - copied unchanged from r278433, head/contrib/xz/src/liblzma/common/stream_encoder_mt.c stable/10/contrib/xz/src/liblzma/liblzma.map - copied unchanged from r278433, head/contrib/xz/src/liblzma/liblzma.map stable/10/contrib/xz/src/liblzma/liblzma.pc.in - copied, changed from r276898, head/contrib/xz/src/liblzma/liblzma.pc.in stable/10/contrib/xz/src/liblzma/validate_map.sh - copied unchanged from r278433, head/contrib/xz/src/liblzma/validate_map.sh stable/10/contrib/xz/src/xz/mytime.c - copied unchanged from r278433, head/contrib/xz/src/xz/mytime.c stable/10/contrib/xz/src/xz/mytime.h - copied unchanged from r278433, head/contrib/xz/src/xz/mytime.h Deleted: stable/10/contrib/xz/src/liblzma/api/lzma/lzma.h stable/10/contrib/xz/src/liblzma/common/stream_encoder.h Modified: stable/10/Makefile.inc1 stable/10/ObsoleteFiles.inc stable/10/contrib/xz/ChangeLog stable/10/contrib/xz/FREEBSD-Xlist stable/10/contrib/xz/FREEBSD-upgrade stable/10/contrib/xz/THANKS stable/10/contrib/xz/TODO stable/10/contrib/xz/src/common/mythread.h stable/10/contrib/xz/src/common/sysdefs.h stable/10/contrib/xz/src/common/tuklib_cpucores.c stable/10/contrib/xz/src/common/tuklib_integer.h stable/10/contrib/xz/src/common/tuklib_physmem.c stable/10/contrib/xz/src/liblzma/api/lzma.h stable/10/contrib/xz/src/liblzma/api/lzma/base.h stable/10/contrib/xz/src/liblzma/api/lzma/block.h stable/10/contrib/xz/src/liblzma/api/lzma/container.h stable/10/contrib/xz/src/liblzma/api/lzma/filter.h stable/10/contrib/xz/src/liblzma/api/lzma/hardware.h stable/10/contrib/xz/src/liblzma/api/lzma/index.h stable/10/contrib/xz/src/liblzma/api/lzma/index_hash.h stable/10/contrib/xz/src/liblzma/api/lzma/version.h stable/10/contrib/xz/src/liblzma/check/check.h stable/10/contrib/xz/src/liblzma/check/sha256.c stable/10/contrib/xz/src/liblzma/common/alone_decoder.c stable/10/contrib/xz/src/liblzma/common/alone_decoder.h stable/10/contrib/xz/src/liblzma/common/alone_encoder.c stable/10/contrib/xz/src/liblzma/common/auto_decoder.c stable/10/contrib/xz/src/liblzma/common/block_buffer_decoder.c stable/10/contrib/xz/src/liblzma/common/block_buffer_encoder.c stable/10/contrib/xz/src/liblzma/common/block_decoder.c stable/10/contrib/xz/src/liblzma/common/block_decoder.h stable/10/contrib/xz/src/liblzma/common/block_encoder.c stable/10/contrib/xz/src/liblzma/common/block_encoder.h stable/10/contrib/xz/src/liblzma/common/block_header_decoder.c stable/10/contrib/xz/src/liblzma/common/block_header_encoder.c stable/10/contrib/xz/src/liblzma/common/block_util.c stable/10/contrib/xz/src/liblzma/common/common.c stable/10/contrib/xz/src/liblzma/common/common.h stable/10/contrib/xz/src/liblzma/common/easy_buffer_encoder.c stable/10/contrib/xz/src/liblzma/common/easy_encoder.c stable/10/contrib/xz/src/liblzma/common/filter_buffer_decoder.c stable/10/contrib/xz/src/liblzma/common/filter_buffer_encoder.c stable/10/contrib/xz/src/liblzma/common/filter_common.c stable/10/contrib/xz/src/liblzma/common/filter_common.h stable/10/contrib/xz/src/liblzma/common/filter_decoder.c stable/10/contrib/xz/src/liblzma/common/filter_decoder.h stable/10/contrib/xz/src/liblzma/common/filter_encoder.c stable/10/contrib/xz/src/liblzma/common/filter_encoder.h stable/10/contrib/xz/src/liblzma/common/filter_flags_decoder.c stable/10/contrib/xz/src/liblzma/common/index.c stable/10/contrib/xz/src/liblzma/common/index_decoder.c stable/10/contrib/xz/src/liblzma/common/index_encoder.c stable/10/contrib/xz/src/liblzma/common/index_encoder.h stable/10/contrib/xz/src/liblzma/common/index_hash.c stable/10/contrib/xz/src/liblzma/common/stream_buffer_decoder.c stable/10/contrib/xz/src/liblzma/common/stream_buffer_encoder.c stable/10/contrib/xz/src/liblzma/common/stream_decoder.c stable/10/contrib/xz/src/liblzma/common/stream_decoder.h stable/10/contrib/xz/src/liblzma/common/stream_encoder.c stable/10/contrib/xz/src/liblzma/delta/delta_common.c stable/10/contrib/xz/src/liblzma/delta/delta_decoder.c stable/10/contrib/xz/src/liblzma/delta/delta_decoder.h stable/10/contrib/xz/src/liblzma/delta/delta_encoder.c stable/10/contrib/xz/src/liblzma/delta/delta_encoder.h stable/10/contrib/xz/src/liblzma/delta/delta_private.h stable/10/contrib/xz/src/liblzma/lz/lz_decoder.c stable/10/contrib/xz/src/liblzma/lz/lz_decoder.h stable/10/contrib/xz/src/liblzma/lz/lz_encoder.c stable/10/contrib/xz/src/liblzma/lz/lz_encoder.h stable/10/contrib/xz/src/liblzma/lz/lz_encoder_mf.c stable/10/contrib/xz/src/liblzma/lzma/fastpos.h stable/10/contrib/xz/src/liblzma/lzma/lzma2_decoder.c stable/10/contrib/xz/src/liblzma/lzma/lzma2_decoder.h stable/10/contrib/xz/src/liblzma/lzma/lzma2_encoder.c stable/10/contrib/xz/src/liblzma/lzma/lzma2_encoder.h stable/10/contrib/xz/src/liblzma/lzma/lzma_common.h stable/10/contrib/xz/src/liblzma/lzma/lzma_decoder.c stable/10/contrib/xz/src/liblzma/lzma/lzma_decoder.h stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder.c stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder.h stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder_private.h stable/10/contrib/xz/src/liblzma/rangecoder/range_decoder.h stable/10/contrib/xz/src/liblzma/simple/arm.c stable/10/contrib/xz/src/liblzma/simple/armthumb.c stable/10/contrib/xz/src/liblzma/simple/ia64.c stable/10/contrib/xz/src/liblzma/simple/powerpc.c stable/10/contrib/xz/src/liblzma/simple/simple_coder.c stable/10/contrib/xz/src/liblzma/simple/simple_coder.h stable/10/contrib/xz/src/liblzma/simple/simple_decoder.c stable/10/contrib/xz/src/liblzma/simple/simple_decoder.h stable/10/contrib/xz/src/liblzma/simple/simple_private.h stable/10/contrib/xz/src/liblzma/simple/sparc.c stable/10/contrib/xz/src/liblzma/simple/x86.c stable/10/contrib/xz/src/xz/args.c stable/10/contrib/xz/src/xz/args.h stable/10/contrib/xz/src/xz/coder.c stable/10/contrib/xz/src/xz/coder.h stable/10/contrib/xz/src/xz/file_io.c stable/10/contrib/xz/src/xz/file_io.h stable/10/contrib/xz/src/xz/hardware.c stable/10/contrib/xz/src/xz/hardware.h stable/10/contrib/xz/src/xz/list.c stable/10/contrib/xz/src/xz/main.c stable/10/contrib/xz/src/xz/message.c stable/10/contrib/xz/src/xz/options.c stable/10/contrib/xz/src/xz/private.h stable/10/contrib/xz/src/xz/signals.c stable/10/contrib/xz/src/xz/suffix.c stable/10/contrib/xz/src/xz/xz.1 stable/10/lib/Makefile stable/10/lib/libarchive/Makefile stable/10/lib/liblzma/Makefile stable/10/lib/liblzma/Symbol.map stable/10/lib/liblzma/Versions.def stable/10/lib/liblzma/config.h stable/10/rescue/rescue/Makefile stable/10/usr.bin/cpio/Makefile stable/10/usr.bin/grep/Makefile stable/10/usr.bin/gzip/Makefile stable/10/usr.bin/lzmainfo/Makefile stable/10/usr.bin/mkulzma/Makefile stable/10/usr.bin/tar/Makefile stable/10/usr.bin/xz/Makefile stable/10/usr.bin/xzdec/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Tue Dec 22 07:59:41 2015 (r292587) +++ stable/10/Makefile.inc1 Tue Dec 22 08:03:23 2015 (r292588) @@ -1697,6 +1697,8 @@ _lib_libradius= lib/libradius _ofed_lib= contrib/ofed/usr.lib/ .endif +lib/liblzma__L: lib/libthr__L + _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib} .for _DIR in ${LOCAL_LIB_DIRS} .if exists(${.CURDIR}/${_DIR}/Makefile) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Tue Dec 22 07:59:41 2015 (r292587) +++ stable/10/ObsoleteFiles.inc Tue Dec 22 08:03:23 2015 (r292588) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20151222: liblzma header +OLD_FILES+=usr/include/lzma/lzma.h # 20151115: added missing _test suffix on multiple tests in lib/libc OLD_FILES+=usr/tests/lib/libc/c063/faccessat OLD_FILES+=usr/tests/lib/libc/c063/fchmodat Modified: stable/10/contrib/xz/ChangeLog ============================================================================== --- stable/10/contrib/xz/ChangeLog Tue Dec 22 07:59:41 2015 (r292587) +++ stable/10/contrib/xz/ChangeLog Tue Dec 22 08:03:23 2015 (r292588) @@ -1,66 +1,1463 @@ -commit 495aaf3a5b7200a5d2bf449bbbcc0e18834607af +commit 9815cdf6987ef91a85493bfcfd1ce2aaf3b47a0a Author: Lasse Collin -Date: 2014-09-20 20:44:32 +0300 +Date: 2015-09-29 13:59:35 +0300 - Bump version and soname for 5.0.7. + Bump version and soname for 5.2.2. src/liblzma/Makefile.am | 2 +- src/liblzma/api/lzma/version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -commit ac6c8921d1d8d2d749d5c97f9a0b0594cc863cea +commit cbe0cec8476bdd0416c7ca9bc83895c9bea1cf78 Author: Lasse Collin -Date: 2014-09-20 20:43:29 +0300 +Date: 2015-09-29 13:57:28 +0300 + + Update NEWS for 5.2.2. + + NEWS | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +commit 49427ce7eececdd18bbd35dab23c81910d083e1c +Author: Andre Noll +Date: 2015-05-28 15:50:00 +0200 + + Fix typo in German translation. + + As pointed out by Robert Pollak, there's a typo in the German + translation of the compression preset option (-0 ... -9) help text. + "The compressor" translates to "der Komprimierer", and the genitive + form is "des Komprimierers". The old word makes no sense at all. + + po/de.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 608d6f06c940e7f28c25de005e8b99bdff42d27c +Author: Hauke Henningsen +Date: 2015-08-17 04:59:54 +0200 + + Update German translation, mostly wrt orthography + + Provide an update of the German translation. + * A lot of compound words were previously written with spaces, while + German orthography is relatively clear in that the components + should not be separated. + * When referring to the actual process of (de)compression rather than the + concept, replace “(De-)Kompression†with “(De-)Komprimierungâ€. + Previously, both forms were used in this context and are now used in a + manner consistent with “Komprimierung†being more likely to refer to + a process. + * Consistently translate “standard inputâ€/“output†+ * Use “Zeichen†instead of false friend “Charakter†for “character†+ * Insert commas around relative clauses (as required in German) + * Some other minor corrections + * Capitalize “߆as “ẞ†+ * Consistently start option descriptions in --help with capital letters + + Acked-By: Andre Noll + + * Update after msgmerge + + po/de.po | 383 ++++++++++++++++++++++++++++++++------------------------------- + 1 file changed, 196 insertions(+), 187 deletions(-) + +commit c8988414e5b67b8ef2fe0ba7b1ccdd0ec73c60d3 +Author: Lasse Collin +Date: 2015-08-11 13:23:04 +0300 + + Build: Minor Cygwin cleanup. + + Some tests used "cygwin*" and some used "cygwin". I changed + them all to use "cygwin". Shouldn't affect anything in practice. + + configure.ac | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit 85a6dfed53477906bfe9a7c0123dd412e391cb48 +Author: Lasse Collin +Date: 2015-08-11 13:21:52 +0300 + + Build: Support building of MSYS2 binaries. + + configure.ac | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +commit 77f270be8432df2e4516a0c48814b6976d6618c5 +Author: Lasse Collin +Date: 2015-08-09 21:06:26 +0300 + + Windows: Define DLL_EXPORT when building liblzma.dll with MSVC. + + src/liblzma/common/common.h uses it to set __declspec(dllexport) + for the API symbols. + + Thanks to Adam Walling. + + windows/liblzma_dll.vcxproj | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 8c975446c5903090a5a8493b5b96b71003056a88 +Author: Lasse Collin +Date: 2015-08-09 21:02:20 +0300 + + Windows: Omit unneeded header files from MSVC project files. + + windows/liblzma.vcxproj | 5 ----- + windows/liblzma_dll.vcxproj | 5 ----- + 2 files changed, 10 deletions(-) + +commit 119a00434954726ca58e4a578e6469f530fca30e +Author: Lasse Collin +Date: 2015-07-12 20:48:19 +0300 + + liblzma: A MSVC-specific hack isn't needed with MSVC 2013 and newer. + + src/liblzma/api/lzma.h | 18 +++++++++++++----- + 1 file changed, 13 insertions(+), 5 deletions(-) + +commit d4e7c557fcab353539c9481a8d95cb04bcb15c7c +Author: Lasse Collin +Date: 2015-06-19 20:38:55 +0300 + + Update THANKS. + + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + +commit 98001740ca56c894a7bd32eb47e9857a8a7d878d +Author: Lasse Collin +Date: 2015-06-19 20:21:30 +0300 + + Windows: Update the docs. + + INSTALL | 29 ++++++---- + windows/INSTALL-MSVC.txt | 47 +++++++++++++++ + windows/INSTALL-MinGW.txt | 138 ++++++++++++++++++++++++++++++++++++++++++++ + windows/INSTALL-Windows.txt | 138 -------------------------------------------- + 4 files changed, 204 insertions(+), 148 deletions(-) + +commit 28195e4c877007cc760ecea1d17f740693d66873 +Author: Lasse Collin +Date: 2015-06-19 17:25:31 +0300 + + Windows: Add MSVC project files for building liblzma. + + Thanks to Adam Walling for creating these files. + + windows/liblzma.vcxproj | 359 ++++++++++++++++++++++++++++++++++++++++ + windows/liblzma_dll.vcxproj | 388 ++++++++++++++++++++++++++++++++++++++++++++ + windows/xz_win.sln | 48 ++++++ + 3 files changed, 795 insertions(+) + +commit 960440f3230dc628f6966d9f7614fc1b28baf44e +Author: Lasse Collin +Date: 2015-05-13 20:57:55 +0300 + + Tests: Fix a memory leak in test_bcj_exact_size. + + Thanks to Cristian Rodríguez. + + tests/test_bcj_exact_size.c | 1 + + 1 file changed, 1 insertion(+) + +commit 68cd35acafbdcdf4e8ea8b5bb843c736939d6f8b +Author: Lasse Collin +Date: 2015-05-12 18:08:24 +0300 + + Fix NEWS about threading in 5.2.0. + + Thanks to Andy Hochhaus. + + NEWS | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit ff96ed6d25786728356017a13baf8c14731b4f1e +Author: Lasse Collin +Date: 2015-05-11 21:26:16 +0300 + + xz: Document that threaded decompression hasn't been implemented yet. + + src/xz/xz.1 | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit 00d37b64a64ea8597fd2422d5187afd761ab9531 +Author: Lasse Collin +Date: 2015-04-20 20:20:29 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit db190a832c49ca3aed6d69cc992fa5583cae7b11 +Author: Lasse Collin +Date: 2015-04-20 19:59:18 +0300 + + Revert "xz: Use pipe2() if available." + + This reverts commit 7a11c4a8e5e15f13d5fa59233b3172e65428efdd. + It is a problem when libc has pipe2() but the kernel is too + old to have pipe2() and thus pipe2() fails. In xz it's pointless + to have a fallback for non-functioning pipe2(); it's better to + avoid pipe2() completely. + + Thanks to Michael Fox for the bug report. + + configure.ac | 4 ++-- + src/xz/file_io.c | 9 +-------- + 2 files changed, 3 insertions(+), 10 deletions(-) + +commit eccd8155e107c5ada03d13e7730675cdf1a44ddc +Author: Lasse Collin +Date: 2015-03-29 22:14:47 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 25263fd9e7a8a913395cb93d7c104cd48c2b4a00 +Author: Lasse Collin +Date: 2015-03-29 22:13:48 +0300 + + Fix the detection of installed RAM on QNX. + + The earlier version compiled but didn't actually work + since sysconf(_SC_PHYS_PAGES) always fails (or so I was told). + + Thanks to Ole André Vadla RavnÃ¥s for the patch and testing. + + m4/tuklib_physmem.m4 | 6 +++--- + src/common/tuklib_physmem.c | 14 +++++++++++++- + 2 files changed, 16 insertions(+), 4 deletions(-) + +commit 4c544d2410903d38402221cb783ed85585b6a007 +Author: Lasse Collin +Date: 2015-03-27 22:39:07 +0200 + + Fix CPU core count detection on QNX. + + It tried to use sysctl() on QNX but + - it broke the build because sysctl() needs -lsocket on QNX; + - sysctl() doesn't work for detecting the core count on QNX + even if it compiled. + + sysconf() works. An alternative would have been to use + QNX-specific SYSPAGE_ENTRY(num_cpu) from . + + Thanks to Ole André Vadla RavnÃ¥s. + + m4/tuklib_cpucores.m4 | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +commit e0ea6737b03e83ccaff4514d00e31bb926f8f0f3 +Author: Lasse Collin +Date: 2015-03-07 22:05:57 +0200 + + xz: size_t/uint32_t cleanup in options.c. + + src/xz/options.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +commit 8bcca29a65335fd679c13814b70b35b68fa5daed +Author: Lasse Collin +Date: 2015-03-07 22:04:23 +0200 + + xz: Fix a comment and silence a warning in message.c. + + src/xz/message.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit f243f5f44c6b19a7c289a0ec73a03ee08364cb5b +Author: Lasse Collin +Date: 2015-03-07 22:01:00 +0200 + + liblzma: Silence more uint32_t vs. size_t warnings. + + src/liblzma/lz/lz_encoder.c | 2 +- + src/liblzma/lzma/lzma_encoder.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 7f0a4c50f4a374c40acf4b86848f301ad1e82d34 +Author: Lasse Collin +Date: 2015-03-07 19:54:00 +0200 + + xz: Make arg_count an unsigned int to silence a warning. + + Actually the value of arg_count cannot exceed INT_MAX + but it's nicer as an unsigned int. + + src/xz/args.h | 2 +- + src/xz/main.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit f6ec46801588b1be29c07c9db98558b521304002 +Author: Lasse Collin +Date: 2015-03-07 19:33:17 +0200 + + liblzma: Fix a warning in index.c. + + src/liblzma/common/index.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +commit a24518971cc621315af142dd3bb7614fab04ad27 +Author: Lasse Collin +Date: 2015-02-26 20:46:14 +0200 + + Build: Fix a CR+LF problem when running autoreconf -fi on OS/2. + + build-aux/version.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit dec11497a71518423b5ff0e759100cf8aadf6c7b +Author: Lasse Collin +Date: 2015-02-26 16:53:44 +0200 + + Bump version and soname for 5.2.1. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 29e39c79975ab89ee5dd671e97064534a9f3a649 +Author: Lasse Collin +Date: 2015-02-26 13:01:09 +0200 + + Update NEWS for 5.2.1. + + NEWS | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +commit 7a11c4a8e5e15f13d5fa59233b3172e65428efdd +Author: Lasse Collin +Date: 2015-02-22 19:38:48 +0200 + + xz: Use pipe2() if available. + + configure.ac | 4 ++-- + src/xz/file_io.c | 9 ++++++++- + 2 files changed, 10 insertions(+), 3 deletions(-) + +commit 117d962685c72682c63edc9bb765367189800202 +Author: Lasse Collin +Date: 2015-02-21 23:40:26 +0200 + + liblzma: Fix a compression-ratio regression in LZMA1/2 in fast mode. + + The bug was added in the commit + f48fce093b07aeda95c18850f5e086d9f2383380 and thus + affected 5.1.4beta and 5.2.0. Luckily the bug cannot + cause data corruption or other nasty things. + + src/liblzma/lzma/lzma_encoder_optimum_fast.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit ae984e31c167d3bc52972ec422dd1ebd5f5d5719 +Author: Lasse Collin +Date: 2015-02-21 23:00:19 +0200 + + xz: Fix the fcntl() usage when creating a pipe for the self-pipe trick. + + Now it reads the old flags instead of blindly setting O_NONBLOCK. + The old code may have worked correctly, but this is better. + + src/xz/file_io.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +commit 2205bb5853098aea36a56df6f5747037175f66b4 +Author: Lasse Collin +Date: 2015-02-10 15:29:34 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit d935b0cdf3db440269b9d952b2b281b18f8c7b08 +Author: Lasse Collin +Date: 2015-02-10 15:28:30 +0200 + + tuklib_cpucores: Use cpuset_getaffinity() on FreeBSD if available. + + In FreeBSD, cpuset_getaffinity() is the preferred way to get + the number of available cores. + + Thanks to Rui Paulo for the patch. I edited it slightly, but + hopefully I didn't break anything. + + m4/tuklib_cpucores.m4 | 23 ++++++++++++++++++++++- + src/common/tuklib_cpucores.c | 18 ++++++++++++++++++ + 2 files changed, 40 insertions(+), 1 deletion(-) + +commit eb61bc58c20769cac4d05f363b9c0e8c9c71a560 +Author: Lasse Collin +Date: 2015-02-09 22:08:37 +0200 + + xzdiff: Make the mktemp usage compatible with FreeBSD's mktemp. + + Thanks to Rui Paulo for the fix. + + src/scripts/xzdiff.in | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +commit b9a5b6b7a29029680af733082b6a46e0fc01623a +Author: Lasse Collin +Date: 2015-02-03 21:45:53 +0200 + + Add a few casts to tuklib_integer.h to silence possible warnings. + + I heard that Visual Studio 2013 gave warnings without the casts. + + Thanks to Gabi Davar. + + src/common/tuklib_integer.h | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +commit c45757135f40e4a0de730ba5fff0100219493982 +Author: Lasse Collin +Date: 2015-01-26 21:24:39 +0200 + + liblzma: Set LZMA_MEMCMPLEN_EXTRA depending on the compare method. + + src/liblzma/common/memcmplen.h | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +commit 3c500174ed5485f550972a2a6109c361e875f069 +Author: Lasse Collin +Date: 2015-01-26 20:40:16 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit fec88d41e672d9e197c9442aecf02bd0dfa6d516 +Author: Lasse Collin +Date: 2015-01-26 20:39:28 +0200 + + liblzma: Silence harmless Valgrind errors. + + Thanks to Torsten Rupp for reporting this. I had + forgotten to run Valgrind before the 5.2.0 release. + + src/liblzma/lz/lz_encoder.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit a9b45badfec0928d20a27c7176c005fa637f7d1e +Author: Lasse Collin +Date: 2015-01-09 21:50:19 +0200 + + xz: Fix comments. + + src/xz/file_io.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit 541aee6dd4aa97a809aba281475a21b641bb89e2 +Author: Lasse Collin +Date: 2015-01-09 21:35:06 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 4170edc914655310d2363baccf5e615e09b04911 +Author: Lasse Collin +Date: 2015-01-09 21:34:06 +0200 + + xz: Don't fail if stdout doesn't support O_NONBLOCK. + + This is similar to the case with stdin. + + Thanks to Brad Smith for the bug report and testing + on OpenBSD. + + src/xz/file_io.c | 36 +++++++++++++++--------------------- + 1 file changed, 15 insertions(+), 21 deletions(-) + +commit 04bbc0c2843c50c8ad1cba42b937118e38b0508d +Author: Lasse Collin +Date: 2015-01-07 19:18:20 +0200 + + xz: Fix a memory leak in DOS-specific code. + + src/xz/file_io.c | 2 ++ + 1 file changed, 2 insertions(+) + +commit f0f1f6c7235ffa901cf76fe18e33749e200b3eea +Author: Lasse Collin +Date: 2015-01-07 19:08:06 +0200 + + xz: Don't fail if stdin doesn't support O_NONBLOCK. + + It's a problem at least on OpenBSD which doesn't support + O_NONBLOCK on e.g. /dev/null. I'm not surprised if it's + a problem on other OSes too since this behavior is allowed + in POSIX-1.2008. + + The code relying on this behavior was committed in June 2013 + and included in 5.1.3alpha released on 2013-10-26. Clearly + the development releases only get limited testing. + + src/xz/file_io.c | 18 +++++++----------- + 1 file changed, 7 insertions(+), 11 deletions(-) + +commit d2d484647d9d9d679f03c75abb0404f67069271c +Author: Lasse Collin +Date: 2015-01-06 20:30:15 +0200 + + Tests: Don't hide unexpected error messages in test_files.sh. + + Hiding them makes no sense since normally there's no error + when testing the "good" files. With "bad" files errors are + expected and then it makes sense to keep the messages hidden. + + tests/test_files.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit aae6a6aeda51cf94a47e39ad624728f9bee75e30 +Author: Lasse Collin +Date: 2014-12-30 11:17:16 +0200 + + Update Solaris notes in INSTALL. + + Mention the possible "make check" failure on Solaris in the + Solaris-specific section of INSTALL. It was already in + section 4.5 but it is better mention it in the OS-specific + section too. + + INSTALL | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 7815112153178800a3521b9f31960e7cdc26cfba +Author: Lasse Collin +Date: 2014-12-26 12:00:05 +0200 + + Build: POSIX shell isn't required if scripts are disabled. + + INSTALL | 3 ++- + configure.ac | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +commit a0cd05ee71d330b79ead6eb9222e1b24e1559d3a +Author: Lasse Collin +Date: 2014-12-21 20:48:37 +0200 + + DOS: Update Makefile. + + dos/Makefile | 1 + + 1 file changed, 1 insertion(+) + +commit b85ee0905ec4ab7656d22e63519fdd3bedb21f2e +Author: Lasse Collin +Date: 2014-12-21 19:50:38 +0200 + + Windows: Fix bin_i486 to bin_i686 in build.bash. + + windows/build.bash | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cbafa710918195dbba3db02c3fab4f0538235206 +Author: Lasse Collin +Date: 2014-12-21 18:58:44 +0200 + + Docs: Use lzma_cputhreads() in 04_compress_easy_mt.c. + + doc/examples/04_compress_easy_mt.c | 30 ++++++++++++++++++++++++++---- + 1 file changed, 26 insertions(+), 4 deletions(-) + +commit 8dbb57238d372c7263cfeb3e7f7fd9a73173156a +Author: Lasse Collin +Date: 2014-12-21 18:56:44 +0200 + + Docs: Update docs/examples/00_README.txt. + + doc/examples/00_README.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 6060f7dc76fd6c2a8a1f8e85d0e4d86bb78273e6 +Author: Lasse Collin +Date: 2014-12-21 18:11:17 +0200 + + Bump version and soname for 5.2.0. + + I know that soname != app version, but I skip AGE=1 + in -version-info to make the soname match the liblzma + version anyway. It doesn't hurt anything as long as + it doesn't conflict with library versioning rules. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 6 +++--- + src/liblzma/liblzma.map | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +commit 3e8bd1d15e417f2d588e9be50ce027ee3d48b2da +Author: Lasse Collin +Date: 2014-12-21 18:05:03 +0200 + + Avoid variable-length arrays in the debug programs. + + debug/full_flush.c | 3 ++- + debug/sync_flush.c | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +commit 72f7307cfdceb941aeb2bf30d424cc0d13621786 +Author: Lasse Collin +Date: 2014-12-21 18:01:45 +0200 + + Build: Include 04_compress_easy_mt.c in the tarball. + + Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +commit 2cb82ff21c62def11f3683a8bb0aaf363102aaa0 +Author: Lasse Collin +Date: 2014-12-21 18:00:38 +0200 + + Fix build when --disable-threads is used. + + src/common/mythread.h | 2 ++ + 1 file changed, 2 insertions(+) + +commit 9b9e3536e458ef958f66b0e8982efc9d36de4d17 +Author: Adrien Nader +Date: 2014-12-21 15:56:15 +0100 + + po/fr: improve wording for help for --lzma1/--lzma2. + + po/fr.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit a8b6b569e7fadbf5b5b9139d53bc764015c15027 +Author: Adrien Nader +Date: 2014-12-21 15:55:48 +0100 + + po/fr: missing line in translation of --extreme. + + po/fr.po | 1 + + 1 file changed, 1 insertion(+) + +commit f168a6fd1a888cf4f0caaddcafcb21dadc6ab6e9 +Author: Lasse Collin +Date: 2014-12-21 14:32:33 +0200 + + Update NEWS for 5.2.0. + + NEWS | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 65 insertions(+) + +commit cec2ee863b3a88f4bf039cb00f73c4a4fc93a429 +Author: Lasse Collin +Date: 2014-12-21 14:32:22 +0200 + + Update NEWS for 5.0.8. + + NEWS | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +commit 42e97a32649bf53ce43be2258b902a417c6e7fa1 +Author: Lasse Collin +Date: 2014-12-21 14:07:54 +0200 + + xz: Fix a comment. + + src/xz/options.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 29b95d5d6665cedffa6a9d6d3d914f981e852182 +Author: Lasse Collin +Date: 2014-12-20 20:43:14 +0200 + + Update INSTALL about the dependencies of the scripts. + + INSTALL | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +commit 3af91040bb42c21afbb81f5568c3313125e61192 +Author: Lasse Collin +Date: 2014-12-20 20:42:33 +0200 + + Windows: Update build instructions. + + INSTALL | 15 +++++++++------ + windows/INSTALL-Windows.txt | 44 +++++++++++++++++++++----------------------- + 2 files changed, 30 insertions(+), 29 deletions(-) + +commit 0152f72bf6289d744823dc6c849538f3a139ad70 +Author: Lasse Collin +Date: 2014-12-20 20:41:48 +0200 + + Windows: Update the build script and README-Windows.txt. + + The 32-bit build is now for i686 or newer because the + prebuilt MinGW-w64 toolchains include i686 code in the + executables even if one uses -march=i486. + + The build script builds 32-bit SSE2 enabled version too. + Run-time detection of SSE2 support would be nice (on any OS) + but it's not implemented in XZ Utils yet. + + windows/README-Windows.txt | 30 ++++++++++++++++-------------- + windows/build.bash | 23 ++++++++++++++--------- + 2 files changed, 30 insertions(+), 23 deletions(-) + +commit 4a1f6133ee5533cee8d91e06fcc22443e5f1881a +Author: Lasse Collin +Date: 2014-12-19 15:51:50 +0200 + + Windows: Define TUKLIB_SYMBOL_PREFIX in config.h. + + It is to keep all symbols in the lzma_ namespace. + + windows/config.h | 3 +++ + 1 file changed, 3 insertions(+) + +commit 7f7d093de79eee0c7dbfd7433647e46302f19f82 +Author: Lasse Collin +Date: 2014-12-16 21:00:09 +0200 + + xz: Update the man page about --threads. + + src/xz/xz.1 | 5 ----- + 1 file changed, 5 deletions(-) + +commit 009823448b82aa5f465668878a544c5842885407 +Author: Lasse Collin +Date: 2014-12-16 20:57:43 +0200 + + xz: Update the man page about --block-size. + + src/xz/xz.1 | 41 +++++++++++++++++++++++++++++++++-------- + 1 file changed, 33 insertions(+), 8 deletions(-) + +commit 7dddfbeb499e528940bc12047355c184644aafe9 +Author: Adrien Nader +Date: 2014-12-10 22:26:57 +0100 + + po/fr: several more translation updates: reword and handle --ignore-check. + + po/fr.po | 50 ++++++++++++++++++++++++++------------------------ + 1 file changed, 26 insertions(+), 24 deletions(-) + +commit 6eca5be40e04ddc4b738d493e4e56835956d8b69 +Author: Adrien Nader +Date: 2014-12-10 22:23:01 +0100 + + po/fr: yet another place where my email address had to be updated. + + po/fr.po | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit d1003673e92ba47edd6aeeb3dbea05c18269d0e7 +Author: Adrien Nader +Date: 2014-12-10 22:22:20 +0100 + + po/fr: fix several typos that have been around since the beginning. + + po/fr.po | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +commit 4c5aa911a0df027e46171e368debc543d2fa72b2 +Author: Adrien Nader +Date: 2014-12-03 20:02:31 +0100 + + po/fr: last batch of new translations for now. + + Four new error messages. + + po/fr.po | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +commit 3e3099e36d27059499e7996fb38a62e8ab01d356 +Author: Adrien Nader +Date: 2014-12-03 20:01:32 +0100 + + po/fr: translations for --threads, --block-size and --block-list. + + po/fr.po | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +commit e7d96a5933eec4e9d4a62569ee88df0ebb0f1d53 +Author: Adrien Nader +Date: 2014-12-03 20:00:53 +0100 + + po/fr: remove fuzzy marker for error messages that will be kept in English. + + The following is a copy of a comment inside fr.po: + + Note from translator on "file status flags". + The following entry is kept un-translated on purpose. It is difficult to + translate and should only happen in exceptional circumstances which means + that translating would: + - lose some of the meaning + - make it more difficult to look up in search engines; it might happen one + in + a million times, if we dilute the error message in 20 languages, it will be + almost impossible to find an explanation and support for the error. + + po/fr.po | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +commit 46cbb9033af8a21fafe543302d6919746e0d72af +Author: Adrien Nader +Date: 2014-12-03 19:58:25 +0100 + + po/fr: several minor updates and better wording. + + Meaning doesn't change at all: it's only for better wording and/or + formatting of a few strings. + + po/fr.po | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +commit 7ce49d444f04e73145f79c832eb4d510594b074a +Author: Adrien Nader +Date: 2014-12-03 19:56:12 +0100 + + po/fr: update my email address and copyright years. + + po/fr.po | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 214c553ebc3047cd720da1ce5c80cf7c38118d3c +Author: Adrien Nader +Date: 2014-11-26 10:08:26 +0100 + + fr.po: commit file after only "update-po" so actual is readable. + + po/fr.po | 311 ++++++++++++++++++++++++++++++++++++++++----------------------- + 1 file changed, 199 insertions(+), 112 deletions(-) + +commit 1190c641af09cde85f8bd0fbe5c4906f4a29431b +Author: Lasse Collin +Date: 2014-12-02 20:04:07 +0200 + + liblzma: Document how lzma_mt.block_size affects memory usage. + + src/liblzma/api/lzma/container.h | 4 ++++ + 1 file changed, 4 insertions(+) + +commit e4fc1d2f9571fba79ce383595be2ea2a9257def0 +Author: Lasse Collin +Date: 2014-11-28 20:07:18 +0200 + + Update INSTALL about a "make check" failure in test_scripts.sh. + + INSTALL | 24 +++++++++++++++++------- + 1 file changed, 17 insertions(+), 7 deletions(-) + +commit 34f9e40a0a0c3bd2c2730cdb9cd550bbb8a3f2fe +Author: Lasse Collin +Date: 2014-11-26 20:12:27 +0200 + + Remove LZMA_UNSTABLE macro. + + src/liblzma/api/lzma/container.h | 4 ---- + src/liblzma/common/common.h | 2 -- + src/xz/private.h | 1 - + 3 files changed, 7 deletions(-) + +commit 6d9c0ce9f2677b159e32b224aba5b535b304a705 +Author: Lasse Collin +Date: 2014-11-26 20:10:33 +0200 + + liblzma: Update lzma_stream_encoder_mt() API docs. + + src/liblzma/api/lzma/container.h | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit 2301f3f05dd9742f42cda8f0f318864f5dc39ab3 +Author: Lasse Collin +Date: 2014-11-25 12:32:05 +0200 + + liblzma: Verify the filter chain in threaded encoder initialization. + + This way an invalid filter chain is detected at the Stream + encoder initialization instead of delaying it to the first + call to lzma_code() which triggers the initialization of + the actual filter encoder(s). + + src/liblzma/common/stream_encoder_mt.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +commit 107a263d5bb63cd3593fd6a5c938706539f84523 +Author: Lasse Collin +Date: 2014-11-17 19:11:49 +0200 + + Build: Update m4/ax_pthread.m4 from Autoconf Archive. + + m4/ax_pthread.m4 | 71 +++++++++++++++++++++++++++++++++++++------------------- + 1 file changed, 47 insertions(+), 24 deletions(-) + +commit b13a781833399ff5726cfc997f3cb2f0acbdbf31 +Author: Lasse Collin +Date: 2014-11-17 18:52:21 +0200 + + Build: Replace obsolete AC_HELP_STRING with AS_HELP_STRING. + + configure.ac | 36 ++++++++++++++++++------------------ + m4/tuklib_integer.m4 | 2 +- + 2 files changed, 19 insertions(+), 19 deletions(-) + +commit 542cac122ed3550148a2af0033af22b757491378 +Author: Lasse Collin +Date: 2014-11-17 18:43:19 +0200 + + Build: Fix Autoconf warnings about escaped backquotes. + + Thanks to Daniel Richard G. for pointing out that it's + good to sometimes run autoreconf -fi with -Wall. + + configure.ac | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit 7b03a15cea8cd4f19ed680b51c4bcbae3ce4142f +Author: Lasse Collin +Date: 2014-11-10 18:54:40 +0200 + + xzdiff: Use mkdir if mktemp isn't available. + + src/scripts/xzdiff.in | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +commit f8c13e5e3609581d5dd9f8777985ca07f2390ad7 +Author: Lasse Collin +Date: 2014-11-10 18:45:01 +0200 + + xzdiff: Create a temporary directory to hold a temporary file. + + This avoids the possibility of "File name too long" when + creating a temp file when the input file name is very long. + + This also means that other users on the system can no longer + see the input file names in /tmp (or whatever $TMPDIR is) + since the temporary directory will have a generic name. This + usually doesn't matter since on many systems one can see + the arguments given to all processes anyway. + + The number X chars to mktemp where increased from 6 to 10. + + Note that with some shells temp files or dirs won't be used at all. + + src/scripts/xzdiff.in | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +commit 7716dcf9df7f457500cb657314e7a9aea5fedb06 +Author: Lasse Collin +Date: 2014-11-10 15:38:47 +0200 + + liblzma: Fix lzma_mt.preset in lzma_stream_encoder_mt_memusage(). + + It read the filter chain from a wrong variable. This is a similar + bug that was fixed in 9494fb6d0ff41c585326f00aa8f7fe58f8106a5e. + + src/liblzma/common/stream_encoder_mt.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +commit 230fa4a605542c84b4178a57381695a0af4e779b +Author: Lasse Collin +Date: 2014-11-10 14:49:55 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 4e4ae08bc7c1711e399c9f2d26eb375d39d08101 +Author: Lasse Collin +Date: 2014-10-29 21:28:25 +0200 + + Update .gitignore files. + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Dec 22 08:08:42 2015 Return-Path: Delivered-To: svn-src-all@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 62BC8A14B1B; Tue, 22 Dec 2015 08:08:42 +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 345A01CF3; Tue, 22 Dec 2015 08:08:42 +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 tBM88fWn001770; Tue, 22 Dec 2015 08:08:41 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM88fYY001769; Tue, 22 Dec 2015 08:08:41 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201512220808.tBM88fYY001769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 22 Dec 2015 08:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292589 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 08:08:42 -0000 Author: delphij Date: Tue Dec 22 08:08:41 2015 New Revision: 292589 URL: https://svnweb.freebsd.org/changeset/base/292589 Log: Bump __FreeBSD_version after xz 5.2.2 merge (multithread support). Modified: stable/10/sys/sys/param.h Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Tue Dec 22 08:03:23 2015 (r292588) +++ stable/10/sys/sys/param.h Tue Dec 22 08:08:41 2015 (r292589) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1002503 /* Master, propagated to newvers */ +#define __FreeBSD_version 1002504 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Dec 22 09:02:53 2015 Return-Path: Delivered-To: svn-src-all@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 343B6A4F1C8; Tue, 22 Dec 2015 09:02:53 +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 03316185B; Tue, 22 Dec 2015 09:02:52 +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 tBM92q9F032819; Tue, 22 Dec 2015 09:02:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM92qju032818; Tue, 22 Dec 2015 09:02:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512220902.tBM92qju032818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 22 Dec 2015 09:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292590 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 09:02:53 -0000 Author: mav Date: Tue Dec 22 09:02:51 2015 New Revision: 292590 URL: https://svnweb.freebsd.org/changeset/base/292590 Log: MFC r292290: Set DS flag, required for LPB log page by spec. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Tue Dec 22 08:08:41 2015 (r292589) +++ stable/10/sys/cam/ctl/ctl.c Tue Dec 22 09:02:51 2015 (r292590) @@ -6870,6 +6870,8 @@ ctl_log_sense(struct ctl_scsiio *ctsio) header = (struct scsi_log_header *)ctsio->kern_data_ptr; header->page = page_index->page_code; + if (page_index->page_code == SLS_LOGICAL_BLOCK_PROVISIONING) + header->page |= SL_DS; if (page_index->subpage) { header->page |= SL_SPF; header->subpage = page_index->subpage; From owner-svn-src-all@freebsd.org Tue Dec 22 09:08:25 2015 Return-Path: Delivered-To: svn-src-all@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 A71FEA4F3B3; Tue, 22 Dec 2015 09:08:25 +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 779121ADD; Tue, 22 Dec 2015 09:08:25 +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 tBM98OVR034446; Tue, 22 Dec 2015 09:08:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM98MvA034410; Tue, 22 Dec 2015 09:08:22 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512220908.tBM98MvA034410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 22 Dec 2015 09:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292591 - in head/sys: arm/at91 arm/cavium/cns11xx arm/conf arm/lpc arm/mv/discovery arm/mv/orion arm/xscale/ixp425 conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 09:08:25 -0000 Author: andrew Date: Tue Dec 22 09:08:21 2015 New Revision: 292591 URL: https://svnweb.freebsd.org/changeset/base/292591 Log: Remove the arm KERNPHYSADDR option as it is no longer used. The make option is still in existance as it is used to build the trampoline code. Modified: head/sys/arm/at91/std.bwct head/sys/arm/at91/std.eb9200 head/sys/arm/at91/std.ethernut5 head/sys/arm/at91/std.hl200 head/sys/arm/at91/std.hl201 head/sys/arm/at91/std.kb920x head/sys/arm/at91/std.qila9g20 head/sys/arm/at91/std.sam9260ek head/sys/arm/at91/std.sam9g20ek head/sys/arm/at91/std.sam9x25ek head/sys/arm/at91/std.sn9g45 head/sys/arm/at91/std.tsc4370 head/sys/arm/cavium/cns11xx/std.econa head/sys/arm/conf/ATMEL head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/CRB head/sys/arm/conf/GUMSTIX head/sys/arm/conf/NOTES head/sys/arm/conf/NSLU head/sys/arm/lpc/std.lpc head/sys/arm/mv/discovery/std.db78xxx head/sys/arm/mv/orion/std.db88f5xxx head/sys/arm/mv/orion/std.ts7800 head/sys/arm/xscale/ixp425/std.avila head/sys/conf/options.arm Modified: head/sys/arm/at91/std.bwct ============================================================================== --- head/sys/arm/at91/std.bwct Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/at91/std.bwct Tue Dec 22 09:08:21 2015 (r292591) @@ -2,7 +2,6 @@ include "../at91/std.at91" makeoptions KERNPHYSADDR=0x20000000 -options KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNVIRTADDR=0xc0000000 Modified: head/sys/arm/at91/std.eb9200 ============================================================================== --- head/sys/arm/at91/std.eb9200 Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/at91/std.eb9200 Tue Dec 22 09:08:21 2015 (r292591) @@ -2,7 +2,6 @@ include "../at91/std.at91" makeoptions KERNPHYSADDR=0x20000000 -options KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNVIRTADDR=0xc0000000 Modified: head/sys/arm/at91/std.ethernut5 ============================================================================== --- head/sys/arm/at91/std.ethernut5 Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/at91/std.ethernut5 Tue Dec 22 09:08:21 2015 (r292591) @@ -3,7 +3,6 @@ include "../at91/std.at91sam9" makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 -options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 device at91_board_ethernut5 Modified: head/sys/arm/at91/std.hl200 ============================================================================== --- head/sys/arm/at91/std.hl200 Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/at91/std.hl200 Tue Dec 22 09:08:21 2015 (r292591) @@ -2,7 +2,6 @@ include "../at91/std.at91" makeoptions KERNPHYSADDR=0x20100000 -options KERNPHYSADDR=0x20100000 makeoptions KERNVIRTADDR=0xc0100000 options KERNVIRTADDR=0xc0100000 Modified: head/sys/arm/at91/std.hl201 ============================================================================== --- head/sys/arm/at91/std.hl201 Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/at91/std.hl201 Tue Dec 22 09:08:21 2015 (r292591) @@ -3,7 +3,6 @@ include "../at91/std.at91sam9" makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 -options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 device at91_board_hl201 Modified: head/sys/arm/at91/std.kb920x ============================================================================== --- head/sys/arm/at91/std.kb920x Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/at91/std.kb920x Tue Dec 22 09:08:21 2015 (r292591) @@ -2,7 +2,6 @@ include "../at91/std.at91" makeoptions KERNPHYSADDR=0x20000000 -options KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNVIRTADDR=0xc0000000 Modified: head/sys/arm/at91/std.qila9g20 ============================================================================== --- head/sys/arm/at91/std.qila9g20 Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/at91/std.qila9g20 Tue Dec 22 09:08:21 2015 (r292591) @@ -3,7 +3,6 @@ include "../at91/std.at91sam9" makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 -options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 device at91_board_qila9g20 Modified: head/sys/arm/at91/std.sam9260ek ============================================================================== --- head/sys/arm/at91/std.sam9260ek Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/at91/std.sam9260ek Tue Dec 22 09:08:21 2015 (r292591) @@ -3,7 +3,6 @@ include "../at91/std.at91sam9" makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 -options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 device at91_board_sam9260ek Modified: head/sys/arm/at91/std.sam9g20ek ============================================================================== --- head/sys/arm/at91/std.sam9g20ek Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/at91/std.sam9g20ek Tue Dec 22 09:08:21 2015 (r292591) @@ -3,7 +3,6 @@ include "../at91/std.at91sam9" makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 -options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 device at91_board_sam9g20ek Modified: head/sys/arm/at91/std.sam9x25ek ============================================================================== --- head/sys/arm/at91/std.sam9x25ek Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/at91/std.sam9x25ek Tue Dec 22 09:08:21 2015 (r292591) @@ -3,7 +3,6 @@ include "../at91/std.at91sam9" makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 -options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 device at91_board_sam9x25ek Modified: head/sys/arm/at91/std.sn9g45 ============================================================================== --- head/sys/arm/at91/std.sn9g45 Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/at91/std.sn9g45 Tue Dec 22 09:08:21 2015 (r292591) @@ -2,7 +2,6 @@ include "../at91/std.at91sam9g45" makeoptions KERNPHYSADDR=0x70008000 -options KERNPHYSADDR=0x70008000 makeoptions KERNVIRTADDR=0xc0008000 options KERNVIRTADDR=0xc0008000 Modified: head/sys/arm/at91/std.tsc4370 ============================================================================== --- head/sys/arm/at91/std.tsc4370 Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/at91/std.tsc4370 Tue Dec 22 09:08:21 2015 (r292591) @@ -3,7 +3,6 @@ include "../at91/std.at91" makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 -options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 device at91_board_tsc4370 Modified: head/sys/arm/cavium/cns11xx/std.econa ============================================================================== --- head/sys/arm/cavium/cns11xx/std.econa Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/cavium/cns11xx/std.econa Tue Dec 22 09:08:21 2015 (r292591) @@ -8,7 +8,6 @@ options PHYSADDR=0x00000000 makeoptions KERNPHYSADDR=0x01000000 makeoptions KERNVIRTADDR=0xc1000000 -options KERNPHYSADDR=0x01000000 options KERNVIRTADDR=0xc1000000 # Used in ldscript.arm options FLASHADDR=0xD0000000 options LOADERRAMADDR=0x00000000 Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/conf/ATMEL Tue Dec 22 09:08:21 2015 (r292591) @@ -13,7 +13,6 @@ include "../at91/std.atmel" # at91sam9g45 or on some boards with non u-boot boot loaders. makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 -options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 makeoptions MODULES_OVERRIDE="dtb/atmel" Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/conf/CNS11XXNAS Tue Dec 22 09:08:21 2015 (r292591) @@ -22,7 +22,6 @@ ident CNS11XXNAS include "std.arm" #options PHYSADDR=0x10000000 -#options KERNPHYSADDR=0x10200000 #options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm #options FLASHADDR=0x50000000 #options LOADERRAMADDR=0x00000000 Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/conf/CRB Tue Dec 22 09:08:21 2015 (r292591) @@ -21,7 +21,6 @@ ident CRB include "std.arm" options PHYSADDR=0x00000000 -options KERNPHYSADDR=0x00200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm options COUNTS_PER_SEC=400000000 Modified: head/sys/arm/conf/GUMSTIX ============================================================================== --- head/sys/arm/conf/GUMSTIX Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/conf/GUMSTIX Tue Dec 22 09:08:21 2015 (r292591) @@ -28,7 +28,6 @@ cpu CPU_XSCALE_PXA2X0 hints "GUMSTIX.hints" options PHYSADDR=0xa0000000 -options KERNPHYSADDR=0xa0200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm include "../xscale/pxa/std.pxa" Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/conf/NOTES Tue Dec 22 09:08:21 2015 (r292591) @@ -26,7 +26,6 @@ files "../xscale/ixp425/files.ixp425" files "../xscale/pxa/files.pxa" options PHYSADDR=0x00000000 -options KERNPHYSADDR=0x00000000 options KERNVIRTADDR=0xc0000000 makeoptions LDFLAGS="-zmuldefs" Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/conf/NSLU Tue Dec 22 09:08:21 2015 (r292591) @@ -24,7 +24,6 @@ ident NSLU include "std.arm" # XXX What is defined in std.avila does not exactly match the following: #options PHYSADDR=0x10000000 -#options KERNPHYSADDR=0x10200000 #options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm #options FLASHADDR=0x50000000 #options LOADERRAMADDR=0x00000000 Modified: head/sys/arm/lpc/std.lpc ============================================================================== --- head/sys/arm/lpc/std.lpc Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/lpc/std.lpc Tue Dec 22 09:08:21 2015 (r292591) @@ -9,6 +9,5 @@ machine arm makeoptions CONF_CFLAGS="-march=armv5te" options PHYSADDR=0x80000000 makeoptions KERNPHYSADDR=0x80100000 -options KERNPHYSADDR=0x80100000 makeoptions KERNVIRTADDR=0xc0100000 options KERNVIRTADDR=0xc0100000 Modified: head/sys/arm/mv/discovery/std.db78xxx ============================================================================== --- head/sys/arm/mv/discovery/std.db78xxx Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/mv/discovery/std.db78xxx Tue Dec 22 09:08:21 2015 (r292591) @@ -5,7 +5,5 @@ files "../mv/discovery/files.db78xxx" makeoptions KERNPHYSADDR=0x00900000 makeoptions KERNVIRTADDR=0xc0900000 - -options KERNPHYSADDR=0x00900000 options KERNVIRTADDR=0xc0900000 options PHYSADDR=0x00000000 Modified: head/sys/arm/mv/orion/std.db88f5xxx ============================================================================== --- head/sys/arm/mv/orion/std.db88f5xxx Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/mv/orion/std.db88f5xxx Tue Dec 22 09:08:21 2015 (r292591) @@ -5,7 +5,5 @@ files "../mv/orion/files.db88f5xxx" makeoptions KERNPHYSADDR=0x00900000 makeoptions KERNVIRTADDR=0xc0900000 - -options KERNPHYSADDR=0x00900000 options KERNVIRTADDR=0xc0900000 options PHYSADDR=0x00000000 Modified: head/sys/arm/mv/orion/std.ts7800 ============================================================================== --- head/sys/arm/mv/orion/std.ts7800 Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/mv/orion/std.ts7800 Tue Dec 22 09:08:21 2015 (r292591) @@ -5,8 +5,6 @@ files "../mv/orion/files.ts7800" makeoptions KERNPHYSADDR=0x00900000 makeoptions KERNVIRTADDR=0xc0900000 - -options KERNPHYSADDR=0x00900000 options KERNVIRTADDR=0xc0900000 options PHYSADDR=0x00000000 options LOADERRAMADDR=0x00000000 Modified: head/sys/arm/xscale/ixp425/std.avila ============================================================================== --- head/sys/arm/xscale/ixp425/std.avila Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/arm/xscale/ixp425/std.avila Tue Dec 22 09:08:21 2015 (r292591) @@ -13,7 +13,6 @@ files "../xscale/ixp425/files.avila" # be remapped away from 0. # options PHYSADDR=0x00000000 -options KERNPHYSADDR=0x00200000 makeoptions KERNPHYSADDR=0x00200000 options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm makeoptions KERNVIRTADDR=0xc0200000 Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Tue Dec 22 09:02:51 2015 (r292590) +++ head/sys/conf/options.arm Tue Dec 22 09:08:21 2015 (r292591) @@ -32,7 +32,6 @@ IPI_IRQ_END opt_smp.h FREEBSD_BOOT_LOADER opt_global.h IXP4XX_FLASH_SIZE opt_global.h KERNBASE opt_global.h -KERNPHYSADDR opt_global.h KERNVIRTADDR opt_global.h LINUX_BOOT_ABI opt_global.h LOADERRAMADDR opt_global.h From owner-svn-src-all@freebsd.org Tue Dec 22 09:26:25 2015 Return-Path: Delivered-To: svn-src-all@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 EF15DA4F9C6; Tue, 22 Dec 2015 09:26:25 +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 BA6F31310; Tue, 22 Dec 2015 09:26:25 +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 tBM9QOEN044470; Tue, 22 Dec 2015 09:26:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM9QOq3044469; Tue, 22 Dec 2015 09:26:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512220926.tBM9QOq3044469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 22 Dec 2015 09:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292592 - head/sys/fs/cuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 09:26:26 -0000 Author: hselasky Date: Tue Dec 22 09:26:24 2015 New Revision: 292592 URL: https://svnweb.freebsd.org/changeset/base/292592 Log: Guard against the same process being both CUSE server and client at the same time. This can easily lead to a deadlock when destroying the character devices nodes. Modified: head/sys/fs/cuse/cuse.c Modified: head/sys/fs/cuse/cuse.c ============================================================================== --- head/sys/fs/cuse/cuse.c Tue Dec 22 09:08:21 2015 (r292591) +++ head/sys/fs/cuse/cuse.c Tue Dec 22 09:26:24 2015 (r292592) @@ -108,6 +108,7 @@ struct cuse_server { TAILQ_HEAD(, cuse_client) hcli; struct cv cv; struct selinfo selinfo; + pid_t pid; int is_closing; int refs; }; @@ -691,6 +692,10 @@ cuse_server_open(struct cdev *dev, int f free(pcs, M_CUSE); return (ENOMEM); } + + /* store current process ID */ + pcs->pid = curproc->p_pid; + TAILQ_INIT(&pcs->head); TAILQ_INIT(&pcs->hdev); TAILQ_INIT(&pcs->hcli); @@ -1357,9 +1362,15 @@ cuse_client_open(struct cdev *dev, int f if (pcsd != NULL) { pcs = pcsd->server; pcd = pcsd->user_dev; + /* + * Check that the refcount didn't wrap and that the + * same process is not both client and server. This + * can easily lead to deadlocks when destroying the + * CUSE character device nodes: + */ pcs->refs++; - if (pcs->refs < 0) { - /* overflow */ + if (pcs->refs < 0 || pcs->pid == curproc->p_pid) { + /* overflow or wrong PID */ pcs->refs--; pcsd = NULL; } From owner-svn-src-all@freebsd.org Tue Dec 22 09:41:35 2015 Return-Path: Delivered-To: svn-src-all@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 274F8A4FE08; Tue, 22 Dec 2015 09:41:35 +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 CF58B1DB0; Tue, 22 Dec 2015 09:41:34 +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 tBM9fXAM048065; Tue, 22 Dec 2015 09:41:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM9fXeT048063; Tue, 22 Dec 2015 09:41:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512220941.tBM9fXeT048063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 22 Dec 2015 09:41:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292593 - head/sys/fs/cuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 09:41:35 -0000 Author: hselasky Date: Tue Dec 22 09:41:33 2015 New Revision: 292593 URL: https://svnweb.freebsd.org/changeset/base/292593 Log: Make CUSE usable with platforms where the size of "unsigned long" is different from the size of a pointer. Modified: head/sys/fs/cuse/cuse.c head/sys/fs/cuse/cuse_ioctl.h Modified: head/sys/fs/cuse/cuse.c ============================================================================== --- head/sys/fs/cuse/cuse.c Tue Dec 22 09:26:24 2015 (r292592) +++ head/sys/fs/cuse/cuse.c Tue Dec 22 09:41:33 2015 (r292593) @@ -1137,7 +1137,7 @@ cuse_server_ioctl(struct cdev *dev, unsi if (pccmd != NULL) { pcc = pccmd->client; for (n = 0; n != CUSE_CMD_MAX; n++) { - pcc->cmds[n].sub.per_file_handle = *(unsigned long *)data; + pcc->cmds[n].sub.per_file_handle = *(uintptr_t *)data; } } else { error = ENXIO; Modified: head/sys/fs/cuse/cuse_ioctl.h ============================================================================== --- head/sys/fs/cuse/cuse_ioctl.h Tue Dec 22 09:26:24 2015 (r292592) +++ head/sys/fs/cuse/cuse_ioctl.h Tue Dec 22 09:41:33 2015 (r292593) @@ -53,7 +53,7 @@ struct cuse_alloc_info { struct cuse_command { struct cuse_dev *dev; unsigned long fflags; - unsigned long per_file_handle; + uintptr_t per_file_handle; unsigned long data_pointer; unsigned long argument; unsigned long command; /* see CUSE_CMD_XXX */ @@ -76,7 +76,7 @@ struct cuse_create_dev { #define CUSE_IOCTL_GET_SIG _IOR('C', 4, int) #define CUSE_IOCTL_ALLOC_MEMORY _IOW('C', 5, struct cuse_alloc_info) #define CUSE_IOCTL_FREE_MEMORY _IOW('C', 6, struct cuse_alloc_info) -#define CUSE_IOCTL_SET_PFH _IOW('C', 7, unsigned long) +#define CUSE_IOCTL_SET_PFH _IOW('C', 7, uintptr_t) #define CUSE_IOCTL_CREATE_DEV _IOW('C', 8, struct cuse_create_dev) #define CUSE_IOCTL_DESTROY_DEV _IOW('C', 9, struct cuse_dev *) #define CUSE_IOCTL_ALLOC_UNIT _IOR('C',10, int) From owner-svn-src-all@freebsd.org Tue Dec 22 09:55:45 2015 Return-Path: Delivered-To: svn-src-all@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 760B1A4E2EC; Tue, 22 Dec 2015 09:55:45 +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 5169E136B; Tue, 22 Dec 2015 09:55:45 +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 tBM9tifr053079; Tue, 22 Dec 2015 09:55:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBM9ti5P053076; Tue, 22 Dec 2015 09:55:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512220955.tBM9ti5P053076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 22 Dec 2015 09:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292594 - in head: lib/libcuse sys/fs/cuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 09:55:45 -0000 Author: hselasky Date: Tue Dec 22 09:55:44 2015 New Revision: 292594 URL: https://svnweb.freebsd.org/changeset/base/292594 Log: Make CUSE usable with platforms where the size of "unsigned long" is different from the size of a pointer. Modified: head/lib/libcuse/cuse_lib.c head/sys/fs/cuse/cuse.c head/sys/fs/cuse/cuse_ioctl.h Modified: head/lib/libcuse/cuse_lib.c ============================================================================== --- head/lib/libcuse/cuse_lib.c Tue Dec 22 09:41:33 2015 (r292593) +++ head/lib/libcuse/cuse_lib.c Tue Dec 22 09:55:44 2015 (r292594) @@ -711,8 +711,8 @@ cuse_copy_out(const void *src, void *use if (pe->is_local) { memcpy(user_dst, src, len); } else { - info.local_ptr = (unsigned long)src; - info.peer_ptr = (unsigned long)user_dst; + info.local_ptr = (uintptr_t)src; + info.peer_ptr = (uintptr_t)user_dst; info.length = len; error = ioctl(f_cuse, CUSE_IOCTL_WRITE_DATA, &info); @@ -744,8 +744,8 @@ cuse_copy_in(const void *user_src, void if (pe->is_local) { memcpy(dst, user_src, len); } else { - info.local_ptr = (unsigned long)dst; - info.peer_ptr = (unsigned long)user_src; + info.local_ptr = (uintptr_t)dst; + info.peer_ptr = (uintptr_t)user_src; info.length = len; error = ioctl(f_cuse, CUSE_IOCTL_READ_DATA, &info); Modified: head/sys/fs/cuse/cuse.c ============================================================================== --- head/sys/fs/cuse/cuse.c Tue Dec 22 09:41:33 2015 (r292593) +++ head/sys/fs/cuse/cuse.c Tue Dec 22 09:55:44 2015 (r292594) @@ -511,7 +511,7 @@ cuse_client_is_closing(struct cuse_clien static void cuse_client_send_command_locked(struct cuse_client_command *pccmd, - unsigned long data_ptr, unsigned long arg, int fflags, int ioflag) + uintptr_t data_ptr, unsigned long arg, int fflags, int ioflag) { unsigned long cuse_fflags = 0; struct cuse_server *pcs; @@ -1547,7 +1547,7 @@ cuse_client_read(struct cdev *dev, struc cuse_lock(); cuse_client_send_command_locked(pccmd, - (unsigned long)uio->uio_iov->iov_base, + (uintptr_t)uio->uio_iov->iov_base, (unsigned long)(unsigned int)len, pcc->fflags, ioflag); error = cuse_client_receive_command_locked(pccmd, 0, 0); @@ -1607,7 +1607,7 @@ cuse_client_write(struct cdev *dev, stru cuse_lock(); cuse_client_send_command_locked(pccmd, - (unsigned long)uio->uio_iov->iov_base, + (uintptr_t)uio->uio_iov->iov_base, (unsigned long)(unsigned int)len, pcc->fflags, ioflag); error = cuse_client_receive_command_locked(pccmd, 0, 0); Modified: head/sys/fs/cuse/cuse_ioctl.h ============================================================================== --- head/sys/fs/cuse/cuse_ioctl.h Tue Dec 22 09:41:33 2015 (r292593) +++ head/sys/fs/cuse/cuse_ioctl.h Tue Dec 22 09:55:44 2015 (r292594) @@ -40,8 +40,8 @@ struct cuse_dev; struct cuse_data_chunk { - unsigned long local_ptr; - unsigned long peer_ptr; + uintptr_t local_ptr; + uintptr_t peer_ptr; unsigned long length; }; @@ -54,7 +54,7 @@ struct cuse_command { struct cuse_dev *dev; unsigned long fflags; uintptr_t per_file_handle; - unsigned long data_pointer; + uintptr_t data_pointer; unsigned long argument; unsigned long command; /* see CUSE_CMD_XXX */ }; From owner-svn-src-all@freebsd.org Tue Dec 22 12:01:08 2015 Return-Path: Delivered-To: svn-src-all@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 4D1E6A4EED8; Tue, 22 Dec 2015 12:01:08 +0000 (UTC) (envelope-from ume@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 1C80015B7; Tue, 22 Dec 2015 12:01:08 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMC17qg088448; Tue, 22 Dec 2015 12:01:07 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMC174P088447; Tue, 22 Dec 2015 12:01:07 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512221201.tBMC174P088447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Tue, 22 Dec 2015 12:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292595 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 12:01:08 -0000 Author: ume Date: Tue Dec 22 12:01:06 2015 New Revision: 292595 URL: https://svnweb.freebsd.org/changeset/base/292595 Log: We don't need to use a temporary buffer, here. MFC after: 1 week Modified: head/lib/libc/net/map_v4v6.c Modified: head/lib/libc/net/map_v4v6.c ============================================================================== --- head/lib/libc/net/map_v4v6.c Tue Dec 22 09:55:44 2015 (r292594) +++ head/lib/libc/net/map_v4v6.c Tue Dec 22 12:01:06 2015 (r292595) @@ -78,15 +78,11 @@ typedef union { void _map_v4v6_address(const char *src, char *dst) { - char tmp[NS_INADDRSZ]; - - /* Stash a temporary copy so our caller can update in place. */ - memcpy(tmp, src, NS_INADDRSZ); + /* Our caller may update in place. */ + memmove(&dst[12], src, NS_INADDRSZ); /* Mark this ipv6 addr as a mapped ipv4. */ - memset(&dst[0], 0, 10); memset(&dst[10], 0xff, 2); - /* Retrieve the saved copy and we're done. */ - memcpy(&dst[12], tmp, NS_INADDRSZ); + memset(&dst[0], 0, 10); } void From owner-svn-src-all@freebsd.org Tue Dec 22 12:53:02 2015 Return-Path: Delivered-To: svn-src-all@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 C4F43A4C093; Tue, 22 Dec 2015 12:53: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 97B851D8C; Tue, 22 Dec 2015 12:53:02 +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 tBMCr1vo006628; Tue, 22 Dec 2015 12:53:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMCr1t4006627; Tue, 22 Dec 2015 12:53:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512221253.tBMCr1t4006627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 22 Dec 2015 12:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292596 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 12:53:02 -0000 Author: mav Date: Tue Dec 22 12:53:01 2015 New Revision: 292596 URL: https://svnweb.freebsd.org/changeset/base/292596 Log: MFC r291730: Update isp_put_icb_2400() for new structure fields. Modified: stable/10/sys/dev/isp/isp_library.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Tue Dec 22 12:01:06 2015 (r292595) +++ stable/10/sys/dev/isp/isp_library.c Tue Dec 22 12:53:01 2015 (r292596) @@ -1402,7 +1402,9 @@ isp_put_icb_2400(ispsoftc_t *isp, isp_ic for (i = 0; i < 4; i++) { ISP_IOXPUT_16(isp, src->icb_priaddr[i], &dst->icb_priaddr[i]); } - for (i = 0; i < 4; i++) { + ISP_IOXPUT_16(isp, src->icb_msixresp, &dst->icb_msixresp); + ISP_IOXPUT_16(isp, src->icb_msixatio, &dst->icb_msixatio); + for (i = 0; i < 2; i++) { ISP_IOXPUT_16(isp, src->icb_reserved1[i], &dst->icb_reserved1[i]); } ISP_IOXPUT_16(isp, src->icb_atio_in, &dst->icb_atio_in); @@ -1415,9 +1417,14 @@ isp_put_icb_2400(ispsoftc_t *isp, isp_ic ISP_IOXPUT_32(isp, src->icb_fwoptions1, &dst->icb_fwoptions1); ISP_IOXPUT_32(isp, src->icb_fwoptions2, &dst->icb_fwoptions2); ISP_IOXPUT_32(isp, src->icb_fwoptions3, &dst->icb_fwoptions3); - for (i = 0; i < 12; i++) { + ISP_IOXPUT_16(isp, src->icb_qos, &dst->icb_qos); + for (i = 0; i < 3; i++) ISP_IOXPUT_16(isp, src->icb_reserved2[i], &dst->icb_reserved2[i]); - } + for (i = 0; i < 3; i++) + ISP_IOXPUT_16(isp, src->icb_enodemac[i], &dst->icb_enodemac[i]); + ISP_IOXPUT_16(isp, src->icb_disctime, &dst->icb_disctime); + for (i = 0; i < 4; i++) + ISP_IOXPUT_16(isp, src->icb_reserved3[i], &dst->icb_reserved3[i]); } void From owner-svn-src-all@freebsd.org Tue Dec 22 12:54:14 2015 Return-Path: Delivered-To: svn-src-all@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 D8349A4C137; Tue, 22 Dec 2015 12:54:14 +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 AF52A1F04; Tue, 22 Dec 2015 12:54:14 +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 tBMCsDR5006725; Tue, 22 Dec 2015 12:54:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMCsDAN006724; Tue, 22 Dec 2015 12:54:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512221254.tBMCsDAN006724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 22 Dec 2015 12:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292597 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 12:54:14 -0000 Author: mav Date: Tue Dec 22 12:54:13 2015 New Revision: 292597 URL: https://svnweb.freebsd.org/changeset/base/292597 Log: MFC r291868: Rework WWNs generation to make cards without NVRAM more useful. Modified: stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Tue Dec 22 12:53:01 2015 (r292596) +++ stable/10/sys/dev/isp/isp_freebsd.c Tue Dec 22 12:54:13 2015 (r292597) @@ -4550,91 +4550,52 @@ isp_uninit(ispsoftc_t *isp) ISP_DISABLE_INTS(isp); } -/* - * When we want to get the 'default' WWNs (when lacking NVRAM), we pick them - * up from our platform default (defww{p|n}n) and morph them based upon - * channel. - * - * When we want to get the 'active' WWNs, we get NVRAM WWNs and then morph them - * based upon channel. - */ - uint64_t isp_default_wwn(ispsoftc_t * isp, int chan, int isactive, int iswwnn) { uint64_t seed; struct isp_fc *fc = ISP_FC_PC(isp, chan); - /* - * If we're asking for a active WWN, the default overrides get - * returned, otherwise the NVRAM value is picked. - * - * If we're asking for a default WWN, we just pick the default override. - */ + /* First try to use explicitly configured WWNs. */ + seed = iswwnn ? fc->def_wwnn : fc->def_wwpn; + if (seed) + return (seed); + + /* Otherwise try to use WWNs from NVRAM. */ if (isactive) { - seed = iswwnn ? fc->def_wwnn : fc->def_wwpn; - if (seed) { - return (seed); - } - seed = iswwnn ? FCPARAM(isp, chan)->isp_wwnn_nvram : FCPARAM(isp, chan)->isp_wwpn_nvram; - if (seed) { + seed = iswwnn ? FCPARAM(isp, chan)->isp_wwnn_nvram : + FCPARAM(isp, chan)->isp_wwpn_nvram; + if (seed) return (seed); - } - return (0x400000007F000009ull); } - seed = iswwnn ? fc->def_wwnn : fc->def_wwpn; - - /* - * For channel zero just return what we have. For either ACTIVE or - * DEFAULT cases, we depend on default override of NVRAM values for - * channel zero. - */ - if (chan == 0) { - return (seed); + /* If still no WWNs, try to steal them from the first channel. */ + if (chan > 0) { + seed = iswwnn ? ISP_FC_PC(isp, 0)->def_wwnn : + ISP_FC_PC(isp, 0)->def_wwpn; + if (seed == 0) { + seed = iswwnn ? FCPARAM(isp, 0)->isp_wwnn_nvram : + FCPARAM(isp, 0)->isp_wwpn_nvram; + } } - /* - * For other channels, we are doing one of three things: - * - * 1. If what we have now is non-zero, return it. Otherwise we morph - * values from channel 0. 2. If we're here for a WWPN we synthesize - * it if Channel 0's wwpn has a type 2 NAA. 3. If we're here for a - * WWNN we synthesize it if Channel 0's wwnn has a type 2 NAA. - */ - - if (seed) { - return (seed); + /* If still nothing -- improvise. */ + if (seed == 0) { + seed = 0x400000007F000000ull + device_get_unit(isp->isp_dev); + if (!iswwnn) + seed ^= 0x0100000000000000ULL; } - seed = iswwnn ? ISP_FC_PC(isp, 0)->def_wwnn : ISP_FC_PC(isp, 0)->def_wwpn; - if (seed == 0) - seed = iswwnn ? FCPARAM(isp, 0)->isp_wwnn_nvram : FCPARAM(isp, 0)->isp_wwpn_nvram; - if (((seed >> 60) & 0xf) == 2) { + /* For additional channels we have to improvise even more. */ + if (!iswwnn && chan > 0) { /* - * The type 2 NAA fields for QLogic cards appear be laid out - * thusly: - * - * bits 63..60 NAA == 2 bits 59..57 unused/zero bit 56 - * port (1) or node (0) WWN distinguishor bit 48 - * physical port on dual-port chips (23XX/24XX) - * - * This is somewhat nutty, particularly since bit 48 is - * irrelevant as they assign separate serial numbers to - * different physical ports anyway. - * * We'll stick our channel number plus one first into bits * 57..59 and thence into bits 52..55 which allows for 8 bits - * of channel which is comfortably more than our maximum - * (126) now. + * of channel which is enough for our maximum of 255 channels. */ - seed &= ~0x0FF0000000000000ULL; - if (iswwnn == 0) { - seed |= ((uint64_t) (chan + 1) & 0xf) << 56; - seed |= ((uint64_t) ((chan + 1) >> 4) & 0xf) << 52; - } - } else { - seed = 0; + seed ^= 0x0100000000000000ULL; + seed ^= ((uint64_t) (chan + 1) & 0xf) << 56; + seed ^= ((uint64_t) ((chan + 1) >> 4) & 0xf) << 52; } return (seed); } From owner-svn-src-all@freebsd.org Tue Dec 22 13:19:31 2015 Return-Path: Delivered-To: svn-src-all@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 A9FAAA4C8A2; Tue, 22 Dec 2015 13:19:31 +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 6CC651935; Tue, 22 Dec 2015 13:19:31 +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 tBMDJUIk012845; Tue, 22 Dec 2015 13:19:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMDJUCc012838; Tue, 22 Dec 2015 13:19:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512221319.tBMDJUCc012838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 22 Dec 2015 13:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292598 - in stable/10: share/man/man4 sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 13:19:31 -0000 Author: mav Date: Tue Dec 22 13:19:29 2015 New Revision: 292598 URL: https://svnweb.freebsd.org/changeset/base/292598 Log: MFC r291654, r291727, r291821, r291872, r292034, r292041, r292249, r292042: Add initial support for 16Gbps FC QLogic chips. Modified: stable/10/share/man/man4/isp.4 stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.h stable/10/sys/dev/isp/isp_pci.c stable/10/sys/dev/isp/isp_sbus.c stable/10/sys/dev/isp/ispmbox.h stable/10/sys/dev/isp/ispvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/isp.4 ============================================================================== --- stable/10/share/man/man4/isp.4 Tue Dec 22 12:54:13 2015 (r292597) +++ stable/10/share/man/man4/isp.4 Tue Dec 22 13:19:29 2015 (r292598) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2015 +.Dd December 9, 2015 .Dt ISP 4 .Os .Sh NAME @@ -107,10 +107,12 @@ Optical 2Gb Fibre Channel PCIe cards. Dell branded version of the QLogic 2312. .It Qlogic 2422 Optical 4Gb Fibre Channel PCI cards. -.It Qlogic 2432 +.It Qlogic 246x (aka 2432) Optical 4Gb Fibre Channel PCIe cards. -.It Qlogic 2532 +.It Qlogic 256x (aka 2532) Optical 8Gb Fibre Channel PCIe cards. +.It Qlogic 267x/836x (aka 2031/8031) +Optical 16Gb FC/FCoE PCIe cards. .El .Sh CONFIGURATION OPTIONS Target mode support for Fibre Channel adapters may be enabled with the @@ -127,12 +129,6 @@ They are: .It Va hint.isp.0.fwload_disable A hint value to disable loading of firmware .Xr ispfw 4 . -.It Va hint.isp.0.prefer_memmap -A hint value to use PCI memory space instead of I/O space -access for. -.It Va hint.isp.0.prefer_iomap -A hint value to use PCI I/O space instead of Memory space -access for. .It Va hint.isp.0.ignore_nvram A hint value to ignore board NVRAM settings for. Otherwise use NVRAM settings. Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Tue Dec 22 12:54:13 2015 (r292597) +++ stable/10/sys/dev/isp/isp.c Tue Dec 22 13:19:29 2015 (r292598) @@ -277,6 +277,9 @@ isp_reset(ispsoftc_t *isp, int do_load_d case ISP_HA_FC_2500: btype = "2532"; break; + case ISP_HA_FC_2600: + btype = "2031"; + break; default: break; } @@ -655,8 +658,10 @@ isp_reset(ispsoftc_t *isp, int do_load_d ISP_WRITE(isp, isp->isp_respinrp, 0); ISP_WRITE(isp, isp->isp_respoutrp, 0); if (IS_24XX(isp)) { - ISP_WRITE(isp, BIU2400_PRI_REQINP, 0); - ISP_WRITE(isp, BIU2400_PRI_REQOUTP, 0); + if (!IS_26XX(isp)) { + ISP_WRITE(isp, BIU2400_PRI_REQINP, 0); + ISP_WRITE(isp, BIU2400_PRI_REQOUTP, 0); + } ISP_WRITE(isp, BIU2400_ATIO_RSPINP, 0); ISP_WRITE(isp, BIU2400_ATIO_RSPOUTP, 0); } @@ -761,6 +766,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d code_org = ISP_CODE_ORG; } + isp->isp_loaded_fw = 0; if (dodnld && IS_24XX(isp)) { const uint32_t *ptr = isp->isp_mdvec->dv_ispfw; int wordload; @@ -956,8 +962,17 @@ isp_reset(ispsoftc_t *isp, int do_load_d ISP_RESET0(isp); return; } + } else if (IS_26XX(isp)) { + MBSINIT(&mbs, MBOX_LOAD_FLASH_FIRMWARE, MBLOGALL, 5000000); + mbs.ibitm = 0x01; + mbs.obitm = 0x07; + isp_mboxcmd(isp, &mbs); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + isp_prt(isp, ISP_LOGERR, "Flash F/W load failed"); + ISP_RESET0(isp); + return; + } } else { - isp->isp_loaded_fw = 0; isp_prt(isp, ISP_LOGDEBUG2, "skipping f/w download"); } @@ -966,7 +981,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d */ if (isp->isp_loaded_fw) { MBSINIT(&mbs, MBOX_VERIFY_CHECKSUM, MBLOGNONE, 0); - mbs.param[0] = MBOX_VERIFY_CHECKSUM; if (IS_24XX(isp)) { mbs.param[1] = code_org >> 16; mbs.param[2] = code_org; @@ -998,9 +1012,6 @@ isp_reset(ispsoftc_t *isp, int do_load_d } else { mbs.param[3] = 1; } - if (IS_25XX(isp)) { - mbs.ibits |= 0x10; - } } else if (IS_2322(isp)) { mbs.param[1] = code_org; if (isp->isp_loaded_fw) { @@ -1861,16 +1872,16 @@ isp_fibre_init(ispsoftc_t *isp) icbp->icb_idelaytimer = 10; } icbp->icb_zfwoptions = fcp->isp_zfwoptions; - if (isp->isp_confopts & ISP_CFG_ONEGB) { + if (isp->isp_confopts & ISP_CFG_1GB) { icbp->icb_zfwoptions &= ~ICBZOPT_RATE_MASK; - icbp->icb_zfwoptions |= ICBZOPT_RATE_ONEGB; - } else if (isp->isp_confopts & ISP_CFG_TWOGB) { + icbp->icb_zfwoptions |= ICBZOPT_RATE_1GB; + } else if (isp->isp_confopts & ISP_CFG_2GB) { icbp->icb_zfwoptions &= ~ICBZOPT_RATE_MASK; - icbp->icb_zfwoptions |= ICBZOPT_RATE_TWOGB; + icbp->icb_zfwoptions |= ICBZOPT_RATE_2GB; } else { switch (icbp->icb_zfwoptions & ICBZOPT_RATE_MASK) { - case ICBZOPT_RATE_ONEGB: - case ICBZOPT_RATE_TWOGB: + case ICBZOPT_RATE_1GB: + case ICBZOPT_RATE_2GB: case ICBZOPT_RATE_AUTO: break; default: @@ -2122,18 +2133,26 @@ isp_fibre_init_2400(ispsoftc_t *isp) break; } + if (IS_26XX(isp)) { + /* We don't support MSI-X yet, so set this unconditionally. */ + icbp->icb_fwoptions2 |= ICB2400_OPT2_ENA_IHR; + icbp->icb_fwoptions2 |= ICB2400_OPT2_ENA_IHA; + } + if ((icbp->icb_fwoptions3 & ICB2400_OPT3_RSPSZ_MASK) == 0) { icbp->icb_fwoptions3 |= ICB2400_OPT3_RSPSZ_24; } icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_AUTO; - if (isp->isp_confopts & ISP_CFG_ONEGB) { - icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_ONEGB; - } else if (isp->isp_confopts & ISP_CFG_TWOGB) { - icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_TWOGB; - } else if (isp->isp_confopts & ISP_CFG_FOURGB) { - icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_FOURGB; - } else if (IS_25XX(isp) && (isp->isp_confopts & ISP_CFG_EIGHTGB)) { - icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_EIGHTGB; + if (isp->isp_confopts & ISP_CFG_1GB) { + icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_1GB; + } else if (isp->isp_confopts & ISP_CFG_2GB) { + icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_2GB; + } else if (isp->isp_confopts & ISP_CFG_4GB) { + icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_4GB; + } else if (isp->isp_confopts & ISP_CFG_8GB) { + icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_8GB; + } else if (isp->isp_confopts & ISP_CFG_16GB) { + icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_16GB; } else { icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_AUTO; } @@ -6828,7 +6847,7 @@ static const char *scsi_mbcmd_names[] = static const uint32_t mbpfc[] = { ISP_FC_OPMAP(0x01, 0x01), /* 0x00: MBOX_NO_OP */ ISP_FC_OPMAP(0x1f, 0x01), /* 0x01: MBOX_LOAD_RAM */ - ISP_FC_OPMAP(0x0f, 0x01), /* 0x02: MBOX_EXEC_FIRMWARE */ + ISP_FC_OPMAP_HALF(0x07, 0xff, 0x00, 0x03), /* 0x02: MBOX_EXEC_FIRMWARE */ ISP_FC_OPMAP(0xdf, 0x01), /* 0x03: MBOX_DUMP_RAM */ ISP_FC_OPMAP(0x07, 0x07), /* 0x04: MBOX_WRITE_RAM_WORD */ ISP_FC_OPMAP(0x03, 0x07), /* 0x05: MBOX_READ_RAM_WORD */ @@ -7602,6 +7621,8 @@ isp_setdfltfcparm(ispsoftc_t *isp, int c fcp->isp_wwnn_nvram = DEFAULT_NODEWWN(isp, chan); fcp->isp_wwpn_nvram = DEFAULT_PORTWWN(isp, chan); fcp->isp_fwoptions = 0; + fcp->isp_xfwoptions = 0; + fcp->isp_zfwoptions = 0; fcp->isp_lasthdl = NIL_HANDLE; if (IS_24XX(isp)) { @@ -7899,7 +7920,9 @@ isp_rd_2400_nvram(ispsoftc_t *isp, uint3 uint32_t base = 0x7ffe0000; uint32_t tmp = 0; - if (IS_25XX(isp)) { + if (IS_26XX(isp)) { + base = 0x7fe7c000; /* XXX: Observation, may be wrong. */ + } else if (IS_25XX(isp)) { base = 0x7ff00000 | 0x48000; } ISP_WRITE(isp, BIU2400_FLASH_ADDR, base | addr); Modified: stable/10/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.h Tue Dec 22 12:54:13 2015 (r292597) +++ stable/10/sys/dev/isp/isp_freebsd.h Tue Dec 22 13:19:29 2015 (r292598) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -286,9 +287,9 @@ struct isposinfo { /* * DMA related sdtuff */ - bus_space_tag_t bus_tag; + struct resource * regs; + struct resource * regs2; bus_dma_tag_t dmat; - bus_space_handle_t bus_handle; bus_dma_tag_t cdmat; bus_dmamap_t cdmap; @@ -361,8 +362,8 @@ struct isposinfo { #define FCP_NEXT_CRN isp_fcp_next_crn #define isp_lock isp_osinfo.lock -#define isp_bus_tag isp_osinfo.bus_tag -#define isp_bus_handle isp_osinfo.bus_handle +#define isp_regs isp_osinfo.regs +#define isp_regs2 isp_osinfo.regs2 /* * Locking macros... @@ -430,8 +431,7 @@ case SYNC_RESULT: \ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); \ break; \ case SYNC_REG: \ - bus_space_barrier(isp->isp_osinfo.bus_tag, \ - isp->isp_osinfo.bus_handle, offset, size, \ + bus_barrier(isp->isp_osinfo.regs, offset, size, \ BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ break; \ default: \ @@ -463,8 +463,7 @@ case SYNC_RESULT: \ isp->isp_osinfo.cdmap, BUS_DMASYNC_POSTWRITE); \ break; \ case SYNC_REG: \ - bus_space_barrier(isp->isp_osinfo.bus_tag, \ - isp->isp_osinfo.bus_handle, offset, size, \ + bus_barrier(isp->isp_osinfo.regs, offset, size, \ BUS_SPACE_BARRIER_WRITE); \ break; \ default: \ Modified: stable/10/sys/dev/isp/isp_pci.c ============================================================================== --- stable/10/sys/dev/isp/isp_pci.c Tue Dec 22 12:54:13 2015 (r292597) +++ stable/10/sys/dev/isp/isp_pci.c Tue Dec 22 13:19:29 2015 (r292598) @@ -59,6 +59,8 @@ static uint32_t isp_pci_rd_reg_1080(isps static void isp_pci_wr_reg_1080(ispsoftc_t *, int, uint32_t); static uint32_t isp_pci_rd_reg_2400(ispsoftc_t *, int); static void isp_pci_wr_reg_2400(ispsoftc_t *, int, uint32_t); +static uint32_t isp_pci_rd_reg_2600(ispsoftc_t *, int); +static void isp_pci_wr_reg_2600(ispsoftc_t *, int, uint32_t); static int isp_pci_rd_isr(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); static int isp_pci_rd_isr_2300(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); static int isp_pci_rd_isr_2400(ispsoftc_t *, uint16_t *, uint16_t *, uint16_t *); @@ -172,6 +174,18 @@ static struct ispmdvec mdvec_2500 = { NULL }; +static struct ispmdvec mdvec_2600 = { + isp_pci_rd_isr_2400, + isp_pci_rd_reg_2600, + isp_pci_wr_reg_2600, + isp_pci_mbxdma, + isp_pci_dmasetup, + isp_common_dmateardown, + isp_pci_reset0, + isp_pci_reset1, + NULL +}; + #ifndef PCIM_CMD_INVEN #define PCIM_CMD_INVEN 0x10 #endif @@ -276,6 +290,14 @@ static struct ispmdvec mdvec_2500 = { #define PCI_PRODUCT_QLOGIC_ISP5432 0x5432 #endif +#ifndef PCI_PRODUCT_QLOGIC_ISP2031 +#define PCI_PRODUCT_QLOGIC_ISP2031 0x2031 +#endif + +#ifndef PCI_PRODUCT_QLOGIC_ISP8031 +#define PCI_PRODUCT_QLOGIC_ISP8031 0x8031 +#endif + #define PCI_QLOGIC_ISP5432 \ ((PCI_PRODUCT_QLOGIC_ISP5432 << 16) | PCI_VENDOR_QLOGIC) @@ -327,14 +349,17 @@ static struct ispmdvec mdvec_2500 = { #define PCI_QLOGIC_ISP6322 \ ((PCI_PRODUCT_QLOGIC_ISP6322 << 16) | PCI_VENDOR_QLOGIC) +#define PCI_QLOGIC_ISP2031 \ + ((PCI_PRODUCT_QLOGIC_ISP2031 << 16) | PCI_VENDOR_QLOGIC) + +#define PCI_QLOGIC_ISP8031 \ + ((PCI_PRODUCT_QLOGIC_ISP8031 << 16) | PCI_VENDOR_QLOGIC) + /* * Odd case for some AMI raid cards... We need to *not* attach to this. */ #define AMI_RAID_SUBVENDOR_ID 0x101e -#define IO_MAP_REG 0x10 -#define MEM_MAP_REG 0x14 - #define PCI_DFLT_LTNCY 0x40 #define PCI_DFLT_LNSZ 0x10 @@ -348,10 +373,16 @@ struct isp_pcisoftc { ispsoftc_t pci_isp; device_t pci_dev; struct resource * regs; + struct resource * regs1; + struct resource * regs2; void * irq; int iqd; int rtp; int rgd; + int rtp1; + int rgd1; + int rtp2; + int rgd2; void * ih; int16_t pci_poff[_NREG_BLKS]; bus_dma_tag_t dmat; @@ -434,6 +465,12 @@ isp_pci_probe(device_t dev) case PCI_QLOGIC_ISP6322: device_set_desc(dev, "Qlogic ISP 6322 PCI FC-AL Adapter"); break; + case PCI_QLOGIC_ISP2031: + device_set_desc(dev, "Qlogic ISP 2031 PCI FC-AL Adapter"); + break; + case PCI_QLOGIC_ISP8031: + device_set_desc(dev, "Qlogic ISP 8031 PCI FCoE Adapter"); + break; default: return (ENXIO); } @@ -485,31 +522,6 @@ isp_get_generic_options(device_t dev, is } static void -isp_get_pci_options(device_t dev, int *m1, int *m2) -{ - int tval; - /* - * Which we should try first - memory mapping or i/o mapping? - * - * We used to try memory first followed by i/o on alpha, otherwise - * the reverse, but we should just try memory first all the time now. - */ - *m1 = PCIM_CMD_MEMEN; - *m2 = PCIM_CMD_PORTEN; - - tval = 0; - if (resource_int_value(device_get_name(dev), device_get_unit(dev), "prefer_iomap", &tval) == 0 && tval != 0) { - *m1 = PCIM_CMD_PORTEN; - *m2 = PCIM_CMD_MEMEN; - } - tval = 0; - if (resource_int_value(device_get_name(dev), device_get_unit(dev), "prefer_memmap", &tval) == 0 && tval != 0) { - *m1 = PCIM_CMD_MEMEN; - *m2 = PCIM_CMD_PORTEN; - } -} - -static void isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp) { const char *sptr; @@ -662,7 +674,7 @@ isp_get_specific_options(device_t dev, i static int isp_pci_attach(device_t dev) { - int i, m1, m2, locksetup = 0; + int i, locksetup = 0; uint32_t data, cmd, linesz, did; struct isp_pcisoftc *pcs; ispsoftc_t *isp; @@ -689,33 +701,10 @@ isp_pci_attach(device_t dev) isp_nvports = 0; isp_get_generic_options(dev, isp); - /* - * Get PCI options- which in this case are just mapping preferences. - */ - isp_get_pci_options(dev, &m1, &m2); - linesz = PCI_DFLT_LNSZ; - pcs->irq = pcs->regs = NULL; + pcs->irq = pcs->regs = pcs->regs2 = NULL; pcs->rgd = pcs->rtp = pcs->iqd = 0; - pcs->rtp = (m1 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; - pcs->rgd = (m1 == PCIM_CMD_MEMEN)? MEM_MAP_REG : IO_MAP_REG; - pcs->regs = bus_alloc_resource_any(dev, pcs->rtp, &pcs->rgd, RF_ACTIVE); - if (pcs->regs == NULL) { - pcs->rtp = (m2 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; - pcs->rgd = (m2 == PCIM_CMD_MEMEN)? MEM_MAP_REG : IO_MAP_REG; - pcs->regs = bus_alloc_resource_any(dev, pcs->rtp, &pcs->rgd, RF_ACTIVE); - } - if (pcs->regs == NULL) { - device_printf(dev, "unable to map any ports\n"); - goto bad; - } - if (bootverbose) { - device_printf(dev, "using %s space register mapping\n", (pcs->rgd == IO_MAP_REG)? "I/O" : "Memory"); - } - isp->isp_bus_tag = rman_get_bustag(pcs->regs); - isp->isp_bus_handle = rman_get_bushandle(pcs->regs); - pcs->pci_dev = dev; pcs->pci_poff[BIU_BLOCK >> _BLK_REG_SHFT] = BIU_REGS_OFF; pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] = PCI_MBOX_REGS_OFF; @@ -823,6 +812,14 @@ isp_pci_attach(device_t dev) isp->isp_type = ISP_HA_FC_2500; pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] = PCI_MBOX_REGS2400_OFF; break; + case PCI_QLOGIC_ISP2031: + case PCI_QLOGIC_ISP8031: + did = 0x2600; + isp->isp_nchan += isp_nvports; + isp->isp_mdvec = &mdvec_2600; + isp->isp_type = ISP_HA_FC_2600; + pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] = PCI_MBOX_REGS2400_OFF; + break; default: device_printf(dev, "unknown device type\n"); goto bad; @@ -830,6 +827,42 @@ isp_pci_attach(device_t dev) } isp->isp_revision = pci_get_revid(dev); + if (IS_26XX(isp)) { + pcs->rtp = SYS_RES_MEMORY; + pcs->rgd = PCIR_BAR(0); + pcs->regs = bus_alloc_resource_any(dev, pcs->rtp, &pcs->rgd, + RF_ACTIVE); + pcs->rtp1 = SYS_RES_MEMORY; + pcs->rgd1 = PCIR_BAR(2); + pcs->regs1 = bus_alloc_resource_any(dev, pcs->rtp1, &pcs->rgd1, + RF_ACTIVE); + pcs->rtp2 = SYS_RES_MEMORY; + pcs->rgd2 = PCIR_BAR(4); + pcs->regs2 = bus_alloc_resource_any(dev, pcs->rtp2, &pcs->rgd2, + RF_ACTIVE); + } else { + pcs->rtp = SYS_RES_MEMORY; + pcs->rgd = PCIR_BAR(1); + pcs->regs = bus_alloc_resource_any(dev, pcs->rtp, &pcs->rgd, + RF_ACTIVE); + if (pcs->regs == NULL) { + pcs->rtp = SYS_RES_IOPORT; + pcs->rgd = PCIR_BAR(0); + pcs->regs = bus_alloc_resource_any(dev, pcs->rtp, + &pcs->rgd, RF_ACTIVE); + } + } + if (pcs->regs == NULL) { + device_printf(dev, "Unable to map any ports\n"); + goto bad; + } + if (bootverbose) { + device_printf(dev, "Using %s space register mapping\n", + (pcs->rtp == SYS_RES_IOPORT)? "I/O" : "Memory"); + } + isp->isp_regs = pcs->regs; + isp->isp_regs2 = pcs->regs2; + if (IS_FC(isp)) { psize = sizeof (fcparam); xsize = sizeof (struct isp_fc); @@ -910,20 +943,28 @@ isp_pci_attach(device_t dev) data &= ~1; pci_write_config(dev, PCIR_ROMADDR, data, 4); - /* - * Do MSI - * - * NB: MSI-X needs to be disabled for the 2432 (PCI-Express) - */ - if (IS_24XX(isp) || IS_2322(isp)) { - pcs->msicount = pci_msi_count(dev); - if (pcs->msicount > 1) { - pcs->msicount = 1; + if (IS_26XX(isp)) { + /* 26XX chips support only MSI-X, so start from them. */ + pcs->msicount = imin(pci_msix_count(dev), 1); + if (pcs->msicount > 0 && + (i = pci_alloc_msix(dev, &pcs->msicount)) == 0) { + pcs->iqd = 1; + } else { + pcs->msicount = 0; } - if (pci_alloc_msi(dev, &pcs->msicount) == 0) { + } + if (pcs->msicount == 0 && (IS_24XX(isp) || IS_2322(isp))) { + /* + * Older chips support both MSI and MSI-X, but I have + * feeling that older firmware may not support MSI-X, + * but we have no way to check the firmware flag here. + */ + pcs->msicount = imin(pci_msi_count(dev), 1); + if (pcs->msicount > 0 && + pci_alloc_msi(dev, &pcs->msicount) == 0) { pcs->iqd = 1; } else { - pcs->iqd = 0; + pcs->msicount = 0; } } pcs->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &pcs->iqd, RF_ACTIVE | RF_SHAREABLE); @@ -978,9 +1019,12 @@ bad: if (pcs->msicount) { pci_release_msi(dev); } - if (pcs->regs) { + if (pcs->regs) (void) bus_release_resource(dev, pcs->rtp, pcs->rgd, pcs->regs); - } + if (pcs->regs1) + (void) bus_release_resource(dev, pcs->rtp1, pcs->rgd1, pcs->regs1); + if (pcs->regs2) + (void) bus_release_resource(dev, pcs->rtp2, pcs->rgd2, pcs->regs2); if (pcs->pci_isp.isp_param) { free(pcs->pci_isp.isp_param, M_DEVBUF); pcs->pci_isp.isp_param = NULL; @@ -1019,6 +1063,10 @@ isp_pci_detach(device_t dev) pci_release_msi(dev); } (void) bus_release_resource(dev, pcs->rtp, pcs->rgd, pcs->regs); + if (pcs->regs1) + (void) bus_release_resource(dev, pcs->rtp1, pcs->rgd1, pcs->regs1); + if (pcs->regs2) + (void) bus_release_resource(dev, pcs->rtp2, pcs->rgd2, pcs->regs2); /* * XXX: THERE IS A LOT OF LEAKAGE HERE */ @@ -1037,15 +1085,12 @@ isp_pci_detach(device_t dev) (((struct isp_pcisoftc *)a)->pci_poff[((x) & _BLK_REG_MASK) >> \ _BLK_REG_SHFT] + ((x) & 0xfff)) -#define BXR2(isp, off) \ - bus_space_read_2(isp->isp_bus_tag, isp->isp_bus_handle, off) -#define BXW2(isp, off, v) \ - bus_space_write_2(isp->isp_bus_tag, isp->isp_bus_handle, off, v) -#define BXR4(isp, off) \ - bus_space_read_4(isp->isp_bus_tag, isp->isp_bus_handle, off) -#define BXW4(isp, off, v) \ - bus_space_write_4(isp->isp_bus_tag, isp->isp_bus_handle, off, v) - +#define BXR2(isp, off) bus_read_2((isp)->isp_regs, (off)) +#define BXW2(isp, off, v) bus_write_2((isp)->isp_regs, (off), (v)) +#define BXR4(isp, off) bus_read_4((isp)->isp_regs, (off)) +#define BXW4(isp, off, v) bus_write_4((isp)->isp_regs, (off), (v)) +#define B2R4(isp, off) bus_read_4((isp)->isp_regs2, (off)) +#define B2W4(isp, off, v) bus_write_4((isp)->isp_regs2, (off), (v)) static ISP_INLINE int isp_pci_rd_debounced(ispsoftc_t *isp, int off, uint16_t *rp) @@ -1308,20 +1353,19 @@ isp_pci_rd_reg_2400(ispsoftc_t *isp, int case MBOX_BLOCK: return (BXR2(isp, IspVirt2Off(isp, regoff))); case SXP_BLOCK: - isp_prt(isp, ISP_LOGWARN, "SXP_BLOCK read at 0x%x", regoff); + isp_prt(isp, ISP_LOGERR, "SXP_BLOCK read at 0x%x", regoff); return (0xffffffff); case RISC_BLOCK: - isp_prt(isp, ISP_LOGWARN, "RISC_BLOCK read at 0x%x", regoff); + isp_prt(isp, ISP_LOGERR, "RISC_BLOCK read at 0x%x", regoff); return (0xffffffff); case DMA_BLOCK: - isp_prt(isp, ISP_LOGWARN, "DMA_BLOCK read at 0x%x", regoff); + isp_prt(isp, ISP_LOGERR, "DMA_BLOCK read at 0x%x", regoff); return (0xffffffff); default: - isp_prt(isp, ISP_LOGWARN, "unknown block read at 0x%x", regoff); + isp_prt(isp, ISP_LOGERR, "unknown block read at 0x%x", regoff); return (0xffffffff); } - switch (regoff) { case BIU2400_FLASH_ADDR: case BIU2400_FLASH_DATA: @@ -1349,8 +1393,8 @@ isp_pci_rd_reg_2400(ispsoftc_t *isp, int rv = BXR4(isp, IspVirt2Off(isp, regoff)) >> 16; break; default: - isp_prt(isp, ISP_LOGERR, - "isp_pci_rd_reg_2400: unknown offset %x", regoff); + isp_prt(isp, ISP_LOGERR, "unknown register read at 0x%x", + regoff); rv = 0xffffffff; break; } @@ -1370,17 +1414,16 @@ isp_pci_wr_reg_2400(ispsoftc_t *isp, int MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 2, -1); return; case SXP_BLOCK: - isp_prt(isp, ISP_LOGWARN, "SXP_BLOCK write at 0x%x", regoff); + isp_prt(isp, ISP_LOGERR, "SXP_BLOCK write at 0x%x", regoff); return; case RISC_BLOCK: - isp_prt(isp, ISP_LOGWARN, "RISC_BLOCK write at 0x%x", regoff); + isp_prt(isp, ISP_LOGERR, "RISC_BLOCK write at 0x%x", regoff); return; case DMA_BLOCK: - isp_prt(isp, ISP_LOGWARN, "DMA_BLOCK write at 0x%x", regoff); + isp_prt(isp, ISP_LOGERR, "DMA_BLOCK write at 0x%x", regoff); return; default: - isp_prt(isp, ISP_LOGWARN, "unknown block write at 0x%x", - regoff); + isp_prt(isp, ISP_LOGERR, "unknown block write at 0x%x", regoff); break; } @@ -1415,10 +1458,83 @@ isp_pci_wr_reg_2400(ispsoftc_t *isp, int MEMORYBARRIER(isp, SYNC_REG, IspVirt2Off(isp, regoff), 4, -1); break; default: - isp_prt(isp, ISP_LOGERR, - "isp_pci_wr_reg_2400: bad offset 0x%x", regoff); + isp_prt(isp, ISP_LOGERR, "unknown register write at 0x%x", + regoff); + break; + } +} + +static uint32_t +isp_pci_rd_reg_2600(ispsoftc_t *isp, int regoff) +{ + uint32_t rv; + + switch (regoff) { + case BIU2400_PRI_REQINP: + case BIU2400_PRI_REQOUTP: + isp_prt(isp, ISP_LOGERR, "unknown register read at 0x%x", + regoff); + rv = 0xffffffff; + break; + case BIU2400_REQINP: + rv = B2R4(isp, 0x00); + break; + case BIU2400_REQOUTP: + rv = B2R4(isp, 0x04); break; + case BIU2400_RSPINP: + rv = B2R4(isp, 0x08); + break; + case BIU2400_RSPOUTP: + rv = B2R4(isp, 0x0c); + break; + case BIU2400_ATIO_RSPINP: + rv = B2R4(isp, 0x10); + break; + case BIU2400_ATIO_RSPOUTP: + rv = B2R4(isp, 0x14); + break; + default: + rv = isp_pci_rd_reg_2400(isp, regoff); + break; + } + return (rv); +} + +static void +isp_pci_wr_reg_2600(ispsoftc_t *isp, int regoff, uint32_t val) +{ + int off; + + switch (regoff) { + case BIU2400_PRI_REQINP: + case BIU2400_PRI_REQOUTP: + isp_prt(isp, ISP_LOGERR, "unknown register write at 0x%x", + regoff); + return; + case BIU2400_REQINP: + off = 0x00; + break; + case BIU2400_REQOUTP: + off = 0x04; + break; + case BIU2400_RSPINP: + off = 0x08; + break; + case BIU2400_RSPOUTP: + off = 0x0c; + break; + case BIU2400_ATIO_RSPINP: + off = 0x10; + break; + case BIU2400_ATIO_RSPOUTP: + off = 0x14; + break; + default: + isp_pci_wr_reg_2400(isp, regoff, val); + return; } + B2W4(isp, off, val); } Modified: stable/10/sys/dev/isp/isp_sbus.c ============================================================================== --- stable/10/sys/dev/isp/isp_sbus.c Tue Dec 22 12:54:13 2015 (r292597) +++ stable/10/sys/dev/isp/isp_sbus.c Tue Dec 22 13:19:29 2015 (r292598) @@ -180,8 +180,7 @@ isp_sbus_attach(device_t dev) sbs->sbus_poff[RISC_BLOCK >> _BLK_REG_SHFT] = SBUS_RISC_REGS_OFF; sbs->sbus_poff[DMA_BLOCK >> _BLK_REG_SHFT] = DMA_REGS_OFF; isp = &sbs->sbus_isp; - isp->isp_bus_tag = rman_get_bustag(sbs->regs); - isp->isp_bus_handle = rman_get_bushandle(sbs->regs); + isp->isp_regs = sbs->regs; isp->isp_mdvec = &sbs->sbus_mdvec; isp->isp_bustype = ISP_BT_SBUS; isp->isp_type = ISP_HA_SCSI_UNKNOWN; @@ -367,16 +366,15 @@ isp_sbus_detach(device_t dev) (((struct isp_sbussoftc *)a)->sbus_poff[((x) & _BLK_REG_MASK) >> \ _BLK_REG_SHFT] + ((x) & 0xff)) -#define BXR2(sbc, off) \ - bus_space_read_2(isp->isp_bus_tag, isp->isp_bus_handle, off) +#define BXR2(isp, off) bus_read_2((isp)->isp_regs, (off)) static int isp_sbus_rd_isr(ispsoftc_t *isp, uint16_t *isrp, uint16_t *semap, uint16_t *info) { uint16_t isr, sema; - isr = BXR2(sbc, IspVirt2Off(isp, BIU_ISR)); - sema = BXR2(sbc, IspVirt2Off(isp, BIU_SEMA)); + isr = BXR2(isp, IspVirt2Off(isp, BIU_ISR)); + sema = BXR2(isp, IspVirt2Off(isp, BIU_SEMA)); isp_prt(isp, ISP_LOGDEBUG3, "ISR 0x%x SEMA 0x%x", isr, sema); isr &= INT_PENDING_MASK(isp); sema &= BIU_SEMA_LOCK; @@ -385,7 +383,7 @@ isp_sbus_rd_isr(ispsoftc_t *isp, uint16_ } *isrp = isr; if ((*semap = sema) != 0) - *info = BXR2(sbc, IspVirt2Off(isp, OUTMAILBOX0)); + *info = BXR2(isp, IspVirt2Off(isp, OUTMAILBOX0)); return (1); } @@ -396,7 +394,7 @@ isp_sbus_rd_reg(ispsoftc_t *isp, int reg struct isp_sbussoftc *sbs = (struct isp_sbussoftc *) isp; int offset = sbs->sbus_poff[(regoff & _BLK_REG_MASK) >> _BLK_REG_SHFT]; offset += (regoff & 0xff); - rval = bus_space_read_2(isp->isp_bus_tag, isp->isp_bus_handle, offset); + rval = BXR2(isp, offset); isp_prt(isp, ISP_LOGDEBUG3, "isp_sbus_rd_reg(off %x) = %x", regoff, rval); return (rval); @@ -410,7 +408,7 @@ isp_sbus_wr_reg(ispsoftc_t *isp, int reg offset += (regoff & 0xff); isp_prt(isp, ISP_LOGDEBUG3, "isp_sbus_wr_reg(off %x) = %x", regoff, val); - bus_space_write_2(isp->isp_bus_tag, isp->isp_bus_handle, offset, val); + bus_write_2(isp->isp_regs, offset, val); MEMORYBARRIER(isp, SYNC_REG, offset, 2, -1); } Modified: stable/10/sys/dev/isp/ispmbox.h ============================================================================== --- stable/10/sys/dev/isp/ispmbox.h Tue Dec 22 12:54:13 2015 (r292597) +++ stable/10/sys/dev/isp/ispmbox.h Tue Dec 22 13:19:29 2015 (r292598) @@ -122,6 +122,7 @@ #define MBOX_GET_TARGET_STATUS 0x0056 /* These are for the ISP2X00 FC cards */ +#define MBOX_LOAD_FLASH_FIRMWARE 0x0003 #define MBOX_WRITE_FC_SERDES_REG 0x0003 /* FC only */ #define MBOX_READ_FC_SERDES_REG 0x0004 /* FC only */ #define MBOX_GET_IO_STATUS 0x0012 @@ -1007,9 +1008,9 @@ typedef struct { #define ICBXOPT_TIMER_MASK 0x7 #define ICBZOPT_RATE_MASK 0xC000 -#define ICBZOPT_RATE_ONEGB 0x0000 +#define ICBZOPT_RATE_1GB 0x0000 #define ICBZOPT_RATE_AUTO 0x8000 -#define ICBZOPT_RATE_TWOGB 0x4000 +#define ICBZOPT_RATE_2GB 0x4000 #define ICBZOPT_50_OHM 0x2000 #define ICBZOPT_NO_LOCAL_PLOGI 0x0080 #define ICBZOPT_ENA_OOF 0x0040 /* out of order frame handling */ @@ -1058,14 +1059,14 @@ typedef struct { #define ICB2400_OPT3_ENA_ETH_RESP 0x08000000 #define ICB2400_OPT3_ENA_ETH_ATIO 0x04000000 #define ICB2400_OPT3_ENA_MFCF 0x00020000 -#define ICB2400_OPT3_SKIP_FOURGB 0x00010000 +#define ICB2400_OPT3_SKIP_4GB 0x00010000 #define ICB2400_OPT3_RATE_MASK 0x0000E000 -#define ICB2400_OPT3_RATE_ONEGB 0x00000000 -#define ICB2400_OPT3_RATE_TWOGB 0x00002000 +#define ICB2400_OPT3_RATE_1GB 0x00000000 +#define ICB2400_OPT3_RATE_2GB 0x00002000 #define ICB2400_OPT3_RATE_AUTO 0x00004000 -#define ICB2400_OPT3_RATE_FOURGB 0x00006000 -#define ICB2400_OPT3_RATE_EIGHTGB 0x00008000 -#define ICB2400_OPT3_RATE_SIXTEENGB 0x0000A000 +#define ICB2400_OPT3_RATE_4GB 0x00006000 +#define ICB2400_OPT3_RATE_8GB 0x00008000 +#define ICB2400_OPT3_RATE_16GB 0x0000A000 #define ICB2400_OPT3_ENA_OOF_XFRDY 0x00000200 #define ICB2400_OPT3_NO_N2N_LOGI 0x00000100 #define ICB2400_OPT3_NO_LOCAL_PLOGI 0x00000080 Modified: stable/10/sys/dev/isp/ispvar.h ============================================================================== --- stable/10/sys/dev/isp/ispvar.h Tue Dec 22 12:54:13 2015 (r292597) +++ stable/10/sys/dev/isp/ispvar.h Tue Dec 22 13:19:29 2015 (r292598) @@ -653,8 +653,8 @@ struct ispsoftc { #define ISP_CFG_NPORT 0x04 /* prefer {N/F}-Port connection */ #define ISP_CFG_NPORT_ONLY 0x08 /* insist on {N/F}-Port connection */ #define ISP_CFG_LPORT_ONLY 0x0c /* insist on {N/F}L-Port connection */ -#define ISP_CFG_ONEGB 0x10 /* force 1GB connection (23XX only) */ -#define ISP_CFG_TWOGB 0x20 /* force 2GB connection (23XX only) */ +#define ISP_CFG_1GB 0x10 /* force 1GB connection (23XX only) */ +#define ISP_CFG_2GB 0x20 /* force 2GB connection (23XX only) */ #define ISP_CFG_NORELOAD 0x80 /* don't download f/w */ #define ISP_CFG_NONVRAM 0x40 /* ignore NVRAM */ #define ISP_CFG_NOFCTAPE 0x100 /* disable FC-Tape */ @@ -662,9 +662,9 @@ struct ispsoftc { #define ISP_CFG_OWNFSZ 0x400 /* override NVRAM frame size */ #define ISP_CFG_OWNLOOPID 0x800 /* override NVRAM loopid */ #define ISP_CFG_OWNEXCTHROTTLE 0x1000 /* override NVRAM execution throttle */ -#define ISP_CFG_FOURGB 0x2000 /* force 4GB connection (24XX only) */ -#define ISP_CFG_EIGHTGB 0x4000 /* force 8GB connection (25XX only) */ -#define ISP_CFG_SIXTEENGB 0x8000 /* force 16GB connection (82XX only) */ +#define ISP_CFG_4GB 0x2000 /* force 4GB connection (24XX only) */ +#define ISP_CFG_8GB 0x4000 /* force 8GB connection (25XX only) */ +#define ISP_CFG_16GB 0x8000 /* force 16GB connection (82XX only) */ /* * For each channel, the outer layers should know what role that channel @@ -764,6 +764,7 @@ struct ispsoftc { #define ISP_HA_FC_2322 0x50 #define ISP_HA_FC_2400 0x60 #define ISP_HA_FC_2500 0x70 +#define ISP_HA_FC_2600 0x80 #define IS_SCSI(isp) (isp->isp_type & ISP_HA_SCSI) #define IS_1020(isp) (isp->isp_type < ISP_HA_SCSI_1240) @@ -789,6 +790,7 @@ struct ispsoftc { #define IS_2322(isp) ((isp)->isp_type == ISP_HA_FC_2322) #define IS_24XX(isp) ((isp)->isp_type >= ISP_HA_FC_2400) #define IS_25XX(isp) ((isp)->isp_type >= ISP_HA_FC_2500) +#define IS_26XX(isp) ((isp)->isp_type >= ISP_HA_FC_2600) /* * DMA related macros From owner-svn-src-all@freebsd.org Tue Dec 22 13:41:52 2015 Return-Path: Delivered-To: svn-src-all@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 30DF0A4D025; Tue, 22 Dec 2015 13:41:52 +0000 (UTC) (envelope-from jtl@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 F06A412CB; Tue, 22 Dec 2015 13:41:51 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMDfpoS019337; Tue, 22 Dec 2015 13:41:51 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMDfp04019336; Tue, 22 Dec 2015 13:41:51 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201512221341.tBMDfp04019336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 22 Dec 2015 13:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292599 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 13:41:52 -0000 Author: jtl Date: Tue Dec 22 13:41:50 2015 New Revision: 292599 URL: https://svnweb.freebsd.org/changeset/base/292599 Log: Fix a panic when launching VNETs after the commit of r292309. Differential Revision: https://reviews.freebsd.org/D4645 Reviewed by: rrs Reported by: kp Tested by: kp Sponsored by: Juniper Networks Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Dec 22 13:19:29 2015 (r292598) +++ head/sys/netinet/tcp_subr.c Tue Dec 22 13:41:50 2015 (r292599) @@ -593,10 +593,6 @@ tcp_init(void) if (hhook_head_register(HHOOK_TYPE_TCP, HHOOK_TCP_EST_OUT, &V_tcp_hhh[HHOOK_TCP_EST_OUT], HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 0) printf("%s: WARNING: unable to register helper hook\n", __func__); - /* Setup the tcp function block list */ - TAILQ_INIT(&t_functions); - rw_init_flags(&tcp_function_lock, "tcp_func_lock" , 0); - register_tcp_functions(&tcp_def_funcblk, M_WAITOK); hashsize = TCBHASHSIZE; TUNABLE_INT_FETCH(tcbhash_tuneable, &hashsize); if (hashsize == 0) { @@ -675,6 +671,10 @@ tcp_init(void) tcp_rexmit_slop = TCPTV_CPU_VAR; tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT; tcp_tcbhashsize = hashsize; + /* Setup the tcp function block list */ + TAILQ_INIT(&t_functions); + rw_init_flags(&tcp_function_lock, "tcp_func_lock" , 0); + register_tcp_functions(&tcp_def_funcblk, M_WAITOK); if (tcp_soreceive_stream) { #ifdef INET From owner-svn-src-all@freebsd.org Tue Dec 22 13:50:02 2015 Return-Path: Delivered-To: svn-src-all@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 A81AFA4D34A; Tue, 22 Dec 2015 13:50:02 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 759211732; Tue, 22 Dec 2015 13:50:02 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [IPv6:::1] (vega.codepro.be [IPv6:2a01:4f8:162:1127::3]) by venus.codepro.be (Postfix) with ESMTPSA id 850668CB3; Tue, 22 Dec 2015 14:49:59 +0100 (CET) Subject: Re: svn commit: r292599 - head/sys/netinet Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: text/plain; charset=us-ascii From: Kristof Provost X-Checked-By-Nsa: Probably In-Reply-To: <201512221341.tBMDfp04019336@repo.freebsd.org> Date: Tue, 22 Dec 2015 14:50:02 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3AB254FD-68BF-4395-8BAA-A0B5D51F1049@FreeBSD.org> References: <201512221341.tBMDfp04019336@repo.freebsd.org> To: "Jonathan T. Looney" X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 13:50:02 -0000 Thanks! Kristof > On 22 Dec 2015, at 14:41, Jonathan T. Looney wrote: >=20 > Author: jtl > Date: Tue Dec 22 13:41:50 2015 > New Revision: 292599 > URL: https://svnweb.freebsd.org/changeset/base/292599 >=20 > Log: > Fix a panic when launching VNETs after the commit of r292309. >=20 > Differential Revision: https://reviews.freebsd.org/D4645 > Reviewed by: rrs > Reported by: kp > Tested by: kp > Sponsored by: Juniper Networks >=20 > Modified: > head/sys/netinet/tcp_subr.c >=20 > Modified: head/sys/netinet/tcp_subr.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/netinet/tcp_subr.c Tue Dec 22 13:19:29 2015 = (r292598) > +++ head/sys/netinet/tcp_subr.c Tue Dec 22 13:41:50 2015 = (r292599) > @@ -593,10 +593,6 @@ tcp_init(void) > if (hhook_head_register(HHOOK_TYPE_TCP, HHOOK_TCP_EST_OUT, > &V_tcp_hhh[HHOOK_TCP_EST_OUT], = HHOOK_NOWAIT|HHOOK_HEADISINVNET) !=3D 0) > printf("%s: WARNING: unable to register helper hook\n", = __func__); > - /* Setup the tcp function block list */ > - TAILQ_INIT(&t_functions); > - rw_init_flags(&tcp_function_lock, "tcp_func_lock" , 0); > - register_tcp_functions(&tcp_def_funcblk, M_WAITOK); > hashsize =3D TCBHASHSIZE; > TUNABLE_INT_FETCH(tcbhash_tuneable, &hashsize); > if (hashsize =3D=3D 0) { > @@ -675,6 +671,10 @@ tcp_init(void) > tcp_rexmit_slop =3D TCPTV_CPU_VAR; > tcp_finwait2_timeout =3D TCPTV_FINWAIT2_TIMEOUT; > tcp_tcbhashsize =3D hashsize; > + /* Setup the tcp function block list */ > + TAILQ_INIT(&t_functions); > + rw_init_flags(&tcp_function_lock, "tcp_func_lock" , 0); > + register_tcp_functions(&tcp_def_funcblk, M_WAITOK); >=20 > if (tcp_soreceive_stream) { > #ifdef INET >=20 From owner-svn-src-all@freebsd.org Tue Dec 22 14:53:20 2015 Return-Path: Delivered-To: svn-src-all@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 A5363A4E9EE; Tue, 22 Dec 2015 14:53:20 +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 7294B1B0E; Tue, 22 Dec 2015 14:53:20 +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 tBMErJAf042713; Tue, 22 Dec 2015 14:53:19 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMErJko042711; Tue, 22 Dec 2015 14:53:19 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201512221453.tBMErJko042711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 22 Dec 2015 14:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292601 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 14:53:20 -0000 Author: bz Date: Tue Dec 22 14:53:19 2015 New Revision: 292601 URL: https://svnweb.freebsd.org/changeset/base/292601 Log: Since r256624 we've been leaking routing table allocations on vnet enabled jail shutdown. Call the provided cleanup routines for IP versions 4 and 6 to plug these leaks. Sponsored by: The FreeBSD Foundation MFC atfer: 2 weeks Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D4530 Modified: head/sys/netinet/in_rmx.c head/sys/netinet6/in6_rmx.c Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Tue Dec 22 13:58:11 2015 (r292600) +++ head/sys/netinet/in_rmx.c Tue Dec 22 14:53:19 2015 (r292601) @@ -133,7 +133,7 @@ int in_detachhead(void **head, int off) { - return (1); + return (rn_detachhead(head)); } #endif Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Tue Dec 22 13:58:11 2015 (r292600) +++ head/sys/netinet6/in6_rmx.c Tue Dec 22 14:53:19 2015 (r292601) @@ -266,6 +266,7 @@ in6_detachhead(void **head, int off) { callout_drain(&V_rtq_mtutimer); + return (rn_detachhead(head)); return (1); } #endif From owner-svn-src-all@freebsd.org Tue Dec 22 14:57:05 2015 Return-Path: Delivered-To: svn-src-all@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 7862FA4EB9C; Tue, 22 Dec 2015 14:57:05 +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 471011DC0; Tue, 22 Dec 2015 14:57:05 +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 tBMEv45l043017; Tue, 22 Dec 2015 14:57:04 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMEv4Cd043016; Tue, 22 Dec 2015 14:57:04 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201512221457.tBMEv4Cd043016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 22 Dec 2015 14:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292602 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 14:57:05 -0000 Author: bz Date: Tue Dec 22 14:57:04 2015 New Revision: 292602 URL: https://svnweb.freebsd.org/changeset/base/292602 Log: Simplify bringup order by removing a SYSINIT making it a static list initialization. Mfp4 @180384,180385: There is no need for a dedicated SYSINIT here. The list can be initialized statically. Sponsored by: CK Software GmbH Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D4528 Modified: head/sys/net/if_llatbl.c Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Tue Dec 22 14:53:19 2015 (r292601) +++ head/sys/net/if_llatbl.c Tue Dec 22 14:57:04 2015 (r292602) @@ -62,11 +62,10 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_LLTABLE, "lltable", "link level address tables"); -static VNET_DEFINE(SLIST_HEAD(, lltable), lltables); +static VNET_DEFINE(SLIST_HEAD(, lltable), lltables) = + SLIST_HEAD_INITIALIZER(lltables); #define V_lltables VNET(lltables) -static void vnet_lltable_init(void); - struct rwlock lltable_rwlock; RW_SYSINIT(lltable_rwlock, &lltable_rwlock, "lltable_rwlock"); @@ -740,15 +739,6 @@ lla_rt_output(struct rt_msghdr *rtm, str return (error); } -static void -vnet_lltable_init() -{ - - SLIST_INIT(&V_lltables); -} -VNET_SYSINIT(vnet_lltable_init, SI_SUB_PSEUDO, SI_ORDER_FIRST, - vnet_lltable_init, NULL); - #ifdef DDB struct llentry_sa { struct llentry base; From owner-svn-src-all@freebsd.org Tue Dec 22 15:00:05 2015 Return-Path: Delivered-To: svn-src-all@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 67E1DA4ECE6; Tue, 22 Dec 2015 15:00:05 +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 3866B1FE1; Tue, 22 Dec 2015 15:00:05 +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 tBMF04GQ043237; Tue, 22 Dec 2015 15:00:04 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMF04Fq043235; Tue, 22 Dec 2015 15:00:04 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201512221500.tBMF04Fq043235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 22 Dec 2015 15:00:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292603 - in head/sys: net netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 15:00:05 -0000 Author: bz Date: Tue Dec 22 15:00:04 2015 New Revision: 292603 URL: https://svnweb.freebsd.org/changeset/base/292603 Log: If bootverbose is enabled every vnet startup and virtual interface creation will print extra lines on the console. We are generally not interested in this (repeated) information for each VNET. Thus only print it for the default VNET. Virtual interfaces on the base system will remain printing information, but e.g. each loopback in each vnet will no longer cause a "bpf attached" line. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D4531 Modified: head/sys/net/bpf.c head/sys/netinet/tcp_subr.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Tue Dec 22 14:57:04 2015 (r292602) +++ head/sys/net/bpf.c Tue Dec 22 15:00:04 2015 (r292603) @@ -2551,7 +2551,7 @@ bpfattach2(struct ifnet *ifp, u_int dlt, bp->bif_hdrlen = hdrlen; - if (bootverbose) + if (bootverbose && IS_DEFAULT_VNET(curvnet)) if_printf(ifp, "bpf attached\n"); } Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Dec 22 14:57:04 2015 (r292602) +++ head/sys/netinet/tcp_subr.c Tue Dec 22 15:00:04 2015 (r292603) @@ -609,7 +609,7 @@ tcp_init(void) */ if (hashsize < 512) hashsize = 512; - if (bootverbose) + if (bootverbose && IS_DEFAULT_VNET(curvnet)) printf("%s: %s auto tuned to %d\n", __func__, tcbhash_tuneable, hashsize); } From owner-svn-src-all@freebsd.org Tue Dec 22 15:03:46 2015 Return-Path: Delivered-To: svn-src-all@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 E20F2A4EEB6; Tue, 22 Dec 2015 15:03:46 +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 98A2A1443; Tue, 22 Dec 2015 15:03:46 +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 tBMF3jBW045993; Tue, 22 Dec 2015 15:03:45 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMF3jQ8045992; Tue, 22 Dec 2015 15:03:45 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201512221503.tBMF3jQ8045992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 22 Dec 2015 15:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292604 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 15:03:47 -0000 Author: bz Date: Tue Dec 22 15:03:45 2015 New Revision: 292604 URL: https://svnweb.freebsd.org/changeset/base/292604 Log: If vnets are torn down while ifconfig runs an ioctl to say, destroy an epair(4), we may hit if_detach_internal() without holding a lock and by the time we aquire it the interface might be gone. We should not panic() in this case as it is our fault for not holding the lock all the way. It is not ideal to return silently without error to user space, but other callers will all ignore the return values so do not change the entire KPI for little benefit for now. The ifp will be dealt with one way or another still. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D4529 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Dec 22 15:00:04 2015 (r292603) +++ head/sys/net/if.c Tue Dec 22 15:03:45 2015 (r292604) @@ -173,7 +173,7 @@ static int if_getgroup(struct ifgroupreq static int if_getgroupmembers(struct ifgroupreq *); static void if_delgroups(struct ifnet *); static void if_attach_internal(struct ifnet *, int, struct if_clone *); -static void if_detach_internal(struct ifnet *, int, struct if_clone **); +static int if_detach_internal(struct ifnet *, int, struct if_clone **); #ifdef INET6 /* @@ -884,7 +884,7 @@ if_detach(struct ifnet *ifp) CURVNET_RESTORE(); } -static void +static int if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp) { struct ifaddr *ifa; @@ -906,11 +906,19 @@ if_detach_internal(struct ifnet *ifp, in #endif IFNET_WUNLOCK(); if (!found) { + /* + * While we would want to panic here, we cannot + * guarantee that the interface is indeed still on + * the list given we don't hold locks all the way. + */ + return (ENOENT); +#if 0 if (vmove) panic("%s: ifp=%p not on the ifnet tailq %p", __func__, ifp, &V_ifnet); else return; /* XXX this should panic as well? */ +#endif } /* Check if this is a cloned interface or not. */ @@ -993,6 +1001,8 @@ if_detach_internal(struct ifnet *ifp, in (*dp->dom_ifdetach)(ifp, ifp->if_afdata[dp->dom_family]); } + + return (0); } #ifdef VIMAGE @@ -1007,12 +1017,16 @@ void if_vmove(struct ifnet *ifp, struct vnet *new_vnet) { struct if_clone *ifc; + int rc; /* * Detach from current vnet, but preserve LLADDR info, do not * mark as dead etc. so that the ifnet can be reattached later. + * If we cannot find it, we lost the race to someone else. */ - if_detach_internal(ifp, 1, &ifc); + rc = if_detach_internal(ifp, 1, &ifc); + if (rc != 0) + return; /* * Unlink the ifnet from ifindex_table[] in current vnet, and shrink From owner-svn-src-all@freebsd.org Tue Dec 22 15:20:09 2015 Return-Path: Delivered-To: svn-src-all@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 7B419A4F361; Tue, 22 Dec 2015 15:20:09 +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 4DF9D1CA8; Tue, 22 Dec 2015 15:20:09 +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 tBMFK8gU049254; Tue, 22 Dec 2015 15:20:08 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMFK87S049253; Tue, 22 Dec 2015 15:20:08 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201512221520.tBMFK87S049253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 22 Dec 2015 15:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292605 - head/usr.sbin/cron/cron X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 15:20:09 -0000 Author: pfg Date: Tue Dec 22 15:20:08 2015 New Revision: 292605 URL: https://svnweb.freebsd.org/changeset/base/292605 Log: crontab: replace malloc + bzero with calloc Obtained from: OpenBSD (Rev 1.20) Modified: head/usr.sbin/cron/cron/popen.c Modified: head/usr.sbin/cron/cron/popen.c ============================================================================== --- head/usr.sbin/cron/cron/popen.c Tue Dec 22 15:03:45 2015 (r292604) +++ head/usr.sbin/cron/cron/popen.c Tue Dec 22 15:20:08 2015 (r292605) @@ -82,9 +82,8 @@ cron_popen(program, type, e) if (!pids) { if ((fds = getdtablesize()) <= 0) return(NULL); - if (!(pids = (PID_T *)malloc((u_int)(fds * sizeof(PID_T))))) + if (!(pids = calloc(fds, sizeof(PID_T)))) return(NULL); - bzero((char *)pids, fds * sizeof(PID_T)); } if (pipe(pdes) < 0) return(NULL); From owner-svn-src-all@freebsd.org Tue Dec 22 15:30:27 2015 Return-Path: Delivered-To: svn-src-all@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 9B3C8A4F61C; Tue, 22 Dec 2015 15:30:27 +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 6194D1453; Tue, 22 Dec 2015 15:30:27 +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 tBMFUQTZ052342; Tue, 22 Dec 2015 15:30:26 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMFUQ3b052341; Tue, 22 Dec 2015 15:30:26 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201512221530.tBMFUQ3b052341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 22 Dec 2015 15:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292606 - head/usr.sbin/cron/crontab X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 15:30:27 -0000 Author: pfg Date: Tue Dec 22 15:30:26 2015 New Revision: 292606 URL: https://svnweb.freebsd.org/changeset/base/292606 Log: crontab: properly free an entry This should close memory leak. Obtained from: OpenBSD (rev. 1.62) CID: 271773 Modified: head/usr.sbin/cron/crontab/crontab.c Modified: head/usr.sbin/cron/crontab/crontab.c ============================================================================== --- head/usr.sbin/cron/crontab/crontab.c Tue Dec 22 15:20:08 2015 (r292605) +++ head/usr.sbin/cron/crontab/crontab.c Tue Dec 22 15:30:26 2015 (r292606) @@ -558,7 +558,7 @@ replace_cmd() { case FALSE: e = load_entry(tmp, check_error, pw, envp); if (e) - free(e); + free_entry(e); break; case TRUE: break; From owner-svn-src-all@freebsd.org Tue Dec 22 15:32:46 2015 Return-Path: Delivered-To: svn-src-all@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 93245A4F7E5; Tue, 22 Dec 2015 15:32:46 +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 639C71A5B; Tue, 22 Dec 2015 15:32:46 +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 tBMFWjG9055175; Tue, 22 Dec 2015 15:32:45 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMFWjiL055174; Tue, 22 Dec 2015 15:32:45 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201512221532.tBMFWjiL055174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 22 Dec 2015 15:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292607 - head/usr.sbin/cron/cron X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 15:32:46 -0000 Author: pfg Date: Tue Dec 22 15:32:45 2015 New Revision: 292607 URL: https://svnweb.freebsd.org/changeset/base/292607 Log: cron: Check the return value of pipe(2) Fix inspired by: OpenBSD (rev 1.56) CID: 1009830 Modified: head/usr.sbin/cron/cron/do_command.c Modified: head/usr.sbin/cron/cron/do_command.c ============================================================================== --- head/usr.sbin/cron/cron/do_command.c Tue Dec 22 15:30:26 2015 (r292606) +++ head/usr.sbin/cron/cron/do_command.c Tue Dec 22 15:32:45 2015 (r292607) @@ -114,7 +114,7 @@ child_process(e, u) struct pam_conv pamc = { .conv = openpam_nullconv, .appdata_ptr = NULL - }; + } Debug(DPROC, ("[%d] checking account with PAM\n", getpid())) @@ -161,8 +161,10 @@ child_process(e, u) /* create some pipes to talk to our future child */ - pipe(stdin_pipe); /* child's stdin */ - pipe(stdout_pipe); /* child's stdout */ + if (pipe(stdin_pipe) != 0 || pipe(stdout_pipe) != 0) { + log_it("CRON", getpid(), "error", "can't pipe"); + exit(ERROR_EXIT); + } /* since we are a forked process, we can diddle the command string * we were passed -- nobody else is going to use it again, right? From owner-svn-src-all@freebsd.org Tue Dec 22 15:42:54 2015 Return-Path: Delivered-To: svn-src-all@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 5547DA4FC44; Tue, 22 Dec 2015 15:42:54 +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 251CF1391; Tue, 22 Dec 2015 15:42:54 +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 tBMFgr4O058219; Tue, 22 Dec 2015 15:42:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMFgrqC058218; Tue, 22 Dec 2015 15:42:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201512221542.tBMFgrqC058218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 22 Dec 2015 15:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292608 - head/usr.sbin/cron/cron X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 15:42:54 -0000 Author: pfg Date: Tue Dec 22 15:42:53 2015 New Revision: 292608 URL: https://svnweb.freebsd.org/changeset/base/292608 Log: Undo change from r292607 that was not meant to be there Pointyhat: me Modified: head/usr.sbin/cron/cron/do_command.c Modified: head/usr.sbin/cron/cron/do_command.c ============================================================================== --- head/usr.sbin/cron/cron/do_command.c Tue Dec 22 15:32:45 2015 (r292607) +++ head/usr.sbin/cron/cron/do_command.c Tue Dec 22 15:42:53 2015 (r292608) @@ -114,7 +114,7 @@ child_process(e, u) struct pam_conv pamc = { .conv = openpam_nullconv, .appdata_ptr = NULL - } + }; Debug(DPROC, ("[%d] checking account with PAM\n", getpid())) From owner-svn-src-all@freebsd.org Tue Dec 22 15:59:42 2015 Return-Path: Delivered-To: svn-src-all@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 B7293A4F1E4; Tue, 22 Dec 2015 15:59:42 +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 8A6AB1D44; Tue, 22 Dec 2015 15:59:42 +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 tBMFxfgN061756; Tue, 22 Dec 2015 15:59:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMFxfAW061753; Tue, 22 Dec 2015 15:59:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512221559.tBMFxfAW061753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 22 Dec 2015 15:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292609 - in head/sys/mips: include mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 15:59:42 -0000 Author: adrian Date: Tue Dec 22 15:59:41 2015 New Revision: 292609 URL: https://svnweb.freebsd.org/changeset/base/292609 Log: [mips] Add TLB pagemask probing code, and print out the allowable page sizes. This is from Stacey's work on larger kernel stack sizes for MIPS. Thanks! Submitted by: sson Modified: head/sys/mips/include/cpuinfo.h head/sys/mips/include/pte.h head/sys/mips/mips/cpu.c Modified: head/sys/mips/include/cpuinfo.h ============================================================================== --- head/sys/mips/include/cpuinfo.h Tue Dec 22 15:42:53 2015 (r292608) +++ head/sys/mips/include/cpuinfo.h Tue Dec 22 15:59:41 2015 (r292609) @@ -54,6 +54,7 @@ struct mips_cpuinfo { u_int8_t cpu_rev; u_int8_t cpu_impl; u_int8_t tlb_type; + u_int32_t tlb_pgmask; u_int16_t tlb_nentries; u_int8_t icache_virtual; boolean_t cache_coherent_dma; Modified: head/sys/mips/include/pte.h ============================================================================== --- head/sys/mips/include/pte.h Tue Dec 22 15:42:53 2015 (r292608) +++ head/sys/mips/include/pte.h Tue Dec 22 15:59:41 2015 (r292609) @@ -188,4 +188,17 @@ typedef pt_entry_t *pd_entry_t; #endif #endif /* LOCORE */ + +/* PageMask Register (CP0 Register 5, Select 0) Values */ +#define MIPS3_PGMASK_MASKX 0x00001800 +#define MIPS3_PGMASK_4K 0x00000000 +#define MIPS3_PGMASK_16K 0x00006000 +#define MIPS3_PGMASK_64K 0x0001e000 +#define MIPS3_PGMASK_256K 0x0007e000 +#define MIPS3_PGMASK_1M 0x001fe000 +#define MIPS3_PGMASK_4M 0x007fe000 +#define MIPS3_PGMASK_16M 0x01ffe000 +#define MIPS3_PGMASK_64M 0x07ffe000 +#define MIPS3_PGMASK_256M 0x1fffe000 + #endif /* !_MACHINE_PTE_H_ */ Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Tue Dec 22 15:42:53 2015 (r292608) +++ head/sys/mips/mips/cpu.c Tue Dec 22 15:59:41 2015 (r292609) @@ -190,6 +190,14 @@ mips_get_identity(struct mips_cpuinfo *c cpuinfo->l1.dc_size = cpuinfo->l1.dc_linesize * cpuinfo->l1.dc_nsets * cpuinfo->l1.dc_nways; + /* + * Probe PageMask register to see what sizes of pages are supported + * by writing all one's and then reading it back. + */ + mips_wr_pagemask(~0); + cpuinfo->tlb_pgmask = mips_rd_pagemask(); + mips_wr_pagemask(MIPS3_PGMASK_4K); + #ifndef CPU_CNMIPS /* L2 cache */ if (!(cfg1 & MIPS_CONFIG_CM)) { @@ -289,8 +297,31 @@ cpu_identify(void) } else if (cpuinfo.tlb_type == MIPS_MMU_FIXED) { printf("Fixed mapping"); } - printf(", %d entries\n", cpuinfo.tlb_nentries); + printf(", %d entries ", cpuinfo.tlb_nentries); + } + + if (cpuinfo.tlb_pgmask) { + printf("("); + if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_MASKX) + printf("1K "); + printf("4K "); + if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_16K) + printf("16K "); + if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_64K) + printf("64K "); + if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_256K) + printf("256K "); + if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_1M) + printf("1M "); + if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_16M) + printf("16M "); + if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_64M) + printf("64M "); + if (cpuinfo.tlb_pgmask & MIPS3_PGMASK_256M) + printf("256M "); + printf("pg sizes)"); } + printf("\n"); printf(" L1 i-cache: "); if (cpuinfo.l1.ic_linesize == 0) { From owner-svn-src-all@freebsd.org Tue Dec 22 17:01:31 2015 Return-Path: Delivered-To: svn-src-all@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 8195DA4E66F; Tue, 22 Dec 2015 17:01:31 +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 31B071CC0; Tue, 22 Dec 2015 17:01:31 +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 tBMH1UZG079857; Tue, 22 Dec 2015 17:01:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMH1URM079856; Tue, 22 Dec 2015 17:01:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512221701.tBMH1URM079856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 22 Dec 2015 17:01:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292610 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 17:01:31 -0000 Author: mav Date: Tue Dec 22 17:01:30 2015 New Revision: 292610 URL: https://svnweb.freebsd.org/changeset/base/292610 Log: Fix speed setting by NVRAM for 24xx and above chips. Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Tue Dec 22 15:59:41 2015 (r292609) +++ head/sys/dev/isp/isp.c Tue Dec 22 17:01:30 2015 (r292610) @@ -2142,19 +2142,41 @@ isp_fibre_init_2400(ispsoftc_t *isp) if ((icbp->icb_fwoptions3 & ICB2400_OPT3_RSPSZ_MASK) == 0) { icbp->icb_fwoptions3 |= ICB2400_OPT3_RSPSZ_24; } - icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_AUTO; if (isp->isp_confopts & ISP_CFG_1GB) { + icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_MASK; icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_1GB; } else if (isp->isp_confopts & ISP_CFG_2GB) { + icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_MASK; icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_2GB; } else if (isp->isp_confopts & ISP_CFG_4GB) { + icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_MASK; icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_4GB; } else if (isp->isp_confopts & ISP_CFG_8GB) { + icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_MASK; icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_8GB; } else if (isp->isp_confopts & ISP_CFG_16GB) { + icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_MASK; icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_16GB; } else { - icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_AUTO; + switch (icbp->icb_fwoptions3 & ICB2400_OPT3_RATE_MASK) { + case ICB2400_OPT3_RATE_4GB: + case ICB2400_OPT3_RATE_8GB: + case ICB2400_OPT3_RATE_16GB: + case ICB2400_OPT3_RATE_AUTO: + break; + case ICB2400_OPT3_RATE_2GB: + if (isp->isp_type <= ISP_HA_FC_2500) + break; + /*FALLTHROUGH*/ + case ICB2400_OPT3_RATE_1GB: + if (isp->isp_type <= ISP_HA_FC_2400) + break; + /*FALLTHROUGH*/ + default: + icbp->icb_fwoptions3 &= ~ICB2400_OPT3_RATE_MASK; + icbp->icb_fwoptions3 |= ICB2400_OPT3_RATE_AUTO; + break; + } } icbp->icb_logintime = ICB_LOGIN_TOV; @@ -7632,6 +7654,7 @@ isp_setdfltfcparm(ispsoftc_t *isp, int c fcp->isp_fwoptions |= ICB2400_OPT1_FULL_DUPLEX; } fcp->isp_fwoptions |= ICB2400_OPT1_BOTH_WWNS; + fcp->isp_zfwoptions |= ICB2400_OPT3_RATE_AUTO; } else { fcp->isp_fwoptions |= ICBOPT_FAIRNESS; fcp->isp_fwoptions |= ICBOPT_PDBCHANGE_AE; @@ -7644,6 +7667,7 @@ isp_setdfltfcparm(ispsoftc_t *isp, int c * extended options from NVRAM */ fcp->isp_fwoptions &= ~ICBOPT_EXTENDED; + fcp->isp_zfwoptions |= ICBZOPT_RATE_AUTO; } From owner-svn-src-all@freebsd.org Tue Dec 22 17:18:41 2015 Return-Path: Delivered-To: svn-src-all@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 6460DA4ED7C; Tue, 22 Dec 2015 17:18:41 +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 316A41EB7; Tue, 22 Dec 2015 17:18:41 +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 tBMHIeQi086532; Tue, 22 Dec 2015 17:18:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMHIeEN086531; Tue, 22 Dec 2015 17:18:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512221718.tBMHIeEN086531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 22 Dec 2015 17:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292611 - head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 17:18:41 -0000 Author: andrew Date: Tue Dec 22 17:18:40 2015 New Revision: 292611 URL: https://svnweb.freebsd.org/changeset/base/292611 Log: Don't adjust the program counter to an invalid address after reaching a breakpoint. The value doesn't need to be adjusted as it is already correctly returned from the kernel. This allows lldb to set breakpoints, and stop on them, however more work is needed, for example single stepping fails to stop. Discussed with: emaste Modified: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp Modified: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp Tue Dec 22 17:01:30 2015 (r292610) +++ head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp Tue Dec 22 17:18:40 2015 (r292611) @@ -260,13 +260,9 @@ RegisterContextPOSIXProcessMonitor_arm64 bool RegisterContextPOSIXProcessMonitor_arm64::UpdateAfterBreakpoint() { - // PC points one byte past the int3 responsible for the breakpoint. - lldb::addr_t pc; - - if ((pc = GetPC()) == LLDB_INVALID_ADDRESS) + if (GetPC() == LLDB_INVALID_ADDRESS) return false; - SetPC(pc - 1); return true; } From owner-svn-src-all@freebsd.org Tue Dec 22 17:46:15 2015 Return-Path: Delivered-To: svn-src-all@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 CA3BBA4F704; Tue, 22 Dec 2015 17:46:15 +0000 (UTC) (envelope-from rodrigc@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 9AE171088; Tue, 22 Dec 2015 17:46:15 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMHkEvk095245; Tue, 22 Dec 2015 17:46:14 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMHkE30095244; Tue, 22 Dec 2015 17:46:14 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201512221746.tBMHkE30095244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Tue, 22 Dec 2015 17:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292612 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 17:46:15 -0000 Author: rodrigc Date: Tue Dec 22 17:46:14 2015 New Revision: 292612 URL: https://svnweb.freebsd.org/changeset/base/292612 Log: Refer to creating Phabricator Herald notifications This will allow maintainers to be notified of any reviews or commits affecting parts of the tree which they maintain. Reviewed by: jhb, emaste, allanjude Differential Revision: https://reviews.freebsd.org/D4623 Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Dec 22 17:18:40 2015 (r292611) +++ head/MAINTAINERS Tue Dec 22 17:46:14 2015 (r292612) @@ -24,6 +24,15 @@ maintainer of a sub-system is to check r sub-system. *** +*** +Maintainers are encouraged to visit: + https://reviews.freebsd.org/herald + +and configure notifications for parts of the tree which they maintain. +Notifications can automatically be sent when someone proposes a revision or +makes a commit to the specified subtree. +*** + subsystem login notes ----------------------------- atf freebsd-testing,jmmv,ngie Pre-commit review requested. From owner-svn-src-all@freebsd.org Tue Dec 22 18:12:13 2015 Return-Path: Delivered-To: svn-src-all@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 B140CA4FE76; Tue, 22 Dec 2015 18:12:13 +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 7E0DD1CC4; Tue, 22 Dec 2015 18:12:13 +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 tBMICCYl003185; Tue, 22 Dec 2015 18:12:12 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMICCPZ003177; Tue, 22 Dec 2015 18:12:12 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201512221812.tBMICCPZ003177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 22 Dec 2015 18:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292613 - in head: include lib/libc/stdlib lib/libc/tests/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 18:12:13 -0000 Author: ed Date: Tue Dec 22 18:12:11 2015 New Revision: 292613 URL: https://svnweb.freebsd.org/changeset/base/292613 Log: Let tsearch()/tdelete() use an AVL tree. The existing implementations of POSIX tsearch() and tdelete() don't attempt to perform any balancing at all. Testing reveals that inserting 100k nodes into a tree sequentially takes approximately one minute on my system. Though most other BSDs also don't use any balanced tree internally, C libraries like glibc and musl do provide better implementations. glibc uses a red-black tree and musl uses an AVL tree. Red-black trees have the advantage over AVL trees that they only require O(1) rotations after insertion and deletion, but have the disadvantage that the tree has a maximum depth of 2*log2(n) instead of 1.44*log2(n). My take is that it's better to focus on having a lower maximum depth, for the reason that in the case of tsearch() the invocation of the comparator likely dominates the running time. This change replaces the tsearch() and tdelete() functions by versions that create an AVL tree. Compared to musl's implementation, this version is different in two different ways: - We don't keep track of heights; just balances. This is sufficient. This has the advantage that it reduces the number of nodes that are being accessed. Storing heights requires us to also access all of the siblings along the path. - Don't use any recursion at all. We know that the tree cannot 2^64 elements in size, so the height of the tree can never be larger than 96. Use a 128-bit bitmask to keep track of the path that is computed. This allows us to iterate over the same path twice, meaning we can apply rotations from top to bottom. Inserting 100k nodes into a tree now only takes 0.015 seconds. Insertion seems to be twice as fast as glibc, whereas deletion has about the same performance. Unlike glibc, it uses a fixed amount of memory. I also experimented with both recursive and iterative bottom-up implementations of the same algorithm. This iterative top-down version performs similar to the recursive bottom-up version in terms of speed and code size. For some reason, the iterative bottom-up algorithm was actually 30% faster for deletion, but has a quadratic memory complexity to keep track of all the parent pointers. Reviewed by: jilles Obtained from: https://github.com/NuxiNL/cloudlibc Differential Revision: https://reviews.freebsd.org/D4412 Added: head/lib/libc/stdlib/tsearch_path.h (contents, props changed) head/lib/libc/tests/stdlib/tsearch_test.c (contents, props changed) Modified: head/include/search.h head/lib/libc/stdlib/tdelete.c head/lib/libc/stdlib/tsearch.3 head/lib/libc/stdlib/tsearch.c head/lib/libc/tests/stdlib/Makefile Modified: head/include/search.h ============================================================================== --- head/include/search.h Tue Dec 22 17:46:14 2015 (r292612) +++ head/include/search.h Tue Dec 22 18:12:11 2015 (r292613) @@ -35,8 +35,9 @@ typedef enum { #ifdef _SEARCH_PRIVATE typedef struct node { - char *key; + void *key; struct node *llink, *rlink; + signed char balance; } node_t; struct que_elem { Modified: head/lib/libc/stdlib/tdelete.c ============================================================================== --- head/lib/libc/stdlib/tdelete.c Tue Dec 22 17:46:14 2015 (r292612) +++ head/lib/libc/stdlib/tdelete.c Tue Dec 22 18:12:11 2015 (r292613) @@ -1,72 +1,213 @@ -/* $NetBSD: tdelete.c,v 1.2 1999/09/16 11:45:37 lukem Exp $ */ - -/* - * Tree search generalized from Knuth (6.2.2) Algorithm T just like - * the AT&T man page says. - * - * The node_t structure is for internal use only, lint doesn't grok it. +/*- + * Copyright (c) 2015 Nuxi, https://nuxi.nl/ * - * Written by reading the System V Interface Definition, not the code. + * 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. * - * Totally public domain. + * 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 -#if 0 -#if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: tdelete.c,v 1.6 2012/06/25 22:32:45 abs Exp $"); -#endif /* LIBC_SCCS and not lint */ -#endif __FBSDID("$FreeBSD$"); -#define _SEARCH_PRIVATE +#define _SEARCH_PRIVATE #include +#include #include +#include "tsearch_path.h" /* - * find a node with given key - * - * vkey: key to be found - * vrootp: address of the root of the tree - * compar: function to carry out node comparisons - */ + * Makes a step to the left along the binary search tree. This step is + * also saved, so it can be replayed while rebalancing. +*/ +#define GO_LEFT() do { \ + if ((*leaf)->balance == 0 || \ + ((*leaf)->balance < 0 && (*leaf)->rlink->balance == 0)) { \ + /* \ + * If we reach a node that is balanced, or has a child \ + * in the opposite direction that is balanced, we know \ + * that we won't need to perform any rotations above \ + * this point. In this case rotations are always \ + * capable of keeping the subtree in balance. Make \ + * this the base node and reset the path. \ + */ \ + base = leaf; \ + path_init(&path); \ + } \ + path_taking_left(&path); \ + leaf = &(*leaf)->llink; \ +} while (0) + +/* Makes a step to the right along the binary search tree. */ +#define GO_RIGHT() do { \ + if ((*leaf)->balance == 0 || \ + ((*leaf)->balance > 0 && (*leaf)->llink->balance == 0)) { \ + base = leaf; \ + path_init(&path); \ + } \ + result = &(*leaf)->key; \ + path_taking_right(&path); \ + leaf = &(*leaf)->rlink; \ +} while (0) + void * -tdelete(const void * __restrict vkey, void ** __restrict vrootp, +tdelete(const void *restrict key, void **restrict rootp, int (*compar)(const void *, const void *)) { - node_t **rootp = (node_t **)vrootp; - node_t *p, *q, *r; + struct path path; + node_t *root, **base, **leaf, *old, **n, *x, *y, *z; + void *result; int cmp; - if (rootp == NULL || (p = *rootp) == NULL) - return NULL; + /* POSIX requires that tdelete() returns NULL if rootp is NULL. */ + if (rootp == NULL) + return (NULL); + root = *rootp; + + /* + * Find the leaf that needs to be removed. Return if we cannot + * find an existing entry. Keep track of the path that is taken + * to get to the node, as we will need it to adjust the + * balances. + */ + result = (void *)1; + path_init(&path); + base = &root; + leaf = &root; + for (;;) { + if (*leaf == NULL) + return (NULL); + cmp = compar(key, (*leaf)->key); + if (cmp < 0) { + result = &(*leaf)->key; + GO_LEFT(); + } else if (cmp > 0) { + result = &(*leaf)->key; + GO_RIGHT(); + } else { + break; + } + } - while ((cmp = (*compar)(vkey, (*rootp)->key)) != 0) { - p = *rootp; - rootp = (cmp < 0) ? - &(*rootp)->llink : /* follow llink branch */ - &(*rootp)->rlink; /* follow rlink branch */ - if (*rootp == NULL) - return NULL; /* key not found */ + /* Found a matching key in the tree. Remove the node. */ + if ((*leaf)->llink == NULL) { + /* Node has no left children. Replace by its right subtree. */ + old = *leaf; + *leaf = old->rlink; + free(old); + } else { + /* + * Node has left children. Replace this node's key by + * its predecessor's and remove that node instead. + */ + void **keyp = &(*leaf)->key; + GO_LEFT(); + while ((*leaf)->rlink != NULL) + GO_RIGHT(); + old = *leaf; + *keyp = old->key; + *leaf = old->llink; + free(old); } - r = (*rootp)->rlink; /* D1: */ - if ((q = (*rootp)->llink) == NULL) /* Left NULL? */ - q = r; - else if (r != NULL) { /* Right link is NULL? */ - if (r->llink == NULL) { /* D2: Find successor */ - r->llink = q; - q = r; - } else { /* D3: Find NULL link */ - for (q = r->llink; q->llink != NULL; q = r->llink) - r = q; - r->llink = q->rlink; - q->llink = (*rootp)->llink; - q->rlink = (*rootp)->rlink; + + /* + * Walk along the same path a second time and adjust the + * balances. Though this code looks similar to the rebalancing + * performed in tsearch(), it is not identical. We now also need + * to consider the case of outward imbalance in the right-right + * and left-left case that only exists when deleting. Hence the + * duplication of code. + */ + for (n = base; n != leaf;) { + if (path_took_left(&path)) { + x = *n; + if (x->balance < 0) { + y = x->rlink; + if (y->balance > 0) { + /* Right-left case. */ + z = y->llink; + x->rlink = z->llink; + z->llink = x; + y->llink = z->rlink; + z->rlink = y; + *n = z; + + x->balance = z->balance < 0 ? 1 : 0; + y->balance = z->balance > 0 ? -1 : 0; + z->balance = 0; + } else { + /* Right-right case. */ + x->rlink = y->llink; + y->llink = x; + *n = y; + + if (y->balance < 0) { + x->balance = 0; + y->balance = 0; + } else { + x->balance = -1; + y->balance = 1; + } + } + } else { + --x->balance; + } + n = &x->llink; + } else { + x = *n; + if (x->balance > 0) { + y = x->llink; + if (y->balance < 0) { + /* Left-right case. */ + z = y->rlink; + y->rlink = z->llink; + z->llink = y; + x->llink = z->rlink; + z->rlink = x; + *n = z; + + x->balance = z->balance > 0 ? -1 : 0; + y->balance = z->balance < 0 ? 1 : 0; + z->balance = 0; + } else { + /* Left-left case. */ + x->llink = y->rlink; + y->rlink = x; + *n = y; + + if (y->balance > 0) { + x->balance = 0; + y->balance = 0; + } else { + x->balance = 1; + y->balance = -1; + } + } + } else { + ++x->balance; + } + n = &x->rlink; } } - if (p != *rootp) - free(*rootp); /* D4: Free node */ - *rootp = q; /* link parent to new node */ - return p; + + /* Return the parent of the old entry. */ + *rootp = root; + return (result); } Modified: head/lib/libc/stdlib/tsearch.3 ============================================================================== --- head/lib/libc/stdlib/tsearch.3 Tue Dec 22 17:46:14 2015 (r292612) +++ head/lib/libc/stdlib/tsearch.3 Tue Dec 22 18:12:11 2015 (r292613) @@ -27,7 +27,7 @@ .\" OpenBSD: tsearch.3,v 1.2 1998/06/21 22:13:49 millert Exp .\" $FreeBSD$ .\" -.Dd June 15, 1997 +.Dd December 6, 2015 .Dt TSEARCH 3 .Os .Sh NAME @@ -50,8 +50,12 @@ The .Fn tsearch , and .Fn twalk -functions manage binary search trees based on algorithms T and D -from Knuth (6.2.2). +functions manage binary search trees. +This implementation uses a balanced AVL tree, +which due to its strong theoretical limit on the height of the tree has +the advantage of calling the comparison function relatively +infrequently. +.Pp The comparison function passed in by the user has the same style of return values as .Xr strcmp 3 . Modified: head/lib/libc/stdlib/tsearch.c ============================================================================== --- head/lib/libc/stdlib/tsearch.c Tue Dec 22 17:46:14 2015 (r292612) +++ head/lib/libc/stdlib/tsearch.c Tue Dec 22 18:12:11 2015 (r292613) @@ -1,55 +1,200 @@ -/* $NetBSD: tsearch.c,v 1.7 2012/06/25 22:32:45 abs Exp $ */ - -/* - * Tree search generalized from Knuth (6.2.2) Algorithm T just like - * the AT&T man page says. - * - * The node_t structure is for internal use only, lint doesn't grok it. +/*- + * Copyright (c) 2015 Nuxi, https://nuxi.nl/ * - * Written by reading the System V Interface Definition, not the code. + * 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. * - * Totally public domain. + * 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 -#if 0 -#if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: tsearch.c,v 1.7 2012/06/25 22:32:45 abs Exp $"); -#endif /* LIBC_SCCS and not lint */ -#endif __FBSDID("$FreeBSD$"); -#define _SEARCH_PRIVATE +#define _SEARCH_PRIVATE #include #include -/* find or insert datum into search tree */ +#include "tsearch_path.h" + void * -tsearch(const void *vkey, void **vrootp, +tsearch(const void *key, void **rootp, int (*compar)(const void *, const void *)) { - node_t *q; - node_t **rootp = (node_t **)vrootp; + struct path path; + node_t *root, **base, **leaf, *result, *n, *x, *y, *z; + int cmp; + /* POSIX requires that tsearch() returns NULL if rootp is NULL. */ if (rootp == NULL) - return NULL; + return (NULL); + root = *rootp; - while (*rootp != NULL) { /* Knuth's T1: */ - int r; - - if ((r = (*compar)(vkey, (*rootp)->key)) == 0) /* T2: */ - return *rootp; /* we found it! */ + /* + * Find the leaf where the new key needs to be inserted. Return + * if we've found an existing entry. Keep track of the path that + * is taken to get to the node, as we will need it to adjust the + * balances. + */ + path_init(&path); + base = &root; + leaf = &root; + while (*leaf != NULL) { + if ((*leaf)->balance != 0) { + /* + * If we reach a node that has a non-zero + * balance on the way, we know that we won't + * need to perform any rotations above this + * point. In this case rotations are always + * capable of keeping the subtree in balance. + * Make this the base node and reset the path. + */ + base = leaf; + path_init(&path); + } + cmp = compar(key, (*leaf)->key); + if (cmp < 0) { + path_taking_left(&path); + leaf = &(*leaf)->llink; + } else if (cmp > 0) { + path_taking_right(&path); + leaf = &(*leaf)->rlink; + } else { + return (&(*leaf)->key); + } + } - rootp = (r < 0) ? - &(*rootp)->llink : /* T3: follow left branch */ - &(*rootp)->rlink; /* T4: follow right branch */ + /* Did not find a matching key in the tree. Insert a new node. */ + result = *leaf = malloc(sizeof(**leaf)); + if (result == NULL) + return (NULL); + result->key = (void *)key; + result->llink = NULL; + result->rlink = NULL; + result->balance = 0; + + /* + * Walk along the same path a second time and adjust the + * balances. Except for the first node, all of these nodes must + * have a balance of zero, meaning that these nodes will not get + * out of balance. + */ + for (n = *base; n != *leaf;) { + if (path_took_left(&path)) { + n->balance += 1; + n = n->llink; + } else { + n->balance -= 1; + n = n->rlink; + } } - q = malloc(sizeof(node_t)); /* T5: key not found */ - if (q != 0) { /* make new node */ - *rootp = q; /* link new node to old */ - q->key = __DECONST(void *, vkey);/* initialize new node */ - q->llink = q->rlink = NULL; + /* + * Adjusting the balances may have pushed the balance of the + * base node out of range. Perform a rotation to bring the + * balance back in range. + */ + x = *base; + if (x->balance > 1) { + y = x->llink; + if (y->balance < 0) { + /* + * Left-right case. + * + * x + * / \ z + * y D / \ + * / \ --> y x + * A z /| |\ + * / \ A B C D + * B C + */ + z = y->rlink; + y->rlink = z->llink; + z->llink = y; + x->llink = z->rlink; + z->rlink = x; + *base = z; + + x->balance = z->balance > 0 ? -1 : 0; + y->balance = z->balance < 0 ? 1 : 0; + z->balance = 0; + } else { + /* + * Left-left case. + * + * x y + * / \ / \ + * y C --> A x + * / \ / \ + * A B B C + */ + x->llink = y->rlink; + y->rlink = x; + *base = y; + + x->balance = 0; + y->balance = 0; + } + } else if (x->balance < -1) { + y = x->rlink; + if (y->balance > 0) { + /* + * Right-left case. + * + * x + * / \ z + * A y / \ + * / \ --> x y + * z D /| |\ + * / \ A B C D + * B C + */ + node_t *z = y->llink; + x->rlink = z->llink; + z->llink = x; + y->llink = z->rlink; + z->rlink = y; + *base = z; + + x->balance = z->balance < 0 ? 1 : 0; + y->balance = z->balance > 0 ? -1 : 0; + z->balance = 0; + } else { + /* + * Right-right case. + * + * x y + * / \ / \ + * A y --> x C + * / \ / \ + * B C A B + */ + x->rlink = y->llink; + y->llink = x; + *base = y; + + x->balance = 0; + y->balance = 0; + } } - return q; + + /* Return the new entry. */ + *rootp = root; + return (&result->key); } Added: head/lib/libc/stdlib/tsearch_path.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdlib/tsearch_path.h Tue Dec 22 18:12:11 2015 (r292613) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2015 Nuxi, https://nuxi.nl/ + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef TSEARCH_PATH_H +#define TSEARCH_PATH_H + +#include +#include +#include + +/* + * Bookkeeping for storing a path in a balanced binary search tree from + * the root to a leaf node. + * + * For an AVL tree we know that its maximum height of a tree is bounded + * by approximately 1.44 * log2(n) - 0.328. Given that the number of + * entries of the tree is constrained by the size of the address space, + * two uintptr_t's provide sufficient space to store the path from the + * root to any leaf. + */ +struct path { + uintptr_t steps[2]; + unsigned int nsteps; +}; + +/* Initializes the path structure with a zero-length path. */ +static inline void +path_init(struct path *p) +{ + + p->nsteps = 0; +} + +#define STEPS_BIT (sizeof(uintptr_t) * CHAR_BIT) + +/* Pushes a step to the left to the end of the path. */ +static inline void +path_taking_left(struct path *p) +{ + + p->steps[p->nsteps / STEPS_BIT] |= + (uintptr_t)1 << (p->nsteps % STEPS_BIT); + ++p->nsteps; +} + +/* Pushes a step to the right to the end of the path. */ +static inline void +path_taking_right(struct path *p) +{ + + p->steps[p->nsteps / STEPS_BIT] &= + ~((uintptr_t)1 << (p->nsteps % STEPS_BIT)); + ++p->nsteps; +} + +/* + * Pops the first step from the path and returns whether it was a step + * to the left. + */ +static inline bool +path_took_left(struct path *p) +{ + bool result; + + result = p->steps[0] & 0x1; + p->steps[0] = (p->steps[0] >> 1) | (p->steps[1] << (STEPS_BIT - 1)); + p->steps[1] >>= 1; + return (result); +} + +#undef STEPS_BIT + +#endif Modified: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- head/lib/libc/tests/stdlib/Makefile Tue Dec 22 17:46:14 2015 (r292612) +++ head/lib/libc/tests/stdlib/Makefile Tue Dec 22 18:12:11 2015 (r292613) @@ -3,6 +3,7 @@ ATF_TESTS_C+= heapsort_test ATF_TESTS_C+= mergesort_test ATF_TESTS_C+= qsort_test +ATF_TESTS_C+= tsearch_test # TODO: t_getenv_thread, t_mi_vector_hash NETBSD_ATF_TESTS_C+= abs_test Added: head/lib/libc/tests/stdlib/tsearch_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/stdlib/tsearch_test.c Tue Dec 22 18:12:11 2015 (r292613) @@ -0,0 +1,131 @@ +/*- + * Copyright (c) 2015 Nuxi, https://nuxi.nl/ + * + * 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 +#define _SEARCH_PRIVATE +#include +#include +#include + +/* Validates the integrity of an AVL tree. */ +static inline unsigned int +tnode_assert(const node_t *n) +{ + unsigned int height_left, height_right; + int balance; + + if (n == NULL) + return 0; + height_left = tnode_assert(n->llink); + height_right = tnode_assert(n->rlink); + balance = (int)height_left - (int)height_right; + ATF_CHECK(balance >= -1); + ATF_CHECK(balance <= 1); + ATF_CHECK_EQ(balance, n->balance); + return (height_left > height_right ? height_left : height_right) + 1; +} + +static int +compar(const void *a, const void *b) +{ + + return *(int *)a - *(int *)b; +} + +ATF_TC_WITHOUT_HEAD(tsearch_test); +ATF_TC_BODY(tsearch_test, tc) +{ + /* + * Run the test below in a deterministic fashion to prevent this + * test from potentially flapping. We assume that this provides + * enough coverage. + */ +#if 0 + unsigned short random_state[3]; + arc4random_buf(random_state, sizeof(random_state)); +#else + unsigned short random_state[3] = { 26554, 13330, 3246 }; +#endif + +#define NKEYS 1000 + /* Create 1000 possible keys. */ + int keys[NKEYS]; + for (int i = 0; i < NKEYS; ++i) + keys[i] = i; + + /* Apply random operations on a binary tree and check the results. */ + void *root = NULL; + bool present[NKEYS] = {}; + for (int i = 0; i < NKEYS * 10; ++i) { + int key = nrand48(random_state) % NKEYS; + switch (nrand48(random_state) % 3) { + case 0: /* tdelete(). */ + if (present[key]) { + ATF_CHECK(tdelete(&key, &root, compar) != NULL); + present[key] = false; + } else { + ATF_CHECK_EQ(NULL, + tdelete(&key, &root, compar)); + } + break; + case 1: /* tfind(). */ + if (present[key]) { + ATF_CHECK_EQ(&keys[key], + *(int **)tfind(&key, &root, compar)); + } else { + ATF_CHECK_EQ(NULL, tfind(&key, &root, compar)); + } + break; + case 2: /* tsearch(). */ + if (present[key]) { + ATF_CHECK_EQ(&keys[key], + *(int **)tsearch(&key, &root, compar)); + } else { + ATF_CHECK_EQ(&keys[key], *(int **)tsearch( + &keys[key], &root, compar)); + present[key] = true; + } + break; + } + tnode_assert(root); + } + + /* Remove all entries from the tree. */ + for (int key = 0; key < NKEYS; ++key) + if (present[key]) + ATF_CHECK(tdelete(&key, &root, compar) != NULL); + ATF_CHECK_EQ(NULL, root); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, tsearch_test); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Tue Dec 22 18:39:08 2015 Return-Path: Delivered-To: svn-src-all@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 DFA7AA4F621; Tue, 22 Dec 2015 18:39:08 +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 B05121898; Tue, 22 Dec 2015 18:39:08 +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 tBMId7Na009813; Tue, 22 Dec 2015 18:39:07 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMId7fF009811; Tue, 22 Dec 2015 18:39:07 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201512221839.tBMId7fF009811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 22 Dec 2015 18:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292614 - stable/10/sys/dev/if_ndis X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 18:39:09 -0000 Author: glebius Date: Tue Dec 22 18:39:07 2015 New Revision: 292614 URL: https://svnweb.freebsd.org/changeset/base/292614 Log: Merge r292411: Fix regression in if_ndis in r280347. Modified: stable/10/sys/dev/if_ndis/if_ndis_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/if_ndis/if_ndis_pci.c ============================================================================== --- stable/10/sys/dev/if_ndis/if_ndis_pci.c Tue Dec 22 18:12:11 2015 (r292613) +++ stable/10/sys/dev/if_ndis/if_ndis_pci.c Tue Dec 22 18:39:07 2015 (r292614) @@ -295,8 +295,7 @@ ndis_attach_pci(dev) BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ - NDIS_NSEG_NEW, /* nsegments */ + DFLTPHYS, NDIS_NSEG_NEW,/* maxsize, nsegments */ BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ BUS_DMA_ALLOCNOW, /* flags */ NULL, NULL, /* lockfunc, lockarg */ From owner-svn-src-all@freebsd.org Tue Dec 22 19:34:22 2015 Return-Path: Delivered-To: svn-src-all@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 AF346A4F4E3; Tue, 22 Dec 2015 19:34:22 +0000 (UTC) (envelope-from davidcs@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 674851604; Tue, 22 Dec 2015 19:34:22 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMJYLY8027241; Tue, 22 Dec 2015 19:34:21 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMJYL6G027238; Tue, 22 Dec 2015 19:34:21 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201512221934.tBMJYL6G027238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 22 Dec 2015 19:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292615 - stable/10/sys/dev/qlxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 19:34:22 -0000 Author: davidcs Date: Tue Dec 22 19:34:21 2015 New Revision: 292615 URL: https://svnweb.freebsd.org/changeset/base/292615 Log: MFC r289635 ql_hw.c: fixed error code INJCT_HEARTBEAT_FAILURE ql_os.c: removed unnecessary debug printf ql_ver.h: updated version number Modified: stable/10/sys/dev/qlxgbe/ql_hw.c stable/10/sys/dev/qlxgbe/ql_os.c stable/10/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_hw.c Tue Dec 22 18:39:07 2015 (r292614) +++ stable/10/sys/dev/qlxgbe/ql_hw.c Tue Dec 22 19:34:21 2015 (r292615) @@ -387,6 +387,7 @@ ql_hw_add_sysctls(qla_host_t *ha) "Minidump Utility can start minidump process"); #ifdef QL_DBG + ha->err_inject = 0; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "err_inject", @@ -3057,7 +3058,7 @@ ql_hw_check_health(qla_host_t *ha) val = READ_REG32(ha, Q8_FIRMWARE_HEARTBEAT); if ((val != ha->hw.hbeat_value) && - (!(QL_ERR_INJECT(ha, INJCT_TEMPERATURE_FAILURE)))) { + (!(QL_ERR_INJECT(ha, INJCT_HEARTBEAT_FAILURE)))) { ha->hw.hbeat_value = val; return 0; } Modified: stable/10/sys/dev/qlxgbe/ql_os.c ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_os.c Tue Dec 22 18:39:07 2015 (r292614) +++ stable/10/sys/dev/qlxgbe/ql_os.c Tue Dec 22 19:34:21 2015 (r292615) @@ -289,8 +289,6 @@ qla_pci_attach(device_t dev) int i; uint32_t num_rcvq = 0; - QL_DPRINT2(ha, (dev, "%s: enter\n", __func__)); - if ((ha = device_get_softc(dev)) == NULL) { device_printf(dev, "cannot get softc\n"); return (ENOMEM); Modified: stable/10/sys/dev/qlxgbe/ql_ver.h ============================================================================== --- stable/10/sys/dev/qlxgbe/ql_ver.h Tue Dec 22 18:39:07 2015 (r292614) +++ stable/10/sys/dev/qlxgbe/ql_ver.h Tue Dec 22 19:34:21 2015 (r292615) @@ -36,6 +36,6 @@ #define QLA_VERSION_MAJOR 3 #define QLA_VERSION_MINOR 10 -#define QLA_VERSION_BUILD 24 +#define QLA_VERSION_BUILD 25 #endif /* #ifndef _QL_VER_H_ */ From owner-svn-src-all@freebsd.org Tue Dec 22 19:40:35 2015 Return-Path: Delivered-To: svn-src-all@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 8BAFDA4F75E; Tue, 22 Dec 2015 19:40:35 +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 4AE8D1A8B; Tue, 22 Dec 2015 19:40:35 +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 tBMJeYUO027501; Tue, 22 Dec 2015 19:40:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMJeYo0027500; Tue, 22 Dec 2015 19:40:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512221940.tBMJeYo0027500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 22 Dec 2015 19:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292616 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 19:40:35 -0000 Author: imp Date: Tue Dec 22 19:40:34 2015 New Revision: 292616 URL: https://svnweb.freebsd.org/changeset/base/292616 Log: Delete the DOS dir to mirror what we do with NANO_WORLDDIR. Copy ubldr and ubldr.bin to the dos partition when we're making it. Minor style fixes. Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Tue Dec 22 19:34:21 2015 (r292615) +++ head/tools/tools/nanobsd/embedded/common Tue Dec 22 19:40:34 2015 (r292616) @@ -106,18 +106,16 @@ NANO_FAT_DIR=${NANO_OBJ}/_.fat customize_cmd cust_allow_ssh_root -add_etc_make_conf() -{ +add_etc_make_conf ( ) ( touch ${NANO_WORLDDIR}/etc/make.conf -} +) customize_cmd add_etc_make_conf -cust_install_machine_files() -{ +cust_install_machine_files ( ) ( echo "cd ${NANO_CFG_BASE}/Files" cd ${NANO_CFG_BASE}/Files find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -dumpv ${NANO_WORLDDIR} -} +) customize_cmd cust_install_files customize_cmd cust_install_machine_files @@ -181,8 +179,7 @@ WITHOUT_RCS=true NANO_PACKAGE_ONLY=1 # install a package from a pre-built binary -do_add_pkg () -{ +do_add_pkg ( ) ( # Need to create ${NANO_OBJ}/ports in this add_pkg_${port} function set -x mkdir -p ${NANO_OBJ}/ports/distfiles @@ -200,11 +197,10 @@ do_add_pkg () rmdir ${NANO_WORLDDIR}/usr/ports/distfiles rmdir ${NANO_WORLDDIR}/usr/ports set +x -} +) # Build a port (with the side effect of creating a package) -do_add_port () -{ +do_add_port ( ) ( local port_path port_path=$1 shift @@ -245,11 +241,12 @@ do_add_port () umount ${NANO_WORLDDIR}/usr/ports umount ${NANO_WORLDDIR}/usr/src set +x -} +) # Need to check if this function works with cross-compiling architecture!!!! # Recursive complex fonction: Generate one function for each ports -add_port () { +# writes shell functions called later, so don't do in subshell. +add_port ( ) { local port_path=$1 local port=`echo $1 | sed -e 's/\//_/'` shift @@ -262,7 +259,7 @@ add_port () { if [ -f ${NANO_OBJ}/ports/packages/All/${PKG_NAME}.txz ]; then # Pkg file found: Generate add_pkg_NAME function eval " - add_pkg_${port} () { + add_pkg_${port} ( ) { do_add_pkg ${PKG_NAME} } customize_cmd add_pkg_${port} @@ -270,7 +267,7 @@ add_port () { else # No pkg file: Generate add_port_NAME function eval " - add_port_${port} () { + add_port_${port} ( ) { do_add_port ${port_path} $* } customize_cmd add_port_${port} @@ -329,7 +326,7 @@ create_diskimage_mbr ( ) ( if [ -z "${NANO_CFGDIR}" ]; then echo "Faking cfg dir, it's empty" NANO_CFGDIR=${NANO_OBJ}/_.empty - mkdir ${NANO_CFGDIR} + mkdir -p ${NANO_CFGDIR} fi # XXX -F cfg-mtree eval "${NANO_MAKEFS_UFS}" -s ${NANO_SLICE_CFG_SIZE} \ @@ -377,8 +374,7 @@ create_diskimage_mbr ( ) ( ) > ${NANO_OBJ}/_.di 2>&1 ) -die() -{ +die( ) { echo "$*" exit 1 } @@ -435,19 +431,17 @@ $var=$val" fi done -save_build ( ) -{ +save_build ( ) ( VERSION_FILE=${NANO_WORLDDIR}/etc/version if [ "${SVNREVISION}" = "${REVISION}" ]; then echo "${NANO_NAME}" > "${VERSION_FILE}" else echo "${NANO_NAME} (${SVNREVISION})" > "${VERSION_FILE}" fi -} +) customize_cmd save_build -shrink_md_fbsize ( ) -{ +shrink_md_fbsize ( ) ( # We have a lot of little files on our memory disks. Let's decrease # the block and frag size to fit more little files on them (this # halves our space requirement by ~50% on /etc and /var on 8.x -- @@ -455,17 +449,25 @@ shrink_md_fbsize ( ) # are 4 times larger). sed -i '' -e 's,-S -i 4096,-S -i 4096 -b 4096 -f 512,' \ ${NANO_WORLDDIR}/etc/rc.initdiskless -} +) customize_cmd shrink_md_fbsize customize_cmd cust_comconsole -dos_boot_part ( ) -( +dos_boot_part ( ) ( local d=/usr/local/share/u-boot/${NANO_BOOT_PKG} + # For now, just copy all the files. However, for iMX6 and Allwinner, + # we'll need to put a special boot block at a fixed location + # on the disk as well. + rm -rf ${NANO_FAT_DIR} mkdir ${NANO_FAT_DIR} - cp ${d}/* ${NANO_FAT_DIR} + cp ${d}/* ${NANO_FAT_DIR} + + # Also copy ubldr. u-boot will load it and it will load the kernel + # from the ufs partition + cp ${NANO_WORLDDIR}/boot/ubldr ${NANO_FAT_DIR} + cp ${NANO_WORLDDIR}/boot/ubldr.bin ${NANO_FAT_DIR} ) if [ -n "$NANO_BOOT_PKG" ]; then @@ -480,8 +482,7 @@ if [ -n "$NANO_BOOT_PKG" ]; then customize_cmd dos_boot_part fi -product_custom ( ) -( +product_custom ( ) ( # not quie ready to tweak these in nopriv build if [ -z ${NANO_NOPRIV_BUILD} ]; then # Last second tweaks -- generally not needed @@ -493,6 +494,12 @@ product_custom ( ) chown root:wheel ${NANO_WORLDDIR}/ chown root:wheel ${NANO_WORLDDIR}/usr fi + local rc=${NANO_WORLDDIR}/etc/rc.conf + echo "hostname=nanobsd-${NANO_NAME}" > $rc + echo "growfs_enable=YES" >> $rc + echo "growfs_type=nanobsd-pingpong" >> $rc + echo "ntpdate_enable=YES" >> $rc + echo "ntpdate_hosts=0.freebsd.pool.ntp.org 1.freebsd.pool.ntp.org" >> $rc ) late_customize_cmd product_custom @@ -504,7 +511,8 @@ late_customize_cmd product_custom # For each architecture, we have a standard set of settings to the extent # it makes sense. For architectures that don't have a standard environment # cfg files need to either define a lot of settings, provide their own disk -# imaging, or set which of the variants we support. +# imaging, or set which of the variants we support. No subshells, since we +# set global variables # std_aarch64 ( ) { From owner-svn-src-all@freebsd.org Tue Dec 22 19:41:42 2015 Return-Path: Delivered-To: svn-src-all@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 01415A4F89E; Tue, 22 Dec 2015 19:41:42 +0000 (UTC) (envelope-from davidcs@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 AEDCA1CC6; Tue, 22 Dec 2015 19:41:41 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMJfevi029512; Tue, 22 Dec 2015 19:41:40 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMJfe0S029509; Tue, 22 Dec 2015 19:41:40 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201512221941.tBMJfe0S029509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 22 Dec 2015 19:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292617 - stable/9/sys/dev/qlxgbe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 19:41:42 -0000 Author: davidcs Date: Tue Dec 22 19:41:40 2015 New Revision: 292617 URL: https://svnweb.freebsd.org/changeset/base/292617 Log: MFC r289635 ql_hw.c: fixed error code INJCT_HEARTBEAT_FAILURE ql_os.c: removed unnecessary debug printf ql_ver.h: updated version number Modified: stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_hw.c Tue Dec 22 19:40:34 2015 (r292616) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Tue Dec 22 19:41:40 2015 (r292617) @@ -387,6 +387,7 @@ ql_hw_add_sysctls(qla_host_t *ha) "Minidump Utility can start minidump process"); #ifdef QL_DBG + ha->err_inject = 0; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "err_inject", @@ -3057,7 +3058,7 @@ ql_hw_check_health(qla_host_t *ha) val = READ_REG32(ha, Q8_FIRMWARE_HEARTBEAT); if ((val != ha->hw.hbeat_value) && - (!(QL_ERR_INJECT(ha, INJCT_TEMPERATURE_FAILURE)))) { + (!(QL_ERR_INJECT(ha, INJCT_HEARTBEAT_FAILURE)))) { ha->hw.hbeat_value = val; return 0; } Modified: stable/9/sys/dev/qlxgbe/ql_os.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_os.c Tue Dec 22 19:40:34 2015 (r292616) +++ stable/9/sys/dev/qlxgbe/ql_os.c Tue Dec 22 19:41:40 2015 (r292617) @@ -289,8 +289,6 @@ qla_pci_attach(device_t dev) int i; uint32_t num_rcvq = 0; - QL_DPRINT2(ha, (dev, "%s: enter\n", __func__)); - if ((ha = device_get_softc(dev)) == NULL) { device_printf(dev, "cannot get softc\n"); return (ENOMEM); Modified: stable/9/sys/dev/qlxgbe/ql_ver.h ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_ver.h Tue Dec 22 19:40:34 2015 (r292616) +++ stable/9/sys/dev/qlxgbe/ql_ver.h Tue Dec 22 19:41:40 2015 (r292617) @@ -36,6 +36,6 @@ #define QLA_VERSION_MAJOR 3 #define QLA_VERSION_MINOR 10 -#define QLA_VERSION_BUILD 24 +#define QLA_VERSION_BUILD 25 #endif /* #ifndef _QL_VER_H_ */ From owner-svn-src-all@freebsd.org Tue Dec 22 20:08:33 2015 Return-Path: Delivered-To: svn-src-all@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 AD063A4E489; Tue, 22 Dec 2015 20:08: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 7CAF51ED7; Tue, 22 Dec 2015 20:08: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 tBMK8Wjg036260; Tue, 22 Dec 2015 20:08:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMK8WAC036259; Tue, 22 Dec 2015 20:08:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512222008.tBMK8WAC036259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Dec 2015 20:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292619 - head/sys/amd64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 20:08:33 -0000 Author: ngie Date: Tue Dec 22 20:08:32 2015 New Revision: 292619 URL: https://svnweb.freebsd.org/changeset/base/292619 Log: Remove redundant ctx_switch_xsave declaration in sys/amd64/include/md_var.h This variable was added to sys/x86/include/x86_var.h recently. This unbreaks building kernel source that #includes both md_var.h and x86_var.h with gcc 4.2.1 on amd64 Differential Revision: https://reviews.freebsd.org/D4686 Reviewed by: kib X-MFC with: r291949 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/amd64/include/md_var.h Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Tue Dec 22 20:03:49 2015 (r292618) +++ head/sys/amd64/include/md_var.h Tue Dec 22 20:08:32 2015 (r292619) @@ -34,7 +34,6 @@ #include -extern char ctx_switch_xsave[]; extern uint64_t *vm_page_dump; /* XXX */ From owner-svn-src-all@freebsd.org Tue Dec 22 20:12:54 2015 Return-Path: Delivered-To: svn-src-all@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 007BDA4E6C9; Tue, 22 Dec 2015 20:12:54 +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 C6ED612EA; Tue, 22 Dec 2015 20:12: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 tBMKCqVp039019; Tue, 22 Dec 2015 20:12:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMKCqqg039018; Tue, 22 Dec 2015 20:12:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512222012.tBMKCqqg039018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 22 Dec 2015 20:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292620 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 20:12:54 -0000 Author: kib Date: Tue Dec 22 20:12:52 2015 New Revision: 292620 URL: https://svnweb.freebsd.org/changeset/base/292620 Log: If we annoy user with the terminal output due to failed load of interpreter, also show the actual error code instead of some interpretation. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Tue Dec 22 20:08:32 2015 (r292619) +++ head/sys/kern/imgact_elf.c Tue Dec 22 20:12:52 2015 (r292620) @@ -1009,7 +1009,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i } vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); if (error != 0) { - uprintf("ELF interpreter %s not found\n", interp); + uprintf("ELF interpreter %s not found, error %d\n", + interp, error); goto ret; } } else From owner-svn-src-all@freebsd.org Tue Dec 22 20:22:18 2015 Return-Path: Delivered-To: svn-src-all@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 EAC1FA4EA56; Tue, 22 Dec 2015 20:22:18 +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 9EBDB1A24; Tue, 22 Dec 2015 20:22:18 +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 tBMKMHss041926; Tue, 22 Dec 2015 20:22:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMKMH80041925; Tue, 22 Dec 2015 20:22:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512222022.tBMKMH80041925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 22 Dec 2015 20:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292621 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 20:22:19 -0000 Author: kib Date: Tue Dec 22 20:22:17 2015 New Revision: 292621 URL: https://svnweb.freebsd.org/changeset/base/292621 Log: Keep devfs mount locked for the whole duration of the devfs_setattr(), and ensure that our dirent is instantiated. Reported and tested by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Tue Dec 22 20:12:52 2015 (r292620) +++ head/sys/fs/devfs/devfs_vnops.c Tue Dec 22 20:22:17 2015 (r292621) @@ -1560,11 +1560,15 @@ devfs_setattr(struct vop_setattr_args *a return (EINVAL); } + error = devfs_populate_vp(vp); + if (error != 0) + return (error); + de = vp->v_data; if (vp->v_type == VDIR) de = de->de_dir; - error = c = 0; + c = 0; if (vap->va_uid == (uid_t)VNOVAL) uid = de->de_uid; else @@ -1577,8 +1581,8 @@ devfs_setattr(struct vop_setattr_args *a if ((ap->a_cred->cr_uid != de->de_uid) || uid != de->de_uid || (gid != de->de_gid && !groupmember(gid, ap->a_cred))) { error = priv_check(td, PRIV_VFS_CHOWN); - if (error) - return (error); + if (error != 0) + goto ret; } de->de_uid = uid; de->de_gid = gid; @@ -1588,8 +1592,8 @@ devfs_setattr(struct vop_setattr_args *a if (vap->va_mode != (mode_t)VNOVAL) { if (ap->a_cred->cr_uid != de->de_uid) { error = priv_check(td, PRIV_VFS_ADMIN); - if (error) - return (error); + if (error != 0) + goto ret; } de->de_mode = vap->va_mode; c = 1; @@ -1598,7 +1602,7 @@ devfs_setattr(struct vop_setattr_args *a if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) { error = vn_utimes_perm(vp, vap, ap->a_cred, td); if (error != 0) - return (error); + goto ret; if (vap->va_atime.tv_sec != VNOVAL) { if (vp->v_type == VCHR) vp->v_rdev->si_atime = vap->va_atime; @@ -1620,7 +1624,10 @@ devfs_setattr(struct vop_setattr_args *a else vfs_timestamp(&de->de_mtime); } - return (0); + +ret: + sx_xunlock(&VFSTODEVFS(vp->v_mount)->dm_lock); + return (error); } #ifdef MAC From owner-svn-src-all@freebsd.org Tue Dec 22 20:33:51 2015 Return-Path: Delivered-To: svn-src-all@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 D2444A4EEB0; Tue, 22 Dec 2015 20:33:51 +0000 (UTC) (envelope-from jhb@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 902351F5D; Tue, 22 Dec 2015 20:33:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMKXoXW044931; Tue, 22 Dec 2015 20:33:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMKXndF044921; Tue, 22 Dec 2015 20:33:49 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512222033.tBMKXndF044921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 22 Dec 2015 20:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292622 - in head: lib/libsysdecode usr.bin/kdump usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 20:33:51 -0000 Author: jhb Date: Tue Dec 22 20:33:49 2015 New Revision: 292622 URL: https://svnweb.freebsd.org/changeset/base/292622 Log: Move the mkioctls script to libsysdecode and use it to generate a sysdecode_ioctlname() function. This function matches the behavior of the truss variant in that it returns a pointer to a string description for known ioctls. The caller is responsible for displaying unknown ioctl requests. For kdump this meant moving the logic to handle unknown ioctl requests out of the generated function and into an ioctlname() function in kdump.c instead. Differential Revision: https://reviews.freebsd.org/D4610 Added: head/lib/libsysdecode/mkioctls - copied, changed from r292620, head/usr.bin/kdump/mkioctls head/lib/libsysdecode/sysdecode_ioctlname.3 (contents, props changed) Deleted: head/usr.bin/kdump/mkioctls Modified: head/lib/libsysdecode/Makefile head/lib/libsysdecode/sysdecode.3 head/lib/libsysdecode/sysdecode.h head/usr.bin/kdump/Makefile head/usr.bin/kdump/kdump.c head/usr.bin/truss/Makefile head/usr.bin/truss/syscalls.c Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Tue Dec 22 20:22:17 2015 (r292621) +++ head/lib/libsysdecode/Makefile Tue Dec 22 20:33:49 2015 (r292622) @@ -4,10 +4,31 @@ LIB= sysdecode -SRCS= utrace.c +SRCS= ioctl.c utrace.c INCS= sysdecode.h MAN+= sysdecode.3 \ + sysdecode_ioctlname.3 \ sysdecode_utrace.3 +CLEANFILES= ioctl.c + +.if defined(COMPAT_32BIT) +CPP+= -m32 +.endif + +.if ${MK_PF} != "no" +CFLAGS+=-DPF +.endif + +# Workaround duplicate declarations in +CFLAGS.gcc.ioctl.c+= -Wno-redundant-decls +CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}} + +ioctl.c: mkioctls + env MACHINE=${MACHINE} CPP="${CPP}" \ + /bin/sh ${.CURDIR}/mkioctls ${DESTDIR}${INCLUDEDIR} > ${.TARGET} + +beforedepend: ioctl.c + .include Copied and modified: head/lib/libsysdecode/mkioctls (from r292620, head/usr.bin/kdump/mkioctls) ============================================================================== --- head/usr.bin/kdump/mkioctls Tue Dec 22 20:12:52 2015 (r292620, copy source) +++ head/lib/libsysdecode/mkioctls Tue Dec 22 20:33:49 2015 (r292622) @@ -1,19 +1,15 @@ #!/bin/sh # # $FreeBSD$ -# -# When editing this script, keep in mind that truss also uses it. -# set -e -if [ $# -ne 2 -o \( $1 != "print" -a $1 != "return" \) ]; then - echo "usage: sh $0 print|return include-dir" +if [ $# -ne 1 ]; then + echo "usage: sh $0 include-dir" exit 1 fi -style="$1" -includedir="$2" +includedir="$1" LC_ALL=C; export LC_ALL @@ -40,7 +36,7 @@ esac awk -v x="$ioctl_includes" 'BEGIN {print x}' | $CPP -nostdinc -I$includedir -dM -DCOMPAT_43TTY - | - awk -v ioctl_includes="$ioctl_includes" -v style="$style" ' + awk -v ioctl_includes="$ioctl_includes" ' BEGIN { print "/* XXX obnoxious prerequisites. */" print "#define COMPAT_43" @@ -68,20 +64,12 @@ BEGIN { print "#include " print "#include " print "#include " + print "#include " print "" print ioctl_includes print "" - if (style == "print") { - print "void ioctlname(unsigned long val, int decimal);" - print "" - print "void" - print "ioctlname(unsigned long val, int decimal)" - } else { - print "const char *ioctlname(unsigned long val);" - print "" - print "const char *" - print "ioctlname(unsigned long val)" - } + print "const char *" + print "sysdecode_ioctlname(unsigned long val)" print "{" print "\tconst char *str = NULL;" print "" @@ -103,16 +91,7 @@ BEGIN { } END { print "" - if (style == "print") { - print "\tif (str != NULL)" - print "\t\tprintf(\"%s\", str);" - print "\telse if (decimal)" - print "\t\tprintf(\"%lu\", val);" - print "\telse" - print "\t\tprintf(\"%#lx\", val);" - } else { - print "\treturn (str);" - } + print "\treturn (str);" print "}" } ' Modified: head/lib/libsysdecode/sysdecode.3 ============================================================================== --- head/lib/libsysdecode/sysdecode.3 Tue Dec 22 20:22:17 2015 (r292621) +++ head/lib/libsysdecode/sysdecode.3 Tue Dec 22 20:33:49 2015 (r292622) @@ -39,6 +39,7 @@ The library includes several functions that provide descriptive names of values associated with system calls. .Sh SEE ALSO +.Xr sysdecode_ioctlname 3 , .Xr sysdecode_utrace 3 .Sh HISTORY The Modified: head/lib/libsysdecode/sysdecode.h ============================================================================== --- head/lib/libsysdecode/sysdecode.h Tue Dec 22 20:22:17 2015 (r292621) +++ head/lib/libsysdecode/sysdecode.h Tue Dec 22 20:33:49 2015 (r292622) @@ -29,6 +29,7 @@ #ifndef __SYSDECODE_H__ #define __SYSDECODE_H__ +const char *sysdecode_ioctlname(unsigned long _val); int sysdecode_utrace(FILE *_fp, void *_buf, size_t _len); #endif /* !__SYSDECODE_H__ */ Added: head/lib/libsysdecode/sysdecode_ioctlname.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsysdecode/sysdecode_ioctlname.3 Tue Dec 22 20:33:49 2015 (r292622) @@ -0,0 +1,57 @@ +.\" +.\" Copyright (c) 2015 John Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 12, 2015 +.Dt sysdecode_ioctlname 3 +.Os +.Sh NAME +.Nm sysdecode_ioctlname +.Nd lookup name of device control command +.Sh LIBRARY +.Lb libsysdecode +.Sh SYNOPSIS +.Ft conts char * +.Fn sysdecode_ioctlname "unsigned long request" +.Sh DESCRIPTION +The +.Fn sysdecode_ioctlname +function returns the name of a device control request identified by +.Fa request . +A table of names is generated during the build of the +.Nm sysdecode +library from system headers that maps device control request values to +the name of the corresponding C macro. +.Sh RETURN VALUES +The +.Fn sysdecode_ioctlname +function returns the name of a device control request if +.Fa request +is a known value; +otherwise +.Dv NULL . +.Sh SEE ALSO +.Xr sysdecode 3 Modified: head/usr.bin/kdump/Makefile ============================================================================== --- head/usr.bin/kdump/Makefile Tue Dec 22 20:22:17 2015 (r292621) +++ head/usr.bin/kdump/Makefile Tue Dec 22 20:33:49 2015 (r292622) @@ -6,7 +6,7 @@ .PATH: ${.CURDIR}/../ktrace PROG= kdump -SRCS= kdump_subr.c kdump_subr.h kdump.c ioctl.c subr.c +SRCS= kdump_subr.c kdump_subr.h kdump.c subr.c CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I. LIBADD= sysdecode @@ -15,15 +15,9 @@ LIBADD+= capsicum CFLAGS+=-DHAVE_LIBCAPSICUM .endif -.if ${MK_PF} != "no" -CFLAGS+=-DPF -.endif - NO_WERROR?= YES -CLEANFILES= ioctl.c kdump_subr.c kdump_subr.h - -beforedepend: ioctl.c +CLEANFILES= kdump_subr.c kdump_subr.h .if (${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386") beforedepend: linux_syscalls.c @@ -44,10 +38,6 @@ linux32_syscalls.c: linux32_syscalls.con ${.CURDIR}/../../sys/${MACHINE_ARCH}/linux32/syscalls.master ${.CURDIR}/linux32_syscalls.conf .endif -ioctl.c: mkioctls - env MACHINE=${MACHINE} CPP="${CPP}" \ - sh ${.CURDIR}/mkioctls print ${DESTDIR}${INCLUDEDIR} > ${.TARGET} - kdump_subr.h: mksubr sh ${.CURDIR}/mksubr ${DESTDIR}${INCLUDEDIR} | \ sed -n 's/^\([a-z].*)\)$$/void \1;/p' >${.TARGET} Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Tue Dec 22 20:22:17 2015 (r292621) +++ head/usr.bin/kdump/kdump.c Tue Dec 22 20:33:49 2015 (r292622) @@ -116,7 +116,6 @@ void ktrfault(struct ktr_fault *); void ktrfaultend(struct ktr_faultend *); void limitfd(int fd); void usage(void); -void ioctlname(unsigned long, int); #define TIMESTAMP_NONE 0x0 #define TIMESTAMP_ABSOLUTE 0x1 @@ -693,6 +692,20 @@ dumpheader(struct ktr_header *kth) #undef KTRACE int nsyscalls = sizeof (syscallnames) / sizeof (syscallnames[0]); +static void +ioctlname(unsigned long val) +{ + const char *str; + + str = sysdecode_ioctlname(val); + if (str != NULL) + printf("%s", str); + else if (decimal) + printf("%lu", val); + else + printf("%#lx", val); +} + void ktrsyscall(struct ktr_syscall *ktr, u_int flags) { @@ -741,7 +754,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_in case SYS_ioctl: { print_number(ip, narg, c); putchar(c); - ioctlname(*ip, decimal); + ioctlname(*ip); c = ','; ip++; narg--; Modified: head/usr.bin/truss/Makefile ============================================================================== --- head/usr.bin/truss/Makefile Tue Dec 22 20:22:17 2015 (r292621) +++ head/usr.bin/truss/Makefile Tue Dec 22 20:33:49 2015 (r292622) @@ -2,16 +2,11 @@ NO_WERROR= PROG= truss -SRCS= cloudabi.c ioctl.c main.c setup.c syscalls.c +SRCS= cloudabi.c main.c setup.c syscalls.c LIBADD= sysdecode CFLAGS+= -I${.CURDIR} -I. -I${.CURDIR}/../../sys -CLEANFILES= ioctl.c - -ioctl.c: ${.CURDIR}/../kdump/mkioctls - env MACHINE=${MACHINE} CPP="${CPP}" \ - /bin/sh ${.CURDIR}/../kdump/mkioctls return ${DESTDIR}${INCLUDEDIR} > ${.TARGET} # Define where to generate syscalls for each ABI. ABI_SYSPATH.freebsd= sys/kern Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Tue Dec 22 20:22:17 2015 (r292621) +++ head/usr.bin/truss/syscalls.c Tue Dec 22 20:33:49 2015 (r292622) @@ -1315,7 +1315,7 @@ print_arg(struct syscall_args *sc, unsig unsigned long cmd; cmd = args[sc->offset]; - temp = ioctlname(cmd); + temp = sysdecode_ioctlname(cmd); if (temp) fputs(temp, fp); else { From owner-svn-src-all@freebsd.org Tue Dec 22 20:36:17 2015 Return-Path: Delivered-To: svn-src-all@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 BDC2DA4EF67; Tue, 22 Dec 2015 20:36:17 +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 83AFA111C; Tue, 22 Dec 2015 20:36:17 +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 tBMKaGcW045077; Tue, 22 Dec 2015 20:36:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMKaE7A045054; Tue, 22 Dec 2015 20:36:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512222036.tBMKaE7A045054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 22 Dec 2015 20:36:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292623 - in head: lib/libc/gen sys/boot/efi/include sys/boot/efi/include/amd64 sys/boot/efi/include/arm64 sys/boot/efi/include/i386 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 20:36:17 -0000 Author: emaste Date: Tue Dec 22 20:36:14 2015 New Revision: 292623 URL: https://svnweb.freebsd.org/changeset/base/292623 Log: Support a.out format in nlist only on i386 i386 is the only current FreeBSD architecture that ever used a.out format. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4687 Modified: head/lib/libc/gen/nlist.c head/sys/boot/efi/include/amd64/efibind.h head/sys/boot/efi/include/amd64/pe.h head/sys/boot/efi/include/arm64/efibind.h head/sys/boot/efi/include/efi.h head/sys/boot/efi/include/efi_nii.h head/sys/boot/efi/include/efidebug.h head/sys/boot/efi/include/efidef.h head/sys/boot/efi/include/efidevp.h head/sys/boot/efi/include/efifs.h head/sys/boot/efi/include/efinet.h head/sys/boot/efi/include/efipart.h head/sys/boot/efi/include/efipciio.h head/sys/boot/efi/include/efiprot.h head/sys/boot/efi/include/efipxebc.h head/sys/boot/efi/include/efiser.h head/sys/boot/efi/include/efiuga.h head/sys/boot/efi/include/i386/efibind.h head/sys/boot/efi/include/i386/pe.h head/sys/boot/efi/libefi/efinet.c head/sys/boot/efi/libefi/efipart.c head/sys/boot/efi/libefi/time.c Modified: head/lib/libc/gen/nlist.c ============================================================================== --- head/lib/libc/gen/nlist.c Tue Dec 22 20:33:49 2015 (r292622) +++ head/lib/libc/gen/nlist.c Tue Dec 22 20:36:14 2015 (r292623) @@ -47,8 +47,8 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" -/* There is no a.out support on arm64 */ -#ifndef __aarch64__ +/* i386 is the only current FreeBSD architecture that used a.out format. */ +#ifdef __i386__ #define _NLIST_DO_AOUT #endif #define _NLIST_DO_ELF Modified: head/sys/boot/efi/include/amd64/efibind.h ============================================================================== --- head/sys/boot/efi/include/amd64/efibind.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/amd64/efibind.h Tue Dec 22 20:36:14 2015 (r292623) @@ -37,11 +37,11 @@ Revision History #if (__STDC_VERSION__ < 199901L ) - // No ANSI C 1999/2000 stdint.h integer width declarations + // No ANSI C 1999/2000 stdint.h integer width declarations #if _MSC_EXTENSIONS - // Use Microsoft C compiler integer width declarations + // Use Microsoft C compiler integer width declarations typedef unsigned __int64 uint64_t; typedef __int64 int64_t; @@ -51,10 +51,10 @@ Revision History typedef short int16_t; typedef unsigned char uint8_t; typedef char int8_t; - #else + #else #ifdef UNIX_LP64 - // Use LP64 programming model from C_FLAGS for integer width declarations + // Use LP64 programming model from C_FLAGS for integer width declarations typedef unsigned long uint64_t; typedef long int64_t; @@ -66,7 +66,7 @@ Revision History typedef char int8_t; #else - // Assume P64 programming model from C_FLAGS for integer width declarations + // Assume P64 programming model from C_FLAGS for integer width declarations typedef unsigned long long uint64_t; typedef long long int64_t; @@ -112,17 +112,17 @@ typedef uint64_t UINTN; #ifdef EFI_NT_EMULATOR #define POST_CODE(_Data) -#else +#else #ifdef EFI_DEBUG #define POST_CODE(_Data) __asm mov eax,(_Data) __asm out 0x80,al #else #define POST_CODE(_Data) - #endif + #endif #endif #define EFIERR(a) (0x8000000000000000 | a) #define EFI_ERROR_MASK 0x8000000000000000 -#define EFIERR_OEM(a) (0xc000000000000000 | a) +#define EFIERR_OEM(a) (0xc000000000000000 | a) #define BAD_POINTER 0xFBFBFBFBFBFBFBFB @@ -156,18 +156,18 @@ typedef uint64_t UINTN; // BOOTSERVICE - prototype for implementation of a boot service interface // RUNTIMESERVICE - prototype for implementation of a runtime service interface // RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service -// RUNTIME_CODE - pragma macro for declaring runtime code +// RUNTIME_CODE - pragma macro for declaring runtime code // #ifdef __amd64__ #define EFIAPI __attribute__((ms_abi)) #endif -#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options +#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options #if _MSC_EXTENSIONS - #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler + #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler #else - #define EFIAPI // Substitute expresion to force C calling convention + #define EFIAPI // Substitute expresion to force C calling convention #endif #endif @@ -184,7 +184,7 @@ typedef uint64_t UINTN; #define VOLATILE volatile -#define MEMORY_FENCE() +#define MEMORY_FENCE() #ifdef EFI_NO_INTERFACE_DECL #define EFI_FORWARD_DECLARATION(x) @@ -233,9 +233,9 @@ typedef uint64_t UINTN; #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \ - (_if)->LoadInternal(type, name, NULL) + (_if)->LoadInternal(type, name, NULL) -#else // EFI_NT_EMULATOR +#else // EFI_NT_EMULATOR // // When build similiar to FW, then link everything together as @@ -247,7 +247,7 @@ typedef uint64_t UINTN; #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \ (_if)->LoadInternal(type, name, entry) -#endif // EFI_FW_NT +#endif // EFI_FW_NT #ifdef __FreeBSD__ #define INTERFACE_DECL(x) struct x Modified: head/sys/boot/efi/include/amd64/pe.h ============================================================================== --- head/sys/boot/efi/include/amd64/pe.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/amd64/pe.h Tue Dec 22 20:36:14 2015 (r292623) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* +/* PE32+ header file */ #ifndef _PE_H @@ -8,7 +8,7 @@ #define IMAGE_DOS_SIGNATURE 0x5A4D // MZ #define IMAGE_OS2_SIGNATURE 0x454E // NE #define IMAGE_OS2_SIGNATURE_LE 0x454C // LE -#define IMAGE_NT_SIGNATURE 0x00004550 // PE00 +#define IMAGE_NT_SIGNATURE 0x00004550 // PE00 #define IMAGE_EDOS_SIGNATURE 0x44454550 // PEED @@ -130,7 +130,7 @@ typedef struct _IMAGE_OPTIONAL_HEADER { UINT32 AddressOfEntryPoint; UINT32 BaseOfCode; UINT32 BaseOfData; - + // // NT additional fields. // Modified: head/sys/boot/efi/include/arm64/efibind.h ============================================================================== --- head/sys/boot/efi/include/arm64/efibind.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/arm64/efibind.h Tue Dec 22 20:36:14 2015 (r292623) @@ -37,11 +37,11 @@ Revision History #if (__STDC_VERSION__ < 199901L ) - // No ANSI C 1999/2000 stdint.h integer width declarations + // No ANSI C 1999/2000 stdint.h integer width declarations #if _MSC_EXTENSIONS - // Use Microsoft C compiler integer width declarations + // Use Microsoft C compiler integer width declarations typedef unsigned __int64 uint64_t; typedef __int64 int64_t; @@ -51,10 +51,10 @@ Revision History typedef __int16 int16_t; typedef unsigned __int8 uint8_t; typedef __int8 int8_t; - #else + #else #ifdef UNIX_LP64 - // Use LP64 programming model from C_FLAGS for integer width declarations + // Use LP64 programming model from C_FLAGS for integer width declarations typedef unsigned long uint64_t; typedef long int64_t; @@ -66,7 +66,7 @@ Revision History typedef char int8_t; #else - // Assume P64 programming model from C_FLAGS for integer width declarations + // Assume P64 programming model from C_FLAGS for integer width declarations typedef unsigned long long uint64_t; typedef long long int64_t; @@ -108,10 +108,10 @@ typedef uint64_t UINTN; // #define BIT63 0x8000000000000000 -#define PLATFORM_IOBASE_ADDRESS (0xffffc000000 | BIT63) +#define PLATFORM_IOBASE_ADDRESS (0xffffc000000 | BIT63) #define PORT_TO_MEMD(_Port) (PLATFORM_IOBASE_ADDRESS | ( ( ( (_Port) & 0xfffc) << 10 ) | ( (_Port) & 0x0fff) ) ) - -// + +// // Macro's with casts make this much easier to use and read. // #define PORT_TO_MEM8D(_Port) (*(UINT8 *)(PORT_TO_MEMD(_Port))) @@ -122,12 +122,12 @@ typedef uint64_t UINTN; #define EFIERR(a) (0x8000000000000000 | a) #define EFI_ERROR_MASK 0x8000000000000000 -#define EFIERR_OEM(a) (0xc000000000000000 | a) +#define EFIERR_OEM(a) (0xc000000000000000 | a) #define BAD_POINTER 0xFBFBFBFBFBFBFBFB #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF -#pragma intrinsic (__break) +#pragma intrinsic (__break) #define BREAKPOINT() __break(0) // @@ -155,14 +155,14 @@ typedef uint64_t UINTN; // BOOTSERVICE - prototype for implementation of a boot service interface // RUNTIMESERVICE - prototype for implementation of a runtime service interface // RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service -// RUNTIME_CODE - pragma macro for declaring runtime code +// RUNTIME_CODE - pragma macro for declaring runtime code // -#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options +#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options #if _MSC_EXTENSIONS - #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler + #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler #else - #define EFIAPI // Substitute expresion to force C calling convention + #define EFIAPI // Substitute expresion to force C calling convention #endif #endif @@ -179,8 +179,8 @@ typedef uint64_t UINTN; // // BugBug: Need to find out if this is portable accross compliers. // -void __mfa (void); -#pragma intrinsic (__mfa) +void __mfa (void); +#pragma intrinsic (__mfa) #define MEMORY_FENCE() __mfa() #ifdef EFI_NO_INTERFACE_DECL Modified: head/sys/boot/efi/include/efi.h ============================================================================== --- head/sys/boot/efi/include/efi.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/efi.h Tue Dec 22 20:36:14 2015 (r292623) @@ -54,10 +54,10 @@ Revision History #include "efierr.h" #include "efigop.h" -#define EFI_STRINGIZE(a) #a -#define EFI_PROTOCOL_DEFINITION(a) EFI_STRINGIZE(Protocol/a/a.h) +#define EFI_STRINGIZE(a) #a +#define EFI_PROTOCOL_DEFINITION(a) EFI_STRINGIZE(Protocol/a/a.h) -#define EFI_GUID_DEFINITION(a) EFI_STRINGIZE(Guid/a/a##.h) +#define EFI_GUID_DEFINITION(a) EFI_STRINGIZE(Guid/a/a##.h) #define EFI_GUID_STRING(guidpointer, shortstring, longstring) #endif Modified: head/sys/boot/efi/include/efi_nii.h ============================================================================== --- head/sys/boot/efi/include/efi_nii.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/efi_nii.h Tue Dec 22 20:36:14 2015 (r292623) @@ -21,7 +21,7 @@ Revision history: 2000-Feb-18 M(f)J GUID updated. Structure order changed for machine word alignment. Added StringId[4] to structure. - + 2000-Feb-14 M(f)J Genesis. --*/ Modified: head/sys/boot/efi/include/efidebug.h ============================================================================== --- head/sys/boot/efi/include/efidebug.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/efidebug.h Tue Dec 22 20:36:14 2015 (r292623) @@ -33,12 +33,12 @@ extern UINTN EFIDebug; #define DBGASSERT(a) DbgAssert(__FILE__, __LINE__, #a) #define DEBUG(a) DbgPrint a - + #else #define DBGASSERT(a) #define DEBUG(a) - + #endif #if EFI_DEBUG_CLEAR_MEMORY @@ -60,7 +60,7 @@ extern UINTN EFIDebug; #define D_INFO 0x00000040 // Verbose #define D_VARIABLE 0x00000100 // Variable #define D_VAR 0x00000100 // Variable -#define D_BM 0x00000400 // Boot Manager +#define D_BM 0x00000400 // Boot Manager #define D_BLKIO 0x00001000 // BlkIo Driver #define D_BLKIO_ULTRA 0x00002000 // BlkIo Driver #define D_NET 0x00004000 // SNI Driver @@ -91,9 +91,9 @@ extern UINTN EFIDebug; #else - #define ASSERT(a) - #define ASSERT_LOCKED(l) - #define ASSERT_STRUCT(p,t) + #define ASSERT(a) + #define ASSERT_LOCKED(l) + #define ASSERT_STRUCT(p,t) #endif Modified: head/sys/boot/efi/include/efidef.h ============================================================================== --- head/sys/boot/efi/include/efidef.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/efidef.h Tue Dec 22 20:36:14 2015 (r292623) @@ -70,11 +70,11 @@ typedef VOID *EFI_EVENT; // A GUID // -typedef struct { +typedef struct { UINT32 Data1; UINT16 Data2; UINT16 Data3; - UINT8 Data4[8]; + UINT8 Data4[8]; } EFI_GUID; @@ -82,7 +82,7 @@ typedef struct { // Time // -typedef struct { +typedef struct { UINT16 Year; // 1998 - 20XX UINT8 Month; // 1 - 12 UINT8 Day; // 1 - 31 @@ -165,9 +165,9 @@ typedef enum { #define EFI_MEMORY_WC 0x0000000000000002 #define EFI_MEMORY_WT 0x0000000000000004 #define EFI_MEMORY_WB 0x0000000000000008 -#define EFI_MEMORY_UCE 0x0000000000000010 +#define EFI_MEMORY_UCE 0x0000000000000010 -// physical memory protection on range +// physical memory protection on range #define EFI_MEMORY_WP 0x0000000000001000 #define EFI_MEMORY_RP 0x0000000000002000 #define EFI_MEMORY_XP 0x0000000000004000 Modified: head/sys/boot/efi/include/efidevp.h ============================================================================== --- head/sys/boot/efi/include/efidevp.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/efidevp.h Tue Dec 22 20:36:14 2015 (r292623) @@ -150,8 +150,8 @@ typedef struct _ACPI_EXTENDED_HID_DEVICE // bits[31:16] - binary number // Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z' // -#define PNP_EISA_ID_CONST 0x41d0 -#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16)) +#define PNP_EISA_ID_CONST 0x41d0 +#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16)) #define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId))) #define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId))) @@ -160,7 +160,7 @@ typedef struct _ACPI_EXTENDED_HID_DEVICE /* * */ -#define MESSAGING_DEVICE_PATH 0x03 +#define MESSAGING_DEVICE_PATH 0x03 #define MSG_ATAPI_DP 0x01 typedef struct _ATAPI_DEVICE_PATH { @@ -174,7 +174,7 @@ typedef struct _ATAPI_DEVICE_PATH { typedef struct _SCSI_DEVICE_PATH { EFI_DEVICE_PATH Header; UINT16 Pun; - UINT16 Lun; + UINT16 Lun; } SCSI_DEVICE_PATH; #define MSG_FIBRECHANNEL_DP 0x03 @@ -281,9 +281,9 @@ typedef struct _UART_DEVICE_PATH { #define DEVICE_PATH_MESSAGING_VT_100_PLUS \ { 0x7baec70b, 0x57e0, 0x4c76, 0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 } - + #define DEVICE_PATH_MESSAGING_VT_UTF8 \ - { 0xad15a0d6, 0x8bec, 0x4acf, 0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } + { 0xad15a0d6, 0x8bec, 0x4acf, 0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } #define MEDIA_DEVICE_PATH 0x04 @@ -356,7 +356,7 @@ typedef union { PCCARD_DEVICE_PATH PcCard; MEMMAP_DEVICE_PATH MemMap; VENDOR_DEVICE_PATH Vendor; - UNKNOWN_DEVICE_VENDOR_DEVICE_PATH UnknownVendor; + UNKNOWN_DEVICE_VENDOR_DEVICE_PATH UnknownVendor; CONTROLLER_DEVICE_PATH Controller; ACPI_HID_DEVICE_PATH Acpi; @@ -390,7 +390,7 @@ typedef union { PCCARD_DEVICE_PATH *PcCard; MEMMAP_DEVICE_PATH *MemMap; VENDOR_DEVICE_PATH *Vendor; - UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *UnknownVendor; + UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *UnknownVendor; CONTROLLER_DEVICE_PATH *Controller; ACPI_HID_DEVICE_PATH *Acpi; ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi; Modified: head/sys/boot/efi/include/efifs.h ============================================================================== --- head/sys/boot/efi/include/efifs.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/efifs.h Tue Dec 22 20:36:14 2015 (r292623) @@ -101,7 +101,7 @@ typedef struct _EFI_LBAL { UINT32 ArrayCount; } EFI_LBAL; -// Array size +// Array size #define EFI_LBAL_ARRAY_SIZE(lbal,offs,blks) \ (((blks) - (offs) - (lbal)->Hdr.HeaderSize) / sizeof(EFI_RL)) Modified: head/sys/boot/efi/include/efinet.h ============================================================================== --- head/sys/boot/efi/include/efinet.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/efinet.h Tue Dec 22 20:36:14 2015 (r292623) @@ -173,8 +173,8 @@ typedef struct { /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_START) ( IN struct _EFI_SIMPLE_NETWORK *This ); @@ -182,8 +182,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_STOP) ( IN struct _EFI_SIMPLE_NETWORK *This ); @@ -191,8 +191,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE) ( IN struct _EFI_SIMPLE_NETWORK *This, IN UINTN ExtraRxBufferSize OPTIONAL, @@ -202,8 +202,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_RESET) ( IN struct _EFI_SIMPLE_NETWORK *This, IN BOOLEAN ExtendedVerification @@ -212,8 +212,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN) ( IN struct _EFI_SIMPLE_NETWORK *This ); @@ -221,8 +221,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS) ( IN struct _EFI_SIMPLE_NETWORK *This, IN UINT32 Enable, @@ -235,8 +235,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS) ( IN struct _EFI_SIMPLE_NETWORK *This, IN BOOLEAN Reset, @@ -246,8 +246,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS) ( IN struct _EFI_SIMPLE_NETWORK *This, IN BOOLEAN Reset, @@ -258,8 +258,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC) ( IN struct _EFI_SIMPLE_NETWORK *This, IN BOOLEAN IPv6, @@ -270,8 +270,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_NVDATA) ( IN struct _EFI_SIMPLE_NETWORK *This, IN BOOLEAN ReadWrite, @@ -283,8 +283,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS) ( IN struct _EFI_SIMPLE_NETWORK *This, OUT UINT32 *InterruptStatus OPTIONAL, @@ -294,8 +294,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT) ( IN struct _EFI_SIMPLE_NETWORK *This, IN UINTN HeaderSize, @@ -309,8 +309,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE) ( IN struct _EFI_SIMPLE_NETWORK *This, OUT UINTN *HeaderSize OPTIONAL, Modified: head/sys/boot/efi/include/efipart.h ============================================================================== --- head/sys/boot/efi/include/efipart.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/efipart.h Tue Dec 22 20:36:14 2015 (r292623) @@ -16,8 +16,8 @@ Intel Corporation. Module Name: efipart.h - -Abstract: + +Abstract: Info about disk partitions and Master Boot Records @@ -55,7 +55,7 @@ typedef struct { #define MIN_MBR_DEVICE_SIZE 0x80000 #define MBR_ERRATA_PAD 0x40000 // 128 MB -#define MAX_MBR_PARTITIONS 4 +#define MAX_MBR_PARTITIONS typedef struct { UINT8 BootStrapCode[440]; UINT8 UniqueMbrSignature[4]; Modified: head/sys/boot/efi/include/efipciio.h ============================================================================== --- head/sys/boot/efi/include/efipciio.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/efipciio.h Tue Dec 22 20:36:14 2015 (r292623) @@ -1,16 +1,16 @@ /* $FreeBSD$ */ /** @file - EFI PCI I/O Protocol provides the basic Memory, I/O, PCI configuration, + EFI PCI I/O Protocol provides the basic Memory, I/O, PCI configuration, and DMA interfaces that a driver uses to access its PCI controller. Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ Modified: head/sys/boot/efi/include/efiprot.h ============================================================================== --- head/sys/boot/efi/include/efiprot.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/efiprot.h Tue Dec 22 20:36:14 2015 (r292623) @@ -307,9 +307,9 @@ typedef struct { // // The FileName field of the EFI_FILE_INFO data structure is variable length. // Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to -// be the size of the data structure without the FileName field. The following macro +// be the size of the data structure without the FileName field. The following macro // computes this size correctly no matter how big the FileName array is declared. -// This is required to make the EFI_FILE_INFO data structure ANSI compilant. +// This is required to make the EFI_FILE_INFO data structure ANSI compilant. // #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName) @@ -329,9 +329,9 @@ typedef struct { // // The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length. // Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs -// to be the size of the data structure without the VolumeLable field. The following macro +// to be the size of the data structure without the VolumeLable field. The following macro // computes this size correctly no matter how big the VolumeLable array is declared. -// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant. +// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant. // #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel) @@ -411,7 +411,7 @@ typedef struct { EFI_DEVICE_IO Write; } EFI_IO_ACCESS; -typedef +typedef EFI_STATUS (EFIAPI *EFI_PCI_DEVICE_PATH) ( IN struct _EFI_DEVICE_IO_INTERFACE *This, Modified: head/sys/boot/efi/include/efipxebc.h ============================================================================== --- head/sys/boot/efi/include/efipxebc.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/efipxebc.h Tue Dec 22 20:36:14 2015 (r292623) @@ -151,7 +151,7 @@ typedef struct { // Discover() definitions // -#define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0 +#define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0 #define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS 1 #define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM 2 #define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI 3 @@ -356,7 +356,7 @@ typedef EFI_STATUS (EFIAPI *EFI_PXE_BASE_CODE_ARP) ( IN struct _EFI_PXE_BASE_CODE *This, - IN EFI_IP_ADDRESS *IpAddr, + IN EFI_IP_ADDRESS *IpAddr, IN EFI_MAC_ADDRESS *MacAddr OPTIONAL ); @@ -455,7 +455,7 @@ typedef enum { } EFI_PXE_BASE_CODE_CALLBACK_STATUS; typedef -EFI_PXE_BASE_CODE_CALLBACK_STATUS +EFI_PXE_BASE_CODE_CALLBACK_STATUS (EFIAPI *EFI_PXE_CALLBACK) ( IN struct _EFI_PXE_BASE_CODE_CALLBACK *This, IN EFI_PXE_BASE_CODE_FUNCTION Function, Modified: head/sys/boot/efi/include/efiser.h ============================================================================== --- head/sys/boot/efi/include/efiser.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/efiser.h Tue Dec 22 20:36:14 2015 (r292623) @@ -35,8 +35,8 @@ Revision History INTERFACE_DECL(_SERIAL_IO_INTERFACE); typedef enum { - DefaultParity, - NoParity, + DefaultParity, + NoParity, EvenParity, OddParity, MarkParity, @@ -44,7 +44,7 @@ typedef enum { } EFI_PARITY_TYPE; typedef enum { - DefaultStopBits, + DefaultStopBits OneStopBit, // 1 stop bit OneFiveStopBits, // 1.5 stop bits TwoStopBits // 2 stop bits Modified: head/sys/boot/efi/include/efiuga.h ============================================================================== --- head/sys/boot/efi/include/efiuga.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/efiuga.h Tue Dec 22 20:36:14 2015 (r292623) @@ -102,33 +102,33 @@ typedef enum { The following table defines actions for BltOperations: - EfiUgaVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY) - directly to every pixel of the video display rectangle - (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). + EfiUgaVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY) + directly to every pixel of the video display rectangle + (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). Only one pixel will be used from the BltBuffer. Delta is NOT used. - EfiUgaVideoToBltBuffer - Read data from the video display rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in - the BltBuffer rectangle (DestinationX, DestinationY ) - (DestinationX + Width, DestinationY + Height). If DestinationX or - DestinationY is not zero then Delta must be set to the length in bytes + EfiUgaVideoToBltBuffer - Read data from the video display rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in + the BltBuffer rectangle (DestinationX, DestinationY ) + (DestinationX + Width, DestinationY + Height). If DestinationX or + DestinationY is not zero then Delta must be set to the length in bytes of a row in the BltBuffer. - EfiUgaBltBufferToVideo - Write data from the BltBuffer rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the - video display rectangle (DestinationX, DestinationY) - (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is - not zero then Delta must be set to the length in bytes of a row in the + EfiUgaBltBufferToVideo - Write data from the BltBuffer rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the + video display rectangle (DestinationX, DestinationY) + (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is + not zero then Delta must be set to the length in bytes of a row in the BltBuffer. EfiUgaVideoToVideo - Copy from the video display rectangle (SourceX, SourceY) - (SourceX + Width, SourceY + Height) .to the video display rectangle - (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). + (SourceX + Width, SourceY + Height) .to the video display rectangle + (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). The BltBuffer and Delta are not used in this mode. @param[in] This - Protocol instance pointer. - @param[in] BltBuffer - Buffer containing data to blit into video buffer. This + @param[in] BltBuffer - Buffer containing data to blit into video buffer. This buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL) @param[in] BltOperation - Operation to perform on BlitBuffer and video memory @param[in] SourceX - X coordinate of source for the BltBuffer. @@ -138,7 +138,7 @@ typedef enum { @param[in] Width - Width of rectangle in BltBuffer in pixels. @param[in] Height - Hight of rectangle in BltBuffer in pixels. @param[in] Delta - OPTIONAL - + @retval EFI_SUCCESS - The Blt operation completed. @retval EFI_INVALID_PARAMETER - BltOperation is not valid. @retval EFI_DEVICE_ERROR - A hardware error occured writting to the video buffer. Modified: head/sys/boot/efi/include/i386/efibind.h ============================================================================== --- head/sys/boot/efi/include/i386/efibind.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/i386/efibind.h Tue Dec 22 20:36:14 2015 (r292623) @@ -37,11 +37,11 @@ Revision History #if (__STDC_VERSION__ < 199901L ) - // No ANSI C 1999/2000 stdint.h integer width declarations + // No ANSI C 1999/2000 stdint.h integer width declarations #if _MSC_EXTENSIONS - // Use Microsoft C compiler integer width declarations + // Use Microsoft C compiler integer width declarations typedef unsigned __int64 uint64_t; typedef __int64 int64_t; @@ -51,10 +51,10 @@ Revision History typedef short int16_t; typedef unsigned char uint8_t; typedef char int8_t; - #else + #else #ifdef UNIX_LP64 - // Use LP64 programming model from C_FLAGS for integer width declarations + // Use LP64 programming model from C_FLAGS for integer width declarations typedef unsigned long uint64_t; typedef long int64_t; @@ -66,7 +66,7 @@ Revision History typedef char int8_t; #else - // Assume P64 programming model from C_FLAGS for integer width declarations + // Assume P64 programming model from C_FLAGS for integer width declarations typedef unsigned long long uint64_t; typedef long long int64_t; @@ -112,17 +112,17 @@ typedef uint32_t UINTN; #ifdef EFI_NT_EMULATOR #define POST_CODE(_Data) -#else +#else #ifdef EFI_DEBUG #define POST_CODE(_Data) __asm mov eax,(_Data) __asm out 0x80,al #else #define POST_CODE(_Data) - #endif + #endif #endif #define EFIERR(a) (0x80000000 | a) #define EFI_ERROR_MASK 0x80000000 -#define EFIERR_OEM(a) (0xc0000000 | a) +#define EFIERR_OEM(a) (0xc0000000 | a) #define BAD_POINTER 0xFBFBFBFB @@ -156,14 +156,14 @@ typedef uint32_t UINTN; // BOOTSERVICE - prototype for implementation of a boot service interface // RUNTIMESERVICE - prototype for implementation of a runtime service interface // RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service -// RUNTIME_CODE - pragma macro for declaring runtime code +// RUNTIME_CODE - pragma macro for declaring runtime code // -#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options +#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options #if _MSC_EXTENSIONS - #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler + #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler #else - #define EFIAPI // Substitute expresion to force C calling convention + #define EFIAPI // Substitute expresion to force C calling convention #endif #endif @@ -180,7 +180,7 @@ typedef uint32_t UINTN; #define VOLATILE volatile -#define MEMORY_FENCE() +#define MEMORY_FENCE() #ifdef EFI_NO_INTERFACE_DECL #define EFI_FORWARD_DECLARATION(x) @@ -229,9 +229,9 @@ typedef uint32_t UINTN; #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \ - (_if)->LoadInternal(type, name, NULL) + (_if)->LoadInternal(type, name, NULL) -#else // EFI_NT_EMULATOR +#else // EFI_NT_EMULATOR // // When build similiar to FW, then link everything together as @@ -243,7 +243,7 @@ typedef uint32_t UINTN; #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \ (_if)->LoadInternal(type, name, entry) -#endif // EFI_FW_NT +#endif // EFI_FW_NT #ifdef __FreeBSD__ #define INTERFACE_DECL(x) struct x Modified: head/sys/boot/efi/include/i386/pe.h ============================================================================== --- head/sys/boot/efi/include/i386/pe.h Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/include/i386/pe.h Tue Dec 22 20:36:14 2015 (r292623) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* +/* PE32+ header file */ #ifndef _PE_H @@ -8,7 +8,7 @@ #define IMAGE_DOS_SIGNATURE 0x5A4D // MZ #define IMAGE_OS2_SIGNATURE 0x454E // NE #define IMAGE_OS2_SIGNATURE_LE 0x454C // LE -#define IMAGE_NT_SIGNATURE 0x00004550 // PE00 +#define IMAGE_NT_SIGNATURE 0x00004550 // PE00 #define IMAGE_EDOS_SIGNATURE 0x44454550 // PEED @@ -130,7 +130,7 @@ typedef struct _IMAGE_OPTIONAL_HEADER { UINT32 AddressOfEntryPoint; UINT32 BaseOfCode; UINT32 BaseOfData; - + // // NT additional fields. // @@ -607,7 +607,7 @@ typedef struct { UINT32 Signature; // "NB10" UINT32 Unknown; UINT32 Unknown2; - UINT32 Unknown3; + UINT32 Unknown3; // // Filename of .PDB goes here // @@ -619,9 +619,9 @@ typedef struct { UINT32 Signature; // "RSDS" UINT32 Unknown; UINT32 Unknown2; - UINT32 Unknown3; - UINT32 Unknown4; - UINT32 Unknown5; + UINT32 Unknown3; + UINT32 Unknown4; + UINT32 Unknown5; // // Filename of .PDB goes here // Modified: head/sys/boot/efi/libefi/efinet.c ============================================================================== --- head/sys/boot/efi/libefi/efinet.c Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/libefi/efinet.c Tue Dec 22 20:36:14 2015 (r292623) @@ -50,7 +50,7 @@ static int efinet_match(struct netif *, static int efinet_probe(struct netif *, void *); static int efinet_put(struct iodesc *, void *, size_t); -struct netif_driver efinetif = { +struct netif_driver efinetif = { .netif_bname = "efinet", .netif_match = efinet_match, .netif_probe = efinet_probe, @@ -132,7 +132,7 @@ efinet_put(struct iodesc *desc, void *pk buf = 0; /* XXX Is this needed? */ status = net->GetStatus(net, 0, &buf); /* - * XXX EFI1.1 and the E1000 card returns a different + * XXX EFI1.1 and the E1000 card returns a different * address than we gave. Sigh. */ } while (status == EFI_SUCCESS && buf == 0); @@ -234,7 +234,7 @@ efinet_init(struct iodesc *desc, void *m static void efinet_end(struct netif *nif) { - EFI_SIMPLE_NETWORK *net = nif->nif_devdata; + EFI_SIMPLE_NETWORK *net = nif->nif_devdata; net->Shutdown(net); } Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/libefi/efipart.c Tue Dec 22 20:36:14 2015 (r292623) @@ -60,7 +60,7 @@ struct devsw efipart_dev = { }; static int -efipart_init(void) +efipart_init(void) { EFI_BLOCK_IO *blkio; EFI_DEVICE_PATH *devpath, *devpathcpy, *tmpdevpath, *node; @@ -174,7 +174,7 @@ efipart_print(int verbose) } } -static int +static int efipart_open(struct open_file *f, ...) { va_list args; @@ -202,7 +202,7 @@ efipart_open(struct open_file *f, ...) return (0); } -static int +static int efipart_close(struct open_file *f) { struct devdesc *dev; @@ -255,7 +255,7 @@ efipart_readwrite(EFI_BLOCK_IO *blkio, i return (efi_status_to_errno(status)); } -static int +static int efipart_strategy(void *devdata, int rw, daddr_t blk, size_t size, char *buf, size_t *rsize) { Modified: head/sys/boot/efi/libefi/time.c ============================================================================== --- head/sys/boot/efi/libefi/time.c Tue Dec 22 20:33:49 2015 (r292622) +++ head/sys/boot/efi/libefi/time.c Tue Dec 22 20:36:14 2015 (r292623) @@ -2,28 +2,28 @@ * Copyright (c) 1999, 2000 * Intel Corporation. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Dec 22 20:37:35 2015 Return-Path: Delivered-To: svn-src-all@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 BFC46A4EFE7; Tue, 22 Dec 2015 20:37:35 +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 804B112D6; Tue, 22 Dec 2015 20:37:35 +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 tBMKbYrr045170; Tue, 22 Dec 2015 20:37:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMKbYh8045167; Tue, 22 Dec 2015 20:37:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512222037.tBMKbYh8045167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 22 Dec 2015 20:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292624 - in head/sys: fs/devfs sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 20:37:35 -0000 Author: kib Date: Tue Dec 22 20:37:34 2015 New Revision: 292624 URL: https://svnweb.freebsd.org/changeset/base/292624 Log: Make it possible for the cdevsw d_close() driver method to detect last close and close due to revoke(2)-like operation. A new FLASTCLOSE flag indicates that this is last close. FREVOKE is set for revokes, and FNONBLOCK is also set, same as is already done for VOP_CLOSE() call from vgonel(). The flags reuse user open(2) flags which are never stored in f_flag, to not consume bit space in the ABI visible way. Assert this with the static check. Requested and reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/fs/devfs/devfs_vnops.c head/sys/sys/fcntl.h Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Tue Dec 22 20:36:14 2015 (r292623) +++ head/sys/fs/devfs/devfs_vnops.c Tue Dec 22 20:37:34 2015 (r292624) @@ -557,7 +557,9 @@ devfs_access(struct vop_access_args *ap) return (error); } -/* ARGSUSED */ +_Static_assert(((FMASK | FCNTLFLAGS) & (FLASTCLOSE | FREVOKE)) == 0, + "devfs-only flag reuse failed"); + static int devfs_close(struct vop_close_args *ap) { @@ -566,7 +568,7 @@ devfs_close(struct vop_close_args *ap) struct proc *p; struct cdev *dev = vp->v_rdev; struct cdevsw *dsw; - int vp_locked, error, ref; + int dflags, error, ref, vp_locked; /* * XXX: Don't call d_close() if we were called because of @@ -621,9 +623,11 @@ devfs_close(struct vop_close_args *ap) dsw = dev_refthread(dev, &ref); if (dsw == NULL) return (ENXIO); + dflags = 0; VI_LOCK(vp); if (vp->v_iflag & VI_DOOMED) { /* Forced close. */ + dflags |= FREVOKE | FNONBLOCK; } else if (dsw->d_flags & D_TRACKCLOSE) { /* Keep device updated on status. */ } else if (count_dev(dev) > 1) { @@ -631,13 +635,15 @@ devfs_close(struct vop_close_args *ap) dev_relthread(dev, ref); return (0); } + if (count_dev(dev) == 1) + dflags |= FLASTCLOSE; vholdl(vp); VI_UNLOCK(vp); vp_locked = VOP_ISLOCKED(vp); VOP_UNLOCK(vp, 0); KASSERT(dev->si_refcount > 0, ("devfs_close() on un-referenced struct cdev *(%s)", devtoname(dev))); - error = dsw->d_close(dev, ap->a_fflag, S_IFCHR, td); + error = dsw->d_close(dev, ap->a_fflag | dflags, S_IFCHR, td); dev_relthread(dev, ref); vn_lock(vp, vp_locked | LK_RETRY); vdrop(vp); Modified: head/sys/sys/fcntl.h ============================================================================== --- head/sys/sys/fcntl.h Tue Dec 22 20:36:14 2015 (r292623) +++ head/sys/sys/fcntl.h Tue Dec 22 20:37:34 2015 (r292624) @@ -138,6 +138,11 @@ typedef __pid_t pid_t; */ #ifdef _KERNEL + +/* Only for devfs d_close() flags. */ +#define FLASTCLOSE O_DIRECTORY +#define FREVOKE O_VERIFY + /* convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE */ #define FFLAGS(oflags) ((oflags) & O_EXEC ? (oflags) : (oflags) + 1) #define OFLAGS(fflags) ((fflags) & O_EXEC ? (fflags) : (fflags) - 1) From owner-svn-src-all@freebsd.org Tue Dec 22 20:40:38 2015 Return-Path: Delivered-To: svn-src-all@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 8E7CCA4F0D3; Tue, 22 Dec 2015 20:40:38 +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 2684E14C7; Tue, 22 Dec 2015 20:40:38 +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 tBMKebxB047280; Tue, 22 Dec 2015 20:40:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMKeZii045349; Tue, 22 Dec 2015 20:40:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512222040.tBMKeZii045349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 22 Dec 2015 20:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292625 - in head/sys/boot/efi: include include/amd64 include/arm64 include/i386 libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 20:40:38 -0000 Author: emaste Date: Tue Dec 22 20:40:34 2015 New Revision: 292625 URL: https://svnweb.freebsd.org/changeset/base/292625 Log: Revert accidental whitespace changes included with r292623 Modified: head/sys/boot/efi/include/amd64/efibind.h head/sys/boot/efi/include/amd64/pe.h head/sys/boot/efi/include/arm64/efibind.h head/sys/boot/efi/include/efi.h head/sys/boot/efi/include/efi_nii.h head/sys/boot/efi/include/efidebug.h head/sys/boot/efi/include/efidef.h head/sys/boot/efi/include/efidevp.h head/sys/boot/efi/include/efifs.h head/sys/boot/efi/include/efinet.h head/sys/boot/efi/include/efipart.h head/sys/boot/efi/include/efipciio.h head/sys/boot/efi/include/efiprot.h head/sys/boot/efi/include/efipxebc.h head/sys/boot/efi/include/efiser.h head/sys/boot/efi/include/efiuga.h head/sys/boot/efi/include/i386/efibind.h head/sys/boot/efi/include/i386/pe.h head/sys/boot/efi/libefi/efinet.c head/sys/boot/efi/libefi/efipart.c head/sys/boot/efi/libefi/time.c Modified: head/sys/boot/efi/include/amd64/efibind.h ============================================================================== --- head/sys/boot/efi/include/amd64/efibind.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/amd64/efibind.h Tue Dec 22 20:40:34 2015 (r292625) @@ -37,11 +37,11 @@ Revision History #if (__STDC_VERSION__ < 199901L ) - // No ANSI C 1999/2000 stdint.h integer width declarations + // No ANSI C 1999/2000 stdint.h integer width declarations #if _MSC_EXTENSIONS - // Use Microsoft C compiler integer width declarations + // Use Microsoft C compiler integer width declarations typedef unsigned __int64 uint64_t; typedef __int64 int64_t; @@ -51,10 +51,10 @@ Revision History typedef short int16_t; typedef unsigned char uint8_t; typedef char int8_t; - #else + #else #ifdef UNIX_LP64 - // Use LP64 programming model from C_FLAGS for integer width declarations + // Use LP64 programming model from C_FLAGS for integer width declarations typedef unsigned long uint64_t; typedef long int64_t; @@ -66,7 +66,7 @@ Revision History typedef char int8_t; #else - // Assume P64 programming model from C_FLAGS for integer width declarations + // Assume P64 programming model from C_FLAGS for integer width declarations typedef unsigned long long uint64_t; typedef long long int64_t; @@ -112,17 +112,17 @@ typedef uint64_t UINTN; #ifdef EFI_NT_EMULATOR #define POST_CODE(_Data) -#else +#else #ifdef EFI_DEBUG #define POST_CODE(_Data) __asm mov eax,(_Data) __asm out 0x80,al #else #define POST_CODE(_Data) - #endif + #endif #endif #define EFIERR(a) (0x8000000000000000 | a) #define EFI_ERROR_MASK 0x8000000000000000 -#define EFIERR_OEM(a) (0xc000000000000000 | a) +#define EFIERR_OEM(a) (0xc000000000000000 | a) #define BAD_POINTER 0xFBFBFBFBFBFBFBFB @@ -156,18 +156,18 @@ typedef uint64_t UINTN; // BOOTSERVICE - prototype for implementation of a boot service interface // RUNTIMESERVICE - prototype for implementation of a runtime service interface // RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service -// RUNTIME_CODE - pragma macro for declaring runtime code +// RUNTIME_CODE - pragma macro for declaring runtime code // #ifdef __amd64__ #define EFIAPI __attribute__((ms_abi)) #endif -#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options +#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options #if _MSC_EXTENSIONS - #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler + #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler #else - #define EFIAPI // Substitute expresion to force C calling convention + #define EFIAPI // Substitute expresion to force C calling convention #endif #endif @@ -184,7 +184,7 @@ typedef uint64_t UINTN; #define VOLATILE volatile -#define MEMORY_FENCE() +#define MEMORY_FENCE() #ifdef EFI_NO_INTERFACE_DECL #define EFI_FORWARD_DECLARATION(x) @@ -233,9 +233,9 @@ typedef uint64_t UINTN; #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \ - (_if)->LoadInternal(type, name, NULL) + (_if)->LoadInternal(type, name, NULL) -#else // EFI_NT_EMULATOR +#else // EFI_NT_EMULATOR // // When build similiar to FW, then link everything together as @@ -247,7 +247,7 @@ typedef uint64_t UINTN; #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \ (_if)->LoadInternal(type, name, entry) -#endif // EFI_FW_NT +#endif // EFI_FW_NT #ifdef __FreeBSD__ #define INTERFACE_DECL(x) struct x Modified: head/sys/boot/efi/include/amd64/pe.h ============================================================================== --- head/sys/boot/efi/include/amd64/pe.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/amd64/pe.h Tue Dec 22 20:40:34 2015 (r292625) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* +/* PE32+ header file */ #ifndef _PE_H @@ -8,7 +8,7 @@ #define IMAGE_DOS_SIGNATURE 0x5A4D // MZ #define IMAGE_OS2_SIGNATURE 0x454E // NE #define IMAGE_OS2_SIGNATURE_LE 0x454C // LE -#define IMAGE_NT_SIGNATURE 0x00004550 // PE00 +#define IMAGE_NT_SIGNATURE 0x00004550 // PE00 #define IMAGE_EDOS_SIGNATURE 0x44454550 // PEED @@ -130,7 +130,7 @@ typedef struct _IMAGE_OPTIONAL_HEADER { UINT32 AddressOfEntryPoint; UINT32 BaseOfCode; UINT32 BaseOfData; - + // // NT additional fields. // Modified: head/sys/boot/efi/include/arm64/efibind.h ============================================================================== --- head/sys/boot/efi/include/arm64/efibind.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/arm64/efibind.h Tue Dec 22 20:40:34 2015 (r292625) @@ -37,11 +37,11 @@ Revision History #if (__STDC_VERSION__ < 199901L ) - // No ANSI C 1999/2000 stdint.h integer width declarations + // No ANSI C 1999/2000 stdint.h integer width declarations #if _MSC_EXTENSIONS - // Use Microsoft C compiler integer width declarations + // Use Microsoft C compiler integer width declarations typedef unsigned __int64 uint64_t; typedef __int64 int64_t; @@ -51,10 +51,10 @@ Revision History typedef __int16 int16_t; typedef unsigned __int8 uint8_t; typedef __int8 int8_t; - #else + #else #ifdef UNIX_LP64 - // Use LP64 programming model from C_FLAGS for integer width declarations + // Use LP64 programming model from C_FLAGS for integer width declarations typedef unsigned long uint64_t; typedef long int64_t; @@ -66,7 +66,7 @@ Revision History typedef char int8_t; #else - // Assume P64 programming model from C_FLAGS for integer width declarations + // Assume P64 programming model from C_FLAGS for integer width declarations typedef unsigned long long uint64_t; typedef long long int64_t; @@ -108,10 +108,10 @@ typedef uint64_t UINTN; // #define BIT63 0x8000000000000000 -#define PLATFORM_IOBASE_ADDRESS (0xffffc000000 | BIT63) +#define PLATFORM_IOBASE_ADDRESS (0xffffc000000 | BIT63) #define PORT_TO_MEMD(_Port) (PLATFORM_IOBASE_ADDRESS | ( ( ( (_Port) & 0xfffc) << 10 ) | ( (_Port) & 0x0fff) ) ) - -// + +// // Macro's with casts make this much easier to use and read. // #define PORT_TO_MEM8D(_Port) (*(UINT8 *)(PORT_TO_MEMD(_Port))) @@ -122,12 +122,12 @@ typedef uint64_t UINTN; #define EFIERR(a) (0x8000000000000000 | a) #define EFI_ERROR_MASK 0x8000000000000000 -#define EFIERR_OEM(a) (0xc000000000000000 | a) +#define EFIERR_OEM(a) (0xc000000000000000 | a) #define BAD_POINTER 0xFBFBFBFBFBFBFBFB #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF -#pragma intrinsic (__break) +#pragma intrinsic (__break) #define BREAKPOINT() __break(0) // @@ -155,14 +155,14 @@ typedef uint64_t UINTN; // BOOTSERVICE - prototype for implementation of a boot service interface // RUNTIMESERVICE - prototype for implementation of a runtime service interface // RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service -// RUNTIME_CODE - pragma macro for declaring runtime code +// RUNTIME_CODE - pragma macro for declaring runtime code // -#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options +#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options #if _MSC_EXTENSIONS - #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler + #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler #else - #define EFIAPI // Substitute expresion to force C calling convention + #define EFIAPI // Substitute expresion to force C calling convention #endif #endif @@ -179,8 +179,8 @@ typedef uint64_t UINTN; // // BugBug: Need to find out if this is portable accross compliers. // -void __mfa (void); -#pragma intrinsic (__mfa) +void __mfa (void); +#pragma intrinsic (__mfa) #define MEMORY_FENCE() __mfa() #ifdef EFI_NO_INTERFACE_DECL Modified: head/sys/boot/efi/include/efi.h ============================================================================== --- head/sys/boot/efi/include/efi.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/efi.h Tue Dec 22 20:40:34 2015 (r292625) @@ -54,10 +54,10 @@ Revision History #include "efierr.h" #include "efigop.h" -#define EFI_STRINGIZE(a) #a -#define EFI_PROTOCOL_DEFINITION(a) EFI_STRINGIZE(Protocol/a/a.h) +#define EFI_STRINGIZE(a) #a +#define EFI_PROTOCOL_DEFINITION(a) EFI_STRINGIZE(Protocol/a/a.h) -#define EFI_GUID_DEFINITION(a) EFI_STRINGIZE(Guid/a/a##.h) +#define EFI_GUID_DEFINITION(a) EFI_STRINGIZE(Guid/a/a##.h) #define EFI_GUID_STRING(guidpointer, shortstring, longstring) #endif Modified: head/sys/boot/efi/include/efi_nii.h ============================================================================== --- head/sys/boot/efi/include/efi_nii.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/efi_nii.h Tue Dec 22 20:40:34 2015 (r292625) @@ -21,7 +21,7 @@ Revision history: 2000-Feb-18 M(f)J GUID updated. Structure order changed for machine word alignment. Added StringId[4] to structure. - + 2000-Feb-14 M(f)J Genesis. --*/ Modified: head/sys/boot/efi/include/efidebug.h ============================================================================== --- head/sys/boot/efi/include/efidebug.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/efidebug.h Tue Dec 22 20:40:34 2015 (r292625) @@ -33,12 +33,12 @@ extern UINTN EFIDebug; #define DBGASSERT(a) DbgAssert(__FILE__, __LINE__, #a) #define DEBUG(a) DbgPrint a - + #else #define DBGASSERT(a) #define DEBUG(a) - + #endif #if EFI_DEBUG_CLEAR_MEMORY @@ -60,7 +60,7 @@ extern UINTN EFIDebug; #define D_INFO 0x00000040 // Verbose #define D_VARIABLE 0x00000100 // Variable #define D_VAR 0x00000100 // Variable -#define D_BM 0x00000400 // Boot Manager +#define D_BM 0x00000400 // Boot Manager #define D_BLKIO 0x00001000 // BlkIo Driver #define D_BLKIO_ULTRA 0x00002000 // BlkIo Driver #define D_NET 0x00004000 // SNI Driver @@ -91,9 +91,9 @@ extern UINTN EFIDebug; #else - #define ASSERT(a) - #define ASSERT_LOCKED(l) - #define ASSERT_STRUCT(p,t) + #define ASSERT(a) + #define ASSERT_LOCKED(l) + #define ASSERT_STRUCT(p,t) #endif Modified: head/sys/boot/efi/include/efidef.h ============================================================================== --- head/sys/boot/efi/include/efidef.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/efidef.h Tue Dec 22 20:40:34 2015 (r292625) @@ -70,11 +70,11 @@ typedef VOID *EFI_EVENT; // A GUID // -typedef struct { +typedef struct { UINT32 Data1; UINT16 Data2; UINT16 Data3; - UINT8 Data4[8]; + UINT8 Data4[8]; } EFI_GUID; @@ -82,7 +82,7 @@ typedef struct { // Time // -typedef struct { +typedef struct { UINT16 Year; // 1998 - 20XX UINT8 Month; // 1 - 12 UINT8 Day; // 1 - 31 @@ -165,9 +165,9 @@ typedef enum { #define EFI_MEMORY_WC 0x0000000000000002 #define EFI_MEMORY_WT 0x0000000000000004 #define EFI_MEMORY_WB 0x0000000000000008 -#define EFI_MEMORY_UCE 0x0000000000000010 +#define EFI_MEMORY_UCE 0x0000000000000010 -// physical memory protection on range +// physical memory protection on range #define EFI_MEMORY_WP 0x0000000000001000 #define EFI_MEMORY_RP 0x0000000000002000 #define EFI_MEMORY_XP 0x0000000000004000 Modified: head/sys/boot/efi/include/efidevp.h ============================================================================== --- head/sys/boot/efi/include/efidevp.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/efidevp.h Tue Dec 22 20:40:34 2015 (r292625) @@ -150,8 +150,8 @@ typedef struct _ACPI_EXTENDED_HID_DEVICE // bits[31:16] - binary number // Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z' // -#define PNP_EISA_ID_CONST 0x41d0 -#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16)) +#define PNP_EISA_ID_CONST 0x41d0 +#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16)) #define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId))) #define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId))) @@ -160,7 +160,7 @@ typedef struct _ACPI_EXTENDED_HID_DEVICE /* * */ -#define MESSAGING_DEVICE_PATH 0x03 +#define MESSAGING_DEVICE_PATH 0x03 #define MSG_ATAPI_DP 0x01 typedef struct _ATAPI_DEVICE_PATH { @@ -174,7 +174,7 @@ typedef struct _ATAPI_DEVICE_PATH { typedef struct _SCSI_DEVICE_PATH { EFI_DEVICE_PATH Header; UINT16 Pun; - UINT16 Lun; + UINT16 Lun; } SCSI_DEVICE_PATH; #define MSG_FIBRECHANNEL_DP 0x03 @@ -281,9 +281,9 @@ typedef struct _UART_DEVICE_PATH { #define DEVICE_PATH_MESSAGING_VT_100_PLUS \ { 0x7baec70b, 0x57e0, 0x4c76, 0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 } - + #define DEVICE_PATH_MESSAGING_VT_UTF8 \ - { 0xad15a0d6, 0x8bec, 0x4acf, 0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } + { 0xad15a0d6, 0x8bec, 0x4acf, 0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } #define MEDIA_DEVICE_PATH 0x04 @@ -356,7 +356,7 @@ typedef union { PCCARD_DEVICE_PATH PcCard; MEMMAP_DEVICE_PATH MemMap; VENDOR_DEVICE_PATH Vendor; - UNKNOWN_DEVICE_VENDOR_DEVICE_PATH UnknownVendor; + UNKNOWN_DEVICE_VENDOR_DEVICE_PATH UnknownVendor; CONTROLLER_DEVICE_PATH Controller; ACPI_HID_DEVICE_PATH Acpi; @@ -390,7 +390,7 @@ typedef union { PCCARD_DEVICE_PATH *PcCard; MEMMAP_DEVICE_PATH *MemMap; VENDOR_DEVICE_PATH *Vendor; - UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *UnknownVendor; + UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *UnknownVendor; CONTROLLER_DEVICE_PATH *Controller; ACPI_HID_DEVICE_PATH *Acpi; ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi; Modified: head/sys/boot/efi/include/efifs.h ============================================================================== --- head/sys/boot/efi/include/efifs.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/efifs.h Tue Dec 22 20:40:34 2015 (r292625) @@ -101,7 +101,7 @@ typedef struct _EFI_LBAL { UINT32 ArrayCount; } EFI_LBAL; -// Array size +// Array size #define EFI_LBAL_ARRAY_SIZE(lbal,offs,blks) \ (((blks) - (offs) - (lbal)->Hdr.HeaderSize) / sizeof(EFI_RL)) Modified: head/sys/boot/efi/include/efinet.h ============================================================================== --- head/sys/boot/efi/include/efinet.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/efinet.h Tue Dec 22 20:40:34 2015 (r292625) @@ -173,8 +173,8 @@ typedef struct { /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_START) ( IN struct _EFI_SIMPLE_NETWORK *This ); @@ -182,8 +182,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_STOP) ( IN struct _EFI_SIMPLE_NETWORK *This ); @@ -191,8 +191,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE) ( IN struct _EFI_SIMPLE_NETWORK *This, IN UINTN ExtraRxBufferSize OPTIONAL, @@ -202,8 +202,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_RESET) ( IN struct _EFI_SIMPLE_NETWORK *This, IN BOOLEAN ExtendedVerification @@ -212,8 +212,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN) ( IN struct _EFI_SIMPLE_NETWORK *This ); @@ -221,8 +221,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS) ( IN struct _EFI_SIMPLE_NETWORK *This, IN UINT32 Enable, @@ -235,8 +235,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS) ( IN struct _EFI_SIMPLE_NETWORK *This, IN BOOLEAN Reset, @@ -246,8 +246,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS) ( IN struct _EFI_SIMPLE_NETWORK *This, IN BOOLEAN Reset, @@ -258,8 +258,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC) ( IN struct _EFI_SIMPLE_NETWORK *This, IN BOOLEAN IPv6, @@ -270,8 +270,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_NVDATA) ( IN struct _EFI_SIMPLE_NETWORK *This, IN BOOLEAN ReadWrite, @@ -283,8 +283,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS) ( IN struct _EFI_SIMPLE_NETWORK *This, OUT UINT32 *InterruptStatus OPTIONAL, @@ -294,8 +294,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT) ( IN struct _EFI_SIMPLE_NETWORK *This, IN UINTN HeaderSize, @@ -309,8 +309,8 @@ EFI_STATUS /////////////////////////////////////////////////////////////////////////////// // -typedef -EFI_STATUS +typedef +EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE) ( IN struct _EFI_SIMPLE_NETWORK *This, OUT UINTN *HeaderSize OPTIONAL, Modified: head/sys/boot/efi/include/efipart.h ============================================================================== --- head/sys/boot/efi/include/efipart.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/efipart.h Tue Dec 22 20:40:34 2015 (r292625) @@ -16,8 +16,8 @@ Intel Corporation. Module Name: efipart.h - -Abstract: + +Abstract: Info about disk partitions and Master Boot Records @@ -55,7 +55,7 @@ typedef struct { #define MIN_MBR_DEVICE_SIZE 0x80000 #define MBR_ERRATA_PAD 0x40000 // 128 MB -#define MAX_MBR_PARTITIONS +#define MAX_MBR_PARTITIONS 4 typedef struct { UINT8 BootStrapCode[440]; UINT8 UniqueMbrSignature[4]; Modified: head/sys/boot/efi/include/efipciio.h ============================================================================== --- head/sys/boot/efi/include/efipciio.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/efipciio.h Tue Dec 22 20:40:34 2015 (r292625) @@ -1,16 +1,16 @@ /* $FreeBSD$ */ /** @file - EFI PCI I/O Protocol provides the basic Memory, I/O, PCI configuration, + EFI PCI I/O Protocol provides the basic Memory, I/O, PCI configuration, and DMA interfaces that a driver uses to access its PCI controller. Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
- This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ Modified: head/sys/boot/efi/include/efiprot.h ============================================================================== --- head/sys/boot/efi/include/efiprot.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/efiprot.h Tue Dec 22 20:40:34 2015 (r292625) @@ -307,9 +307,9 @@ typedef struct { // // The FileName field of the EFI_FILE_INFO data structure is variable length. // Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to -// be the size of the data structure without the FileName field. The following macro +// be the size of the data structure without the FileName field. The following macro // computes this size correctly no matter how big the FileName array is declared. -// This is required to make the EFI_FILE_INFO data structure ANSI compilant. +// This is required to make the EFI_FILE_INFO data structure ANSI compilant. // #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName) @@ -329,9 +329,9 @@ typedef struct { // // The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length. // Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs -// to be the size of the data structure without the VolumeLable field. The following macro +// to be the size of the data structure without the VolumeLable field. The following macro // computes this size correctly no matter how big the VolumeLable array is declared. -// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant. +// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant. // #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel) @@ -411,7 +411,7 @@ typedef struct { EFI_DEVICE_IO Write; } EFI_IO_ACCESS; -typedef +typedef EFI_STATUS (EFIAPI *EFI_PCI_DEVICE_PATH) ( IN struct _EFI_DEVICE_IO_INTERFACE *This, Modified: head/sys/boot/efi/include/efipxebc.h ============================================================================== --- head/sys/boot/efi/include/efipxebc.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/efipxebc.h Tue Dec 22 20:40:34 2015 (r292625) @@ -151,7 +151,7 @@ typedef struct { // Discover() definitions // -#define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0 +#define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0 #define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS 1 #define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM 2 #define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI 3 @@ -356,7 +356,7 @@ typedef EFI_STATUS (EFIAPI *EFI_PXE_BASE_CODE_ARP) ( IN struct _EFI_PXE_BASE_CODE *This, - IN EFI_IP_ADDRESS *IpAddr, + IN EFI_IP_ADDRESS *IpAddr, IN EFI_MAC_ADDRESS *MacAddr OPTIONAL ); @@ -455,7 +455,7 @@ typedef enum { } EFI_PXE_BASE_CODE_CALLBACK_STATUS; typedef -EFI_PXE_BASE_CODE_CALLBACK_STATUS +EFI_PXE_BASE_CODE_CALLBACK_STATUS (EFIAPI *EFI_PXE_CALLBACK) ( IN struct _EFI_PXE_BASE_CODE_CALLBACK *This, IN EFI_PXE_BASE_CODE_FUNCTION Function, Modified: head/sys/boot/efi/include/efiser.h ============================================================================== --- head/sys/boot/efi/include/efiser.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/efiser.h Tue Dec 22 20:40:34 2015 (r292625) @@ -35,8 +35,8 @@ Revision History INTERFACE_DECL(_SERIAL_IO_INTERFACE); typedef enum { - DefaultParity, - NoParity, + DefaultParity, + NoParity, EvenParity, OddParity, MarkParity, @@ -44,7 +44,7 @@ typedef enum { } EFI_PARITY_TYPE; typedef enum { - DefaultStopBits + DefaultStopBits, OneStopBit, // 1 stop bit OneFiveStopBits, // 1.5 stop bits TwoStopBits // 2 stop bits Modified: head/sys/boot/efi/include/efiuga.h ============================================================================== --- head/sys/boot/efi/include/efiuga.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/efiuga.h Tue Dec 22 20:40:34 2015 (r292625) @@ -102,33 +102,33 @@ typedef enum { The following table defines actions for BltOperations: - EfiUgaVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY) - directly to every pixel of the video display rectangle - (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). + EfiUgaVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY) + directly to every pixel of the video display rectangle + (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). Only one pixel will be used from the BltBuffer. Delta is NOT used. - EfiUgaVideoToBltBuffer - Read data from the video display rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in - the BltBuffer rectangle (DestinationX, DestinationY ) - (DestinationX + Width, DestinationY + Height). If DestinationX or - DestinationY is not zero then Delta must be set to the length in bytes + EfiUgaVideoToBltBuffer - Read data from the video display rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in + the BltBuffer rectangle (DestinationX, DestinationY ) + (DestinationX + Width, DestinationY + Height). If DestinationX or + DestinationY is not zero then Delta must be set to the length in bytes of a row in the BltBuffer. - EfiUgaBltBufferToVideo - Write data from the BltBuffer rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the - video display rectangle (DestinationX, DestinationY) - (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is - not zero then Delta must be set to the length in bytes of a row in the + EfiUgaBltBufferToVideo - Write data from the BltBuffer rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the + video display rectangle (DestinationX, DestinationY) + (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is + not zero then Delta must be set to the length in bytes of a row in the BltBuffer. EfiUgaVideoToVideo - Copy from the video display rectangle (SourceX, SourceY) - (SourceX + Width, SourceY + Height) .to the video display rectangle - (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). + (SourceX + Width, SourceY + Height) .to the video display rectangle + (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). The BltBuffer and Delta are not used in this mode. @param[in] This - Protocol instance pointer. - @param[in] BltBuffer - Buffer containing data to blit into video buffer. This + @param[in] BltBuffer - Buffer containing data to blit into video buffer. This buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL) @param[in] BltOperation - Operation to perform on BlitBuffer and video memory @param[in] SourceX - X coordinate of source for the BltBuffer. @@ -138,7 +138,7 @@ typedef enum { @param[in] Width - Width of rectangle in BltBuffer in pixels. @param[in] Height - Hight of rectangle in BltBuffer in pixels. @param[in] Delta - OPTIONAL - + @retval EFI_SUCCESS - The Blt operation completed. @retval EFI_INVALID_PARAMETER - BltOperation is not valid. @retval EFI_DEVICE_ERROR - A hardware error occured writting to the video buffer. Modified: head/sys/boot/efi/include/i386/efibind.h ============================================================================== --- head/sys/boot/efi/include/i386/efibind.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/i386/efibind.h Tue Dec 22 20:40:34 2015 (r292625) @@ -37,11 +37,11 @@ Revision History #if (__STDC_VERSION__ < 199901L ) - // No ANSI C 1999/2000 stdint.h integer width declarations + // No ANSI C 1999/2000 stdint.h integer width declarations #if _MSC_EXTENSIONS - // Use Microsoft C compiler integer width declarations + // Use Microsoft C compiler integer width declarations typedef unsigned __int64 uint64_t; typedef __int64 int64_t; @@ -51,10 +51,10 @@ Revision History typedef short int16_t; typedef unsigned char uint8_t; typedef char int8_t; - #else + #else #ifdef UNIX_LP64 - // Use LP64 programming model from C_FLAGS for integer width declarations + // Use LP64 programming model from C_FLAGS for integer width declarations typedef unsigned long uint64_t; typedef long int64_t; @@ -66,7 +66,7 @@ Revision History typedef char int8_t; #else - // Assume P64 programming model from C_FLAGS for integer width declarations + // Assume P64 programming model from C_FLAGS for integer width declarations typedef unsigned long long uint64_t; typedef long long int64_t; @@ -112,17 +112,17 @@ typedef uint32_t UINTN; #ifdef EFI_NT_EMULATOR #define POST_CODE(_Data) -#else +#else #ifdef EFI_DEBUG #define POST_CODE(_Data) __asm mov eax,(_Data) __asm out 0x80,al #else #define POST_CODE(_Data) - #endif + #endif #endif #define EFIERR(a) (0x80000000 | a) #define EFI_ERROR_MASK 0x80000000 -#define EFIERR_OEM(a) (0xc0000000 | a) +#define EFIERR_OEM(a) (0xc0000000 | a) #define BAD_POINTER 0xFBFBFBFB @@ -156,14 +156,14 @@ typedef uint32_t UINTN; // BOOTSERVICE - prototype for implementation of a boot service interface // RUNTIMESERVICE - prototype for implementation of a runtime service interface // RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service -// RUNTIME_CODE - pragma macro for declaring runtime code +// RUNTIME_CODE - pragma macro for declaring runtime code // -#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options +#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options #if _MSC_EXTENSIONS - #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler + #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler #else - #define EFIAPI // Substitute expresion to force C calling convention + #define EFIAPI // Substitute expresion to force C calling convention #endif #endif @@ -180,7 +180,7 @@ typedef uint32_t UINTN; #define VOLATILE volatile -#define MEMORY_FENCE() +#define MEMORY_FENCE() #ifdef EFI_NO_INTERFACE_DECL #define EFI_FORWARD_DECLARATION(x) @@ -229,9 +229,9 @@ typedef uint32_t UINTN; #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \ - (_if)->LoadInternal(type, name, NULL) + (_if)->LoadInternal(type, name, NULL) -#else // EFI_NT_EMULATOR +#else // EFI_NT_EMULATOR // // When build similiar to FW, then link everything together as @@ -243,7 +243,7 @@ typedef uint32_t UINTN; #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \ (_if)->LoadInternal(type, name, entry) -#endif // EFI_FW_NT +#endif // EFI_FW_NT #ifdef __FreeBSD__ #define INTERFACE_DECL(x) struct x Modified: head/sys/boot/efi/include/i386/pe.h ============================================================================== --- head/sys/boot/efi/include/i386/pe.h Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/include/i386/pe.h Tue Dec 22 20:40:34 2015 (r292625) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* +/* PE32+ header file */ #ifndef _PE_H @@ -8,7 +8,7 @@ #define IMAGE_DOS_SIGNATURE 0x5A4D // MZ #define IMAGE_OS2_SIGNATURE 0x454E // NE #define IMAGE_OS2_SIGNATURE_LE 0x454C // LE -#define IMAGE_NT_SIGNATURE 0x00004550 // PE00 +#define IMAGE_NT_SIGNATURE 0x00004550 // PE00 #define IMAGE_EDOS_SIGNATURE 0x44454550 // PEED @@ -130,7 +130,7 @@ typedef struct _IMAGE_OPTIONAL_HEADER { UINT32 AddressOfEntryPoint; UINT32 BaseOfCode; UINT32 BaseOfData; - + // // NT additional fields. // @@ -607,7 +607,7 @@ typedef struct { UINT32 Signature; // "NB10" UINT32 Unknown; UINT32 Unknown2; - UINT32 Unknown3; + UINT32 Unknown3; // // Filename of .PDB goes here // @@ -619,9 +619,9 @@ typedef struct { UINT32 Signature; // "RSDS" UINT32 Unknown; UINT32 Unknown2; - UINT32 Unknown3; - UINT32 Unknown4; - UINT32 Unknown5; + UINT32 Unknown3; + UINT32 Unknown4; + UINT32 Unknown5; // // Filename of .PDB goes here // Modified: head/sys/boot/efi/libefi/efinet.c ============================================================================== --- head/sys/boot/efi/libefi/efinet.c Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/libefi/efinet.c Tue Dec 22 20:40:34 2015 (r292625) @@ -50,7 +50,7 @@ static int efinet_match(struct netif *, static int efinet_probe(struct netif *, void *); static int efinet_put(struct iodesc *, void *, size_t); -struct netif_driver efinetif = { +struct netif_driver efinetif = { .netif_bname = "efinet", .netif_match = efinet_match, .netif_probe = efinet_probe, @@ -132,7 +132,7 @@ efinet_put(struct iodesc *desc, void *pk buf = 0; /* XXX Is this needed? */ status = net->GetStatus(net, 0, &buf); /* - * XXX EFI1.1 and the E1000 card returns a different + * XXX EFI1.1 and the E1000 card returns a different * address than we gave. Sigh. */ } while (status == EFI_SUCCESS && buf == 0); @@ -234,7 +234,7 @@ efinet_init(struct iodesc *desc, void *m static void efinet_end(struct netif *nif) { - EFI_SIMPLE_NETWORK *net = nif->nif_devdata; + EFI_SIMPLE_NETWORK *net = nif->nif_devdata; net->Shutdown(net); } Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/libefi/efipart.c Tue Dec 22 20:40:34 2015 (r292625) @@ -60,7 +60,7 @@ struct devsw efipart_dev = { }; static int -efipart_init(void) +efipart_init(void) { EFI_BLOCK_IO *blkio; EFI_DEVICE_PATH *devpath, *devpathcpy, *tmpdevpath, *node; @@ -174,7 +174,7 @@ efipart_print(int verbose) } } -static int +static int efipart_open(struct open_file *f, ...) { va_list args; @@ -202,7 +202,7 @@ efipart_open(struct open_file *f, ...) return (0); } -static int +static int efipart_close(struct open_file *f) { struct devdesc *dev; @@ -255,7 +255,7 @@ efipart_readwrite(EFI_BLOCK_IO *blkio, i return (efi_status_to_errno(status)); } -static int +static int efipart_strategy(void *devdata, int rw, daddr_t blk, size_t size, char *buf, size_t *rsize) { Modified: head/sys/boot/efi/libefi/time.c ============================================================================== --- head/sys/boot/efi/libefi/time.c Tue Dec 22 20:37:34 2015 (r292624) +++ head/sys/boot/efi/libefi/time.c Tue Dec 22 20:40:34 2015 (r292625) @@ -2,28 +2,28 @@ * Copyright (c) 1999, 2000 * Intel Corporation. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Dec 22 21:07:34 2015 Return-Path: Delivered-To: svn-src-all@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 8EF4AA4FBF3; Tue, 22 Dec 2015 21:07:34 +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 5E97613B7; Tue, 22 Dec 2015 21:07:34 +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 tBML7XMm053902; Tue, 22 Dec 2015 21:07:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBML7XUO053901; Tue, 22 Dec 2015 21:07:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512222107.tBML7XUO053901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 22 Dec 2015 21:07:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292626 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 21:07:34 -0000 Author: ngie Date: Tue Dec 22 21:07:33 2015 New Revision: 292626 URL: https://svnweb.freebsd.org/changeset/base/292626 Log: Fold lim_shared into lim_copy to mute a -Wunused compiler warning from clang when the kernel is compiled without INVARIANTS Differential Revision: https://reviews.freebsd.org/D4683 Reviewed by: kib, jhb MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/kern_resource.c Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Tue Dec 22 20:40:34 2015 (r292625) +++ head/sys/kern/kern_resource.c Tue Dec 22 21:07:33 2015 (r292626) @@ -80,8 +80,6 @@ static int donice(struct thread *td, str static struct uidinfo *uilookup(uid_t uid); static void ruxagg_locked(struct rusage_ext *rux, struct thread *td); -static __inline int lim_shared(struct plimit *limp); - /* * Resource controls and accounting. */ @@ -1109,13 +1107,6 @@ lim_hold(struct plimit *limp) return (limp); } -static __inline int -lim_shared(struct plimit *limp) -{ - - return (limp->pl_refcnt > 1); -} - void lim_fork(struct proc *p1, struct proc *p2) { @@ -1146,7 +1137,7 @@ void lim_copy(struct plimit *dst, struct plimit *src) { - KASSERT(!lim_shared(dst), ("lim_copy to shared limit")); + KASSERT(dst->pl_refcnt <= 1, ("lim_copy to shared limit")); bcopy(src->pl_rlimit, dst->pl_rlimit, sizeof(src->pl_rlimit)); } From owner-svn-src-all@freebsd.org Tue Dec 22 21:26:51 2015 Return-Path: Delivered-To: svn-src-all@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 E2D5BA4F1BD; Tue, 22 Dec 2015 21:26:51 +0000 (UTC) (envelope-from andreast@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 B2B4E1D5D; Tue, 22 Dec 2015 21:26:51 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBMLQobV059543; Tue, 22 Dec 2015 21:26:50 GMT (envelope-from andreast@FreeBSD.org) Received: (from andreast@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMLQoR1059542; Tue, 22 Dec 2015 21:26:50 GMT (envelope-from andreast@FreeBSD.org) Message-Id: <201512222126.tBMLQoR1059542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andreast set sender to andreast@FreeBSD.org using -f From: Andreas Tobler Date: Tue, 22 Dec 2015 21:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292627 - head/contrib/gcc/config/rs6000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 21:26:52 -0000 Author: andreast Date: Tue Dec 22 21:26:50 2015 New Revision: 292627 URL: https://svnweb.freebsd.org/changeset/base/292627 Log: Silence a boring warning. Modified: head/contrib/gcc/config/rs6000/sysv4.h Modified: head/contrib/gcc/config/rs6000/sysv4.h ============================================================================== --- head/contrib/gcc/config/rs6000/sysv4.h Tue Dec 22 21:07:33 2015 (r292626) +++ head/contrib/gcc/config/rs6000/sysv4.h Tue Dec 22 21:26:50 2015 (r292627) @@ -282,7 +282,9 @@ do { \ #define RESTORE_FP_SUFFIX "_l" /* Type used for ptrdiff_t, as a string used in a declaration. */ +#ifndef PTRDIFF_TYPE #define PTRDIFF_TYPE "int" +#endif /* Type used for wchar_t, as a string used in a declaration. */ /* Override svr4.h definition. */ From owner-svn-src-all@freebsd.org Tue Dec 22 21:30:57 2015 Return-Path: Delivered-To: svn-src-all@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 4EA3DA4F386; Tue, 22 Dec 2015 21:30:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 182F6107E; Tue, 22 Dec 2015 21:30:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id E85C94281B9; Wed, 23 Dec 2015 08:02:11 +1100 (AEDT) Date: Wed, 23 Dec 2015 08:02:10 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292620 - head/sys/kern In-Reply-To: <201512222012.tBMKCqqg039018@repo.freebsd.org> Message-ID: <20151223073258.M993@besplex.bde.org> References: <201512222012.tBMKCqqg039018@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.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=g1POIRE1eMl8mroPKJgA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 21:30:57 -0000 On Tue, 22 Dec 2015, Konstantin Belousov wrote: > Log: > If we annoy user with the terminal output due to failed load of > interpreter, also show the actual error code instead of some > interpretation. This and nearby messages are of annoyingly low quality. They don't even print the program name(s). I use the following partial fixes. I forget if they print the program name or the interpeter name. X Index: imgact_elf.c X =================================================================== X RCS file: /home/ncvs/src/sys/kern/imgact_elf.c,v X retrieving revision 1.151 X diff -u -2 -r1.151 imgact_elf.c X --- imgact_elf.c 5 Jun 2004 02:18:28 -0000 1.151 X +++ imgact_elf.c 5 Jun 2004 06:51:25 -0000 X @@ -694,6 +693,6 @@ X brand_info = __elfN(get_brandinfo)(hdr, interp); X if (brand_info == NULL) { X - uprintf("ELF binary type \"%u\" not known.\n", X - hdr->e_ident[EI_OSABI]); X + uprintf("%s: ELF binary type \"%u\" not known.\n", X + imgp->stringbase, hdr->e_ident[EI_OSABI]); X error = ENOEXEC; X goto fail; X @@ -828,5 +827,6 @@ X &imgp->entry_addr, sv->sv_pagesize); X if (error != 0) { X - uprintf("ELF interpreter %s not found\n", interp); X + uprintf("%s: ELF interpreter %s not found\n", X + imgp->stringbase, interp); X goto fail; X } Other uprintf()s in imgact_elf.c are worse -- they print a fixed string that gives no hint about the intepreter either (except it sometimes says ELF or elf or PT_). Y uprintf("elf_load_section: truncated ELF file\n"); Y uprintf("Program headers not in the first page\n"); Y uprintf("Unaligned program headers\n"); Y uprintf("Invalid PT_INTERP\n"); Y uprintf("i/o error PT_INTERP\n"); Y uprintf("Cannot execute shared object\n"); Y uprintf("%s\n", err_str); Y uprintf("ELF interpreter %s not found\n", interp); Y uprintf("i/o error PT_NOTE\n"); The "ELF binary type \"%u\" not known.\n", message is the only one with the style bug of a terminating ".". My patch is missing the fix for this. "elf_load_section: truncated ELF file\n" messages is the only one that prints the function name. This is not very useful for users. All kernel printfs and KASSERT()s in the file use __func__ to obfuscate the function name and have many other style bugs. uprintf() is rarely used. Aproximately 100 times. Most uses don't print enough context. In kern_exec.c there is a related one that prints a pathname, but not in err() format with the name first. The problematic pathname or interpreter name may be nested. I'm not sure how to find the complete sequence of names. tprintf() is only used 7 times. Some uprintf()s should probably be tprintf()s to get them logged. Bruce From owner-svn-src-all@freebsd.org Tue Dec 22 21:35:45 2015 Return-Path: Delivered-To: svn-src-all@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 7B47FA4F5BE; Tue, 22 Dec 2015 21:35:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D9AC1486; Tue, 22 Dec 2015 21:35:45 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id E14B2B94C; Tue, 22 Dec 2015 16:35:43 -0500 (EST) From: John Baldwin To: Garrett Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292626 - head/sys/kern Date: Tue, 22 Dec 2015 13:17:10 -0800 Message-ID: <3052030.KADVjZoIBd@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201512222107.tBML7XUO053901@repo.freebsd.org> References: <201512222107.tBML7XUO053901@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.2.7 (bigwig.baldwin.cx); Tue, 22 Dec 2015 16:35:44 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 21:35:45 -0000 On Tuesday, December 22, 2015 09:07:33 PM Garrett Cooper wrote: > Author: ngie > Date: Tue Dec 22 21:07:33 2015 > New Revision: 292626 > URL: https://svnweb.freebsd.org/changeset/base/292626 > > Log: > Fold lim_shared into lim_copy to mute a -Wunused compiler warning from > clang when the kernel is compiled without INVARIANTS > > Differential Revision: https://reviews.freebsd.org/D4683 > Reviewed by: kib, jhb > MFC after: 1 week > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/kern/kern_resource.c > > Modified: head/sys/kern/kern_resource.c > ============================================================================== > --- head/sys/kern/kern_resource.c Tue Dec 22 20:40:34 2015 (r292625) > +++ head/sys/kern/kern_resource.c Tue Dec 22 21:07:33 2015 (r292626) > @@ -80,8 +80,6 @@ static int donice(struct thread *td, str > static struct uidinfo *uilookup(uid_t uid); > static void ruxagg_locked(struct rusage_ext *rux, struct thread *td); > > -static __inline int lim_shared(struct plimit *limp); > - > /* > * Resource controls and accounting. > */ > @@ -1109,13 +1107,6 @@ lim_hold(struct plimit *limp) > return (limp); > } > > -static __inline int > -lim_shared(struct plimit *limp) > -{ > - > - return (limp->pl_refcnt > 1); > -} > - > void > lim_fork(struct proc *p1, struct proc *p2) > { > @@ -1146,7 +1137,7 @@ void > lim_copy(struct plimit *dst, struct plimit *src) > { > > - KASSERT(!lim_shared(dst), ("lim_copy to shared limit")); > + KASSERT(dst->pl_refcnt <= 1, ("lim_copy to shared limit")); It shouldn't be zero, I think == 1 would be best actually. -- John Baldwin From owner-svn-src-all@freebsd.org Tue Dec 22 21:48:27 2015 Return-Path: Delivered-To: svn-src-all@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 50E1EA4FB07; Tue, 22 Dec 2015 21:48:27 +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 1B56F1FBC; Tue, 22 Dec 2015 21:48:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id F2FC4D62764; Wed, 23 Dec 2015 08:26:46 +1100 (AEDT) Date: Wed, 23 Dec 2015 08:26:46 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292621 - head/sys/fs/devfs In-Reply-To: <201512222022.tBMKMH80041925@repo.freebsd.org> Message-ID: <20151223080243.H993@besplex.bde.org> References: <201512222022.tBMKMH80041925@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.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=r5tAJkBtihdERt8MAFMA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 21:48:27 -0000 On Tue, 22 Dec 2015, Konstantin Belousov wrote: > Log: > Keep devfs mount locked for the whole duration of the devfs_setattr(), > and ensure that our dirent is instantiated. > > Reported and tested by: bde > Sponsored by: The FreeBSD Foundation > MFC after: 1 week Thanks. This is part of fixing revoke(2). Even stat() doesn't work right when it races revoke(). setattr() is used surprisingly often since it is used for opening with O_TRUNC. open() racing with revoke() caused problems doing the truncation even though truncation is a no-op for devfs. Truncation is not atomic for opening with O_TRUNC. Bruce From owner-svn-src-all@freebsd.org Tue Dec 22 21:52:10 2015 Return-Path: Delivered-To: svn-src-all@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 DCE93A4FBE7; Tue, 22 Dec 2015 21:52:10 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x22a.google.com (mail-ig0-x22a.google.com [IPv6:2607:f8b0:4001:c05::22a]) (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 AF0B51356; Tue, 22 Dec 2015 21:52:10 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ig0-x22a.google.com with SMTP id m11so57383979igk.1; Tue, 22 Dec 2015 13:52:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=LFXR3lvH0FMan4gJi6s//Whezg+hJaQlFOWIl+TEot8=; b=tv8FJPf3rYI/2gFzDlc7l09BozftkyAAzO+dLKY71T2l7kH70odNCSs3pd+6OjJ2uK rJjKGKJ8bjXaF4soOTufUTA+MWn/Zw3IQ4Ty520vMCbm7lqKibIQg0AjS22XTprBZx6s DKOQlEH63PO2T0hpzQQFq0IZrfQRJFY4VrB77QUiajonztSsfn+nPNNI9br7Azpz3Ja1 QQkiu0vvzRCxq02xZQneGrF4zZTQfy3yT4qUy2UM97X638SNK4DueHSR8esfIn2+j+mu KsBAFqb/F/f3OgGqvEYtT03H6Xey2x5XmZ5z/EJwHfVTEYOhishp64Et4AXfbUfOnPNw 6Vcg== X-Received: by 10.50.112.34 with SMTP id in2mr27618224igb.58.1450821130034; Tue, 22 Dec 2015 13:52:10 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.163.66 with HTTP; Tue, 22 Dec 2015 13:51:50 -0800 (PST) In-Reply-To: <201512191842.tBJIgohI010539@repo.freebsd.org> References: <201512191842.tBJIgohI010539@repo.freebsd.org> From: Ed Maste Date: Tue, 22 Dec 2015 16:51:50 -0500 X-Google-Sender-Auth: fYKYNjx9tvPKHhxRH1AFB5-Cz9Y Message-ID: Subject: Re: svn commit: r292469 - in head/sys: dev/drm2/ttm mips/include mips/mips vm To: Alan Cox 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 21:52:11 -0000 On 19 December 2015 at 13:42, Alan Cox wrote: > Author: alc > Date: Sat Dec 19 18:42:50 2015 > New Revision: 292469 > URL: https://svnweb.freebsd.org/changeset/base/292469 > > Log: > Introduce a new mechanism for relocating virtual pages to a new physical > address and use this mechanism when: Universe build is failing on powerpc.powerpc with: cc1: warnings being treated as errors /scratch/tmp/emaste/freebsd/sys/vm/vm_page.c: In function 'vm_page_reclaim_run': /scratch/tmp/emaste/freebsd/sys/vm/vm_page.c:2449: warning: comparison is always true due to limited range of data type *** [vm_page.o] Error code 1 From owner-svn-src-all@freebsd.org Tue Dec 22 22:29:39 2015 Return-Path: Delivered-To: svn-src-all@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 94A32A5063C; Tue, 22 Dec 2015 22:29:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x22d.google.com (mail-pf0-x22d.google.com [IPv6:2607:f8b0:400e:c00::22d]) (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 6DB701F96; Tue, 22 Dec 2015 22:29:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22d.google.com with SMTP id 78so39889117pfw.2; Tue, 22 Dec 2015 14:29:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FTF25jJkwwdr2nqi/aYrS9CgxqYIg3k91BI1BWgCVX0=; b=qmrOIwCWVv8KnTadaL/UD2rAxil6/QB337t+UENqOCMT1jOVmi3aJiPX5b3d0eRPM4 tZmtKOV9wehGx/MsXbiIaxos3ziGxVGafHJ7tDCPhVjcb6bGifyUHPoEZx2IIFjGBWB2 7LCLiZ8G15GJiKoDE/0emzPZ+Sn7rqTWdpOG3yB04hB1Jo1o9SkeXHjF2cwm4YwCZKoD KdsyvIMkG1WCSlhTdPC+f3EWsyBCTbUWjisR9GaDFqT0pE0SrdIjM9fVJ7dfBePY9BXd Y4U+1trxHsFbOVxwJeT+X3+wlgWuQB78n7svKO+X3cBZmCsXtua9jVDFo8yeDQEKYuH2 2vHg== X-Received: by 10.98.73.218 with SMTP id r87mr39430445pfi.20.1450823378968; Tue, 22 Dec 2015 14:29:38 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:3046:341c:d40a:9ef1? ([2601:601:800:126d:3046:341c:d40a:9ef1]) by smtp.gmail.com with ESMTPSA id fl9sm48051977pab.33.2015.12.22.14.29.36 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Dec 2015 14:29:37 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r292626 - head/sys/kern From: NGie Cooper In-Reply-To: <3052030.KADVjZoIBd@ralph.baldwin.cx> Date: Tue, 22 Dec 2015 14:29:36 -0800 Cc: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2BB34BE5-B312-42DA-B89E-F25B823B9831@gmail.com> References: <201512222107.tBML7XUO053901@repo.freebsd.org> <3052030.KADVjZoIBd@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 22:29:39 -0000 > On Dec 22, 2015, at 13:17, John Baldwin wrote: >=20 > On Tuesday, December 22, 2015 09:07:33 PM Garrett Cooper wrote: =E2=80=A6 > It shouldn't be zero, I think =3D=3D 1 would be best actually. I=E2=80=99ll boot up GENERIC and see whether or not it works with =3D=3D = 1. Thanks :)! -NGie= From owner-svn-src-all@freebsd.org Tue Dec 22 22:40:43 2015 Return-Path: Delivered-To: svn-src-all@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 D6A8EA50A10; Tue, 22 Dec 2015 22:40:43 +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 A7CF4182B; Tue, 22 Dec 2015 22:40:43 +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 tBMMegs8079866; Tue, 22 Dec 2015 22:40:42 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBMMeg5S079865; Tue, 22 Dec 2015 22:40:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512222240.tBMMeg5S079865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 22 Dec 2015 22:40:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292629 - head/contrib/libexecinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 22:40:43 -0000 Author: bapt Date: Tue Dec 22 22:40:42 2015 New Revision: 292629 URL: https://svnweb.freebsd.org/changeset/base/292629 Log: backtrace.3: Fix prototype of backtrace_symbols_fd_fmt(). While here, fix a typo Submitted by: Sascha Wildner Obtained from: DragonflyBSD Modified: head/contrib/libexecinfo/backtrace.3 Modified: head/contrib/libexecinfo/backtrace.3 ============================================================================== --- head/contrib/libexecinfo/backtrace.3 Tue Dec 22 22:32:19 2015 (r292628) +++ head/contrib/libexecinfo/backtrace.3 Tue Dec 22 22:40:42 2015 (r292629) @@ -28,7 +28,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 3, 2015 +.Dd December 12, 2015 .Dt BACKTRACE 3 .Os .Sh NAME @@ -47,7 +47,7 @@ .Ft "char **" .Fn backtrace_symbols_fmt "void * const *addrlist" "size_t len" "const char *fmt" .Ft int -.Fn backtrace_symbols_fd_fmt "void * const *addrlist" "size_t len" "const char *fmt" "int fd" +.Fn backtrace_symbols_fd_fmt "void * const *addrlist" "size_t len" "int fd" "const char *fmt" .Sh DESCRIPTION The .Fn backtrace @@ -85,7 +85,7 @@ the /proc filesystem is available to det The difference of the symbol address and the address element printed using 0x%tx. .It Dv D -The difference of the symbol addresss and the address element printed using +The difference of the symbol address and the address element printed using +0x%tx if non-zero, or nothing if zero. .It Dv f The filename of the symbol as determined by From owner-svn-src-all@freebsd.org Tue Dec 22 23:48:00 2015 Return-Path: Delivered-To: svn-src-all@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 8F75BA4FFCA; Tue, 22 Dec 2015 23:48:00 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ig0-x229.google.com (mail-ig0-x229.google.com [IPv6:2607:f8b0:4001: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 677891DE1; Tue, 22 Dec 2015 23:48:00 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-ig0-x229.google.com with SMTP id mv3so58762284igc.0; Tue, 22 Dec 2015 15:48:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=3syBlYlbNlqLmjfY93ao1A6tvSs4plhQ5yTBcaezEMU=; b=YlVg71rnOIEbPHHZbj038pMa3iiaN8jnGs78HOATQOaYroiJt0tqclsLmPnsMsskAm U7XUSNfm+/FBBKqK3+sbsppZ4PKB5QtPEUCb7qGWXAutcizmXucKG1fal2665+ewQe6u ieDP2Zek4nMmAx3g17C81CRaauipqXhA2eeEEt/KsSpHzfuDa1rrXxSC/Y7mqWqwYx6R 1LLjtp3DEu4j9FGKnVwmcouhQ7Np1rRULJe376Gvw/LipSG08a8JNQgfyanGNpHMD0P5 P0XFG+vv9YPEYIobvxkJMwpt9aKTZloPaht8XBV+qkCl5uZN0VKj5bvwjeHPrPjzxqaU WJpA== X-Received: by 10.50.111.8 with SMTP id ie8mr28471730igb.65.1450828079706; Tue, 22 Dec 2015 15:47:59 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:3046:341c:d40a:9ef1? ([2601:601:800:126d:3046:341c:d40a:9ef1]) by smtp.gmail.com with ESMTPSA id i195sm13267603ioe.19.2015.12.22.15.47.58 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Dec 2015 15:47:58 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r292469 - in head/sys: dev/drm2/ttm mips/include mips/mips vm From: NGie Cooper In-Reply-To: Date: Tue, 22 Dec 2015 15:47:56 -0800 Cc: Alan Cox , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <610A02A5-1399-4A6C-993C-CDCC9DC8502A@gmail.com> References: <201512191842.tBJIgohI010539@repo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 23:48:00 -0000 > On Dec 22, 2015, at 13:51, Ed Maste wrote: >=20 > On 19 December 2015 at 13:42, Alan Cox wrote: >> Author: alc >> Date: Sat Dec 19 18:42:50 2015 >> New Revision: 292469 >> URL: https://svnweb.freebsd.org/changeset/base/292469 >>=20 >> Log: >> Introduce a new mechanism for relocating virtual pages to a new = physical >> address and use this mechanism when: >=20 > Universe build is failing on powerpc.powerpc with: >=20 > cc1: warnings being treated as errors > /scratch/tmp/emaste/freebsd/sys/vm/vm_page.c: In function = 'vm_page_reclaim_run': > /scratch/tmp/emaste/freebsd/sys/vm/vm_page.c:2449: warning: comparison > is always true due to limited range of data type > *** [vm_page.o] Error code 1 +1 It=E2=80=99s only with the MPC85XX kernel, which I believe is 32-bit = powerpc. Thanks! -NGie= From owner-svn-src-all@freebsd.org Tue Dec 22 23:54:32 2015 Return-Path: Delivered-To: svn-src-all@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 6FC8DA501CA; Tue, 22 Dec 2015 23:54:32 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-oi0-x22c.google.com (mail-oi0-x22c.google.com [IPv6:2607:f8b0:4003:c06::22c]) (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 3957F1224; Tue, 22 Dec 2015 23:54:32 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-oi0-x22c.google.com with SMTP id l9so87633991oia.2; Tue, 22 Dec 2015 15:54:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=+naupRtjWSBl8SzpYCq67XNh9632o7yz9B2u4wHDDtY=; b=Jhw8ErijPsiTw5IKKYyddznVlLgCDtRvOeMq1RtNQAA+z2p3YKb6cg74ueb18iNXFt yWwlpQO98nJAOQ73VJ08zVXmL8IKBt0GkDX0/qg21CBkUR4DCk58zWjL7hDTXAhb8Vln g7IIL2DwU4Zlss/GDU3S2h50Qcj0dAR9VjZC/mLSqK5/Z2+7TAzRvJX9BbDmhsrsP8YQ qIeuV2ZZ7MvICO+DyH0HeIcXJz7g/RUNrhUPOCnItnkjF5UG8rH8cLq5uXZ0BGfiP3sI b2swsnzvjN75kEV5HWZpBCew6z8YiybXGp+qG/G4mYrGCF7SVi2dAwwDPWHXS068ahWx MsoQ== MIME-Version: 1.0 X-Received: by 10.202.213.78 with SMTP id m75mr3351959oig.56.1450828471130; Tue, 22 Dec 2015 15:54:31 -0800 (PST) Received: by 10.182.210.195 with HTTP; Tue, 22 Dec 2015 15:54:30 -0800 (PST) Received: by 10.182.210.195 with HTTP; Tue, 22 Dec 2015 15:54:30 -0800 (PST) In-Reply-To: <610A02A5-1399-4A6C-993C-CDCC9DC8502A@gmail.com> References: <201512191842.tBJIgohI010539@repo.freebsd.org> <610A02A5-1399-4A6C-993C-CDCC9DC8502A@gmail.com> Date: Tue, 22 Dec 2015 17:54:30 -0600 Message-ID: Subject: Re: svn commit: r292469 - in head/sys: dev/drm2/ttm mips/include mips/mips vm From: Justin Hibbits To: Garrett Cooper Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Ed Maste , Alan Cox , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 23:54:32 -0000 On Dec 22, 2015 18:48, "NGie Cooper" wrote: > > > > On Dec 22, 2015, at 13:51, Ed Maste wrote: > > > > On 19 December 2015 at 13:42, Alan Cox wrote: > >> Author: alc > >> Date: Sat Dec 19 18:42:50 2015 > >> New Revision: 292469 > >> URL: https://svnweb.freebsd.org/changeset/base/292469 > >> > >> Log: > >> Introduce a new mechanism for relocating virtual pages to a new physical > >> address and use this mechanism when: > > > > Universe build is failing on powerpc.powerpc with: > > > > cc1: warnings being treated as errors > > /scratch/tmp/emaste/freebsd/sys/vm/vm_page.c: In function 'vm_page_reclaim_run': > > /scratch/tmp/emaste/freebsd/sys/vm/vm_page.c:2449: warning: comparison > > is always true due to limited range of data type > > *** [vm_page.o] Error code 1 > > +1 > > It=E2=80=99s only with the MPC85XX kernel, which I believe is 32-bit powe= rpc. > > Thanks! > -NGie Correct, this is due to the fact that on this target vm_paddr_t is 64-bit, and trunc_page() macro casts through unsigned long (32 bits). I have a patch that removes all casts for vm macros in PowerPC (PowerPC is the only target that casts for these macros still), in code review right now (only been lightly tested). - Justin From owner-svn-src-all@freebsd.org Wed Dec 23 01:31:34 2015 Return-Path: Delivered-To: svn-src-all@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 1C146A4F2B1; Wed, 23 Dec 2015 01:31:34 +0000 (UTC) (envelope-from davidcs@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 D42F01017; Wed, 23 Dec 2015 01:31:33 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBN1VXNi030996; Wed, 23 Dec 2015 01:31:33 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBN1VWnA030993; Wed, 23 Dec 2015 01:31:32 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201512230131.tBN1VWnA030993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 23 Dec 2015 01:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292638 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 01:31:34 -0000 Author: davidcs Date: Wed Dec 23 01:31:32 2015 New Revision: 292638 URL: https://svnweb.freebsd.org/changeset/base/292638 Log: Check for packet_length is greater than 60 bytes as well as packet_length is greater than len_on_bd, before invoking the routine to handle jumbo over SGL (bxe_service_rxsgl()). Add counters for number of jumbo_over_SGL packets (rx_bxe_service_rxsgl) and erroneous jumbo_over_SGL packets (rx_erroneous_jumbo_sge_pkts) Fix formatting in bxe_sysctl_state() MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/bxe_stats.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Tue Dec 22 23:21:06 2015 (r292637) +++ head/sys/dev/bxe/bxe.c Wed Dec 23 01:31:32 2015 (r292638) @@ -472,6 +472,10 @@ static const struct { 4, STATS_FLAGS_FUNC, "rx_pkts"}, { STATS_OFFSET32(rx_tpa_pkts), 4, STATS_FLAGS_FUNC, "rx_tpa_pkts"}, + { STATS_OFFSET32(rx_erroneous_jumbo_sge_pkts), + 4, STATS_FLAGS_FUNC, "rx_erroneous_jumbo_sge_pkts"}, + { STATS_OFFSET32(rx_bxe_service_rxsgl), + 4, STATS_FLAGS_FUNC, "rx_bxe_service_rxsgl"}, { STATS_OFFSET32(rx_jumbo_sge_pkts), 4, STATS_FLAGS_FUNC, "rx_jumbo_sge_pkts"}, { STATS_OFFSET32(rx_soft_errors), @@ -585,6 +589,10 @@ static const struct { 4, "rx_pkts"}, { Q_STATS_OFFSET32(rx_tpa_pkts), 4, "rx_tpa_pkts"}, + { Q_STATS_OFFSET32(rx_erroneous_jumbo_sge_pkts), + 4, "rx_erroneous_jumbo_sge_pkts"}, + { Q_STATS_OFFSET32(rx_bxe_service_rxsgl), + 4, "rx_bxe_service_rxsgl"}, { Q_STATS_OFFSET32(rx_jumbo_sge_pkts), 4, "rx_jumbo_sge_pkts"}, { Q_STATS_OFFSET32(rx_soft_errors), @@ -3475,11 +3483,14 @@ bxe_rxeof(struct bxe_softc *sc, m_adj(m, pad); m->m_pkthdr.len = m->m_len = len; - if (len != lenonbd){ + if ((len > 60) && (len > lenonbd)) { + fp->eth_q_stats.rx_bxe_service_rxsgl++; rc = bxe_service_rxsgl(fp, len, lenonbd, m, cqe_fp); if (rc) break; fp->eth_q_stats.rx_jumbo_sge_pkts++; + } else if (lenonbd < len) { + fp->eth_q_stats.rx_erroneous_jumbo_sge_pkts++; } /* assign packet to this interface interface */ @@ -16122,12 +16133,12 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS) } if (result == 1) { - uint32_t temp; + uint32_t temp; sc = (struct bxe_softc *)arg1; BLOGI(sc, "... dumping driver state ...\n"); - temp = SHMEM2_RD(sc, temperature_in_half_celsius); - BLOGI(sc, "\t Device Temperature = %d Celsius\n", (temp/2)); + temp = SHMEM2_RD(sc, temperature_in_half_celsius); + BLOGI(sc, "\t Device Temperature = %d Celsius\n", (temp/2)); } return (error); Modified: head/sys/dev/bxe/bxe_stats.c ============================================================================== --- head/sys/dev/bxe/bxe_stats.c Tue Dec 22 23:21:06 2015 (r292637) +++ head/sys/dev/bxe/bxe_stats.c Wed Dec 23 01:31:32 2015 (r292638) @@ -1227,6 +1227,8 @@ bxe_drv_stats_update(struct bxe_softc *s UPDATE_ESTAT_QSTAT(rx_calls); UPDATE_ESTAT_QSTAT(rx_pkts); UPDATE_ESTAT_QSTAT(rx_tpa_pkts); + UPDATE_ESTAT_QSTAT(rx_erroneous_jumbo_sge_pkts); + UPDATE_ESTAT_QSTAT(rx_bxe_service_rxsgl); UPDATE_ESTAT_QSTAT(rx_jumbo_sge_pkts); UPDATE_ESTAT_QSTAT(rx_soft_errors); UPDATE_ESTAT_QSTAT(rx_hw_csum_errors); Modified: head/sys/dev/bxe/bxe_stats.h ============================================================================== --- head/sys/dev/bxe/bxe_stats.h Tue Dec 22 23:21:06 2015 (r292637) +++ head/sys/dev/bxe/bxe_stats.h Wed Dec 23 01:31:32 2015 (r292638) @@ -218,6 +218,8 @@ struct bxe_eth_stats { uint32_t rx_calls; uint32_t rx_pkts; uint32_t rx_tpa_pkts; + uint32_t rx_erroneous_jumbo_sge_pkts; + uint32_t rx_bxe_service_rxsgl; uint32_t rx_jumbo_sge_pkts; uint32_t rx_soft_errors; uint32_t rx_hw_csum_errors; @@ -319,6 +321,8 @@ struct bxe_eth_q_stats { uint32_t rx_calls; uint32_t rx_pkts; uint32_t rx_tpa_pkts; + uint32_t rx_erroneous_jumbo_sge_pkts; + uint32_t rx_bxe_service_rxsgl; uint32_t rx_jumbo_sge_pkts; uint32_t rx_soft_errors; uint32_t rx_hw_csum_errors; @@ -413,6 +417,8 @@ struct bxe_eth_q_stats_old { uint32_t rx_calls_old; uint32_t rx_pkts_old; uint32_t rx_tpa_pkts_old; + uint32_t rx_erroneous_jumbo_sge_pkts_old; + uint32_t rx_bxe_service_rxsgl_old; uint32_t rx_jumbo_sge_pkts_old; uint32_t rx_soft_errors_old; uint32_t rx_hw_csum_errors_old; From owner-svn-src-all@freebsd.org Wed Dec 23 03:19:14 2015 Return-Path: Delivered-To: svn-src-all@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 54348A501BE; Wed, 23 Dec 2015 03:19:14 +0000 (UTC) (envelope-from davidcs@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 E03E61DE5; Wed, 23 Dec 2015 03:19:13 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBN3JDrg062146; Wed, 23 Dec 2015 03:19:13 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBN3JCnM062142; Wed, 23 Dec 2015 03:19:12 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201512230319.tBN3JCnM062142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 23 Dec 2015 03:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292639 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 03:19:14 -0000 Author: davidcs Date: Wed Dec 23 03:19:12 2015 New Revision: 292639 URL: https://svnweb.freebsd.org/changeset/base/292639 Log: Add support for firmware dump (a.k.a grcdump) MFC after:5 days Added: head/sys/dev/bxe/bxe_dump.h (contents, props changed) head/sys/dev/bxe/bxe_ioctl.h (contents, props changed) Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/ecore_init.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Wed Dec 23 01:31:32 2015 (r292638) +++ head/sys/dev/bxe/bxe.c Wed Dec 23 03:19:12 2015 (r292639) @@ -736,6 +736,8 @@ static __noinline int bxe_nic_unload(str static void bxe_handle_sp_tq(void *context, int pending); static void bxe_handle_fp_tq(void *context, int pending); +static int bxe_add_cdev(struct bxe_softc *sc); +static void bxe_del_cdev(struct bxe_softc *sc); /* calculate crc32 on a buffer (NOTE: crc32_length MUST be aligned to 8) */ uint32_t @@ -4503,7 +4505,7 @@ bxe_nic_unload(struct bxe_softc *sc, sc->rx_mode = BXE_RX_MODE_NONE; /* XXX set rx mode ??? */ - if (IS_PF(sc)) { + if (IS_PF(sc) && !sc->grcdump_done) { /* set ALWAYS_ALIVE bit in shmem */ sc->fw_drv_pulse_wr_seq |= DRV_PULSE_ALWAYS_ALIVE; @@ -4523,7 +4525,8 @@ bxe_nic_unload(struct bxe_softc *sc, ; /* bxe_vfpf_close_vf(sc); */ } else if (unload_mode != UNLOAD_RECOVERY) { /* if this is a normal/close unload need to clean up chip */ - bxe_chip_cleanup(sc, unload_mode, keep_link); + if (!sc->grcdump_done) + bxe_chip_cleanup(sc, unload_mode, keep_link); } else { /* Send the UNLOAD_REQUEST to the MCP */ bxe_send_unload_req(sc, unload_mode); @@ -16276,6 +16279,12 @@ bxe_add_sysctls(struct bxe_softc *sc) CTLFLAG_RW, &sc->debug, "debug logging mode"); + sc->trigger_grcdump = 0; + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump", + CTLFLAG_RW, &sc->trigger_grcdump, 0, + "set by driver when a grcdump is needed"); + + sc->rx_budget = bxe_rx_budget; SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "rx_budget", CTLFLAG_RW, &sc->rx_budget, 0, @@ -16404,8 +16413,20 @@ bxe_attach(device_t dev) return (ENXIO); } + if (bxe_add_cdev(sc) != 0) { + if (sc->ifp != NULL) { + ether_ifdetach(sc->ifp); + } + ifmedia_removeall(&sc->ifmedia); + bxe_release_mutexes(sc); + bxe_deallocate_bars(sc); + pci_disable_busmaster(dev); + return (ENXIO); + } + /* allocate device interrupts */ if (bxe_interrupt_alloc(sc) != 0) { + bxe_del_cdev(sc); if (sc->ifp != NULL) { ether_ifdetach(sc->ifp); } @@ -16419,6 +16440,7 @@ bxe_attach(device_t dev) /* allocate ilt */ if (bxe_alloc_ilt_mem(sc) != 0) { bxe_interrupt_free(sc); + bxe_del_cdev(sc); if (sc->ifp != NULL) { ether_ifdetach(sc->ifp); } @@ -16433,6 +16455,7 @@ bxe_attach(device_t dev) if (bxe_alloc_hsi_mem(sc) != 0) { bxe_free_ilt_mem(sc); bxe_interrupt_free(sc); + bxe_del_cdev(sc); if (sc->ifp != NULL) { ether_ifdetach(sc->ifp); } @@ -16504,6 +16527,8 @@ bxe_detach(device_t dev) return(EBUSY); } + bxe_del_cdev(sc); + /* stop the periodic callout */ bxe_periodic_stop(sc); @@ -18824,3 +18849,457 @@ ecore_storm_memset_struct(struct bxe_sof } } + +/* + * character device - ioctl interface definitions + */ + + +#include "bxe_dump.h" +#include "bxe_ioctl.h" +#include + +static int bxe_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, + struct thread *td); + +static struct cdevsw bxe_cdevsw = { + .d_version = D_VERSION, + .d_ioctl = bxe_eioctl, + .d_name = "bxecnic", +}; + +#define BXE_PATH(sc) (CHIP_IS_E1x(sc) ? 0 : (sc->pcie_func & 1)) + + +#define DUMP_ALL_PRESETS 0x1FFF +#define DUMP_MAX_PRESETS 13 +#define IS_E1_REG(chips) ((chips & DUMP_CHIP_E1) == DUMP_CHIP_E1) +#define IS_E1H_REG(chips) ((chips & DUMP_CHIP_E1H) == DUMP_CHIP_E1H) +#define IS_E2_REG(chips) ((chips & DUMP_CHIP_E2) == DUMP_CHIP_E2) +#define IS_E3A0_REG(chips) ((chips & DUMP_CHIP_E3A0) == DUMP_CHIP_E3A0) +#define IS_E3B0_REG(chips) ((chips & DUMP_CHIP_E3B0) == DUMP_CHIP_E3B0) + +#define IS_REG_IN_PRESET(presets, idx) \ + ((presets & (1 << (idx-1))) == (1 << (idx-1))) + + +static int +bxe_get_preset_regs_len(struct bxe_softc *sc, uint32_t preset) +{ + if (CHIP_IS_E1(sc)) + return dump_num_registers[0][preset-1]; + else if (CHIP_IS_E1H(sc)) + return dump_num_registers[1][preset-1]; + else if (CHIP_IS_E2(sc)) + return dump_num_registers[2][preset-1]; + else if (CHIP_IS_E3A0(sc)) + return dump_num_registers[3][preset-1]; + else if (CHIP_IS_E3B0(sc)) + return dump_num_registers[4][preset-1]; + else + return 0; +} + +static int +bxe_get_max_regs_len(struct bxe_softc *sc) +{ + uint32_t preset_idx; + int regdump_len32, len32; + + regdump_len32 = bxe_get_preset_regs_len(sc, 1); + + /* Calculate the total preset regs length */ + for (preset_idx = 2; preset_idx <= DUMP_MAX_PRESETS; preset_idx++) { + + len32 = bxe_get_preset_regs_len(sc, preset_idx); + + if (regdump_len32 < len32) + regdump_len32 = len32; + } + + return regdump_len32; +} + +static int +bxe_get_total_regs_len32(struct bxe_softc *sc) +{ + uint32_t preset_idx; + int regdump_len32 = 0; + + + /* Calculate the total preset regs length */ + for (preset_idx = 1; preset_idx <= DUMP_MAX_PRESETS; preset_idx++) { + regdump_len32 += bxe_get_preset_regs_len(sc, preset_idx); + } + + return regdump_len32; +} + +static const uint32_t * +__bxe_get_page_addr_ar(struct bxe_softc *sc) +{ + if (CHIP_IS_E2(sc)) + return page_vals_e2; + else if (CHIP_IS_E3(sc)) + return page_vals_e3; + else + return NULL; +} + +static uint32_t +__bxe_get_page_reg_num(struct bxe_softc *sc) +{ + if (CHIP_IS_E2(sc)) + return PAGE_MODE_VALUES_E2; + else if (CHIP_IS_E3(sc)) + return PAGE_MODE_VALUES_E3; + else + return 0; +} + +static const uint32_t * +__bxe_get_page_write_ar(struct bxe_softc *sc) +{ + if (CHIP_IS_E2(sc)) + return page_write_regs_e2; + else if (CHIP_IS_E3(sc)) + return page_write_regs_e3; + else + return NULL; +} + +static uint32_t +__bxe_get_page_write_num(struct bxe_softc *sc) +{ + if (CHIP_IS_E2(sc)) + return PAGE_WRITE_REGS_E2; + else if (CHIP_IS_E3(sc)) + return PAGE_WRITE_REGS_E3; + else + return 0; +} + +static const struct reg_addr * +__bxe_get_page_read_ar(struct bxe_softc *sc) +{ + if (CHIP_IS_E2(sc)) + return page_read_regs_e2; + else if (CHIP_IS_E3(sc)) + return page_read_regs_e3; + else + return NULL; +} + +static uint32_t +__bxe_get_page_read_num(struct bxe_softc *sc) +{ + if (CHIP_IS_E2(sc)) + return PAGE_READ_REGS_E2; + else if (CHIP_IS_E3(sc)) + return PAGE_READ_REGS_E3; + else + return 0; +} + +static bool +bxe_is_reg_in_chip(struct bxe_softc *sc, const struct reg_addr *reg_info) +{ + if (CHIP_IS_E1(sc)) + return IS_E1_REG(reg_info->chips); + else if (CHIP_IS_E1H(sc)) + return IS_E1H_REG(reg_info->chips); + else if (CHIP_IS_E2(sc)) + return IS_E2_REG(reg_info->chips); + else if (CHIP_IS_E3A0(sc)) + return IS_E3A0_REG(reg_info->chips); + else if (CHIP_IS_E3B0(sc)) + return IS_E3B0_REG(reg_info->chips); + else + return 0; +} + +static bool +bxe_is_wreg_in_chip(struct bxe_softc *sc, const struct wreg_addr *wreg_info) +{ + if (CHIP_IS_E1(sc)) + return IS_E1_REG(wreg_info->chips); + else if (CHIP_IS_E1H(sc)) + return IS_E1H_REG(wreg_info->chips); + else if (CHIP_IS_E2(sc)) + return IS_E2_REG(wreg_info->chips); + else if (CHIP_IS_E3A0(sc)) + return IS_E3A0_REG(wreg_info->chips); + else if (CHIP_IS_E3B0(sc)) + return IS_E3B0_REG(wreg_info->chips); + else + return 0; +} + +/** + * bxe_read_pages_regs - read "paged" registers + * + * @bp device handle + * @p output buffer + * + * Reads "paged" memories: memories that may only be read by first writing to a + * specific address ("write address") and then reading from a specific address + * ("read address"). There may be more than one write address per "page" and + * more than one read address per write address. + */ +static void +bxe_read_pages_regs(struct bxe_softc *sc, uint32_t *p, uint32_t preset) +{ + uint32_t i, j, k, n; + + /* addresses of the paged registers */ + const uint32_t *page_addr = __bxe_get_page_addr_ar(sc); + /* number of paged registers */ + int num_pages = __bxe_get_page_reg_num(sc); + /* write addresses */ + const uint32_t *write_addr = __bxe_get_page_write_ar(sc); + /* number of write addresses */ + int write_num = __bxe_get_page_write_num(sc); + /* read addresses info */ + const struct reg_addr *read_addr = __bxe_get_page_read_ar(sc); + /* number of read addresses */ + int read_num = __bxe_get_page_read_num(sc); + uint32_t addr, size; + + for (i = 0; i < num_pages; i++) { + for (j = 0; j < write_num; j++) { + REG_WR(sc, write_addr[j], page_addr[i]); + + for (k = 0; k < read_num; k++) { + if (IS_REG_IN_PRESET(read_addr[k].presets, preset)) { + size = read_addr[k].size; + for (n = 0; n < size; n++) { + addr = read_addr[k].addr + n*4; + *p++ = REG_RD(sc, addr); + } + } + } + } + } + return; +} + + +static int +bxe_get_preset_regs(struct bxe_softc *sc, uint32_t *p, uint32_t preset) +{ + uint32_t i, j, addr; + const struct wreg_addr *wreg_addr_p = NULL; + + if (CHIP_IS_E1(sc)) + wreg_addr_p = &wreg_addr_e1; + else if (CHIP_IS_E1H(sc)) + wreg_addr_p = &wreg_addr_e1h; + else if (CHIP_IS_E2(sc)) + wreg_addr_p = &wreg_addr_e2; + else if (CHIP_IS_E3A0(sc)) + wreg_addr_p = &wreg_addr_e3; + else if (CHIP_IS_E3B0(sc)) + wreg_addr_p = &wreg_addr_e3b0; + else + return (-1); + + /* Read the idle_chk registers */ + for (i = 0; i < IDLE_REGS_COUNT; i++) { + if (bxe_is_reg_in_chip(sc, &idle_reg_addrs[i]) && + IS_REG_IN_PRESET(idle_reg_addrs[i].presets, preset)) { + for (j = 0; j < idle_reg_addrs[i].size; j++) + *p++ = REG_RD(sc, idle_reg_addrs[i].addr + j*4); + } + } + + /* Read the regular registers */ + for (i = 0; i < REGS_COUNT; i++) { + if (bxe_is_reg_in_chip(sc, ®_addrs[i]) && + IS_REG_IN_PRESET(reg_addrs[i].presets, preset)) { + for (j = 0; j < reg_addrs[i].size; j++) + *p++ = REG_RD(sc, reg_addrs[i].addr + j*4); + } + } + + /* Read the CAM registers */ + if (bxe_is_wreg_in_chip(sc, wreg_addr_p) && + IS_REG_IN_PRESET(wreg_addr_p->presets, preset)) { + for (i = 0; i < wreg_addr_p->size; i++) { + *p++ = REG_RD(sc, wreg_addr_p->addr + i*4); + + /* In case of wreg_addr register, read additional + registers from read_regs array + */ + for (j = 0; j < wreg_addr_p->read_regs_count; j++) { + addr = *(wreg_addr_p->read_regs); + *p++ = REG_RD(sc, addr + j*4); + } + } + } + + /* Paged registers are supported in E2 & E3 only */ + if (CHIP_IS_E2(sc) || CHIP_IS_E3(sc)) { + /* Read "paged" registers */ + bxe_read_pages_regs(sc, p, preset); + } + + return 0; +} + +static int +bxe_grc_dump(struct bxe_softc *sc, bxe_grcdump_t *dump) +{ + int rval = 0; + uint32_t preset_idx; + uint8_t *buf; + uint32_t size; + struct dump_header *d_hdr; + + ecore_disable_blocks_parity(sc); + + buf = dump->grcdump; + d_hdr = dump->grcdump; + + d_hdr->header_size = (sizeof(struct dump_header) >> 2) - 1; + d_hdr->version = BNX2X_DUMP_VERSION; + d_hdr->preset = DUMP_ALL_PRESETS; + + if (CHIP_IS_E1(sc)) { + d_hdr->dump_meta_data = DUMP_CHIP_E1; + } else if (CHIP_IS_E1H(sc)) { + d_hdr->dump_meta_data = DUMP_CHIP_E1H; + } else if (CHIP_IS_E2(sc)) { + d_hdr->dump_meta_data = DUMP_CHIP_E2 | + (BXE_PATH(sc) ? DUMP_PATH_1 : DUMP_PATH_0); + } else if (CHIP_IS_E3A0(sc)) { + d_hdr->dump_meta_data = DUMP_CHIP_E3A0 | + (BXE_PATH(sc) ? DUMP_PATH_1 : DUMP_PATH_0); + } else if (CHIP_IS_E3B0(sc)) { + d_hdr->dump_meta_data = DUMP_CHIP_E3B0 | + (BXE_PATH(sc) ? DUMP_PATH_1 : DUMP_PATH_0); + } + + dump->grcdump_dwords = sizeof(struct dump_header) >> 2; + buf += sizeof(struct dump_header); + + for (preset_idx = 1; preset_idx <= DUMP_MAX_PRESETS; preset_idx++) { + + /* Skip presets with IOR */ + if ((preset_idx == 2) || (preset_idx == 5) || (preset_idx == 8) || + (preset_idx == 11)) + continue; + + rval = bxe_get_preset_regs(sc, sc->grc_dump, preset_idx); + + if (rval) + break; + + size = bxe_get_preset_regs_len(sc, preset_idx) * (sizeof (uint32_t)); + + rval = copyout(sc->grc_dump, buf, size); + + if (rval) + break; + + dump->grcdump_dwords += (size / (sizeof (uint32_t))); + + buf += size; + } + + ecore_clear_blocks_parity(sc); + ecore_enable_blocks_parity(sc); + + sc->grcdump_done = 1; + return(rval); +} + +static int +bxe_add_cdev(struct bxe_softc *sc) +{ + int max_preset_size; + + max_preset_size = bxe_get_max_regs_len(sc) * (sizeof (uint32_t)); + + sc->grc_dump = malloc(max_preset_size, M_DEVBUF, M_NOWAIT); + + if (sc->grc_dump == NULL) + return (-1); + + sc->ioctl_dev = make_dev(&bxe_cdevsw, + sc->ifp->if_dunit, + UID_ROOT, + GID_WHEEL, + 0600, + "%s", + if_name(sc->ifp)); + + if (sc->ioctl_dev == NULL) { + + free(sc->grc_dump, M_DEVBUF); + + return (-1); + } + + sc->ioctl_dev->si_drv1 = sc; + + return (0); +} + +static void +bxe_del_cdev(struct bxe_softc *sc) +{ + if (sc->ioctl_dev != NULL) + destroy_dev(sc->ioctl_dev); + + if (sc->grc_dump == NULL) + free(sc->grc_dump, M_DEVBUF); + + return; +} + +static int +bxe_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, + struct thread *td) +{ + struct bxe_softc *sc; + int rval = 0; + device_t pci_dev; + bxe_grcdump_t *dump = NULL; + int grc_dump_size; + + if ((sc = (struct bxe_softc *)dev->si_drv1) == NULL) + return ENXIO; + + pci_dev= sc->dev; + + dump = (bxe_grcdump_t *)data; + + switch(cmd) { + + case BXE_GRC_DUMP_SIZE: + dump->pci_func = sc->pcie_func; + dump->grcdump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); + break; + + case BXE_GRC_DUMP: + + grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + + sizeof(struct dump_header); + + if ((sc->grc_dump == NULL) || (dump->grcdump == NULL) || + (dump->grcdump_size < grc_dump_size)) { + rval = EINVAL; + break; + } + + rval = bxe_grc_dump(sc, dump); + + break; + + default: + break; + } + + return (rval); +} Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Wed Dec 23 01:31:32 2015 (r292638) +++ head/sys/dev/bxe/bxe.h Wed Dec 23 03:19:12 2015 (r292639) @@ -1830,6 +1830,11 @@ struct bxe_softc { uint8_t prio_to_cos[BXE_MAX_PRIORITY]; int panic; + + struct cdev *ioctl_dev; + void *grc_dump; + int trigger_grcdump; + int grcdump_done; }; /* struct bxe_softc */ /* IOCTL sub-commands for edebug and firmware upgrade */ @@ -2296,6 +2301,7 @@ void ecore_storm_memset_struct(struct bx "ERROR: " format, \ ## args); \ } \ + sc->trigger_grcdump |= 0x1; \ } while(0) #ifdef ECORE_STOP_ON_ERROR Added: head/sys/dev/bxe/bxe_dump.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bxe/bxe_dump.h Wed Dec 23 03:19:12 2015 (r292639) @@ -0,0 +1,2231 @@ +/* + * Copyright (c) 2007-2015 QLogic Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#ifndef __BXE_DUMP_H__ +#define __BXE_DUMP_H__ + +#include +__FBSDID("$FreeBSD$"); + +/* WaitP Definitions */ +#define DRV_DUMP_XSTORM_WAITP_ADDRESS 0x2b8a80 +#define DRV_DUMP_TSTORM_WAITP_ADDRESS 0x1b8a80 +#define DRV_DUMP_USTORM_WAITP_ADDRESS 0x338a80 +#define DRV_DUMP_CSTORM_WAITP_ADDRESS 0x238a80 + +/* Possible Chips */ +#define DUMP_CHIP_E1 1 +#define DUMP_CHIP_E1H 2 +#define DUMP_CHIP_E2 4 +#define DUMP_CHIP_E3A0 8 +#define DUMP_CHIP_E3B0 16 +#define DUMP_PATH_0 512 +#define DUMP_PATH_1 1024 +#define NUM_PRESETS 13 +#define NUM_CHIPS 5 + +struct dump_header { + uint32_t header_size; /* Size in DWORDs excluding this field */ + uint32_t version; + uint32_t preset; + uint32_t dump_meta_data; /* OR of CHIP and PATH. */ +}; + +#define BNX2X_DUMP_VERSION 0x61111111 +struct reg_addr { + uint32_t addr; + uint32_t size; + uint32_t chips; + uint32_t presets; +}; + +struct wreg_addr { + uint32_t addr; + uint32_t size; + uint32_t read_regs_count; + const uint32_t *read_regs; + uint32_t chips; + uint32_t presets; +}; + +#define PAGE_MODE_VALUES_E2 2 +#define PAGE_READ_REGS_E2 1 +#define PAGE_WRITE_REGS_E2 1 +static const uint32_t page_vals_e2[] = {0, 128}; +static const uint32_t page_write_regs_e2[] = {328476}; +static const struct reg_addr page_read_regs_e2[] = { + {0x58000, 4608, DUMP_CHIP_E2, 0x30} +}; + +#define PAGE_MODE_VALUES_E3 2 +#define PAGE_READ_REGS_E3 1 +#define PAGE_WRITE_REGS_E3 1 +static const uint32_t page_vals_e3[] = {0, 128}; +static const uint32_t page_write_regs_e3[] = {328476}; +static const struct reg_addr page_read_regs_e3[] = { + {0x58000, 4608, DUMP_CHIP_E3A0 | DUMP_CHIP_E3B0, 0x30} +}; + +static const struct reg_addr reg_addrs[] = { + { 0x2000, 1, 0x1f, 0xfff}, + { 0x2004, 1, 0x1f, 0x1fff}, + { 0x2008, 25, 0x1f, 0xfff}, + { 0x206c, 1, 0x1f, 0x1fff}, + { 0x2070, 313, 0x1f, 0xfff}, + { 0x2800, 103, 0x1f, 0xfff}, + { 0x3000, 287, 0x1f, 0xfff}, + { 0x3800, 331, 0x1f, 0xfff}, + { 0x8800, 6, 0x1f, 0x924}, + { 0x8818, 1, 0x1e, 0x924}, + { 0x9000, 4, 0x1c, 0x924}, + { 0x9010, 7, 0x1c, 0xfff}, + { 0x902c, 1, 0x1c, 0x924}, + { 0x9030, 1, 0x1c, 0xfff}, + { 0x9034, 13, 0x1c, 0x924}, + { 0x9068, 16, 0x1c, 0xfff}, + { 0x90a8, 98, 0x1c, 0x924}, + { 0x9230, 2, 0x1c, 0xfff}, + { 0x9238, 3, 0x1c, 0x924}, + { 0x9244, 1, 0x1c, 0xfff}, + { 0x9248, 1, 0x1c, 0x924}, + { 0x924c, 1, 0x4, 0x924}, + { 0x9250, 16, 0x1c, 0x924}, + { 0x92a8, 2, 0x1c, 0x1fff}, + { 0x92b4, 1, 0x1c, 0x1fff}, + { 0x9400, 33, 0x1c, 0x924}, + { 0x9484, 5, 0x18, 0x924}, + { 0xa000, 27, 0x1f, 0x924}, + { 0xa06c, 1, 0x3, 0x924}, + { 0xa070, 2, 0x1f, 0x924}, + { 0xa078, 1, 0x1f, 0x1fff}, + { 0xa07c, 31, 0x1f, 0x924}, + { 0xa0f8, 1, 0x1f, 0x1fff}, + { 0xa0fc, 3, 0x1f, 0x924}, + { 0xa108, 1, 0x1f, 0x1fff}, + { 0xa10c, 3, 0x1f, 0x924}, + { 0xa118, 1, 0x1f, 0x1fff}, + { 0xa11c, 28, 0x1f, 0x924}, + { 0xa18c, 4, 0x3, 0x924}, + { 0xa19c, 3, 0x1f, 0x924}, + { 0xa1a8, 1, 0x1f, 0x1fff}, + { 0xa1ac, 3, 0x1f, 0x924}, + { 0xa1b8, 1, 0x1f, 0x1fff}, + { 0xa1bc, 54, 0x1f, 0x924}, + { 0xa294, 2, 0x3, 0x924}, + { 0xa29c, 2, 0x1f, 0x924}, + { 0xa2a4, 2, 0x7, 0x924}, + { 0xa2ac, 2, 0x1f, 0x924}, + { 0xa2b4, 1, 0x1f, 0x1fff}, + { 0xa2b8, 49, 0x1f, 0x924}, + { 0xa38c, 2, 0x1f, 0x1fff}, + { 0xa398, 1, 0x1f, 0x1fff}, + { 0xa39c, 7, 0x1e, 0x924}, + { 0xa3b8, 2, 0x18, 0x924}, + { 0xa3c0, 1, 0x1e, 0x924}, + { 0xa3c4, 1, 0x1e, 0xfff}, + { 0xa3c8, 1, 0x1e, 0x924}, + { 0xa3d0, 1, 0x1e, 0x924}, + { 0xa3d8, 1, 0x1e, 0x924}, + { 0xa3e0, 1, 0x1e, 0x924}, + { 0xa3e8, 1, 0x1e, 0x924}, + { 0xa3f0, 1, 0x1e, 0x924}, + { 0xa3f8, 1, 0x1e, 0x924}, + { 0xa400, 1, 0x1f, 0x924}, + { 0xa404, 1, 0x1f, 0xfff}, + { 0xa408, 2, 0x1f, 0x1fff}, + { 0xa410, 7, 0x1f, 0x924}, + { 0xa42c, 12, 0x1f, 0xfff}, + { 0xa45c, 1, 0x1f, 0x924}, + { 0xa460, 1, 0x1f, 0x1924}, + { 0xa464, 15, 0x1f, 0x924}, + { 0xa4a0, 1, 0x7, 0x924}, + { 0xa4a4, 2, 0x1f, 0x924}, + { 0xa4ac, 2, 0x3, 0x924}, + { 0xa4b4, 1, 0x7, 0x924}, + { 0xa4b8, 2, 0x3, 0x924}, + { 0xa4c0, 3, 0x1f, 0x924}, + { 0xa4cc, 5, 0x3, 0x924}, + { 0xa4e0, 3, 0x1f, 0x924}, + { 0xa4fc, 2, 0x1f, 0x924}, + { 0xa504, 1, 0x3, 0x924}, + { 0xa508, 3, 0x1f, 0x924}, + { 0xa518, 1, 0x1f, 0x924}, + { 0xa520, 1, 0x1f, 0x924}, + { 0xa528, 1, 0x1f, 0x924}, + { 0xa530, 1, 0x1f, 0x924}, + { 0xa538, 1, 0x1f, 0x924}, + { 0xa540, 1, 0x1f, 0x924}, + { 0xa548, 1, 0x3, 0x924}, + { 0xa550, 1, 0x3, 0x924}, + { 0xa558, 1, 0x3, 0x924}, + { 0xa560, 1, 0x3, 0x924}, + { 0xa568, 1, 0x3, 0x924}, + { 0xa570, 1, 0x1f, 0x924}, + { 0xa580, 1, 0x1f, 0x1fff}, + { 0xa590, 1, 0x1f, 0x1fff}, + { 0xa5a0, 1, 0x7, 0x924}, + { 0xa5c0, 1, 0x1f, 0x924}, + { 0xa5e0, 1, 0x1e, 0x924}, + { 0xa5e8, 1, 0x1e, 0x924}, + { 0xa5f0, 1, 0x1e, 0x924}, + { 0xa5f8, 1, 0x6, 0x924}, + { 0xa5fc, 1, 0x1e, 0x924}, + { 0xa600, 5, 0x1e, 0xfff}, + { 0xa614, 1, 0x1e, 0x924}, + { 0xa618, 1, 0x1e, 0xfff}, + { 0xa61c, 1, 0x1e, 0x924}, + { 0xa620, 6, 0x1c, 0x924}, + { 0xa638, 20, 0x4, 0x924}, + { 0xa688, 35, 0x1c, 0x924}, + { 0xa714, 1, 0x1c, 0xfff}, + { 0xa718, 2, 0x1c, 0x924}, + { 0xa720, 1, 0x1c, 0xfff}, + { 0xa724, 3, 0x1c, 0x924}, + { 0xa730, 1, 0x4, 0x924}, + { 0xa734, 2, 0x1c, 0x924}, + { 0xa73c, 4, 0x4, 0x924}, + { 0xa74c, 1, 0x1c, 0x924}, + { 0xa750, 1, 0x1c, 0xfff}, + { 0xa754, 3, 0x1c, 0x924}, + { 0xa760, 5, 0x4, 0x924}, + { 0xa774, 7, 0x1c, 0x924}, + { 0xa790, 15, 0x4, 0x924}, + { 0xa7cc, 4, 0x1c, 0x924}, + { 0xa7e0, 6, 0x18, 0x924}, + { 0xa800, 18, 0x4, 0x924}, + { 0xa848, 33, 0x1c, 0x924}, + { 0xa8cc, 2, 0x18, 0x924}, + { 0xa8d4, 4, 0x1c, 0x924}, + { 0xa8e4, 1, 0x18, 0x924}, + { 0xa8e8, 1, 0x1c, 0x924}, + { 0xa8f0, 1, 0x1c, 0x924}, + { 0xa8f8, 30, 0x18, 0x924}, + { 0xa974, 73, 0x18, 0x924}, + { 0xac30, 1, 0x18, 0x924}, + { 0xac40, 1, 0x18, 0x924}, + { 0xac50, 1, 0x18, 0x924}, + { 0xac60, 1, 0x10, 0x924}, + { 0x10000, 9, 0x1f, 0x924}, + { 0x10024, 1, 0x7, 0x924}, + { 0x10028, 5, 0x1f, 0x924}, + { 0x1003c, 6, 0x7, 0x924}, + { 0x10054, 20, 0x1f, 0x924}, + { 0x100a4, 4, 0x7, 0x924}, + { 0x100b4, 11, 0x1f, 0x924}, + { 0x100e0, 4, 0x7, 0x924}, + { 0x100f0, 8, 0x1f, 0x924}, + { 0x10110, 6, 0x7, 0x924}, + { 0x10128, 110, 0x1f, 0x924}, + { 0x102e0, 4, 0x7, 0x924}, + { 0x102f0, 18, 0x1f, 0x924}, + { 0x10338, 20, 0x7, 0x924}, + { 0x10388, 10, 0x1f, 0x924}, + { 0x103d0, 2, 0x3, 0x1fff}, + { 0x103dc, 1, 0x3, 0x1fff}, + { 0x10400, 6, 0x7, 0x924}, + { 0x10418, 1, 0x1f, 0xfff}, + { 0x1041c, 1, 0x1f, 0x924}, + { 0x10420, 1, 0x1f, 0xfff}, + { 0x10424, 1, 0x1f, 0x924}, + { 0x10428, 1, 0x1f, 0xfff}, + { 0x1042c, 1, 0x1f, 0x924}, + { 0x10430, 10, 0x7, 0x924}, + { 0x10458, 2, 0x1f, 0x924}, + { 0x10460, 1, 0x1f, 0xfff}, + { 0x10464, 4, 0x1f, 0x924}, + { 0x10474, 1, 0x1f, 0xfff}, + { 0x10478, 14, 0x1f, 0x924}, + { 0x104b0, 12, 0x7, 0x924}, + { 0x104e0, 1, 0x1f, 0xfff}, + { 0x104e8, 1, 0x1f, 0x924}, + { 0x104ec, 1, 0x1f, 0xfff}, + { 0x104f4, 1, 0x1f, 0x924}, + { 0x104f8, 1, 0x1f, 0xfff}, + { 0x10500, 2, 0x1f, 0x924}, + { 0x10508, 1, 0x1f, 0xfff}, + { 0x1050c, 9, 0x1f, 0x924}, + { 0x10530, 1, 0x1f, 0xfff}, + { 0x10534, 1, 0x1f, 0x924}, + { 0x10538, 1, 0x1f, 0xfff}, + { 0x1053c, 3, 0x1f, 0x924}, + { 0x10548, 1, 0x1f, 0xfff}, + { 0x1054c, 3, 0x1f, 0x924}, + { 0x10558, 1, 0x1f, 0xfff}, + { 0x1055c, 123, 0x1f, 0x924}, + { 0x10750, 2, 0x7, 0x924}, + { 0x10760, 2, 0x7, 0x924}, + { 0x10770, 2, 0x7, 0x924}, + { 0x10780, 2, 0x7, 0x924}, + { 0x10790, 2, 0x1f, 0x924}, + { 0x107a0, 2, 0x7, 0x924}, + { 0x107b0, 2, 0x7, 0x924}, + { 0x107c0, 2, 0x7, 0x924}, + { 0x107d0, 2, 0x7, 0x924}, + { 0x107e0, 2, 0x1f, 0x924}, + { 0x10880, 2, 0x1f, 0x924}, + { 0x10900, 2, 0x1f, 0x924}, + { 0x16000, 1, 0x6, 0x924}, + { 0x16004, 25, 0x1e, 0x924}, + { 0x16070, 8, 0x1e, 0x924}, + { 0x16090, 4, 0xe, 0x924}, + { 0x160a0, 6, 0x1e, 0x924}, + { 0x160c0, 7, 0x1e, 0x924}, + { 0x160dc, 2, 0x6, 0x924}, + { 0x160e4, 6, 0x1e, 0x924}, + { 0x160fc, 4, 0x1e, 0x1fff}, + { 0x1610c, 2, 0x6, 0x924}, + { 0x16114, 6, 0x1e, 0x924}, + { 0x16140, 48, 0x1e, 0x1fff}, + { 0x16204, 5, 0x1e, 0x924}, + { 0x18000, 1, 0x1e, 0x924}, + { 0x18008, 1, 0x1e, 0x924}, + { 0x18010, 35, 0x1c, 0x924}, + { 0x180a4, 2, 0x1c, 0x924}, + { 0x180c0, 9, 0x1c, 0x924}, + { 0x180e4, 1, 0xc, 0x924}, + { 0x180e8, 2, 0x1c, 0x924}, + { 0x180f0, 1, 0xc, 0x924}, + { 0x180f4, 79, 0x1c, 0x924}, + { 0x18230, 1, 0xc, 0x924}, + { 0x18234, 2, 0x1c, 0x924}, + { 0x1823c, 1, 0xc, 0x924}, + { 0x18240, 13, 0x1c, 0x924}, + { 0x18274, 1, 0x4, 0x924}, + { 0x18278, 12, 0x1c, 0x924}, + { 0x182a8, 1, 0x1c, 0xfff}, + { 0x182ac, 3, 0x1c, 0x924}, + { 0x182b8, 1, 0x1c, 0xfff}, + { 0x182bc, 19, 0x1c, 0x924}, + { 0x18308, 1, 0x1c, 0xfff}, + { 0x1830c, 3, 0x1c, 0x924}, + { 0x18318, 1, 0x1c, 0xfff}, + { 0x1831c, 7, 0x1c, 0x924}, + { 0x18338, 1, 0x1c, 0xfff}, + { 0x1833c, 3, 0x1c, 0x924}, + { 0x18348, 1, 0x1c, 0xfff}, + { 0x1834c, 28, 0x1c, 0x924}, + { 0x183bc, 2, 0x1c, 0x1fff}, + { 0x183c8, 3, 0x1c, 0x1fff}, + { 0x183d8, 1, 0x1c, 0x1fff}, + { 0x18440, 48, 0x1c, 0x1fff}, + { 0x18500, 15, 0x1c, 0x924}, + { 0x18570, 1, 0x18, 0xfff}, + { 0x18574, 1, 0x18, 0x924}, + { 0x18578, 1, 0x18, 0xfff}, + { 0x1857c, 4, 0x18, 0x924}, + { 0x1858c, 1, 0x18, 0xfff}, + { 0x18590, 1, 0x18, 0x924}, + { 0x18594, 1, 0x18, 0xfff}, + { 0x18598, 32, 0x18, 0x924}, + { 0x18618, 5, 0x10, 0x924}, + { 0x1862c, 4, 0x10, 0xfff}, + { 0x1863c, 16, 0x10, 0x924}, + { 0x18680, 44, 0x10, 0x924}, + { 0x18748, 12, 0x10, 0x924}, + { 0x18788, 1, 0x10, 0x924}, + { 0x1879c, 6, 0x10, 0x924}, + { 0x187c4, 51, 0x10, 0x924}, + { 0x18a00, 48, 0x10, 0x924}, + { 0x20000, 24, 0x1f, 0x924}, + { 0x20060, 8, 0x1f, 0x9e4}, + { 0x20080, 94, 0x1f, 0x924}, + { 0x201f8, 1, 0x3, 0x924}, + { 0x201fc, 1, 0x1f, 0x924}, + { 0x20200, 1, 0x3, 0x924}, + { 0x20204, 1, 0x1f, 0x924}, + { 0x20208, 1, 0x3, 0x924}, + { 0x2020c, 4, 0x1f, 0x924}, + { 0x2021c, 11, 0x1f, 0xfff}, + { 0x20248, 24, 0x1f, 0x924}, + { 0x202b8, 2, 0x1f, 0x1fff}, + { 0x202c4, 1, 0x1f, 0x1fff}, + { 0x202c8, 1, 0x1c, 0x924}, + { 0x202d8, 4, 0x1c, 0x924}, + { 0x202f0, 1, 0x10, 0x924}, + { 0x20400, 1, 0x1f, 0x924}, + { 0x20404, 1, 0x1f, 0xfff}, + { 0x2040c, 2, 0x1f, 0xfff}, + { 0x20414, 2, 0x1f, 0x924}, + { 0x2041c, 2, 0x1f, 0xfff}, + { 0x20424, 2, 0x1f, 0x924}, + { 0x2042c, 18, 0x1e, 0x924}, + { 0x20480, 1, 0x1f, 0x924}, + { 0x20500, 1, 0x1f, 0x924}, + { 0x20600, 1, 0x1f, 0x924}, + { 0x28000, 1, 0x1f, 0x9e4}, + { 0x28004, 255, 0x1f, 0x180}, + { 0x28400, 1, 0x1f, 0x1c0}, + { 0x28404, 255, 0x1f, 0x180}, + { 0x28800, 1, 0x1f, 0x1c0}, + { 0x28804, 255, 0x1f, 0x180}, + { 0x28c00, 1, 0x1f, 0x1c0}, + { 0x28c04, 255, 0x1f, 0x180}, + { 0x29000, 1, 0x1f, 0x1c0}, + { 0x29004, 255, 0x1f, 0x180}, + { 0x29400, 1, 0x1f, 0x1c0}, + { 0x29404, 255, 0x1f, 0x180}, + { 0x29800, 1, 0x1f, 0x1c0}, + { 0x29804, 255, 0x1f, 0x180}, + { 0x29c00, 1, 0x1f, 0x1c0}, + { 0x29c04, 255, 0x1f, 0x180}, + { 0x2a000, 1, 0x1f, 0x1c0}, + { 0x2a004, 255, 0x1f, 0x180}, + { 0x2a400, 1, 0x1f, 0x1c0}, + { 0x2a404, 255, 0x1f, 0x180}, + { 0x2a800, 1, 0x1f, 0x1c0}, + { 0x2a804, 255, 0x1f, 0x180}, + { 0x2ac00, 1, 0x1f, 0x1c0}, + { 0x2ac04, 255, 0x1f, 0x180}, + { 0x2b000, 1, 0x1f, 0x1c0}, + { 0x2b004, 255, 0x1f, 0x180}, + { 0x2b400, 1, 0x1f, 0x1c0}, + { 0x2b404, 255, 0x1f, 0x180}, + { 0x2b800, 1, 0x1f, 0x1c0}, + { 0x2b804, 255, 0x1f, 0x180}, + { 0x2bc00, 1, 0x1f, 0x1c0}, + { 0x2bc04, 255, 0x1f, 0x180}, + { 0x2c000, 1, 0x1f, 0x1c0}, + { 0x2c004, 255, 0x1f, 0x180}, + { 0x2c400, 1, 0x1f, 0x1c0}, + { 0x2c404, 255, 0x1f, 0x180}, + { 0x2c800, 1, 0x1f, 0x1c0}, + { 0x2c804, 255, 0x1f, 0x180}, + { 0x2cc00, 1, 0x1f, 0x1c0}, + { 0x2cc04, 255, 0x1f, 0x180}, + { 0x2d000, 1, 0x1f, 0x1c0}, + { 0x2d004, 255, 0x1f, 0x180}, + { 0x2d400, 1, 0x1f, 0x1c0}, + { 0x2d404, 255, 0x1f, 0x180}, + { 0x2d800, 1, 0x1f, 0x1c0}, + { 0x2d804, 255, 0x1f, 0x180}, + { 0x2dc00, 1, 0x1f, 0x1c0}, + { 0x2dc04, 255, 0x1f, 0x180}, + { 0x2e000, 1, 0x1f, 0x1c0}, + { 0x2e004, 255, 0x1f, 0x180}, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 23 03:29:38 2015 Return-Path: Delivered-To: svn-src-all@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 C63B3A5045A; Wed, 23 Dec 2015 03:29:38 +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 71D3B1340; Wed, 23 Dec 2015 03:29:38 +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 tBN3TbF6065091; Wed, 23 Dec 2015 03:29:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBN3Tboq065090; Wed, 23 Dec 2015 03:29:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512230329.tBN3Tboq065090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 03:29:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292640 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 03:29:38 -0000 Author: ngie Date: Wed Dec 23 03:29:37 2015 New Revision: 292640 URL: https://svnweb.freebsd.org/changeset/base/292640 Log: Clean up trailing whitespace; no functional change MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/link_elf.c Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Wed Dec 23 03:19:12 2015 (r292639) +++ head/sys/kern/link_elf.c Wed Dec 23 03:29:37 2015 (r292640) @@ -438,7 +438,7 @@ link_elf_init(void* arg) ctors_sizep = (Elf_Size *)preload_search_info(modptr, MODINFO_METADATA | MODINFOMD_CTORS_SIZE); if (ctors_addrp != NULL && ctors_sizep != NULL) { - linker_kernel_file->ctors_addr = ef->address + + linker_kernel_file->ctors_addr = ef->address *ctors_addrp; linker_kernel_file->ctors_size = *ctors_sizep; } @@ -605,7 +605,7 @@ parse_dynamic(elf_file_t ef) static int parse_dpcpu(elf_file_t ef) -{ +{ int count; int error; @@ -636,7 +636,7 @@ parse_dpcpu(elf_file_t ef) #ifdef VIMAGE static int parse_vnet(elf_file_t ef) -{ +{ int count; int error; @@ -916,7 +916,7 @@ link_elf_load_file(linker_class_t cls, c */ base_offset = trunc_page(segs[0]->p_offset); base_vaddr = trunc_page(segs[0]->p_vaddr); - base_vlimit = round_page(segs[nsegs - 1]->p_vaddr + + base_vlimit = round_page(segs[nsegs - 1]->p_vaddr + segs[nsegs - 1]->p_memsz); mapsize = base_vlimit - base_vaddr; @@ -979,7 +979,7 @@ link_elf_load_file(linker_class_t cls, c #ifdef GPROF /* Update profiling information with the new text segment. */ mtx_lock(&Giant); - kmupetext((uintfptr_t)(mapbase + segs[0]->p_vaddr - base_vaddr + + kmupetext((uintfptr_t)(mapbase + segs[0]->p_vaddr - base_vaddr segs[0]->p_memsz)); mtx_unlock(&Giant); #endif @@ -1481,7 +1481,7 @@ link_elf_each_function_name(linker_file_ elf_file_t ef = (elf_file_t)file; const Elf_Sym *symp; int i, error; - + /* Exhaustive search */ for (i = 0, symp = ef->ddbsymtab; i < ef->ddbsymcnt; i++, symp++) { if (symp->st_value != 0 && @@ -1652,7 +1652,7 @@ link_elf_symtab_get(linker_file_t lf, co return (ef->ddbsymcnt); } - + static long link_elf_strtab_get(linker_file_t lf, caddr_t *strtab) { From owner-svn-src-all@freebsd.org Wed Dec 23 03:34:44 2015 Return-Path: Delivered-To: svn-src-all@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 523D4A50605; Wed, 23 Dec 2015 03:34:44 +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 214591807; Wed, 23 Dec 2015 03:34:44 +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 tBN3Yhbt067870; Wed, 23 Dec 2015 03:34:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBN3Yhob067869; Wed, 23 Dec 2015 03:34:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512230334.tBN3Yhob067869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 03:34:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292641 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 03:34:44 -0000 Author: ngie Date: Wed Dec 23 03:34:43 2015 New Revision: 292641 URL: https://svnweb.freebsd.org/changeset/base/292641 Log: Fix r292640 vim overzealously removed some trailing `+' and I didn't check the diff MFC after: 1 week X-MFC with: r292640 Pointyhat to: ngie Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/link_elf.c Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Wed Dec 23 03:29:37 2015 (r292640) +++ head/sys/kern/link_elf.c Wed Dec 23 03:34:43 2015 (r292641) @@ -438,7 +438,7 @@ link_elf_init(void* arg) ctors_sizep = (Elf_Size *)preload_search_info(modptr, MODINFO_METADATA | MODINFOMD_CTORS_SIZE); if (ctors_addrp != NULL && ctors_sizep != NULL) { - linker_kernel_file->ctors_addr = ef->address + linker_kernel_file->ctors_addr = ef->address + *ctors_addrp; linker_kernel_file->ctors_size = *ctors_sizep; } @@ -979,7 +979,7 @@ link_elf_load_file(linker_class_t cls, c #ifdef GPROF /* Update profiling information with the new text segment. */ mtx_lock(&Giant); - kmupetext((uintfptr_t)(mapbase + segs[0]->p_vaddr - base_vaddr + kmupetext((uintfptr_t)(mapbase + segs[0]->p_vaddr - base_vaddr + segs[0]->p_memsz)); mtx_unlock(&Giant); #endif From owner-svn-src-all@freebsd.org Wed Dec 23 06:42:37 2015 Return-Path: Delivered-To: svn-src-all@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 B8FF3A4FAEE; Wed, 23 Dec 2015 06:42:37 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::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 8897B1A56; Wed, 23 Dec 2015 06:42:37 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by mail-io0-x229.google.com with SMTP id o67so207816832iof.3; Tue, 22 Dec 2015 22:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=N7XYEWJsoG4REEfXaJpES5+/f99HcYpkje0HOI07VEg=; b=J98d9l+L8ZU9qC8JgMifylattDkyTwFUJ0IundSpcSV/1rSkgK3QIk6jTMkPn2dx+0 ATj9dItG6DIpIw7IX+xAmboamlz5y6V0zlSEIT69EGnP7wE05a826evpMbJY5xGqM8xx z542JsJSpomseh/HVeeeD1xqkZE/wkqUv8h9jT2URqgr53Y+FDgWizyrICxsNMJYQ0Q6 xqd8KN7X8bkXtddJkmNWst0+Ui1txe/EeO1emPeVcU9iq649uFO2yanOneGwTKNBdnuD w/OZwJviZJ7GDYguVQGM8rrFhYepDHxjI2yUaCzaixp5ZCglDD5d+MSabd6rCcz8SyLW iKmg== MIME-Version: 1.0 X-Received: by 10.107.41.206 with SMTP id p197mr21708598iop.80.1450852956904; Tue, 22 Dec 2015 22:42:36 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.50.152.69 with HTTP; Tue, 22 Dec 2015 22:42:36 -0800 (PST) In-Reply-To: <201512210858.tBL8wFQu079407@repo.freebsd.org> References: <201512210858.tBL8wFQu079407@repo.freebsd.org> Date: Tue, 22 Dec 2015 22:42:36 -0800 X-Google-Sender-Auth: 0SUu5Kc4G3Y7Vezjpnj5sQ6fzXc Message-ID: Subject: Re: svn commit: r292533 - head/tools/regression/mac/mac_bsdextended From: Craig Rodrigues To: Garrett Cooper Cc: "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.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 06:42:37 -0000 On Mon, Dec 21, 2015 at 12:58 AM, Garrett Cooper wrote: > Author: ngie > Date: Mon Dec 21 08:58:14 2015 > New Revision: 292533 > URL: https://svnweb.freebsd.org/changeset/base/292533 > > Log: > Skip the testcases if mac_bsdextended(4) isn't detected on the > system > > MFC after: 2 weeks > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/tools/regression/mac/mac_bsdextended/test_matches.sh > > One of these tests seems to be failing: https://jenkins.freebsd.org/job/FreeBSD_HEAD_Build_and_Test/60/testReport/junit/sys.mac.bsdextended/ugidfw_test/main/ -- Craig From owner-svn-src-all@freebsd.org Wed Dec 23 06:49:20 2015 Return-Path: Delivered-To: svn-src-all@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 182A5A4FCDB; Wed, 23 Dec 2015 06:49:20 +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 DD0A61D35; Wed, 23 Dec 2015 06:49:19 +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 tBN6nJSS023271; Wed, 23 Dec 2015 06:49:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBN6nJsJ023270; Wed, 23 Dec 2015 06:49:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512230649.tBN6nJsJ023270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 23 Dec 2015 06:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292644 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 06:49:20 -0000 Author: imp Date: Wed Dec 23 06:49:18 2015 New Revision: 292644 URL: https://svnweb.freebsd.org/changeset/base/292644 Log: Copy all the dtb files that we build as part of the kernel build from boot/dtb to the fat partition. They seem to be needed. Create an empty uEnv.txt file Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Wed Dec 23 04:36:15 2015 (r292643) +++ head/tools/tools/nanobsd/embedded/common Wed Dec 23 06:49:18 2015 (r292644) @@ -456,18 +456,26 @@ customize_cmd cust_comconsole dos_boot_part ( ) ( local d=/usr/local/share/u-boot/${NANO_BOOT_PKG} + local f=${NANO_FAT_DIR} # For now, just copy all the files. However, for iMX6 and Allwinner, # we'll need to put a special boot block at a fixed location # on the disk as well. - rm -rf ${NANO_FAT_DIR} - mkdir ${NANO_FAT_DIR} - cp ${d}/* ${NANO_FAT_DIR} + rm -rf $f + mkdir $f + chdir $f + cp ${d}/* . # Also copy ubldr. u-boot will load it and it will load the kernel # from the ufs partition - cp ${NANO_WORLDDIR}/boot/ubldr ${NANO_FAT_DIR} - cp ${NANO_WORLDDIR}/boot/ubldr.bin ${NANO_FAT_DIR} + cp ${NANO_WORLDDIR}/boot/ubldr . + cp ${NANO_WORLDDIR}/boot/ubldr.bin . + + # We have to touch the saveenv file + touch uEnv.txt + + # Now we need to copy over dtb files from the build. + cp ${NANO_WORLDDIR}/boot/dtb/*.dtb . ) if [ -n "$NANO_BOOT_PKG" ]; then From owner-svn-src-all@freebsd.org Wed Dec 23 06:49:30 2015 Return-Path: Delivered-To: svn-src-all@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 0FE0DA4FD15; Wed, 23 Dec 2015 06:49: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 D7A321E86; Wed, 23 Dec 2015 06: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 tBN6nTlw023317; Wed, 23 Dec 2015 06:49:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBN6nTPW023316; Wed, 23 Dec 2015 06:49:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512230649.tBN6nTPW023316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 23 Dec 2015 06:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292645 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 06:49:30 -0000 Author: imp Date: Wed Dec 23 06:49:28 2015 New Revision: 292645 URL: https://svnweb.freebsd.org/changeset/base/292645 Log: Touch /firstboot in the WORLDDIR. Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Wed Dec 23 06:49:18 2015 (r292644) +++ head/tools/tools/nanobsd/embedded/common Wed Dec 23 06:49:28 2015 (r292645) @@ -508,6 +508,8 @@ product_custom ( ) ( echo "growfs_type=nanobsd-pingpong" >> $rc echo "ntpdate_enable=YES" >> $rc echo "ntpdate_hosts=0.freebsd.pool.ntp.org 1.freebsd.pool.ntp.org" >> $rc + # Make sure that firstboot scripts run so growfs works. + touch ${NANO_WORLDDIR}/firstboot ) late_customize_cmd product_custom From owner-svn-src-all@freebsd.org Wed Dec 23 07:27:50 2015 Return-Path: Delivered-To: svn-src-all@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 C52BAA5079C; Wed, 23 Dec 2015 07:27:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::231]) (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 8E7231EE4; Wed, 23 Dec 2015 07:27:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x231.google.com with SMTP id q63so12701588pfb.0; Tue, 22 Dec 2015 23:27:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=3Yibc9SEVWBCKSjUFZdrUW4BiavoCoEznaOtLbdk5ak=; b=Kz7X8ekK+rIHohtYIPGle8vHTDY2VZIxxGSfV9koFmeZrQQUhIqM+KhsLHVDJ7MGNV PFVAz3O/MohI++yJtq0e6FtPOlgLOFT0XfAU62Zru1CKVeCRuRH6gr1hSV901lUdCMjp N9bgeQ6XiVOf6WhlnUHda5eU40ImppQ+9LK30HJaSWuN4h7SaWmtB27IPCO5g4kycF+j TeZmsTXC86V4/JzKoV3Jgp4BWfUGSecWl2Lms2c1CmD4JAIy3cDSM487rYBSkF3Nc0VN N7hDSNbU9iHwkK5F0iH5mfKejsYd60M/O0+CtXVuDnkMmcJv9g+LIbc3zsWKTa6Fg6eB 2oxw== X-Received: by 10.98.73.71 with SMTP id w68mr31126799pfa.138.1450855670064; Tue, 22 Dec 2015 23:27:50 -0800 (PST) Received: from [10.1.10.60] (c-71-231-224-9.hsd1.wa.comcast.net. [71.231.224.9]) by smtp.gmail.com with ESMTPSA id c27sm19711503pfd.50.2015.12.22.23.27.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Dec 2015 23:27:48 -0800 (PST) Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r292533 - head/tools/regression/mac/mac_bsdextended From: Garrett Cooper X-Mailer: iPhone Mail (13C75) In-Reply-To: Date: Tue, 22 Dec 2015 23:27:45 -0800 Cc: Garrett Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: References: <201512210858.tBL8wFQu079407@repo.freebsd.org> To: Craig Rodrigues Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 07:27:51 -0000 > On Dec 22, 2015, at 22:42, Craig Rodrigues wrote:= >=20 >> On Mon, Dec 21, 2015 at 12:58 AM, Garrett Cooper wrote= : >> Author: ngie >> Date: Mon Dec 21 08:58:14 2015 >> New Revision: 292533 >> URL: https://svnweb.freebsd.org/changeset/base/292533 >>=20 >> Log: >> Skip the testcases if mac_bsdextended(4) isn't detected on the >> system >>=20 >> MFC after: 2 weeks >> Sponsored by: EMC / Isilon Storage Division >>=20 >> Modified: >> head/tools/regression/mac/mac_bsdextended/test_matches.sh >=20 > One of these tests seems to be failing: >=20 > https://jenkins.freebsd.org/job/FreeBSD_HEAD_Build_and_Test/60/testReport/= junit/sys.mac.bsdextended/ugidfw_test/main/ Thanks for the heads up. I'll look into this soon!= From owner-svn-src-all@freebsd.org Wed Dec 23 07:28:49 2015 Return-Path: Delivered-To: svn-src-all@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 3C9E5A50814; Wed, 23 Dec 2015 07:28:49 +0000 (UTC) (envelope-from rodrigc@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 104091083; Wed, 23 Dec 2015 07:28:48 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBN7Sm6p034497; Wed, 23 Dec 2015 07:28:48 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBN7SmfD034496; Wed, 23 Dec 2015 07:28:48 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201512230728.tBN7SmfD034496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Wed, 23 Dec 2015 07:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292646 - head/usr.bin/vmstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 07:28:49 -0000 Author: rodrigc Date: Wed Dec 23 07:28:48 2015 New Revision: 292646 URL: https://svnweb.freebsd.org/changeset/base/292646 Log: Remove extraneous characters Noticed by: markj Reviewed by: allanjude Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Wed Dec 23 06:49:28 2015 (r292645) +++ head/usr.bin/vmstat/vmstat.c Wed Dec 23 07:28:48 2015 (r292646) @@ -886,9 +886,9 @@ printhdr(int maxid, u_long cpumask) num_shown = (num_selected < maxshowdevs) ? num_selected : maxshowdevs; if (hflag) { - xo_emit("{T:procs} {T:memory} ${T:/page%*s}", 19, ""); + xo_emit("{T:procs} {T:memory} {T:/page%*s}", 19, ""); } else { - xo_emit("{T:procs} {T:memory} ${T:/page%*s}", 19, ""); + xo_emit("{T:procs} {T:memory} {T:/page%*s}", 19, ""); } if (num_shown > 1) xo_emit(" {T:/disks %*s}", num_shown * 4 - 7, ""); From owner-svn-src-all@freebsd.org Wed Dec 23 09:11:19 2015 Return-Path: Delivered-To: svn-src-all@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 87D89A4EB86; Wed, 23 Dec 2015 09:11:19 +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 54B6317D1; Wed, 23 Dec 2015 09:11:19 +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 tBN9BI0f063520; Wed, 23 Dec 2015 09:11:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBN9BIvZ063519; Wed, 23 Dec 2015 09:11:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512230911.tBN9BIvZ063519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 09:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292647 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 09:11:19 -0000 Author: ngie Date: Wed Dec 23 09:11:18 2015 New Revision: 292647 URL: https://svnweb.freebsd.org/changeset/base/292647 Log: Use j instead of a hardcoded index (9) and increment it after running the NaNs testcases MFC after: 3 days Pointyhat to: ngie Sponsored by: EMC / Isilon Storage Division Modified: head/lib/msun/tests/fma_test.c Modified: head/lib/msun/tests/fma_test.c ============================================================================== --- head/lib/msun/tests/fma_test.c Wed Dec 23 07:28:48 2015 (r292646) +++ head/lib/msun/tests/fma_test.c Wed Dec 23 09:11:18 2015 (r292647) @@ -507,7 +507,8 @@ main(int argc, char *argv[]) fesetround(FE_TONEAREST); test_nans(); - printf("ok 9 - fma NaNs\n"); + printf("ok %d - fma NaNs\n", j); + j++; for (i = 0; i < nitems(rmodes); i++, j++) { printf("rmode = %d\n", rmodes[i]); From owner-svn-src-all@freebsd.org Wed Dec 23 09:18:49 2015 Return-Path: Delivered-To: svn-src-all@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 3FAA1A4ED52; Wed, 23 Dec 2015 09:18: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 0E8391E2E; Wed, 23 Dec 2015 09:18:48 +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 tBN9Imea066457; Wed, 23 Dec 2015 09:18:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBN9ImJb066456; Wed, 23 Dec 2015 09:18:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512230918.tBN9ImJb066456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 09:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292649 - stable/10/tools/regression/lib/msun X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 09:18:49 -0000 Author: ngie Date: Wed Dec 23 09:18:47 2015 New Revision: 292649 URL: https://svnweb.freebsd.org/changeset/base/292649 Log: MFC r292327: Use fabsl instead of fabs to mute -Wabsolute-value warnings from clang because `nums[]` is an array of long doubles Sponsored by: EMC / Isilon Storage Division Modified: stable/10/tools/regression/lib/msun/test-invctrig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/lib/msun/test-invctrig.c ============================================================================== --- stable/10/tools/regression/lib/msun/test-invctrig.c Wed Dec 23 09:13:53 2015 (r292648) +++ stable/10/tools/regression/lib/msun/test-invctrig.c Wed Dec 23 09:18:47 2015 (r292649) @@ -281,21 +281,21 @@ test_axes(void) for (i = 0; i < sizeof(nums) / sizeof(nums[0]); i++) { /* Real axis */ z = CMPLXL(nums[i], 0.0); - if (fabs(nums[i]) <= 1) { + if (fabsl(nums[i]) <= 1) { testall_tol(cacosh, z, CMPLXL(0.0, acos(nums[i])), 1); testall_tol(cacos, z, CMPLXL(acosl(nums[i]), -0.0), 1); testall_tol(casin, z, CMPLXL(asinl(nums[i]), 0.0), 1); testall_tol(catanh, z, CMPLXL(atanh(nums[i]), 0.0), 1); } else { testall_tol(cacosh, z, - CMPLXL(acosh(fabs(nums[i])), + CMPLXL(acosh(fabsl(nums[i])), (nums[i] < 0) ? pi : 0), 1); testall_tol(cacos, z, CMPLXL((nums[i] < 0) ? pi : 0, - -acosh(fabs(nums[i]))), 1); + -acosh(fabsl(nums[i]))), 1); testall_tol(casin, z, CMPLXL(copysign(pi / 2, nums[i]), - acosh(fabs(nums[i]))), 1); + acosh(fabsl(nums[i]))), 1); testall_tol(catanh, z, CMPLXL(atanh(1 / nums[i]), pi / 2), 1); } From owner-svn-src-all@freebsd.org Wed Dec 23 09:59:32 2015 Return-Path: Delivered-To: svn-src-all@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 5451DA49F8B; Wed, 23 Dec 2015 09:59:32 +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 244D31E69; Wed, 23 Dec 2015 09:59:32 +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 tBN9xVLb077950; Wed, 23 Dec 2015 09:59:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBN9xV1q077949; Wed, 23 Dec 2015 09:59:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512230959.tBN9xV1q077949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 09:59:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292650 - head/tests/sys/mac/bsdextended X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 09:59:32 -0000 Author: ngie Date: Wed Dec 23 09:59:31 2015 New Revision: 292650 URL: https://svnweb.freebsd.org/changeset/base/292650 Log: Move mac_bsdextended check up before running the test_libugidfw_strings testcases I realize that these tests could be run before mac_bsdextended is loaded, but it would overcomplicate things to special case handle the testcases before doing the mac_bsdextended(4) feature check The testcases will be split up so they can be run separately in the near future MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/mac/bsdextended/ugidfw_test.c Modified: head/tests/sys/mac/bsdextended/ugidfw_test.c ============================================================================== --- head/tests/sys/mac/bsdextended/ugidfw_test.c Wed Dec 23 09:18:47 2015 (r292649) +++ head/tests/sys/mac/bsdextended/ugidfw_test.c Wed Dec 23 09:59:31 2015 (r292650) @@ -208,16 +208,6 @@ main(void) return (0); } - printf("1..%lu\n", nitems(test_users) + nitems(test_groups) + - 3 * nitems(test_strings) + 2); - - /* - * We can test some parts of the library without the MAC Framework - * and policy loaded, so run those tests before calling - * mac_is_present(). - */ - test_libugidfw_strings(); - switch (mac_is_present("bsdextended")) { case -1: printf("1..0 # SKIP mac_is_present failed: %s\n", @@ -231,6 +221,16 @@ main(void) return (0); } + printf("1..%lu\n", nitems(test_users) + nitems(test_groups) + + 3 * nitems(test_strings) + 2); + + /* + * We can test some parts of the library without the MAC Framework + * and policy loaded, so run those tests before calling + * mac_is_present(). + */ + test_libugidfw_strings(); + /* * Some simple up-front checks to see if we're able to query the * policy for basic state. We want the rule count to be 0 before From owner-svn-src-all@freebsd.org Wed Dec 23 09:59:50 2015 Return-Path: Delivered-To: svn-src-all@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 69CFEA49FD3; Wed, 23 Dec 2015 09:59:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::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 4A3791FDE; Wed, 23 Dec 2015 09:59:50 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x232.google.com with SMTP id jx14so103738566pad.2; Wed, 23 Dec 2015 01:59:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WnkSOCFQawEE+Y0UEZstlHr2ftbmkkAlEfvXAFBBFTI=; b=cQOBlJ0NObQRm5Xxf95OUqTCwNqLKaCj2pxnKgCmwH894Al3hH6MgkzsPShwyxwAsw Z5FA6XwjRAcMeecjXBfHNGpoaFotsTstpc5yP6ZeBhPg3wxOwBDRCjWW+RfSvQRG4FNd mf64HelBCHmRYJi31+nMAKjQSrqITRZsLtvfnqr8p3EnCZ9cBYxzdHcHSoplWQhZazE6 a1r2xN6KQJcTMwD4tAkyTsceDXAKjLe0L0YMHWLMoj/fk0SVuqm5tUkqzFQYco288qbo XyPZpyZmaS+04dVm2uF1Be9nHF3IBYqMRsFg5ibo65Ch/At81voSweu5GwZG7nSmrG1M aI3Q== X-Received: by 10.66.160.168 with SMTP id xl8mr43225357pab.116.1450864789791; Wed, 23 Dec 2015 01:59:49 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:6572:283a:84b7:ac98? ([2601:601:800:126d:6572:283a:84b7:ac98]) by smtp.gmail.com with ESMTPSA id k76sm7662163pfb.37.2015.12.23.01.59.47 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Dec 2015 01:59:48 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r292533 - head/tools/regression/mac/mac_bsdextended From: NGie Cooper In-Reply-To: Date: Wed, 23 Dec 2015 01:59:46 -0800 Cc: Garrett Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <836ADE8C-08AF-4639-8942-05C6F7F26839@gmail.com> References: <201512210858.tBL8wFQu079407@repo.freebsd.org> To: Craig Rodrigues X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 09:59:50 -0000 > On Dec 22, 2015, at 23:27, Garrett Cooper = wrote: >=20 > On Dec 22, 2015, at 22:42, Craig Rodrigues = wrote: >=20 >> On Mon, Dec 21, 2015 at 12:58 AM, Garrett Cooper = wrote: >> Author: ngie >> Date: Mon Dec 21 08:58:14 2015 >> New Revision: 292533 >> URL: https://svnweb.freebsd.org/changeset/base/292533 >>=20 >> Log: >> Skip the testcases if mac_bsdextended(4) isn't detected on the >> system >>=20 >> MFC after: 2 weeks >> Sponsored by: EMC / Isilon Storage Division >>=20 >> Modified: >> head/tools/regression/mac/mac_bsdextended/test_matches.sh >>=20 >>=20 >> One of these tests seems to be failing: >>=20 >> = https://jenkins.freebsd.org/job/FreeBSD_HEAD_Build_and_Test/60/testReport/= junit/sys.mac.bsdextended/ugidfw_test/main/ >=20 > Thanks for the heads up. I'll look into this soon! Fixed in r292650 =E2=80=94 thanks :)!= From owner-svn-src-all@freebsd.org Wed Dec 23 10:02:52 2015 Return-Path: Delivered-To: svn-src-all@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 84853A4F227; Wed, 23 Dec 2015 10:02:52 +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 5037E147A; Wed, 23 Dec 2015 10:02:52 +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 tBNA2pJt080673; Wed, 23 Dec 2015 10:02:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNA2p0l080672; Wed, 23 Dec 2015 10:02:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512231002.tBNA2p0l080672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 10:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292651 - head/tests/sys/mac/bsdextended X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 10:02:52 -0000 Author: ngie Date: Wed Dec 23 10:02:51 2015 New Revision: 292651 URL: https://svnweb.freebsd.org/changeset/base/292651 Log: Delete the comment about running `test_libugidfw_strings` before testing `mac_is_present` so it doesn't accidentally confuse people MFC after: 3 days X-MFC with: r292650 Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/mac/bsdextended/ugidfw_test.c Modified: head/tests/sys/mac/bsdextended/ugidfw_test.c ============================================================================== --- head/tests/sys/mac/bsdextended/ugidfw_test.c Wed Dec 23 09:59:31 2015 (r292650) +++ head/tests/sys/mac/bsdextended/ugidfw_test.c Wed Dec 23 10:02:51 2015 (r292651) @@ -224,11 +224,6 @@ main(void) printf("1..%lu\n", nitems(test_users) + nitems(test_groups) + 3 * nitems(test_strings) + 2); - /* - * We can test some parts of the library without the MAC Framework - * and policy loaded, so run those tests before calling - * mac_is_present(). - */ test_libugidfw_strings(); /* From owner-svn-src-all@freebsd.org Wed Dec 23 10:11:55 2015 Return-Path: Delivered-To: svn-src-all@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 C797DA4F5EC; Wed, 23 Dec 2015 10:11:55 +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 7E8FE18AD; Wed, 23 Dec 2015 10:11:55 +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 tBNABsk2081015; Wed, 23 Dec 2015 10:11:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNABswu081013; Wed, 23 Dec 2015 10:11:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512231011.tBNABswu081013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 10:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292652 - in stable/10/tools/regression/lib/libc: nss resolv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 10:11:55 -0000 Author: ngie Date: Wed Dec 23 10:11:54 2015 New Revision: 292652 URL: https://svnweb.freebsd.org/changeset/base/292652 Log: MFC r292316: Remove hosts that don't resolve properly with the nss and resolv tests Sponsored by: EMC / Isilon Storage Division Modified: stable/10/tools/regression/lib/libc/nss/mach stable/10/tools/regression/lib/libc/resolv/mach Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/lib/libc/nss/mach ============================================================================== --- stable/10/tools/regression/lib/libc/nss/mach Wed Dec 23 10:02:51 2015 (r292651) +++ stable/10/tools/regression/lib/libc/nss/mach Wed Dec 23 10:11:54 2015 (r292652) @@ -1,32 +1,17 @@ # $FreeBSD$ localhost -above.warped.net anoncvs.cirr.com -anoncvs.isc.netbsd.org -anoncvs.leo.org -anoncvs.netbsd.lt -anoncvs.netbsd.ro anoncvs.netbsd.se antioche.antioche.eu.org -boulder.tele.dk centaurus.4web.cz chur.math.ntnu.no console.netbsd.org -cvs.fi.netbsd.org -cvs.mikrolahti.fi cvs.netbsd.org -cvsup-netbsd.leo.org cvsup.netbsd.se -cvsup.pasta.cs.uit.no -ftp.bitcon.no ftp.chg.ru -ftp.duth.gr ftp.estpak.ee ftp.fsn.hu ftp.funet.fi -ftp.grondar.za -ftp.leo.org -ftp.netbsd.lt ftp.netbsd.org ftp.nluug.nl ftp.plig.org @@ -34,60 +19,28 @@ ftp.uni-erlangen.de ftp.xgate.co.kr gd.tuwien.ac.at gort.ludd.luth.se -grappa.unix-ag.uni-kl.de -info.wins.uva.nl irc.warped.net knug.youn.co.kr -lala.iri.co.jp mail.jp.netbsd.org -mail.kr.netbsd.org mail.netbsd.org melanoma.cs.rmit.edu.au mirror.aarnet.edu.au -mirror.netbsd.com.br -mirror03.inet.tele.dk moon.vub.ac.be -nbwww.sergei.cc net.bsd.cz netbsd.3miasto.net netbsd.4ka.mipt.ru -netbsd.apk.od.ua netbsd.csie.nctu.edu.tw netbsd.enderunix.org netbsd.ftp.fu-berlin.de -netbsd.netlead.com.au -netbsd.nsysu.edu.tw netbsd.pair.com -netbsd.stevens-tech.edu -netbsd.triada.bg -netbsd.unix.net.nz -netbsd.unixtech.be -netbsd.vejas.lt -netbsd.wagener-consulting.lu -netbsd.zarco.org netbsdiso.interoute.net.uk -netbsdwww.bitcon.no -netbsdwww.cordef.com.pl netbsdwww.cs.rmit.edu.au netbsdwww.interoute.net.uk -news.gw.com ns.netbsd.org -pigu.iri.co.jp -pluto.cdpa.nsysu.edu.tw -projects.slowass.net -server6.pasta.cs.uit.no skeleton.phys.spbu.ru -snoopy.allbsd.org -spike.allbsd.org -sundry.netbsd.org -tanya.sergei.cc -web-a.fi.gw.com -web-a.us.gw.com -web.netbsd.mirror.arhea.net www.en.netbsd.de www.netbsd.cl www.netbsd.nl www.netbsd.org www.netbsd.ro -zathras.netbsd.org zeppo.rediris.es Modified: stable/10/tools/regression/lib/libc/resolv/mach ============================================================================== --- stable/10/tools/regression/lib/libc/resolv/mach Wed Dec 23 10:02:51 2015 (r292651) +++ stable/10/tools/regression/lib/libc/resolv/mach Wed Dec 23 10:11:54 2015 (r292652) @@ -1,32 +1,17 @@ # $FreeBSD$ localhost -above.warped.net anoncvs.cirr.com -anoncvs.isc.netbsd.org -anoncvs.leo.org -anoncvs.netbsd.lt -anoncvs.netbsd.ro anoncvs.netbsd.se antioche.antioche.eu.org -boulder.tele.dk centaurus.4web.cz chur.math.ntnu.no console.netbsd.org -cvs.fi.netbsd.org -cvs.mikrolahti.fi cvs.netbsd.org -cvsup-netbsd.leo.org cvsup.netbsd.se -cvsup.pasta.cs.uit.no -ftp.bitcon.no ftp.chg.ru -ftp.duth.gr ftp.estpak.ee ftp.fsn.hu ftp.funet.fi -ftp.grondar.za -ftp.leo.org -ftp.netbsd.lt ftp.netbsd.org ftp.nluug.nl ftp.plig.org @@ -34,60 +19,28 @@ ftp.uni-erlangen.de ftp.xgate.co.kr gd.tuwien.ac.at gort.ludd.luth.se -grappa.unix-ag.uni-kl.de -info.wins.uva.nl irc.warped.net knug.youn.co.kr -lala.iri.co.jp mail.jp.netbsd.org -mail.kr.netbsd.org mail.netbsd.org melanoma.cs.rmit.edu.au mirror.aarnet.edu.au -mirror.netbsd.com.br -mirror03.inet.tele.dk moon.vub.ac.be -nbwww.sergei.cc net.bsd.cz netbsd.3miasto.net netbsd.4ka.mipt.ru -netbsd.apk.od.ua netbsd.csie.nctu.edu.tw netbsd.enderunix.org netbsd.ftp.fu-berlin.de -netbsd.netlead.com.au -netbsd.nsysu.edu.tw netbsd.pair.com -netbsd.stevens-tech.edu -netbsd.triada.bg -netbsd.unix.net.nz -netbsd.unixtech.be -netbsd.vejas.lt -netbsd.wagener-consulting.lu -netbsd.zarco.org netbsdiso.interoute.net.uk -netbsdwww.bitcon.no -netbsdwww.cordef.com.pl netbsdwww.cs.rmit.edu.au netbsdwww.interoute.net.uk -news.gw.com ns.netbsd.org -pigu.iri.co.jp -pluto.cdpa.nsysu.edu.tw -projects.slowass.net -server6.pasta.cs.uit.no skeleton.phys.spbu.ru -snoopy.allbsd.org -spike.allbsd.org -sundry.netbsd.org -tanya.sergei.cc -web-a.fi.gw.com -web-a.us.gw.com -web.netbsd.mirror.arhea.net www.en.netbsd.de www.netbsd.cl www.netbsd.nl www.netbsd.org www.netbsd.ro -zathras.netbsd.org zeppo.rediris.es From owner-svn-src-all@freebsd.org Wed Dec 23 10:20:48 2015 Return-Path: Delivered-To: svn-src-all@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 11A48A4F882; Wed, 23 Dec 2015 10:20:48 +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 D7A0B1D27; Wed, 23 Dec 2015 10:20:47 +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 tBNAKkkj084034; Wed, 23 Dec 2015 10:20:46 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNAKkPk084033; Wed, 23 Dec 2015 10:20:46 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512231020.tBNAKkPk084033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 23 Dec 2015 10:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292653 - head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 10:20:48 -0000 Author: bapt Date: Wed Dec 23 10:20:46 2015 New Revision: 292653 URL: https://svnweb.freebsd.org/changeset/base/292653 Log: Report an error if zdb cannot initialize zfs If the zfs module is not present and not loadable, report an error to the user instead of crashing Reviewed by: mahrens Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D4691 Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Dec 23 10:11:54 2015 (r292652) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Dec 23 10:20:46 2015 (r292653) @@ -3657,7 +3657,8 @@ main(int argc, char **argv) kernel_init(FREAD); g_zfs = libzfs_init(); - ASSERT(g_zfs != NULL); + if (g_zfs == NULL) + fatal("Fail to initialize zfs"); if (dump_all) verbose = MAX(verbose, 1); From owner-svn-src-all@freebsd.org Wed Dec 23 10:23:49 2015 Return-Path: Delivered-To: svn-src-all@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 3E1F5A4FA0B; Wed, 23 Dec 2015 10:23:49 +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 0C86010A7; Wed, 23 Dec 2015 10:23:48 +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 tBNANm5g086748; Wed, 23 Dec 2015 10:23:48 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNANmNX086747; Wed, 23 Dec 2015 10:23:48 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201512231023.tBNANmNX086747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 23 Dec 2015 10:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292654 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 10:23:49 -0000 Author: bz Date: Wed Dec 23 10:23:47 2015 New Revision: 292654 URL: https://svnweb.freebsd.org/changeset/base/292654 Log: Remove superfluous return (1) missed in r292601. Reported by: Matthew D. Fuller (fullermd over-yonder.net), Kevin Bowling (kevin.bowling kev009.com) MFC after: 13 days X-MFC with: r292601 Sponsored by: The FreeBSD Foundation Modified: head/sys/netinet6/in6_rmx.c Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Wed Dec 23 10:20:46 2015 (r292653) +++ head/sys/netinet6/in6_rmx.c Wed Dec 23 10:23:47 2015 (r292654) @@ -267,7 +267,6 @@ in6_detachhead(void **head, int off) callout_drain(&V_rtq_mtutimer); return (rn_detachhead(head)); - return (1); } #endif From owner-svn-src-all@freebsd.org Wed Dec 23 10:31:47 2015 Return-Path: Delivered-To: svn-src-all@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 6499FA4FBA2; Wed, 23 Dec 2015 10:31:47 +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 325A9147C; Wed, 23 Dec 2015 10:31:47 +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 tBNAVkFD087069; Wed, 23 Dec 2015 10:31:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNAVkNo087068; Wed, 23 Dec 2015 10:31:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512231031.tBNAVkNo087068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 10:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292655 - stable/10/tests/freebsd_test_suite X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 10:31:47 -0000 Author: ngie Date: Wed Dec 23 10:31:46 2015 New Revision: 292655 URL: https://svnweb.freebsd.org/changeset/base/292655 Log: MFC r292319: Add ATF_REQUIRE_FEATURE and PLAIN_REQUIRE_FEATURE macros for testing for kernel features via the feature_present(3) libcall The semantics are similar to the other macros in the header (skip testcase with ATF macro; exit with appropriate exit code with the PLAIN macro) Sponsored by: EMC / Isilon Storage Division Modified: stable/10/tests/freebsd_test_suite/macros.h Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/freebsd_test_suite/macros.h ============================================================================== --- stable/10/tests/freebsd_test_suite/macros.h Wed Dec 23 10:23:47 2015 (r292654) +++ stable/10/tests/freebsd_test_suite/macros.h Wed Dec 23 10:31:46 2015 (r292655) @@ -38,6 +38,13 @@ #include +#define ATF_REQUIRE_FEATURE(_feature_name) do { \ + if (feature_present(_feature_name) == 0) { \ + atf_tc_skip("kernel feature (%s) not present", \ + _feature_name); \ + } \ +} while(0) + #define ATF_REQUIRE_KERNEL_MODULE(_mod_name) do { \ if (modfind(_mod_name) == -1) { \ atf_tc_skip("module %s could not be resolved: %s", \ @@ -45,6 +52,14 @@ } \ } while(0) +#define PLAIN_REQUIRE_FEATURE(_feature_name, _exit_code) do { \ + if (feature_present(_feature_name) == 0) { \ + printf("kernel feature (%s) not present\n", \ + _feature_name); \ + _exit(_exit_code); \ + } \ +} while(0) + #define PLAIN_REQUIRE_KERNEL_MODULE(_mod_name, _exit_code) do { \ if (modfind(_mod_name) == -1) { \ printf("module %s could not be resolved: %s\n", \ From owner-svn-src-all@freebsd.org Wed Dec 23 10:34:12 2015 Return-Path: Delivered-To: svn-src-all@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 DF322A4FD9B; Wed, 23 Dec 2015 10:34:12 +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 B1C2D198C; Wed, 23 Dec 2015 10:34:12 +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 tBNAYBEh089660; Wed, 23 Dec 2015 10:34:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNAYBD0089659; Wed, 23 Dec 2015 10:34:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512231034.tBNAYBD0089659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 10:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292656 - stable/10/share/examples/tests/tests/atf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 10:34:13 -0000 Author: ngie Date: Wed Dec 23 10:34:11 2015 New Revision: 292656 URL: https://svnweb.freebsd.org/changeset/base/292656 Log: MFC r292485: Add missing return statement to atf/printf_test to make the example complete and correct, and mute a compiler warning from clang Reported by: Jenkins Sponsored by: EMC / Isilon Storage Division Modified: stable/10/share/examples/tests/tests/atf/printf_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/examples/tests/tests/atf/printf_test.c ============================================================================== --- stable/10/share/examples/tests/tests/atf/printf_test.c Wed Dec 23 10:31:46 2015 (r292655) +++ stable/10/share/examples/tests/tests/atf/printf_test.c Wed Dec 23 10:34:11 2015 (r292656) @@ -152,4 +152,6 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, snprintf__two_formatters); ATF_TP_ADD_TC(tp, snprintf__overflow); ATF_TP_ADD_TC(tp, fprintf__simple_string); + + return (atf_no_error()); } From owner-svn-src-all@freebsd.org Wed Dec 23 10:38:45 2015 Return-Path: Delivered-To: svn-src-all@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 A763FA4FF3B; Wed, 23 Dec 2015 10:38:45 +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 670CC1B32; Wed, 23 Dec 2015 10:38:45 +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 tBNAci7T089843; Wed, 23 Dec 2015 10:38:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNAciKc089840; Wed, 23 Dec 2015 10:38:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512231038.tBNAciKc089840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 10:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292657 - in stable/9/tools/regression/lib/libc: nss resolv X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 10:38:45 -0000 Author: ngie Date: Wed Dec 23 10:38:44 2015 New Revision: 292657 URL: https://svnweb.freebsd.org/changeset/base/292657 Log: MFstable/10 r292652: MFC r292316: Remove hosts that don't resolve properly with the nss and resolv tests Sponsored by: EMC / Isilon Storage Division Modified: stable/9/tools/regression/lib/libc/nss/mach stable/9/tools/regression/lib/libc/resolv/mach Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/ (props changed) stable/9/tools/regression/lib/libc/ (props changed) Modified: stable/9/tools/regression/lib/libc/nss/mach ============================================================================== --- stable/9/tools/regression/lib/libc/nss/mach Wed Dec 23 10:34:11 2015 (r292656) +++ stable/9/tools/regression/lib/libc/nss/mach Wed Dec 23 10:38:44 2015 (r292657) @@ -1,32 +1,17 @@ # $FreeBSD$ localhost -above.warped.net anoncvs.cirr.com -anoncvs.isc.netbsd.org -anoncvs.leo.org -anoncvs.netbsd.lt -anoncvs.netbsd.ro anoncvs.netbsd.se antioche.antioche.eu.org -boulder.tele.dk centaurus.4web.cz chur.math.ntnu.no console.netbsd.org -cvs.fi.netbsd.org -cvs.mikrolahti.fi cvs.netbsd.org -cvsup-netbsd.leo.org cvsup.netbsd.se -cvsup.pasta.cs.uit.no -ftp.bitcon.no ftp.chg.ru -ftp.duth.gr ftp.estpak.ee ftp.fsn.hu ftp.funet.fi -ftp.grondar.za -ftp.leo.org -ftp.netbsd.lt ftp.netbsd.org ftp.nluug.nl ftp.plig.org @@ -34,60 +19,28 @@ ftp.uni-erlangen.de ftp.xgate.co.kr gd.tuwien.ac.at gort.ludd.luth.se -grappa.unix-ag.uni-kl.de -info.wins.uva.nl irc.warped.net knug.youn.co.kr -lala.iri.co.jp mail.jp.netbsd.org -mail.kr.netbsd.org mail.netbsd.org melanoma.cs.rmit.edu.au mirror.aarnet.edu.au -mirror.netbsd.com.br -mirror03.inet.tele.dk moon.vub.ac.be -nbwww.sergei.cc net.bsd.cz netbsd.3miasto.net netbsd.4ka.mipt.ru -netbsd.apk.od.ua netbsd.csie.nctu.edu.tw netbsd.enderunix.org netbsd.ftp.fu-berlin.de -netbsd.netlead.com.au -netbsd.nsysu.edu.tw netbsd.pair.com -netbsd.stevens-tech.edu -netbsd.triada.bg -netbsd.unix.net.nz -netbsd.unixtech.be -netbsd.vejas.lt -netbsd.wagener-consulting.lu -netbsd.zarco.org netbsdiso.interoute.net.uk -netbsdwww.bitcon.no -netbsdwww.cordef.com.pl netbsdwww.cs.rmit.edu.au netbsdwww.interoute.net.uk -news.gw.com ns.netbsd.org -pigu.iri.co.jp -pluto.cdpa.nsysu.edu.tw -projects.slowass.net -server6.pasta.cs.uit.no skeleton.phys.spbu.ru -snoopy.allbsd.org -spike.allbsd.org -sundry.netbsd.org -tanya.sergei.cc -web-a.fi.gw.com -web-a.us.gw.com -web.netbsd.mirror.arhea.net www.en.netbsd.de www.netbsd.cl www.netbsd.nl www.netbsd.org www.netbsd.ro -zathras.netbsd.org zeppo.rediris.es Modified: stable/9/tools/regression/lib/libc/resolv/mach ============================================================================== --- stable/9/tools/regression/lib/libc/resolv/mach Wed Dec 23 10:34:11 2015 (r292656) +++ stable/9/tools/regression/lib/libc/resolv/mach Wed Dec 23 10:38:44 2015 (r292657) @@ -1,32 +1,17 @@ # $FreeBSD$ localhost -above.warped.net anoncvs.cirr.com -anoncvs.isc.netbsd.org -anoncvs.leo.org -anoncvs.netbsd.lt -anoncvs.netbsd.ro anoncvs.netbsd.se antioche.antioche.eu.org -boulder.tele.dk centaurus.4web.cz chur.math.ntnu.no console.netbsd.org -cvs.fi.netbsd.org -cvs.mikrolahti.fi cvs.netbsd.org -cvsup-netbsd.leo.org cvsup.netbsd.se -cvsup.pasta.cs.uit.no -ftp.bitcon.no ftp.chg.ru -ftp.duth.gr ftp.estpak.ee ftp.fsn.hu ftp.funet.fi -ftp.grondar.za -ftp.leo.org -ftp.netbsd.lt ftp.netbsd.org ftp.nluug.nl ftp.plig.org @@ -34,60 +19,28 @@ ftp.uni-erlangen.de ftp.xgate.co.kr gd.tuwien.ac.at gort.ludd.luth.se -grappa.unix-ag.uni-kl.de -info.wins.uva.nl irc.warped.net knug.youn.co.kr -lala.iri.co.jp mail.jp.netbsd.org -mail.kr.netbsd.org mail.netbsd.org melanoma.cs.rmit.edu.au mirror.aarnet.edu.au -mirror.netbsd.com.br -mirror03.inet.tele.dk moon.vub.ac.be -nbwww.sergei.cc net.bsd.cz netbsd.3miasto.net netbsd.4ka.mipt.ru -netbsd.apk.od.ua netbsd.csie.nctu.edu.tw netbsd.enderunix.org netbsd.ftp.fu-berlin.de -netbsd.netlead.com.au -netbsd.nsysu.edu.tw netbsd.pair.com -netbsd.stevens-tech.edu -netbsd.triada.bg -netbsd.unix.net.nz -netbsd.unixtech.be -netbsd.vejas.lt -netbsd.wagener-consulting.lu -netbsd.zarco.org netbsdiso.interoute.net.uk -netbsdwww.bitcon.no -netbsdwww.cordef.com.pl netbsdwww.cs.rmit.edu.au netbsdwww.interoute.net.uk -news.gw.com ns.netbsd.org -pigu.iri.co.jp -pluto.cdpa.nsysu.edu.tw -projects.slowass.net -server6.pasta.cs.uit.no skeleton.phys.spbu.ru -snoopy.allbsd.org -spike.allbsd.org -sundry.netbsd.org -tanya.sergei.cc -web-a.fi.gw.com -web-a.us.gw.com -web.netbsd.mirror.arhea.net www.en.netbsd.de www.netbsd.cl www.netbsd.nl www.netbsd.org www.netbsd.ro -zathras.netbsd.org zeppo.rediris.es From owner-svn-src-all@freebsd.org Wed Dec 23 11:11:28 2015 Return-Path: Delivered-To: svn-src-all@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 426BEA50938; Wed, 23 Dec 2015 11:11:28 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-oi0-x22e.google.com (mail-oi0-x22e.google.com [IPv6:2607:f8b0:4003:c06::22e]) (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 040CA1DAD; Wed, 23 Dec 2015 11:11:28 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-oi0-x22e.google.com with SMTP id y66so121901200oig.0; Wed, 23 Dec 2015 03:11:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=m6cd/CBnjKR5PMDJ2vD29plziGwODjWni6V5VwBSK1I=; b=Y1jftmw/mL6PCqhCV1oJe0x23wqr3Nj6VPdGHWUaWe5KPGttSPOzqCGwQ5I/2S+Zi2 aw3UlqQqLFoG1BCkFkBXjwW+bykSDY5Rdgs4P86+fjP+PlW8QhVgxc0e7eFFJzz+PY0t 3klkHQyIM8PDwstnEgHFqQ9RYe0Y8FMDvuMw/qUWj2YhhdKG0Xn6jg+3y3uuRO73010N u5Faq/Ge8UOyvFdsAQmi1IXfypYnPjVUQby+tKV6EMs94XT+sip4H/UFuM6uqSmrySPT YMe3/dgXJAEJTQAq1u46fVTXdwR3ETjxommbW8A7tUMU/mb5qCrca+pNwn4TQz92EnG0 ttBg== MIME-Version: 1.0 X-Received: by 10.202.173.9 with SMTP id w9mr12849640oie.79.1450869087324; Wed, 23 Dec 2015 03:11:27 -0800 (PST) Received: by 10.182.7.33 with HTTP; Wed, 23 Dec 2015 03:11:26 -0800 (PST) Received: by 10.182.7.33 with HTTP; Wed, 23 Dec 2015 03:11:26 -0800 (PST) Reply-To: araujo@FreeBSD.org In-Reply-To: <201512230319.tBN3JCnM062142@repo.freebsd.org> References: <201512230319.tBN3JCnM062142@repo.freebsd.org> Date: Wed, 23 Dec 2015 19:11:26 +0800 Message-ID: Subject: Re: svn commit: r292639 - head/sys/dev/bxe From: Marcelo Araujo To: David C Somayajulu Cc: svn-src-head@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 11:11:28 -0000 Hey, I'm wondering what that means: bxe_is_wreg_in_chip(struct bxe_softc *sc, const struct wreg_addr *wreg_info) Wreg, what wreg means?? Best, On Dec 23, 2015 11:19 AM, "David C Somayajulu" wrote: > Author: davidcs > Date: Wed Dec 23 03:19:12 2015 > New Revision: 292639 > URL: https://svnweb.freebsd.org/changeset/base/292639 > > Log: > Add support for firmware dump (a.k.a grcdump) > > MFC after:5 days > > Added: > head/sys/dev/bxe/bxe_dump.h (contents, props changed) > head/sys/dev/bxe/bxe_ioctl.h (contents, props changed) > Modified: > head/sys/dev/bxe/bxe.c > head/sys/dev/bxe/bxe.h > head/sys/dev/bxe/ecore_init.h > > Modified: head/sys/dev/bxe/bxe.c > > ============================================================================== > --- head/sys/dev/bxe/bxe.c Wed Dec 23 01:31:32 2015 (r292638) > +++ head/sys/dev/bxe/bxe.c Wed Dec 23 03:19:12 2015 (r292639) > @@ -736,6 +736,8 @@ static __noinline int bxe_nic_unload(str > static void bxe_handle_sp_tq(void *context, int pending); > static void bxe_handle_fp_tq(void *context, int pending); > > +static int bxe_add_cdev(struct bxe_softc *sc); > +static void bxe_del_cdev(struct bxe_softc *sc); > > /* calculate crc32 on a buffer (NOTE: crc32_length MUST be aligned to 8) > */ > uint32_t > @@ -4503,7 +4505,7 @@ bxe_nic_unload(struct bxe_softc *sc, > sc->rx_mode = BXE_RX_MODE_NONE; > /* XXX set rx mode ??? */ > > - if (IS_PF(sc)) { > + if (IS_PF(sc) && !sc->grcdump_done) { > /* set ALWAYS_ALIVE bit in shmem */ > sc->fw_drv_pulse_wr_seq |= DRV_PULSE_ALWAYS_ALIVE; > > @@ -4523,7 +4525,8 @@ bxe_nic_unload(struct bxe_softc *sc, > ; /* bxe_vfpf_close_vf(sc); */ > } else if (unload_mode != UNLOAD_RECOVERY) { > /* if this is a normal/close unload need to clean up chip */ > - bxe_chip_cleanup(sc, unload_mode, keep_link); > + if (!sc->grcdump_done) > + bxe_chip_cleanup(sc, unload_mode, keep_link); > } else { > /* Send the UNLOAD_REQUEST to the MCP */ > bxe_send_unload_req(sc, unload_mode); > @@ -16276,6 +16279,12 @@ bxe_add_sysctls(struct bxe_softc *sc) > CTLFLAG_RW, &sc->debug, > "debug logging mode"); > > + sc->trigger_grcdump = 0; > + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump", > + CTLFLAG_RW, &sc->trigger_grcdump, 0, > + "set by driver when a grcdump is needed"); > + > + > sc->rx_budget = bxe_rx_budget; > SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "rx_budget", > CTLFLAG_RW, &sc->rx_budget, 0, > @@ -16404,8 +16413,20 @@ bxe_attach(device_t dev) > return (ENXIO); > } > > + if (bxe_add_cdev(sc) != 0) { > + if (sc->ifp != NULL) { > + ether_ifdetach(sc->ifp); > + } > + ifmedia_removeall(&sc->ifmedia); > + bxe_release_mutexes(sc); > + bxe_deallocate_bars(sc); > + pci_disable_busmaster(dev); > + return (ENXIO); > + } > + > /* allocate device interrupts */ > if (bxe_interrupt_alloc(sc) != 0) { > + bxe_del_cdev(sc); > if (sc->ifp != NULL) { > ether_ifdetach(sc->ifp); > } > @@ -16419,6 +16440,7 @@ bxe_attach(device_t dev) > /* allocate ilt */ > if (bxe_alloc_ilt_mem(sc) != 0) { > bxe_interrupt_free(sc); > + bxe_del_cdev(sc); > if (sc->ifp != NULL) { > ether_ifdetach(sc->ifp); > } > @@ -16433,6 +16455,7 @@ bxe_attach(device_t dev) > if (bxe_alloc_hsi_mem(sc) != 0) { > bxe_free_ilt_mem(sc); > bxe_interrupt_free(sc); > + bxe_del_cdev(sc); > if (sc->ifp != NULL) { > ether_ifdetach(sc->ifp); > } > @@ -16504,6 +16527,8 @@ bxe_detach(device_t dev) > return(EBUSY); > } > > + bxe_del_cdev(sc); > + > /* stop the periodic callout */ > bxe_periodic_stop(sc); > > @@ -18824,3 +18849,457 @@ ecore_storm_memset_struct(struct bxe_sof > } > } > > + > +/* > + * character device - ioctl interface definitions > + */ > + > + > +#include "bxe_dump.h" > +#include "bxe_ioctl.h" > +#include > + > +static int bxe_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int > fflag, > + struct thread *td); > + > +static struct cdevsw bxe_cdevsw = { > + .d_version = D_VERSION, > + .d_ioctl = bxe_eioctl, > + .d_name = "bxecnic", > +}; > + > +#define BXE_PATH(sc) (CHIP_IS_E1x(sc) ? 0 : (sc->pcie_func & 1)) > + > + > +#define DUMP_ALL_PRESETS 0x1FFF > +#define DUMP_MAX_PRESETS 13 > +#define IS_E1_REG(chips) ((chips & DUMP_CHIP_E1) == DUMP_CHIP_E1) > +#define IS_E1H_REG(chips) ((chips & DUMP_CHIP_E1H) == DUMP_CHIP_E1H) > +#define IS_E2_REG(chips) ((chips & DUMP_CHIP_E2) == DUMP_CHIP_E2) > +#define IS_E3A0_REG(chips) ((chips & DUMP_CHIP_E3A0) == > DUMP_CHIP_E3A0) > +#define IS_E3B0_REG(chips) ((chips & DUMP_CHIP_E3B0) == > DUMP_CHIP_E3B0) > + > +#define IS_REG_IN_PRESET(presets, idx) \ > + ((presets & (1 << (idx-1))) == (1 << (idx-1))) > + > + > +static int > +bxe_get_preset_regs_len(struct bxe_softc *sc, uint32_t preset) > +{ > + if (CHIP_IS_E1(sc)) > + return dump_num_registers[0][preset-1]; > + else if (CHIP_IS_E1H(sc)) > + return dump_num_registers[1][preset-1]; > + else if (CHIP_IS_E2(sc)) > + return dump_num_registers[2][preset-1]; > + else if (CHIP_IS_E3A0(sc)) > + return dump_num_registers[3][preset-1]; > + else if (CHIP_IS_E3B0(sc)) > + return dump_num_registers[4][preset-1]; > + else > + return 0; > +} > + > +static int > +bxe_get_max_regs_len(struct bxe_softc *sc) > +{ > + uint32_t preset_idx; > + int regdump_len32, len32; > + > + regdump_len32 = bxe_get_preset_regs_len(sc, 1); > + > + /* Calculate the total preset regs length */ > + for (preset_idx = 2; preset_idx <= DUMP_MAX_PRESETS; preset_idx++) { > + > + len32 = bxe_get_preset_regs_len(sc, preset_idx); > + > + if (regdump_len32 < len32) > + regdump_len32 = len32; > + } > + > + return regdump_len32; > +} > + > +static int > +bxe_get_total_regs_len32(struct bxe_softc *sc) > +{ > + uint32_t preset_idx; > + int regdump_len32 = 0; > + > + > + /* Calculate the total preset regs length */ > + for (preset_idx = 1; preset_idx <= DUMP_MAX_PRESETS; preset_idx++) { > + regdump_len32 += bxe_get_preset_regs_len(sc, preset_idx); > + } > + > + return regdump_len32; > +} > + > +static const uint32_t * > +__bxe_get_page_addr_ar(struct bxe_softc *sc) > +{ > + if (CHIP_IS_E2(sc)) > + return page_vals_e2; > + else if (CHIP_IS_E3(sc)) > + return page_vals_e3; > + else > + return NULL; > +} > + > +static uint32_t > +__bxe_get_page_reg_num(struct bxe_softc *sc) > +{ > + if (CHIP_IS_E2(sc)) > + return PAGE_MODE_VALUES_E2; > + else if (CHIP_IS_E3(sc)) > + return PAGE_MODE_VALUES_E3; > + else > + return 0; > +} > + > +static const uint32_t * > +__bxe_get_page_write_ar(struct bxe_softc *sc) > +{ > + if (CHIP_IS_E2(sc)) > + return page_write_regs_e2; > + else if (CHIP_IS_E3(sc)) > + return page_write_regs_e3; > + else > + return NULL; > +} > + > +static uint32_t > +__bxe_get_page_write_num(struct bxe_softc *sc) > +{ > + if (CHIP_IS_E2(sc)) > + return PAGE_WRITE_REGS_E2; > + else if (CHIP_IS_E3(sc)) > + return PAGE_WRITE_REGS_E3; > + else > + return 0; > +} > + > +static const struct reg_addr * > +__bxe_get_page_read_ar(struct bxe_softc *sc) > +{ > + if (CHIP_IS_E2(sc)) > + return page_read_regs_e2; > + else if (CHIP_IS_E3(sc)) > + return page_read_regs_e3; > + else > + return NULL; > +} > + > +static uint32_t > +__bxe_get_page_read_num(struct bxe_softc *sc) > +{ > + if (CHIP_IS_E2(sc)) > + return PAGE_READ_REGS_E2; > + else if (CHIP_IS_E3(sc)) > + return PAGE_READ_REGS_E3; > + else > + return 0; > +} > + > +static bool > +bxe_is_reg_in_chip(struct bxe_softc *sc, const struct reg_addr *reg_info) > +{ > + if (CHIP_IS_E1(sc)) > + return IS_E1_REG(reg_info->chips); > + else if (CHIP_IS_E1H(sc)) > + return IS_E1H_REG(reg_info->chips); > + else if (CHIP_IS_E2(sc)) > + return IS_E2_REG(reg_info->chips); > + else if (CHIP_IS_E3A0(sc)) > + return IS_E3A0_REG(reg_info->chips); > + else if (CHIP_IS_E3B0(sc)) > + return IS_E3B0_REG(reg_info->chips); > + else > + return 0; > +} > + > +static bool > +bxe_is_wreg_in_chip(struct bxe_softc *sc, const struct wreg_addr > *wreg_info) > +{ > + if (CHIP_IS_E1(sc)) > + return IS_E1_REG(wreg_info->chips); > + else if (CHIP_IS_E1H(sc)) > + return IS_E1H_REG(wreg_info->chips); > + else if (CHIP_IS_E2(sc)) > + return IS_E2_REG(wreg_info->chips); > + else if (CHIP_IS_E3A0(sc)) > + return IS_E3A0_REG(wreg_info->chips); > + else if (CHIP_IS_E3B0(sc)) > + return IS_E3B0_REG(wreg_info->chips); > + else > + return 0; > +} > + > +/** > + * bxe_read_pages_regs - read "paged" registers > + * > + * @bp device handle > + * @p output buffer > + * > + * Reads "paged" memories: memories that may only be read by first > writing to a > + * specific address ("write address") and then reading from a specific > address > + * ("read address"). There may be more than one write address per "page" > and > + * more than one read address per write address. > + */ > +static void > +bxe_read_pages_regs(struct bxe_softc *sc, uint32_t *p, uint32_t preset) > +{ > + uint32_t i, j, k, n; > + > + /* addresses of the paged registers */ > + const uint32_t *page_addr = __bxe_get_page_addr_ar(sc); > + /* number of paged registers */ > + int num_pages = __bxe_get_page_reg_num(sc); > + /* write addresses */ > + const uint32_t *write_addr = __bxe_get_page_write_ar(sc); > + /* number of write addresses */ > + int write_num = __bxe_get_page_write_num(sc); > + /* read addresses info */ > + const struct reg_addr *read_addr = __bxe_get_page_read_ar(sc); > + /* number of read addresses */ > + int read_num = __bxe_get_page_read_num(sc); > + uint32_t addr, size; > + > + for (i = 0; i < num_pages; i++) { > + for (j = 0; j < write_num; j++) { > + REG_WR(sc, write_addr[j], page_addr[i]); > + > + for (k = 0; k < read_num; k++) { > + if (IS_REG_IN_PRESET(read_addr[k].presets, preset)) { > + size = read_addr[k].size; > + for (n = 0; n < size; n++) { > + addr = read_addr[k].addr + n*4; > + *p++ = REG_RD(sc, addr); > + } > + } > + } > + } > + } > + return; > +} > + > + > +static int > +bxe_get_preset_regs(struct bxe_softc *sc, uint32_t *p, uint32_t preset) > +{ > + uint32_t i, j, addr; > + const struct wreg_addr *wreg_addr_p = NULL; > + > + if (CHIP_IS_E1(sc)) > + wreg_addr_p = &wreg_addr_e1; > + else if (CHIP_IS_E1H(sc)) > + wreg_addr_p = &wreg_addr_e1h; > + else if (CHIP_IS_E2(sc)) > + wreg_addr_p = &wreg_addr_e2; > + else if (CHIP_IS_E3A0(sc)) > + wreg_addr_p = &wreg_addr_e3; > + else if (CHIP_IS_E3B0(sc)) > + wreg_addr_p = &wreg_addr_e3b0; > + else > + return (-1); > + > + /* Read the idle_chk registers */ > + for (i = 0; i < IDLE_REGS_COUNT; i++) { > + if (bxe_is_reg_in_chip(sc, &idle_reg_addrs[i]) && > + IS_REG_IN_PRESET(idle_reg_addrs[i].presets, preset)) { > + for (j = 0; j < idle_reg_addrs[i].size; j++) > + *p++ = REG_RD(sc, idle_reg_addrs[i].addr + j*4); > + } > + } > + > + /* Read the regular registers */ > + for (i = 0; i < REGS_COUNT; i++) { > + if (bxe_is_reg_in_chip(sc, ®_addrs[i]) && > + IS_REG_IN_PRESET(reg_addrs[i].presets, preset)) { > + for (j = 0; j < reg_addrs[i].size; j++) > + *p++ = REG_RD(sc, reg_addrs[i].addr + j*4); > + } > + } > + > + /* Read the CAM registers */ > + if (bxe_is_wreg_in_chip(sc, wreg_addr_p) && > + IS_REG_IN_PRESET(wreg_addr_p->presets, preset)) { > + for (i = 0; i < wreg_addr_p->size; i++) { > + *p++ = REG_RD(sc, wreg_addr_p->addr + i*4); > + > + /* In case of wreg_addr register, read additional > + registers from read_regs array > + */ > + for (j = 0; j < wreg_addr_p->read_regs_count; j++) { > + addr = *(wreg_addr_p->read_regs); > + *p++ = REG_RD(sc, addr + j*4); > + } > + } > + } > + > + /* Paged registers are supported in E2 & E3 only */ > + if (CHIP_IS_E2(sc) || CHIP_IS_E3(sc)) { > + /* Read "paged" registers */ > + bxe_read_pages_regs(sc, p, preset); > + } > + > + return 0; > +} > + > +static int > +bxe_grc_dump(struct bxe_softc *sc, bxe_grcdump_t *dump) > +{ > + int rval = 0; > + uint32_t preset_idx; > + uint8_t *buf; > + uint32_t size; > + struct dump_header *d_hdr; > + > + ecore_disable_blocks_parity(sc); > + > + buf = dump->grcdump; > + d_hdr = dump->grcdump; > + > + d_hdr->header_size = (sizeof(struct dump_header) >> 2) - 1; > + d_hdr->version = BNX2X_DUMP_VERSION; > + d_hdr->preset = DUMP_ALL_PRESETS; > + > + if (CHIP_IS_E1(sc)) { > + d_hdr->dump_meta_data = DUMP_CHIP_E1; > + } else if (CHIP_IS_E1H(sc)) { > + d_hdr->dump_meta_data = DUMP_CHIP_E1H; > + } else if (CHIP_IS_E2(sc)) { > + d_hdr->dump_meta_data = DUMP_CHIP_E2 | > + (BXE_PATH(sc) ? DUMP_PATH_1 : DUMP_PATH_0); > + } else if (CHIP_IS_E3A0(sc)) { > + d_hdr->dump_meta_data = DUMP_CHIP_E3A0 | > + (BXE_PATH(sc) ? DUMP_PATH_1 : DUMP_PATH_0); > + } else if (CHIP_IS_E3B0(sc)) { > + d_hdr->dump_meta_data = DUMP_CHIP_E3B0 | > + (BXE_PATH(sc) ? DUMP_PATH_1 : DUMP_PATH_0); > + } > + > + dump->grcdump_dwords = sizeof(struct dump_header) >> 2; > + buf += sizeof(struct dump_header); > + > + for (preset_idx = 1; preset_idx <= DUMP_MAX_PRESETS; preset_idx++) { > + > + /* Skip presets with IOR */ > + if ((preset_idx == 2) || (preset_idx == 5) || (preset_idx == 8) || > + (preset_idx == 11)) > + continue; > + > + rval = bxe_get_preset_regs(sc, sc->grc_dump, preset_idx); > + > + if (rval) > + break; > + > + size = bxe_get_preset_regs_len(sc, preset_idx) * (sizeof > (uint32_t)); > + > + rval = copyout(sc->grc_dump, buf, size); > + > + if (rval) > + break; > + > + dump->grcdump_dwords += (size / (sizeof (uint32_t))); > + > + buf += size; > + } > + > + ecore_clear_blocks_parity(sc); > + ecore_enable_blocks_parity(sc); > + > + sc->grcdump_done = 1; > + return(rval); > +} > + > +static int > +bxe_add_cdev(struct bxe_softc *sc) > +{ > + int max_preset_size; > + > + max_preset_size = bxe_get_max_regs_len(sc) * (sizeof (uint32_t)); > + > + sc->grc_dump = malloc(max_preset_size, M_DEVBUF, M_NOWAIT); > + > + if (sc->grc_dump == NULL) > + return (-1); > + > + sc->ioctl_dev = make_dev(&bxe_cdevsw, > + sc->ifp->if_dunit, > + UID_ROOT, > + GID_WHEEL, > + 0600, > + "%s", > + if_name(sc->ifp)); > + > + if (sc->ioctl_dev == NULL) { > + > + free(sc->grc_dump, M_DEVBUF); > + > + return (-1); > + } > + > + sc->ioctl_dev->si_drv1 = sc; > + > + return (0); > +} > + > +static void > +bxe_del_cdev(struct bxe_softc *sc) > +{ > + if (sc->ioctl_dev != NULL) > + destroy_dev(sc->ioctl_dev); > + > + if (sc->grc_dump == NULL) > + free(sc->grc_dump, M_DEVBUF); > + > + return; > +} > + > +static int > +bxe_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, > + struct thread *td) > +{ > + struct bxe_softc *sc; > + int rval = 0; > + device_t pci_dev; > + bxe_grcdump_t *dump = NULL; > + int grc_dump_size; > + > + if ((sc = (struct bxe_softc *)dev->si_drv1) == NULL) > + return ENXIO; > + > + pci_dev= sc->dev; > + > + dump = (bxe_grcdump_t *)data; > + > + switch(cmd) { > + > + case BXE_GRC_DUMP_SIZE: > + dump->pci_func = sc->pcie_func; > + dump->grcdump_size = (bxe_get_total_regs_len32(sc) * > sizeof(uint32_t)) + > + sizeof(struct dump_header); > + break; > + > + case BXE_GRC_DUMP: > + > + grc_dump_size = (bxe_get_total_regs_len32(sc) * > sizeof(uint32_t)) + > + sizeof(struct dump_header); > + > + if ((sc->grc_dump == NULL) || (dump->grcdump == NULL) || > + (dump->grcdump_size < grc_dump_size)) { > + rval = EINVAL; > + break; > + } > + > + rval = bxe_grc_dump(sc, dump); > + > + break; > + > + default: > + break; > + } > + > + return (rval); > +} > > Modified: head/sys/dev/bxe/bxe.h > > ============================================================================== > --- head/sys/dev/bxe/bxe.h Wed Dec 23 01:31:32 2015 (r292638) > +++ head/sys/dev/bxe/bxe.h Wed Dec 23 03:19:12 2015 (r292639) > @@ -1830,6 +1830,11 @@ struct bxe_softc { > uint8_t prio_to_cos[BXE_MAX_PRIORITY]; > > int panic; > + > + struct cdev *ioctl_dev; > + void *grc_dump; > + int trigger_grcdump; > + int grcdump_done; > }; /* struct bxe_softc */ > > /* IOCTL sub-commands for edebug and firmware upgrade */ > @@ -2296,6 +2301,7 @@ void ecore_storm_memset_struct(struct bx > "ERROR: " format, \ > ## args); \ > } \ > + sc->trigger_grcdump |= 0x1; \ > } while(0) > > #ifdef ECORE_STOP_ON_ERROR > > Added: head/sys/dev/bxe/bxe_dump.h > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/bxe/bxe_dump.h Wed Dec 23 03:19:12 2015 (r292639) > @@ -0,0 +1,2231 @@ > +/* > + * Copyright (c) 2007-2015 QLogic Corporation. All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > "AS IS" > + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, > THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS > + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR > BUSINESS > + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN > + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) > + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF > + * THE POSSIBILITY OF SUCH DAMAGE. > + */ > + > + > +#ifndef __BXE_DUMP_H__ > +#define __BXE_DUMP_H__ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +/* WaitP Definitions */ > +#define DRV_DUMP_XSTORM_WAITP_ADDRESS 0x2b8a80 > +#define DRV_DUMP_TSTORM_WAITP_ADDRESS 0x1b8a80 > +#define DRV_DUMP_USTORM_WAITP_ADDRESS 0x338a80 > +#define DRV_DUMP_CSTORM_WAITP_ADDRESS 0x238a80 > + > +/* Possible Chips */ > +#define DUMP_CHIP_E1 1 > +#define DUMP_CHIP_E1H 2 > +#define DUMP_CHIP_E2 4 > +#define DUMP_CHIP_E3A0 8 > +#define DUMP_CHIP_E3B0 16 > +#define DUMP_PATH_0 512 > +#define DUMP_PATH_1 1024 > +#define NUM_PRESETS 13 > +#define NUM_CHIPS 5 > + > +struct dump_header { > + uint32_t header_size; /* Size in DWORDs excluding this field */ > + uint32_t version; > + uint32_t preset; > + uint32_t dump_meta_data; /* OR of CHIP and PATH. */ > +}; > + > +#define BNX2X_DUMP_VERSION 0x61111111 > +struct reg_addr { > + uint32_t addr; > + uint32_t size; > + uint32_t chips; > + uint32_t presets; > +}; > + > +struct wreg_addr { > + uint32_t addr; > + uint32_t size; > + uint32_t read_regs_count; > + const uint32_t *read_regs; > + uint32_t chips; > + uint32_t presets; > +}; > + > +#define PAGE_MODE_VALUES_E2 2 > +#define PAGE_READ_REGS_E2 1 > +#define PAGE_WRITE_REGS_E2 1 > +static const uint32_t page_vals_e2[] = {0, 128}; > +static const uint32_t page_write_regs_e2[] = {328476}; > +static const struct reg_addr page_read_regs_e2[] = { > + {0x58000, 4608, DUMP_CHIP_E2, 0x30} > +}; > + > +#define PAGE_MODE_VALUES_E3 2 > +#define PAGE_READ_REGS_E3 1 > +#define PAGE_WRITE_REGS_E3 1 > +static const uint32_t page_vals_e3[] = {0, 128}; > +static const uint32_t page_write_regs_e3[] = {328476}; > +static const struct reg_addr page_read_regs_e3[] = { > + {0x58000, 4608, DUMP_CHIP_E3A0 | DUMP_CHIP_E3B0, 0x30} > +}; > + > +static const struct reg_addr reg_addrs[] = { > + { 0x2000, 1, 0x1f, 0xfff}, > + { 0x2004, 1, 0x1f, 0x1fff}, > + { 0x2008, 25, 0x1f, 0xfff}, > + { 0x206c, 1, 0x1f, 0x1fff}, > + { 0x2070, 313, 0x1f, 0xfff}, > + { 0x2800, 103, 0x1f, 0xfff}, > + { 0x3000, 287, 0x1f, 0xfff}, > + { 0x3800, 331, 0x1f, 0xfff}, > + { 0x8800, 6, 0x1f, 0x924}, > + { 0x8818, 1, 0x1e, 0x924}, > + { 0x9000, 4, 0x1c, 0x924}, > + { 0x9010, 7, 0x1c, 0xfff}, > + { 0x902c, 1, 0x1c, 0x924}, > + { 0x9030, 1, 0x1c, 0xfff}, > + { 0x9034, 13, 0x1c, 0x924}, > + { 0x9068, 16, 0x1c, 0xfff}, > + { 0x90a8, 98, 0x1c, 0x924}, > + { 0x9230, 2, 0x1c, 0xfff}, > + { 0x9238, 3, 0x1c, 0x924}, > + { 0x9244, 1, 0x1c, 0xfff}, > + { 0x9248, 1, 0x1c, 0x924}, > + { 0x924c, 1, 0x4, 0x924}, > + { 0x9250, 16, 0x1c, 0x924}, > + { 0x92a8, 2, 0x1c, 0x1fff}, > + { 0x92b4, 1, 0x1c, 0x1fff}, > + { 0x9400, 33, 0x1c, 0x924}, > + { 0x9484, 5, 0x18, 0x924}, > + { 0xa000, 27, 0x1f, 0x924}, > + { 0xa06c, 1, 0x3, 0x924}, > + { 0xa070, 2, 0x1f, 0x924}, > + { 0xa078, 1, 0x1f, 0x1fff}, > + { 0xa07c, 31, 0x1f, 0x924}, > + { 0xa0f8, 1, 0x1f, 0x1fff}, > + { 0xa0fc, 3, 0x1f, 0x924}, > + { 0xa108, 1, 0x1f, 0x1fff}, > + { 0xa10c, 3, 0x1f, 0x924}, > + { 0xa118, 1, 0x1f, 0x1fff}, > + { 0xa11c, 28, 0x1f, 0x924}, > + { 0xa18c, 4, 0x3, 0x924}, > + { 0xa19c, 3, 0x1f, 0x924}, > + { 0xa1a8, 1, 0x1f, 0x1fff}, > + { 0xa1ac, 3, 0x1f, 0x924}, > + { 0xa1b8, 1, 0x1f, 0x1fff}, > + { 0xa1bc, 54, 0x1f, 0x924}, > + { 0xa294, 2, 0x3, 0x924}, > + { 0xa29c, 2, 0x1f, 0x924}, > + { 0xa2a4, 2, 0x7, 0x924}, > + { 0xa2ac, 2, 0x1f, 0x924}, > + { 0xa2b4, 1, 0x1f, 0x1fff}, > + { 0xa2b8, 49, 0x1f, 0x924}, > + { 0xa38c, 2, 0x1f, 0x1fff}, > + { 0xa398, 1, 0x1f, 0x1fff}, > + { 0xa39c, 7, 0x1e, 0x924}, > + { 0xa3b8, 2, 0x18, 0x924}, > + { 0xa3c0, 1, 0x1e, 0x924}, > + { 0xa3c4, 1, 0x1e, 0xfff}, > + { 0xa3c8, 1, 0x1e, 0x924}, > + { 0xa3d0, 1, 0x1e, 0x924}, > + { 0xa3d8, 1, 0x1e, 0x924}, > + { 0xa3e0, 1, 0x1e, 0x924}, > + { 0xa3e8, 1, 0x1e, 0x924}, > + { 0xa3f0, 1, 0x1e, 0x924}, > + { 0xa3f8, 1, 0x1e, 0x924}, > + { 0xa400, 1, 0x1f, 0x924}, > + { 0xa404, 1, 0x1f, 0xfff}, > + { 0xa408, 2, 0x1f, 0x1fff}, > + { 0xa410, 7, 0x1f, 0x924}, > + { 0xa42c, 12, 0x1f, 0xfff}, > + { 0xa45c, 1, 0x1f, 0x924}, > + { 0xa460, 1, 0x1f, 0x1924}, > + { 0xa464, 15, 0x1f, 0x924}, > + { 0xa4a0, 1, 0x7, 0x924}, > + { 0xa4a4, 2, 0x1f, 0x924}, > + { 0xa4ac, 2, 0x3, 0x924}, > + { 0xa4b4, 1, 0x7, 0x924}, > + { 0xa4b8, 2, 0x3, 0x924}, > + { 0xa4c0, 3, 0x1f, 0x924}, > + { 0xa4cc, 5, 0x3, 0x924}, > + { 0xa4e0, 3, 0x1f, 0x924}, > + { 0xa4fc, 2, 0x1f, 0x924}, > + { 0xa504, 1, 0x3, 0x924}, > + { 0xa508, 3, 0x1f, 0x924}, > + { 0xa518, 1, 0x1f, 0x924}, > + { 0xa520, 1, 0x1f, 0x924}, > + { 0xa528, 1, 0x1f, 0x924}, > + { 0xa530, 1, 0x1f, 0x924}, > + { 0xa538, 1, 0x1f, 0x924}, > + { 0xa540, 1, 0x1f, 0x924}, > + { 0xa548, 1, 0x3, 0x924}, > + { 0xa550, 1, 0x3, 0x924}, > + { 0xa558, 1, 0x3, 0x924}, > + { 0xa560, 1, 0x3, 0x924}, > + { 0xa568, 1, 0x3, 0x924}, > + { 0xa570, 1, 0x1f, 0x924}, > + { 0xa580, 1, 0x1f, 0x1fff}, > + { 0xa590, 1, 0x1f, 0x1fff}, > + { 0xa5a0, 1, 0x7, 0x924}, > + { 0xa5c0, 1, 0x1f, 0x924}, > + { 0xa5e0, 1, 0x1e, 0x924}, > + { 0xa5e8, 1, 0x1e, 0x924}, > + { 0xa5f0, 1, 0x1e, 0x924}, > + { 0xa5f8, 1, 0x6, 0x924}, > + { 0xa5fc, 1, 0x1e, 0x924}, > + { 0xa600, 5, 0x1e, 0xfff}, > + { 0xa614, 1, 0x1e, 0x924}, > + { 0xa618, 1, 0x1e, 0xfff}, > + { 0xa61c, 1, 0x1e, 0x924}, > + { 0xa620, 6, 0x1c, 0x924}, > + { 0xa638, 20, 0x4, 0x924}, > + { 0xa688, 35, 0x1c, 0x924}, > + { 0xa714, 1, 0x1c, 0xfff}, > + { 0xa718, 2, 0x1c, 0x924}, > + { 0xa720, 1, 0x1c, 0xfff}, > + { 0xa724, 3, 0x1c, 0x924}, > + { 0xa730, 1, 0x4, 0x924}, > + { 0xa734, 2, 0x1c, 0x924}, > + { 0xa73c, 4, 0x4, 0x924}, > + { 0xa74c, 1, 0x1c, 0x924}, > + { 0xa750, 1, 0x1c, 0xfff}, > + { 0xa754, 3, 0x1c, 0x924}, > + { 0xa760, 5, 0x4, 0x924}, > + { 0xa774, 7, 0x1c, 0x924}, > + { 0xa790, 15, 0x4, 0x924}, > + { 0xa7cc, 4, 0x1c, 0x924}, > + { 0xa7e0, 6, 0x18, 0x924}, > + { 0xa800, 18, 0x4, 0x924}, > + { 0xa848, 33, 0x1c, 0x924}, > + { 0xa8cc, 2, 0x18, 0x924}, > + { 0xa8d4, 4, 0x1c, 0x924}, > + { 0xa8e4, 1, 0x18, 0x924}, > + { 0xa8e8, 1, 0x1c, 0x924}, > + { 0xa8f0, 1, 0x1c, 0x924}, > + { 0xa8f8, 30, 0x18, 0x924}, > + { 0xa974, 73, 0x18, 0x924}, > + { 0xac30, 1, 0x18, 0x924}, > + { 0xac40, 1, 0x18, 0x924}, > + { 0xac50, 1, 0x18, 0x924}, > + { 0xac60, 1, 0x10, 0x924}, > + { 0x10000, 9, 0x1f, 0x924}, > + { 0x10024, 1, 0x7, 0x924}, > + { 0x10028, 5, 0x1f, 0x924}, > + { 0x1003c, 6, 0x7, 0x924}, > + { 0x10054, 20, 0x1f, 0x924}, > + { 0x100a4, 4, 0x7, 0x924}, > + { 0x100b4, 11, 0x1f, 0x924}, > + { 0x100e0, 4, 0x7, 0x924}, > + { 0x100f0, 8, 0x1f, 0x924}, > + { 0x10110, 6, 0x7, 0x924}, > + { 0x10128, 110, 0x1f, 0x924}, > + { 0x102e0, 4, 0x7, 0x924}, > + { 0x102f0, 18, 0x1f, 0x924}, > + { 0x10338, 20, 0x7, 0x924}, > + { 0x10388, 10, 0x1f, 0x924}, > + { 0x103d0, 2, 0x3, 0x1fff}, > + { 0x103dc, 1, 0x3, 0x1fff}, > + { 0x10400, 6, 0x7, 0x924}, > + { 0x10418, 1, 0x1f, 0xfff}, > + { 0x1041c, 1, 0x1f, 0x924}, > + { 0x10420, 1, 0x1f, 0xfff}, > + { 0x10424, 1, 0x1f, 0x924}, > + { 0x10428, 1, 0x1f, 0xfff}, > + { 0x1042c, 1, 0x1f, 0x924}, > + { 0x10430, 10, 0x7, 0x924}, > + { 0x10458, 2, 0x1f, 0x924}, > + { 0x10460, 1, 0x1f, 0xfff}, > + { 0x10464, 4, 0x1f, 0x924}, > + { 0x10474, 1, 0x1f, 0xfff}, > + { 0x10478, 14, 0x1f, 0x924}, > + { 0x104b0, 12, 0x7, 0x924}, > + { 0x104e0, 1, 0x1f, 0xfff}, > + { 0x104e8, 1, 0x1f, 0x924}, > + { 0x104ec, 1, 0x1f, 0xfff}, > + { 0x104f4, 1, 0x1f, 0x924}, > + { 0x104f8, 1, 0x1f, 0xfff}, > + { 0x10500, 2, 0x1f, 0x924}, > + { 0x10508, 1, 0x1f, 0xfff}, > + { 0x1050c, 9, 0x1f, 0x924}, > + { 0x10530, 1, 0x1f, 0xfff}, > + { 0x10534, 1, 0x1f, 0x924}, > + { 0x10538, 1, 0x1f, 0xfff}, > + { 0x1053c, 3, 0x1f, 0x924}, > + { 0x10548, 1, 0x1f, 0xfff}, > + { 0x1054c, 3, 0x1f, 0x924}, > + { 0x10558, 1, 0x1f, 0xfff}, > + { 0x1055c, 123, 0x1f, 0x924}, > + { 0x10750, 2, 0x7, 0x924}, > + { 0x10760, 2, 0x7, 0x924}, > + { 0x10770, 2, 0x7, 0x924}, > + { 0x10780, 2, 0x7, 0x924}, > + { 0x10790, 2, 0x1f, 0x924}, > + { 0x107a0, 2, 0x7, 0x924}, > + { 0x107b0, 2, 0x7, 0x924}, > + { 0x107c0, 2, 0x7, 0x924}, > + { 0x107d0, 2, 0x7, 0x924}, > + { 0x107e0, 2, 0x1f, 0x924}, > + { 0x10880, 2, 0x1f, 0x924}, > + { 0x10900, 2, 0x1f, 0x924}, > + { 0x16000, 1, 0x6, 0x924}, > + { 0x16004, 25, 0x1e, 0x924}, > + { 0x16070, 8, 0x1e, 0x924}, > + { 0x16090, 4, 0xe, 0x924}, > + { 0x160a0, 6, 0x1e, 0x924}, > + { 0x160c0, 7, 0x1e, 0x924}, > + { 0x160dc, 2, 0x6, 0x924}, > + { 0x160e4, 6, 0x1e, 0x924}, > + { 0x160fc, 4, 0x1e, 0x1fff}, > + { 0x1610c, 2, 0x6, 0x924}, > + { 0x16114, 6, 0x1e, 0x924}, > + { 0x16140, 48, 0x1e, 0x1fff}, > + { 0x16204, 5, 0x1e, 0x924}, > + { 0x18000, 1, 0x1e, 0x924}, > + { 0x18008, 1, 0x1e, 0x924}, > + { 0x18010, 35, 0x1c, 0x924}, > + { 0x180a4, 2, 0x1c, 0x924}, > + { 0x180c0, 9, 0x1c, 0x924}, > + { 0x180e4, 1, 0xc, 0x924}, > + { 0x180e8, 2, 0x1c, 0x924}, > + { 0x180f0, 1, 0xc, 0x924}, > + { 0x180f4, 79, 0x1c, 0x924}, > + { 0x18230, 1, 0xc, 0x924}, > + { 0x18234, 2, 0x1c, 0x924}, > + { 0x1823c, 1, 0xc, 0x924}, > + { 0x18240, 13, 0x1c, 0x924}, > + { 0x18274, 1, 0x4, 0x924}, > + { 0x18278, 12, 0x1c, 0x924}, > + { 0x182a8, 1, 0x1c, 0xfff}, > + { 0x182ac, 3, 0x1c, 0x924}, > + { 0x182b8, 1, 0x1c, 0xfff}, > + { 0x182bc, 19, 0x1c, 0x924}, > + { 0x18308, 1, 0x1c, 0xfff}, > + { 0x1830c, 3, 0x1c, 0x924}, > + { 0x18318, 1, 0x1c, 0xfff}, > + { 0x1831c, 7, 0x1c, 0x924}, > + { 0x18338, 1, 0x1c, 0xfff}, > + { 0x1833c, 3, 0x1c, 0x924}, > + { 0x18348, 1, 0x1c, 0xfff}, > + { 0x1834c, 28, 0x1c, 0x924}, > + { 0x183bc, 2, 0x1c, 0x1fff}, > + { 0x183c8, 3, 0x1c, 0x1fff}, > + { 0x183d8, 1, 0x1c, 0x1fff}, > + { 0x18440, 48, 0x1c, 0x1fff}, > + { 0x18500, 15, 0x1c, 0x924}, > + { 0x18570, 1, 0x18, 0xfff}, > + { 0x18574, 1, 0x18, 0x924}, > + { 0x18578, 1, 0x18, 0xfff}, > + { 0x1857c, 4, 0x18, 0x924}, > + { 0x1858c, 1, 0x18, 0xfff}, > + { 0x18590, 1, 0x18, 0x924}, > + { 0x18594, 1, 0x18, 0xfff}, > + { 0x18598, 32, 0x18, 0x924}, > + { 0x18618, 5, 0x10, 0x924}, > + { 0x1862c, 4, 0x10, 0xfff}, > + { 0x1863c, 16, 0x10, 0x924}, > + { 0x18680, 44, 0x10, 0x924}, > + { 0x18748, 12, 0x10, 0x924}, > + { 0x18788, 1, 0x10, 0x924}, > + { 0x1879c, 6, 0x10, 0x924}, > + { 0x187c4, 51, 0x10, 0x924}, > + { 0x18a00, 48, 0x10, 0x924}, > + { 0x20000, 24, 0x1f, 0x924}, > + { 0x20060, 8, 0x1f, 0x9e4}, > + { 0x20080, 94, 0x1f, 0x924}, > + { 0x201f8, 1, 0x3, 0x924}, > + { 0x201fc, 1, 0x1f, 0x924}, > + { 0x20200, 1, 0x3, 0x924}, > + { 0x20204, 1, 0x1f, 0x924}, > + { 0x20208, 1, 0x3, 0x924}, > + { 0x2020c, 4, 0x1f, 0x924}, > + { 0x2021c, 11, 0x1f, 0xfff}, > + { 0x20248, 24, 0x1f, 0x924}, > + { 0x202b8, 2, 0x1f, 0x1fff}, > + { 0x202c4, 1, 0x1f, 0x1fff}, > + { 0x202c8, 1, 0x1c, 0x924}, > + { 0x202d8, 4, 0x1c, 0x924}, > + { 0x202f0, 1, 0x10, 0x924}, > + { 0x20400, 1, 0x1f, 0x924}, > + { 0x20404, 1, 0x1f, 0xfff}, > + { 0x2040c, 2, 0x1f, 0xfff}, > + { 0x20414, 2, 0x1f, 0x924}, > + { 0x2041c, 2, 0x1f, 0xfff}, > + { 0x20424, 2, 0x1f, 0x924}, > + { 0x2042c, 18, 0x1e, 0x924}, > + { 0x20480, 1, 0x1f, 0x924}, > + { 0x20500, 1, 0x1f, 0x924}, > + { 0x20600, 1, 0x1f, 0x924}, > + { 0x28000, 1, 0x1f, 0x9e4}, > + { 0x28004, 255, 0x1f, 0x180}, > + { 0x28400, 1, 0x1f, 0x1c0}, > + { 0x28404, 255, 0x1f, 0x180}, > + { 0x28800, 1, 0x1f, 0x1c0}, > + { 0x28804, 255, 0x1f, 0x180}, > + { 0x28c00, 1, 0x1f, 0x1c0}, > + { 0x28c04, 255, 0x1f, 0x180}, > + { 0x29000, 1, 0x1f, 0x1c0}, > + { 0x29004, 255, 0x1f, 0x180}, > + { 0x29400, 1, 0x1f, 0x1c0}, > + { 0x29404, 255, 0x1f, 0x180}, > + { 0x29800, 1, 0x1f, 0x1c0}, > + { 0x29804, 255, 0x1f, 0x180}, > + { 0x29c00, 1, 0x1f, 0x1c0}, > + { 0x29c04, 255, 0x1f, 0x180}, > + { 0x2a000, 1, 0x1f, 0x1c0}, > + { 0x2a004, 255, 0x1f, 0x180}, > + { 0x2a400, 1, 0x1f, 0x1c0}, > + { 0x2a404, 255, 0x1f, 0x180}, > + { 0x2a800, 1, 0x1f, 0x1c0}, > + { 0x2a804, 255, 0x1f, 0x180}, > + { 0x2ac00, 1, 0x1f, 0x1c0}, > + { 0x2ac04, 255, 0x1f, 0x180}, > + { 0x2b000, 1, 0x1f, 0x1c0}, > + { 0x2b004, 255, 0x1f, 0x180}, > + { 0x2b400, 1, 0x1f, 0x1c0}, > + { 0x2b404, 255, 0x1f, 0x180}, > + { 0x2b800, 1, 0x1f, 0x1c0}, > + { 0x2b804, 255, 0x1f, 0x180}, > + { 0x2bc00, 1, 0x1f, 0x1c0}, > + { 0x2bc04, 255, 0x1f, 0x180}, > + { 0x2c000, 1, 0x1f, 0x1c0}, > + { 0x2c004, 255, 0x1f, 0x180}, > + { 0x2c400, 1, 0x1f, 0x1c0}, > + { 0x2c404, 255, 0x1f, 0x180}, > + { 0x2c800, 1, 0x1f, 0x1c0}, > + { 0x2c804, 255, 0x1f, 0x180}, > + { 0x2cc00, 1, 0x1f, 0x1c0}, > + { 0x2cc04, 255, 0x1f, 0x180}, > + { 0x2d000, 1, 0x1f, 0x1c0}, > + { 0x2d004, 255, 0x1f, 0x180}, > + { 0x2d400, 1, 0x1f, 0x1c0}, > + { 0x2d404, 255, 0x1f, 0x180}, > + { 0x2d800, 1, 0x1f, 0x1c0}, > + { 0x2d804, 255, 0x1f, 0x180}, > + { 0x2dc00, 1, 0x1f, 0x1c0}, > + { 0x2dc04, 255, 0x1f, 0x180}, > + { 0x2e000, 1, 0x1f, 0x1c0}, > + { 0x2e004, 255, 0x1f, 0x180}, > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > From owner-svn-src-all@freebsd.org Wed Dec 23 14:31:27 2015 Return-Path: Delivered-To: svn-src-all@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 AD5AFA502BC; Wed, 23 Dec 2015 14:31:27 +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 784F612C8; Wed, 23 Dec 2015 14:31:27 +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 tBNEVQFr059298; Wed, 23 Dec 2015 14:31:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNEVQwv059296; Wed, 23 Dec 2015 14:31:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512231431.tBNEVQwv059296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 23 Dec 2015 14:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292658 - in head: gnu/usr.bin/binutils/ld tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 14:31:27 -0000 Author: emaste Date: Wed Dec 23 14:31:26 2015 New Revision: 292658 URL: https://svnweb.freebsd.org/changeset/base/292658 Log: Install ld also as ld.bfd, for use with cc -fuse-ld=bfd PR: 205409 [exp-run] MFC after: 1 week Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: head/gnu/usr.bin/binutils/ld/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/gnu/usr.bin/binutils/ld/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/ld/Makefile Wed Dec 23 10:38:44 2015 (r292657) +++ head/gnu/usr.bin/binutils/ld/Makefile Wed Dec 23 14:31:26 2015 (r292658) @@ -48,6 +48,7 @@ CLEANFILES+= ldemul-list.h stringify.sed FILES= ${LDSCRIPTS:S|^|ldscripts/|} FILESDIR= ${SCRIPTDIR} +LINKS= ${BINDIR}/ld ${BINDIR}/ld.bfd HOST= ${TARGET_TUPLE} LIBSEARCHPATH= \"=/lib\":\"=/usr/lib\" Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Dec 23 10:38:44 2015 (r292657) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Dec 23 14:31:26 2015 (r292658) @@ -189,6 +189,7 @@ OLD_DIRS+=usr/share/examples/bhyve .if ${MK_BINUTILS} == no OLD_FILES+=usr/bin/as OLD_FILES+=usr/bin/ld +OLD_FILES+=usr/bin/ld.bfd .if ${MK_ELFCOPY_AS_OBJCOPY} == no OLD_FILES+=usr/bin/objcopy .endif From owner-svn-src-all@freebsd.org Wed Dec 23 15:22:45 2015 Return-Path: Delivered-To: svn-src-all@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 C88C8A4F15E; Wed, 23 Dec 2015 15:22:45 +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 7AE661DBE; Wed, 23 Dec 2015 15:22:45 +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 tBNFMiuv074301; Wed, 23 Dec 2015 15:22:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNFMiNm074300; Wed, 23 Dec 2015 15:22:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512231522.tBNFMiNm074300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 23 Dec 2015 15:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292659 - head/sys/arm64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 15:22:45 -0000 Author: andrew Date: Wed Dec 23 15:22:44 2015 New Revision: 292659 URL: https://svnweb.freebsd.org/changeset/base/292659 Log: Increase the size and alignment of the setjmp buffer. This will allow for possible future CPU extentions with larger registers. jmp_buf's size and alignment are baked into the ABI of third party libraries and thus are very hard to change later so it is best to waste a small amount of space now. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D3956 Modified: head/sys/arm64/include/setjmp.h Modified: head/sys/arm64/include/setjmp.h ============================================================================== --- head/sys/arm64/include/setjmp.h Wed Dec 23 14:31:26 2015 (r292658) +++ head/sys/arm64/include/setjmp.h Wed Dec 23 15:22:44 2015 (r292659) @@ -43,13 +43,12 @@ * - 11 general purpose registers * - 8 floating point registers * - The signal mask (128 bits) - * i.e. 24 64-bit words, this can be rounded up to 32 to give us some - * space to expand into without affecting the ABI. - * XXX: Is this enough space for expansion? + * i.e. 24 64-bit words, round this up to 31(+1) 128-bit words to allow for + * CPU extensions with larger registers and stronger alignment requirements. * * The registers to save are: r19 to r29, and d8 to d15. */ -#define _JBLEN 32 +#define _JBLEN 31 #define _JB_SIGMASK 21 /* This should only be needed in libc and may change */ @@ -65,10 +64,10 @@ * internally to avoid some run-time errors for mismatches. */ #if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE -typedef struct _sigjmp_buf { long _sjb[_JBLEN + 1]; } sigjmp_buf[1]; +typedef struct _sigjmp_buf { __int128_t _sjb[_JBLEN + 1]; } sigjmp_buf[1]; #endif -typedef struct _jmp_buf { long _jb[_JBLEN + 1]; } jmp_buf[1]; +typedef struct _jmp_buf { __int128_t _jb[_JBLEN + 1]; } jmp_buf[1]; #endif /* __ASSEMBLER__ */ #endif /* !_MACHINE_SETJMP_H_ */ From owner-svn-src-all@freebsd.org Wed Dec 23 15:24:27 2015 Return-Path: Delivered-To: svn-src-all@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 479ACA4F21A; Wed, 23 Dec 2015 15:24:27 +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 183361F69; Wed, 23 Dec 2015 15:24:27 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp.Home (unknown [90.200.119.55]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id F2F96D78FE; Wed, 23 Dec 2015 15:23:55 +0000 (UTC) Date: Wed, 23 Dec 2015 15:23:52 +0000 From: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292659 - head/sys/arm64/include Message-ID: <20151223152352.6c82e8ba@zapp.Home> In-Reply-To: <201512231522.tBNFMiNm074300@repo.freebsd.org> References: <201512231522.tBNFMiNm074300@repo.freebsd.org> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 15:24:27 -0000 On Wed, 23 Dec 2015 15:22:44 +0000 (UTC) Andrew Turner wrote: > Author: andrew > Date: Wed Dec 23 15:22:44 2015 > New Revision: 292659 > URL: https://svnweb.freebsd.org/changeset/base/292659 > > Log: > Increase the size and alignment of the setjmp buffer. This will > allow for possible future CPU extentions with larger registers. > > jmp_buf's size and alignment are baked into the ABI of third party > libraries and thus are very hard to change later so it is best to > waste a small amount of space now. > > Reviewed by: brooks This should be "Submitted by: brooks". Andrew From owner-svn-src-all@freebsd.org Wed Dec 23 15:40:06 2015 Return-Path: Delivered-To: svn-src-all@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 07CE3A4F68D; Wed, 23 Dec 2015 15:40:06 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::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 985F218A4; Wed, 23 Dec 2015 15:40:05 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id l126so152604523wml.0; Wed, 23 Dec 2015 07:40:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=aihMd9w+Y0TM4Tczd1b0c3SwRfaJIswQSytZZXI557o=; b=xz/ZsRLWcoJ62Khd+NtE5NzanmgMW7LavaVhG/tOTumFATiDZ5pknD4lkrWnUbuHI4 ry4mDPhgZFJZ/awa/i+i+qCv1LRZ+LQhPn/N1bw+6GuAlC+8xlHIe+D2DW+xFfvDk7c2 jE+8nP5Z4+2eO/7xY30AGm0oPiZvvuweKabo4z4fCw7nFq6aswIsrxOIdw67oLQOqtJw wOkAZ9QAv7OK2Glx73dHTOjQG+4wW1k+KCwZdiw7RVul2drsSxOT4B3QmwzX2vS2iDxU 0rqo3BhIlTPTjd/TYa9oxE5do9/CvS/aev20UCWY/Aj5D9LCBKBlYwWGwxlG+4/JaIA5 Wg0w== X-Received: by 10.194.133.233 with SMTP id pf9mr34535903wjb.71.1450885203993; Wed, 23 Dec 2015 07:40:03 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id e136sm29803820wma.23.2015.12.23.07.40.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Dec 2015 07:40:02 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 23 Dec 2015 16:40:00 +0100 From: Baptiste Daroussin To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292658 - in head: gnu/usr.bin/binutils/ld tools/build/mk Message-ID: <20151223154000.GC20454@ivaldir.etoilebsd.net> References: <201512231431.tBNEVQwv059296@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2/5bycvrmDh4d1IB" Content-Disposition: inline In-Reply-To: <201512231431.tBNEVQwv059296@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 15:40:06 -0000 --2/5bycvrmDh4d1IB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 23, 2015 at 02:31:26PM +0000, Ed Maste wrote: > Author: emaste > Date: Wed Dec 23 14:31:26 2015 > New Revision: 292658 > URL: https://svnweb.freebsd.org/changeset/base/292658 >=20 > Log: > Install ld also as ld.bfd, for use with cc -fuse-ld=3Dbfd > =20 > PR: 205409 [exp-run] > MFC after: 1 week > Relnotes: Yes > Sponsored by: The FreeBSD Foundation >=20 It might be a good idea to have a wrapper for ld, cc, c++ etc that reads a configuration file (overridable via env) to determine the default of those. Best regards, Bapt --2/5bycvrmDh4d1IB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWesBQAAoJEGOJi9zxtz5aAVgP/iIhT6wTvRE77xQIzC+3HCnp Tc6RX5G6VsT7YYzXlV1ELzrrUd+p0oRTdYzKFHuCzjLQCD4bS7D/6M45mj0bamYp hK4E8PstrnUqA/DDdq671bHeMXLbbWq9Nawj+AOE/1QSfIyaZCYy2oAQ6Peo8M8j psLJ8oSPCvHTlFlpVpZ1uvPCkG5dpwUGo5n/BfWf7MGcK6QzBvjbAVvjG3fU39LF pPWmW5GpeNHPTeiP4RH9V1D1hcewFx3XDAwO9IBLIB3POEJSwyROHd4JdvcjRLKb x5bxT0+pz1dkBEUTXyASuh4fLtc3lIu3Bl4Bk2aHQlc6Ovuni5N4ch2hptacHcsZ ulAlkbgSt2L6fzQH+qAw2ISBnKM4ooztuL9kXvqOV6gT0RGAl1FnkzTc5F+c/j5P uC2ccmF0XqCoboZY5Lxjj4kB8Pg2KcCBhMUr7XHpLWZvyNlTBvFJKfLWZkuod8KC PA6cIfQXdEwvFx1QIUMP+R1OWGAQMcgy3w+cR9rAz15d6hI5F1CJSWXSPWk6it+1 y5JlBgPqrfyXLKsZ46vJHvqPhaaEnWdlazVZGUJSjx4x7NaBAie0MYPZ7Ckv3vH/ r7WlKiJXKkX/ViBm9NeKCwGNlGDLX1JKJL2feesS2Z9VA9LfnVu2XuZ1Rq/LoGC6 jziK8WAKZWVeuFaeIUTY =BPaH -----END PGP SIGNATURE----- --2/5bycvrmDh4d1IB-- From owner-svn-src-all@freebsd.org Wed Dec 23 16:32:05 2015 Return-Path: Delivered-To: svn-src-all@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 50C41A509DB; Wed, 23 Dec 2015 16:32:05 +0000 (UTC) (envelope-from emax@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 235D112CB; Wed, 23 Dec 2015 16:32:05 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBNGW406093031; Wed, 23 Dec 2015 16:32:04 GMT (envelope-from emax@FreeBSD.org) Received: (from emax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNGW4m8093030; Wed, 23 Dec 2015 16:32:04 GMT (envelope-from emax@FreeBSD.org) Message-Id: <201512231632.tBNGW4m8093030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emax set sender to emax@FreeBSD.org using -f From: Maksim Yevmenkin Date: Wed, 23 Dec 2015 16:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292660 - head/sys/netgraph/bluetooth/socket X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 16:32:05 -0000 Author: emax Date: Wed Dec 23 16:32:04 2015 New Revision: 292660 URL: https://svnweb.freebsd.org/changeset/base/292660 Log: - grab ng_btsocket_l2cap_sockets_mtx lock in ng_btsocket_l2cap_process_l2ca_enc_change() before calling ng_btsocket_l2cap_pcb_by_cid(); - handle possible NULL value returned from ng_btsocket_l2cap_pcb_by_cid(); Submitted by: Hans Petter Selasky; hps at selasky dot org MFC after: 1 week Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Wed Dec 23 15:22:44 2015 (r292659) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Wed Dec 23 16:32:04 2015 (r292660) @@ -708,8 +708,15 @@ static int ng_btsocket_l2cap_process_l2c op = (ng_l2cap_l2ca_enc_chg_op *)(msg->data); + mtx_lock(&ng_btsocket_l2cap_sockets_mtx); + pcb = ng_btsocket_l2cap_pcb_by_cid(&rt->src, op->lcid, op->idtype); + if (pcb == NULL) { + mtx_unlock(&ng_btsocket_l2cap_sockets_mtx); + return (ENOENT); + } + mtx_lock(&pcb->pcb_mtx); pcb->encryption = op->result; @@ -729,6 +736,7 @@ static int ng_btsocket_l2cap_process_l2c } } mtx_unlock(&pcb->pcb_mtx); + mtx_unlock(&ng_btsocket_l2cap_sockets_mtx); return 0; } From owner-svn-src-all@freebsd.org Wed Dec 23 17:37:31 2015 Return-Path: Delivered-To: svn-src-all@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 AA9D8A5028E; Wed, 23 Dec 2015 17:37:31 +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 704FD14EE; Wed, 23 Dec 2015 17:37:31 +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 tBNHbUEO012694; Wed, 23 Dec 2015 17:37:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNHbU9Z012693; Wed, 23 Dec 2015 17:37:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512231737.tBNHbU9Z012693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 17:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292661 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 17:37:31 -0000 Author: ngie Date: Wed Dec 23 17:37:30 2015 New Revision: 292661 URL: https://svnweb.freebsd.org/changeset/base/292661 Log: Remove redundant vmbus_select_outgoing_channel declaration already handled in include/hyperv.h This unbreaks the gcc 4.2.1 kernel build of hyperv Differential Revision: https://reviews.freebsd.org/D4684 MFC after: 3 days Reviewed by: royger Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Dec 23 16:32:04 2015 (r292660) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Wed Dec 23 17:37:30 2015 (r292661) @@ -50,8 +50,6 @@ static void vmbus_channel_on_gpadl_tornd static void vmbus_channel_on_offers_delivered(hv_vmbus_channel_msg_header* hdr); static void vmbus_channel_on_version_response(hv_vmbus_channel_msg_header* hdr); static void vmbus_channel_process_offer(void *context); -struct hv_vmbus_channel* - vmbus_select_outgoing_channel(struct hv_vmbus_channel *promary); /** * Channel message dispatch table From owner-svn-src-all@freebsd.org Wed Dec 23 17:43:56 2015 Return-Path: Delivered-To: svn-src-all@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 79A76A50472; Wed, 23 Dec 2015 17:43:56 +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 47F2619E8; Wed, 23 Dec 2015 17:43:56 +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 tBNHht4W015489; Wed, 23 Dec 2015 17:43:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNHhtYn015487; Wed, 23 Dec 2015 17:43:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512231743.tBNHhtYn015487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 17:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292662 - head/sys/x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 17:43:56 -0000 Author: ngie Date: Wed Dec 23 17:43:55 2015 New Revision: 292662 URL: https://svnweb.freebsd.org/changeset/base/292662 Log: Remove redundant declarations in sys/x86/xen which are now handled in other sys/x86 headers Differential Revision: https://reviews.freebsd.org/D4685 X-MFC with: r291949 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/x86/xen/pv.c head/sys/x86/xen/xen_apic.c Modified: head/sys/x86/xen/pv.c ============================================================================== --- head/sys/x86/xen/pv.c Wed Dec 23 17:37:30 2015 (r292661) +++ head/sys/x86/xen/pv.c Wed Dec 23 17:43:55 2015 (r292662) @@ -96,13 +96,8 @@ static int xen_pv_start_all_aps(void); /*---------------------------- Extern Declarations ---------------------------*/ #ifdef SMP /* Variables used by amd64 mp_machdep to start APs */ -extern struct mtx ap_boot_mtx; -extern void *bootstacks[]; extern char *doublefault_stack; extern char *nmi_stack; -extern void *dpcpu; -extern int bootAP; -extern char *bootSTK; #endif /* Modified: head/sys/x86/xen/xen_apic.c ============================================================================== --- head/sys/x86/xen/xen_apic.c Wed Dec 23 17:37:30 2015 (r292661) +++ head/sys/x86/xen/xen_apic.c Wed Dec 23 17:43:55 2015 (r292662) @@ -74,12 +74,6 @@ static driver_filter_t xen_cpususpend_ha static driver_filter_t xen_cpustophard_handler; #endif -/*---------------------------- Extern Declarations ---------------------------*/ -/* Variables used by mp_machdep to perform the MMU related IPIs */ -#ifdef __amd64__ -extern int pmap_pcid_enabled; -#endif - /*---------------------------------- Macros ----------------------------------*/ #define IPI_TO_IDX(ipi) ((ipi) - APIC_IPI_INTS) From owner-svn-src-all@freebsd.org Wed Dec 23 17:54:20 2015 Return-Path: Delivered-To: svn-src-all@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 ECB6CA5080E; Wed, 23 Dec 2015 17:54:20 +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 BF9A01EE2; Wed, 23 Dec 2015 17:54:20 +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 tBNHsJDU018423; Wed, 23 Dec 2015 17:54:19 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNHsJ6f018422; Wed, 23 Dec 2015 17:54:19 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512231754.tBNHsJ6f018422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 23 Dec 2015 17:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292663 - head/sys/cddl/dev/fbt/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 17:54:21 -0000 Author: andrew Date: Wed Dec 23 17:54:19 2015 New Revision: 292663 URL: https://svnweb.freebsd.org/changeset/base/292663 Log: Be stricter on which functions we can probe with FBT. We now only check the first instruction to see if it's either a pushm with lr, or a sub with sp. The former is the common case, with the latter used with va_args. This removes 12 probes. These are all hand-written assembly, with a few C functions with no stack usage. Submitted by: Howard Su Differential Revision: https://reviews.freebsd.org/D4419 Modified: head/sys/cddl/dev/fbt/arm/fbt_isa.c Modified: head/sys/cddl/dev/fbt/arm/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/arm/fbt_isa.c Wed Dec 23 17:43:55 2015 (r292662) +++ head/sys/cddl/dev/fbt/arm/fbt_isa.c Wed Dec 23 17:54:19 2015 (r292663) @@ -35,6 +35,7 @@ #include #include +#include #include #include "fbt.h" @@ -42,6 +43,7 @@ #define FBT_PUSHM 0xe92d0000 #define FBT_POPM 0xe8bd0000 #define FBT_JUMP 0xea000000 +#define FBT_SUBSP 0xe24dd000 #define FBT_ENTRY "entry" #define FBT_RETURN "return" @@ -111,12 +113,18 @@ fbt_provide_module_function(linker_file_ instr = (uint32_t *)symval->value; limit = (uint32_t *)(symval->value + symval->size); - for (; instr < limit; instr++) - if ((*instr & 0xffff0000) == FBT_PUSHM && - (*instr & 0x4000) != 0) - break; + /* + * va_arg functions has first instruction of + * sub sp, sp, #? + */ + if ((*instr & 0xfffff000) == FBT_SUBSP) + instr++; - if (instr >= limit) + /* + * check if insn is a pushm with LR + */ + if ((*instr & 0xffff0000) != FBT_PUSHM || + (*instr & (1 << LR)) == 0) return (0); fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO); From owner-svn-src-all@freebsd.org Wed Dec 23 18:24:41 2015 Return-Path: Delivered-To: svn-src-all@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 A1CE9A4F1E9; Wed, 23 Dec 2015 18:24:41 +0000 (UTC) (envelope-from jilles@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 6DAA5101A; Wed, 23 Dec 2015 18:24:41 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBNIOeuT027455; Wed, 23 Dec 2015 18:24:40 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNIOeie027454; Wed, 23 Dec 2015 18:24:40 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201512231824.tBNIOeie027454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 23 Dec 2015 18:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292664 - stable/10/bin/sh X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 18:24:41 -0000 Author: jilles Date: Wed Dec 23 18:24:40 2015 New Revision: 292664 URL: https://svnweb.freebsd.org/changeset/base/292664 Log: MFC r292360: sh: Fix use-after-free when attempting to modify a read-only variable. Reported by: bapt Modified: stable/10/bin/sh/var.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/sh/var.c ============================================================================== --- stable/10/bin/sh/var.c Wed Dec 23 17:54:19 2015 (r292663) +++ stable/10/bin/sh/var.c Wed Dec 23 18:24:40 2015 (r292664) @@ -328,7 +328,7 @@ setvareq(char *s, int flags) if (vp->flags & VREADONLY) { if ((flags & (VTEXTFIXED|VSTACK)) == 0) ckfree(s); - error("%.*s: is read only", vp->name_len, s); + error("%.*s: is read only", vp->name_len, vp->text); } if (flags & VNOSET) { if ((flags & (VTEXTFIXED|VSTACK)) == 0) From owner-svn-src-all@freebsd.org Wed Dec 23 18:48:34 2015 Return-Path: Delivered-To: svn-src-all@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 3A437A4F8BA; Wed, 23 Dec 2015 18:48:34 +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 E54E81C1C; Wed, 23 Dec 2015 18:48: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 tBNImXWd033689; Wed, 23 Dec 2015 18:48:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNImWAf033687; Wed, 23 Dec 2015 18:48:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512231848.tBNImWAf033687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 23 Dec 2015 18:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292665 - head/lib/libc/tests/resolv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 18:48:34 -0000 Author: ngie Date: Wed Dec 23 18:48:32 2015 New Revision: 292665 URL: https://svnweb.freebsd.org/changeset/base/292665 Log: Increase the timeout for resolv_test from the default (300 seconds) to 450 seconds This is required on slower network connections, and on older releases (stable/10 seems to be slower as far as name resolution goes.. not sure why yet). Remove an outdated comment in the Makefile from when I was working on this code over a year ago on github MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/resolv/Makefile head/lib/libc/tests/resolv/resolv_test.c Modified: head/lib/libc/tests/resolv/Makefile ============================================================================== --- head/lib/libc/tests/resolv/Makefile Wed Dec 23 18:24:40 2015 (r292664) +++ head/lib/libc/tests/resolv/Makefile Wed Dec 23 18:48:32 2015 (r292665) @@ -6,7 +6,6 @@ BINDIR= ${TESTSDIR} FILES+= mach ATF_TESTS_C+= resolv_test -#TEST_METADATA.resolv_test= timeout="1800" # Note: this test relies on being dynamically linked. You will get a # spurious PASS for a statically linked test. Modified: head/lib/libc/tests/resolv/resolv_test.c ============================================================================== --- head/lib/libc/tests/resolv/resolv_test.c Wed Dec 23 18:24:40 2015 (r292664) +++ head/lib/libc/tests/resolv/resolv_test.c Wed Dec 23 18:48:32 2015 (r292665) @@ -289,21 +289,31 @@ do { \ ATF_REQUIRE(run_tests(_hostlist_file, method) == 0); \ } while(0) -ATF_TC_WITHOUT_HEAD(getaddrinfo_test); +ATF_TC(getaddrinfo_test); +ATF_TC_HEAD(getaddrinfo_test, tc) { + atf_tc_set_md_var(tc, "timeout", "450"); +} ATF_TC_BODY(getaddrinfo_test, tc) { RUN_TESTS(tc, METHOD_GETADDRINFO); } -ATF_TC_WITHOUT_HEAD(gethostby_test); +ATF_TC(gethostby_test); +ATF_TC_HEAD(gethostby_test, tc) { + atf_tc_set_md_var(tc, "timeout", "450"); +} ATF_TC_BODY(gethostby_test, tc) { RUN_TESTS(tc, METHOD_GETHOSTBY); } -ATF_TC_WITHOUT_HEAD(getipnodeby_test); +ATF_TC(getipnodeby_test); +ATF_TC_HEAD(getipnodeby_test, tc) { + + atf_tc_set_md_var(tc, "timeout", "450"); +} ATF_TC_BODY(getipnodeby_test, tc) { From owner-svn-src-all@freebsd.org Wed Dec 23 20:41:55 2015 Return-Path: Delivered-To: svn-src-all@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 DD8FBA4FF34 for ; Wed, 23 Dec 2015 20:41:55 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C26201BBE for ; Wed, 23 Dec 2015 20:41:55 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 23 Dec 2015 20:41:27 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tBNKfqiB004133; Wed, 23 Dec 2015 13:41:52 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1450903312.25138.212.camel@freebsd.org> Subject: Re: svn commit: r292644 - head/tools/tools/nanobsd/embedded From: Ian Lepore To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 23 Dec 2015 13:41:52 -0700 In-Reply-To: <201512230649.tBN6nJsJ023270@repo.freebsd.org> References: <201512230649.tBN6nJsJ023270@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 20:41:56 -0000 On Wed, 2015-12-23 at 06:49 +0000, Warner Losh wrote: > Author: imp > Date: Wed Dec 23 06:49:18 2015 > New Revision: 292644 > URL: https://svnweb.freebsd.org/changeset/base/292644 > > Log: > Copy all the dtb files that we build as part of the kernel build > from > boot/dtb to the fat partition. They seem to be needed. > Create an empty uEnv.txt file Of all the arm platforms we support, only RPi and RPi2 require the dtb files to be in the fat partition. The only advantage to an empty uEnv.txt file is that it will suppress a warning about not being able to read it. There's no way to suppress a similar warning about a bad saved-environment checksum that u-boot emits if you've never changed anything and done a saveenv. -- Ian From owner-svn-src-all@freebsd.org Wed Dec 23 21:41:44 2015 Return-Path: Delivered-To: svn-src-all@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 41D73A50213; Wed, 23 Dec 2015 21:41:44 +0000 (UTC) (envelope-from jhb@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 0133917FC; Wed, 23 Dec 2015 21:41:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBNLfhXX085962; Wed, 23 Dec 2015 21:41:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNLfgYK084842; Wed, 23 Dec 2015 21:41:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512232141.tBNLfgYK084842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 23 Dec 2015 21:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292668 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/include x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 21:41:44 -0000 Author: jhb Date: Wed Dec 23 21:41:42 2015 New Revision: 292668 URL: https://svnweb.freebsd.org/changeset/base/292668 Log: Move shared variables from {amd64,i386}/initcpu.c to x86/identcpu.c. While here, move the common bits of to as well. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D4670 Added: head/sys/x86/include/cputypes.h - copied, changed from r292667, head/sys/i386/include/cputypes.h Modified: head/sys/amd64/amd64/initcpu.c head/sys/amd64/include/cputypes.h head/sys/i386/i386/initcpu.c head/sys/i386/include/cputypes.h head/sys/x86/x86/identcpu.c Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Wed Dec 23 20:27:23 2015 (r292667) +++ head/sys/amd64/amd64/initcpu.c Wed Dec 23 21:41:42 2015 (r292668) @@ -55,37 +55,6 @@ SYSCTL_INT(_hw, OID_AUTO, instruction_ss */ static int hw_clflush_disable = -1; -int cpu; /* Are we 386, 386sx, 486, etc? */ -u_int cpu_feature; /* Feature flags */ -u_int cpu_feature2; /* Feature flags */ -u_int amd_feature; /* AMD feature flags */ -u_int amd_feature2; /* AMD feature flags */ -u_int amd_pminfo; /* AMD advanced power management info */ -u_int via_feature_rng; /* VIA RNG features */ -u_int via_feature_xcrypt; /* VIA ACE features */ -u_int cpu_high; /* Highest arg to CPUID */ -u_int cpu_exthigh; /* Highest arg to extended CPUID */ -u_int cpu_id; /* Stepping ID */ -u_int cpu_procinfo; /* HyperThreading Info / Brand Index / CLFUSH */ -u_int cpu_procinfo2; /* Multicore info */ -char cpu_vendor[20]; /* CPU Origin code */ -u_int cpu_vendor_id; /* CPU vendor ID */ -u_int cpu_fxsr; /* SSE enabled */ -u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ -u_int cpu_clflush_line_size = 32; -u_int cpu_stdext_feature; -u_int cpu_stdext_feature2; -u_int cpu_max_ext_state_size; -u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */ -u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ -u_int cpu_mon_max_size; /* MONITOR minimum range size, bytes */ -u_int cpu_maxphyaddr; /* Max phys addr width in bits */ - -SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, - &via_feature_rng, 0, "VIA RNG feature available in CPU"); -SYSCTL_UINT(_hw, OID_AUTO, via_feature_xcrypt, CTLFLAG_RD, - &via_feature_xcrypt, 0, "VIA xcrypt feature available in CPU"); - static void init_amd(void) { Modified: head/sys/amd64/include/cputypes.h ============================================================================== --- head/sys/amd64/include/cputypes.h Wed Dec 23 20:27:23 2015 (r292667) +++ head/sys/amd64/include/cputypes.h Wed Dec 23 21:41:42 2015 (r292668) @@ -30,6 +30,8 @@ #ifndef _MACHINE_CPUTYPES_H_ #define _MACHINE_CPUTYPES_H_ +#include + /* * Classes of processor. */ @@ -43,17 +45,4 @@ #define CPU_CLAWHAMMER 1 /* AMD Clawhammer */ #define CPU_SLEDGEHAMMER 2 /* AMD Sledgehammer */ -/* - * Vendors of processor. - */ -#define CPU_VENDOR_AMD 0x1022 /* AMD */ -#define CPU_VENDOR_IDT 0x111d /* Centaur/IDT/VIA */ -#define CPU_VENDOR_INTEL 0x8086 /* Intel */ -#define CPU_VENDOR_CENTAUR CPU_VENDOR_IDT - -#ifndef LOCORE -extern int cpu; -extern int cpu_class; -#endif - #endif /* !_MACHINE_CPUTYPES_H_ */ Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Wed Dec 23 20:27:23 2015 (r292667) +++ head/sys/i386/i386/initcpu.c Wed Dec 23 21:41:42 2015 (r292668) @@ -81,39 +81,7 @@ SYSCTL_INT(_hw, OID_AUTO, instruction_ss */ static int hw_clflush_disable = -1; -int cpu; /* Are we 386, 386sx, 486, etc? */ -u_int cpu_feature; /* Feature flags */ -u_int cpu_feature2; /* Feature flags */ -u_int amd_feature; /* AMD feature flags */ -u_int amd_feature2; /* AMD feature flags */ -u_int amd_pminfo; /* AMD advanced power management info */ -u_int via_feature_rng; /* VIA RNG features */ -u_int via_feature_xcrypt; /* VIA ACE features */ -u_int cpu_high; /* Highest arg to CPUID */ -u_int cpu_exthigh; /* Highest arg to extended CPUID */ -u_int cpu_id; /* Stepping ID */ -u_int cpu_procinfo; /* HyperThreading Info / Brand Index / CLFUSH */ -u_int cpu_procinfo2; /* Multicore info */ -char cpu_vendor[20]; /* CPU Origin code */ -u_int cpu_vendor_id; /* CPU vendor ID */ -#ifdef CPU_ENABLE_SSE -u_int cpu_fxsr; /* SSE enabled */ -u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ -#endif -u_int cpu_clflush_line_size = 32; -u_int cpu_stdext_feature; -u_int cpu_stdext_feature2; -u_int cpu_max_ext_state_size; -u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */ -u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ -u_int cpu_mon_max_size; /* MONITOR minimum range size, bytes */ u_int cyrix_did; /* Device ID of Cyrix CPU */ -u_int cpu_maxphyaddr; /* Max phys addr width in bits */ - -SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, - &via_feature_rng, 0, "VIA RNG feature available in CPU"); -SYSCTL_UINT(_hw, OID_AUTO, via_feature_xcrypt, CTLFLAG_RD, - &via_feature_xcrypt, 0, "VIA xcrypt feature available in CPU"); #ifdef I486_CPU /* Modified: head/sys/i386/include/cputypes.h ============================================================================== --- head/sys/i386/include/cputypes.h Wed Dec 23 20:27:23 2015 (r292667) +++ head/sys/i386/include/cputypes.h Wed Dec 23 21:41:42 2015 (r292668) @@ -30,6 +30,8 @@ #ifndef _MACHINE_CPUTYPES_H_ #define _MACHINE_CPUTYPES_H_ +#include + /* * Classes of processor. */ @@ -61,25 +63,4 @@ #define CPU_P4 16 /* Intel Pentium 4 */ #define CPU_GEODE1100 17 /* NS Geode SC1100 */ -/* - * Vendors of processor. - */ -#define CPU_VENDOR_NSC 0x100b /* NSC */ -#define CPU_VENDOR_IBM 0x1014 /* IBM */ -#define CPU_VENDOR_AMD 0x1022 /* AMD */ -#define CPU_VENDOR_SIS 0x1039 /* SiS */ -#define CPU_VENDOR_UMC 0x1060 /* UMC */ -#define CPU_VENDOR_NEXGEN 0x1074 /* Nexgen */ -#define CPU_VENDOR_CYRIX 0x1078 /* Cyrix */ -#define CPU_VENDOR_IDT 0x111d /* Centaur/IDT/VIA */ -#define CPU_VENDOR_TRANSMETA 0x1279 /* Transmeta */ -#define CPU_VENDOR_INTEL 0x8086 /* Intel */ -#define CPU_VENDOR_RISE 0xdead2bad /* Rise */ -#define CPU_VENDOR_CENTAUR CPU_VENDOR_IDT - -#ifndef LOCORE -extern int cpu; -extern int cpu_class; -#endif - #endif /* !_MACHINE_CPUTYPES_H_ */ Copied and modified: head/sys/x86/include/cputypes.h (from r292667, head/sys/i386/include/cputypes.h) ============================================================================== --- head/sys/i386/include/cputypes.h Wed Dec 23 20:27:23 2015 (r292667, copy source) +++ head/sys/x86/include/cputypes.h Wed Dec 23 21:41:42 2015 (r292668) @@ -27,39 +27,8 @@ * $FreeBSD$ */ -#ifndef _MACHINE_CPUTYPES_H_ -#define _MACHINE_CPUTYPES_H_ - -/* - * Classes of processor. - */ -#define CPUCLASS_286 0 -#define CPUCLASS_386 1 -#define CPUCLASS_486 2 -#define CPUCLASS_586 3 -#define CPUCLASS_686 4 - -/* - * Kinds of processor. - */ -#define CPU_286 0 /* Intel 80286 */ -#define CPU_386SX 1 /* Intel 80386SX */ -#define CPU_386 2 /* Intel 80386DX */ -#define CPU_486SX 3 /* Intel 80486SX */ -#define CPU_486 4 /* Intel 80486DX */ -#define CPU_586 5 /* Intel Pentium */ -#define CPU_486DLC 6 /* Cyrix 486DLC */ -#define CPU_686 7 /* Pentium Pro */ -#define CPU_M1SC 8 /* Cyrix M1sc (aka 5x86) */ -#define CPU_M1 9 /* Cyrix M1 (aka 6x86) */ -#define CPU_BLUE 10 /* IBM BlueLighting CPU */ -#define CPU_M2 11 /* Cyrix M2 (enhanced 6x86 with MMX) */ -#define CPU_NX586 12 /* NexGen (now AMD) 586 */ -#define CPU_CY486DX 13 /* Cyrix 486S/DX/DX2/DX4 */ -#define CPU_PII 14 /* Intel Pentium II */ -#define CPU_PIII 15 /* Intel Pentium III */ -#define CPU_P4 16 /* Intel Pentium 4 */ -#define CPU_GEODE1100 17 /* NS Geode SC1100 */ +#ifndef _X86_CPUTYPES_H_ +#define _X86_CPUTYPES_H_ /* * Vendors of processor. @@ -82,4 +51,4 @@ extern int cpu; extern int cpu_class; #endif -#endif /* !_MACHINE_CPUTYPES_H_ */ +#endif /* !_X86_CPUTYPES_H_ */ Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Wed Dec 23 20:27:23 2015 (r292667) +++ head/sys/x86/x86/identcpu.c Wed Dec 23 21:41:42 2015 (r292668) @@ -67,6 +67,10 @@ __FBSDID("$FreeBSD$"); #include #ifdef __i386__ +#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) +#define CPU_ENABLE_SSE +#endif + #define IDENTBLUE_CYRIX486 0 #define IDENTBLUE_IBMCPU 1 #define IDENTBLUE_CYRIXM2 2 @@ -83,9 +87,43 @@ static void print_svm_info(void); static void print_via_padlock_info(void); static void print_vmx_info(void); +int cpu; /* Are we 386, 386sx, 486, etc? */ int cpu_class; +u_int cpu_feature; /* Feature flags */ +u_int cpu_feature2; /* Feature flags */ +u_int amd_feature; /* AMD feature flags */ +u_int amd_feature2; /* AMD feature flags */ +u_int amd_pminfo; /* AMD advanced power management info */ +u_int via_feature_rng; /* VIA RNG features */ +u_int via_feature_xcrypt; /* VIA ACE features */ +u_int cpu_high; /* Highest arg to CPUID */ +u_int cpu_exthigh; /* Highest arg to extended CPUID */ +u_int cpu_id; /* Stepping ID */ +u_int cpu_procinfo; /* HyperThreading Info / Brand Index / CLFUSH */ +u_int cpu_procinfo2; /* Multicore info */ +char cpu_vendor[20]; /* CPU Origin code */ +u_int cpu_vendor_id; /* CPU vendor ID */ +#if defined(__amd64__) || defined(CPU_ENABLE_SSE) +u_int cpu_fxsr; /* SSE enabled */ +u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ +#endif +u_int cpu_clflush_line_size = 32; +u_int cpu_stdext_feature; +u_int cpu_stdext_feature2; +u_int cpu_max_ext_state_size; +u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */ +u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ +u_int cpu_mon_max_size; /* MONITOR minimum range size, bytes */ +u_int cpu_maxphyaddr; /* Max phys addr width in bits */ char machine[] = MACHINE; +SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, + &via_feature_rng, 0, + "VIA RNG feature available in CPU"); +SYSCTL_UINT(_hw, OID_AUTO, via_feature_xcrypt, CTLFLAG_RD, + &via_feature_xcrypt, 0, + "VIA xcrypt feature available in CPU"); + #ifdef __amd64__ #ifdef SCTL_MASK32 extern int adaptive_machine_arch; From owner-svn-src-all@freebsd.org Wed Dec 23 21:51:12 2015 Return-Path: Delivered-To: svn-src-all@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 36DCDA50631; Wed, 23 Dec 2015 21:51:12 +0000 (UTC) (envelope-from jhb@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 EC13F1D39; Wed, 23 Dec 2015 21:51:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBNLpBYI087633; Wed, 23 Dec 2015 21:51:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNLpAUP087626; Wed, 23 Dec 2015 21:51:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512232151.tBNLpAUP087626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 23 Dec 2015 21:51:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292669 - in head: share/man/man9 sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 21:51:12 -0000 Author: jhb Date: Wed Dec 23 21:51:10 2015 New Revision: 292669 URL: https://svnweb.freebsd.org/changeset/base/292669 Log: Add accessor methods to fetch the BAR holding the MSI-X table and PBA. While here, explicitly note the requirement that the BAR(s) must be allocated prior to calling pci_alloc_msix(). Reviewed by: andrew, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4688 Modified: head/share/man/man9/Makefile head/share/man/man9/pci.9 head/sys/dev/pci/pci.c head/sys/dev/pci/pci_if.m head/sys/dev/pci/pci_private.h head/sys/dev/pci/pcivar.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Dec 23 21:41:42 2015 (r292668) +++ head/share/man/man9/Makefile Wed Dec 23 21:51:10 2015 (r292669) @@ -1287,6 +1287,8 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_iov_detach.9 \ pci.9 pci_msi_count.9 \ pci.9 pci_msix_count.9 \ + pci.9 pci_msix_pba_bar.9 \ + pci.9 pci_msix_table_bar.9 \ pci.9 pci_pending_msix.9 \ pci.9 pci_read_config.9 \ pci.9 pci_release_msi.9 \ Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Wed Dec 23 21:41:42 2015 (r292668) +++ head/share/man/man9/pci.9 Wed Dec 23 21:51:10 2015 (r292669) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 5, 2015 +.Dd December 23, 2015 .Dt PCI 9 .Os .Sh NAME @@ -51,6 +51,8 @@ .Nm pci_iov_detach , .Nm pci_msi_count , .Nm pci_msix_count , +.Nm pci_msix_pba_bar , +.Nm pci_msix_table_bar , .Nm pci_pending_msix , .Nm pci_read_config , .Nm pci_release_msi , @@ -107,6 +109,10 @@ .Ft int .Fn pci_msix_count "device_t dev" .Ft int +.Fn pci_msix_pba_bar "device_t dev" +.Ft int +.Fn pci_msix_table_bar "device_t dev" +.Ft int .Fn pci_pending_msix "device_t dev" "u_int index" .Ft uint32_t .Fn pci_read_config "device_t dev" "int reg" "int width" @@ -694,6 +700,37 @@ then returns zero. .Pp The +.Fn pci_msix_pba_bar +function returns the offset in configuration space of the Base Address Register +.Pq BAR +containing the MSI-X Pending Bit Array (PBA) for device +.Fa dev . +The returned value can be used as the resource ID with +.Xr bus_alloc_resource 9 +and +.Xr bus_release_resource 9 +to allocate the BAR. +If the device does not support MSI-X, +then +.Fn pci_msix_pba_bar +returns -1. +.Pp +The +.Fn pci_msix_table_bar +function returns the offset in configuration space of the BAR +containing the MSI-X vector table for device +.Fa dev . +The returned value can be used as the resource ID with +.Xr bus_alloc_resource 9 +and +.Xr bus_release_resource 9 +to allocate the BAR. +If the device does not support MSI-X, +then +.Fn pci_msix_table_bar +returns -1. +.Pp +The .Fn pci_alloc_msix function attempts to allocate .Fa *count @@ -732,12 +769,21 @@ it returns an error. Unlike MSI, MSI-X does not require message counts that are powers of two. .Pp +The BARs containing the MSI-X vector table and PBA must be +allocated via +.Xr bus_alloc_resource 9 +before calling +.Fn pci_alloc_msix +and must not be released until after calling +.Fn pci_release_msi . +Note that the vector table and PBA may be stored in the same BAR or in +different BARs. +.Pp The .Fn pci_pending_msix function examines the .Fa dev -device's Pending Bit Array -.Pq PBA +device's PBA to determine the pending status of the MSI-X message at table index .Fa index . If the indicated message is pending, @@ -853,3 +899,6 @@ These do not refer to the geographic loc but to the device number assigned by the combination of the PCI IDSEL mechanism and the platform firmware. This should be taken note of when working with the kernel PCI code. +.Pp +The PCI bus driver should allocate the MSI-X vector table and PBA internally +as necessary rather than requiring the caller to do so. Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Dec 23 21:41:42 2015 (r292668) +++ head/sys/dev/pci/pci.c Wed Dec 23 21:51:10 2015 (r292669) @@ -187,6 +187,8 @@ static device_method_t pci_methods[] = { DEVMETHOD(pci_release_msi, pci_release_msi_method), DEVMETHOD(pci_msi_count, pci_msi_count_method), DEVMETHOD(pci_msix_count, pci_msix_count_method), + DEVMETHOD(pci_msix_pba_bar, pci_msix_pba_bar_method), + DEVMETHOD(pci_msix_table_bar, pci_msix_table_bar_method), DEVMETHOD(pci_get_rid, pci_get_rid_method), DEVMETHOD(pci_child_added, pci_child_added_method), #ifdef PCI_IOV @@ -1851,6 +1853,28 @@ pci_msix_count_method(device_t dev, devi return (0); } +int +pci_msix_pba_bar_method(device_t dev, device_t child) +{ + struct pci_devinfo *dinfo = device_get_ivars(child); + struct pcicfg_msix *msix = &dinfo->cfg.msix; + + if (pci_do_msix && msix->msix_location != 0) + return (msix->msix_pba_bar); + return (-1); +} + +int +pci_msix_table_bar_method(device_t dev, device_t child) +{ + struct pci_devinfo *dinfo = device_get_ivars(child); + struct pcicfg_msix *msix = &dinfo->cfg.msix; + + if (pci_do_msix && msix->msix_location != 0) + return (msix->msix_table_bar); + return (-1); +} + /* * HyperTransport MSI mapping control */ Modified: head/sys/dev/pci/pci_if.m ============================================================================== --- head/sys/dev/pci/pci_if.m Wed Dec 23 21:41:42 2015 (r292668) +++ head/sys/dev/pci/pci_if.m Wed Dec 23 21:51:10 2015 (r292669) @@ -36,7 +36,13 @@ CODE { { return (0); } - + + static int + null_msix_bar(device_t dev, device_t child) + { + return (-1); + } + static device_t null_create_iov_child(device_t bus, device_t pf, uint16_t rid, uint16_t vid, uint16_t did) @@ -192,6 +198,16 @@ METHOD int msix_count { device_t child; } DEFAULT null_msi_count; +METHOD int msix_pba_bar { + device_t dev; + device_t child; +} DEFAULT null_msix_bar; + +METHOD int msix_table_bar { + device_t dev; + device_t child; +} DEFAULT null_msix_bar; + METHOD uint16_t get_rid { device_t dev; device_t child; Modified: head/sys/dev/pci/pci_private.h ============================================================================== --- head/sys/dev/pci/pci_private.h Wed Dec 23 21:41:42 2015 (r292668) +++ head/sys/dev/pci/pci_private.h Wed Dec 23 21:51:10 2015 (r292669) @@ -102,6 +102,8 @@ int pci_remap_msix_method(device_t dev, int pci_release_msi_method(device_t dev, device_t child); int pci_msi_count_method(device_t dev, device_t child); int pci_msix_count_method(device_t dev, device_t child); +int pci_msix_pba_bar_method(device_t dev, device_t child); +int pci_msix_table_bar_method(device_t dev, device_t child); struct resource *pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Wed Dec 23 21:41:42 2015 (r292668) +++ head/sys/dev/pci/pcivar.h Wed Dec 23 21:51:10 2015 (r292669) @@ -516,6 +516,18 @@ pci_msix_count(device_t dev) return (PCI_MSIX_COUNT(device_get_parent(dev), dev)); } +static __inline int +pci_msix_pba_bar(device_t dev) +{ + return (PCI_MSIX_PBA_BAR(device_get_parent(dev), dev)); +} + +static __inline int +pci_msix_table_bar(device_t dev) +{ + return (PCI_MSIX_TABLE_BAR(device_get_parent(dev), dev)); +} + static __inline uint16_t pci_get_rid(device_t dev) { From owner-svn-src-all@freebsd.org Wed Dec 23 21:54:06 2015 Return-Path: Delivered-To: svn-src-all@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 B20B8A50776; Wed, 23 Dec 2015 21:54:06 +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 6FEA3116A; Wed, 23 Dec 2015 21:54:06 +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 tBNLs55g090309; Wed, 23 Dec 2015 21:54:05 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNLs5si090307; Wed, 23 Dec 2015 21:54:05 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201512232154.tBNLs5si090307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 23 Dec 2015 21:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292670 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 21:54:06 -0000 Author: sbruno Date: Wed Dec 23 21:54:05 2015 New Revision: 292670 URL: https://svnweb.freebsd.org/changeset/base/292670 Log: Add support for sysctl knobs to live tune the tx packet processing limits in igb and fix a wrap-around bug. Reviewed by: hiren Obtained from: Jason (j@nitrology.com) MFC after: 2 weeks Sponsored by: LimeLight Networks Differential Revision: https://reviews.freebsd.org/D4039 Modified: head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Wed Dec 23 21:51:10 2015 (r292669) +++ head/sys/dev/e1000/if_igb.c Wed Dec 23 21:54:05 2015 (r292670) @@ -336,6 +336,12 @@ SYSCTL_INT(_hw_igb, OID_AUTO, rx_process &igb_rx_process_limit, 0, "Maximum number of received packets to process at a time, -1 means unlimited"); +/* How many packets txeof tries to clean at a time */ +static int igb_tx_process_limit = -1; +SYSCTL_INT(_hw_igb, OID_AUTO, tx_process_limit, CTLFLAG_RDTUN, + &igb_tx_process_limit, 0, + "Maximum number of sent packets to process at a time, -1 means unlimited"); + #ifdef DEV_NETMAP /* see ixgbe.c for details */ #include #endif /* DEV_NETMAP */ @@ -453,11 +459,15 @@ igb_attach(device_t dev) e1000_get_bus_info(&adapter->hw); - /* Sysctl for limiting the amount of work done in the taskqueue */ + /* Sysctls for limiting the amount of work done in the taskqueues */ igb_set_sysctl_value(adapter, "rx_processing_limit", "max number of rx packets to process", &adapter->rx_process_limit, igb_rx_process_limit); + igb_set_sysctl_value(adapter, "tx_processing_limit", + "max number of tx packets to process", + &adapter->tx_process_limit, igb_tx_process_limit); + /* * Validate number of transmit and receive descriptors. It * must not exceed hardware maximum, and must be multiple @@ -3971,7 +3981,7 @@ igb_txeof(struct tx_ring *txr) struct ifnet *ifp = adapter->ifp; #endif /* DEV_NETMAP */ u32 work, processed = 0; - u16 limit = txr->process_limit; + int limit = adapter->tx_process_limit; struct igb_tx_buf *buf; union e1000_adv_tx_desc *txd; Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Wed Dec 23 21:51:10 2015 (r292669) +++ head/sys/dev/e1000/if_igb.h Wed Dec 23 21:54:05 2015 (r292670) @@ -355,7 +355,6 @@ struct tx_ring { volatile u16 tx_avail; u16 next_avail_desc; u16 next_to_clean; - u16 process_limit; u16 num_desc; enum { IGB_QUEUE_IDLE = 1, @@ -534,6 +533,7 @@ struct adapter { int has_manage; int wol; int rx_process_limit; + int tx_process_limit; u16 vf_ifp; /* a VF interface */ bool in_detach; /* Used only in igb_ioctl */ From owner-svn-src-all@freebsd.org Wed Dec 23 21:55:55 2015 Return-Path: Delivered-To: svn-src-all@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 C48E8A5081D; Wed, 23 Dec 2015 21:55:55 +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 92A011345; Wed, 23 Dec 2015 21:55:55 +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 tBNLtsbh090433; Wed, 23 Dec 2015 21:55:54 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNLtsj2090432; Wed, 23 Dec 2015 21:55:54 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201512232155.tBNLtsj2090432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 23 Dec 2015 21:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292671 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 21:55:55 -0000 Author: sbruno Date: Wed Dec 23 21:55:54 2015 New Revision: 292671 URL: https://svnweb.freebsd.org/changeset/base/292671 Log: Fixup native-xtools target for poudriere cross build jails after svn r291955 by excluding all debug files. Reported by: swills Reviewed by: emaste Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Dec 23 21:54:05 2015 (r292670) +++ head/Makefile.inc1 Wed Dec 23 21:55:54 2015 (r292671) @@ -1677,7 +1677,7 @@ NXBMAKE= ${NXBENV} ${MAKE} \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ - MK_LLDB=no + MK_LLDB=no MK_DEBUG_FILES=no # native-xtools is the current target for qemu-user cross builds of ports # via poudriere and the imgact_binmisc kernel module. From owner-svn-src-all@freebsd.org Wed Dec 23 21:57:27 2015 Return-Path: Delivered-To: svn-src-all@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 A59C7A508D7; Wed, 23 Dec 2015 21:57:27 +0000 (UTC) (envelope-from lidl@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 744E31649; Wed, 23 Dec 2015 21:57:27 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBNLvQrO090536; Wed, 23 Dec 2015 21:57:26 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNLvQMv090535; Wed, 23 Dec 2015 21:57:26 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201512232157.tBNLvQMv090535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Wed, 23 Dec 2015 21:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292672 - stable/10/etc/periodic/security X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 21:57:27 -0000 Author: lidl Date: Wed Dec 23 21:57:26 2015 New Revision: 292672 URL: https://svnweb.freebsd.org/changeset/base/292672 Log: MFC r290405: Restrict 520.pfdenied to only list rules that blocked traffic. Before this change, the 520.pfdenied script listed all rules that matched /^block/ in the rule. Restrict the printed output to only those rules that result in packets being dropped. Approved by: rpaulo (mentor) Modified: stable/10/etc/periodic/security/520.pfdenied Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/periodic/security/520.pfdenied ============================================================================== --- stable/10/etc/periodic/security/520.pfdenied Wed Dec 23 21:55:54 2015 (r292671) +++ stable/10/etc/periodic/security/520.pfdenied Wed Dec 23 21:57:26 2015 (r292672) @@ -44,7 +44,7 @@ rc=0 if check_yesno_period security_status_pfdenied_enable then TMP=`mktemp -t security` - if pfctl -sr -v 2>/dev/null | nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); print buf$0;} }' > ${TMP}; then + if pfctl -sr -v 2>/dev/null | nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); if ($5 > 0) print buf$0;} }' > ${TMP}; then check_diff new_only pf ${TMP} "${host} pf denied packets:" fi rc=$? From owner-svn-src-all@freebsd.org Wed Dec 23 21:59:39 2015 Return-Path: Delivered-To: svn-src-all@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 A0DF6A509A0; Wed, 23 Dec 2015 21:59:39 +0000 (UTC) (envelope-from lidl@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 6F7AC18AF; Wed, 23 Dec 2015 21:59:39 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBNLxcGG090655; Wed, 23 Dec 2015 21:59:38 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNLxcAv090654; Wed, 23 Dec 2015 21:59:38 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201512232159.tBNLxcAv090654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Wed, 23 Dec 2015 21:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292673 - stable/10/etc/periodic/daily X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 21:59:39 -0000 Author: lidl Date: Wed Dec 23 21:59:38 2015 New Revision: 292673 URL: https://svnweb.freebsd.org/changeset/base/292673 Log: MFC r292313: Skip unavailable pools when running zfs pool scrubs Approved by: rpaulo (mentor) Modified: stable/10/etc/periodic/daily/800.scrub-zfs Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/periodic/daily/800.scrub-zfs ============================================================================== --- stable/10/etc/periodic/daily/800.scrub-zfs Wed Dec 23 21:57:26 2015 (r292672) +++ stable/10/etc/periodic/daily/800.scrub-zfs Wed Dec 23 21:59:38 2015 (r292673) @@ -43,6 +43,10 @@ case "$daily_scrub_zfs_enable" in rc=3 echo "Skipping faulted pool: ${pool}" continue ;; + *UNAVAIL*) + rc=4 + echo "Skipping unavailable pool: ${pool}" + continue ;; esac # determine how many days shall be between scrubs From owner-svn-src-all@freebsd.org Wed Dec 23 22:45:19 2015 Return-Path: Delivered-To: svn-src-all@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 89BDBA4F761; Wed, 23 Dec 2015 22:45:19 +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 1D3AD1AB7; Wed, 23 Dec 2015 22:45:19 +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 tBNMjIkJ005073; Wed, 23 Dec 2015 22:45:18 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBNMjIJO005070; Wed, 23 Dec 2015 22:45:18 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201512232245.tBNMjIJO005070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 23 Dec 2015 22:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292674 - in head/sys: conf dev/ixgbe modules/ix modules/ixv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2015 22:45:19 -0000 Author: sbruno Date: Wed Dec 23 22:45:17 2015 New Revision: 292674 URL: https://svnweb.freebsd.org/changeset/base/292674 Log: ixgbe(4): Update to version 3.1.13-k Add support for two new devices: X552 SFP+ 10 GbE, and the single port version of X550T. Submitted by: erj Reviewed by: gnn Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D4186 Added: head/sys/dev/ixgbe/ixgbe_osdep.c - copied, changed from r292671, head/sys/dev/ixgbe/LICENSE Deleted: head/sys/dev/ixgbe/LICENSE head/sys/dev/ixgbe/README Modified: head/sys/conf/files head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixgbe/ix_txrx.c head/sys/dev/ixgbe/ixgbe.h head/sys/dev/ixgbe/ixgbe_82598.c head/sys/dev/ixgbe/ixgbe_82599.c head/sys/dev/ixgbe/ixgbe_api.c head/sys/dev/ixgbe/ixgbe_api.h head/sys/dev/ixgbe/ixgbe_common.c head/sys/dev/ixgbe/ixgbe_dcb.c head/sys/dev/ixgbe/ixgbe_osdep.h head/sys/dev/ixgbe/ixgbe_phy.c head/sys/dev/ixgbe/ixgbe_phy.h head/sys/dev/ixgbe/ixgbe_type.h head/sys/dev/ixgbe/ixgbe_vf.c head/sys/dev/ixgbe/ixgbe_x540.c head/sys/dev/ixgbe/ixgbe_x550.c head/sys/dev/ixgbe/ixgbe_x550.h head/sys/modules/ix/Makefile head/sys/modules/ixv/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Dec 23 21:59:38 2015 (r292673) +++ head/sys/conf/files Wed Dec 23 22:45:17 2015 (r292674) @@ -1861,6 +1861,8 @@ dev/ixgbe/if_ixv.c optional ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP" dev/ixgbe/ix_txrx.c optional ix inet | ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_osdep.c optional ix inet | ixv inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_phy.c optional ix inet | ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_api.c optional ix inet | ixv inet \ Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Wed Dec 23 21:59:38 2015 (r292673) +++ head/sys/dev/ixgbe/if_ix.c Wed Dec 23 22:45:17 2015 (r292674) @@ -47,14 +47,10 @@ #endif /********************************************************************* - * Set this to one to display debug statistics - *********************************************************************/ -int ixgbe_display_debug_stats = 0; - -/********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "3.1.0"; +char ixgbe_driver_version[] = "3.1.13-k"; + /********************************************************************* * PCI Device ID Table @@ -95,9 +91,11 @@ static ixgbe_vendor_info_t ixgbe_vendor_ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T1, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KR, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KX4, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_10G_T, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_SFP, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} }; @@ -131,7 +129,7 @@ static void ixgbe_media_status(struc static int ixgbe_media_change(struct ifnet *); static void ixgbe_identify_hardware(struct adapter *); static int ixgbe_allocate_pci_resources(struct adapter *); -static void ixgbe_get_slot_info(struct ixgbe_hw *); +static void ixgbe_get_slot_info(struct adapter *); static int ixgbe_allocate_msix(struct adapter *); static int ixgbe_allocate_legacy(struct adapter *); static int ixgbe_setup_msix(struct adapter *); @@ -142,7 +140,6 @@ static void ixgbe_config_gpie(struct ada static void ixgbe_config_dmac(struct adapter *); static void ixgbe_config_delay_values(struct adapter *); static void ixgbe_config_link(struct adapter *); -static void ixgbe_check_eee_support(struct adapter *); static void ixgbe_check_wol_support(struct adapter *); static int ixgbe_setup_low_power_mode(struct adapter *); static void ixgbe_rearm_queues(struct adapter *, u64); @@ -151,6 +148,7 @@ static void ixgbe_initialize_transmi static void ixgbe_initialize_receive_units(struct adapter *); static void ixgbe_enable_rx_drop(struct adapter *); static void ixgbe_disable_rx_drop(struct adapter *); +static void ixgbe_initialize_rss_mapping(struct adapter *); static void ixgbe_enable_intr(struct adapter *); static void ixgbe_disable_intr(struct adapter *); @@ -171,19 +169,24 @@ static void ixgbe_add_hw_stats(struc /* Sysctl handlers */ static void ixgbe_set_sysctl_value(struct adapter *, const char *, - const char *, int *, int); + const char *, int *, int); static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS); static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_thermal_test(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_dmac(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_phy_temp(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_phy_overtemp_occurred(SYSCTL_HANDLER_ARGS); +#ifdef IXGBE_DEBUG +static int ixgbe_sysctl_power_state(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_print_rss_config(SYSCTL_HANDLER_ARGS); +#endif static int ixgbe_sysctl_wol_enable(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_wufc(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_eee_enable(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_eee_negotiated(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_eee_rx_lpi_status(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_eee_tx_lpi_status(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_eee_tx_lpi_delay(SYSCTL_HANDLER_ARGS); /* Support for pluggable optic modules */ static bool ixgbe_sfp_probe(struct adapter *); @@ -439,7 +442,7 @@ ixgbe_attach(device_t dev) /* Allocate, clear, and link in our adapter structure */ adapter = device_get_softc(dev); - adapter->dev = adapter->osdep.dev = dev; + adapter->dev = dev; hw = &adapter->hw; #ifdef DEV_NETMAP @@ -529,18 +532,18 @@ ixgbe_attach(device_t dev) adapter->sfp_probe = TRUE; error = 0; } else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) { - device_printf(dev,"Unsupported SFP+ module detected!\n"); + device_printf(dev, "Unsupported SFP+ module detected!\n"); error = EIO; goto err_late; } else if (error) { - device_printf(dev,"Unable to initialize the shared code\n"); + device_printf(dev, "Unable to initialize the shared code\n"); error = EIO; goto err_late; } /* Make sure we have a good EEPROM before we read from it */ if (ixgbe_validate_eeprom_checksum(&adapter->hw, &csum) < 0) { - device_printf(dev,"The EEPROM Checksum Is Not Valid\n"); + device_printf(dev, "The EEPROM Checksum Is Not Valid\n"); error = EIO; goto err_late; } @@ -550,24 +553,21 @@ ixgbe_attach(device_t dev) case IXGBE_ERR_EEPROM_VERSION: device_printf(dev, "This device is a pre-production adapter/" "LOM. Please be aware there may be issues associated " - "with your hardware.\n If you are experiencing problems " + "with your hardware.\nIf you are experiencing problems " "please contact your Intel or hardware representative " "who provided you with this hardware.\n"); break; case IXGBE_ERR_SFP_NOT_SUPPORTED: - device_printf(dev,"Unsupported SFP+ Module\n"); + device_printf(dev, "Unsupported SFP+ Module\n"); error = EIO; goto err_late; case IXGBE_ERR_SFP_NOT_PRESENT: - device_printf(dev,"No SFP+ Module found\n"); + device_printf(dev, "No SFP+ Module found\n"); /* falls thru */ default: break; } - /* Detect and set physical type */ - ixgbe_setup_optics(adapter); - if ((adapter->msix > 1) && (ixgbe_enable_msix)) error = ixgbe_allocate_msix(adapter); else @@ -589,11 +589,12 @@ ixgbe_attach(device_t dev) ixgbe_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); /* Check PCIE slot type/speed/width */ - ixgbe_get_slot_info(hw); + ixgbe_get_slot_info(adapter); - - /* Set an initial default flow control value */ + /* Set an initial default flow control & dmac value */ adapter->fc = ixgbe_fc_full; + adapter->dmac = 0; + adapter->eee_enabled = 0; #ifdef PCI_IOV if ((hw->mac.type != ixgbe_mac_82598EB) && (adapter->msix > 1)) { @@ -619,7 +620,6 @@ ixgbe_attach(device_t dev) /* Check for certain supported features */ ixgbe_check_wol_support(adapter); - ixgbe_check_eee_support(adapter); /* Add sysctls */ ixgbe_add_device_sysctls(adapter); @@ -680,6 +680,7 @@ ixgbe_detach(device_t dev) } #endif /* PCI_IOV */ + ether_ifdetach(adapter->ifp); /* Stop the adapter */ IXGBE_CORE_LOCK(adapter); ixgbe_setup_low_power_mode(adapter); @@ -721,7 +722,6 @@ ixgbe_detach(device_t dev) if (adapter->vlan_detach != NULL) EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach); - ether_ifdetach(adapter->ifp); callout_drain(&adapter->timer); #ifdef DEV_NETMAP netmap_detach(adapter->ifp); @@ -776,10 +776,6 @@ ixgbe_suspend(device_t dev) error = ixgbe_setup_low_power_mode(adapter); - /* Save state and power down */ - pci_save_state(dev); - pci_set_powerstate(dev, PCI_POWERSTATE_D3); - IXGBE_CORE_UNLOCK(adapter); return (error); @@ -797,9 +793,6 @@ ixgbe_resume(device_t dev) IXGBE_CORE_LOCK(adapter); - pci_set_powerstate(dev, PCI_POWERSTATE_D0); - pci_restore_state(dev); - /* Read & clear WUS register */ wus = IXGBE_READ_REG(hw, IXGBE_WUS); if (wus) @@ -818,7 +811,6 @@ ixgbe_resume(device_t dev) IXGBE_CORE_UNLOCK(adapter); - INIT_DEBUGOUT("ixgbe_resume: end"); return (0); } @@ -862,7 +854,7 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_flags |= IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) ixgbe_init(adapter); -#if defined(INET) +#ifdef INET if (!(ifp->if_flags & IFF_NOARP)) arp_ifinit(ifp, ifa); #endif @@ -920,10 +912,21 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c break; case SIOCSIFCAP: { - int mask = ifr->ifr_reqcap ^ ifp->if_capenable; IOCTL_DEBUGOUT("ioctl: SIOCSIFCAP (Set Capabilities)"); - if (mask & IFCAP_HWCSUM) - ifp->if_capenable ^= IFCAP_HWCSUM; + + int mask = ifr->ifr_reqcap ^ ifp->if_capenable; + if (!mask) + break; + + /* HW cannot turn these on/off separately */ + if (mask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { + ifp->if_capenable ^= IFCAP_RXCSUM; + ifp->if_capenable ^= IFCAP_RXCSUM_IPV6; + } + if (mask & IFCAP_TXCSUM) + ifp->if_capenable ^= IFCAP_TXCSUM; + if (mask & IFCAP_TXCSUM_IPV6) + ifp->if_capenable ^= IFCAP_TXCSUM_IPV6; if (mask & IFCAP_TSO4) ifp->if_capenable ^= IFCAP_TSO4; if (mask & IFCAP_TSO6) @@ -936,6 +939,7 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_capenable ^= IFCAP_VLAN_HWFILTER; if (mask & IFCAP_VLAN_HWTSO) ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { IXGBE_CORE_LOCK(adapter); ixgbe_init_locked(adapter); @@ -979,6 +983,42 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c return (error); } +/* + * Set the various hardware offload abilities. + * + * This takes the ifnet's if_capenable flags (e.g. set by the user using + * ifconfig) and indicates to the OS via the ifnet's if_hwassist field what + * mbuf offload flags the driver will understand. + */ +static void +ixgbe_set_if_hwassist(struct adapter *adapter) +{ + struct ifnet *ifp = adapter->ifp; + + ifp->if_hwassist = 0; +#if __FreeBSD_version >= 1000000 + if (ifp->if_capenable & IFCAP_TSO4) + ifp->if_hwassist |= CSUM_IP_TSO; + if (ifp->if_capenable & IFCAP_TSO6) + ifp->if_hwassist |= CSUM_IP6_TSO; + if (ifp->if_capenable & IFCAP_TXCSUM) + ifp->if_hwassist |= (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP | + CSUM_IP_SCTP); + if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) + ifp->if_hwassist |= (CSUM_IP6_UDP | CSUM_IP6_TCP | + CSUM_IP6_SCTP); +#else + if (ifp->if_capenable & IFCAP_TSO) + ifp->if_hwassist |= CSUM_TSO; + if (ifp->if_capenable & IFCAP_TXCSUM) { + ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); + struct ixgbe_hw *hw = &adapter->hw; + if (hw->mac.type != ixgbe_mac_82598EB) + ifp->if_hwassist |= CSUM_SCTP; + } +#endif +} + /********************************************************************* * Init entry point * @@ -1001,6 +1041,7 @@ ixgbe_init_locked(struct adapter *adapte struct rx_ring *rxr; u32 txdctl, mhadd; u32 rxdctl, rxctrl; + int err = 0; #ifdef PCI_IOV enum ixgbe_iov_mode mode; #endif @@ -1029,17 +1070,8 @@ ixgbe_init_locked(struct adapter *adapte ixgbe_set_rar(hw, 0, hw->mac.addr, adapter->pool, 1); hw->addr_ctrl.rar_used_count = 1; - /* Set the various hardware offload abilities */ - ifp->if_hwassist = 0; - if (ifp->if_capenable & IFCAP_TSO) - ifp->if_hwassist |= CSUM_TSO; - if (ifp->if_capenable & IFCAP_TXCSUM) { - ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); -#if __FreeBSD_version >= 800000 - if (hw->mac.type != ixgbe_mac_82598EB) - ifp->if_hwassist |= CSUM_SCTP; -#endif - } + /* Set hardware offload abilities from ifnet flags */ + ixgbe_set_if_hwassist(adapter); /* Prepare transmit descriptors and buffers */ if (ixgbe_setup_transmit_structures(adapter)) { @@ -1057,10 +1089,7 @@ ixgbe_init_locked(struct adapter *adapte /* Setup Multicast table */ ixgbe_set_multi(adapter); - /* - ** Determine the correct mbuf pool - ** for doing jumbo frames - */ + /* Determine the correct mbuf pool, based on frame size */ if (adapter->max_frame_size <= MCLBYTES) adapter->rx_mbuf_sz = MCLBYTES; else @@ -1196,7 +1225,7 @@ ixgbe_init_locked(struct adapter *adapte * need to be kick-started */ if (hw->phy.type == ixgbe_phy_none) { - int err = hw->phy.ops.identify(hw); + err = hw->phy.ops.identify(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Unsupported SFP+ module type was detected.\n"); @@ -1208,7 +1237,11 @@ ixgbe_init_locked(struct adapter *adapte IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->vector), IXGBE_LINK_ITR); /* Configure Energy Efficient Ethernet for supported devices */ - ixgbe_setup_eee(hw, adapter->eee_enabled); + if (hw->mac.ops.setup_eee) { + err = hw->mac.ops.setup_eee(hw, adapter->eee_enabled); + if (err) + device_printf(dev, "Error setting up EEE: %d\n", err); + } /* Config/Enable Link */ ixgbe_config_link(adapter); @@ -1278,7 +1311,7 @@ ixgbe_config_gpie(struct adapter *adapte /* * Thermal Failure Detection (X540) - * Link Detection (X557) + * Link Detection (X552 SFP+, X552/X557-AT) */ if (hw->mac.type == ixgbe_mac_X540 || hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP || @@ -1586,6 +1619,9 @@ ixgbe_msix_link(void *arg) ++adapter->link_irq; + /* Pause other interrupts */ + IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_OTHER); + /* First get the cause */ reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICS); /* Be sure the queue bits are not cleared */ @@ -1594,8 +1630,10 @@ ixgbe_msix_link(void *arg) IXGBE_WRITE_REG(hw, IXGBE_EICR, reg_eicr); /* Link status change */ - if (reg_eicr & IXGBE_EICR_LSC) + if (reg_eicr & IXGBE_EICR_LSC) { + IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_EIMC_LSC); taskqueue_enqueue(adapter->tq, &adapter->link_task); + } if (adapter->hw.mac.type != ixgbe_mac_82598EB) { #ifdef IXGBE_FDIR @@ -1609,14 +1647,14 @@ ixgbe_msix_link(void *arg) } else #endif if (reg_eicr & IXGBE_EICR_ECC) { - device_printf(adapter->dev, "\nCRITICAL: ECC ERROR!! " + device_printf(adapter->dev, "CRITICAL: ECC ERROR!! " "Please Reboot!!\n"); IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_ECC); } /* Check for over temp condition */ if (reg_eicr & IXGBE_EICR_TS) { - device_printf(adapter->dev, "\nCRITICAL: OVER TEMP!! " + device_printf(adapter->dev, "CRITICAL: OVER TEMP!! " "PHY IS SHUT DOWN!!\n"); device_printf(adapter->dev, "System shutdown required!\n"); IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_TS); @@ -1658,6 +1696,7 @@ ixgbe_msix_link(void *arg) taskqueue_enqueue(adapter->tq, &adapter->phy_task); } + /* Re-enable other interrupts */ IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_OTHER); return; } @@ -1751,6 +1790,7 @@ ixgbe_media_status(struct ifnet * ifp, s ** XXX: These need to use the proper media types once ** they're added. */ +#ifndef IFM_ETH_XTYPE if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) switch (adapter->link_speed) { case IXGBE_LINK_SPEED_10GB_FULL: @@ -1776,6 +1816,33 @@ ixgbe_media_status(struct ifnet * ifp, s ifmr->ifm_active |= IFM_1000_CX | IFM_FDX; break; } +#else + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) + switch (adapter->link_speed) { + case IXGBE_LINK_SPEED_10GB_FULL: + ifmr->ifm_active |= IFM_10G_KR | IFM_FDX; + break; + case IXGBE_LINK_SPEED_2_5GB_FULL: + ifmr->ifm_active |= IFM_2500_KX | IFM_FDX; + break; + case IXGBE_LINK_SPEED_1GB_FULL: + ifmr->ifm_active |= IFM_1000_KX | IFM_FDX; + break; + } + else if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4 + || layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX) + switch (adapter->link_speed) { + case IXGBE_LINK_SPEED_10GB_FULL: + ifmr->ifm_active |= IFM_10G_KX4 | IFM_FDX; + break; + case IXGBE_LINK_SPEED_2_5GB_FULL: + ifmr->ifm_active |= IFM_2500_KX | IFM_FDX; + break; + case IXGBE_LINK_SPEED_1GB_FULL: + ifmr->ifm_active |= IFM_1000_KX | IFM_FDX; + break; + } +#endif /* If nothing is recognized... */ if (IFM_SUBTYPE(ifmr->ifm_active) == 0) @@ -1818,13 +1885,14 @@ ixgbe_media_change(struct ifnet * ifp) return (EINVAL); if (hw->phy.media_type == ixgbe_media_type_backplane) - return (EPERM); + return (ENODEV); /* ** We don't actually need to check against the supported ** media types of the adapter; ifmedia will take care of ** that for us. */ +#ifndef IFM_ETH_XTYPE switch (IFM_SUBTYPE(ifm->ifm_media)) { case IFM_AUTO: case IFM_10G_T: @@ -1850,6 +1918,33 @@ ixgbe_media_change(struct ifnet * ifp) default: goto invalid; } +#else + switch (IFM_SUBTYPE(ifm->ifm_media)) { + case IFM_AUTO: + case IFM_10G_T: + speed |= IXGBE_LINK_SPEED_100_FULL; + case IFM_10G_LRM: + case IFM_10G_KR: + case IFM_10G_LR: + case IFM_10G_KX4: + speed |= IXGBE_LINK_SPEED_1GB_FULL; + case IFM_10G_TWINAX: + speed |= IXGBE_LINK_SPEED_10GB_FULL; + break; + case IFM_1000_T: + speed |= IXGBE_LINK_SPEED_100_FULL; + case IFM_1000_LX: + case IFM_1000_SX: + case IFM_1000_KX: + speed |= IXGBE_LINK_SPEED_1GB_FULL; + break; + case IFM_100_TX: + speed |= IXGBE_LINK_SPEED_100_FULL; + break; + default: + goto invalid; + } +#endif hw->mac.autotry_restart = TRUE; hw->mac.ops.setup_link(hw, speed, TRUE); @@ -2384,7 +2479,7 @@ ixgbe_allocate_msix(struct adapter *adap return (error); } #if __FreeBSD_version >= 800504 - bus_describe_intr(dev, que->res, que->tag, "que %d", i); + bus_describe_intr(dev, que->res, que->tag, "q%d", i); #endif que->msix = vector; adapter->active_queues |= (u64)(1 << que->msix); @@ -2435,8 +2530,8 @@ ixgbe_allocate_msix(struct adapter *adap device_get_nameunit(adapter->dev), cpu_id); #else - taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que", - device_get_nameunit(adapter->dev)); + taskqueue_start_threads(&que->tq, 1, PI_NET, "%s:q%d", + device_get_nameunit(adapter->dev), i); #endif } @@ -2514,7 +2609,7 @@ ixgbe_setup_msix(struct adapter *adapter } /* Figure out a reasonable auto config value */ - queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; + queues = (mp_ncpus > (msgs - 1)) ? (msgs - 1) : mp_ncpus; #ifdef RSS /* If we're doing RSS, clamp at the number of RSS buckets */ @@ -2524,6 +2619,9 @@ ixgbe_setup_msix(struct adapter *adapter if (ixgbe_num_queues != 0) queues = ixgbe_num_queues; + /* Set max queues to 8 when autoconfiguring */ + else if ((ixgbe_num_queues == 0) && (queues > 8)) + queues = 8; /* reflect correct sysctl value */ ixgbe_num_queues = queues; @@ -2560,12 +2658,12 @@ msi: rid, adapter->msix_mem); adapter->msix_mem = NULL; } - msgs = 1; - if (pci_alloc_msi(dev, &msgs) == 0) { - device_printf(adapter->dev,"Using an MSI interrupt\n"); + msgs = 1; + if (pci_alloc_msi(dev, &msgs) == 0) { + device_printf(adapter->dev, "Using an MSI interrupt\n"); return (msgs); } - device_printf(adapter->dev,"Using a Legacy interrupt\n"); + device_printf(adapter->dev, "Using a Legacy interrupt\n"); return (0); } @@ -2581,22 +2679,24 @@ ixgbe_allocate_pci_resources(struct adap &rid, RF_ACTIVE); if (!(adapter->pci_mem)) { - device_printf(dev,"Unable to allocate bus resource: memory\n"); + device_printf(dev, "Unable to allocate bus resource: memory\n"); return (ENXIO); } + /* Save bus_space values for READ/WRITE_REG macros */ adapter->osdep.mem_bus_space_tag = rman_get_bustag(adapter->pci_mem); adapter->osdep.mem_bus_space_handle = rman_get_bushandle(adapter->pci_mem); + /* Set hw values for shared code */ adapter->hw.hw_addr = (u8 *) &adapter->osdep.mem_bus_space_handle; + adapter->hw.back = adapter; - /* Legacy defaults */ + /* Default to 1 queue if MSI-X setup fails */ adapter->num_queues = 1; - adapter->hw.back = &adapter->osdep; /* - ** Now setup MSI or MSI/X, should + ** Now setup MSI or MSI-X, should ** return us the number of supported ** vectors. (Will be 1 for MSI) */ @@ -2721,13 +2821,22 @@ ixgbe_setup_interface(device_t dev, stru */ ifp->if_hdrlen = sizeof(struct ether_vlan_header); - ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO | IFCAP_VLAN_HWCSUM; - ifp->if_capabilities |= IFCAP_JUMBO_MTU; - ifp->if_capabilities |= IFCAP_LRO; - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING + /* Set capability flags */ + ifp->if_capabilities |= IFCAP_RXCSUM + | IFCAP_TXCSUM + | IFCAP_RXCSUM_IPV6 + | IFCAP_TXCSUM_IPV6 + | IFCAP_TSO4 + | IFCAP_TSO6 + | IFCAP_LRO + | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO + | IFCAP_VLAN_HWCSUM + | IFCAP_JUMBO_MTU | IFCAP_VLAN_MTU | IFCAP_HWSTATS; + + /* Enable the above capabilities by default */ ifp->if_capenable = ifp->if_capabilities; /* @@ -2747,9 +2856,10 @@ ixgbe_setup_interface(device_t dev, stru ifmedia_init(&adapter->media, IFM_IMASK, ixgbe_media_change, ixgbe_media_status); + adapter->phy_layer = ixgbe_get_supported_physical_layer(&adapter->hw); ixgbe_add_media_types(adapter); - /* Autoselect media by default */ + /* Set autoselect media by default */ ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO); return (0); @@ -2762,7 +2872,7 @@ ixgbe_add_media_types(struct adapter *ad device_t dev = adapter->dev; int layer; - layer = adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); + layer = adapter->phy_layer; /* Media types with matching FreeBSD media defines */ if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) @@ -2776,20 +2886,28 @@ ixgbe_add_media_types(struct adapter *ad layer & IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA) ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL); - if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_LR) + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_LR) { ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_LR, 0, NULL); - if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_SR) + if (hw->phy.multispeed_fiber) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_LX, 0, NULL); + } + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_SR) { ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_SR, 0, NULL); + if (hw->phy.multispeed_fiber) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_SX, 0, NULL); + } else if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_SX) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_SX, 0, NULL); if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_CX4) ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_CX4, 0, NULL); - if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_SX) - ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_SX, 0, NULL); - /* - ** Other (no matching FreeBSD media type): - ** To workaround this, we'll assign these completely - ** inappropriate media types. - */ +#ifdef IFM_ETH_XTYPE + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_KR, 0, NULL); + if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_10G_KX4, 0, NULL); + if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_KX) + ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_KX, 0, NULL); +#else if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) { device_printf(dev, "Media supported: 10GbaseKR\n"); device_printf(dev, "10GbaseKR mapped to 10GbaseSR\n"); @@ -2805,10 +2923,9 @@ ixgbe_add_media_types(struct adapter *ad device_printf(dev, "1000baseKX mapped to 1000baseCX\n"); ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_CX, 0, NULL); } - if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_BX) { - /* Someday, someone will care about you... */ +#endif + if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_BX) device_printf(dev, "Media supported: 1000baseBX\n"); - } if (hw->device_id == IXGBE_DEV_ID_82598AT) { ifmedia_add(&adapter->media, @@ -2869,7 +2986,6 @@ ixgbe_initialize_transmit_units(struct a struct ixgbe_hw *hw = &adapter->hw; /* Setup the Base and Length of the Tx Descriptor Ring */ - for (int i = 0; i < adapter->num_queues; i++, txr++) { u64 tdba = txr->txdma.dma_paddr; u32 txctrl = 0; @@ -2889,12 +3005,15 @@ ixgbe_initialize_transmit_units(struct a txr->tail = IXGBE_TDT(j); /* Disable Head Writeback */ + /* + * Note: for X550 series devices, these registers are actually + * prefixed with TPH_ isntead of DCA_, but the addresses and + * fields remain the same. + */ switch (hw->mac.type) { case ixgbe_mac_82598EB: txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(j)); break; - case ixgbe_mac_82599EB: - case ixgbe_mac_X540: default: txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(j)); break; @@ -2904,8 +3023,6 @@ ixgbe_initialize_transmit_units(struct a case ixgbe_mac_82598EB: IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(j), txctrl); break; - case ixgbe_mac_82599EB: - case ixgbe_mac_X540: default: IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(j), txctrl); break; @@ -2938,7 +3055,7 @@ ixgbe_initialize_transmit_units(struct a } static void -ixgbe_initialise_rss_mapping(struct adapter *adapter) +ixgbe_initialize_rss_mapping(struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; u32 reta = 0, mrqc, rss_key[10]; @@ -3073,7 +3190,6 @@ ixgbe_initialize_receive_units(struct ad u32 bufsz, fctrl, srrctl, rxcsum; u32 hlreg; - /* * Make sure receives are disabled while * setting up the descriptor ring @@ -3158,7 +3274,7 @@ ixgbe_initialize_receive_units(struct ad rxcsum = IXGBE_READ_REG(hw, IXGBE_RXCSUM); - ixgbe_initialise_rss_mapping(adapter); + ixgbe_initialize_rss_mapping(adapter); if (adapter->num_queues > 1) { /* RSS and RX IPP Checksum are mutually exclusive */ @@ -3168,6 +3284,7 @@ ixgbe_initialize_receive_units(struct ad if (ifp->if_capenable & IFCAP_RXCSUM) rxcsum |= IXGBE_RXCSUM_PCSD; + /* This is useful for calculating UDP/IP fragment checksums */ if (!(rxcsum & IXGBE_RXCSUM_PCSD)) rxcsum |= IXGBE_RXCSUM_IPPCSE; @@ -3389,9 +3506,10 @@ ixgbe_disable_intr(struct adapter *adapt ** the slot this adapter is plugged into. */ static void -ixgbe_get_slot_info(struct ixgbe_hw *hw) +ixgbe_get_slot_info(struct adapter *adapter) { - device_t dev = ((struct ixgbe_osdep *)hw->back)->dev; + device_t dev = adapter->dev; + struct ixgbe_hw *hw = &adapter->hw; struct ixgbe_mac_info *mac = &hw->mac; u16 link; u32 offset; @@ -3598,12 +3716,12 @@ ixgbe_sfp_probe(struct adapter *adapter) goto out; ret = hw->phy.ops.reset(hw); if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { - device_printf(dev,"Unsupported SFP+ module detected!"); - printf(" Reload driver with supported module.\n"); + device_printf(dev, "Unsupported SFP+ module detected!"); + device_printf(dev, "Reload driver with supported module.\n"); adapter->sfp_probe = FALSE; goto out; } else - device_printf(dev,"SFP+ module detected!\n"); + device_printf(dev, "SFP+ module detected!\n"); /* We now have supported optics */ adapter->sfp_probe = FALSE; /* Set the optics type so system reports correctly */ @@ -3622,10 +3740,14 @@ static void ixgbe_handle_link(void *context, int pending) { struct adapter *adapter = context; + struct ixgbe_hw *hw = &adapter->hw; - ixgbe_check_link(&adapter->hw, + ixgbe_check_link(hw, &adapter->link_speed, &adapter->link_up, 0); ixgbe_update_link_status(adapter); + + /* Re-enable link interrupts */ + IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_LSC); } /* @@ -3667,13 +3789,9 @@ ixgbe_handle_msf(void *context, int pend struct ixgbe_hw *hw = &adapter->hw; u32 autoneg; bool negotiate; - int err; - err = hw->phy.ops.identify_sfp(hw); - if (!err) { - ixgbe_setup_optics(adapter); - INIT_DEBUGOUT1("ixgbe_sfp_probe: flags: %X\n", adapter->optics); - } + /* get_supported_phy_layer will call hw->phy.ops.identify_sfp() */ + adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); autoneg = hw->phy.autoneg_advertised; if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) @@ -3681,6 +3799,7 @@ ixgbe_handle_msf(void *context, int pend if (hw->mac.ops.setup_link) hw->mac.ops.setup_link(hw, autoneg, TRUE); + /* Adjust media types shown in ifconfig */ ifmedia_removeall(&adapter->media); ixgbe_add_media_types(adapter); return; @@ -3760,18 +3879,6 @@ ixgbe_config_dmac(struct adapter *adapte } /* - * Checks whether the adapter supports Energy Efficient Ethernet - * or not, based on device ID. - */ -static void -ixgbe_check_eee_support(struct adapter *adapter) -{ - struct ixgbe_hw *hw = &adapter->hw; - - adapter->eee_enabled = !!(hw->mac.ops.setup_eee); -} - -/* * Checks whether the adapter's ports are capable of * Wake On LAN by reading the adapter's NVM. * @@ -3789,8 +3896,8 @@ ixgbe_check_wol_support(struct adapter * ixgbe_get_device_caps(hw, &dev_caps); if ((dev_caps & IXGBE_DEVICE_CAPS_WOL_PORT0_1) || ((dev_caps & IXGBE_DEVICE_CAPS_WOL_PORT0) && - hw->bus.func == 0)) - adapter->wol_support = hw->wol_enabled = 1; + hw->bus.func == 0)) + adapter->wol_support = hw->wol_enabled = 1; /* Save initial wake up filter configuration */ adapter->wufc = IXGBE_READ_REG(hw, IXGBE_WUFC); @@ -4137,14 +4244,24 @@ ixgbe_add_device_sysctls(struct adapter CTLTYPE_INT | CTLFLAG_RW, adapter, 0, ixgbe_sysctl_thermal_test, "I", "Thermal Test"); - /* for X550 devices */ +#ifdef IXGBE_DEBUG + /* testing sysctls (for all devices) */ + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "power_state", + CTLTYPE_INT | CTLFLAG_RW, adapter, 0, + ixgbe_sysctl_power_state, "I", "PCI Power State"); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "print_rss_config", + CTLTYPE_STRING | CTLFLAG_RD, adapter, 0, + ixgbe_sysctl_print_rss_config, "A", "Prints RSS Configuration"); +#endif + /* for X550 series devices */ if (hw->mac.type >= ixgbe_mac_X550) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "dmac", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, ixgbe_sysctl_dmac, "I", "DMA Coalesce"); - /* for X550T and X550EM backplane devices */ - if (hw->mac.ops.setup_eee) { + /* for X552 backplane devices */ + if (hw->device_id == IXGBE_DEV_ID_X550EM_X_KR) { struct sysctl_oid *eee_node; struct sysctl_oid_list *eee_list; @@ -4172,11 +4289,15 @@ ixgbe_add_device_sysctls(struct adapter CTLTYPE_INT | CTLFLAG_RD, adapter, 0, ixgbe_sysctl_eee_rx_lpi_status, "I", "Whether or not RX link is in LPI state"); + + SYSCTL_ADD_PROC(ctx, eee_list, OID_AUTO, "tx_lpi_delay", + CTLTYPE_INT | CTLFLAG_RD, adapter, 0, + ixgbe_sysctl_eee_tx_lpi_delay, "I", + "TX LPI entry delay in microseconds"); } - /* for certain 10GBaseT devices */ - if (hw->device_id == IXGBE_DEV_ID_X550T || - hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) { + /* for WoL-capable devices */ + if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) { SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "wol_enable", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, ixgbe_sysctl_wol_enable, "I", @@ -4188,7 +4309,7 @@ ixgbe_add_device_sysctls(struct adapter "Enable/Disable Wake Up Filters"); } - /* for X550EM 10GBaseT devices */ + /* for X552/X557-AT devices */ if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) { struct sysctl_oid *phy_node; struct sysctl_oid_list *phy_list; @@ -4544,6 +4665,10 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) if ((error) || (req->newptr == NULL)) return (error); + /* No speed changes for backplane media */ + if (hw->phy.media_type == ixgbe_media_type_backplane) + return (ENODEV); + /* Checks to validate new value */ if (adapter->advertise == requested) /* no change */ return (0); @@ -4585,7 +4710,7 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) } /* - * The following two sysctls are for X550 BaseT devices; + * The following two sysctls are for X552/X557-AT devices; * they deal with the external PHY used in them. */ static int @@ -4684,31 +4809,22 @@ static int ixgbe_sysctl_dmac(SYSCTL_HANDLER_ARGS) { struct adapter *adapter = (struct adapter *) arg1; - struct ixgbe_hw *hw = &adapter->hw; struct ifnet *ifp = adapter->ifp; int error; - u16 oldval; + u32 newval; - oldval = adapter->dmac; - error = sysctl_handle_int(oidp, &adapter->dmac, 0, req); + newval = adapter->dmac; + error = sysctl_handle_int(oidp, &newval, 0, req); if ((error) || (req->newptr == NULL)) return (error); - switch (hw->mac.type) { - case ixgbe_mac_X550: - case ixgbe_mac_X550EM_x: - break; - default: - device_printf(adapter->dev, - "DMA Coalescing is only supported on X550 devices\n"); - return (ENODEV); - } - - switch (adapter->dmac) { + switch (newval) { case 0: /* Disabled */ + adapter->dmac = 0; break; - case 1: /* Enable and use default */ + case 1: + /* Enable and use default */ adapter->dmac = 1000; break; case 50: @@ -4720,10 +4836,10 @@ ixgbe_sysctl_dmac(SYSCTL_HANDLER_ARGS) case 5000: case 10000: /* Legal values - allow */ + adapter->dmac = newval; break; default: /* Do nothing, illegal value */ - adapter->dmac = oldval; return (EINVAL); } @@ -4734,6 +4850,42 @@ ixgbe_sysctl_dmac(SYSCTL_HANDLER_ARGS) return (0); } +#ifdef IXGBE_DEBUG *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 24 00:58:12 2015 Return-Path: Delivered-To: svn-src-all@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 E8DA7A482F6; Thu, 24 Dec 2015 00:58:12 +0000 (UTC) (envelope-from jtl@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 B9E9517C1; Thu, 24 Dec 2015 00:58:12 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBO0wBLn043453; Thu, 24 Dec 2015 00:58:11 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBO0wBve043452; Thu, 24 Dec 2015 00:58:11 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201512240058.tBO0wBve043452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Thu, 24 Dec 2015 00:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292676 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 00:58:13 -0000 Author: jtl Date: Thu Dec 24 00:58:11 2015 New Revision: 292676 URL: https://svnweb.freebsd.org/changeset/base/292676 Log: Only allow one PT_INTERP ELF program header. This also fixes a potential memory leak for interp_buf. Differential Revision: https://reviews.freebsd.org/D4692 Reviewed by: kib MFC after: 2 weeks Sponsored by: Juniper Networks Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Wed Dec 23 23:35:32 2015 (r292675) +++ head/sys/kern/imgact_elf.c Thu Dec 24 00:58:11 2015 (r292676) @@ -799,6 +799,11 @@ __CONCAT(exec_, __elfN(imgact))(struct i error = ENOEXEC; goto ret; } + if (interp != NULL) { + uprintf("Multiple PT_INTERP headers\n"); + error = ENOEXEC; + goto ret; + } interp_name_len = phdr[i].p_filesz; if (phdr[i].p_offset > PAGE_SIZE || interp_name_len > PAGE_SIZE - phdr[i].p_offset) { From owner-svn-src-all@freebsd.org Thu Dec 24 01:48:42 2015 Return-Path: Delivered-To: svn-src-all@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 2A6DEA4E4CB; Thu, 24 Dec 2015 01:48: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 D607A1D6D; Thu, 24 Dec 2015 01:48:41 +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 tBO1mf8m057673; Thu, 24 Dec 2015 01:48:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBO1meQY057672; Thu, 24 Dec 2015 01:48:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512240148.tBO1meQY057672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 24 Dec 2015 01:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292677 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 01:48:42 -0000 Author: imp Date: Thu Dec 24 01:48:40 2015 New Revision: 292677 URL: https://svnweb.freebsd.org/changeset/base/292677 Log: Move creation of rc.conf to earlier so it winds up in /conf/boot/etc With this change we mostly boot w/o errors on RPi-B for an image cross built w/o privs. Other systems to follow. Release Notes: Yes Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Thu Dec 24 00:58:11 2015 (r292676) +++ head/tools/tools/nanobsd/embedded/common Thu Dec 24 01:48:40 2015 (r292677) @@ -431,6 +431,24 @@ $var=$val" fi done +typical_embedded ( ) ( + # Need to create rc.conf before we copy over /etc to /conf/base/etc + # so now's a good time. + + local rc=${NANO_WORLDDIR}/etc/rc.conf + + echo "hostname=nanobsd-${NANO_NAME}" > $rc + echo "growfs_enable=YES" >> $rc + echo "growfs_type=nanobsd-pingpong" >> $rc + echo "ntpdate_enable=YES" >> $rc + echo "ifconfig_DEFAULT=DHCP" >> $rc + echo "ntpdate_hosts=0.freebsd.pool.ntp.org 1.freebsd.pool.ntp.org" >> $rc + # Make sure that firstboot scripts run so growfs works. + # Note: still some issues remvoing this XXX + touch ${NANO_WORLDDIR}/firstboot +) +customize_cmd typical_embedded + save_build ( ) ( VERSION_FILE=${NANO_WORLDDIR}/etc/version if [ "${SVNREVISION}" = "${REVISION}" ]; then @@ -502,14 +520,6 @@ product_custom ( ) ( chown root:wheel ${NANO_WORLDDIR}/ chown root:wheel ${NANO_WORLDDIR}/usr fi - local rc=${NANO_WORLDDIR}/etc/rc.conf - echo "hostname=nanobsd-${NANO_NAME}" > $rc - echo "growfs_enable=YES" >> $rc - echo "growfs_type=nanobsd-pingpong" >> $rc - echo "ntpdate_enable=YES" >> $rc - echo "ntpdate_hosts=0.freebsd.pool.ntp.org 1.freebsd.pool.ntp.org" >> $rc - # Make sure that firstboot scripts run so growfs works. - touch ${NANO_WORLDDIR}/firstboot ) late_customize_cmd product_custom From owner-svn-src-all@freebsd.org Thu Dec 24 02:02:06 2015 Return-Path: Delivered-To: svn-src-all@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 ED341A4EAE2; Thu, 24 Dec 2015 02:02:06 +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 BED8F151B; Thu, 24 Dec 2015 02:02:06 +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 tBO225YH062705; Thu, 24 Dec 2015 02:02:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBO225pD062704; Thu, 24 Dec 2015 02:02:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512240202.tBO225pD062704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 24 Dec 2015 02:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292678 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 02:02:07 -0000 Author: imp Date: Thu Dec 24 02:02:05 2015 New Revision: 292678 URL: https://svnweb.freebsd.org/changeset/base/292678 Log: Add quotes to prevent syntax errors on boot. 1.freebsd.pool.ntp.org isn't a very popular command :) Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Thu Dec 24 01:48:40 2015 (r292677) +++ head/tools/tools/nanobsd/embedded/common Thu Dec 24 02:02:05 2015 (r292678) @@ -442,7 +442,7 @@ typical_embedded ( ) ( echo "growfs_type=nanobsd-pingpong" >> $rc echo "ntpdate_enable=YES" >> $rc echo "ifconfig_DEFAULT=DHCP" >> $rc - echo "ntpdate_hosts=0.freebsd.pool.ntp.org 1.freebsd.pool.ntp.org" >> $rc + echo "ntpdate_hosts='0.freebsd.pool.ntp.org 1.freebsd.pool.ntp.org'" >> $rc # Make sure that firstboot scripts run so growfs works. # Note: still some issues remvoing this XXX touch ${NANO_WORLDDIR}/firstboot From owner-svn-src-all@freebsd.org Thu Dec 24 02:36:00 2015 Return-Path: Delivered-To: svn-src-all@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 8D431A4F82B; Thu, 24 Dec 2015 02:36:00 +0000 (UTC) (envelope-from np@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 45FEB152B; Thu, 24 Dec 2015 02:36:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBO2ZxXK071899; Thu, 24 Dec 2015 02:35:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBO2ZxH3071898; Thu, 24 Dec 2015 02:35:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201512240235.tBO2ZxH3071898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 24 Dec 2015 02:35:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292679 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 02:36:00 -0000 Author: np Date: Thu Dec 24 02:35:59 2015 New Revision: 292679 URL: https://svnweb.freebsd.org/changeset/base/292679 Log: MFP r291227, r291228, and r292618. r291227: s/is->is_conn/ic to shorten things a bit. r291228: Do not generate PDUs with payload greater than max_data_segment_length. It is perhaps preferable to have a separate limit for send instead of reusing the receive limit. I'll discuss with trasz@ and mav@ before pulling this into head. r292618: Add comment to go with r291228. Modified: head/sys/dev/iscsi/iscsi.c Directory Properties: head/ (props changed) head/sys/ (props changed) Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Thu Dec 24 02:02:05 2015 (r292678) +++ head/sys/dev/iscsi/iscsi.c Thu Dec 24 02:35:59 2015 (r292679) @@ -1329,6 +1329,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ struct iscsi_daemon_handoff *handoff) { struct iscsi_session *is; + struct icl_conn *ic; int error; sx_slock(&sc->sc_lock); @@ -1345,6 +1346,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ return (ESRCH); } ISCSI_SESSION_LOCK(is); + ic = is->is_conn; if (is->is_conf.isc_discovery || is->is_terminating) { ISCSI_SESSION_UNLOCK(is); sx_sunlock(&sc->sc_lock); @@ -1369,18 +1371,24 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ is->is_statsn = handoff->idh_statsn; is->is_initial_r2t = handoff->idh_initial_r2t; is->is_immediate_data = handoff->idh_immediate_data; - is->is_max_data_segment_length = handoff->idh_max_data_segment_length; + + /* + * Cap MaxRecvDataSegmentLength obtained from the target to the maximum + * size supported by our ICL module. + */ + is->is_max_data_segment_length = min(ic->ic_max_data_segment_length, + handoff->idh_max_data_segment_length); is->is_max_burst_length = handoff->idh_max_burst_length; is->is_first_burst_length = handoff->idh_first_burst_length; if (handoff->idh_header_digest == ISCSI_DIGEST_CRC32C) - is->is_conn->ic_header_crc32c = true; + ic->ic_header_crc32c = true; else - is->is_conn->ic_header_crc32c = false; + ic->ic_header_crc32c = false; if (handoff->idh_data_digest == ISCSI_DIGEST_CRC32C) - is->is_conn->ic_data_crc32c = true; + ic->ic_data_crc32c = true; else - is->is_conn->ic_data_crc32c = false; + ic->ic_data_crc32c = false; is->is_cmdsn = 0; is->is_expcmdsn = 0; @@ -1399,7 +1407,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ /* * Handoff without using ICL proxy. */ - error = icl_conn_handoff(is->is_conn, handoff->idh_socket); + error = icl_conn_handoff(ic, handoff->idh_socket); if (error != 0) { sx_sunlock(&sc->sc_lock); iscsi_session_terminate(is); From owner-svn-src-all@freebsd.org Thu Dec 24 04:30:17 2015 Return-Path: Delivered-To: svn-src-all@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 49838A50A8F; Thu, 24 Dec 2015 04:30:17 +0000 (UTC) (envelope-from jhibbits@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 08FA41F28; Thu, 24 Dec 2015 04:30:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBO4UGXs004939; Thu, 24 Dec 2015 04:30:16 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBO4UFJx004929; Thu, 24 Dec 2015 04:30:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201512240430.tBO4UFJx004929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 24 Dec 2015 04:30:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292680 - in head/sys: powerpc/booke powerpc/include powerpc/ofw powerpc/powerpc sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 04:30:17 -0000 Author: jhibbits Date: Thu Dec 24 04:30:15 2015 New Revision: 292680 URL: https://svnweb.freebsd.org/changeset/base/292680 Log: Extend Book-E to support >4GB RAM Summary: With some additional changes for AIM, that could also support much larger physmem sizes. Given that 32-bit AIM is more or less obsolete, though, it's not worth it at this time. Differential Revision: https://reviews.freebsd.org/D4345 Modified: head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/param.h head/sys/powerpc/include/platform.h head/sys/powerpc/include/pmap.h head/sys/powerpc/ofw/ofw_machdep.c head/sys/powerpc/powerpc/machdep.c head/sys/powerpc/powerpc/platform.c head/sys/powerpc/powerpc/pmap_dispatch.c head/sys/sys/libkern.h Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Thu Dec 24 02:35:59 2015 (r292679) +++ head/sys/powerpc/booke/pmap.c Thu Dec 24 04:30:15 2015 (r292680) @@ -1024,12 +1024,13 @@ pte_find(mmu_t mmu, pmap_t pmap, vm_offs static void mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_offset_t kernelend) { - vm_offset_t phys_kernelend; + vm_paddr_t phys_kernelend; struct mem_region *mp, *mp1; int cnt, i, j; - u_int s, e, sz; + vm_paddr_t s, e, sz; + vm_paddr_t physsz, hwphyssz; u_int phys_avail_count; - vm_size_t physsz, hwphyssz, kstack0_sz; + vm_size_t kstack0_sz; vm_offset_t kernel_pdir, kstack0, va; vm_paddr_t kstack0_phys; void *dpcpu; @@ -1163,7 +1164,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset for (mp = availmem_regions; mp->mr_size; mp++) { s = mp->mr_start; e = mp->mr_start + mp->mr_size; - debugf(" %08x-%08x -> ", s, e); + debugf(" %09jx-%09jx -> ", (uintmax_t)s, (uintmax_t)e); /* Check whether this region holds all of the kernel. */ if (s < kernload && e > phys_kernelend) { availmem_regions[cnt].mr_start = phys_kernelend; @@ -1188,7 +1189,8 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset if (e < s) e = s; sz = e - s; - debugf("%08x-%08x = %x\n", s, e, sz); + debugf("%09jx-%09jx = %jx\n", + (uintmax_t)s, (uintmax_t)e, (uintmax_t)sz); /* Check whether some memory is left here. */ if (sz == 0) { @@ -1237,10 +1239,10 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset for (i = 0, j = 0; i < availmem_regions_sz; i++, j += 2) { debugf(" region: 0x%jx - 0x%jx (0x%jx)\n", - availmem_regions[i].mr_start, - availmem_regions[i].mr_start + + (uintmax_t)availmem_regions[i].mr_start, + (uintmax_t)availmem_regions[i].mr_start + availmem_regions[i].mr_size, - availmem_regions[i].mr_size); + (uintmax_t)availmem_regions[i].mr_size); if (hwphyssz != 0 && (physsz + availmem_regions[i].mr_size) >= hwphyssz) { Modified: head/sys/powerpc/include/param.h ============================================================================== --- head/sys/powerpc/include/param.h Thu Dec 24 02:35:59 2015 (r292679) +++ head/sys/powerpc/include/param.h Thu Dec 24 04:30:15 2015 (r292680) @@ -98,7 +98,7 @@ #define PAGE_SHIFT 12 #define PAGE_SIZE (1L << PAGE_SHIFT) /* Page size */ -#define PAGE_MASK (vm_offset_t)(PAGE_SIZE - 1) +#define PAGE_MASK (PAGE_SIZE - 1) #define NPTEPG (PAGE_SIZE/(sizeof (pt_entry_t))) #define MAXPAGESIZES 1 /* maximum number of supported page sizes */ @@ -116,15 +116,17 @@ /* * Mach derived conversion macros */ -#define trunc_page(x) ((unsigned long)(x) & ~(PAGE_MASK)) +#define trunc_page(x) ((x) & ~(PAGE_MASK)) #define round_page(x) (((x) + PAGE_MASK) & ~PAGE_MASK) -#define atop(x) ((unsigned long)(x) >> PAGE_SHIFT) -#define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT) +#define atop(x) ((x) >> PAGE_SHIFT) +#define ptoa(x) ((x) << PAGE_SHIFT) -#define powerpc_btop(x) ((unsigned long)(x) >> PAGE_SHIFT) -#define powerpc_ptob(x) ((unsigned long)(x) << PAGE_SHIFT) +#define powerpc_btop(x) ((x) >> PAGE_SHIFT) +#define powerpc_ptob(x) ((x) << PAGE_SHIFT) #define pgtok(x) ((x) * (PAGE_SIZE / 1024UL)) +#define btoc(x) ((vm_offset_t)(((x)+PAGE_MASK)>>PAGE_SHIFT)) + #endif /* !_POWERPC_INCLUDE_PARAM_H_ */ Modified: head/sys/powerpc/include/platform.h ============================================================================== --- head/sys/powerpc/include/platform.h Thu Dec 24 02:35:59 2015 (r292679) +++ head/sys/powerpc/include/platform.h Thu Dec 24 04:30:15 2015 (r292680) @@ -39,8 +39,8 @@ #include struct mem_region { - vm_offset_t mr_start; - vm_size_t mr_size; + uint64_t mr_start; + uint64_t mr_size; }; void mem_regions(struct mem_region **, int *, struct mem_region **, int *); Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Thu Dec 24 02:35:59 2015 (r292679) +++ head/sys/powerpc/include/pmap.h Thu Dec 24 04:30:15 2015 (r292680) @@ -250,7 +250,7 @@ boolean_t pmap_mmu_install(char *name, i * For more Ram increase the lmb or this value. */ -extern vm_offset_t phys_avail[PHYS_AVAIL_SZ]; +extern vm_paddr_t phys_avail[PHYS_AVAIL_SZ]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Thu Dec 24 02:35:59 2015 (r292679) +++ head/sys/powerpc/ofw/ofw_machdep.c Thu Dec 24 04:30:15 2015 (r292680) @@ -172,8 +172,8 @@ parse_ofw_memory(phandle_t node, const c i = 0; j = 0; while (i < sz/sizeof(cell_t)) { - #ifndef __powerpc64__ - /* On 32-bit PPC, ignore regions starting above 4 GB */ + #if !defined(__powerpc64__) && !defined(BOOKE) + /* On 32-bit PPC (OEA), ignore regions starting above 4 GB */ if (address_cells > 1 && OFmem[i] > 0) { i += address_cells + size_cells; continue; @@ -182,21 +182,18 @@ parse_ofw_memory(phandle_t node, const c output[j].mr_start = OFmem[i++]; if (address_cells == 2) { - #ifdef __powerpc64__ output[j].mr_start <<= 32; - #endif output[j].mr_start += OFmem[i++]; } output[j].mr_size = OFmem[i++]; if (size_cells == 2) { - #ifdef __powerpc64__ output[j].mr_size <<= 32; - #endif output[j].mr_size += OFmem[i++]; } - #ifndef __powerpc64__ + #if !defined(__powerpc64__) && !defined(BOOKE) + /* Book-E can support 36-bit addresses. */ /* * Check for memory regions extending above 32-bit * memory space, and restrict them to stay there. Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Thu Dec 24 02:35:59 2015 (r292679) +++ head/sys/powerpc/powerpc/machdep.c Thu Dec 24 04:30:15 2015 (r292680) @@ -176,8 +176,8 @@ cpu_startup(void *dummy) #ifdef PERFMON perfmon_init(); #endif - printf("real memory = %lu (%lu MB)\n", ptoa(physmem), - ptoa(physmem) / 1048576); + printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)physmem), + ptoa((uintmax_t)physmem) / 1048576); realmem = physmem; if (bootverbose) @@ -193,23 +193,25 @@ cpu_startup(void *dummy) printf("Physical memory chunk(s):\n"); for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { - vm_offset_t size1 = + vm_paddr_t size1 = phys_avail[indx + 1] - phys_avail[indx]; #ifdef __powerpc64__ - printf("0x%016lx - 0x%016lx, %ld bytes (%ld pages)\n", + printf("0x%016jx - 0x%016jx, %jd bytes (%jd pages)\n", #else - printf("0x%08x - 0x%08x, %u bytes (%lu pages)\n", + printf("0x%09jx - 0x%09jx, %ju bytes (%ju pages)\n", #endif - phys_avail[indx], phys_avail[indx + 1] - 1, size1, - size1 / PAGE_SIZE); + (uintmax_t)phys_avail[indx], + (uintmax_t)phys_avail[indx + 1] - 1, + (uintmax_t)size1, (uintmax_t)size1 / PAGE_SIZE); } } vm_ksubmap_init(&kmi); - printf("avail memory = %lu (%lu MB)\n", ptoa(vm_cnt.v_free_count), - ptoa(vm_cnt.v_free_count) / 1048576); + printf("avail memory = %ju (%ju MB)\n", + ptoa((uintmax_t)vm_cnt.v_free_count), + ptoa((uintmax_t)vm_cnt.v_free_count) / 1048576); /* * Set up buffers, so they can be used to read disk labels. Modified: head/sys/powerpc/powerpc/platform.c ============================================================================== --- head/sys/powerpc/powerpc/platform.c Thu Dec 24 02:35:59 2015 (r292679) +++ head/sys/powerpc/powerpc/platform.c Thu Dec 24 04:30:15 2015 (r292680) @@ -86,8 +86,8 @@ static void memr_merge(struct mem_region *from, struct mem_region *to) { vm_offset_t end; - end = ulmax(to->mr_start + to->mr_size, from->mr_start + from->mr_size); - to->mr_start = ulmin(from->mr_start, to->mr_start); + end = uqmax(to->mr_start + to->mr_size, from->mr_start + from->mr_size); + to->mr_start = uqmin(from->mr_start, to->mr_start); to->mr_size = end - to->mr_start; } Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Thu Dec 24 02:35:59 2015 (r292679) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Thu Dec 24 04:30:15 2015 (r292680) @@ -74,7 +74,7 @@ struct msgbuf *msgbufp; vm_offset_t msgbuf_phys; vm_offset_t kernel_vm_end; -vm_offset_t phys_avail[PHYS_AVAIL_SZ]; +vm_paddr_t phys_avail[PHYS_AVAIL_SZ]; vm_offset_t virtual_avail; vm_offset_t virtual_end; Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Thu Dec 24 02:35:59 2015 (r292679) +++ head/sys/sys/libkern.h Thu Dec 24 04:30:15 2015 (r292680) @@ -61,6 +61,8 @@ static __inline u_int max(u_int a, u_int static __inline u_int min(u_int a, u_int b) { return (a < b ? a : b); } static __inline quad_t qmax(quad_t a, quad_t b) { return (a > b ? a : b); } static __inline quad_t qmin(quad_t a, quad_t b) { return (a < b ? a : b); } +static __inline u_quad_t uqmax(u_quad_t a, u_quad_t b) { return (a > b ? a : b); } +static __inline u_quad_t uqmin(u_quad_t a, u_quad_t b) { return (a < b ? a : b); } static __inline u_long ulmax(u_long a, u_long b) { return (a > b ? a : b); } static __inline u_long ulmin(u_long a, u_long b) { return (a < b ? a : b); } static __inline off_t omax(off_t a, off_t b) { return (a > b ? a : b); } From owner-svn-src-all@freebsd.org Thu Dec 24 04:37:21 2015 Return-Path: Delivered-To: svn-src-all@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 10E09A50D25; Thu, 24 Dec 2015 04:37:21 +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 D4B071335; Thu, 24 Dec 2015 04:37:20 +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 tBO4bJ5l007649; Thu, 24 Dec 2015 04:37:19 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBO4bJb6007648; Thu, 24 Dec 2015 04:37:19 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512240437.tBO4bJb6007648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 24 Dec 2015 04:37:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292681 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 04:37:21 -0000 Author: adrian Date: Thu Dec 24 04:37:19 2015 New Revision: 292681 URL: https://svnweb.freebsd.org/changeset/base/292681 Log: Add missing \n. Otherwise you end up with: Cache info: picache_stride = 4096 picache_loopcount = 16 pdcache_stride = 4096 pdcache_loopcount = 8 cpu0: MIPS Technologies processor v80.150 MMU: Standard TLB, 32 entries (4K 16K 64K 256K 1M 16M 64M 256M pg sizes) L1 i-cache: 4 ways of 512 sets, 32 bytes per line L1 d-cache: 4 ways of 256 sets, 32 bytes per line L2 cache: disabled Config1=0xbee3519e Config2=0x80000000 Config3=0x2420 Tested: * MT7620 SoC Modified: head/sys/mips/mips/cpu.c Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Thu Dec 24 04:30:15 2015 (r292680) +++ head/sys/mips/mips/cpu.c Thu Dec 24 04:37:19 2015 (r292681) @@ -351,7 +351,7 @@ cpu_identify(void) printf(" L2 cache: "); if (cpuinfo.l2.dc_linesize == 0) { - printf("disabled"); + printf("disabled\n"); } else { printf("%d ways of %d sets, %d bytes per line, " "%d KiB total size\n", From owner-svn-src-all@freebsd.org Thu Dec 24 06:00:57 2015 Return-Path: Delivered-To: svn-src-all@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 DFB86A4F496; Thu, 24 Dec 2015 06:00:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC1541D2B; Thu, 24 Dec 2015 06:00:57 +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 bigwig.baldwin.cx (Postfix) with ESMTPSA id BD5C1B989; Thu, 24 Dec 2015 01:00:56 -0500 (EST) From: John Baldwin To: cem@freebsd.org Cc: Ravi Pokala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292528 - head/sys/x86/include Date: Wed, 23 Dec 2015 13:29:29 -0800 Message-ID: <19132903.CqPZ5E7ceZ@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201512210442.tBL4gw6T007629@repo.freebsd.org> <9D7D1132-ED42-4F37-BEFD-AD62FB6321C7@panasas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 24 Dec 2015 01:00:56 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 06:00:58 -0000 On Monday, December 21, 2015 01:41:35 PM Conrad Meyer wrote: > No, I didn't forget. AVX512VBMI is a flag in ECX > ("cpu_stdext_feature2") rather than EBX ("cpu_stdext_feature"), and > there aren't any macros for any of the ECX flags yet (PREFETCHWT1, > AVX512VBMI, PKU, and OSPKE). Might as well start on them? I would be tempted to just use CPU_STDEXT_foo for those as well. The standard ext leaf allows for multiple "banks" of feature registers, so I'm not sure CPU_STDEXT2_*, etc. will scale all that well. -- John Baldwin From owner-svn-src-all@freebsd.org Thu Dec 24 06:22:43 2015 Return-Path: Delivered-To: svn-src-all@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 4AE74A4FC13; Thu, 24 Dec 2015 06:22:43 +0000 (UTC) (envelope-from jhb@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 226DC18A3; Thu, 24 Dec 2015 06:22:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBO6MgVG039132; Thu, 24 Dec 2015 06:22:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBO6MgKZ039129; Thu, 24 Dec 2015 06:22:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512240622.tBO6MgKZ039129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 24 Dec 2015 06:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292682 - in head/sys/boot: i386/zfsboot pc98/boot2 pc98/libpc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 06:22:43 -0000 Author: jhb Date: Thu Dec 24 06:22:41 2015 New Revision: 292682 URL: https://svnweb.freebsd.org/changeset/base/292682 Log: Fix remaining direct tests of the carry flag in the v86 %eflags via a magic number to use V86_CY() instead. These should have been fixed as part of the cleanup in r226746 but were missed. The md5 sums of the object files were unchanged, so there should be no functional change. PR: 205424 Submitted by: Alexander Kuleshov MFC after: 1 week Modified: head/sys/boot/i386/zfsboot/zfsboot.c head/sys/boot/pc98/boot2/boot2.c head/sys/boot/pc98/libpc98/biosdisk.c Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Thu Dec 24 04:37:19 2015 (r292681) +++ head/sys/boot/i386/zfsboot/zfsboot.c Thu Dec 24 06:22:41 2015 (r292682) @@ -238,7 +238,7 @@ bios_getmem(void) v86.es = VTOPSEG(&smap); v86.edi = VTOPOFF(&smap); v86int(); - if ((v86.efl & 1) || (v86.eax != SMAP_SIG)) + if (V86_CY(v86.efl) || (v86.eax != SMAP_SIG)) break; /* look for a low-memory segment that's large enough */ if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && @@ -285,7 +285,7 @@ bios_getmem(void) v86.addr = 0x15; /* int 0x15 function 0xe801*/ v86.eax = 0xe801; v86int(); - if (!(v86.efl & 1)) { + if (!V86_CY(v86.efl)) { bios_extmem = ((v86.ecx & 0xffff) + ((v86.edx & 0xffff) * 64)) * 1024; } } @@ -320,7 +320,7 @@ int13probe(int drive) v86.edx = drive; v86int(); - if (!(v86.efl & 0x1) && /* carry clear */ + if (!V86_CY(v86.efl) && /* carry clear */ ((v86.edx & 0xff) != (drive & DRV_MASK))) { /* unit # OK */ if ((v86.ecx & 0x3f) == 0) { /* absurd sector size */ return(0); /* skip device */ Modified: head/sys/boot/pc98/boot2/boot2.c ============================================================================== --- head/sys/boot/pc98/boot2/boot2.c Thu Dec 24 04:37:19 2015 (r292681) +++ head/sys/boot/pc98/boot2/boot2.c Thu Dec 24 06:22:41 2015 (r292682) @@ -327,7 +327,7 @@ bd_getbigeom(int bunit) v86.addr = 0x1b; v86.eax = 0x8400 | unit; v86int(); - if (v86.efl & 0x1) + if (V86_CY(v86.efl)) return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */ return ((v86.ecx & 0xffff) << 16) | (v86.edx & 0xffff); } Modified: head/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- head/sys/boot/pc98/libpc98/biosdisk.c Thu Dec 24 04:37:19 2015 (r292681) +++ head/sys/boot/pc98/libpc98/biosdisk.c Thu Dec 24 06:22:41 2015 (r292682) @@ -824,7 +824,7 @@ bd_chs_io(struct open_disk *od, daddr_t v86.es = VTOPSEG(dest); v86.ebp = VTOPOFF(dest); v86int(); - return (v86.efl & 0x1); + return (V86_CY(v86.efl)); } static int @@ -959,7 +959,7 @@ bd_getgeom(struct open_disk *od) od->od_cyl = v86.ecx; od->od_hds = (v86.edx >> 8) & 0xff; od->od_sec = v86.edx & 0xff; - if (v86.efl & 0x1) + if (V86_CY(v86.efl)) return(1); } @@ -1010,7 +1010,7 @@ bd_getbigeom(int bunit) v86.addr = 0x1b; v86.eax = 0x8400 | unit; v86int(); - if (v86.efl & 0x1) + if (V86_CY(v86.efl)) return 0x4F020F; /* 1200KB FD C:80 H:2 S:15 */ return ((v86.ecx & 0xffff) << 16) | (v86.edx & 0xffff); } From owner-svn-src-all@freebsd.org Thu Dec 24 09:40:31 2015 Return-Path: Delivered-To: svn-src-all@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 EC724A4F81B; Thu, 24 Dec 2015 09:40:30 +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 AADC21833; Thu, 24 Dec 2015 09:40:30 +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 tBO9eTQn093783; Thu, 24 Dec 2015 09:40:29 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBO9eTeQ093781; Thu, 24 Dec 2015 09:40:29 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512240940.tBO9eTeQ093781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 24 Dec 2015 09:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292683 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 09:40:31 -0000 Author: andrew Date: Thu Dec 24 09:40:29 2015 New Revision: 292683 URL: https://svnweb.freebsd.org/changeset/base/292683 Log: Ads support to the xhci pci attachment to use MSI-X interrupts when available. As with MSI interrupts these can be disabled by setting hw.usb.xhci.msix to 0 in the loader. MSI-X interrupts are needed on some hardware, for example the Cavium ThunderX only supports them, and with this we don't fall back to polling. PR: 204378 Reviewed by: hselasky, jhb MFC after: 1 week (after r292669) Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D4698 Modified: head/sys/dev/usb/controller/xhci.h head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Thu Dec 24 06:22:41 2015 (r292682) +++ head/sys/dev/usb/controller/xhci.h Thu Dec 24 09:40:29 2015 (r292683) @@ -465,6 +465,7 @@ struct xhci_softc { struct usb_device *sc_devices[XHCI_MAX_DEVICES]; struct resource *sc_io_res; struct resource *sc_irq_res; + struct resource *sc_msix_res; void *sc_intr_hdl; bus_size_t sc_io_size; Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Thu Dec 24 06:22:41 2015 (r292682) +++ head/sys/dev/usb/controller/xhci_pci.c Thu Dec 24 09:40:29 2015 (r292683) @@ -148,6 +148,8 @@ xhci_pci_probe(device_t self) static int xhci_use_msi = 1; TUNABLE_INT("hw.usb.xhci.msi", &xhci_use_msi); +static int xhci_use_msix = 1; +TUNABLE_INT("hw.usb.xhci.msix", &xhci_use_msix); static void xhci_interrupt_poll(void *_sc) @@ -188,7 +190,7 @@ static int xhci_pci_attach(device_t self) { struct xhci_softc *sc = device_get_softc(self); - int count, err, rid; + int count, err, msix_table, rid; uint8_t usemsi = 1; uint8_t usedma32 = 0; @@ -240,7 +242,27 @@ xhci_pci_attach(device_t self) usb_callout_init_mtx(&sc->sc_callout, &sc->sc_bus.bus_mtx, 0); rid = 0; - if (xhci_use_msi && usemsi) { + if (xhci_use_msix && (msix_table = pci_msix_table_bar(self)) >= 0) { + sc->sc_msix_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, + &msix_table, RF_ACTIVE); + if (sc->sc_msix_res == NULL) { + /* May not be enabled */ + device_printf(self, + "Unable to map MSI-X table \n"); + } else { + count = 1; + if (pci_alloc_msix(self, &count) == 0) { + if (bootverbose) + device_printf(self, "MSI-X enabled\n"); + rid = 1; + } else { + bus_release_resource(self, SYS_RES_MEMORY, + msix_table, sc->sc_msix_res); + sc->sc_msix_res = NULL; + } + } + } + if (rid == 0 && xhci_use_msi && usemsi) { count = 1; if (pci_alloc_msi(self, &count) == 0) { if (bootverbose) @@ -341,6 +363,11 @@ xhci_pci_detach(device_t self) sc->sc_io_res); sc->sc_io_res = NULL; } + if (sc->sc_msix_res) { + bus_release_resource(self, SYS_RES_MEMORY, + rman_get_rid(sc->sc_msix_res), sc->sc_msix_res); + sc->sc_msix_res = NULL; + } xhci_uninit(sc); From owner-svn-src-all@freebsd.org Thu Dec 24 11:30:30 2015 Return-Path: Delivered-To: svn-src-all@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 C575CA5186F; Thu, 24 Dec 2015 11:30:30 +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 960321458; Thu, 24 Dec 2015 11:30:30 +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 tBOBUTfV025746; Thu, 24 Dec 2015 11:30:29 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOBUTOg025745; Thu, 24 Dec 2015 11:30:29 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512241130.tBOBUTOg025745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 24 Dec 2015 11:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292684 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 11:30:30 -0000 Author: bapt Date: Thu Dec 24 11:30:29 2015 New Revision: 292684 URL: https://svnweb.freebsd.org/changeset/base/292684 Log: Reduce overlinking ifconfig does not need libbsdxml and libsbuf only lib80211 needs it Modified: head/sbin/ifconfig/Makefile Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Thu Dec 24 09:40:29 2015 (r292683) +++ head/sbin/ifconfig/Makefile Thu Dec 24 11:30:29 2015 (r292684) @@ -38,7 +38,7 @@ SRCS+= sfp.c # SFP/SFP+ information LIBADD+= m SRCS+= ifieee80211.c # SIOC[GS]IEEE80211 support -LIBADD+= bsdxml sbuf 80211 +LIBADD+= 80211 SRCS+= carp.c # SIOC[GS]VH support SRCS+= ifgroup.c # ... From owner-svn-src-all@freebsd.org Thu Dec 24 11:35:44 2015 Return-Path: Delivered-To: svn-src-all@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 6A3B0A51A37; Thu, 24 Dec 2015 11:35:44 +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 379751A3A; Thu, 24 Dec 2015 11:35:44 +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 tBOBZhKN028515; Thu, 24 Dec 2015 11:35:43 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOBZhk2028513; Thu, 24 Dec 2015 11:35:43 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512241135.tBOBZhk2028513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 24 Dec 2015 11:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292685 - in head/cddl/sbin: zfs zpool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 11:35:44 -0000 Author: bapt Date: Thu Dec 24 11:35:42 2015 New Revision: 292685 URL: https://svnweb.freebsd.org/changeset/base/292685 Log: Reduce overlinking Modified: head/cddl/sbin/zfs/Makefile head/cddl/sbin/zpool/Makefile Modified: head/cddl/sbin/zfs/Makefile ============================================================================== --- head/cddl/sbin/zfs/Makefile Thu Dec 24 11:30:29 2015 (r292684) +++ head/cddl/sbin/zfs/Makefile Thu Dec 24 11:35:42 2015 (r292685) @@ -22,6 +22,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -LIBADD= geom jail nvpair umem util uutil zfs_core zfs +LIBADD= jail nvpair uutil zfs_core zfs .include Modified: head/cddl/sbin/zpool/Makefile ============================================================================== --- head/cddl/sbin/zpool/Makefile Thu Dec 24 11:30:29 2015 (r292684) +++ head/cddl/sbin/zpool/Makefile Thu Dec 24 11:35:42 2015 (r292685) @@ -27,6 +27,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/stat/common -LIBADD= avl geom nvpair umem util uutil zfs_core zfs +LIBADD= geom nvpair uutil zfs .include From owner-svn-src-all@freebsd.org Thu Dec 24 11:41:23 2015 Return-Path: Delivered-To: svn-src-all@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 1BB05A51B88; Thu, 24 Dec 2015 11:41:23 +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 E0A4A1E5A; Thu, 24 Dec 2015 11:41:22 +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 tBOBfMCL031265; Thu, 24 Dec 2015 11:41:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOBfLvJ031263; Thu, 24 Dec 2015 11:41:21 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512241141.tBOBfLvJ031263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 24 Dec 2015 11:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292686 - head/usr.bin/nfsstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 11:41:23 -0000 Author: bapt Date: Thu Dec 24 11:41:21 2015 New Revision: 292686 URL: https://svnweb.freebsd.org/changeset/base/292686 Log: Since removal of oldnfs support linking to kvm is not needed anymore Modified: head/usr.bin/nfsstat/Makefile head/usr.bin/nfsstat/nfsstat.c Modified: head/usr.bin/nfsstat/Makefile ============================================================================== --- head/usr.bin/nfsstat/Makefile Thu Dec 24 11:35:42 2015 (r292685) +++ head/usr.bin/nfsstat/Makefile Thu Dec 24 11:41:21 2015 (r292686) @@ -4,6 +4,4 @@ PROG= nfsstat CFLAGS+=-DNFS -LIBADD= kvm - .include Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Thu Dec 24 11:35:42 2015 (r292685) +++ head/usr.bin/nfsstat/nfsstat.c Thu Dec 24 11:41:21 2015 (r292686) @@ -60,7 +60,6 @@ static const char rcsid[] = #include #include #include -#include #include #include #include From owner-svn-src-all@freebsd.org Thu Dec 24 11:43:33 2015 Return-Path: Delivered-To: svn-src-all@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 5813EA51D1A; Thu, 24 Dec 2015 11:43:33 +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 292461368; Thu, 24 Dec 2015 11:43:33 +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 tBOBhW5F031964; Thu, 24 Dec 2015 11:43:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOBhWY0031963; Thu, 24 Dec 2015 11:43:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512241143.tBOBhWY0031963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 24 Dec 2015 11:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292687 - head/usr.sbin/camdd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 11:43:33 -0000 Author: bapt Date: Thu Dec 24 11:43:32 2015 New Revision: 292687 URL: https://svnweb.freebsd.org/changeset/base/292687 Log: camadd does not require linking to libsbuf or libbsdxml directly Modified: head/usr.sbin/camdd/Makefile Modified: head/usr.sbin/camdd/Makefile ============================================================================== --- head/usr.sbin/camdd/Makefile Thu Dec 24 11:41:21 2015 (r292686) +++ head/usr.sbin/camdd/Makefile Thu Dec 24 11:43:32 2015 (r292687) @@ -3,7 +3,7 @@ PROG= camdd SRCS= camdd.c SDIR= ${.CURDIR}/../../sys -LIBADD= cam mt sbuf bsdxml util pthread +LIBADD= cam mt util pthread NO_WTHREAD_SAFETY= 1 MAN= camdd.8 From owner-svn-src-all@freebsd.org Thu Dec 24 11:56:38 2015 Return-Path: Delivered-To: svn-src-all@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 7FA84A50234; Thu, 24 Dec 2015 11:56:38 +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 4E5541DCD; Thu, 24 Dec 2015 11:56:38 +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 tBOBub3t035114; Thu, 24 Dec 2015 11:56:37 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOBubpQ035112; Thu, 24 Dec 2015 11:56:37 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512241156.tBOBubpQ035112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 24 Dec 2015 11:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292688 - in head/cddl/usr.sbin: zdb zhack X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 11:56:38 -0000 Author: bapt Date: Thu Dec 24 11:56:37 2015 New Revision: 292688 URL: https://svnweb.freebsd.org/changeset/base/292688 Log: Reduce zfs utilities overlinking Modified: head/cddl/usr.sbin/zdb/Makefile head/cddl/usr.sbin/zhack/Makefile Modified: head/cddl/usr.sbin/zdb/Makefile ============================================================================== --- head/cddl/usr.sbin/zdb/Makefile Thu Dec 24 11:43:32 2015 (r292687) +++ head/cddl/usr.sbin/zdb/Makefile Thu Dec 24 11:56:37 2015 (r292688) @@ -24,7 +24,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/../../lib/libumem -LIBADD= geom m nvpair pthread umem uutil zfs_core zfs zpool +LIBADD= nvpair umem uutil zfs zpool # Since there are many asserts in this program, it makes no sense to compile # it without debugging. Modified: head/cddl/usr.sbin/zhack/Makefile ============================================================================== --- head/cddl/usr.sbin/zhack/Makefile Thu Dec 24 11:43:32 2015 (r292687) +++ head/cddl/usr.sbin/zhack/Makefile Thu Dec 24 11:56:37 2015 (r292688) @@ -23,7 +23,7 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/../../lib/libumem -LIBADD= geom m nvpair pthread umem uutil zfs_core zfs zpool +LIBADD= nvpair zfs zpool CFLAGS+= -DDEBUG=1 #DEBUG_FLAGS+= -g From owner-svn-src-all@freebsd.org Thu Dec 24 13:57:44 2015 Return-Path: Delivered-To: svn-src-all@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 EBFC1A511A8; Thu, 24 Dec 2015 13:57:44 +0000 (UTC) (envelope-from pluknet@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 B970B1366; Thu, 24 Dec 2015 13:57:44 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBODvhtS075793; Thu, 24 Dec 2015 13:57:43 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBODvh5N075792; Thu, 24 Dec 2015 13:57:43 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201512241357.tBODvh5N075792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Thu, 24 Dec 2015 13:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292689 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 13:57:45 -0000 Author: pluknet Date: Thu Dec 24 13:57:43 2015 New Revision: 292689 URL: https://svnweb.freebsd.org/changeset/base/292689 Log: Fixed comment placement. Before r12296, this comment described the udp_recvspace default value. Spotted by: ru Sponsored by: Nginx, Inc. Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Dec 24 11:56:37 2015 (r292688) +++ head/sys/netinet/udp_usrreq.c Thu Dec 24 13:57:43 2015 (r292689) @@ -128,7 +128,6 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, blac "Do not send port unreachables for refused connects"); u_long udp_sendspace = 9216; /* really max datagram size */ - /* 40 1K datagrams */ SYSCTL_ULONG(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW, &udp_sendspace, 0, "Maximum outgoing UDP datagram size"); @@ -138,7 +137,7 @@ u_long udp_recvspace = 40 * (1024 + #else sizeof(struct sockaddr_in) #endif - ); + ); /* 40 1K datagrams */ SYSCTL_ULONG(_net_inet_udp, UDPCTL_RECVSPACE, recvspace, CTLFLAG_RW, &udp_recvspace, 0, "Maximum space for incoming UDP datagrams"); From owner-svn-src-all@freebsd.org Thu Dec 24 14:53:30 2015 Return-Path: Delivered-To: svn-src-all@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 7E332A4F45C; Thu, 24 Dec 2015 14:53:30 +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 5989115B5; Thu, 24 Dec 2015 14:53:30 +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 tBOErTpL093922; Thu, 24 Dec 2015 14:53:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOErTCa093918; Thu, 24 Dec 2015 14:53:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512241453.tBOErTCa093918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 24 Dec 2015 14:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292690 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 14:53:30 -0000 Author: mav Date: Thu Dec 24 14:53:29 2015 New Revision: 292690 URL: https://svnweb.freebsd.org/changeset/base/292690 Log: Some polishing for command timeouts handling. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/ispmbox.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Thu Dec 24 13:57:43 2015 (r292689) +++ head/sys/dev/isp/isp.c Thu Dec 24 14:53:29 2015 (r292690) @@ -2446,7 +2446,8 @@ isp_plogx(ispsoftc_t *isp, int chan, uin scp = fcp->isp_scratch; isp_put_plogx(isp, plp, (isp_plogx_t *) scp); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 500000); + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, + MBCMD_DEFAULT_TIMEOUT + ICB_LOGIN_TOV * 1000000); mbs.param[1] = QENTRY_LEN; mbs.param[2] = DMA_WD1(fcp->isp_scdma); mbs.param[3] = DMA_WD0(fcp->isp_scdma); @@ -3390,7 +3391,7 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, pt->ctp_nphdl = fcp->isp_sns_hdl; pt->ctp_cmd_cnt = 1; pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan); - pt->ctp_time = 30; + pt->ctp_time = 10; pt->ctp_rsp_cnt = 1; pt->ctp_rsp_bcnt = GIDLEN; pt->ctp_cmd_bcnt = sizeof (*ct) + sizeof (uint32_t); @@ -3426,7 +3427,8 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, sizeof (*ct) + sizeof (uint32_t), &scp[XTXOFF]); } ISP_MEMZERO(&scp[ZTXOFF], QENTRY_LEN); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 500000); + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, + MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 1000000); mbs.param[1] = QENTRY_LEN; mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); @@ -3861,7 +3863,7 @@ isp_register_fc4_type_24xx(ispsoftc_t *i pt->ctp_nphdl = fcp->isp_sns_hdl; pt->ctp_cmd_cnt = 1; pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan); - pt->ctp_time = 1; + pt->ctp_time = 4; pt->ctp_rsp_cnt = 1; pt->ctp_rsp_bcnt = sizeof (ct_hdr_t); pt->ctp_cmd_bcnt = sizeof (rft_id_t); @@ -3900,7 +3902,8 @@ isp_register_fc4_type_24xx(ispsoftc_t *i ISP_MEMZERO(&scp[ZTXOFF], sizeof (ct_hdr_t)); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 1000000); + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, + MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 1000000); mbs.param[1] = QENTRY_LEN; mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); @@ -3972,7 +3975,7 @@ isp_register_fc4_features_24xx(ispsoftc_ pt->ctp_nphdl = fcp->isp_sns_hdl; pt->ctp_cmd_cnt = 1; pt->ctp_vpidx = ISP_GET_VPIDX(isp, chan); - pt->ctp_time = 1; + pt->ctp_time = 4; pt->ctp_rsp_cnt = 1; pt->ctp_rsp_bcnt = sizeof (ct_hdr_t); pt->ctp_cmd_bcnt = sizeof (rff_id_t); @@ -4016,7 +4019,8 @@ isp_register_fc4_features_24xx(ispsoftc_ ISP_MEMZERO(&scp[ZTXOFF], sizeof (ct_hdr_t)); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 1000000); + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, + MBCMD_DEFAULT_TIMEOUT + pt->ctp_time * 1000000); mbs.param[1] = QENTRY_LEN; mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); @@ -4403,10 +4407,7 @@ isp_start(XS_T *xs) } ISP_MEMCPY(cdbp, XS_CDBP(xs), cdblen); - *tptr = XS_TIME(xs) / 1000; - if (*tptr == 0 && XS_TIME(xs)) { - *tptr = 1; - } + *tptr = (XS_TIME(xs) + 999) / 1000; if (IS_24XX(isp) && *tptr > 0x1999) { *tptr = 0x1999; } @@ -4512,13 +4513,14 @@ isp_control(ispsoftc_t *isp, ispctl_t ct tmf->tmf_header.rqs_entry_count = 1; tmf->tmf_nphdl = lp->handle; tmf->tmf_delay = 2; - tmf->tmf_timeout = 2; + tmf->tmf_timeout = 4; tmf->tmf_flags = ISP24XX_TMF_TARGET_RESET; tmf->tmf_tidlo = lp->portid; tmf->tmf_tidhi = lp->portid >> 16; tmf->tmf_vpidx = ISP_GET_VPIDX(isp, chan); isp_prt(isp, ISP_LOGALL, "Chan %d Reset N-Port Handle 0x%04x @ Port 0x%06x", chan, lp->handle, lp->portid); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 5000000); + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, + MBCMD_DEFAULT_TIMEOUT + tmf->tmf_timeout * 1000000); mbs.param[1] = QENTRY_LEN; mbs.param[2] = DMA_WD1(fcp->isp_scdma); mbs.param[3] = DMA_WD0(fcp->isp_scdma); @@ -6901,7 +6903,7 @@ static const uint32_t mbpfc[] = { ISP_FC_OPMAP(0x01, 0x07), /* 0x1f: MBOX_GET_FIRMWARE_STATUS */ ISP_FC_OPMAP_HALF(0x2, 0x01, 0x7e, 0xcf), /* 0x20: MBOX_GET_LOOP_ID */ ISP_FC_OPMAP(0x00, 0x00), /* 0x21: */ - ISP_FC_OPMAP(0x01, 0x07), /* 0x22: MBOX_GET_RETRY_COUNT */ + ISP_FC_OPMAP(0x03, 0x4b), /* 0x22: MBOX_GET_TIMEOUT_PARAMS */ ISP_FC_OPMAP(0x00, 0x00), /* 0x23: */ ISP_FC_OPMAP(0x00, 0x00), /* 0x24: */ ISP_FC_OPMAP(0x00, 0x00), /* 0x25: */ @@ -6917,7 +6919,7 @@ static const uint32_t mbpfc[] = { ISP_FC_OPMAP(0x00, 0x00), /* 0x2f: */ ISP_FC_OPMAP(0x00, 0x00), /* 0x30: */ ISP_FC_OPMAP(0x00, 0x00), /* 0x31: */ - ISP_FC_OPMAP(0x07, 0x07), /* 0x32: MBOX_SET_RETRY_COUNT */ + ISP_FC_OPMAP(0x4b, 0x4b), /* 0x32: MBOX_SET_TIMEOUT_PARAMS */ ISP_FC_OPMAP(0x00, 0x00), /* 0x33: */ ISP_FC_OPMAP(0x00, 0x00), /* 0x34: */ ISP_FC_OPMAP(0x00, 0x00), /* 0x35: */ Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Thu Dec 24 13:57:43 2015 (r292689) +++ head/sys/dev/isp/isp_freebsd.c Thu Dec 24 14:53:29 2015 (r292690) @@ -632,7 +632,7 @@ ispioctl(struct cdev *dev, u_long c, cad tmf->tmf_header.rqs_entry_count = 1; tmf->tmf_nphdl = lp->handle; tmf->tmf_delay = 2; - tmf->tmf_timeout = 2; + tmf->tmf_timeout = 4; tmf->tmf_tidlo = lp->portid; tmf->tmf_tidhi = lp->portid >> 16; tmf->tmf_vpidx = ISP_GET_VPIDX(isp, chan); @@ -668,7 +668,8 @@ ispioctl(struct cdev *dev, u_long c, cad ISP_UNLOCK(isp); break; } - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 5000000); + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, + MBCMD_DEFAULT_TIMEOUT + tmf->tmf_timeout * 1000000); mbs.param[1] = QENTRY_LEN; mbs.param[2] = DMA_WD1(fcp->isp_scdma); mbs.param[3] = DMA_WD0(fcp->isp_scdma); @@ -1403,7 +1404,7 @@ isp_target_start_ctio(ispsoftc_t *isp, u cto->ct_iid_hi = atp->portid >> 16; cto->ct_oxid = atp->oxid; cto->ct_vpidx = ISP_GET_VPIDX(isp, XS_CHANNEL(ccb)); - cto->ct_timeout = 120; + cto->ct_timeout = (XS_TIME(ccb) + 999) / 1000; cto->ct_flags = atp->tattr << CT7_TASK_ATTR_SHIFT; /* @@ -1555,7 +1556,7 @@ isp_target_start_ctio(ispsoftc_t *isp, u cto->ct_lun = ccb->ccb_h.target_lun; } } - cto->ct_timeout = 10; + cto->ct_timeout = (XS_TIME(ccb) + 999) / 1000; cto->ct_rxid = cso->tag_id; /* Modified: head/sys/dev/isp/ispmbox.h ============================================================================== --- head/sys/dev/isp/ispmbox.h Thu Dec 24 13:57:43 2015 (r292689) +++ head/sys/dev/isp/ispmbox.h Thu Dec 24 14:53:29 2015 (r292690) @@ -1086,7 +1086,7 @@ typedef struct { #define ICB_DFLT_RDELAY 5 #define ICB_DFLT_RCOUNT 3 -#define ICB_LOGIN_TOV 30 +#define ICB_LOGIN_TOV 10 #define ICB_LUN_ENABLE_TOV 15 From owner-svn-src-all@freebsd.org Thu Dec 24 15:40:51 2015 Return-Path: Delivered-To: svn-src-all@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 B236AA507BA for ; Thu, 24 Dec 2015 15:40:51 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95B911332 for ; Thu, 24 Dec 2015 15:40:51 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 24 Dec 2015 15:41:02 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tBOFeg0p005820; Thu, 24 Dec 2015 08:40:42 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1450971642.25138.247.camel@freebsd.org> Subject: Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern From: Ian Lepore To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 24 Dec 2015 08:40:42 -0700 In-Reply-To: <201512071220.tB7CKRw0027858@repo.freebsd.org> References: <201512071220.tB7CKRw0027858@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 15:40:51 -0000 On Mon, 2015-12-07 at 12:20 +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon Dec 7 12:20:26 2015 > New Revision: 291937 > URL: https://svnweb.freebsd.org/changeset/base/291937 > > Log: > Add support for usermode (vdso-like) gettimeofday(2) and > clock_gettime(2) on ARMv7 and ARMv8 systems which have architectural > generic timer hardware. It is similar how the RDTSC timer is used in > userspace on x86. > > Fix a permission problem where generic timer access from EL0 (or > userspace on v7) was not properly initialized on APs. > > For ARMv7, mark the stack non-executable. The shared page is added for > all arms (including ARMv8 64bit), and the signal trampoline code is > moved to the page. > > Reviewed by:> > andrew > Discussed with:> > emaste, mmel > Sponsored by:> > The FreeBSD Foundation > Differential revision:> https://reviews.freebsd.org/D4209 I've just discovered this change breaks buildworld on armv4/5 systems. Those systems don't have the counter hardware that can be read from userland (they don't have any common timer hardware at all, every system is different). Also, they don't support the 'mrrc' instruction, so the buildworld fails to compile libc. -- Ian From owner-svn-src-all@freebsd.org Thu Dec 24 15:47:53 2015 Return-Path: Delivered-To: svn-src-all@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 DEF78A50A8C; Thu, 24 Dec 2015 15:47:52 +0000 (UTC) (envelope-from br@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 ADBE6187B; Thu, 24 Dec 2015 15:47:52 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBOFlpOH009103; Thu, 24 Dec 2015 15:47:51 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOFlpdt009099; Thu, 24 Dec 2015 15:47:51 GMT (envelope-from br@FreeBSD.org) Message-Id: <201512241547.tBOFlpdt009099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 24 Dec 2015 15:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292691 - in head/libexec/rtld-elf: . riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 15:47:53 -0000 Author: br Date: Thu Dec 24 15:47:51 2015 New Revision: 292691 URL: https://svnweb.freebsd.org/changeset/base/292691 Log: Add support for RISC-V architecture. Reviewed by: andrew, kib Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D4679 Added: head/libexec/rtld-elf/riscv/ head/libexec/rtld-elf/riscv/reloc.c (contents, props changed) head/libexec/rtld-elf/riscv/rtld_machdep.h (contents, props changed) head/libexec/rtld-elf/riscv/rtld_start.S (contents, props changed) Modified: head/libexec/rtld-elf/rtld.c Added: head/libexec/rtld-elf/riscv/reloc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rtld-elf/riscv/reloc.c Thu Dec 24 15:47:51 2015 (r292691) @@ -0,0 +1,400 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * This software was developed by the University of Cambridge Computer + * Laboratory as part of the CTSRD Project, with support from the UK Higher + * Education Innovation Fund (HEIF). + * + * 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 "debug.h" +#include "rtld.h" +#include "rtld_printf.h" + +/* + * It is possible for the compiler to emit relocations for unaligned data. + * We handle this situation with these inlines. + */ +#define RELOC_ALIGNED_P(x) \ + (((uintptr_t)(x) & (sizeof(void *) - 1)) == 0) + +void _exit(int); + +uint64_t +set_gp(Obj_Entry *obj) +{ + uint64_t old; + SymLook req; + uint64_t gp; + int res; + + __asm __volatile("mv %0, gp" : "=r"(old)); + + symlook_init(&req, "_gp"); + req.ventry = NULL; + req.flags = SYMLOOK_EARLY; + res = symlook_obj(&req, obj); + + if (res == 0) { + gp = req.sym_out->st_value; + __asm __volatile("mv gp, %0" :: "r"(gp)); + } + + return (old); +} + +void +init_pltgot(Obj_Entry *obj) +{ + + if (obj->pltgot != NULL) { + obj->pltgot[0] = (Elf_Addr)&_rtld_bind_start; + obj->pltgot[1] = (Elf_Addr)obj; + } +} + +int +do_copy_relocations(Obj_Entry *dstobj) +{ + const Obj_Entry *srcobj, *defobj; + const Elf_Rela *relalim; + const Elf_Rela *rela; + const Elf_Sym *srcsym; + const Elf_Sym *dstsym; + const void *srcaddr; + const char *name; + void *dstaddr; + SymLook req; + size_t size; + int res; + + /* + * COPY relocs are invalid outside of the main program + */ + assert(dstobj->mainprog); + + relalim = (const Elf_Rela *)((char *)dstobj->rela + + dstobj->relasize); + for (rela = dstobj->rela; rela < relalim; rela++) { + if (ELF_R_TYPE(rela->r_info) != R_RISCV_COPY) + continue; + + dstaddr = (void *)(dstobj->relocbase + rela->r_offset); + dstsym = dstobj->symtab + ELF_R_SYM(rela->r_info); + name = dstobj->strtab + dstsym->st_name; + size = dstsym->st_size; + + symlook_init(&req, name); + req.ventry = fetch_ventry(dstobj, ELF_R_SYM(rela->r_info)); + req.flags = SYMLOOK_EARLY; + + for (srcobj = dstobj->next; srcobj != NULL; + srcobj = srcobj->next) { + res = symlook_obj(&req, srcobj); + if (res == 0) { + srcsym = req.sym_out; + defobj = req.defobj_out; + break; + } + } + if (srcobj == NULL) { + _rtld_error( +"Undefined symbol \"%s\" referenced from COPY relocation in %s", + name, dstobj->path); + return (-1); + } + + srcaddr = (const void *)(defobj->relocbase + srcsym->st_value); + memcpy(dstaddr, srcaddr, size); + } + + return (0); +} + +/* + * Process the PLT relocations. + */ +int +reloc_plt(Obj_Entry *obj) +{ + const Elf_Rela *relalim; + const Elf_Rela *rela; + + relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); + for (rela = obj->pltrela; rela < relalim; rela++) { + Elf_Addr *where; + + assert(ELF_R_TYPE(rela->r_info) == R_RISCV_JUMP_SLOT); + + where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + *where += (Elf_Addr)obj->relocbase; + } + + return (0); +} + +/* + * LD_BIND_NOW was set - force relocation for all jump slots + */ +int +reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate) +{ + const Obj_Entry *defobj; + const Elf_Rela *relalim; + const Elf_Rela *rela; + const Elf_Sym *def; + + relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); + for (rela = obj->pltrela; rela < relalim; rela++) { + Elf_Addr *where; + + where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + switch(ELF_R_TYPE(rela->r_info)) { + case R_RISCV_JUMP_SLOT: + def = find_symdef(ELF_R_SYM(rela->r_info), obj, + &defobj, SYMLOOK_IN_PLT | flags, NULL, lockstate); + if (def == NULL) { + dbg("reloc_jmpslots: sym not found"); + return (-1); + } + + *where = (Elf_Addr)(defobj->relocbase + def->st_value); + break; + default: + _rtld_error("Unknown relocation type %x in jmpslot", + (unsigned int)ELF_R_TYPE(rela->r_info)); + return (-1); + } + } + + return (0); +} + +int +reloc_iresolve(Obj_Entry *obj, struct Struct_RtldLockState *lockstate) +{ + + /* XXX not implemented */ + return (0); +} + +int +reloc_gnu_ifunc(Obj_Entry *obj, int flags, + struct Struct_RtldLockState *lockstate) +{ + + /* XXX not implemented */ + return (0); +} + +Elf_Addr +reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Obj_Entry *defobj, + const Obj_Entry *obj, const Elf_Rel *rel) +{ + + assert(ELF_R_TYPE(rel->r_info) == R_RISCV_JUMP_SLOT); + + if (*where != target) + *where = target; + + return target; +} + +/* + * Process non-PLT relocations + */ +int +reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, + RtldLockState *lockstate) +{ + const Obj_Entry *defobj; + const Elf_Rela *relalim; + const Elf_Rela *rela; + const Elf_Sym *def; + SymCache *cache; + Elf_Addr *where; + unsigned long symnum; + + if ((flags & SYMLOOK_IFUNC) != 0) + /* XXX not implemented */ + return (0); + + /* + * The dynamic loader may be called from a thread, we have + * limited amounts of stack available so we cannot use alloca(). + */ + if (obj == obj_rtld) + cache = NULL; + else + cache = calloc(obj->dynsymcount, sizeof(SymCache)); + /* No need to check for NULL here */ + + relalim = (const Elf_Rela *)((caddr_t)obj->rela + obj->relasize); + for (rela = obj->rela; rela < relalim; rela++) { + where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + symnum = ELF_R_SYM(rela->r_info); + + switch (ELF_R_TYPE(rela->r_info)) { + case R_RISCV_JUMP_SLOT: + /* This will be handled by the plt/jmpslot routines */ + break; + case R_RISCV_NONE: + break; + case R_RISCV_64: + def = find_symdef(symnum, obj, &defobj, flags, cache, + lockstate); + if (def == NULL) + return (-1); + + *where = (Elf_Addr)(defobj->relocbase + def->st_value + + rela->r_addend); + break; + case R_RISCV_TLS_DTPMOD64: + def = find_symdef(symnum, obj, &defobj, flags, cache, + lockstate); + if (def == NULL) + return -1; + + *where += (Elf_Addr)defobj->tlsindex; + break; + case R_RISCV_COPY: + /* + * These are deferred until all other relocations have + * been done. All we do here is make sure that the + * COPY relocation is not in a shared library. They + * are allowed only in executable files. + */ + if (!obj->mainprog) { + _rtld_error("%s: Unexpected R_RISCV_COPY " + "relocation in shared library", obj->path); + return (-1); + } + break; + case R_RISCV_TLS_DTPREL64: + def = find_symdef(symnum, obj, &defobj, flags, cache, + lockstate); + if (def == NULL) + return (-1); + /* + * We lazily allocate offsets for static TLS as we + * see the first relocation that references the + * TLS block. This allows us to support (small + * amounts of) static TLS in dynamically loaded + * modules. If we run out of space, we generate an + * error. + */ + if (!defobj->tls_done) { + if (!allocate_tls_offset((Obj_Entry*) defobj)) { + _rtld_error( + "%s: No space available for static " + "Thread Local Storage", obj->path); + return (-1); + } + } + + *where += (Elf_Addr)(def->st_value + rela->r_addend + - TLS_DTV_OFFSET); + break; + case R_RISCV_TLS_TPREL64: + def = find_symdef(symnum, obj, &defobj, flags, cache, + lockstate); + if (def == NULL) + return (-1); + + /* + * We lazily allocate offsets for static TLS as we + * see the first relocation that references the + * TLS block. This allows us to support (small + * amounts of) static TLS in dynamically loaded + * modules. If we run out of space, we generate an + * error. + */ + if (!defobj->tls_done) { + if (!allocate_tls_offset((Obj_Entry*) defobj)) { + _rtld_error( + "%s: No space available for static " + "Thread Local Storage", obj->path); + return (-1); + } + } + + *where = (def->st_value + rela->r_addend + + defobj->tlsoffset - TLS_TP_OFFSET); + break; + case R_RISCV_RELATIVE: + *where = (Elf_Addr)(obj->relocbase + rela->r_addend); + break; + default: + rtld_printf("%s: Unhandled relocation %lu\n", + obj->path, ELF_R_TYPE(rela->r_info)); + return (-1); + } + } + + return (0); +} + +void +allocate_initial_tls(Obj_Entry *objs) +{ + Elf_Addr **tp; + + /* + * Fix the size of the static TLS block by using the maximum + * offset allocated so far and adding a bit for dynamic modules to + * use. + */ + tls_static_space = tls_last_offset + tls_last_size + + RTLD_STATIC_TLS_EXTRA; + + tp = (Elf_Addr **) ((char *)allocate_tls(objs, NULL, TLS_TCB_SIZE, 16) + + TLS_TP_OFFSET + TLS_TCB_SIZE); + + __asm __volatile("mv tp, %0" :: "r"(tp)); +} + +void * +__tls_get_addr(tls_index* ti) +{ + char *_tp; + void *p; + + __asm __volatile("mv %0, tp" : "=r" (_tp)); + + p = tls_get_addr_common((Elf_Addr**)((Elf_Addr)_tp - TLS_TP_OFFSET + - TLS_TCB_SIZE), ti->ti_module, ti->ti_offset); + + return (p + TLS_DTV_OFFSET); +} Added: head/libexec/rtld-elf/riscv/rtld_machdep.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rtld-elf/riscv/rtld_machdep.h Thu Dec 24 15:47:51 2015 (r292691) @@ -0,0 +1,111 @@ +/*- + * Copyright (c) 1999, 2000 John D. Polstra. + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were 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. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef RTLD_MACHDEP_H +#define RTLD_MACHDEP_H 1 + +#include +#include + +struct Struct_Obj_Entry; + +uint64_t set_gp(struct Struct_Obj_Entry *obj); + +/* Return the address of the .dynamic section in the dynamic linker. */ +#define rtld_dynamic(obj) \ +({ \ + Elf_Addr _dynamic_addr; \ + __asm __volatile("lla %0, _DYNAMIC" : "=r"(_dynamic_addr)); \ + (const Elf_Dyn *)_dynamic_addr; \ +}) +#define RTLD_IS_DYNAMIC() (1) + +Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, + const struct Struct_Obj_Entry *defobj, + const struct Struct_Obj_Entry *obj, + const Elf_Rel *rel); + +#define make_function_pointer(def, defobj) \ + ((defobj)->relocbase + (def)->st_value) + +#define call_initfini_pointer(obj, target) \ +({ \ + uint64_t old0; \ + old0 = set_gp(obj); \ + (((InitFunc)(target))()); \ + __asm __volatile("mv gp, %0" :: "r"(old0)); \ +}) + +#define call_init_pointer(obj, target) \ +({ \ + uint64_t old1; \ + old1 = set_gp(obj); \ + (((InitArrFunc)(target))(main_argc, main_argv, environ)); \ + __asm __volatile("mv gp, %0" :: "r"(old1)); \ +}) + +/* + * Lazy binding entry point, called via PLT. + */ +void _rtld_bind_start(void); + +/* + * TLS + */ +#define TLS_TP_OFFSET 0x0 +#define TLS_DTV_OFFSET 0x800 +#define TLS_TCB_SIZE 16 + +#define round(size, align) \ + (((size) + (align) - 1) & ~((align) - 1)) +#define calculate_first_tls_offset(size, align) \ + round(16, align) +#define calculate_tls_offset(prev_offset, prev_size, size, align) \ + round(prev_offset + prev_size, align) +#define calculate_tls_end(off, size) ((off) + (size)) + +typedef struct { + unsigned long ti_module; + unsigned long ti_offset; +} tls_index; + +extern void *__tls_get_addr(tls_index* ti); + +#define RTLD_DEFAULT_STACK_PF_EXEC PF_X +#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC + +#endif Added: head/libexec/rtld-elf/riscv/rtld_start.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rtld-elf/riscv/rtld_start.S Thu Dec 24 15:47:51 2015 (r292691) @@ -0,0 +1,129 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * This software was developed by the University of Cambridge Computer + * Laboratory as part of the CTSRD Project, with support from the UK Higher + * Education Innovation Fund (HEIF). + * + * 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$"); + +/* + * func_ptr_type + * _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) + */ + +ENTRY(.rtld_start) + mv s0, a0 /* Put ps_strings in a callee-saved register */ + mv s1, sp /* And the stack pointer */ + + addi sp, sp, -16 /* Make room for obj_main & exit proc */ + + mv a1, sp /* exit_proc */ + addi a2, a1, 8 /* obj_main */ + jal _rtld /* Call the loader */ + mv t0, a0 /* Backup the entry point */ + + ld a2, 0(sp) /* Load cleanup */ + ld a1, 8(sp) /* Load obj_main */ + mv a0, s0 /* Restore ps_strings */ + mv sp, s1 /* Restore the stack pointer */ + jr t0 /* Jump to the entry point */ +END(.rtld_start) + +/* + * t0 = obj pointer + * t1 = reloc offset + */ +ENTRY(_rtld_bind_start) + /* Save the arguments and ra */ + addi sp, sp, -(8 * 25) + sd a0, (8 * 0)(sp) + sd a1, (8 * 1)(sp) + sd a2, (8 * 2)(sp) + sd a3, (8 * 3)(sp) + sd a4, (8 * 4)(sp) + sd a5, (8 * 5)(sp) + sd a6, (8 * 6)(sp) + sd a7, (8 * 7)(sp) + sd ra, (8 * 8)(sp) +#if 0 + /* RISCVTODO VFP */ + /* Save any floating-point arguments */ + fsq fa0, (8 * 9)(sp) + fsq fa1, (8 * 11)(sp) + fsq fa2, (8 * 13)(sp) + fsq fa3, (8 * 15)(sp) + fsq fa4, (8 * 17)(sp) + fsq fa5, (8 * 19)(sp) + fsq fa6, (8 * 21)(sp) + fsq fa7, (8 * 23)(sp) +#endif + + /* Reloc offset is 3x of the .got.plt offset */ + slli a1, t1, 1 /* Mult items by 2 */ + add a1, a1, t1 /* Plus item */ + + /* Load obj */ + mv a0, t0 + + /* Call into rtld */ + jal _rtld_bind + + /* Backup the address to branch to */ + mv t0, a0 + + /* Restore the arguments and ra */ + ld a0, (8 * 0)(sp) + ld a1, (8 * 1)(sp) + ld a2, (8 * 2)(sp) + ld a3, (8 * 3)(sp) + ld a4, (8 * 4)(sp) + ld a5, (8 * 5)(sp) + ld a6, (8 * 6)(sp) + ld a7, (8 * 7)(sp) + ld ra, (8 * 8)(sp) +#if 0 + /* RISCVTODO VFP */ + /* Restore floating-point arguments */ + flq fa0, (8 * 9)(sp) + flq fa1, (8 * 11)(sp) + flq fa2, (8 * 13)(sp) + flq fa3, (8 * 15)(sp) + flq fa4, (8 * 17)(sp) + flq fa5, (8 * 19)(sp) + flq fa6, (8 * 21)(sp) + flq fa7, (8 * 23)(sp) +#endif + addi sp, sp, (8 * 25) + + /* Call into the correct function */ + jr t0 +END(_rtld_bind_start) Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Dec 24 14:53:29 2015 (r292690) +++ head/libexec/rtld-elf/rtld.c Thu Dec 24 15:47:51 2015 (r292691) @@ -4396,7 +4396,7 @@ tls_get_addr_common(Elf_Addr **dtvp, int } #if defined(__aarch64__) || defined(__arm__) || defined(__mips__) || \ - defined(__powerpc__) + defined(__powerpc__) || defined(__riscv__) /* * Allocate Static TLS using the Variant I method. From owner-svn-src-all@freebsd.org Thu Dec 24 15:52:22 2015 Return-Path: Delivered-To: svn-src-all@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 D91D5A50CEB; Thu, 24 Dec 2015 15:52:22 +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 B4B451C01; Thu, 24 Dec 2015 15:52:22 +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 tBOFqLqK011844; Thu, 24 Dec 2015 15:52:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOFqLP3011841; Thu, 24 Dec 2015 15:52:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512241552.tBOFqLP3011841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 24 Dec 2015 15:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292692 - in head/sys: conf mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 15:52:23 -0000 Author: adrian Date: Thu Dec 24 15:52:21 2015 New Revision: 292692 URL: https://svnweb.freebsd.org/changeset/base/292692 Log: Begin the initial support for the mips1004kc core. * add build option; * add initial coherence manager config register bits; * use the right hazard instruction (ehb); * add page attributes. Tested: * MT7621A SoC (not yet in-tree) Submitted by: Stanislav Galabov Modified: head/sys/conf/options.mips head/sys/mips/include/cpufunc.h head/sys/mips/include/cpuregs.h Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Thu Dec 24 15:47:51 2015 (r292691) +++ head/sys/conf/options.mips Thu Dec 24 15:52:21 2015 (r292692) @@ -31,6 +31,7 @@ CPU_MIPS4KC opt_global.h CPU_MIPS24KC opt_global.h CPU_MIPS74KC opt_global.h +CPU_MIPS1004KC opt_global.h CPU_MIPS32 opt_global.h CPU_MIPS64 opt_global.h CPU_SENTRY5 opt_global.h Modified: head/sys/mips/include/cpufunc.h ============================================================================== --- head/sys/mips/include/cpufunc.h Thu Dec 24 15:47:51 2015 (r292691) +++ head/sys/mips/include/cpufunc.h Thu Dec 24 15:52:21 2015 (r292692) @@ -248,7 +248,7 @@ MIPS_RW32_COP0_SEL(config5, MIPS_COP_0_C #if defined(CPU_NLM) || defined(BERI_LARGE_TLB) MIPS_RW32_COP0_SEL(config6, MIPS_COP_0_CONFIG, 6); #endif -#ifdef CPU_NLM +#if defined(CPU_NLM) || defined(CPU_MIPS1004KC) MIPS_RW32_COP0_SEL(config7, MIPS_COP_0_CONFIG, 7); #endif MIPS_RW32_COP0(count, MIPS_COP_0_COUNT); @@ -259,6 +259,7 @@ MIPS_RW32_COP0(cause, MIPS_COP_0_CAUSE); MIPS_RW32_COP0(excpc, MIPS_COP_0_EXC_PC); #endif MIPS_RW32_COP0(status, MIPS_COP_0_STATUS); +MIPS_RW32_COP0_SEL(cmgcrbase, 15, 3); /* XXX: Some of these registers are specific to MIPS32. */ #if !defined(__mips_n64) Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Thu Dec 24 15:47:51 2015 (r292691) +++ head/sys/mips/include/cpuregs.h Thu Dec 24 15:52:21 2015 (r292692) @@ -154,6 +154,11 @@ #define MIPS_CCA_CACHED 0x03 #endif +#if defined(CPU_MIPS1004KC) +#define MIPS_CCA_UNCACHED 0x02 +#define MIPS_CCA_CACHED 0x05 +#endif + #ifndef MIPS_CCA_UNCACHED #define MIPS_CCA_UNCACHED MIPS_CCA_UC #endif @@ -209,7 +214,7 @@ #define COP0_SYNC .word 0xc0 /* ehb */ #elif defined(CPU_SB1) #define COP0_SYNC ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop -#elif defined(CPU_MIPS74KC) +#elif defined(CPU_MIPS74KC) || defined(CPU_MIPS1004KC) #define COP0_SYNC .word 0xc0 /* ehb */ #else /* @@ -557,6 +562,8 @@ #define MIPS_CONFIG2_SS_SHIFT 8 /* Secondary cache sets per way */ #define MIPS_CONFIG2_SS_MASK 0xf +#define MIPS_CONFIG3_CMGCR_MASK (1 << 29) /* Coherence manager present */ + #define MIPS_CONFIG4_MMUSIZEEXT 0x000000FF /* bits 7.. 0 MMU Size Extension */ #define MIPS_CONFIG4_MMUEXTDEF 0x0000C000 /* bits 15.14 MMU Extension Definition */ #define MIPS_CONFIG4_MMUEXTDEF_MMUSIZEEXT 0x00004000 /* This values denotes CONFIG4 bits */ @@ -634,4 +641,8 @@ #define MIPS_OPCODE_SHIFT 26 #define MIPS_OPCODE_C1 0x11 +/* Coherence manager constants */ +#define MIPS_CMGCRB_BASE 11 +#define MIPS_CMGCRF_BASE (~((1 << MIPS_CMGCRB_BASE) - 1)) + #endif /* _MIPS_CPUREGS_H_ */ From owner-svn-src-all@freebsd.org Thu Dec 24 15:58:34 2015 Return-Path: Delivered-To: svn-src-all@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 A0AB4A50F88; Thu, 24 Dec 2015 15:58:34 +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 6E7141EF1; Thu, 24 Dec 2015 15:58:34 +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 tBOFwXTR012084; Thu, 24 Dec 2015 15:58:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOFwXVY012083; Thu, 24 Dec 2015 15:58:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512241558.tBOFwXVY012083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 24 Dec 2015 15:58:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292693 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 15:58:34 -0000 Author: adrian Date: Thu Dec 24 15:58:33 2015 New Revision: 292693 URL: https://svnweb.freebsd.org/changeset/base/292693 Log: Flesh out some build time configuration options for the realtek/mediatek ports. The sys/mips/rt305x/ code currently has these hard-coded with a comment to make them configurable; this is the first step towards that. Submitted by: Stanislav Galabov Modified: head/sys/conf/options.mips Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Thu Dec 24 15:52:21 2015 (r292692) +++ head/sys/conf/options.mips Thu Dec 24 15:58:33 2015 (r292693) @@ -121,6 +121,18 @@ IF_RT_PHY_SUPPORT opt_if_rt.h IF_RT_RING_DATA_COUNT opt_if_rt.h # +# Options that control the Ralink/Mediatek SoC type. +# +MT7620 opt_rt305x.h +RT5350 opt_rt305x.h +RT305XF opt_rt305x.h +RT3052F opt_rt305x.h +RT3050F opt_rt305x.h +RT305X opt_rt305x.h +RT305X_UBOOT opt_rt305x.h +RT305X_USE_UART opt_rt305x.h + +# # Options that affect the pmap. # PV_STATS opt_pmap.h From owner-svn-src-all@freebsd.org Thu Dec 24 16:18:39 2015 Return-Path: Delivered-To: svn-src-all@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 04F32A515A5; Thu, 24 Dec 2015 16:18:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ob0-x22c.google.com (mail-ob0-x22c.google.com [IPv6:2607:f8b0:4003:c01::22c]) (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 C451B18E2; Thu, 24 Dec 2015 16:18:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-ob0-x22c.google.com with SMTP id bx1so69792023obb.0; Thu, 24 Dec 2015 08:18:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FFIIyDKFbL/aklKh9vDZZasnczfd10bX/m26QctGGJE=; b=rVdrfVBTee7sHK5zsAesB0yl2eGOXO5AQfFNFZOEazlOTpdhfmEWLZz+ca5rEFOL4k NTmlAj6CRxF4B540sr7lvO2M5VIEGj0OvefHGTOqnxJJ9XnKei0UfXTEdNgWUc/keV1a fbefLnBLMWdqn3XzoQU6ObrzkmHNGiJh8jnLu0xK+MP+Rua/+BXAbCZLW7s/0cVIlc2s ugHzqQYraKql1y6TKBg7I3Vne2h+gN1kR3gHZHU1rxj1zX6dJSvKzGQvM7kKxyUnh9Yd 4D/IJm2w91TQxZUUgHX7T10/YBEMzKQFF4rX1/2IIZi71pdz6J+omq9DlzJh1jRoa4JZ Ri8w== X-Received: by 10.182.221.201 with SMTP id qg9mr2028002obc.1.1450973917995; Thu, 24 Dec 2015 08:18:37 -0800 (PST) Received: from [192.168.20.11] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id mj8sm11015518obc.25.2015.12.24.08.18.36 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Dec 2015 08:18:36 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern From: Garrett Cooper X-Mailer: iPhone Mail (13C75) In-Reply-To: <1450971642.25138.247.camel@freebsd.org> Date: Thu, 24 Dec 2015 08:18:35 -0800 Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <3BB67238-237B-41C7-8A3E-32849A51F896@gmail.com> References: <201512071220.tB7CKRw0027858@repo.freebsd.org> <1450971642.25138.247.camel@freebsd.org> To: Ian Lepore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 16:18:39 -0000 > On Dec 24, 2015, at 07:40, Ian Lepore wrote: > >> On Mon, 2015-12-07 at 12:20 +0000, Konstantin Belousov wrote: >> Author: kib >> Date: Mon Dec 7 12:20:26 2015 >> New Revision: 291937 >> URL: https://svnweb.freebsd.org/changeset/base/291937 >> >> Log: >> Add support for usermode (vdso-like) gettimeofday(2) and >> clock_gettime(2) on ARMv7 and ARMv8 systems which have architectural >> generic timer hardware. It is similar how the RDTSC timer is used in >> userspace on x86. >> >> Fix a permission problem where generic timer access from EL0 (or >> userspace on v7) was not properly initialized on APs. >> >> For ARMv7, mark the stack non-executable. The shared page is added for >> all arms (including ARMv8 64bit), and the signal trampoline code is >> moved to the page. >> >> Reviewed by:> > andrew >> Discussed with:> > emaste, mmel >> Sponsored by:> > The FreeBSD Foundation >> Differential revision:> https://reviews.freebsd.org/D4209 > > I've just discovered this change breaks buildworld on armv4/5 systems. > Those systems don't have the counter hardware that can be read from > userland (they don't have any common timer hardware at all, every > system is different). Also, they don't support the 'mrrc' instruction, > so the buildworld fails to compile libc. +1 I ran into this on ref9-amd64. I thought it was a tool chain issue :/.. From owner-svn-src-all@freebsd.org Thu Dec 24 16:35:30 2015 Return-Path: Delivered-To: svn-src-all@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 1FB23A51DAB; Thu, 24 Dec 2015 16:35:30 +0000 (UTC) (envelope-from jlh@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 E16B713C1; Thu, 24 Dec 2015 16:35:29 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBOGZSf5025468; Thu, 24 Dec 2015 16:35:28 GMT (envelope-from jlh@FreeBSD.org) Received: (from jlh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOGZSc6025467; Thu, 24 Dec 2015 16:35:28 GMT (envelope-from jlh@FreeBSD.org) Message-Id: <201512241635.tBOGZSc6025467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jlh set sender to jlh@FreeBSD.org using -f From: Jeremie Le Hen Date: Thu, 24 Dec 2015 16:35:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292694 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 16:35:30 -0000 Author: jlh Date: Thu Dec 24 16:35:28 2015 New Revision: 292694 URL: https://svnweb.freebsd.org/changeset/base/292694 Log: Replace all whitespaces between port name and number with tabs, Modified: head/etc/services Modified: head/etc/services ============================================================================== --- head/etc/services Thu Dec 24 15:58:33 2015 (r292693) +++ head/etc/services Thu Dec 24 16:35:28 2015 (r292694) @@ -1029,7 +1029,7 @@ nntps 563/udp snntp #nntp protocol o whoami 565/tcp whoami 565/udp streettalk 566/tcp -streettalk 566/udp +streettalk 566/udp banyan-rpc 567/tcp banyan-rpc 567/udp ms-shuttle 568/tcp #Microsoft shuttle @@ -1099,16 +1099,16 @@ acp 599/tcp #Aeolon Core Protocol acp 599/udp #Aeolon Core Protocol ipcserver 600/tcp #Sun IPC server ipcserver 600/udp #Sun IPC server -syslog-conn 601/tcp #Reliable Syslog Service -syslog-conn 601/udp #Reliable Syslog Service -xmlrpc-beep 602/tcp #XML-RPC over BEEP -xmlrpc-beep 602/udp #XML-RPC over BEEP -idxp 603/tcp -idxp 603/udp -tunnel 604/tcp -tunnel 604/udp -soap-beep 605/tcp #SOAP over BEEP -soap-beep 605/udp #SOAP over BEEP +syslog-conn 601/tcp #Reliable Syslog Service +syslog-conn 601/udp #Reliable Syslog Service +xmlrpc-beep 602/tcp #XML-RPC over BEEP +xmlrpc-beep 602/udp #XML-RPC over BEEP +idxp 603/tcp +idxp 603/udp +tunnel 604/tcp +tunnel 604/udp +soap-beep 605/tcp #SOAP over BEEP +soap-beep 605/udp #SOAP over BEEP urm 606/tcp #Cray Unified Resource Manager urm 606/udp #Cray Unified Resource Manager nqs 607/tcp @@ -1137,14 +1137,14 @@ dei-icda 618/tcp dei-icda 618/udp compaq-evm 619/tcp #Compaq EVM compaq-evm 619/udp #Compaq EVM -sco-websrvrmgr 620/tcp #SCO WebServer Manager -sco-websrvrmgr 620/udp #SCO WebServer Manager +sco-websrvrmgr 620/tcp #SCO WebServer Manager +sco-websrvrmgr 620/udp #SCO WebServer Manager escp-ip 621/tcp #ESCP escp-ip 621/udp #ESCP collaborator 622/tcp collaborator 622/udp -asf-rmcp 623/tcp #ASF Remote Management and Control Protocol -asf-rmcp 623/udp #ASF Remote Management and Control Protocol +asf-rmcp 623/tcp #ASF Remote Management and Control Protocol +asf-rmcp 623/udp #ASF Remote Management and Control Protocol cryptoadmin 624/tcp #Crypto Admin cryptoadmin 624/udp #Crypto Admin dec_dlm 625/tcp #DEC DLM @@ -1167,12 +1167,12 @@ servstat 633/tcp #Service Status upda servstat 633/udp #Service Status update (Sterling Software) ginad 634/tcp ginad 634/udp -rlzdbase 635/tcp #RLZ DBase -rlzdbase 635/udp #RLZ DBase +rlzdbase 635/tcp #RLZ DBase +rlzdbase 635/udp #RLZ DBase ldaps 636/tcp sldap #ldap protocol over TLS/SSL ldaps 636/udp sldap -lanserver 637/tcp -lanserver 637/udp +lanserver 637/tcp +lanserver 637/udp mcns-sec 638/tcp mcns-sec 638/udp msdp 639/tcp @@ -1191,12 +1191,12 @@ pssc 645/tcp pssc 645/udp ldp 646/tcp ldp 646/udp -dhcp-failover 647/tcp #DHCP Failover -dhcp-failover 647/udp #DHCP Failover -rrp 648/tcp #Registry Registrar Protocol (RRP) -rrp 648/udp #Registry Registrar Protocol (RRP) -cadview-3d 649/tcp #Cadview-3d - streaming 3d models over the internet -cadview-3d 649/udp #Cadview-3d - streaming 3d models over the internet +dhcp-failover 647/tcp #DHCP Failover +dhcp-failover 647/udp #DHCP Failover +rrp 648/tcp #Registry Registrar Protocol (RRP) +rrp 648/udp #Registry Registrar Protocol (RRP) +cadview-3d 649/tcp #Cadview-3d - streaming 3d models over the internet +cadview-3d 649/udp #Cadview-3d - streaming 3d models over the internet obex 650/tcp obex 650/udp ieee-mms 651/tcp #IEEE MMS @@ -1215,38 +1215,38 @@ rmc 657/tcp rmc 657/udp tenfold 658/tcp tenfold 658/udp -mac-srvr-admin 660/tcp #MacOS Server Admin -mac-srvr-admin 660/udp #MacOS Server Admin -hap 661/tcp -hap 661/udp -pftp 662/tcp -pftp 662/udp -purenoise 663/tcp #PureNoise -purenoise 663/udp #PureNoise -asf-secure-rmcp 664/tcp #ASF Secure Remote Management and Control Protocol -asf-secure-rmcp 664/udp #ASF Secure Remote Management and Control Protocol -sun-dr 665/tcp #Sun DR -sun-dr 665/udp #Sun DR +mac-srvr-admin 660/tcp #MacOS Server Admin +mac-srvr-admin 660/udp #MacOS Server Admin +hap 661/tcp +hap 661/udp +pftp 662/tcp +pftp 662/udp +purenoise 663/tcp #PureNoise +purenoise 663/udp #PureNoise +asf-secure-rmcp 664/tcp #ASF Secure Remote Management and Control Protocol +asf-secure-rmcp 664/udp #ASF Secure Remote Management and Control Protocol +sun-dr 665/tcp #Sun DR +sun-dr 665/udp #Sun DR mdqs 666/tcp mdqs 666/udp #PROBLEMS!=============================================== doom 666/tcp #doom Id Software doom 666/udp #doom Id Software #PROBLEMS!=============================================== -disclose 667/tcp #campaign contribution disclosures - SDR Technologies -disclose 667/udp #campaign contribution disclosures - SDR Technologies -mecomm 668/tcp -mecomm 668/udp -meregister 669/tcp -meregister 669/udp -vacdsm-sws 670/tcp -vacdsm-sws 670/udp -vacdsm-app 671/tcp -vacdsm-app 671/udp -vpps-qua 672/tcp -vpps-qua 672/udp -cimplex 673/tcp -cimplex 673/udp +disclose 667/tcp #campaign contribution disclosures - SDR Technologies +disclose 667/udp #campaign contribution disclosures - SDR Technologies +mecomm 668/tcp +mecomm 668/udp +meregister 669/tcp +meregister 669/udp +vacdsm-sws 670/tcp +vacdsm-sws 670/udp +vacdsm-app 671/tcp +vacdsm-app 671/udp +vpps-qua 672/tcp +vpps-qua 672/udp +cimplex 673/tcp +cimplex 673/udp acap 674/tcp #Application Configuration Access Protocol acap 674/udp #Application Configuration Access Protocol dctp 675/tcp @@ -1257,70 +1257,70 @@ vpp 677/tcp #Virtual Presence Protoc vpp 677/udp #Virtual Presence Protocol ggf-ncp 678/tcp #GNU Generation Foundation NCP ggf-ncp 678/udp #GNU Generation Foundation NCP -mrm 679/tcp -mrm 679/udp +mrm 679/tcp +mrm 679/udp entrust-aaas 680/tcp entrust-aaas 680/udp entrust-aams 681/tcp entrust-aams 681/udp -xfr 682/tcp -xfr 682/udp -corba-iiop 683/tcp #CORBA IIOP -corba-iiop 683/udp #CORBA IIOP +xfr 682/tcp +xfr 682/udp +corba-iiop 683/tcp #CORBA IIOP +corba-iiop 683/udp #CORBA IIOP corba-iiop-ssl 684/tcp #CORBA IIOP SSL corba-iiop-ssl 684/udp #CORBA IIOP SSL mdc-portmapper 685/tcp #MDC Port Mapper mdc-portmapper 685/udp #MDC Port Mapper -hcp-wismar 686/tcp #Hardware Control Protocol Wismar -hcp-wismar 686/udp #Hardware Control Protocol Wismar +hcp-wismar 686/tcp #Hardware Control Protocol Wismar +hcp-wismar 686/udp #Hardware Control Protocol Wismar asipregistry 687/tcp asipregistry 687/udp -realm-rusd 688/tcp #ApplianceWare management protocol -realm-rusd 688/udp #ApplianceWare management protocol -nmap 689/tcp -nmap 689/udp -vatp 690/tcp #Velazquez Application Transfer Protocol -vatp 690/udp #Velazquez Application Transfer Protocol +realm-rusd 688/tcp #ApplianceWare management protocol +realm-rusd 688/udp #ApplianceWare management protocol +nmap 689/tcp +nmap 689/udp +vatp 690/tcp #Velazquez Application Transfer Protocol +vatp 690/udp #Velazquez Application Transfer Protocol msexch-routing 691/tcp #MS Exchange Routing msexch-routing 691/udp #MS Exchange Routing hyperwave-isp 692/tcp #Hyperwave-ISP hyperwave-isp 692/udp #Hyperwave-ISP -connendp 693/tcp -connendp 693/udp -ha-cluster 694/tcp -ha-cluster 694/udp -ieee-mms-ssl 695/tcp -ieee-mms-ssl 695/udp -rushd 696/tcp -rushd 696/udp -uuidgen 697/tcp -uuidgen 697/udp -olsr 698/tcp -olsr 698/udp -accessnetwork 699/tcp #Access Network -accessnetwork 699/udp #Access Network -epp 700/tcp #Extensible Provisioning Protocol -epp 700/udp #Extensible Provisioning Protocol -lmp 701/tcp #Link Management Protocol (LMP) -lmp 701/udp #Link Management Protocol (LMP) -iris-beep 702/tcp #IRIS over BEEP -iris-beep 702/udp #IRIS over BEEP +connendp 693/tcp +connendp 693/udp +ha-cluster 694/tcp +ha-cluster 694/udp +ieee-mms-ssl 695/tcp +ieee-mms-ssl 695/udp +rushd 696/tcp +rushd 696/udp +uuidgen 697/tcp +uuidgen 697/udp +olsr 698/tcp +olsr 698/udp +accessnetwork 699/tcp #Access Network +accessnetwork 699/udp #Access Network +epp 700/tcp #Extensible Provisioning Protocol +epp 700/udp #Extensible Provisioning Protocol +lmp 701/tcp #Link Management Protocol (LMP) +lmp 701/udp #Link Management Protocol (LMP) +iris-beep 702/tcp #IRIS over BEEP +iris-beep 702/udp #IRIS over BEEP elcsd 704/tcp #errlog copy/server daemon elcsd 704/udp #errlog copy/server daemon -agentx 705/tcp #AgentX -agentx 705/udp #AgentX -silc 706/tcp -silc 706/udp -borland-dsj 707/tcp #Borland DSJ -borland-dsj 707/udp #Borland DSJ +agentx 705/tcp #AgentX +agentx 705/udp #AgentX +silc 706/tcp +silc 706/udp +borland-dsj 707/tcp #Borland DSJ +borland-dsj 707/udp #Borland DSJ entrustmanager 709/tcp #EntrustManager entrustmanager 709/udp #EntrustManager -entrust-ash 710/tcp #Entrust Administration Service Handler -entrust-ash 710/udp #Entrust Administration Service Handler -cisco-tdp 711/tcp #Cisco TDP -cisco-tdp 711/udp #Cisco TDP -tbrpf 712/tcp -tbrpf 712/udp +entrust-ash 710/tcp #Entrust Administration Service Handler +entrust-ash 710/udp #Entrust Administration Service Handler +cisco-tdp 711/tcp #Cisco TDP +cisco-tdp 711/udp #Cisco TDP +tbrpf 712/tcp +tbrpf 712/udp iris-xpc 713/tcp #IRIS over XPC iris-xpc 713/udp #IRIS over XPC iris-xpcs 714/tcp #IRIS over XPCS @@ -1419,49 +1419,49 @@ fcp-udp 810/udp #FCP Datagram itm-mcell-s 828/tcp itm-mcell-s 828/udp pkix-3-ca-ra 829/tcp #PKIX-3 CA/RA -pkix-3-ca-ra 829/udp #PKIX-3 CA/RA -netconf-ssh 830/tcp #NETCONF over SSH -netconf-ssh 830/udp #NETCONF over SSH -netconf-beep 831/tcp #NETCONF over BEEP -netconf-beep 831/udp #NETCONF over BEEP -netconfsoaphttp 832/tcp #NETCONF for SOAP over HTTPS -netconfsoaphttp 832/udp #NETCONF for SOAP over HTTPS -netconfsoapbeep 833/tcp #NETCONF for SOAP over BEEP -netconfsoapbeep 833/udp #NETCONF for SOAP over BEEP -dhcp-failover2 847/tcp #dhcp-failover 2 -dhcp-failover2 847/udp #dhcp-failover 2 -gdoi 848/tcp -gdoi 848/udp -iscsi 860/tcp -iscsi 860/udp -owamp-control 861/tcp -owamp-control 861/udp +pkix-3-ca-ra 829/udp #PKIX-3 CA/RA +netconf-ssh 830/tcp #NETCONF over SSH +netconf-ssh 830/udp #NETCONF over SSH +netconf-beep 831/tcp #NETCONF over BEEP +netconf-beep 831/udp #NETCONF over BEEP +netconfsoaphttp 832/tcp #NETCONF for SOAP over HTTPS +netconfsoaphttp 832/udp #NETCONF for SOAP over HTTPS +netconfsoapbeep 833/tcp #NETCONF for SOAP over BEEP +netconfsoapbeep 833/udp #NETCONF for SOAP over BEEP +dhcp-failover2 847/tcp #dhcp-failover 2 +dhcp-failover2 847/udp #dhcp-failover 2 +gdoi 848/tcp +gdoi 848/udp +iscsi 860/tcp +iscsi 860/udp +owamp-control 861/tcp +owamp-control 861/udp supfilesrv 871/tcp # for SUP rsync 873/tcp rsync 873/udp -iclcnet-locate 886/tcp #ICL coNETion locate server -iclcnet-locate 886/udp #ICL coNETion locate server -iclcnet_svinfo 887/tcp #ICL coNETion server info -iclcnet_svinfo 887/udp #ICL coNETion server info +iclcnet-locate 886/tcp #ICL coNETion locate server +iclcnet-locate 886/udp #ICL coNETion locate server +iclcnet_svinfo 887/tcp #ICL coNETion server info +iclcnet_svinfo 887/udp #ICL coNETion server info accessbuilder 888/tcp accessbuilder 888/udp -omginitialrefs 900/tcp #OMG Initial Refs -omginitialrefs 900/udp #OMG Initial Refs +omginitialrefs 900/tcp #OMG Initial Refs +omginitialrefs 900/udp #OMG Initial Refs swat 901/tcp # samba web configuration tool -smpnameres 901/tcp -smpnameres 901/udp -ideafarm-chat 902/tcp -ideafarm-chat 902/udp -ideafarm-catch 903/tcp -ideafarm-catch 903/udp -kink 910/tcp #Kerberized Internet Negotiation of Keys (KINK) -kink 910/udp #Kerberized Internet Negotiation of Keys (KINK) -xact-backup 911/tcp -xact-backup 911/udp -apex-mesh 912/tcp #APEX relay-relay service -apex-mesh 912/udp #APEX relay-relay service -apex-edge 913/tcp #APEX endpoint-relay service -apex-edge 913/udp #APEX endpoint-relay service +smpnameres 901/tcp +smpnameres 901/udp +ideafarm-chat 902/tcp +ideafarm-chat 902/udp +ideafarm-catch 903/tcp +ideafarm-catch 903/udp +kink 910/tcp #Kerberized Internet Negotiation of Keys (KINK) +kink 910/udp #Kerberized Internet Negotiation of Keys (KINK) +xact-backup 911/tcp +xact-backup 911/udp +apex-mesh 912/tcp #APEX relay-relay service +apex-mesh 912/udp #APEX relay-relay service +apex-edge 913/tcp #APEX endpoint-relay service +apex-edge 913/udp #APEX endpoint-relay service rndc 953/tcp # named's rndc control socket ftps-data 989/tcp # ftp protocol, data, over TLS/SSL ftps-data 989/udp @@ -1491,10 +1491,10 @@ cadlock2 1000/tcp cadlock2 1000/udp surf 1010/tcp surf 1010/udp -exp1 1021/tcp #RFC3692-style Experiment 1 (*) [RFC4727] -exp1 1021/udp #RFC3692-style Experiment 1 (*) [RFC4727] -exp2 1022/tcp #RFC3692-style Experiment 2 (*) [RFC4727] -exp2 1022/udp #RFC3692-style Experiment 2 (*) [RFC4727] +exp1 1021/tcp #RFC3692-style Experiment 1 (*) [RFC4727] +exp1 1021/udp #RFC3692-style Experiment 1 (*) [RFC4727] +exp2 1022/tcp #RFC3692-style Experiment 2 (*) [RFC4727] +exp2 1022/udp #RFC3692-style Experiment 2 (*) [RFC4727] # # REGISTERED PORT NUMBERS # @@ -2401,7 +2401,7 @@ xdsxdm 6558/udp sane-port 6566/tcp #Scanner Access Now Easy (SANE) Control Port sane-port 6566/udp #Scanner Access Now Easy (SANE) Control Port ircd 6667/tcp #Internet Relay Chat (unofficial) -ircs-u 6697/tcp #Internet Relay Chat over TLS/SSL +ircs-u 6697/tcp #Internet Relay Chat over TLS/SSL frc-hp 6704/sctp #ForCES HP (High Priority) channel frc-mp 6705/sctp #ForCES MP (Medium Priority) channel frc-lp 6706/sctp #ForCES LP (Low priority) channel From owner-svn-src-all@freebsd.org Thu Dec 24 16:51:04 2015 Return-Path: Delivered-To: svn-src-all@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 7E406A50381; Thu, 24 Dec 2015 16:51:04 +0000 (UTC) (envelope-from brnrd@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 4DBD01CB9; Thu, 24 Dec 2015 16:51:04 +0000 (UTC) (envelope-from brnrd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBOGp3PR029155; Thu, 24 Dec 2015 16:51:03 GMT (envelope-from brnrd@FreeBSD.org) Received: (from brnrd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOGp3t9029154; Thu, 24 Dec 2015 16:51:03 GMT (envelope-from brnrd@FreeBSD.org) Message-Id: <201512241651.tBOGp3t9029154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brnrd set sender to brnrd@FreeBSD.org using -f From: Bernard Spil Date: Thu, 24 Dec 2015 16:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292695 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 16:51:04 -0000 Author: brnrd (ports committer) Date: Thu Dec 24 16:51:03 2015 New Revision: 292695 URL: https://svnweb.freebsd.org/changeset/base/292695 Log: Update mentors for brnrd - Remove vsevolod as mentor for brnrd - Add feld as mentor for brnrd Reviewed by: koobs (mentor), vsevolod (mentor p.t.), feld (mentor h.t.) Approved by: koobs (mentor) Differential Revision: https://reviews.freebsd.org/D4702 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Thu Dec 24 16:35:28 2015 (r292694) +++ head/share/misc/committers-ports.dot Thu Dec 24 16:51:03 2015 (r292695) @@ -349,6 +349,7 @@ erwin -> lbr erwin -> lth erwin -> simon +feld -> brnrd feld -> junovitch fjoe -> danfe @@ -584,8 +585,6 @@ thierry -> riggs tmclaugh -> itetcu tmclaugh -> xride -vsevolod -> brnrd - wen -> cs wen -> culot wen -> pawel From owner-svn-src-all@freebsd.org Thu Dec 24 16:55:12 2015 Return-Path: Delivered-To: svn-src-all@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 7336AA505BF; Thu, 24 Dec 2015 16:55:12 +0000 (UTC) (envelope-from jlh@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 3C7871002; Thu, 24 Dec 2015 16:55:11 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBOGtAxG032094; Thu, 24 Dec 2015 16:55:10 GMT (envelope-from jlh@FreeBSD.org) Received: (from jlh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOGtALD032093; Thu, 24 Dec 2015 16:55:10 GMT (envelope-from jlh@FreeBSD.org) Message-Id: <201512241655.tBOGtALD032093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jlh set sender to jlh@FreeBSD.org using -f From: Jeremie Le Hen Date: Thu, 24 Dec 2015 16:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292696 - stable/10/etc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 16:55:12 -0000 Author: jlh Date: Thu Dec 24 16:55:09 2015 New Revision: 292696 URL: https://svnweb.freebsd.org/changeset/base/292696 Log: MFC r292564: Add port for IRC over TLS/SSL, as noted in RFC 7194. PR: 192505 Submitted by: loic.blot@unix-experience.fr MFC r292694: Replace all whitespaces between port name and number with tabs. Modified: stable/10/etc/services Modified: stable/10/etc/services ============================================================================== --- stable/10/etc/services Thu Dec 24 16:51:03 2015 (r292695) +++ stable/10/etc/services Thu Dec 24 16:55:09 2015 (r292696) @@ -1029,7 +1029,7 @@ nntps 563/udp snntp #nntp protocol o whoami 565/tcp whoami 565/udp streettalk 566/tcp -streettalk 566/udp +streettalk 566/udp banyan-rpc 567/tcp banyan-rpc 567/udp ms-shuttle 568/tcp #Microsoft shuttle @@ -1099,16 +1099,16 @@ acp 599/tcp #Aeolon Core Protocol acp 599/udp #Aeolon Core Protocol ipcserver 600/tcp #Sun IPC server ipcserver 600/udp #Sun IPC server -syslog-conn 601/tcp #Reliable Syslog Service -syslog-conn 601/udp #Reliable Syslog Service -xmlrpc-beep 602/tcp #XML-RPC over BEEP -xmlrpc-beep 602/udp #XML-RPC over BEEP -idxp 603/tcp -idxp 603/udp -tunnel 604/tcp -tunnel 604/udp -soap-beep 605/tcp #SOAP over BEEP -soap-beep 605/udp #SOAP over BEEP +syslog-conn 601/tcp #Reliable Syslog Service +syslog-conn 601/udp #Reliable Syslog Service +xmlrpc-beep 602/tcp #XML-RPC over BEEP +xmlrpc-beep 602/udp #XML-RPC over BEEP +idxp 603/tcp +idxp 603/udp +tunnel 604/tcp +tunnel 604/udp +soap-beep 605/tcp #SOAP over BEEP +soap-beep 605/udp #SOAP over BEEP urm 606/tcp #Cray Unified Resource Manager urm 606/udp #Cray Unified Resource Manager nqs 607/tcp @@ -1137,14 +1137,14 @@ dei-icda 618/tcp dei-icda 618/udp compaq-evm 619/tcp #Compaq EVM compaq-evm 619/udp #Compaq EVM -sco-websrvrmgr 620/tcp #SCO WebServer Manager -sco-websrvrmgr 620/udp #SCO WebServer Manager +sco-websrvrmgr 620/tcp #SCO WebServer Manager +sco-websrvrmgr 620/udp #SCO WebServer Manager escp-ip 621/tcp #ESCP escp-ip 621/udp #ESCP collaborator 622/tcp collaborator 622/udp -asf-rmcp 623/tcp #ASF Remote Management and Control Protocol -asf-rmcp 623/udp #ASF Remote Management and Control Protocol +asf-rmcp 623/tcp #ASF Remote Management and Control Protocol +asf-rmcp 623/udp #ASF Remote Management and Control Protocol cryptoadmin 624/tcp #Crypto Admin cryptoadmin 624/udp #Crypto Admin dec_dlm 625/tcp #DEC DLM @@ -1167,12 +1167,12 @@ servstat 633/tcp #Service Status upda servstat 633/udp #Service Status update (Sterling Software) ginad 634/tcp ginad 634/udp -rlzdbase 635/tcp #RLZ DBase -rlzdbase 635/udp #RLZ DBase +rlzdbase 635/tcp #RLZ DBase +rlzdbase 635/udp #RLZ DBase ldaps 636/tcp sldap #ldap protocol over TLS/SSL ldaps 636/udp sldap -lanserver 637/tcp -lanserver 637/udp +lanserver 637/tcp +lanserver 637/udp mcns-sec 638/tcp mcns-sec 638/udp msdp 639/tcp @@ -1191,12 +1191,12 @@ pssc 645/tcp pssc 645/udp ldp 646/tcp ldp 646/udp -dhcp-failover 647/tcp #DHCP Failover -dhcp-failover 647/udp #DHCP Failover -rrp 648/tcp #Registry Registrar Protocol (RRP) -rrp 648/udp #Registry Registrar Protocol (RRP) -cadview-3d 649/tcp #Cadview-3d - streaming 3d models over the internet -cadview-3d 649/udp #Cadview-3d - streaming 3d models over the internet +dhcp-failover 647/tcp #DHCP Failover +dhcp-failover 647/udp #DHCP Failover +rrp 648/tcp #Registry Registrar Protocol (RRP) +rrp 648/udp #Registry Registrar Protocol (RRP) +cadview-3d 649/tcp #Cadview-3d - streaming 3d models over the internet +cadview-3d 649/udp #Cadview-3d - streaming 3d models over the internet obex 650/tcp obex 650/udp ieee-mms 651/tcp #IEEE MMS @@ -1215,38 +1215,38 @@ rmc 657/tcp rmc 657/udp tenfold 658/tcp tenfold 658/udp -mac-srvr-admin 660/tcp #MacOS Server Admin -mac-srvr-admin 660/udp #MacOS Server Admin -hap 661/tcp -hap 661/udp -pftp 662/tcp -pftp 662/udp -purenoise 663/tcp #PureNoise -purenoise 663/udp #PureNoise -asf-secure-rmcp 664/tcp #ASF Secure Remote Management and Control Protocol -asf-secure-rmcp 664/udp #ASF Secure Remote Management and Control Protocol -sun-dr 665/tcp #Sun DR -sun-dr 665/udp #Sun DR +mac-srvr-admin 660/tcp #MacOS Server Admin +mac-srvr-admin 660/udp #MacOS Server Admin +hap 661/tcp +hap 661/udp +pftp 662/tcp +pftp 662/udp +purenoise 663/tcp #PureNoise +purenoise 663/udp #PureNoise +asf-secure-rmcp 664/tcp #ASF Secure Remote Management and Control Protocol +asf-secure-rmcp 664/udp #ASF Secure Remote Management and Control Protocol +sun-dr 665/tcp #Sun DR +sun-dr 665/udp #Sun DR mdqs 666/tcp mdqs 666/udp #PROBLEMS!=============================================== doom 666/tcp #doom Id Software doom 666/udp #doom Id Software #PROBLEMS!=============================================== -disclose 667/tcp #campaign contribution disclosures - SDR Technologies -disclose 667/udp #campaign contribution disclosures - SDR Technologies -mecomm 668/tcp -mecomm 668/udp -meregister 669/tcp -meregister 669/udp -vacdsm-sws 670/tcp -vacdsm-sws 670/udp -vacdsm-app 671/tcp -vacdsm-app 671/udp -vpps-qua 672/tcp -vpps-qua 672/udp -cimplex 673/tcp -cimplex 673/udp +disclose 667/tcp #campaign contribution disclosures - SDR Technologies +disclose 667/udp #campaign contribution disclosures - SDR Technologies +mecomm 668/tcp +mecomm 668/udp +meregister 669/tcp +meregister 669/udp +vacdsm-sws 670/tcp +vacdsm-sws 670/udp +vacdsm-app 671/tcp +vacdsm-app 671/udp +vpps-qua 672/tcp +vpps-qua 672/udp +cimplex 673/tcp +cimplex 673/udp acap 674/tcp #Application Configuration Access Protocol acap 674/udp #Application Configuration Access Protocol dctp 675/tcp @@ -1257,70 +1257,70 @@ vpp 677/tcp #Virtual Presence Protoc vpp 677/udp #Virtual Presence Protocol ggf-ncp 678/tcp #GNU Generation Foundation NCP ggf-ncp 678/udp #GNU Generation Foundation NCP -mrm 679/tcp -mrm 679/udp +mrm 679/tcp +mrm 679/udp entrust-aaas 680/tcp entrust-aaas 680/udp entrust-aams 681/tcp entrust-aams 681/udp -xfr 682/tcp -xfr 682/udp -corba-iiop 683/tcp #CORBA IIOP -corba-iiop 683/udp #CORBA IIOP +xfr 682/tcp +xfr 682/udp +corba-iiop 683/tcp #CORBA IIOP +corba-iiop 683/udp #CORBA IIOP corba-iiop-ssl 684/tcp #CORBA IIOP SSL corba-iiop-ssl 684/udp #CORBA IIOP SSL mdc-portmapper 685/tcp #MDC Port Mapper mdc-portmapper 685/udp #MDC Port Mapper -hcp-wismar 686/tcp #Hardware Control Protocol Wismar -hcp-wismar 686/udp #Hardware Control Protocol Wismar +hcp-wismar 686/tcp #Hardware Control Protocol Wismar +hcp-wismar 686/udp #Hardware Control Protocol Wismar asipregistry 687/tcp asipregistry 687/udp -realm-rusd 688/tcp #ApplianceWare management protocol -realm-rusd 688/udp #ApplianceWare management protocol -nmap 689/tcp -nmap 689/udp -vatp 690/tcp #Velazquez Application Transfer Protocol -vatp 690/udp #Velazquez Application Transfer Protocol +realm-rusd 688/tcp #ApplianceWare management protocol +realm-rusd 688/udp #ApplianceWare management protocol +nmap 689/tcp +nmap 689/udp +vatp 690/tcp #Velazquez Application Transfer Protocol +vatp 690/udp #Velazquez Application Transfer Protocol msexch-routing 691/tcp #MS Exchange Routing msexch-routing 691/udp #MS Exchange Routing hyperwave-isp 692/tcp #Hyperwave-ISP hyperwave-isp 692/udp #Hyperwave-ISP -connendp 693/tcp -connendp 693/udp -ha-cluster 694/tcp -ha-cluster 694/udp -ieee-mms-ssl 695/tcp -ieee-mms-ssl 695/udp -rushd 696/tcp -rushd 696/udp -uuidgen 697/tcp -uuidgen 697/udp -olsr 698/tcp -olsr 698/udp -accessnetwork 699/tcp #Access Network -accessnetwork 699/udp #Access Network -epp 700/tcp #Extensible Provisioning Protocol -epp 700/udp #Extensible Provisioning Protocol -lmp 701/tcp #Link Management Protocol (LMP) -lmp 701/udp #Link Management Protocol (LMP) -iris-beep 702/tcp #IRIS over BEEP -iris-beep 702/udp #IRIS over BEEP +connendp 693/tcp +connendp 693/udp +ha-cluster 694/tcp +ha-cluster 694/udp +ieee-mms-ssl 695/tcp +ieee-mms-ssl 695/udp +rushd 696/tcp +rushd 696/udp +uuidgen 697/tcp +uuidgen 697/udp +olsr 698/tcp +olsr 698/udp +accessnetwork 699/tcp #Access Network +accessnetwork 699/udp #Access Network +epp 700/tcp #Extensible Provisioning Protocol +epp 700/udp #Extensible Provisioning Protocol +lmp 701/tcp #Link Management Protocol (LMP) +lmp 701/udp #Link Management Protocol (LMP) +iris-beep 702/tcp #IRIS over BEEP +iris-beep 702/udp #IRIS over BEEP elcsd 704/tcp #errlog copy/server daemon elcsd 704/udp #errlog copy/server daemon -agentx 705/tcp #AgentX -agentx 705/udp #AgentX -silc 706/tcp -silc 706/udp -borland-dsj 707/tcp #Borland DSJ -borland-dsj 707/udp #Borland DSJ +agentx 705/tcp #AgentX +agentx 705/udp #AgentX +silc 706/tcp +silc 706/udp +borland-dsj 707/tcp #Borland DSJ +borland-dsj 707/udp #Borland DSJ entrustmanager 709/tcp #EntrustManager entrustmanager 709/udp #EntrustManager -entrust-ash 710/tcp #Entrust Administration Service Handler -entrust-ash 710/udp #Entrust Administration Service Handler -cisco-tdp 711/tcp #Cisco TDP -cisco-tdp 711/udp #Cisco TDP -tbrpf 712/tcp -tbrpf 712/udp +entrust-ash 710/tcp #Entrust Administration Service Handler +entrust-ash 710/udp #Entrust Administration Service Handler +cisco-tdp 711/tcp #Cisco TDP +cisco-tdp 711/udp #Cisco TDP +tbrpf 712/tcp +tbrpf 712/udp iris-xpc 713/tcp #IRIS over XPC iris-xpc 713/udp #IRIS over XPC iris-xpcs 714/tcp #IRIS over XPCS @@ -1419,49 +1419,49 @@ fcp-udp 810/udp #FCP Datagram itm-mcell-s 828/tcp itm-mcell-s 828/udp pkix-3-ca-ra 829/tcp #PKIX-3 CA/RA -pkix-3-ca-ra 829/udp #PKIX-3 CA/RA -netconf-ssh 830/tcp #NETCONF over SSH -netconf-ssh 830/udp #NETCONF over SSH -netconf-beep 831/tcp #NETCONF over BEEP -netconf-beep 831/udp #NETCONF over BEEP -netconfsoaphttp 832/tcp #NETCONF for SOAP over HTTPS -netconfsoaphttp 832/udp #NETCONF for SOAP over HTTPS -netconfsoapbeep 833/tcp #NETCONF for SOAP over BEEP -netconfsoapbeep 833/udp #NETCONF for SOAP over BEEP -dhcp-failover2 847/tcp #dhcp-failover 2 -dhcp-failover2 847/udp #dhcp-failover 2 -gdoi 848/tcp -gdoi 848/udp -iscsi 860/tcp -iscsi 860/udp -owamp-control 861/tcp -owamp-control 861/udp +pkix-3-ca-ra 829/udp #PKIX-3 CA/RA +netconf-ssh 830/tcp #NETCONF over SSH +netconf-ssh 830/udp #NETCONF over SSH +netconf-beep 831/tcp #NETCONF over BEEP +netconf-beep 831/udp #NETCONF over BEEP +netconfsoaphttp 832/tcp #NETCONF for SOAP over HTTPS +netconfsoaphttp 832/udp #NETCONF for SOAP over HTTPS +netconfsoapbeep 833/tcp #NETCONF for SOAP over BEEP +netconfsoapbeep 833/udp #NETCONF for SOAP over BEEP +dhcp-failover2 847/tcp #dhcp-failover 2 +dhcp-failover2 847/udp #dhcp-failover 2 +gdoi 848/tcp +gdoi 848/udp +iscsi 860/tcp +iscsi 860/udp +owamp-control 861/tcp +owamp-control 861/udp supfilesrv 871/tcp # for SUP rsync 873/tcp rsync 873/udp -iclcnet-locate 886/tcp #ICL coNETion locate server -iclcnet-locate 886/udp #ICL coNETion locate server -iclcnet_svinfo 887/tcp #ICL coNETion server info -iclcnet_svinfo 887/udp #ICL coNETion server info +iclcnet-locate 886/tcp #ICL coNETion locate server +iclcnet-locate 886/udp #ICL coNETion locate server +iclcnet_svinfo 887/tcp #ICL coNETion server info +iclcnet_svinfo 887/udp #ICL coNETion server info accessbuilder 888/tcp accessbuilder 888/udp -omginitialrefs 900/tcp #OMG Initial Refs -omginitialrefs 900/udp #OMG Initial Refs +omginitialrefs 900/tcp #OMG Initial Refs +omginitialrefs 900/udp #OMG Initial Refs swat 901/tcp # samba web configuration tool -smpnameres 901/tcp -smpnameres 901/udp -ideafarm-chat 902/tcp -ideafarm-chat 902/udp -ideafarm-catch 903/tcp -ideafarm-catch 903/udp -kink 910/tcp #Kerberized Internet Negotiation of Keys (KINK) -kink 910/udp #Kerberized Internet Negotiation of Keys (KINK) -xact-backup 911/tcp -xact-backup 911/udp -apex-mesh 912/tcp #APEX relay-relay service -apex-mesh 912/udp #APEX relay-relay service -apex-edge 913/tcp #APEX endpoint-relay service -apex-edge 913/udp #APEX endpoint-relay service +smpnameres 901/tcp +smpnameres 901/udp +ideafarm-chat 902/tcp +ideafarm-chat 902/udp +ideafarm-catch 903/tcp +ideafarm-catch 903/udp +kink 910/tcp #Kerberized Internet Negotiation of Keys (KINK) +kink 910/udp #Kerberized Internet Negotiation of Keys (KINK) +xact-backup 911/tcp +xact-backup 911/udp +apex-mesh 912/tcp #APEX relay-relay service +apex-mesh 912/udp #APEX relay-relay service +apex-edge 913/tcp #APEX endpoint-relay service +apex-edge 913/udp #APEX endpoint-relay service rndc 953/tcp # named's rndc control socket ftps-data 989/tcp # ftp protocol, data, over TLS/SSL ftps-data 989/udp @@ -1491,10 +1491,10 @@ cadlock2 1000/tcp cadlock2 1000/udp surf 1010/tcp surf 1010/udp -exp1 1021/tcp #RFC3692-style Experiment 1 (*) [RFC4727] -exp1 1021/udp #RFC3692-style Experiment 1 (*) [RFC4727] -exp2 1022/tcp #RFC3692-style Experiment 2 (*) [RFC4727] -exp2 1022/udp #RFC3692-style Experiment 2 (*) [RFC4727] +exp1 1021/tcp #RFC3692-style Experiment 1 (*) [RFC4727] +exp1 1021/udp #RFC3692-style Experiment 1 (*) [RFC4727] +exp2 1022/tcp #RFC3692-style Experiment 2 (*) [RFC4727] +exp2 1022/udp #RFC3692-style Experiment 2 (*) [RFC4727] # # REGISTERED PORT NUMBERS # @@ -2399,6 +2399,7 @@ xdsxdm 6558/udp sane-port 6566/tcp #Scanner Access Now Easy (SANE) Control Port sane-port 6566/udp #Scanner Access Now Easy (SANE) Control Port ircd 6667/tcp #Internet Relay Chat (unofficial) +ircs-u 6697/tcp #Internet Relay Chat over TLS/SSL frc-hp 6704/sctp #ForCES HP (High Priority) channel frc-mp 6705/sctp #ForCES MP (Medium Priority) channel frc-lp 6706/sctp #ForCES LP (Low priority) channel From owner-svn-src-all@freebsd.org Thu Dec 24 17:05:26 2015 Return-Path: Delivered-To: svn-src-all@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 4B54EA50AD8; Thu, 24 Dec 2015 17:05:26 +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 1F134189F; Thu, 24 Dec 2015 17:05:26 +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 tBOH5PEf035374; Thu, 24 Dec 2015 17:05:25 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOH5Pss035373; Thu, 24 Dec 2015 17:05:25 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201512241705.tBOH5Pss035373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 24 Dec 2015 17:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292697 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 17:05:26 -0000 Author: sbruno Date: Thu Dec 24 17:05:25 2015 New Revision: 292697 URL: https://svnweb.freebsd.org/changeset/base/292697 Log: Fix NO INET6 build broken at svn r292674 Reported by: ohartman@zedat.fu-berlin.de Modified: head/sys/dev/ixgbe/ix_txrx.c Modified: head/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- head/sys/dev/ixgbe/ix_txrx.c Thu Dec 24 16:55:09 2015 (r292696) +++ head/sys/dev/ixgbe/ix_txrx.c Thu Dec 24 17:05:25 2015 (r292697) @@ -808,12 +808,14 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, *olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8; } break; +#ifdef INET6 case ETHERTYPE_IPV6: ip6 = (struct ip6_hdr *)(l3d); ip_hlen = sizeof(struct ip6_hdr); ipproto = ip6->ip6_nxt; type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6; break; +#endif default: offload = FALSE; break; From owner-svn-src-all@freebsd.org Thu Dec 24 18:01:00 2015 Return-Path: Delivered-To: svn-src-all@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 32ABCA51C95; Thu, 24 Dec 2015 18:01:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5FB817FD; Thu, 24 Dec 2015 18:00:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tBOI0rLJ058191 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 24 Dec 2015 20:00:53 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tBOI0rLJ058191 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tBOI0rNK058190; Thu, 24 Dec 2015 20:00:53 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 Dec 2015 20:00:53 +0200 From: Konstantin Belousov To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern Message-ID: <20151224180053.GY3625@kib.kiev.ua> References: <201512071220.tB7CKRw0027858@repo.freebsd.org> <1450971642.25138.247.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1450971642.25138.247.camel@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 18:01:00 -0000 On Thu, Dec 24, 2015 at 08:40:42AM -0700, Ian Lepore wrote: > On Mon, 2015-12-07 at 12:20 +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Mon Dec 7 12:20:26 2015 > > New Revision: 291937 > > URL: https://svnweb.freebsd.org/changeset/base/291937 > > > > Log: > > Add support for usermode (vdso-like) gettimeofday(2) and > > clock_gettime(2) on ARMv7 and ARMv8 systems which have architectural > > generic timer hardware. It is similar how the RDTSC timer is used in > > userspace on x86. > > > > Fix a permission problem where generic timer access from EL0 (or > > userspace on v7) was not properly initialized on APs. > > > > For ARMv7, mark the stack non-executable. The shared page is added for > > all arms (including ARMv8 64bit), and the signal trampoline code is > > moved to the page. > > > > Reviewed by:> > andrew > > Discussed with:> > emaste, mmel > > Sponsored by:> > The FreeBSD Foundation > > Differential revision:> https://reviews.freebsd.org/D4209 > > I've just discovered this change breaks buildworld on armv4/5 systems. > Those systems don't have the counter hardware that can be read from > userland (they don't have any common timer hardware at all, every > system is different). Also, they don't support the 'mrrc' instruction, > so the buildworld fails to compile libc. I tested the change with make universe. Is the armv5 world included into the make ? If yes, there is something even more broken. That said, the code in __vdso_gettime.c is unused om armv4/v5 since kernel never directs libc to use a fast timecounter. The routines could be left undefined since they are declared weak, or the bodies could be stubbed out. Anyway, to test, I should be able to compile libc for the target. And, BTW, what is exactly your error message ? From owner-svn-src-all@freebsd.org Thu Dec 24 18:30:05 2015 Return-Path: Delivered-To: svn-src-all@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 E3A67A50755; Thu, 24 Dec 2015 18:30:05 +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 B3BCA177D; Thu, 24 Dec 2015 18:30:05 +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 tBOIU4tY059182; Thu, 24 Dec 2015 18:30:04 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOIU4l0059181; Thu, 24 Dec 2015 18:30:04 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512241830.tBOIU4l0059181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 24 Dec 2015 18:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292698 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 18:30:06 -0000 Author: adrian Date: Thu Dec 24 18:30:04 2015 New Revision: 292698 URL: https://svnweb.freebsd.org/changeset/base/292698 Log: [rt305x] Prepare for the upcoming regime change - add RT305x options. Submitted by: Stanislav Galabov Modified: head/sys/mips/conf/RT305X Modified: head/sys/mips/conf/RT305X ============================================================================== --- head/sys/mips/conf/RT305X Thu Dec 24 17:05:25 2015 (r292697) +++ head/sys/mips/conf/RT305X Thu Dec 24 18:30:04 2015 (r292698) @@ -33,6 +33,9 @@ hints "RT305X.hints" #Default places t #makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +options RT3052F +options RT305X_UBOOT + # Debugging for use in -current #options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking From owner-svn-src-all@freebsd.org Thu Dec 24 18:31:57 2015 Return-Path: Delivered-To: svn-src-all@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 1A47CA508B6; Thu, 24 Dec 2015 18:31:57 +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 E684519E0; Thu, 24 Dec 2015 18:31:56 +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 tBOIVukx059280; Thu, 24 Dec 2015 18:31:56 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOIVu9s059279; Thu, 24 Dec 2015 18:31:56 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512241831.tBOIVu9s059279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 24 Dec 2015 18:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292699 - head/sys/mips/rt305x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 18:31:57 -0000 Author: adrian Date: Thu Dec 24 18:31:55 2015 New Revision: 292699 URL: https://svnweb.freebsd.org/changeset/base/292699 Log: [rt305x] add register space definitions for later generation chips. This adds definitions for the MT5350 and MT7620 SoCs. Submitted by: Stanislav Galabov Modified: head/sys/mips/rt305x/rt305xreg.h Modified: head/sys/mips/rt305x/rt305xreg.h ============================================================================== --- head/sys/mips/rt305x/rt305xreg.h Thu Dec 24 18:30:04 2015 (r292698) +++ head/sys/mips/rt305x/rt305xreg.h Thu Dec 24 18:31:55 2015 (r292699) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2015 Stanislav Galabov. * Copyright (c) 2010 Aleksandr Rybalko. * All rights reserved. * @@ -29,12 +30,7 @@ #ifndef _RT305XREG_H_ #define _RT305XREG_H_ -/* XXX: must move to config */ -#define RT305X 1 -#define RT305XF 1 -#define RT3052F 1 -#define __U_BOOT__ 1 -/* XXX: must move to config */ +#include "opt_rt305x.h" #ifdef RT3052F #define PLATFORM_COUNTER_FREQ (384 * 1000 * 1000) @@ -42,12 +38,19 @@ #ifdef RT3050F #define PLATFORM_COUNTER_FREQ (320 * 1000 * 1000) #endif +#ifdef MT7620 +#define PLATFORM_COUNTER_FREQ (580 * 1000 * 1000) +#endif +#ifdef RT5350 +#define PLATFORM_COUNTER_FREQ (360 * 1000 * 1000) +#endif #ifndef PLATFORM_COUNTER_FREQ -#error "Nor RT3052F nor RT3050F defined" +#error "No platform selected" #endif -#define SYSTEM_CLOCK (PLATFORM_COUNTER_FREQ/3) +#ifndef MT7620 +#define SYSTEM_CLOCK (PLATFORM_COUNTER_FREQ/3) #define SDRAM_BASE 0x00000000 #define SDRAM_END 0x03FFFFFF @@ -60,16 +63,26 @@ #define INTCTL_END 0x100002FF #define MEMCTRL_BASE 0x10000300 #define MEMCTRL_END 0x100003FF /* SDRAM & Flash/SRAM */ +#ifndef RT5350 #define PCM_BASE 0x10000400 #define PCM_END 0x100004FF +#else +#define PCM_BASE 0x10002000 +#define PCM_END 0x100027FF +#endif #define UART_BASE 0x10000500 #define UART_END 0x100005FF #define PIO_BASE 0x10000600 #define PIO_END 0x100006FF +#ifndef RT5350 #define GDMA_BASE 0x10000700 #define GDMA_END 0x100007FF /* Generic DMA */ #define NANDFC_BASE 0x10000800 #define NANDFC_END 0x100008FF /* NAND Flash Controller */ +#else +#define GDMA_BASE 0x10002800 +#define GDMA_END 0x10002FFF +#endif #define I2C_BASE 0x10000900 #define I2C_END 0x100009FF #define I2S_BASE 0x10000A00 @@ -87,23 +100,110 @@ #define ROM_END 0x10119FFF #define WLAN_BASE 0x10180000 #define WLAN_END 0x101BFFFF /* 802.11n MAC/BBP */ +#ifndef RT5350 #define USB_OTG_BASE 0x101C0000 #define USB_OTG_END 0x101FFFFF +#else +#define USB_OTG_BASE 0x101C0000 +#define USB_OTG_END 0x101C0FFF +#define USB_OHCI_BASE 0x101C1000 +#define USB_OHCI_END 0x101C1FFF +#endif #define EMEM_BASE 0x1B000000 #define EMEM_END 0x1BFFFFFF /* External SRAM/Flash */ +#ifdef RT5350 +#define BOOT_ROM_BASE 0x1C000000 +#define BOOT_ROM_END 0x1C003FFF +#endif +#ifndef RT5350 #define FLASH_BASE 0x1F000000 #define FLASH_END 0x1FFFFFFF /* Flash window */ +#endif #define OBIO_MEM_BASE SYSCTL_BASE #define OBIO_MEM_START OBIO_MEM_BASE +#ifndef RT5350 #define OBIO_MEM_END FLASH_END +#else +#define OBIO_MEM_END BOOT_ROM_END +#endif + +#else /* MT7620 */ +#define SYSTEM_CLOCK (40 * 1000 * 1000) +#define SDRAM_BASE 0x00000000 +#define SDRAM_END 0x0FFFFFFF + +#define SYSCTL_BASE 0x10000000 +#define SYSCTL_END 0x100000FF +#define TIMER_BASE 0x10000100 +#define TIMER_END 0x100001FF +#define INTCTL_BASE 0x10000200 +#define INTCTL_END 0x100002FF +#define MEMCTRL_BASE 0x10000300 +#define MEMCTRL_END 0x100003FF /* SDRAM & Flash/SRAM */ +#define PCM_BASE 0x10002000 +#define PCM_END 0x100027FF +#define UART_BASE 0x10000500 +#define UART_END 0x100005FF +#define PIO_BASE 0x10000600 +#define PIO_END 0x100006FF +#define GDMA_BASE 0x10002800 +#define GDMA_END 0x10002FFF /* Generic DMA */ +#define NANDFC_BASE 0x10000800 +#define NANDFC_END 0x100008FF /* NAND Flash Controller */ +#define I2C_BASE 0x10000900 +#define I2C_END 0x100009FF +#define I2S_BASE 0x10000A00 +#define I2S_END 0x10000AFF +#define SPI_BASE 0x10000B00 +#define SPI_END 0x10000BFF +#define UARTLITE_BASE 0x10000C00 +#define UARTLITE_END 0x10000CFF + +#define FRENG_BASE 0x10100000 +#define FRENG_END 0x1010FFFF /* Frame Engine */ +#define ETHSW_BASE 0x10110000 +#define ETHSW_END 0x10117FFF /* Ethernet Switch */ +#define ROM_BASE 0x10118000 +#define ROM_END 0x1011FFFF +#define WLAN_BASE 0x10180000 +#define WLAN_END 0x101BFFFF /* 802.11n MAC/BBP */ +#define USB_OTG_BASE 0x101C0000 +#define USB_OTG_END 0x101C0FFF +#define USB_OHCI_BASE 0x101C1000 +#define USB_OHCI_END 0x101C1FFF +#define PCIE_BASE 0x10140000 +#define PCIE_END 0x1017FFFF +#define SDHC_BASE 0x10130000 +#define SDHC_END 0x10133FFF + +#define PCIE_IO_BASE 0x10160000 +#define PCIE_IO_END 0x1016FFFF +#define PCIE_MEM_BASE 0x20000000 +#define PCIE_MEM_END 0x2FFFFFFF + +// TODO: fix below mappings? +#define EMEM_BASE 0x1B000000 +#define EMEM_END 0x1BFFFFFF /* External SRAM/Flash */ +#define FLASH_BASE 0x1F000000 +#define FLASH_END 0x1FFFFFFF /* Flash window */ + +#define OBIO_MEM_BASE SYSCTL_BASE +#define OBIO_MEM_START OBIO_MEM_BASE +#define OBIO_MEM_END FLASH_END +#endif /* System Control */ -#define SYSCTL_CHIPID0_3 0x00 /* 'R''T''3''0' */ -#define SYSCTL_CHIPID4_7 0x04 /* '5''2'' '' ' */ +#define SYSCTL_CHIPID0_3 0x00 +#define SYSCTL_CHIPID4_7 0x04 +#ifdef RT5350 +#define SYSCTL_REVID 0x0C +#endif + #define SYSCTL_SYSCFG 0x10 +#if !defined(RT5350) && !defined(MT7620) #define SYSCTL_SYSCFG_INIC_EE_SDRAM (1<<29) #define SYSCTL_SYSCFG_INIC_8MB_SDRAM (1<<28) #define SYSCTL_SYSCFG_GE0_MODE_MASK 0x03000000 @@ -129,6 +229,18 @@ #define SYSCTL_SYSCFG_SRAM_CS_MODE_WDOG_RST 1 #define SYSCTL_SYSCFG_SRAM_CS_MODE_BT_COEX 2 #define SYSCTL_SYSCFG_SDRAM_CLK_DRV (1<<0) /* 8mA/12mA */ +#endif +#ifdef RT5350 +#define SYSCTL1_SYSCFG_PULL_EN (1<<26) +#define SYSCTL1_SYSCFG_SDR_PAD_DRV_MASK 0x0700000 +#define SYSCTL1_SYSCFG_SDR_PAD_DRV_SHIFT 20 +#define SYSCTL1_SYSCFG_SDR_PAD_DRV_0 0 +#define SYSCTL1_SYSCFG_SDR_PAD_DRV_1 1 +#define SYSCTL1_SYSCFG_SDR_PAD_DRV_2 2 +#endif + +#define SYSCTL_SYSCFG1 0x14 +#define SYSCTL_SYSCFG1_USB0_HOST_MODE (1 << 10) #define SYSCTL_TESTSTAT 0x18 #define SYSCTL_TESTSTAT2 0x1C @@ -142,7 +254,10 @@ #define SYSCTL_CLKCFG0_SDRAM_CLK_SKEW_3NS_DELAY 3 #define SYSCTL_CLKCFG1 0x30 +#if !defined(RT5350) #define SYSCTL_CLKCFG1_PBUS_DIV_CLK_BY2 (1<<30) +#define SYSCTL_CLKCFG1_UPHY0_CLK_EN (1<<25) +#define SYSCTL_CLKCFG1_UPHY1_CLK_EN (1<<22) #define SYSCTL_CLKCFG1_OTG_CLK_EN (1<<18) #define SYSCTL_CLKCFG1_I2S_CLK_EN (1<<15) #define SYSCTL_CLKCFG1_I2S_CLK_SEL_EXT (1<<14) @@ -152,10 +267,21 @@ #define SYSCTL_CLKCFG1_PCM_CLK_SEL_EXT (1<<6) #define SYSCTL_CLKCFG1_PCM_CLK_DIV_MASK 0x0000003f #define SYSCTL_CLKCFG1_PCM_CLK_DIV_SHIFT 0 +#endif +#ifdef RT5350 +#define SYSCTL_CLKCFG1_SYSTICK_EN (1<<29) +#define SYSCTL_CLKCFG1_PDMA_CSR_CLK_GATE_BYP (1<<23) +#define SYSCTL_CLKCFG1_UPHY0_CLK_EN (1<<18) +#endif #define SYSCTL_RSTCTRL 0x34 #define SYSCTL_RSTCTRL_ETHSW (1<<23) +#if !defined(MT7620) && !defined(RT5350) #define SYSCTL_RSTCTRL_OTG (1<<22) +#else +#define SYSCTL_RSTCTRL_UPHY0 (1<<25) +#define SYSCTL_RSTCTRL_UPHY1 (1<<22) +#endif #define SYSCTL_RSTCTRL_FRENG (1<<21) #define SYSCTL_RSTCTRL_WLAN (1<<20) #define SYSCTL_RSTCTRL_UARTL (1<<19) @@ -196,6 +322,9 @@ #define SYSCTL_MEMO0 0x68 #define SYSCTL_MEMO1 0x6C +#define SYSCTL_PPLL_CFG1 0x9C +#define SYSCTL_PPLL_DRV 0xA0 + /* Timer */ #define TIMER_TMRSTAT 0x00 #define TIMER_TMRSTAT_TMR1RST (1<<5) @@ -249,7 +378,10 @@ #define IC_OTG 18 #define IC_ETHSW 17 +#define IC_R2P 15 +#define IC_SDHC 14 #define IC_UARTLITE 12 +#define IC_SPI 11 #define IC_I2S 10 #define IC_PERFC 9 #define IC_NAND 8 @@ -362,7 +494,39 @@ */ #define GDMACT0_SWMODE (1<<0) +/* SPI controller interface */ + +#define RT305X_SPISTAT 0x00 +/* SPIBUSY is alias for SPIBUSY, because SPISTAT have only BUSY bit*/ +#define RT305X_SPIBUSY RT305X_SPISTAT + +#define RT305X_SPICFG 0x10 +#define MSBFIRST (1<<8) +#define SPICLKPOL (1<<6) +#define CAPT_ON_CLK_FALL (1<<5) +#define TX_ON_CLK_FALL (1<<4) +#define HIZSPI (1<<3) /* Set SPI pins to Tri-state */ +#define SPI_CLK_SHIFT 0 /* SPI clock divide control */ +#define SPI_CLK_MASK 0x00000007 +#define SPI_CLK_DIV2 0 +#define SPI_CLK_DIV4 1 +#define SPI_CLK_DIV8 2 +#define SPI_CLK_DIV16 3 +#define SPI_CLK_DIV32 4 +#define SPI_CLK_DIV64 5 +#define SPI_CLK_DIV128 6 +#define SPI_CLK_DISABLED 7 + +#define RT305X_SPICTL 0x14 +#define HIZSMOSI (1<<3) +#define START_WRITE (1<<2) +#define START_READ (1<<1) +#define CS_HIGH (1<<0) +#define RT305X_SPIDATA 0x20 +#define SPIDATA_MASK 0x000000ff +#define RT305X_SPI_WRITE 1 +#define RT305X_SPI_READ 0 #endif /* _RT305XREG_H_ */ From owner-svn-src-all@freebsd.org Thu Dec 24 18:33:09 2015 Return-Path: Delivered-To: svn-src-all@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 57099A50941; Thu, 24 Dec 2015 18:33:09 +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 26B451C85; Thu, 24 Dec 2015 18:33:09 +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 tBOIX8lU061928; Thu, 24 Dec 2015 18:33:08 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOIX8pV061926; Thu, 24 Dec 2015 18:33:08 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512241833.tBOIX8pV061926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 24 Dec 2015 18:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292700 - head/sys/mips/rt305x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 18:33:09 -0000 Author: adrian Date: Thu Dec 24 18:33:08 2015 New Revision: 292700 URL: https://svnweb.freebsd.org/changeset/base/292700 Log: [rt305x] add PCI bus / resource allocation code for the MT7620. This is based on the sys/arm/mv/ pci resource/allocation code. Submitted by: Stanislav Galabov Added: head/sys/mips/rt305x/rt305x_pci.c (contents, props changed) head/sys/mips/rt305x/rt305x_pcireg.h (contents, props changed) Added: head/sys/mips/rt305x/rt305x_pci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/rt305x/rt305x_pci.c Thu Dec 24 18:33:08 2015 (r292700) @@ -0,0 +1,955 @@ +/*- + * Copyright (c) 2015 Stanislav Galabov. + * + * 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. + * + * This is based on the pci allocator code from sys/dev/arm/mv/: + * + * Copyright (c) 2008 MARVELL INTERNATIONAL LTD. + * Copyright (c) 2010 The FreeBSD Foundation + * Copyright (c) 2010-2012 Semihalf + * All rights reserved. + * + * Developed by Semihalf. + */ +#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 "pcib_if.h" + +#include +#include +#include + +struct mtx rt305x_pci_mtx; +MTX_SYSINIT(rt305x_pci_mtx, &rt305x_pci_mtx, "rt305x PCI/PCIe mutex", MTX_SPIN); + +struct rt305x_pci_softc { + device_t sc_dev; + + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + + int sc_busno; + + struct rman sc_mem_rman; + struct rman sc_io_rman; + struct rman sc_irq_rman; + + bus_addr_t sc_mem_base; + bus_addr_t sc_mem_size; + uint32_t sc_mem_map[(256*1024*1024) / + (PCI_MIN_MEM_ALLOC * BITS_PER_UINT32)]; + + bus_addr_t sc_io_base; + bus_addr_t sc_io_size; + uint32_t sc_io_map[(16*1024*1024) / + (PCI_MIN_IO_ALLOC * BITS_PER_UINT32)]; + + struct intr_event *sc_eventstab[RT305X_PCI_NIRQS]; + mips_intrcnt_t sc_intr_counter[RT305X_PCI_NIRQS]; + + int pcie_link_status; +}; + +static void rt305x_pci_phy_init(device_t); +static void rt305x_pci_init(device_t); +static int rt305x_pcib_init(device_t, int, int); +static int rt305x_pci_intr(void *); + +static void rt305x_pci_dump_regs(device_t); + +static struct rt305x_pci_softc *rt_sc = NULL; + +static int +rt305x_pci_probe(device_t dev) +{ + + return (BUS_PROBE_NOWILDCARD); +} + +static int +rt305x_pci_attach(device_t dev) +{ + struct rt305x_pci_softc *sc = device_get_softc(dev); + + rt_sc = sc; + + sc->sc_dev = dev; + sc->sc_mem_base = PCIE_MEM_BASE; + sc->sc_mem_size = 0x10000000; + sc->sc_io_base = PCIE_IO_BASE; + sc->sc_io_size = 0x10000; + + sc->sc_bsh = MIPS_PHYS_TO_KSEG1(PCIE_BASE); + sc->sc_bst = mips_bus_space_generic; + + sc->sc_mem_rman.rm_type = RMAN_ARRAY; + sc->sc_mem_rman.rm_descr = "rt305x pci memory window"; + if (rman_init(&sc->sc_mem_rman) != 0 || + rman_manage_region(&sc->sc_mem_rman, sc->sc_mem_base, + sc->sc_mem_base + sc->sc_mem_size - 1) != 0) { + panic("%s: failed to set up memory rman", __FUNCTION__); + } + + sc->sc_io_rman.rm_type = RMAN_ARRAY; + sc->sc_io_rman.rm_descr = "rt305x pci io window"; + if (rman_init(&sc->sc_io_rman) != 0 || + rman_manage_region(&sc->sc_io_rman, sc->sc_io_base, + sc->sc_io_base + sc->sc_io_size - 1) != 0) { + panic("%s: failed to set up io rman", __FUNCTION__); + } + + sc->sc_irq_rman.rm_type = RMAN_ARRAY; + sc->sc_irq_rman.rm_descr = "rt305x pci irqs"; + if (rman_init(&sc->sc_irq_rman) != 0 || + rman_manage_region(&sc->sc_irq_rman, RT305X_PCIE0_IRQ, + RT305X_PCIE0_IRQ) != 0) { + panic("%s: failed to set up irq rman", __FUNCTION__); + } + + cpu_establish_hardintr("pci", rt305x_pci_intr, NULL, sc, + RT305X_PCI_INTR_PIN, INTR_TYPE_MISC | INTR_EXCL, NULL); + + rt305x_pci_phy_init(dev); + + rt305x_pci_init(dev); + + rt305x_pci_dump_regs(dev); + + rt305x_pcib_init(dev, 0, PCI_SLOTMAX); + + device_add_child(dev, "pci", -1); + + return (bus_generic_attach(dev)); +} + +static int +rt305x_pci_read_ivar(device_t dev, device_t child, int which, + uintptr_t *result) +{ + struct rt305x_pci_softc *sc = device_get_softc(dev); + + switch (which) { + case PCIB_IVAR_DOMAIN: + *result = device_get_unit(dev); + return (0); + case PCIB_IVAR_BUS: + *result = sc->sc_busno; + return (0); + } + + return (ENOENT); +} + +static int +rt305x_pci_write_ivar(device_t dev, device_t child, int which, + uintptr_t result) +{ + struct rt305x_pci_softc *sc = device_get_softc(dev); + + switch (which) { + case PCIB_IVAR_BUS: + sc->sc_busno = result; + return (0); + } + + return (ENOENT); +} + +static struct resource * +rt305x_pci_alloc_resource(device_t bus, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct rt305x_pci_softc *sc = device_get_softc(bus); + struct resource *rv; + struct rman *rm; + vm_offset_t va; + + switch (type) { + case SYS_RES_IRQ: + rm = &sc->sc_irq_rman; + break; + case SYS_RES_IOPORT: + rm = &sc->sc_io_rman; + break; + case SYS_RES_MEMORY: + rm = &sc->sc_mem_rman; + break; + default: + return (NULL); + } + + rv = rman_reserve_resource(rm, start, end, count, flags, child); + + if (rv == NULL) + return (NULL); + + rman_set_rid(rv, *rid); + + if (type != SYS_RES_IRQ) { + if (type == SYS_RES_MEMORY) { + va = (vm_offset_t)pmap_mapdev(start, count); + } else if (type == SYS_RES_IOPORT){ + va = (vm_offset_t)MIPS_PHYS_TO_KSEG1(start); + } + rman_set_bushandle(rv, va); + rman_set_virtual(rv, (void *)va); + rman_set_bustag(rv, mips_bus_space_generic); + } + + if (flags & RF_ACTIVE) { + if (bus_activate_resource(child, type, *rid, rv)) { + rman_release_resource(rv); + return (NULL); + } + } + + return (rv); +} + +static int +rt305x_pci_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + + return rman_activate_resource(r); +} + +static inline int +rt305x_idx_to_irq(int idx) +{ + + return ((idx == 0) ? RT305X_PCIE0_IRQ : + (idx == 1) ? RT305X_PCIE1_IRQ : + (idx == 2) ? RT305X_PCIE2_IRQ : -1); +} + +static inline int +rt305x_irq_to_idx(int irq) +{ + + return ((irq == RT305X_PCIE0_IRQ) ? 0 : + (irq == RT305X_PCIE1_IRQ) ? 1 : + (irq == RT305X_PCIE2_IRQ) ? 2 : -1); +} + +static void +rt305x_pci_mask_irq(void *source) +{ + + RT_WRITE32(rt_sc, RT305X_PCI_PCIENA, + RT_READ32(rt_sc, RT305X_PCI_PCIENA) & ~(1<<((int)source))); +} + +static void +rt305x_pci_unmask_irq(void *source) +{ + + RT_WRITE32(rt_sc, RT305X_PCI_PCIENA, + RT_READ32(rt_sc, RT305X_PCI_PCIENA) | (1<<((int)source))); +} + +static int +rt305x_pci_setup_intr(device_t bus, device_t child, struct resource *ires, + int flags, driver_filter_t *filt, driver_intr_t *handler, + void *arg, void **cookiep) +{ + struct rt305x_pci_softc *sc = device_get_softc(bus); + struct intr_event *event; + int irq, error, irqidx; + + irq = rman_get_start(ires); + + if ((irqidx = rt305x_irq_to_idx(irq)) == -1) + panic("%s: bad irq %d", __FUNCTION__, irq); + + event = sc->sc_eventstab[irqidx]; + if (event == NULL) { + error = intr_event_create(&event, (void *)irq, 0, irq, + rt305x_pci_mask_irq, rt305x_pci_unmask_irq, NULL, NULL, + "pci intr%d:", irq); + + if (error == 0) { + sc->sc_eventstab[irqidx] = event; + sc->sc_intr_counter[irqidx] = + mips_intrcnt_create(event->ie_name); + } + else + return (error); + } + + intr_event_add_handler(event, device_get_nameunit(child), filt, + handler, arg, intr_priority(flags), flags, cookiep); + + mips_intrcnt_setname(sc->sc_intr_counter[irqidx], event->ie_fullname); + + rt305x_pci_unmask_irq((void*)irq); + + return (0); +} + +static int +rt305x_pci_teardown_intr(device_t dev, device_t child, struct resource *ires, + void *cookie) +{ + struct rt305x_pci_softc *sc = device_get_softc(dev); + int irq, result, irqidx; + + irq = rman_get_start(ires); + if ((irqidx = rt305x_irq_to_idx(irq)) == -1) + panic("%s: bad irq %d", __FUNCTION__, irq); + + if (sc->sc_eventstab[irqidx] == NULL) + panic("Trying to teardown unoccupied IRQ"); + + rt305x_pci_mask_irq((void*)irq); + + result = intr_event_remove_handler(cookie); + if (!result) + sc->sc_eventstab[irqidx] = NULL; + + return (result); +} + +static inline uint32_t +rt305x_pci_make_addr(int bus, int slot, int func, int reg) +{ + uint32_t addr; + + addr = (((reg & 0xf00) >> 8) << 24) | (bus << 16) | (slot << 11) | + (func << 8) | (reg & 0xfc) | (1 << 31); + + return (addr); +} + +static int +rt305x_pci_maxslots(device_t dev) +{ + + return (PCI_SLOTMAX); +} + +static uint32_t +rt305x_pci_read_config(device_t dev, u_int bus, u_int slot, u_int func, + u_int reg, int bytes) +{ + struct rt305x_pci_softc *sc = device_get_softc(dev); + uint32_t addr = 0, data = 0; + + if (bus == 0 && (sc->pcie_link_status & (1<pcie_link_status & (1<sc_mem_base); + RT_WRITE32(sc, RT305X_PCI_IOBASE, sc->sc_io_base); + + RT_WRITE32(sc, RT305X_PCI_PCICFG, RT_READ32(sc, 0) & ~(1<<1)); + DELAY(500000); + if ((RT_READ32(sc, RT305X_PCI_PCIE0_STATUS) & 0x1) == 1) + sc->pcie_link_status = 1; + else + sc->pcie_link_status = 0; + + RT_WRITE32(sc, RT305X_PCI_PCIE0_BAR0SETUP, 0x7FFF0001); + RT_WRITE32(sc, RT305X_PCI_PCIE0_BAR1SETUP, 0x00000000); + RT_WRITE32(sc, RT305X_PCI_PCIE0_IMBASEBAR0, 0x00000000); + RT_WRITE32(sc, RT305X_PCI_PCIE0_CLASS, 0x06040001); + + tmp = rt305x_pci_read_config(dev, 0, 0, 0, 4, 4); + rt305x_pci_write_config(dev, 0, 0, 0, 4, tmp | 0x7, 4); + tmp = rt305x_pci_read_config(dev, 0, 0, 0, 0x70c, 4); + tmp &= ~(0xff)<<8; + tmp |= 0x50<<8; + rt305x_pci_write_config(dev, 0, 0, 0, 0x70c, tmp, 4); + tmp = rt305x_pci_read_config(dev, 0, 0, 0, 0x70c, 4); + + rt305x_pci_write_config(dev, 0, 0, 0, PCIR_BAR(0), 0, 4); +} + +static inline uint32_t +pcib_bit_get(uint32_t *map, uint32_t bit) +{ + uint32_t n = bit / BITS_PER_UINT32; + + bit = bit % BITS_PER_UINT32; + return (map[n] & (1 << bit)); +} + +static inline void +pcib_bit_set(uint32_t *map, uint32_t bit) +{ + uint32_t n = bit / BITS_PER_UINT32; + + bit = bit % BITS_PER_UINT32; + map[n] |= (1 << bit); +} + +static inline uint32_t +pcib_map_check(uint32_t *map, uint32_t start, uint32_t bits) +{ + uint32_t i; + + for (i = start; i < start + bits; i++) + if (pcib_bit_get(map, i)) + return (0); + + return (1); +} + +static inline void +pcib_map_set(uint32_t *map, uint32_t start, uint32_t bits) +{ + uint32_t i; + + for (i = start; i < start + bits; i++) + pcib_bit_set(map, i); +} + +static bus_addr_t +pcib_alloc(device_t dev, uint32_t smask) +{ + struct rt305x_pci_softc *sc = device_get_softc(dev); + uint32_t bits, bits_limit, i, *map, min_alloc, size; + bus_addr_t addr = 0; + bus_addr_t base; + + if (smask & 1) { + base = sc->sc_io_base; + min_alloc = PCI_MIN_IO_ALLOC; + bits_limit = sc->sc_io_size / min_alloc; + map = sc->sc_io_map; + smask &= ~0x3; + } else { + base = sc->sc_mem_base; + min_alloc = PCI_MIN_MEM_ALLOC; + bits_limit = sc->sc_mem_size / min_alloc; + map = sc->sc_mem_map; + smask &= ~0xF; + } + + size = ~smask + 1; + bits = size / min_alloc; + + for (i = 0; i + bits <= bits_limit; i+= bits) + if (pcib_map_check(map, i, bits)) { + pcib_map_set(map, i, bits); + addr = base + (i * min_alloc); + return (addr); + } + + return (addr); +} + +static int +rt305x_pcib_init_bar(device_t dev, int bus, int slot, int func, int barno) +{ + uint32_t addr, bar; + int reg, width; + + reg = PCIR_BAR(barno); + + rt305x_pci_write_config(dev, bus, slot, func, reg, ~0, 4); + bar = rt305x_pci_read_config(dev, bus, slot, func, reg, 4); + if (bar == 0) + return (1); + + /* Calculate BAR size: 64 or 32 bit (in 32-bit units) */ + width = ((bar & 7) == 4) ? 2 : 1; + + addr = pcib_alloc(dev, bar); + if (!addr) + return (-1); + + if (bootverbose) + printf("PCI %u:%u:%u: reg %x: smask=%08x: addr=%08x\n", + bus, slot, func, reg, bar, addr); + + rt305x_pci_write_config(dev, bus, slot, func, reg, addr, 4); + if (width == 2) + rt305x_pci_write_config(dev, bus, slot, func, reg + 4, 0, 4); + + return (width); +} + +static int +rt305x_pcib_init_all_bars(device_t dev, int bus, int slot, int func, + int hdrtype) +{ + int maxbar, bar, i; + + maxbar = (hdrtype & PCIM_HDRTYPE) ? 0 : 6; + bar = 0; + + while (bar < maxbar) { + i = rt305x_pcib_init_bar(dev, bus, slot, func, bar); + bar += i; + if (i < 0) { + device_printf(dev, "PCI IO/Memory space exhausted\n"); + return (ENOMEM); + } + } + + return (0); +} + +static inline int +rt305x_pci_slot_has_link(device_t dev, int slot) +{ + struct rt305x_pci_softc *sc = device_get_softc(dev); + + return !!(sc->pcie_link_status & (1<sc_io_base; + io_limit = io_base + sc->sc_io_size - 1; + mem_base = sc->sc_mem_base; + mem_limit = mem_base + sc->sc_mem_size - 1; + + rt305x_pci_write_config(dev, bus, slot, func, PCIR_IOBASEL_1, + io_base >> 8, 1); + rt305x_pci_write_config(dev, bus, slot, func, PCIR_IOBASEH_1, + io_base >> 16, 2); + rt305x_pci_write_config(dev, bus, slot, func, PCIR_IOLIMITL_1, + io_limit >> 8, 1); + rt305x_pci_write_config(dev, bus, slot, func, PCIR_IOLIMITH_1, + io_limit >> 16, 2); + + rt305x_pci_write_config(dev, bus, slot, func, PCIR_MEMBASE_1, + mem_base >> 16, 2); + rt305x_pci_write_config(dev, bus, slot, func, PCIR_MEMLIMIT_1, + mem_limit >> 16, 2); + + rt305x_pci_write_config(dev, bus, slot, func, PCIR_PMBASEL_1, + 0x10, 2); + rt305x_pci_write_config(dev, bus, slot, func, PCIR_PMBASEH_1, + 0x0, 4); + rt305x_pci_write_config(dev, bus, slot, func, PCIR_PMLIMITL_1, + 0xF, 2); + rt305x_pci_write_config(dev, bus, slot, func, PCIR_PMLIMITH_1, + 0x0, 4); + + secbus = rt305x_pci_read_config(dev, bus, slot, func, PCIR_SECBUS_1, 1); + + if (secbus == 0) { + rt305x_pci_write_config(dev, bus, slot, func, PCIR_SECBUS_1, + ++cur_secbus, 1); + rt305x_pci_write_config(dev, bus, slot, func, PCIR_SUBBUS_1, + cur_secbus, 1); + secbus = cur_secbus; + } + + rt305x_pcib_init(dev, secbus, PCI_SLOTMAX); +} + +static int +rt305x_pcib_init(device_t dev, int bus, int maxslot) +{ + int slot, func, maxfunc, error; + uint8_t hdrtype, command, class, subclass; + + for (slot = 0; slot <= maxslot; slot++) { + maxfunc = 0; + for (func = 0; func <= maxfunc; func++) { + hdrtype = rt305x_pci_read_config(dev, bus, slot, func, + PCIR_HDRTYPE, 1); + + if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) + continue; + + if (func == 0 && (hdrtype & PCIM_MFDEV)) + maxfunc = PCI_FUNCMAX; + + command = rt305x_pci_read_config(dev, bus, slot, func, + PCIR_COMMAND, 1); + command &= ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN); + rt305x_pci_write_config(dev, bus, slot, func, + PCIR_COMMAND, command, 1); + + error = rt305x_pcib_init_all_bars(dev, bus, slot, func, + hdrtype); + + if (error) + return (error); + + command |= PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN | + PCIM_CMD_PORTEN; + rt305x_pci_write_config(dev, bus, slot, func, + PCIR_COMMAND, command, 1); + + rt305x_pci_write_config(dev, bus, slot, func, + PCIR_CACHELNSZ, 16, 1); + + class = rt305x_pci_read_config(dev, bus, slot, func, + PCIR_CLASS, 1); + subclass = rt305x_pci_read_config(dev, bus, slot, func, + PCIR_SUBCLASS, 1); + + if (class != PCIC_BRIDGE || subclass != PCIS_BRIDGE_PCI) + continue; + + rt305x_pcib_init_bridge(dev, bus, slot, func); + } + } + + return (0); +} + +#define BUSY 0x80000000 +#define WAITRETRY_MAX 10 +#define WRITE_MODE (1<<23) +#define DATA_SHIFT 0 +#define ADDR_SHIFT 8 + +static int +rt305x_wait_pci_phy_busy(struct rt305x_pci_softc *sc) +{ + uint32_t reg_value = 0x0, retry = 0; + + while (1) { + reg_value = RT_READ32(sc, RT305X_PCI_PHY0_CFG); + if (reg_value & BUSY) + DELAY(100000); + else + break; + if (retry++ > WAITRETRY_MAX) { + printf("PHY retry failed\n"); + return (-1); + } + } + return (0); +} + +static uint32_t +rt305x_pci_phy(struct rt305x_pci_softc *sc, char rwmode, uint32_t addr, + uint32_t val) +{ + uint32_t reg_value = 0x0; + + rt305x_wait_pci_phy_busy(sc); + if (rwmode == 'w') { + reg_value |= WRITE_MODE; + reg_value |= (val) << DATA_SHIFT; + } + reg_value |= (addr) << ADDR_SHIFT; + + RT_WRITE32(sc, RT305X_PCI_PHY0_CFG, reg_value); + DELAY(1000); + + rt305x_wait_pci_phy_busy(sc); + + if (rwmode == 'r') { + reg_value = RT_READ32(sc, RT305X_PCI_PHY0_CFG); + return (reg_value); + } + + return (0); +} + +static void +rt305x_pci_phy_init(device_t dev) +{ + struct rt305x_pci_softc *sc = device_get_softc(dev); + uint32_t tmp; + + rt305x_pci_phy(sc, 'w', 0x00, 0x80); + rt305x_pci_phy(sc, 'w', 0x01, 0x04); + rt305x_pci_phy(sc, 'w', 0x68, 0x84); + + rt305x_sysctl_set(SYSCTL_RSTCTRL, + rt305x_sysctl_get(SYSCTL_RSTCTRL) | (1<<26)); + rt305x_sysctl_set(SYSCTL_CLKCFG1, + rt305x_sysctl_get(SYSCTL_CLKCFG1) & ~(1<<26)); + + tmp = rt305x_sysctl_get(SYSCTL_PPLL_CFG1); + tmp &= ~(1<<19); + rt305x_sysctl_set(SYSCTL_PPLL_CFG1, tmp); + tmp |= (1<<31); + rt305x_sysctl_set(SYSCTL_PPLL_CFG1, tmp); +} + +static int +rt305x_pci_intr(void *arg) +{ + struct rt305x_pci_softc *sc = arg; + struct intr_event *event; + uint32_t reg, irq, irqidx; + + reg = RT_READ32(sc, RT305X_PCI_PCIINT); + + for (irqidx = 0; irqidx < RT305X_PCI_NIRQS; irqidx++) { + irq = rt305x_idx_to_irq(irqidx); + if (reg & (1<sc_eventstab[irqidx]; + if (!event || TAILQ_EMPTY(&event->ie_handlers)) { + if (irq != 0) + printf("Stray PCI IRQ %d\n", irq); + continue; + } + + intr_event_handle(event, NULL); + mips_intrcnt_inc(sc->sc_intr_counter[irqidx]); + } + } + + return (FILTER_HANDLED); +} Added: head/sys/mips/rt305x/rt305x_pcireg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/rt305x/rt305x_pcireg.h Thu Dec 24 18:33:08 2015 (r292700) @@ -0,0 +1,76 @@ +/*- + * Copyright (c) 2015 Stanislav Galabov. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef __RT305X_PCIREG_H__ +#define __RT305X_PCIREG_H__ + +#define RT305X_PCI_NIRQS 1 +#define RT305X_PCI_BASESLOT 0 + +#define RT305X_PCI_PCICFG 0x0000 +#define RT305X_PCI_PCIINT 0x0008 +#define RT305X_PCI_PCIENA 0x000C +#define RT305X_PCI_CFGADDR 0x0020 +#define RT305X_PCI_CFGDATA 0x0024 +#define RT305X_PCI_MEMBASE 0x0028 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 24 18:34:47 2015 Return-Path: Delivered-To: svn-src-all@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 7F2FAA50A19; Thu, 24 Dec 2015 18:34:47 +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 408B71E0C; Thu, 24 Dec 2015 18:34:47 +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 tBOIYkmg062020; Thu, 24 Dec 2015 18:34:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOIYkBP062019; Thu, 24 Dec 2015 18:34:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512241834.tBOIYkBP062019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 24 Dec 2015 18:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292701 - head/sys/mips/rt305x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 18:34:47 -0000 Author: adrian Date: Thu Dec 24 18:34:46 2015 New Revision: 292701 URL: https://svnweb.freebsd.org/changeset/base/292701 Log: [MT7620] add SPI device support. Submitted by: Alexander A. Mityaev Added: head/sys/mips/rt305x/rt305x_spi.c (contents, props changed) Added: head/sys/mips/rt305x/rt305x_spi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/rt305x/rt305x_spi.c Thu Dec 24 18:34:46 2015 (r292701) @@ -0,0 +1,350 @@ +/*- + * Copyright (c) 2009, Oleksandr Tymoshenko + * Copyright (c) 2011, Aleksandr Rybalko + * Copyright (c) 2013, Alexander A. Mityaev + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +//#include + +#include +#include +#include "spibus_if.h" + +#include "opt_platform.h" + +#ifdef FDT +#include +#include +#include +#endif + +#include +#include + +#undef RT305X_SPI_DEBUG +#ifdef RT305X_SPI_DEBUG +#define dprintf printf +#else +#define dprintf(x, arg...) +#endif + +/* + * register space access macros + */ +#define SPI_WRITE(sc, reg, val) do { \ + bus_write_4(sc->sc_mem_res, (reg), (val)); \ + } while (0) + +#define SPI_READ(sc, reg) bus_read_4(sc->sc_mem_res, (reg)) + +#define SPI_SET_BITS(sc, reg, bits) \ + SPI_WRITE(sc, reg, SPI_READ(sc, (reg)) | (bits)) + +#define SPI_CLEAR_BITS(sc, reg, bits) \ + SPI_WRITE(sc, reg, SPI_READ(sc, (reg)) & ~(bits)) + +struct rt305x_spi_softc { + device_t sc_dev; + struct resource *sc_mem_res; +}; + +static int rt305x_spi_probe(device_t); +static int rt305x_spi_attach(device_t); +static int rt305x_spi_detach(device_t); +static int rt305x_spi_wait(struct rt305x_spi_softc *); +static void rt305x_spi_chip_activate(struct rt305x_spi_softc *); +static void rt305x_spi_chip_deactivate(struct rt305x_spi_softc *); +static uint8_t rt305x_spi_txrx(struct rt305x_spi_softc *, uint8_t *, int); +static int rt305x_spi_transfer(device_t, device_t, struct spi_command *); +#ifdef FDT +static phandle_t rt305x_spi_get_node(device_t, device_t); +#endif + +static int +rt305x_spi_probe(device_t dev) +{ +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "ralink,rt305x-spi")) + return(ENXIO); +#endif + device_set_desc(dev, "RT305X SPI"); + return (0); +} + +static int +rt305x_spi_attach(device_t dev) +{ + struct rt305x_spi_softc *sc = device_get_softc(dev); + int rid; + + sc->sc_dev = dev; + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "Could not map memory\n"); + return (ENXIO); + } + + if (rt305x_spi_wait(sc)) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + return (EBUSY); + } + + SPI_WRITE(sc, RT305X_SPICFG, MSBFIRST | SPICLKPOL | TX_ON_CLK_FALL | + SPI_CLK_DIV8); /* XXX: make it configurable */ + /* + * W25Q64CV max 104MHz, bus 120-192 MHz, so divide by 2. + * Update: divide by 4, DEV2 to fast for flash. + */ + + device_add_child(dev, "spibus", 0); + return (bus_generic_attach(dev)); +} + +static int +rt305x_spi_detach(device_t dev) +{ + struct rt305x_spi_softc *sc = device_get_softc(dev); + + SPI_SET_BITS(sc, RT305X_SPICTL, HIZSMOSI | CS_HIGH); + + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + + return (0); +} + +static void +rt305x_spi_chip_activate(struct rt305x_spi_softc *sc) +{ +// printf("%s\n", __func__); + rt305x_spi_wait(sc); + /* + * Put all CSx to low + */ + SPI_CLEAR_BITS(sc, RT305X_SPICTL, CS_HIGH | HIZSMOSI); +} + +static void +rt305x_spi_chip_deactivate(struct rt305x_spi_softc *sc) +{ +// printf("%s\n", __func__); + rt305x_spi_wait(sc); + /* + * Put all CSx to high + */ + SPI_SET_BITS(sc, RT305X_SPICTL, CS_HIGH | HIZSMOSI); +} + +static int +rt305x_spi_wait(struct rt305x_spi_softc *sc) +{ + int i = 1000; + + while (i--) { + if (!SPI_READ(sc, RT305X_SPIBUSY)) + break; + } + if (i == 0) { + printf("busy\n"); + return (1); + } + + return (0); +} + +static uint8_t +rt305x_spi_txrx(struct rt305x_spi_softc *sc, uint8_t *data, int write) +{ + + if (rt305x_spi_wait(sc)) + return (EBUSY); + + if (write == RT305X_SPI_WRITE) { + SPI_WRITE(sc, RT305X_SPIDATA, *data); + SPI_SET_BITS(sc, RT305X_SPICTL, START_WRITE); + //printf("%s(W:%d)\n", __func__, *data); + } else {/* RT305X_SPI_READ */ + SPI_SET_BITS(sc, RT305X_SPICTL, START_READ); + if (rt305x_spi_wait(sc)) + return (EBUSY); + + *data = SPI_READ(sc, RT305X_SPIDATA) & 0xff; + //printf("%s(R:%d)\n", __func__, *data); + } + return (0); +} + +static int +rt305x_spi_transfer(device_t dev, device_t child, struct spi_command *cmd) +{ + struct rt305x_spi_softc *sc; + uint8_t *buf, byte, *tx_buf; + struct spibus_ivar *devi = SPIBUS_IVAR(child); + int i, sz, error = 0, write = 0; + + sc = device_get_softc(dev); + + if (devi->cs != 0) + /* Only 1 CS */ + return (ENXIO); + + /* There is always a command to transfer. */ + tx_buf = (uint8_t *)(cmd->tx_cmd); + + /* Perform some fixup because RT305X dont support duplex SPI */ + switch(tx_buf[0]) { + case CMD_READ_IDENT: + cmd->tx_cmd_sz = 1; + cmd->rx_cmd_sz = 3; + break; + case CMD_WRITE_ENABLE: + case CMD_WRITE_DISABLE: + cmd->tx_cmd_sz = 1; + cmd->rx_cmd_sz = 0; + break; + case CMD_READ_STATUS: + cmd->tx_cmd_sz = 1; + cmd->rx_cmd_sz = 1; + break; + case CMD_READ: + cmd->tx_cmd_sz = 4; + case CMD_FAST_READ: + cmd->tx_cmd_sz = 5; + cmd->rx_cmd_sz = cmd->tx_data_sz = 0; + break; + case CMD_SECTOR_ERASE: + cmd->tx_cmd_sz = 4; + cmd->rx_cmd_sz = cmd->tx_data_sz = 0; + break; + case CMD_PAGE_PROGRAM: + cmd->tx_cmd_sz = 4; + cmd->rx_cmd_sz = cmd->rx_data_sz = 0; + break; + } + + rt305x_spi_chip_activate(sc); + + if (cmd->tx_cmd_sz + cmd->rx_cmd_sz) { + buf = (uint8_t *)(cmd->rx_cmd); + tx_buf = (uint8_t *)(cmd->tx_cmd); + sz = cmd->tx_cmd_sz + cmd->rx_cmd_sz; + + for (i = 0; i < sz; i++) { + if(i < cmd->tx_cmd_sz) { + byte = tx_buf[i]; + error = rt305x_spi_txrx(sc, &byte, + RT305X_SPI_WRITE); + if (error) + goto rt305x_spi_transfer_fail; + continue; + } + error = rt305x_spi_txrx(sc, &byte, + RT305X_SPI_READ); + if (error) + goto rt305x_spi_transfer_fail; + buf[i] = byte; + } + } + + /* + * Transfer/Receive data + */ + + if (cmd->tx_data_sz + cmd->rx_data_sz) { + write = (cmd->tx_data_sz > 0)?1:0; + buf = (uint8_t *)(write ? cmd->tx_data : cmd->rx_data); + sz = write ? cmd->tx_data_sz : cmd->rx_data_sz; + + for (i = 0; i < sz; i++) { + byte = buf[i]; + error = rt305x_spi_txrx(sc, &byte, + write?RT305X_SPI_WRITE:RT305X_SPI_READ); + if (error) + goto rt305x_spi_transfer_fail; + buf[i] = byte; + } + } +rt305x_spi_transfer_fail: + rt305x_spi_chip_deactivate(sc); + + return (error); +} + +#ifdef FDT +static phandle_t +rt305x_spi_get_node(device_t bus, device_t dev) +{ + + /* We only have one child, the SPI bus, which needs our own node. */ + return (ofw_bus_get_node(bus)); +} +#endif + +static device_method_t rt305x_spi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, rt305x_spi_probe), + DEVMETHOD(device_attach, rt305x_spi_attach), + DEVMETHOD(device_detach, rt305x_spi_detach), + + DEVMETHOD(spibus_transfer, rt305x_spi_transfer), + +#ifdef FDT + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, rt305x_spi_get_node), +#endif + + DEVMETHOD_END +}; + +static driver_t rt305x_spi_driver = { + .name = "spi", + .methods = rt305x_spi_methods, + .size = sizeof(struct rt305x_spi_softc), +}; + +static devclass_t rt305x_spi_devclass; + +DRIVER_MODULE(rt305x_spi, obio, rt305x_spi_driver, rt305x_spi_devclass, 0, 0); +#ifdef FDT +DRIVER_MODULE(rt305x_spi, simplebus, rt305x_spi_driver, rt305x_spi_devclass, 0, 0); +#endif From owner-svn-src-all@freebsd.org Thu Dec 24 18:36:09 2015 Return-Path: Delivered-To: svn-src-all@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 D4C51A50AB8; Thu, 24 Dec 2015 18:36:09 +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 A075D1F7F; Thu, 24 Dec 2015 18:36:09 +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 tBOIa81l062112; Thu, 24 Dec 2015 18:36:08 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOIa8hA062110; Thu, 24 Dec 2015 18:36:08 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512241836.tBOIa8hA062110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 24 Dec 2015 18:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292702 - head/sys/mips/rt305x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 18:36:10 -0000 Author: adrian Date: Thu Dec 24 18:36:08 2015 New Revision: 292702 URL: https://svnweb.freebsd.org/changeset/base/292702 Log: [MT7620] add ehci/ohci USB support. The newer chips don't use OTG; they're more traditional USB. Submitted by: Stanislav Galabov Added: head/sys/mips/rt305x/rt305x_ehci.c (contents, props changed) head/sys/mips/rt305x/rt305x_ohci.c (contents, props changed) Added: head/sys/mips/rt305x/rt305x_ehci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/rt305x/rt305x_ehci.c Thu Dec 24 18:36:08 2015 (r292702) @@ -0,0 +1,245 @@ +#include +__FBSDID("$FreeBSD$"); + +/*- + * Copyright (c) 2015 Stanislav Galabov. All rights reserved. + * Copyright (c) 2010,2011 Aleksandr Rybalko. All rights reserved. + * Copyright (c) 2007-2008 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + +#define EHCI_HC_DEVSTR "Ralink integrated USB 2.0 controller" + +static device_probe_t ehci_obio_probe; +static device_attach_t ehci_obio_attach; +static device_detach_t ehci_obio_detach; + +static int +ehci_obio_probe(device_t self) +{ + device_set_desc(self, EHCI_HC_DEVSTR); + + return (BUS_PROBE_DEFAULT); +} + +static int +ehci_obio_attach(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + uint32_t reg; + int err; + int rid; + + /* setup controller interface softc */ + reg = rt305x_sysctl_get(SYSCTL_SYSCFG1); + reg |= SYSCTL_SYSCFG1_USB0_HOST_MODE; + rt305x_sysctl_set(SYSCTL_SYSCFG1, reg); + + reg = rt305x_sysctl_get(SYSCTL_CLKCFG1); + reg |= SYSCTL_CLKCFG1_UPHY0_CLK_EN; +#ifdef MT7620 + reg |= SYSCTL_CLKCFG1_UPHY1_CLK_EN; +#endif + rt305x_sysctl_set(SYSCTL_CLKCFG1, reg); + + reg = rt305x_sysctl_get(SYSCTL_RSTCTRL); + reg |= SYSCTL_RSTCTRL_UPHY0 | SYSCTL_RSTCTRL_UPHY1; + rt305x_sysctl_set(SYSCTL_RSTCTRL, reg); + reg &= ~(SYSCTL_RSTCTRL_UPHY0 | SYSCTL_RSTCTRL_UPHY1); + DELAY(100000); + rt305x_sysctl_set(SYSCTL_RSTCTRL, reg); + DELAY(100000); + + /* initialise some bus fields */ + sc->sc_bus.parent = self; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = EHCI_MAX_DEVICES; + sc->sc_bus.dma_bits = 32; + + /* get all DMA memory */ + if (usb_bus_mem_alloc_all(&sc->sc_bus, + USB_GET_DMA_TAG(self), &ehci_iterate_hw_softc)) { + printf("No mem\n"); + return (ENOMEM); + } + + rid = 0; + sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_io_res) { + device_printf(self, "Could not map memory\n"); + goto error; + } + sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); + sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); + sc->sc_io_size = rman_get_size(sc->sc_io_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->sc_irq_res == NULL) { + device_printf(self, "Could not allocate irq\n"); + goto error; + } + + sc->sc_bus.bdev = device_add_child(self, "usbus", -1); + if (!(sc->sc_bus.bdev)) { + device_printf(self, "Could not add USB device\n"); + goto error; + } + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + device_set_desc(sc->sc_bus.bdev, EHCI_HC_DEVSTR); + + sprintf(sc->sc_vendor, "Ralink"); + + err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl); + if (err) { + device_printf(self, "Could not setup irq, %d\n", err); + sc->sc_intr_hdl = NULL; + goto error; + } + + err = ehci_init(sc); + if (!err) { + err = device_probe_and_attach(sc->sc_bus.bdev); + } + if (err) { + device_printf(self, "USB init failed err=%d\n", err); + goto error; + } + return (0); + +error: + ehci_obio_detach(self); + return (ENXIO); +} + +static int +ehci_obio_detach(device_t self) +{ + ehci_softc_t *sc = device_get_softc(self); + device_t bdev; + int err; + + if (sc->sc_bus.bdev) { + bdev = sc->sc_bus.bdev; + device_detach(bdev); + device_delete_child(self, bdev); + } + /* during module unload there are lots of children leftover */ + device_delete_children(self); + + if (sc->sc_irq_res && sc->sc_intr_hdl) { + /* + * only call ehci_detach() after ehci_init() + */ + ehci_detach(sc); + + /* Stop EHCI clock */ + rt305x_sysctl_set(SYSCTL_CLKCFG1, + rt305x_sysctl_get(SYSCTL_CLKCFG1) & + ~(SYSCTL_CLKCFG1_UPHY0_CLK_EN +#ifdef MT7620 + | SYSCTL_CLKCFG1_UPHY1_CLK_EN +#endif + )); + + err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); + if (err) + device_printf(self, "Could not tear down irq, %d\n", + err); + sc->sc_intr_hdl = NULL; + } + if (sc->sc_irq_res) { + bus_release_resource(self, SYS_RES_IRQ, 0, + sc->sc_irq_res); + sc->sc_irq_res = NULL; + } + if (sc->sc_io_res) { + bus_release_resource(self, SYS_RES_MEMORY, 0, + sc->sc_io_res); + sc->sc_io_res = NULL; + } + usb_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc); + + return (0); +} + +static device_method_t ehci_obio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ehci_obio_probe), + DEVMETHOD(device_attach, ehci_obio_attach), + DEVMETHOD(device_detach, ehci_obio_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + DEVMETHOD_END +}; + +static driver_t ehci_obio_driver = { + .name = "ehci", + .methods = ehci_obio_methods, + .size = sizeof(ehci_softc_t), +}; + +static devclass_t ehci_obio_devclass; + +DRIVER_MODULE(ehci, obio, ehci_obio_driver, ehci_obio_devclass, 0, 0); Added: head/sys/mips/rt305x/rt305x_ohci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/rt305x/rt305x_ohci.c Thu Dec 24 18:36:08 2015 (r292702) @@ -0,0 +1,245 @@ +#include +__FBSDID("$FreeBSD$"); + +/*- + * Copyright (c) 2015 Stanislav Galabov. All rights reserved. + * Copyright (c) 2010,2011 Aleksandr Rybalko. All rights reserved. + * Copyright (c) 2007-2008 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + +#define OHCI_HC_DEVSTR "Ralink integrated USB controller" + +static device_probe_t ohci_obio_probe; +static device_attach_t ohci_obio_attach; +static device_detach_t ohci_obio_detach; + +static int +ohci_obio_probe(device_t self) +{ + device_set_desc(self, OHCI_HC_DEVSTR); + + return (BUS_PROBE_DEFAULT); +} + +static int +ohci_obio_attach(device_t self) +{ + ohci_softc_t *sc = device_get_softc(self); + uint32_t reg; + int err; + int rid; + + /* setup controller interface softc */ + reg = rt305x_sysctl_get(SYSCTL_SYSCFG1); + reg |= SYSCTL_SYSCFG1_USB0_HOST_MODE; + rt305x_sysctl_set(SYSCTL_SYSCFG1, reg); + + reg = rt305x_sysctl_get(SYSCTL_CLKCFG1); + reg |= SYSCTL_CLKCFG1_UPHY0_CLK_EN; +#ifdef MT7620 + reg |= SYSCTL_CLKCFG1_UPHY1_CLK_EN; +#endif + rt305x_sysctl_set(SYSCTL_CLKCFG1, reg); + + reg = rt305x_sysctl_get(SYSCTL_RSTCTRL); + reg |= SYSCTL_RSTCTRL_UPHY0 | SYSCTL_RSTCTRL_UPHY1; + rt305x_sysctl_set(SYSCTL_RSTCTRL, reg); + reg &= ~(SYSCTL_RSTCTRL_UPHY0 | SYSCTL_RSTCTRL_UPHY1); + DELAY(100000); + rt305x_sysctl_set(SYSCTL_RSTCTRL, reg); + DELAY(100000); + + /* initialise some bus fields */ + sc->sc_bus.parent = self; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = OHCI_MAX_DEVICES; + sc->sc_bus.dma_bits = 32; + + /* get all DMA memory */ + if (usb_bus_mem_alloc_all(&sc->sc_bus, + USB_GET_DMA_TAG(self), &ohci_iterate_hw_softc)) { + printf("No mem\n"); + return (ENOMEM); + } + + rid = 0; + sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_io_res) { + device_printf(self, "Could not map memory\n"); + goto error; + } + sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); + sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); + sc->sc_io_size = rman_get_size(sc->sc_io_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->sc_irq_res == NULL) { + device_printf(self, "Could not allocate irq\n"); + goto error; + } + + sc->sc_bus.bdev = device_add_child(self, "usbus", -1); + if (!(sc->sc_bus.bdev)) { + device_printf(self, "Could not add USB device\n"); + goto error; + } + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + device_set_desc(sc->sc_bus.bdev, OHCI_HC_DEVSTR); + + sprintf(sc->sc_vendor, "Ralink"); + + err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl); + if (err) { + device_printf(self, "Could not setup irq, %d\n", err); + sc->sc_intr_hdl = NULL; + goto error; + } + + err = ohci_init(sc); + if (!err) { + err = device_probe_and_attach(sc->sc_bus.bdev); + } + if (err) { + device_printf(self, "USB init failed err=%d\n", err); + goto error; + } + return (0); + +error: + ohci_obio_detach(self); + return (ENXIO); +} + +static int +ohci_obio_detach(device_t self) +{ + ohci_softc_t *sc = device_get_softc(self); + device_t bdev; + int err; + + if (sc->sc_bus.bdev) { + bdev = sc->sc_bus.bdev; + device_detach(bdev); + device_delete_child(self, bdev); + } + /* during module unload there are lots of children leftover */ + device_delete_children(self); + + if (sc->sc_irq_res && sc->sc_intr_hdl) { + /* + * only call ohci_detach() after ohci_init() + */ + ohci_detach(sc); + + /* Stop OHCI clock */ + rt305x_sysctl_set(SYSCTL_CLKCFG1, + rt305x_sysctl_get(SYSCTL_CLKCFG1) & + ~(SYSCTL_CLKCFG1_UPHY0_CLK_EN +#ifdef MT7620 + | SYSCTL_CLKCFG1_UPHY1_CLK_EN +#endif + )); + + err = bus_teardown_intr(self, sc->sc_irq_res, sc->sc_intr_hdl); + if (err) + device_printf(self, "Could not tear down irq, %d\n", + err); + sc->sc_intr_hdl = NULL; + } + if (sc->sc_irq_res) { + bus_release_resource(self, SYS_RES_IRQ, 0, + sc->sc_irq_res); + sc->sc_irq_res = NULL; + } + if (sc->sc_io_res) { + bus_release_resource(self, SYS_RES_MEMORY, 0, + sc->sc_io_res); + sc->sc_io_res = NULL; + } + usb_bus_mem_free_all(&sc->sc_bus, &ohci_iterate_hw_softc); + + return (0); +} + +static device_method_t ohci_obio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ohci_obio_probe), + DEVMETHOD(device_attach, ohci_obio_attach), + DEVMETHOD(device_detach, ohci_obio_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + DEVMETHOD_END +}; + +static driver_t ohci_obio_driver = { + .name = "ohci", + .methods = ohci_obio_methods, + .size = sizeof(ohci_softc_t), +}; + +static devclass_t ohci_obio_devclass; + +DRIVER_MODULE(ohci, obio, ohci_obio_driver, ohci_obio_devclass, 0, 0); From owner-svn-src-all@freebsd.org Thu Dec 24 18:40:12 2015 Return-Path: Delivered-To: svn-src-all@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 AFDADA50C73; Thu, 24 Dec 2015 18:40:12 +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 7AD801290; Thu, 24 Dec 2015 18:40:12 +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 tBOIeBSZ062293; Thu, 24 Dec 2015 18:40:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOIeASj062286; Thu, 24 Dec 2015 18:40:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512241840.tBOIeASj062286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 24 Dec 2015 18:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292703 - head/sys/mips/rt305x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 18:40:12 -0000 Author: adrian Date: Thu Dec 24 18:40:10 2015 New Revision: 292703 URL: https://svnweb.freebsd.org/changeset/base/292703 Log: [rt305x] Add initial RT5350 and MT7620 glue. * Add in chipset awareness to the obio bus layout (ie, which devices are where); * Add in some USB OTG changes to be aware of the newer stuff; * Add in a configurable primary console - some chips use the normal UART, some use UARTLITE. Tested (by Stanislav); * RT3050 (NFS) * RT5350 (NFS, MFS) * MT7620 (USB) Submitted by: Stanislav Galabov Modified: head/sys/mips/rt305x/files.rt305x head/sys/mips/rt305x/obio.c head/sys/mips/rt305x/rt305x_dotg.c head/sys/mips/rt305x/rt305x_machdep.c head/sys/mips/rt305x/rt305x_sysctl.c head/sys/mips/rt305x/uart_bus_rt305x.c head/sys/mips/rt305x/uart_cpu_rt305x.c Modified: head/sys/mips/rt305x/files.rt305x ============================================================================== --- head/sys/mips/rt305x/files.rt305x Thu Dec 24 18:36:08 2015 (r292702) +++ head/sys/mips/rt305x/files.rt305x Thu Dec 24 18:40:10 2015 (r292703) @@ -9,6 +9,11 @@ mips/rt305x/rt305x_gpio.c optional gpio mips/rt305x/uart_bus_rt305x.c optional uart mips/rt305x/uart_cpu_rt305x.c optional uart mips/rt305x/uart_dev_rt305x.c optional uart +mips/rt305x/rt305x_dotg.c optional dwcotg +mips/rt305x/rt305x_ehci.c optional ehci +mips/rt305x/rt305x_ohci.c optional ohci +mips/rt305x/rt305x_spi.c optional spibus +mips/rt305x/rt305x_pci.c optional pci mips/mips/intr_machdep.c standard mips/mips/tick.c standard dev/rt/if_rt.c optional rt Modified: head/sys/mips/rt305x/obio.c ============================================================================== --- head/sys/mips/rt305x/obio.c Thu Dec 24 18:36:08 2015 (r292702) +++ head/sys/mips/rt305x/obio.c Thu Dec 24 18:40:10 2015 (r292703) @@ -221,10 +221,10 @@ obio_attach(device_t dev) obio_add_res_child(dev, "pcm", 0, PCM_BASE, (PCM_END - PCM_BASE + 1), IC_PCM); +#endif obio_add_res_child(dev, "uart", 0, UART_BASE, (UART_END - UART_BASE + 1), IC_UART); -#endif obio_add_res_child(dev, "gpio", 0, PIO_BASE, (PIO_END - PIO_BASE + 1), IC_PIO); @@ -241,19 +241,28 @@ obio_attach(device_t dev) obio_add_res_child(dev, "i2s", 0, I2S_BASE, (I2S_END - I2S_BASE + 1), IC_I2S); +#endif obio_add_res_child(dev, "spi", 0, SPI_BASE, (SPI_END - SPI_BASE + 1), -1); -#endif obio_add_res_child(dev, "uart", 1, UARTLITE_BASE, (UARTLITE_END - UARTLITE_BASE + 1), IC_UARTLITE); +#if !defined(RT5350) && !defined(MT7620) obio_add_res_child(dev, "cfi", 0, FLASH_BASE, (FLASH_END - FLASH_BASE + 1), -1); - obio_add_res_child(dev, "dotg", 0, + obio_add_res_child(dev, "dwcotg", 0, USB_OTG_BASE, (USB_OTG_END - USB_OTG_BASE + 1), IC_OTG); +#else + obio_add_res_child(dev, "ehci", 0, + USB_OTG_BASE, (USB_OTG_END - USB_OTG_BASE + 1), + IC_OTG); + obio_add_res_child(dev, "ohci", 0, + USB_OHCI_BASE, (USB_OHCI_END - USB_OHCI_BASE + 1), + IC_OTG); +#endif obio_add_res_child(dev, "switch", 0, ETHSW_BASE, (ETHSW_END - ETHSW_BASE + 1), IC_ETHSW); Modified: head/sys/mips/rt305x/rt305x_dotg.c ============================================================================== --- head/sys/mips/rt305x/rt305x_dotg.c Thu Dec 24 18:36:08 2015 (r292702) +++ head/sys/mips/rt305x/rt305x_dotg.c Thu Dec 24 18:40:10 2015 (r292703) @@ -2,6 +2,7 @@ __FBSDID("$FreeBSD$"); /*- + * Copyright (c) 2015 Stanislav Galabov. All rights reserved. * Copyright (c) 2010,2011 Aleksandr Rybalko. All rights reserved. * Copyright (c) 2007-2008 Hans Petter Selasky. All rights reserved. * @@ -58,7 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include @@ -68,10 +69,6 @@ static device_probe_t dotg_obio_probe; static device_attach_t dotg_obio_attach; static device_detach_t dotg_obio_detach; -struct dotg_obio_softc { - struct dotg_softc sc_dci; /* must be first */ -}; - static int dotg_obio_probe(device_t dev) { @@ -82,61 +79,63 @@ dotg_obio_probe(device_t dev) static int dotg_obio_attach(device_t dev) { - struct dotg_obio_softc *sc = device_get_softc(dev); - int err; + struct dwc_otg_softc *sc = device_get_softc(dev); + uint32_t tmp; + int err, rid; /* setup controller interface softc */ /* initialise some bus fields */ - sc->sc_dci.sc_dev = dev; - sc->sc_dci.sc_bus.parent = dev; - sc->sc_dci.sc_bus.devices = sc->sc_dci.sc_devices; - sc->sc_dci.sc_bus.devices_max = DOTG_MAX_DEVICES; - sc->sc_dci.sc_bus.dma_bits = 32; + sc->sc_mode = DWC_MODE_HOST; + sc->sc_bus.parent = dev; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = DWC_OTG_MAX_DEVICES; + sc->sc_bus.dma_bits = 32; /* get all DMA memory */ - if (usb_bus_mem_alloc_all(&sc->sc_dci.sc_bus, + if (usb_bus_mem_alloc_all(&sc->sc_bus, USB_GET_DMA_TAG(dev), NULL)) { printf("No mem\n"); return (ENOMEM); } - sc->sc_dci.sc_mem_rid = 0; - sc->sc_dci.sc_mem_res = - bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_dci.sc_irq_rid, - RF_ACTIVE); - if (!(sc->sc_dci.sc_mem_res)) { + rid = 0; + sc->sc_io_res = + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (!(sc->sc_io_res)) { printf("Can`t alloc MEM\n"); goto error; } - sc->sc_dci.sc_bst = rman_get_bustag(sc->sc_dci.sc_mem_res); - sc->sc_dci.sc_bsh = rman_get_bushandle(sc->sc_dci.sc_mem_res); - - sc->sc_dci.sc_irq_rid = 0; - sc->sc_dci.sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &sc->sc_dci.sc_irq_rid, RF_SHAREABLE| RF_ACTIVE); - if (!(sc->sc_dci.sc_irq_res)) { + sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); + sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); + sc->sc_io_size = rman_get_size(sc->sc_io_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &rid, RF_ACTIVE); + if (!(sc->sc_irq_res)) { printf("Can`t alloc IRQ\n"); goto error; } - sc->sc_dci.sc_bus.bdev = device_add_child(dev, "usbus", -1); - if (!(sc->sc_dci.sc_bus.bdev)) { + sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (!(sc->sc_bus.bdev)) { printf("Can`t add usbus\n"); goto error; } - device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); #if (__FreeBSD_version >= 700031) - err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, - INTR_TYPE_BIO | INTR_MPSAFE, NULL, (driver_intr_t *)dotg_interrupt, - sc, &sc->sc_dci.sc_intr_hdl); + err = bus_setup_intr(dev, sc->sc_irq_res, + INTR_TYPE_TTY | INTR_MPSAFE, dwc_otg_filter_interrupt, + dwc_otg_interrupt, sc, &sc->sc_intr_hdl); #else - err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, - INTR_TYPE_BIO | INTR_MPSAFE, (driver_intr_t *)dotg_interrupt, - sc, &sc->sc_dci.sc_intr_hdl); + #error error + err = bus_setup_intr(dev, sc->sc_irq_res, + INTR_TYPE_BIO | INTR_MPSAFE,(driver_intr_t*)dwc_otg_interrupt, + sc, &sc->sc_intr_hdl); #endif if (err) { - sc->sc_dci.sc_intr_hdl = NULL; + sc->sc_intr_hdl = NULL; printf("Can`t set IRQ handle\n"); goto error; } @@ -144,14 +143,21 @@ dotg_obio_attach(device_t dev) /* Run clock for OTG core */ rt305x_sysctl_set(SYSCTL_CLKCFG1, rt305x_sysctl_get(SYSCTL_CLKCFG1) | SYSCTL_CLKCFG1_OTG_CLK_EN); - rt305x_sysctl_set(SYSCTL_RSTCTRL, SYSCTL_RSTCTRL_OTG); + tmp = rt305x_sysctl_get(SYSCTL_RSTCTRL); + rt305x_sysctl_set(SYSCTL_RSTCTRL, tmp | SYSCTL_RSTCTRL_OTG); DELAY(100); + /* + * Docs say that RSTCTRL bits for RT305x are W1C, so there should + * be no need for the below, but who really knows? + */ +// rt305x_sysctl_set(SYSCTL_RSTCTRL, tmp & ~SYSCTL_RSTCTRL_OTG); +// DELAY(100); - err = dotg_init(&sc->sc_dci); + err = dwc_otg_init(sc); if (err) printf("dotg_init fail\n"); if (!err) { - err = device_probe_and_attach(sc->sc_dci.sc_bus.bdev); - if (err) printf("device_probe_and_attach fail\n"); + err = device_probe_and_attach(sc->sc_bus.bdev); + if (err) printf("device_probe_and_attach fail %d\n", err); } if (err) { goto error; @@ -166,44 +172,44 @@ error: static int dotg_obio_detach(device_t dev) { - struct dotg_obio_softc *sc = device_get_softc(dev); + struct dwc_otg_softc *sc = device_get_softc(dev); device_t bdev; int err; - if (sc->sc_dci.sc_bus.bdev) { - bdev = sc->sc_dci.sc_bus.bdev; + if (sc->sc_bus.bdev) { + bdev = sc->sc_bus.bdev; device_detach(bdev); device_delete_child(dev, bdev); } /* during module unload there are lots of children leftover */ device_delete_children(dev); - if (sc->sc_dci.sc_irq_res && sc->sc_dci.sc_intr_hdl) { + if (sc->sc_irq_res && sc->sc_intr_hdl) { /* * only call dotg_obio_uninit() after dotg_obio_init() */ - dotg_uninit(&sc->sc_dci); + dwc_otg_uninit(sc); /* Stop OTG clock */ rt305x_sysctl_set(SYSCTL_CLKCFG1, rt305x_sysctl_get(SYSCTL_CLKCFG1) & ~SYSCTL_CLKCFG1_OTG_CLK_EN); - err = bus_teardown_intr(dev, sc->sc_dci.sc_irq_res, - sc->sc_dci.sc_intr_hdl); - sc->sc_dci.sc_intr_hdl = NULL; + err = bus_teardown_intr(dev, sc->sc_irq_res, + sc->sc_intr_hdl); + sc->sc_intr_hdl = NULL; } - if (sc->sc_dci.sc_irq_res) { + if (sc->sc_irq_res) { bus_release_resource(dev, SYS_RES_IRQ, 0, - sc->sc_dci.sc_irq_res); - sc->sc_dci.sc_irq_res = NULL; + sc->sc_irq_res); + sc->sc_irq_res = NULL; } - if (sc->sc_dci.sc_mem_res) { + if (sc->sc_io_res) { bus_release_resource(dev, SYS_RES_MEMORY, 0, - sc->sc_dci.sc_mem_res); - sc->sc_dci.sc_mem_res = NULL; + sc->sc_io_res); + sc->sc_io_res = NULL; } - usb_bus_mem_free_all(&sc->sc_dci.sc_bus, NULL); + usb_bus_mem_free_all(&sc->sc_bus, NULL); return (0); } @@ -221,11 +227,11 @@ static device_method_t dotg_obio_methods }; static driver_t dotg_obio_driver = { - .name = "dotg", + .name = "dwcotg", .methods = dotg_obio_methods, - .size = sizeof(struct dotg_obio_softc), + .size = sizeof(struct dwc_otg_softc), }; static devclass_t dotg_obio_devclass; -DRIVER_MODULE(dotg, obio, dotg_obio_driver, dotg_obio_devclass, 0, 0); +DRIVER_MODULE(dwcotg, obio, dotg_obio_driver, dotg_obio_devclass, 0, 0); Modified: head/sys/mips/rt305x/rt305x_machdep.c ============================================================================== --- head/sys/mips/rt305x/rt305x_machdep.c Thu Dec 24 18:36:08 2015 (r292702) +++ head/sys/mips/rt305x/rt305x_machdep.c Thu Dec 24 18:40:10 2015 (r292703) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include extern int *edata; extern int *end; @@ -87,11 +88,17 @@ static void mips_init(void) { int i; + char *memsize; printf("entry: mips_init()\n"); + if ((memsize = kern_getenv("memsize")) != NULL) + realmem = btoc(strtol(memsize, NULL, 0) << 20); + else + realmem = btoc(32 << 20); + + bootverbose = 1; - realmem = btoc(32 << 20); for (i = 0; i < 10; i++) { phys_avail[i] = 0; @@ -120,8 +127,13 @@ void platform_reset(void) { +#if !defined(MT7620) && !defined(RT5350) __asm __volatile("li $25, 0xbf000000"); __asm __volatile("j $25"); +#else + rt305x_sysctl_set(SYSCTL_RSTCTRL, 1); + while (1); +#endif } void @@ -144,6 +156,8 @@ platform_start(__register_t a0 __unused, /* Initialize pcpu stuff */ mips_pcpu0_init(); + mips_timer_early_init(platform_counter_freq / 2); + /* initialize console so that we have printf */ boothowto |= (RB_SERIAL | RB_MULTIPLE); /* Use multiple consoles */ boothowto |= (RB_VERBOSE); @@ -173,10 +187,12 @@ platform_start(__register_t a0 __unused, printf("Environment:\n"); - for (i = 0; envp[i] ; i++) { + for (i = 0; envp[i] && MIPS_IS_VALID_PTR(envp[i]); i++) { char *n, *arg; arg = (char *)(intptr_t)MIPS_PHYS_TO_KSEG0(envp[i]); + if (! MIPS_IS_VALID_PTR(arg)) + continue; printf("\t%s\n", arg); n = strsep(&arg, "="); if (arg == NULL) Modified: head/sys/mips/rt305x/rt305x_sysctl.c ============================================================================== --- head/sys/mips/rt305x/rt305x_sysctl.c Thu Dec 24 18:36:08 2015 (r292702) +++ head/sys/mips/rt305x/rt305x_sysctl.c Thu Dec 24 18:40:10 2015 (r292703) @@ -70,6 +70,7 @@ rt305x_sysctl_dump_config(device_t dev) (val >> 24) & 0xff); DUMPREG(SYSCTL_SYSCFG); +#if !defined(RT5350) && !defined(MT7620) if ( val & SYSCTL_SYSCFG_INIC_EE_SDRAM) printf("\tGet SDRAM config from EEPROM\n"); if ( val & SYSCTL_SYSCFG_INIC_8MB_SDRAM) @@ -123,6 +124,7 @@ rt305x_sysctl_dump_config(device_t dev) ((val & SYSCTL_CLKCFG1_PCM_CLK_DIV_MASK) >> SYSCTL_CLKCFG1_PCM_CLK_DIV_SHIFT)); DUMPREG(SYSCTL_GPIOMODE); +#endif #undef DUMPREG return; Modified: head/sys/mips/rt305x/uart_bus_rt305x.c ============================================================================== --- head/sys/mips/rt305x/uart_bus_rt305x.c Thu Dec 24 18:36:08 2015 (r292702) +++ head/sys/mips/rt305x/uart_bus_rt305x.c Thu Dec 24 18:40:10 2015 (r292703) @@ -75,21 +75,13 @@ static driver_t uart_rt305x_driver = { sizeof(struct uart_softc), }; -extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; - static int uart_rt305x_probe(device_t dev) { struct uart_softc *sc; sc = device_get_softc(dev); - sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); sc->sc_class = &uart_rt305x_uart_class; - bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); - sc->sc_sysdev->bas.regshft = 2; - sc->sc_sysdev->bas.bst = mips_bus_space_generic; - sc->sc_sysdev->bas.bsh = - MIPS_PHYS_TO_KSEG1(device_get_unit(dev)?UARTLITE_BASE:UART_BASE); sc->sc_bas.regshft = 2; sc->sc_bas.bst = mips_bus_space_generic; sc->sc_bas.bsh = Modified: head/sys/mips/rt305x/uart_cpu_rt305x.c ============================================================================== --- head/sys/mips/rt305x/uart_cpu_rt305x.c Thu Dec 24 18:36:08 2015 (r292702) +++ head/sys/mips/rt305x/uart_cpu_rt305x.c Thu Dec 24 18:40:10 2015 (r292703) @@ -77,6 +77,10 @@ uart_cpu_getdev(int devtype, struct uart uart_bus_space_io = NULL; uart_bus_space_mem = mips_bus_space_generic; +#ifdef RT305X_USE_UART + di->bas.bsh = MIPS_PHYS_TO_KSEG1(UART_BASE); +#else di->bas.bsh = MIPS_PHYS_TO_KSEG1(UARTLITE_BASE); +#endif return (0); } From owner-svn-src-all@freebsd.org Thu Dec 24 18:41:18 2015 Return-Path: Delivered-To: svn-src-all@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 47CD7A50D9F; Thu, 24 Dec 2015 18:41:18 +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 10E2F14A5; Thu, 24 Dec 2015 18:41:18 +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 tBOIfHKh064305; Thu, 24 Dec 2015 18:41:17 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOIfHFe064302; Thu, 24 Dec 2015 18:41:17 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512241841.tBOIfHFe064302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 24 Dec 2015 18:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292704 - head/sys/dev/rt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 18:41:18 -0000 Author: adrian Date: Thu Dec 24 18:41:16 2015 New Revision: 292704 URL: https://svnweb.freebsd.org/changeset/base/292704 Log: [rt] add support for the RT5350 and MT7620 SoCs. This is a work in progress; bringing the interface down stops further use. It only happens on RT5350/MT7620. This is based on work by Alexander A. Mityaev . Submitted by: Stanislav Galabov Modified: head/sys/dev/rt/if_rt.c head/sys/dev/rt/if_rtreg.h head/sys/dev/rt/if_rtvar.h Modified: head/sys/dev/rt/if_rt.c ============================================================================== --- head/sys/dev/rt/if_rt.c Thu Dec 24 18:40:10 2015 (r292703) +++ head/sys/dev/rt/if_rt.c Thu Dec 24 18:41:16 2015 (r292704) @@ -1,4 +1,6 @@ /*- + * Copyright (c) 2015, Stanislav Galabov + * Copyright (c) 2014, Aleksandr A. Mityaev * Copyright (c) 2011, Aleksandr Rybalko * based on hard work * by Alexander Egorenkov @@ -56,6 +58,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_platform.h" +#include "opt_rt305x.h" + +#ifdef FDT +#include +#include +#include +#endif + #include #include @@ -78,6 +89,23 @@ __FBSDID("$FreeBSD$"); #define RT_TX_WATCHDOG_TIMEOUT 5 +#define RT_CHIPID_RT3050 0x3050 +#define RT_CHIPID_RT3052 0x3052 +#define RT_CHIPID_RT5350 0x5350 +#define RT_CHIPID_RT6855 0x6855 +#define RT_CHIPID_MT7620 0x7620 + +#ifdef FDT +/* more specific and new models should go first */ +static const struct ofw_compat_data rt_compat_data[] = { + { "ralink,rt6855-eth", (uintptr_t)RT_CHIPID_RT6855 }, + { "ralink,rt5350-eth", (uintptr_t)RT_CHIPID_RT5350 }, + { "ralink,rt3052-eth", (uintptr_t)RT_CHIPID_RT3052 }, + { "ralink,rt305x-eth", (uintptr_t)RT_CHIPID_RT3050 }, + { NULL, (uintptr_t)NULL } +}; +#endif + /* * Static function prototypes */ @@ -96,16 +124,18 @@ static int rt_ioctl(struct ifnet *ifp, u static void rt_periodic(void *arg); static void rt_tx_watchdog(void *arg); static void rt_intr(void *arg); +static void rt_rt5350_intr(void *arg); static void rt_tx_coherent_intr(struct rt_softc *sc); static void rt_rx_coherent_intr(struct rt_softc *sc); static void rt_rx_delay_intr(struct rt_softc *sc); static void rt_tx_delay_intr(struct rt_softc *sc); -static void rt_rx_intr(struct rt_softc *sc); +static void rt_rx_intr(struct rt_softc *sc, int qid); static void rt_tx_intr(struct rt_softc *sc, int qid); static void rt_rx_done_task(void *context, int pending); static void rt_tx_done_task(void *context, int pending); static void rt_periodic_task(void *context, int pending); -static int rt_rx_eof(struct rt_softc *sc, int limit); +static int rt_rx_eof(struct rt_softc *sc, + struct rt_softc_rx_ring *ring, int limit); static void rt_tx_eof(struct rt_softc *sc, struct rt_softc_tx_ring *ring); static void rt_update_stats(struct rt_softc *sc); @@ -115,7 +145,7 @@ static void rt_intr_enable(struct rt_sof static void rt_intr_disable(struct rt_softc *sc, uint32_t intr_mask); static int rt_txrx_enable(struct rt_softc *sc); static int rt_alloc_rx_ring(struct rt_softc *sc, - struct rt_softc_rx_ring *ring); + struct rt_softc_rx_ring *ring, int qid); static void rt_reset_rx_ring(struct rt_softc *sc, struct rt_softc_rx_ring *ring); static void rt_free_rx_ring(struct rt_softc *sc, @@ -147,8 +177,29 @@ SYSCTL_INT(_hw_rt, OID_AUTO, debug, CTLF static int rt_probe(device_t dev) { - device_set_desc(dev, "Ralink RT305XF onChip Ethernet MAC"); - return (BUS_PROBE_NOWILDCARD); + struct rt_softc *sc = device_get_softc(dev); + char buf[80]; +#ifdef FDT + const struct ofw_compat_data * cd; + + cd = ofw_bus_search_compatible(dev, rt_compat_data); + if (cd->ocd_data == (uintptr_t)NULL) + return (ENXIO); + + sc->rt_chipid = (unsigned int)(cd->ocd_data); +#else +#if defined(MT7620) + sc->rt_chipid = RT_CHIPID_MT7620; +#elif defined(RT5350) + sc->rt_chipid = RT_CHIPID_RT5350; +#else + sc->rt_chipid = RT_CHIPID_RT3050; +#endif +#endif + snprintf(buf, sizeof(buf), "Ralink RT%x onChip Ethernet driver", + sc->rt_chipid); + device_set_desc_copy(dev, buf); + return (BUS_PROBE_GENERIC); } /* @@ -240,7 +291,7 @@ ether_request_mac(device_t dev, uint8_t * "ethaddr" is passed via envp on RedBoot platforms * "kmac" is passed via argv on RouterBOOT platforms */ -#if defined(__U_BOOT__) || defined(__REDBOOT__) || defined(__ROUTERBOOT__) +#if defined(RT305X_UBOOT) || defined(__REDBOOT__) || defined(__ROUTERBOOT__) if ((var = kern_getenv("ethaddr")) != NULL || (var = kern_getenv("kmac")) != NULL ) { @@ -288,6 +339,16 @@ ether_request_mac(device_t dev, uint8_t return (0); } +/* + * Reset hardware + */ +static void +reset_freng(struct rt_softc *sc) +{ + /* XXX hard reset kills everything so skip it ... */ + return; +} + static int rt_attach(device_t dev) { @@ -331,23 +392,80 @@ rt_attach(device_t dev) "debug", CTLFLAG_RW, &sc->debug, 0, "rt debug level"); #endif - device_printf(dev, "RT305XF Ethernet MAC (rev 0x%08x)\n", - sc->mac_rev); - /* Reset hardware */ - RT_WRITE(sc, GE_PORT_BASE + FE_RST_GLO, PSE_RESET); - - RT_WRITE(sc, GDMA1_BASE + GDMA_FWD_CFG, - ( - GDM_ICS_EN | /* Enable IP Csum */ - GDM_TCS_EN | /* Enable TCP Csum */ - GDM_UCS_EN | /* Enable UDP Csum */ - GDM_STRPCRC | /* Strip CRC from packet */ - GDM_DST_PORT_CPU << GDM_UFRC_P_SHIFT | /* Forward UCast to CPU */ - GDM_DST_PORT_CPU << GDM_BFRC_P_SHIFT | /* Forward BCast to CPU */ - GDM_DST_PORT_CPU << GDM_MFRC_P_SHIFT | /* Forward MCast to CPU */ - GDM_DST_PORT_CPU << GDM_OFRC_P_SHIFT /* Forward Other to CPU */ - )); + reset_freng(sc); + + /* Fill in soc-specific registers map */ + switch(sc->rt_chipid) { + case RT_CHIPID_MT7620: + case RT_CHIPID_RT5350: + device_printf(dev, "RT%x Ethernet MAC (rev 0x%08x)\n", + sc->rt_chipid, sc->mac_rev); + /* RT5350: No GDMA, PSE, CDMA, PPE */ + RT_WRITE(sc, GE_PORT_BASE + 0x0C00, // UDPCS, TCPCS, IPCS=1 + RT_READ(sc, GE_PORT_BASE + 0x0C00) | (0x7<<16)); + sc->delay_int_cfg=RT5350_PDMA_BASE+RT5350_DELAY_INT_CFG; + sc->fe_int_status=RT5350_FE_INT_STATUS; + sc->fe_int_enable=RT5350_FE_INT_ENABLE; + sc->pdma_glo_cfg=RT5350_PDMA_BASE+RT5350_PDMA_GLO_CFG; + sc->pdma_rst_idx=RT5350_PDMA_BASE+RT5350_PDMA_RST_IDX; + for (i = 0; i < RT_SOFTC_TX_RING_COUNT; i++) { + sc->tx_base_ptr[i]=RT5350_PDMA_BASE+RT5350_TX_BASE_PTR(i); + sc->tx_max_cnt[i]=RT5350_PDMA_BASE+RT5350_TX_MAX_CNT(i); + sc->tx_ctx_idx[i]=RT5350_PDMA_BASE+RT5350_TX_CTX_IDX(i); + sc->tx_dtx_idx[i]=RT5350_PDMA_BASE+RT5350_TX_DTX_IDX(i); + } + sc->rx_ring_count=2; + sc->rx_base_ptr[0]=RT5350_PDMA_BASE+RT5350_RX_BASE_PTR0; + sc->rx_max_cnt[0]=RT5350_PDMA_BASE+RT5350_RX_MAX_CNT0; + sc->rx_calc_idx[0]=RT5350_PDMA_BASE+RT5350_RX_CALC_IDX0; + sc->rx_drx_idx[0]=RT5350_PDMA_BASE+RT5350_RX_DRX_IDX0; + sc->rx_base_ptr[1]=RT5350_PDMA_BASE+RT5350_RX_BASE_PTR1; + sc->rx_max_cnt[1]=RT5350_PDMA_BASE+RT5350_RX_MAX_CNT1; + sc->rx_calc_idx[1]=RT5350_PDMA_BASE+RT5350_RX_CALC_IDX1; + sc->rx_drx_idx[1]=RT5350_PDMA_BASE+RT5350_RX_DRX_IDX1; + sc->int_rx_done_mask=RT5350_INT_RXQ0_DONE; + sc->int_tx_done_mask=RT5350_INT_TXQ0_DONE; + break; + case RT_CHIPID_RT6855: + device_printf(dev, "RT6855 Ethernet MAC (rev 0x%08x)\n", + sc->mac_rev); + break; + default: + device_printf(dev, "RT305XF Ethernet MAC (rev 0x%08x)\n", + sc->mac_rev); + RT_WRITE(sc, GDMA1_BASE + GDMA_FWD_CFG, + ( + GDM_ICS_EN | /* Enable IP Csum */ + GDM_TCS_EN | /* Enable TCP Csum */ + GDM_UCS_EN | /* Enable UDP Csum */ + GDM_STRPCRC | /* Strip CRC from packet */ + GDM_DST_PORT_CPU << GDM_UFRC_P_SHIFT | /* fwd UCast to CPU */ + GDM_DST_PORT_CPU << GDM_BFRC_P_SHIFT | /* fwd BCast to CPU */ + GDM_DST_PORT_CPU << GDM_MFRC_P_SHIFT | /* fwd MCast to CPU */ + GDM_DST_PORT_CPU << GDM_OFRC_P_SHIFT /* fwd Other to CPU */ + )); + + sc->delay_int_cfg=PDMA_BASE+DELAY_INT_CFG; + sc->fe_int_status=GE_PORT_BASE+FE_INT_STATUS; + sc->fe_int_enable=GE_PORT_BASE+FE_INT_ENABLE; + sc->pdma_glo_cfg=PDMA_BASE+PDMA_GLO_CFG; + sc->pdma_glo_cfg=PDMA_BASE+PDMA_GLO_CFG; + sc->pdma_rst_idx=PDMA_BASE+PDMA_RST_IDX; + for (i = 0; i < RT_SOFTC_TX_RING_COUNT; i++) { + sc->tx_base_ptr[i]=PDMA_BASE+TX_BASE_PTR(i); + sc->tx_max_cnt[i]=PDMA_BASE+TX_MAX_CNT(i); + sc->tx_ctx_idx[i]=PDMA_BASE+TX_CTX_IDX(i); + sc->tx_dtx_idx[i]=PDMA_BASE+TX_DTX_IDX(i); + } + sc->rx_ring_count=1; + sc->rx_base_ptr[0]=PDMA_BASE+RX_BASE_PTR0; + sc->rx_max_cnt[0]=PDMA_BASE+RX_MAX_CNT0; + sc->rx_calc_idx[0]=PDMA_BASE+RX_CALC_IDX0; + sc->rx_drx_idx[0]=PDMA_BASE+RX_DRX_IDX0; + sc->int_rx_done_mask=INT_RX_DONE; + sc->int_tx_done_mask=INT_TXQ0_DONE; + }; /* allocate Tx and Rx rings */ for (i = 0; i < RT_SOFTC_TX_RING_COUNT; i++) { @@ -360,11 +478,12 @@ rt_attach(device_t dev) } sc->tx_ring_mgtqid = 5; - - error = rt_alloc_rx_ring(sc, &sc->rx_ring); - if (error != 0) { - device_printf(dev, "could not allocate Rx ring\n"); - goto fail; + for (i = 0; i < sc->rx_ring_count; i++) { + error = rt_alloc_rx_ring(sc, &sc->rx_ring[i], i); + if (error != 0) { + device_printf(dev, "could not allocate Rx ring\n"); + goto fail; + } } callout_init(&sc->periodic_ch, 0); @@ -434,7 +553,9 @@ rt_attach(device_t dev) /* set up interrupt */ error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, - NULL, rt_intr, sc, &sc->irqh); + NULL, (sc->rt_chipid == RT_CHIPID_RT5350 || + sc->rt_chipid == RT_CHIPID_MT7620) ? rt_rt5350_intr : rt_intr, + sc, &sc->irqh); if (error != 0) { printf("%s: could not set up interrupt\n", device_get_nameunit(dev)); @@ -451,7 +572,8 @@ fail: for (i = 0; i < RT_SOFTC_TX_RING_COUNT; i++) rt_free_tx_ring(sc, &sc->tx_ring[i]); - rt_free_rx_ring(sc, &sc->rx_ring); + for (i = 0; i < sc->rx_ring_count; i++) + rt_free_rx_ring(sc, &sc->rx_ring[i]); mtx_destroy(&sc->lock); @@ -567,8 +689,8 @@ rt_detach(device_t dev) /* free Tx and Rx rings */ for (i = 0; i < RT_SOFTC_TX_RING_COUNT; i++) rt_free_tx_ring(sc, &sc->tx_ring[i]); - - rt_free_rx_ring(sc, &sc->rx_ring); + for (i = 0; i < sc->rx_ring_count; i++) + rt_free_rx_ring(sc, &sc->rx_ring[i]); RT_SOFTC_UNLOCK(sc); @@ -658,11 +780,12 @@ rt_init_locked(void *priv) RT_SOFTC_ASSERT_LOCKED(sc); /* hardware reset */ - RT_WRITE(sc, GE_PORT_BASE + FE_RST_GLO, PSE_RESET); - rt305x_sysctl_set(SYSCTL_RSTCTRL, SYSCTL_RSTCTRL_FRENG); + //RT_WRITE(sc, GE_PORT_BASE + FE_RST_GLO, PSE_RESET); + //rt305x_sysctl_set(SYSCTL_RSTCTRL, SYSCTL_RSTCTRL_FRENG); /* Fwd to CPU (uni|broad|multi)cast and Unknown */ - RT_WRITE(sc, GDMA1_BASE + GDMA_FWD_CFG, + if(sc->rt_chipid == RT_CHIPID_RT3050 || sc->rt_chipid == RT_CHIPID_RT3052) + RT_WRITE(sc, GDMA1_BASE + GDMA_FWD_CFG, ( GDM_ICS_EN | /* Enable IP Csum */ GDM_TCS_EN | /* Enable TCP Csum */ @@ -675,12 +798,12 @@ rt_init_locked(void *priv) )); /* disable DMA engine */ - RT_WRITE(sc, PDMA_BASE + PDMA_GLO_CFG, 0); - RT_WRITE(sc, PDMA_BASE + PDMA_RST_IDX, 0xffffffff); + RT_WRITE(sc, sc->pdma_glo_cfg, 0); + RT_WRITE(sc, sc->pdma_rst_idx, 0xffffffff); /* wait while DMA engine is busy */ for (ntries = 0; ntries < 100; ntries++) { - tmp = RT_READ(sc, PDMA_BASE + PDMA_GLO_CFG); + tmp = RT_READ(sc, sc->pdma_glo_cfg); if (!(tmp & (FE_TX_DMA_BUSY | FE_RX_DMA_BUSY))) break; DELAY(1000); @@ -698,7 +821,7 @@ rt_init_locked(void *priv) FE_RST_DTX_IDX1 | FE_RST_DTX_IDX0; - RT_WRITE(sc, PDMA_BASE + PDMA_RST_IDX, tmp); + RT_WRITE(sc, sc->pdma_rst_idx, tmp); /* XXX switch set mac address */ for (i = 0; i < RT_SOFTC_TX_RING_COUNT; i++) @@ -706,36 +829,52 @@ rt_init_locked(void *priv) for (i = 0; i < RT_SOFTC_TX_RING_COUNT; i++) { /* update TX_BASE_PTRx */ - RT_WRITE(sc, PDMA_BASE + TX_BASE_PTR(i), + RT_WRITE(sc, sc->tx_base_ptr[i], sc->tx_ring[i].desc_phys_addr); - RT_WRITE(sc, PDMA_BASE + TX_MAX_CNT(i), + RT_WRITE(sc, sc->tx_max_cnt[i], RT_SOFTC_TX_RING_DESC_COUNT); - RT_WRITE(sc, PDMA_BASE + TX_CTX_IDX(i), 0); + RT_WRITE(sc, sc->tx_ctx_idx[i], 0); } /* init Rx ring */ - rt_reset_rx_ring(sc, &sc->rx_ring); + for (i = 0; i < sc->rx_ring_count; i++) + rt_reset_rx_ring(sc, &sc->rx_ring[i]); - /* update RX_BASE_PTR0 */ - RT_WRITE(sc, PDMA_BASE + RX_BASE_PTR0, - sc->rx_ring.desc_phys_addr); - RT_WRITE(sc, PDMA_BASE + RX_MAX_CNT0, - RT_SOFTC_RX_RING_DATA_COUNT); - RT_WRITE(sc, PDMA_BASE + RX_CALC_IDX0, - RT_SOFTC_RX_RING_DATA_COUNT - 1); + /* update RX_BASE_PTRx */ + for (i = 0; i < sc->rx_ring_count; i++) { + RT_WRITE(sc, sc->rx_base_ptr[i], + sc->rx_ring[i].desc_phys_addr); + RT_WRITE(sc, sc->rx_max_cnt[i], + RT_SOFTC_RX_RING_DATA_COUNT); + RT_WRITE(sc, sc->rx_calc_idx[i], + RT_SOFTC_RX_RING_DATA_COUNT - 1); + } /* write back DDONE, 16byte burst enable RX/TX DMA */ - RT_WRITE(sc, PDMA_BASE + PDMA_GLO_CFG, - FE_TX_WB_DDONE | FE_DMA_BT_SIZE16 | FE_RX_DMA_EN | FE_TX_DMA_EN); + tmp = FE_TX_WB_DDONE | FE_DMA_BT_SIZE16 | FE_RX_DMA_EN | FE_TX_DMA_EN; + if (sc->rt_chipid == RT_CHIPID_MT7620) + tmp |= (1<<31); + RT_WRITE(sc, sc->pdma_glo_cfg, tmp); /* disable interrupts mitigation */ - RT_WRITE(sc, PDMA_BASE + DELAY_INT_CFG, 0); + RT_WRITE(sc, sc->delay_int_cfg, 0); /* clear pending interrupts */ - RT_WRITE(sc, GE_PORT_BASE + FE_INT_STATUS, 0xffffffff); + RT_WRITE(sc, sc->fe_int_status, 0xffffffff); /* enable interrupts */ - tmp = CNT_PPE_AF | + if (sc->rt_chipid == RT_CHIPID_RT5350 || + sc->rt_chipid == RT_CHIPID_MT7620) + tmp = RT5350_INT_TX_COHERENT | + RT5350_INT_RX_COHERENT | + RT5350_INT_TXQ3_DONE | + RT5350_INT_TXQ2_DONE | + RT5350_INT_TXQ1_DONE | + RT5350_INT_TXQ0_DONE | + RT5350_INT_RXQ1_DONE | + RT5350_INT_RXQ0_DONE; + else + tmp = CNT_PPE_AF | CNT_GDM_AF | PSE_P2_FC | GDM_CRC_DROP | @@ -754,7 +893,7 @@ rt_init_locked(void *priv) sc->intr_enable_mask = tmp; - RT_WRITE(sc, GE_PORT_BASE + FE_INT_ENABLE, tmp); + RT_WRITE(sc, sc->fe_int_enable, tmp); if (rt_txrx_enable(sc) != 0) goto fail; @@ -824,12 +963,15 @@ rt_stop_locked(void *priv) RT_SOFTC_LOCK(sc); /* disable interrupts */ - RT_WRITE(sc, GE_PORT_BASE + FE_INT_ENABLE, 0); - - /* reset adapter */ - RT_WRITE(sc, GE_PORT_BASE + FE_RST_GLO, PSE_RESET); + RT_WRITE(sc, sc->fe_int_enable, 0); + + if(sc->rt_chipid == RT_CHIPID_RT5350 || + sc->rt_chipid == RT_CHIPID_MT7620) { + } else { + /* reset adapter */ + RT_WRITE(sc, GE_PORT_BASE + FE_RST_GLO, PSE_RESET); - RT_WRITE(sc, GDMA1_BASE + GDMA_FWD_CFG, + RT_WRITE(sc, GDMA1_BASE + GDMA_FWD_CFG, ( GDM_ICS_EN | /* Enable IP Csum */ GDM_TCS_EN | /* Enable TCP Csum */ @@ -840,6 +982,7 @@ rt_stop_locked(void *priv) GDM_DST_PORT_CPU << GDM_MFRC_P_SHIFT | /* Forward MCast to CPU */ GDM_DST_PORT_CPU << GDM_OFRC_P_SHIFT /* Forward Other to CPU */ )); + } } static void @@ -930,8 +1073,16 @@ rt_tx_data(struct rt_softc *sc, struct m /* set up Tx descs */ for (i = 0; i < ndmasegs; i += 2) { - /* Set destenation */ - desc->dst = (TXDSCR_DST_PORT_GDMA1); + + /* TODO: this needs to be refined as MT7620 for example has + * a different word3 layout than RT305x and RT5350 (the last + * one doesn't use word3 at all). + */ + + /* Set destination */ + if (sc->rt_chipid != RT_CHIPID_MT7620) + desc->dst = (TXDSCR_DST_PORT_GDMA1); + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) desc->dst |= (TXDSCR_IP_CSUM_GEN|TXDSCR_UDP_CSUM_GEN| TXDSCR_TCP_CSUM_GEN); @@ -986,7 +1137,7 @@ rt_tx_data(struct rt_softc *sc, struct m ring->data_cur = (ring->data_cur + 1) % RT_SOFTC_TX_RING_DATA_COUNT; /* kick Tx */ - RT_WRITE(sc, PDMA_BASE + TX_CTX_IDX(qid), ring->desc_cur); + RT_WRITE(sc, sc->tx_ctx_idx[qid], ring->desc_cur); return (0); } @@ -1272,8 +1423,8 @@ rt_intr(void *arg) ifp = sc->ifp; /* acknowledge interrupts */ - status = RT_READ(sc, GE_PORT_BASE + FE_INT_STATUS); - RT_WRITE(sc, GE_PORT_BASE + FE_INT_STATUS, status); + status = RT_READ(sc, sc->fe_int_status); + RT_WRITE(sc, sc->fe_int_status, status); RT_DPRINTF(sc, RT_DEBUG_INTR, "interrupt: status=0x%08x\n", status); @@ -1326,7 +1477,7 @@ rt_intr(void *arg) rt_tx_delay_intr(sc); if (status & INT_RX_DONE) - rt_rx_intr(sc); + rt_rx_intr(sc, 0); if (status & INT_TXQ3_DONE) rt_tx_intr(sc, 3); @@ -1341,6 +1492,56 @@ rt_intr(void *arg) rt_tx_intr(sc, 0); } +/* + * rt_rt5350_intr - main ISR for Ralink 5350 SoC + */ +static void +rt_rt5350_intr(void *arg) +{ + struct rt_softc *sc; + struct ifnet *ifp; + uint32_t status; + + sc = arg; + ifp = sc->ifp; + + /* acknowledge interrupts */ + status = RT_READ(sc, sc->fe_int_status); + RT_WRITE(sc, sc->fe_int_status, status); + + RT_DPRINTF(sc, RT_DEBUG_INTR, "interrupt: status=0x%08x\n", status); + + if (status == 0xffffffff || /* device likely went away */ + status == 0) /* not for us */ + return; + + sc->interrupts++; + + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + return; + + if (status & RT5350_INT_TX_COHERENT) + rt_tx_coherent_intr(sc); + if (status & RT5350_INT_RX_COHERENT) + rt_rx_coherent_intr(sc); + if (status & RT5350_RX_DLY_INT) + rt_rx_delay_intr(sc); + if (status & RT5350_TX_DLY_INT) + rt_tx_delay_intr(sc); + if (status & RT5350_INT_RXQ1_DONE) + rt_rx_intr(sc, 1); + if (status & RT5350_INT_RXQ0_DONE) + rt_rx_intr(sc, 0); + if (status & RT5350_INT_TXQ3_DONE) + rt_tx_intr(sc, 3); + if (status & RT5350_INT_TXQ2_DONE) + rt_tx_intr(sc, 2); + if (status & RT5350_INT_TXQ1_DONE) + rt_tx_intr(sc, 1); + if (status & RT5350_INT_TXQ0_DONE) + rt_tx_intr(sc, 0); +} + static void rt_tx_coherent_intr(struct rt_softc *sc) { @@ -1352,19 +1553,19 @@ rt_tx_coherent_intr(struct rt_softc *sc) sc->tx_coherent_interrupts++; /* restart DMA engine */ - tmp = RT_READ(sc, PDMA_BASE + PDMA_GLO_CFG); + tmp = RT_READ(sc, sc->pdma_glo_cfg); tmp &= ~(FE_TX_WB_DDONE | FE_TX_DMA_EN); - RT_WRITE(sc, PDMA_BASE + PDMA_GLO_CFG, tmp); + RT_WRITE(sc, sc->pdma_glo_cfg, tmp); for (i = 0; i < RT_SOFTC_TX_RING_COUNT; i++) rt_reset_tx_ring(sc, &sc->tx_ring[i]); for (i = 0; i < RT_SOFTC_TX_RING_COUNT; i++) { - RT_WRITE(sc, PDMA_BASE + TX_BASE_PTR(i), + RT_WRITE(sc, sc->tx_base_ptr[i], sc->tx_ring[i].desc_phys_addr); - RT_WRITE(sc, PDMA_BASE + TX_MAX_CNT(i), + RT_WRITE(sc, sc->tx_max_cnt[i], RT_SOFTC_TX_RING_DESC_COUNT); - RT_WRITE(sc, PDMA_BASE + TX_CTX_IDX(i), 0); + RT_WRITE(sc, sc->tx_ctx_idx[i], 0); } rt_txrx_enable(sc); @@ -1377,24 +1578,29 @@ static void rt_rx_coherent_intr(struct rt_softc *sc) { uint32_t tmp; + int i; RT_DPRINTF(sc, RT_DEBUG_INTR, "Rx coherent interrupt\n"); sc->rx_coherent_interrupts++; /* restart DMA engine */ - tmp = RT_READ(sc, PDMA_BASE + PDMA_GLO_CFG); + tmp = RT_READ(sc, sc->pdma_glo_cfg); tmp &= ~(FE_RX_DMA_EN); - RT_WRITE(sc, PDMA_BASE + PDMA_GLO_CFG, tmp); + RT_WRITE(sc, sc->pdma_glo_cfg, tmp); /* init Rx ring */ - rt_reset_rx_ring(sc, &sc->rx_ring); - RT_WRITE(sc, PDMA_BASE + RX_BASE_PTR0, - sc->rx_ring.desc_phys_addr); - RT_WRITE(sc, PDMA_BASE + RX_MAX_CNT0, - RT_SOFTC_RX_RING_DATA_COUNT); - RT_WRITE(sc, PDMA_BASE + RX_CALC_IDX0, - RT_SOFTC_RX_RING_DATA_COUNT - 1); + for (i = 0; i < sc->rx_ring_count; i++) + rt_reset_rx_ring(sc, &sc->rx_ring[i]); + + for (i = 0; i < sc->rx_ring_count; i++) { + RT_WRITE(sc, sc->rx_base_ptr[i], + sc->rx_ring[i].desc_phys_addr); + RT_WRITE(sc, sc->rx_max_cnt[i], + RT_SOFTC_RX_RING_DATA_COUNT); + RT_WRITE(sc, sc->rx_calc_idx[i], + RT_SOFTC_RX_RING_DATA_COUNT - 1); + } rt_txrx_enable(sc); } @@ -1403,19 +1609,22 @@ rt_rx_coherent_intr(struct rt_softc *sc) * rt_rx_intr - a packet received */ static void -rt_rx_intr(struct rt_softc *sc) +rt_rx_intr(struct rt_softc *sc, int qid) { + KASSERT(qid >= 0 && qid < sc->rx_ring_count, + ("%s: Rx interrupt: invalid qid=%d\n", + device_get_nameunit(sc->dev), qid)); RT_DPRINTF(sc, RT_DEBUG_INTR, "Rx interrupt\n"); - sc->rx_interrupts++; + sc->rx_interrupts[qid]++; RT_SOFTC_LOCK(sc); - if (!(sc->intr_disable_mask & INT_RX_DONE)) { - rt_intr_disable(sc, INT_RX_DONE); + if (!(sc->intr_disable_mask & (sc->int_rx_done_mask << qid))) { + rt_intr_disable(sc, (sc->int_rx_done_mask << qid)); taskqueue_enqueue(sc->taskqueue, &sc->rx_done_task); } - sc->intr_pending_mask |= INT_RX_DONE; + sc->intr_pending_mask |= (sc->int_rx_done_mask << qid); RT_SOFTC_UNLOCK(sc); } @@ -1451,12 +1660,12 @@ rt_tx_intr(struct rt_softc *sc, int qid) sc->tx_interrupts[qid]++; RT_SOFTC_LOCK(sc); - if (!(sc->intr_disable_mask & (INT_TXQ0_DONE << qid))) { - rt_intr_disable(sc, (INT_TXQ0_DONE << qid)); + if (!(sc->intr_disable_mask & (sc->int_tx_done_mask << qid))) { + rt_intr_disable(sc, (sc->int_tx_done_mask << qid)); taskqueue_enqueue(sc->taskqueue, &sc->tx_done_task); } - sc->intr_pending_mask |= (INT_TXQ0_DONE << qid); + sc->intr_pending_mask |= (sc->int_tx_done_mask << qid); RT_SOFTC_UNLOCK(sc); } @@ -1478,18 +1687,18 @@ rt_rx_done_task(void *context, int pendi if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) return; - sc->intr_pending_mask &= ~INT_RX_DONE; + sc->intr_pending_mask &= ~sc->int_rx_done_mask; - again = rt_rx_eof(sc, sc->rx_process_limit); + again = rt_rx_eof(sc, &sc->rx_ring[0], sc->rx_process_limit); RT_SOFTC_LOCK(sc); - if ((sc->intr_pending_mask & INT_RX_DONE) || again) { + if ((sc->intr_pending_mask & sc->int_rx_done_mask) || again) { RT_DPRINTF(sc, RT_DEBUG_RX, "Rx done task: scheduling again\n"); taskqueue_enqueue(sc->taskqueue, &sc->rx_done_task); } else { - rt_intr_enable(sc, INT_RX_DONE); + rt_intr_enable(sc, sc->int_rx_done_mask); } RT_SOFTC_UNLOCK(sc); @@ -1515,8 +1724,8 @@ rt_tx_done_task(void *context, int pendi return; for (i = RT_SOFTC_TX_RING_COUNT - 1; i >= 0; i--) { - if (sc->intr_pending_mask & (INT_TXQ0_DONE << i)) { - sc->intr_pending_mask &= ~(INT_TXQ0_DONE << i); + if (sc->intr_pending_mask & (sc->int_tx_done_mask << i)) { + sc->intr_pending_mask &= ~(sc->int_tx_done_mask << i); rt_tx_eof(sc, &sc->tx_ring[i]); } } @@ -1525,7 +1734,15 @@ rt_tx_done_task(void *context, int pendi ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - intr_mask = ( + if(sc->rt_chipid == RT_CHIPID_RT5350 || + sc->rt_chipid == RT_CHIPID_MT7620) + intr_mask = ( + RT5350_INT_TXQ3_DONE | + RT5350_INT_TXQ2_DONE | + RT5350_INT_TXQ1_DONE | + RT5350_INT_TXQ0_DONE); + else + intr_mask = ( INT_TXQ3_DONE | INT_TXQ2_DONE | INT_TXQ1_DONE | @@ -1584,10 +1801,10 @@ rt_periodic_task(void *context, int pend * network subsystem. */ static int -rt_rx_eof(struct rt_softc *sc, int limit) +rt_rx_eof(struct rt_softc *sc, struct rt_softc_rx_ring *ring, int limit) { struct ifnet *ifp; - struct rt_softc_rx_ring *ring; +/* struct rt_softc_rx_ring *ring; */ struct rt_rxdesc *desc; struct rt_softc_rx_data *data; struct mbuf *m, *mnew; @@ -1597,12 +1814,12 @@ rt_rx_eof(struct rt_softc *sc, int limit int error, nsegs, len, nframes; ifp = sc->ifp; - ring = &sc->rx_ring; +/* ring = &sc->rx_ring[0]; */ nframes = 0; while (limit != 0) { - index = RT_READ(sc, PDMA_BASE + RX_DRX_IDX0); + index = RT_READ(sc, sc->rx_drx_idx[0]); if (ring->cur == index) break; @@ -1728,10 +1945,10 @@ skip: } if (ring->cur == 0) - RT_WRITE(sc, PDMA_BASE + RX_CALC_IDX0, + RT_WRITE(sc, sc->rx_calc_idx[0], RT_SOFTC_RX_RING_DATA_COUNT - 1); else - RT_WRITE(sc, PDMA_BASE + RX_CALC_IDX0, + RT_WRITE(sc, sc->rx_calc_idx[0], ring->cur - 1); RT_DPRINTF(sc, RT_DEBUG_RX, "Rx eof: nframes=%d\n", nframes); @@ -1760,7 +1977,7 @@ rt_tx_eof(struct rt_softc *sc, struct rt nframes = 0; for (;;) { - index = RT_READ(sc, PDMA_BASE + TX_DTX_IDX(ring->qid)); + index = RT_READ(sc, sc->tx_dtx_idx[ring->qid]); if (ring->desc_next == index) break; @@ -1834,12 +2051,13 @@ rt_watchdog(struct rt_softc *sc) #ifdef notyet int ntries; #endif + if(sc->rt_chipid != RT_CHIPID_RT5350 && + sc->rt_chipid != RT_CHIPID_MT7620) { + tmp = RT_READ(sc, PSE_BASE + CDMA_OQ_STA); - tmp = RT_READ(sc, PSE_BASE + CDMA_OQ_STA); - - RT_DPRINTF(sc, RT_DEBUG_WATCHDOG, "watchdog: PSE_IQ_STA=0x%08x\n", - tmp); - + RT_DPRINTF(sc, RT_DEBUG_WATCHDOG, + "watchdog: PSE_IQ_STA=0x%08x\n", tmp); + } /* XXX: do not reset */ #ifdef notyet if (((tmp >> P0_IQ_PCNT_SHIFT) & 0xff) != 0) { @@ -1896,7 +2114,7 @@ rt_intr_enable(struct rt_softc *sc, uint sc->intr_disable_mask &= ~intr_mask; tmp = sc->intr_enable_mask & ~sc->intr_disable_mask; - RT_WRITE(sc, GE_PORT_BASE + FE_INT_ENABLE, tmp); + RT_WRITE(sc, sc->fe_int_enable, tmp); } static void @@ -1906,7 +2124,7 @@ rt_intr_disable(struct rt_softc *sc, uin sc->intr_disable_mask |= intr_mask; tmp = sc->intr_enable_mask & ~sc->intr_disable_mask; - RT_WRITE(sc, GE_PORT_BASE + FE_INT_ENABLE, tmp); + RT_WRITE(sc, sc->fe_int_enable, tmp); } /* @@ -1923,7 +2141,7 @@ rt_txrx_enable(struct rt_softc *sc) /* enable Tx/Rx DMA engine */ for (ntries = 0; ntries < 200; ntries++) { - tmp = RT_READ(sc, PDMA_BASE + PDMA_GLO_CFG); + tmp = RT_READ(sc, sc->pdma_glo_cfg); if (!(tmp & (FE_TX_DMA_BUSY | FE_RX_DMA_BUSY))) break; @@ -1938,7 +2156,7 @@ rt_txrx_enable(struct rt_softc *sc) DELAY(50); tmp |= FE_TX_WB_DDONE | FE_RX_DMA_EN | FE_TX_DMA_EN; - RT_WRITE(sc, PDMA_BASE + PDMA_GLO_CFG, tmp); + RT_WRITE(sc, sc->pdma_glo_cfg, tmp); /* XXX set Rx filter */ return (0); @@ -1948,7 +2166,7 @@ rt_txrx_enable(struct rt_softc *sc) * rt_alloc_rx_ring - allocate RX DMA ring buffer */ static int -rt_alloc_rx_ring(struct rt_softc *sc, struct rt_softc_rx_ring *ring) +rt_alloc_rx_ring(struct rt_softc *sc, struct rt_softc_rx_ring *ring, int qid) { struct rt_rxdesc *desc; struct rt_softc_rx_data *data; @@ -2041,6 +2259,7 @@ rt_alloc_rx_ring(struct rt_softc *sc, st bus_dmamap_sync(ring->desc_dma_tag, ring->desc_dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + ring->qid = qid; return (0); fail: @@ -2352,7 +2571,7 @@ rt_sysctl_attach(struct rt_softc *sc) "Rx coherent interrupts"); SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO, - "rx_interrupts", CTLFLAG_RD, &sc->rx_interrupts, + "rx_interrupts", CTLFLAG_RD, &sc->rx_interrupts[0], "Rx interrupts"); SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO, @@ -2606,6 +2825,10 @@ static driver_t rt_driver = static devclass_t rt_dev_class; DRIVER_MODULE(rt, nexus, rt_driver, rt_dev_class, 0, 0); +#ifdef FDT +DRIVER_MODULE(rt, simplebus, rt_driver, rt_dev_class, 0, 0); +#endif + MODULE_DEPEND(rt, ether, 1, 1, 1); MODULE_DEPEND(rt, miibus, 1, 1, 1); Modified: head/sys/dev/rt/if_rtreg.h ============================================================================== --- head/sys/dev/rt/if_rtreg.h Thu Dec 24 18:40:10 2015 (r292703) +++ head/sys/dev/rt/if_rtreg.h Thu Dec 24 18:41:16 2015 (r292704) @@ -62,6 +62,7 @@ #define FC_DROP_CNT_SHIFT 16 #define PSE_RESET (1<<0) +/* RT305x interrupt registers */ #define FE_INT_STATUS 0x10 #define CNT_PPE_AF (1<<31) #define CNT_GDM_AF (1<<29) @@ -82,6 +83,21 @@ #define TX_DLY_INT (1<<1) /* TXQ[0|1]_DONE with delay */ #define RX_DLY_INT (1<<0) /* RX_DONE with delay */ #define FE_INT_ENABLE 0x14 + +/* RT5350 interrupt registers */ +#define RT5350_FE_INT_STATUS (RT5350_PDMA_BASE + 0x220) +#define RT5350_INT_RX_COHERENT (1<<31) +#define RT5350_RX_DLY_INT (1<<30) +#define RT5350_INT_TX_COHERENT (1<<29) +#define RT5350_TX_DLY_INT (1<<28) +#define RT5350_INT_RXQ1_DONE (1<<17) +#define RT5350_INT_RXQ0_DONE (1<<16) +#define RT5350_INT_TXQ3_DONE (1<<3) +#define RT5350_INT_TXQ2_DONE (1<<2) +#define RT5350_INT_TXQ1_DONE (1<<1) +#define RT5350_INT_TXQ0_DONE (1<<0) +#define RT5350_FE_INT_ENABLE (RT5350_PDMA_BASE + 0x228) + #define MDIO_CFG2 0x18 #define FOE_TS_T 0x1c #define PSE_FQ_PCNT_MASK 0xff000000 @@ -208,7 +224,9 @@ #define P0_IQ_PCNT_SHIFT 0 #define PDMA_BASE 0x0100 +#define RT5350_PDMA_BASE 0x0800 #define PDMA_GLO_CFG 0x00 +#define RT5350_PDMA_GLO_CFG 0x204 #define FE_TX_WB_DDONE (1<<6) #define FE_DMA_BT_SIZE4 (0<<4) #define FE_DMA_BT_SIZE8 (1<<4) @@ -218,6 +236,7 @@ #define FE_TX_DMA_BUSY (1<<1) #define FE_TX_DMA_EN (1<<0) #define PDMA_RST_IDX 0x04 +#define RT5350_PDMA_RST_IDX 0x208 #define FE_RST_DRX_IDX0 (1<<16) #define FE_RST_DTX_IDX3 (1<<3) #define FE_RST_DTX_IDX2 (1<<2) @@ -225,7 +244,9 @@ #define FE_RST_DTX_IDX0 (1<<0) #define PDMA_SCH_CFG 0x08 +#define RT5350_PDMA_SCH_CFG 0x280 #define DELAY_INT_CFG 0x0C +#define RT5350_DELAY_INT_CFG 0x20C #define TXDLY_INT_EN (1<<31) #define TXMAX_PINT_SHIFT 24 #define TXMAX_PTIME_SHIFT 16 @@ -263,6 +284,41 @@ #define TX_CTX_IDX(qid) (((qid>1)?(0x28):(0x18)) + (qid) * 16) #define TX_DTX_IDX(qid) (((qid>1)?(0x2c):(0x1c)) + (qid) * 16) +#define RT5350_TX_BASE_PTR0 0x000 +#define RT5350_TX_MAX_CNT0 0x004 +#define RT5350_TX_CTX_IDX0 0x008 +#define RT5350_TX_DTX_IDX0 0x00C + +#define RT5350_TX_BASE_PTR1 0x010 +#define RT5350_TX_MAX_CNT1 0x014 +#define RT5350_TX_CTX_IDX1 0x018 +#define RT5350_TX_DTX_IDX1 0x01C + +#define RT5350_TX_BASE_PTR2 0x020 +#define RT5350_TX_MAX_CNT2 0x024 +#define RT5350_TX_CTX_IDX2 0x028 +#define RT5350_TX_DTX_IDX2 0x02C + +#define RT5350_TX_BASE_PTR3 0x030 +#define RT5350_TX_MAX_CNT3 0x034 +#define RT5350_TX_CTX_IDX3 0x038 +#define RT5350_TX_DTX_IDX3 0x03C + +#define RT5350_RX_BASE_PTR0 0x100 +#define RT5350_RX_MAX_CNT0 0x104 +#define RT5350_RX_CALC_IDX0 0x108 +#define RT5350_RX_DRX_IDX0 0x10C + +#define RT5350_RX_BASE_PTR1 0x110 +#define RT5350_RX_MAX_CNT1 0x114 +#define RT5350_RX_CALC_IDX1 0x118 +#define RT5350_RX_DRX_IDX1 0x11C + +#define RT5350_TX_BASE_PTR(qid) ((qid) * 0x10 + 0x000) +#define RT5350_TX_MAX_CNT(qid) ((qid) * 0x10 + 0x004) +#define RT5350_TX_CTX_IDX(qid) ((qid) * 0x10 + 0x008) +#define RT5350_TX_DTX_IDX(qid) ((qid) * 0x10 + 0x00C) + #define PPE_BASE 0x0200 #define CNTR_BASE 0x0400 Modified: head/sys/dev/rt/if_rtvar.h ============================================================================== --- head/sys/dev/rt/if_rtvar.h Thu Dec 24 18:40:10 2015 (r292703) +++ head/sys/dev/rt/if_rtvar.h Thu Dec 24 18:41:16 2015 (r292704) @@ -68,6 +68,7 @@ mtx_assert(&(ring)->lock, MA_OWNED) #define RT_SOFTC_TX_RING_COUNT 4 +#define RT_SOFTC_RX_RING_COUNT 4 #ifndef IF_RT_RING_DATA_COUNT #define IF_RT_RING_DATA_COUNT 128 @@ -151,6 +152,7 @@ struct rt_softc_rx_ring bus_dmamap_t spare_dma_map; struct rt_softc_rx_data data[RT_SOFTC_RX_RING_DATA_COUNT]; int cur; + int qid; }; struct rt_softc_tx_data @@ -216,7 +218,7 @@ struct rt_softc unsigned long periodic_round; struct taskqueue *taskqueue; - struct rt_softc_rx_ring rx_ring; + struct rt_softc_rx_ring rx_ring[RT_SOFTC_RX_RING_COUNT]; struct rt_softc_tx_ring tx_ring[RT_SOFTC_TX_RING_COUNT]; int tx_ring_mgtqid; @@ -227,7 +229,7 @@ struct rt_softc unsigned long interrupts; unsigned long tx_coherent_interrupts; unsigned long rx_coherent_interrupts; - unsigned long rx_interrupts; + unsigned long rx_interrupts[RT_SOFTC_RX_RING_COUNT]; unsigned long rx_delay_interrupts; unsigned long tx_interrupts[RT_SOFTC_TX_RING_COUNT]; unsigned long tx_delay_interrupts; @@ -257,6 +259,25 @@ struct rt_softc #ifdef IF_RT_DEBUG int debug; #endif + + uint32_t rt_chipid; + /* chip specific registers config */ + int rx_ring_count; + uint32_t int_rx_done_mask; + uint32_t int_tx_done_mask; + uint32_t delay_int_cfg; + uint32_t fe_int_status; + uint32_t fe_int_enable; + uint32_t pdma_glo_cfg; + uint32_t pdma_rst_idx; + uint32_t tx_base_ptr[RT_SOFTC_TX_RING_COUNT]; + uint32_t tx_max_cnt[RT_SOFTC_TX_RING_COUNT]; + uint32_t tx_ctx_idx[RT_SOFTC_TX_RING_COUNT]; + uint32_t tx_dtx_idx[RT_SOFTC_TX_RING_COUNT]; + uint32_t rx_base_ptr[RT_SOFTC_RX_RING_COUNT]; + uint32_t rx_max_cnt[RT_SOFTC_RX_RING_COUNT]; + uint32_t rx_calc_idx[RT_SOFTC_RX_RING_COUNT]; + uint32_t rx_drx_idx[RT_SOFTC_RX_RING_COUNT]; }; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 24 18:53:19 2015 Return-Path: Delivered-To: svn-src-all@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 0CEB2A512A9; Thu, 24 Dec 2015 18:53:19 +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 CD9B01D8D; Thu, 24 Dec 2015 18:53:18 +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 tBOIrHRq067705; Thu, 24 Dec 2015 18:53:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOIrHho067704; Thu, 24 Dec 2015 18:53:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512241853.tBOIrHho067704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 24 Dec 2015 18:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292705 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 18:53:19 -0000 Author: emaste Date: Thu Dec 24 18:53:17 2015 New Revision: 292705 URL: https://svnweb.freebsd.org/changeset/base/292705 Log: rtld: remove old XXX comment missed in r35529 Sponsored by: The FreeBSD Foundation Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Dec 24 18:41:16 2015 (r292704) +++ head/libexec/rtld-elf/rtld.c Thu Dec 24 18:53:17 2015 (r292705) @@ -1126,7 +1126,6 @@ digest_dynamic1(Obj_Entry *obj, int earl #ifndef __mips__ case DT_DEBUG: - /* XXX - not implemented yet */ if (!early) dbg("Filling in DT_DEBUG entry"); ((Elf_Dyn*)dynp)->d_un.d_ptr = (Elf_Addr) &r_debug; From owner-svn-src-all@freebsd.org Thu Dec 24 19:09:51 2015 Return-Path: Delivered-To: svn-src-all@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 36FC8A51659; Thu, 24 Dec 2015 19:09:51 +0000 (UTC) (envelope-from pkelsey@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 C106D11CA; Thu, 24 Dec 2015 19:09:50 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBOJ9oXe070860; Thu, 24 Dec 2015 19:09:50 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOJ9nlX070850; Thu, 24 Dec 2015 19:09:49 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201512241909.tBOJ9nlX070850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Thu, 24 Dec 2015 19:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292706 - in head/sys: conf netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 19:09:51 -0000 Author: pkelsey Date: Thu Dec 24 19:09:48 2015 New Revision: 292706 URL: https://svnweb.freebsd.org/changeset/base/292706 Log: Implementation of server-side TCP Fast Open (TFO) [RFC7413]. TFO is disabled by default in the kernel build. See the top comment in sys/netinet/tcp_fastopen.c for implementation particulars. Reviewed by: gnn, jch, stas MFC after: 3 days Sponsored by: Verisign, Inc. Differential Revision: https://reviews.freebsd.org/D4350 Added: head/sys/netinet/tcp_fastopen.c (contents, props changed) head/sys/netinet/tcp_fastopen.h (contents, props changed) Modified: head/sys/conf/files head/sys/conf/options head/sys/netinet/tcp.h head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_syncache.h head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Dec 24 18:53:17 2015 (r292705) +++ head/sys/conf/files Thu Dec 24 19:09:48 2015 (r292706) @@ -3688,6 +3688,7 @@ netinet/sctp_usrreq.c optional inet sct netinet/sctputil.c optional inet sctp | inet6 sctp netinet/siftr.c optional inet siftr alq | inet6 siftr alq netinet/tcp_debug.c optional tcpdebug +netinet/tcp_fastopen.c optional inet tcp_rfc7413 | inet6 tcp_rfc7413 netinet/tcp_hostcache.c optional inet | inet6 netinet/tcp_input.c optional inet | inet6 netinet/tcp_lro.c optional inet | inet6 Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Dec 24 18:53:17 2015 (r292705) +++ head/sys/conf/options Thu Dec 24 19:09:48 2015 (r292706) @@ -440,6 +440,8 @@ TCPDEBUG TCPPCAP opt_global.h SIFTR TCP_OFFLOAD opt_inet.h # Enable code to dispatch TCP offloading +TCP_RFC7413 opt_inet.h +TCP_RFC7413_MAX_KEYS opt_inet.h TCP_SIGNATURE opt_inet.h VLAN_ARRAY opt_vlan.h XBONEHACK Modified: head/sys/netinet/tcp.h ============================================================================== --- head/sys/netinet/tcp.h Thu Dec 24 18:53:17 2015 (r292705) +++ head/sys/netinet/tcp.h Thu Dec 24 19:09:48 2015 (r292706) @@ -97,6 +97,10 @@ struct tcphdr { #define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ #define TCPOPT_SIGNATURE 19 /* Keyed MD5: RFC 2385 */ #define TCPOLEN_SIGNATURE 18 +#define TCPOPT_FAST_OPEN 34 +#define TCPOLEN_FAST_OPEN_EMPTY 2 +#define TCPOLEN_FAST_OPEN_MIN 6 +#define TCPOLEN_FAST_OPEN_MAX 18 /* Miscellaneous constants */ #define MAX_SACK_BLKS 6 /* Max # SACK blocks stored at receiver side */ @@ -165,6 +169,7 @@ struct tcphdr { #define TCP_KEEPIDLE 256 /* L,N,X start keeplives after this period */ #define TCP_KEEPINTVL 512 /* L,N interval between keepalives */ #define TCP_KEEPCNT 1024 /* L,N number of keepalives before close */ +#define TCP_FASTOPEN 1025 /* enable TFO / was created via TFO */ #define TCP_PCAP_OUT 2048 /* number of output packets to keep */ #define TCP_PCAP_IN 4096 /* number of input packets to keep */ #define TCP_FUNCTION_BLK 8192 /* Set the tcp function pointers to the specified stack */ Added: head/sys/netinet/tcp_fastopen.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/tcp_fastopen.c Thu Dec 24 19:09:48 2015 (r292706) @@ -0,0 +1,442 @@ +/*- + * Copyright (c) 2015 Patrick Kelsey + * 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. + */ + +/* + * This is a server-side implementation of TCP Fast Open (TFO) [RFC7413]. + * + * This implementation is currently considered to be experimental and is not + * included in kernel builds by default. To include this code, add the + * following line to your kernel config: + * + * options TCP_RFC7413 + * + * The generated TFO cookies are the 64-bit output of + * SipHash24(<16-byte-key>). Multiple concurrent valid keys are + * supported so that time-based rolling cookie invalidation policies can be + * implemented in the system. The default number of concurrent keys is 2. + * This can be adjusted in the kernel config as follows: + * + * options TCP_RFC7413_MAX_KEYS= + * + * + * The following TFO-specific sysctls are defined: + * + * net.inet.tcp.fastopen.acceptany (RW, default 0) + * When non-zero, all client-supplied TFO cookies will be considered to + * be valid. + * + * net.inet.tcp.fastopen.autokey (RW, default 120) + * When this and net.inet.tcp.fastopen.enabled are non-zero, a new key + * will be automatically generated after this many seconds. + * + * net.inet.tcp.fastopen.enabled (RW, default 0) + * When zero, no new TFO connections can be created. On the transition + * from enabled to disabled, all installed keys are removed. On the + * transition from disabled to enabled, if net.inet.tcp.fastopen.autokey + * is non-zero and there are no keys installed, a new key will be + * generated immediately. The transition from enabled to disabled does + * not affect any TFO connections in progress; it only prevents new ones + * from being made. + * + * net.inet.tcp.fastopen.keylen (RO) + * The key length in bytes. + * + * net.inet.tcp.fastopen.maxkeys (RO) + * The maximum number of keys supported. + * + * net.inet.tcp.fastopen.numkeys (RO) + * The current number of keys installed. + * + * net.inet.tcp.fastopen.setkey (WO) + * Install a new key by writing net.inet.tcp.fastopen.keylen bytes to this + * sysctl. + * + * + * In order for TFO connections to be created via a listen socket, that + * socket must have the TCP_FASTOPEN socket option set on it. This option + * can be set on the socket either before or after the listen() is invoked. + * Clearing this option on a listen socket after it has been set has no + * effect on existing TFO connections or TFO connections in progress; it + * only prevents new TFO connections from being made. + * + * For passively-created sockets, the TCP_FASTOPEN socket option can be + * queried to determine whether the connection was established using TFO. + * Note that connections that are established via a TFO SYN, but that fall + * back to using a non-TFO SYN|ACK will have the TCP_FASTOPEN socket option + * set. + * + * Per the RFC, this implementation limits the number of TFO connections + * that can be in the SYN_RECEIVED state on a per listen-socket basis. + * Whenever this limit is exceeded, requests for new TFO connections are + * serviced as non-TFO requests. Without such a limit, given a valid TFO + * cookie, an attacker could keep the listen queue in an overflow condition + * using a TFO SYN flood. This implementation sets the limit at half the + * configured listen backlog. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include + + +#define TCP_FASTOPEN_KEY_LEN SIPHASH_KEY_LENGTH + +#if !defined(TCP_RFC7413_MAX_KEYS) || (TCP_RFC7413_MAX_KEYS < 1) +#define TCP_FASTOPEN_MAX_KEYS 2 +#else +#define TCP_FASTOPEN_MAX_KEYS TCP_RFC7413_MAX_KEYS +#endif + +struct tcp_fastopen_keylist { + unsigned int newest; + uint8_t key[TCP_FASTOPEN_MAX_KEYS][TCP_FASTOPEN_KEY_LEN]; +}; + +struct tcp_fastopen_callout { + struct callout c; + struct vnet *v; +}; + +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, fastopen, CTLFLAG_RW, 0, "TCP Fast Open"); + +static VNET_DEFINE(int, tcp_fastopen_acceptany) = 0; +#define V_tcp_fastopen_acceptany VNET(tcp_fastopen_acceptany) +SYSCTL_INT(_net_inet_tcp_fastopen, OID_AUTO, acceptany, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_fastopen_acceptany), 0, + "Accept any non-empty cookie"); + +static VNET_DEFINE(unsigned int, tcp_fastopen_autokey) = 120; +#define V_tcp_fastopen_autokey VNET(tcp_fastopen_autokey) +static int sysctl_net_inet_tcp_fastopen_autokey(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, autokey, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, + &sysctl_net_inet_tcp_fastopen_autokey, "IU", + "Number of seconds between auto-generation of a new key; zero disables"); + +VNET_DEFINE(unsigned int, tcp_fastopen_enabled) = 0; +static int sysctl_net_inet_tcp_fastopen_enabled(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, enabled, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, + &sysctl_net_inet_tcp_fastopen_enabled, "IU", + "Enable/disable TCP Fast Open processing"); + +SYSCTL_INT(_net_inet_tcp_fastopen, OID_AUTO, keylen, + CTLFLAG_RD, SYSCTL_NULL_INT_PTR, TCP_FASTOPEN_KEY_LEN, + "Key length in bytes"); + +SYSCTL_INT(_net_inet_tcp_fastopen, OID_AUTO, maxkeys, + CTLFLAG_RD, SYSCTL_NULL_INT_PTR, TCP_FASTOPEN_MAX_KEYS, + "Maximum number of keys supported"); + +static VNET_DEFINE(unsigned int, tcp_fastopen_numkeys) = 0; +#define V_tcp_fastopen_numkeys VNET(tcp_fastopen_numkeys) +SYSCTL_UINT(_net_inet_tcp_fastopen, OID_AUTO, numkeys, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(tcp_fastopen_numkeys), 0, + "Number of keys installed"); + +static int sysctl_net_inet_tcp_fastopen_setkey(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, setkey, + CTLFLAG_VNET | CTLTYPE_OPAQUE | CTLFLAG_WR, NULL, 0, + &sysctl_net_inet_tcp_fastopen_setkey, "", + "Install a new key"); + +static VNET_DEFINE(struct rmlock, tcp_fastopen_keylock); +#define V_tcp_fastopen_keylock VNET(tcp_fastopen_keylock) + +#define TCP_FASTOPEN_KEYS_RLOCK(t) rm_rlock(&V_tcp_fastopen_keylock, (t)) +#define TCP_FASTOPEN_KEYS_RUNLOCK(t) rm_runlock(&V_tcp_fastopen_keylock, (t)) +#define TCP_FASTOPEN_KEYS_WLOCK() rm_wlock(&V_tcp_fastopen_keylock) +#define TCP_FASTOPEN_KEYS_WUNLOCK() rm_wunlock(&V_tcp_fastopen_keylock) + +static VNET_DEFINE(struct tcp_fastopen_keylist, tcp_fastopen_keys); +#define V_tcp_fastopen_keys VNET(tcp_fastopen_keys) + +static VNET_DEFINE(struct tcp_fastopen_callout, tcp_fastopen_autokey_ctx); +#define V_tcp_fastopen_autokey_ctx VNET(tcp_fastopen_autokey_ctx) + +static VNET_DEFINE(uma_zone_t, counter_zone); +#define V_counter_zone VNET(counter_zone) + +void +tcp_fastopen_init(void) +{ + V_counter_zone = uma_zcreate("tfo", sizeof(unsigned int), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + rm_init(&V_tcp_fastopen_keylock, "tfo_keylock"); + callout_init_rm(&V_tcp_fastopen_autokey_ctx.c, + &V_tcp_fastopen_keylock, 0); + V_tcp_fastopen_keys.newest = TCP_FASTOPEN_MAX_KEYS - 1; +} + +void +tcp_fastopen_destroy(void) +{ + callout_drain(&V_tcp_fastopen_autokey_ctx.c); + rm_destroy(&V_tcp_fastopen_keylock); + uma_zdestroy(V_counter_zone); +} + +unsigned int * +tcp_fastopen_alloc_counter(void) +{ + unsigned int *counter; + counter = uma_zalloc(V_counter_zone, M_NOWAIT); + if (counter) + *counter = 1; + return (counter); +} + +void +tcp_fastopen_decrement_counter(unsigned int *counter) +{ + if (*counter == 1) + uma_zfree(V_counter_zone, counter); + else + atomic_subtract_int(counter, 1); +} + +static void +tcp_fastopen_addkey_locked(uint8_t *key) +{ + + V_tcp_fastopen_keys.newest++; + if (V_tcp_fastopen_keys.newest == TCP_FASTOPEN_MAX_KEYS) + V_tcp_fastopen_keys.newest = 0; + memcpy(V_tcp_fastopen_keys.key[V_tcp_fastopen_keys.newest], key, + TCP_FASTOPEN_KEY_LEN); + if (V_tcp_fastopen_numkeys < TCP_FASTOPEN_MAX_KEYS) + V_tcp_fastopen_numkeys++; +} + +static void +tcp_fastopen_autokey_locked(void) +{ + uint8_t newkey[TCP_FASTOPEN_KEY_LEN]; + + arc4rand(newkey, TCP_FASTOPEN_KEY_LEN, 0); + tcp_fastopen_addkey_locked(newkey); +} + +static void +tcp_fastopen_autokey_callout(void *arg) +{ + struct tcp_fastopen_callout *ctx = arg; + + CURVNET_SET(ctx->v); + tcp_fastopen_autokey_locked(); + callout_reset(&ctx->c, V_tcp_fastopen_autokey * hz, + tcp_fastopen_autokey_callout, ctx); + CURVNET_RESTORE(); +} + + +static uint64_t +tcp_fastopen_make_cookie(uint8_t key[SIPHASH_KEY_LENGTH], struct in_conninfo *inc) +{ + SIPHASH_CTX ctx; + uint64_t siphash; + + SipHash24_Init(&ctx); + SipHash_SetKey(&ctx, key); + switch (inc->inc_flags & INC_ISIPV6) { +#ifdef INET + case 0: + SipHash_Update(&ctx, &inc->inc_faddr, sizeof(inc->inc_faddr)); + break; +#endif +#ifdef INET6 + case INC_ISIPV6: + SipHash_Update(&ctx, &inc->inc6_faddr, sizeof(inc->inc6_faddr)); + break; +#endif + } + SipHash_Final((u_int8_t *)&siphash, &ctx); + + return (siphash); +} + + +/* + * Return values: + * -1 the cookie is invalid and no valid cookie is available + * 0 the cookie is invalid and the latest cookie has been returned + * 1 the cookie is valid and the latest cookie has been returned + */ +int +tcp_fastopen_check_cookie(struct in_conninfo *inc, uint8_t *cookie, + unsigned int len, uint64_t *latest_cookie) +{ + struct rm_priotracker tracker; + unsigned int i, key_index; + uint64_t cur_cookie; + + if (V_tcp_fastopen_acceptany) { + *latest_cookie = 0; + return (1); + } + + if (len != TCP_FASTOPEN_COOKIE_LEN) { + if (V_tcp_fastopen_numkeys > 0) { + *latest_cookie = + tcp_fastopen_make_cookie( + V_tcp_fastopen_keys.key[V_tcp_fastopen_keys.newest], + inc); + return (0); + } + return (-1); + } + + /* + * Check against each available key, from newest to oldest. + */ + TCP_FASTOPEN_KEYS_RLOCK(&tracker); + key_index = V_tcp_fastopen_keys.newest; + for (i = 0; i < V_tcp_fastopen_numkeys; i++) { + cur_cookie = + tcp_fastopen_make_cookie(V_tcp_fastopen_keys.key[key_index], + inc); + if (i == 0) + *latest_cookie = cur_cookie; + if (memcmp(cookie, &cur_cookie, TCP_FASTOPEN_COOKIE_LEN) == 0) { + TCP_FASTOPEN_KEYS_RUNLOCK(&tracker); + return (1); + } + if (key_index == 0) + key_index = TCP_FASTOPEN_MAX_KEYS - 1; + else + key_index--; + } + TCP_FASTOPEN_KEYS_RUNLOCK(&tracker); + + return (0); +} + +static int +sysctl_net_inet_tcp_fastopen_autokey(SYSCTL_HANDLER_ARGS) +{ + int error; + unsigned int new; + + new = V_tcp_fastopen_autokey; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + if (new > (INT_MAX / hz)) + return (EINVAL); + + TCP_FASTOPEN_KEYS_WLOCK(); + if (V_tcp_fastopen_enabled) { + if (V_tcp_fastopen_autokey && !new) + callout_stop(&V_tcp_fastopen_autokey_ctx.c); + else if (new) + callout_reset(&V_tcp_fastopen_autokey_ctx.c, + new * hz, tcp_fastopen_autokey_callout, + &V_tcp_fastopen_autokey_ctx); + } + V_tcp_fastopen_autokey = new; + TCP_FASTOPEN_KEYS_WUNLOCK(); + } + + return (error); +} + +static int +sysctl_net_inet_tcp_fastopen_enabled(SYSCTL_HANDLER_ARGS) +{ + int error; + unsigned int new; + + new = V_tcp_fastopen_enabled; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + if (V_tcp_fastopen_enabled && !new) { + /* enabled -> disabled */ + TCP_FASTOPEN_KEYS_WLOCK(); + V_tcp_fastopen_numkeys = 0; + V_tcp_fastopen_keys.newest = TCP_FASTOPEN_MAX_KEYS - 1; + if (V_tcp_fastopen_autokey) + callout_stop(&V_tcp_fastopen_autokey_ctx.c); + V_tcp_fastopen_enabled = 0; + TCP_FASTOPEN_KEYS_WUNLOCK(); + } else if (!V_tcp_fastopen_enabled && new) { + /* disabled -> enabled */ + TCP_FASTOPEN_KEYS_WLOCK(); + if (V_tcp_fastopen_autokey && + (V_tcp_fastopen_numkeys == 0)) { + tcp_fastopen_autokey_locked(); + callout_reset(&V_tcp_fastopen_autokey_ctx.c, + V_tcp_fastopen_autokey * hz, + tcp_fastopen_autokey_callout, + &V_tcp_fastopen_autokey_ctx); + } + V_tcp_fastopen_enabled = 1; + TCP_FASTOPEN_KEYS_WUNLOCK(); + } + } + return (error); +} + +static int +sysctl_net_inet_tcp_fastopen_setkey(SYSCTL_HANDLER_ARGS) +{ + int error; + uint8_t newkey[TCP_FASTOPEN_KEY_LEN]; + + if (req->oldptr != NULL || req->oldlen != 0) + return (EINVAL); + if (req->newptr == NULL) + return (EPERM); + if (req->newlen != sizeof(newkey)) + return (EINVAL); + error = SYSCTL_IN(req, newkey, sizeof(newkey)); + if (error) + return (error); + + TCP_FASTOPEN_KEYS_WLOCK(); + tcp_fastopen_addkey_locked(newkey); + TCP_FASTOPEN_KEYS_WUNLOCK(); + + return (0); +} Added: head/sys/netinet/tcp_fastopen.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/tcp_fastopen.h Thu Dec 24 19:09:48 2015 (r292706) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2015 Patrick Kelsey + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _TCP_FASTOPEN_H_ +#define _TCP_FASTOPEN_H_ + +#ifdef _KERNEL + +#define TCP_FASTOPEN_COOKIE_LEN 8 /* tied to SipHash24 64-bit output */ + +VNET_DECLARE(unsigned int, tcp_fastopen_enabled); +#define V_tcp_fastopen_enabled VNET(tcp_fastopen_enabled) + +void tcp_fastopen_init(void); +void tcp_fastopen_destroy(void); +unsigned int *tcp_fastopen_alloc_counter(void); +void tcp_fastopen_decrement_counter(unsigned int *counter); +int tcp_fastopen_check_cookie(struct in_conninfo *inc, uint8_t *cookie, + unsigned int len, uint64_t *latest_cookie); +#endif /* _KERNEL */ + +#endif /* _TCP_FASTOPEN_H_ */ Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Dec 24 18:53:17 2015 (r292705) +++ head/sys/netinet/tcp_input.c Thu Dec 24 19:09:48 2015 (r292706) @@ -98,6 +98,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef TCP_RFC7413 +#include +#endif #include #include #include @@ -999,7 +1002,8 @@ relocked: INP_INFO_RLOCK_ASSERT(&V_tcbinfo); #endif if (!((tp->t_state == TCPS_ESTABLISHED && (thflags & TH_SYN) == 0) || - (tp->t_state == TCPS_LISTEN && (thflags & TH_SYN)))) { + (tp->t_state == TCPS_LISTEN && (thflags & TH_SYN) && + !(tp->t_flags & TF_FASTOPEN)))) { if (ti_locked == TI_UNLOCKED) { if (INP_INFO_TRY_RLOCK(&V_tcbinfo) == 0) { in_pcbref(inp); @@ -1091,6 +1095,9 @@ relocked: rstreason = BANDLIM_RST_OPENPORT; goto dropwithreset; } +#ifdef TCP_RFC7413 +new_tfo_socket: +#endif if (so == NULL) { /* * We completed the 3-way handshake @@ -1353,7 +1360,12 @@ relocked: #endif TCP_PROBE3(debug__input, tp, th, mtod(m, const char *)); tcp_dooptions(&to, optp, optlen, TO_SYN); +#ifdef TCP_RFC7413 + if (syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL)) + goto new_tfo_socket; +#else syncache_add(&inc, &to, th, inp, &so, m, NULL, NULL); +#endif /* * Entry added to syncache and mbuf consumed. * Only the listen socket is unlocked by syncache_add(). @@ -1468,7 +1480,8 @@ tcp_do_segment(struct mbuf *m, struct tc struct in_conninfo *inc; struct mbuf *mfree; struct tcpopt to; - + int tfo_syn; + #ifdef TCPDEBUG /* * The size of tcp_saveipgen must be the size of the max ip header, @@ -1921,6 +1934,28 @@ tcp_do_segment(struct mbuf *m, struct tc rstreason = BANDLIM_RST_OPENPORT; goto dropwithreset; } +#ifdef TCP_RFC7413 + if (tp->t_flags & TF_FASTOPEN) { + /* + * When a TFO connection is in SYN_RECEIVED, the + * only valid packets are the initial SYN, a + * retransmit/copy of the initial SYN (possibly with + * a subset of the original data), a valid ACK, a + * FIN, or a RST. + */ + if ((thflags & (TH_SYN|TH_ACK)) == (TH_SYN|TH_ACK)) { + rstreason = BANDLIM_RST_OPENPORT; + goto dropwithreset; + } else if (thflags & TH_SYN) { + /* non-initial SYN is ignored */ + if ((tcp_timer_active(tp, TT_DELACK) || + tcp_timer_active(tp, TT_REXMT))) + goto drop; + } else if (!(thflags & (TH_ACK|TH_FIN|TH_RST))) { + goto drop; + } + } +#endif break; /* @@ -2136,7 +2171,8 @@ tcp_do_segment(struct mbuf *m, struct tc * RFC5961 Section 4.2 * Send challenge ACK for any SYN in synchronized state. */ - if ((thflags & TH_SYN) && tp->t_state != TCPS_SYN_SENT) { + if ((thflags & TH_SYN) && tp->t_state != TCPS_SYN_SENT && + tp->t_state != TCPS_SYN_RECEIVED) { KASSERT(ti_locked == TI_RLOCKED, ("tcp_do_segment: TH_SYN ti_locked %d", ti_locked)); INP_INFO_RLOCK_ASSERT(&V_tcbinfo); @@ -2330,9 +2366,16 @@ tcp_do_segment(struct mbuf *m, struct tc */ if ((thflags & TH_ACK) == 0) { if (tp->t_state == TCPS_SYN_RECEIVED || - (tp->t_flags & TF_NEEDSYN)) + (tp->t_flags & TF_NEEDSYN)) { +#ifdef TCP_RFC7413 + if (tp->t_state == TCPS_SYN_RECEIVED && + tp->t_flags & TF_FASTOPEN) { + tp->snd_wnd = tiwin; + cc_conn_init(tp); + } +#endif goto step6; - else if (tp->t_flags & TF_ACKNOW) + } else if (tp->t_flags & TF_ACKNOW) goto dropafterack; else goto drop; @@ -2371,7 +2414,27 @@ tcp_do_segment(struct mbuf *m, struct tc tcp_state_change(tp, TCPS_ESTABLISHED); TCP_PROBE5(accept__established, NULL, tp, mtod(m, const char *), tp, th); - cc_conn_init(tp); +#ifdef TCP_RFC7413 + if (tp->t_tfo_pending) { + tcp_fastopen_decrement_counter(tp->t_tfo_pending); + tp->t_tfo_pending = NULL; + + /* + * Account for the ACK of our SYN prior to + * regular ACK processing below. + */ + tp->snd_una++; + } + /* + * TFO connections call cc_conn_init() during SYN + * processing. Calling it again here for such + * connections is not harmless as it would undo the + * snd_cwnd reduction that occurs when a TFO SYN|ACK + * is retransmitted. + */ + if (!(tp->t_flags & TF_FASTOPEN)) +#endif + cc_conn_init(tp); tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); } /* @@ -2919,7 +2982,9 @@ dodata: /* XXX */ * case PRU_RCVD). If a FIN has already been received on this * connection then we just ignore the text. */ - if ((tlen || (thflags & TH_FIN)) && + tfo_syn = ((tp->t_state == TCPS_SYN_RECEIVED) && + (tp->t_flags & TF_FASTOPEN)); + if ((tlen || (thflags & TH_FIN) || tfo_syn) && TCPS_HAVERCVDFIN(tp->t_state) == 0) { tcp_seq save_start = th->th_seq; m_adj(m, drop_hdrlen); /* delayed header drop */ @@ -2937,8 +3002,9 @@ dodata: /* XXX */ */ if (th->th_seq == tp->rcv_nxt && LIST_EMPTY(&tp->t_segq) && - TCPS_HAVEESTABLISHED(tp->t_state)) { - if (DELAY_ACK(tp, tlen)) + (TCPS_HAVEESTABLISHED(tp->t_state) || + tfo_syn)) { + if (DELAY_ACK(tp, tlen) || tfo_syn) tp->t_flags |= TF_DELACK; else tp->t_flags |= TF_ACKNOW; @@ -3293,6 +3359,21 @@ tcp_dooptions(struct tcpopt *to, u_char to->to_sacks = cp + 2; TCPSTAT_INC(tcps_sack_rcv_blocks); break; +#ifdef TCP_RFC7413 + case TCPOPT_FAST_OPEN: + if ((optlen != TCPOLEN_FAST_OPEN_EMPTY) && + (optlen < TCPOLEN_FAST_OPEN_MIN) && + (optlen > TCPOLEN_FAST_OPEN_MAX)) + continue; + if (!(flags & TO_SYN)) + continue; + if (!V_tcp_fastopen_enabled) + continue; + to->to_flags |= TOF_FASTOPEN; + to->to_tfo_len = optlen - 2; + to->to_tfo_cookie = to->to_tfo_len ? cp + 2 : NULL; + break; +#endif default: continue; } Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Dec 24 18:53:17 2015 (r292705) +++ head/sys/netinet/tcp_output.c Thu Dec 24 19:09:48 2015 (r292706) @@ -68,6 +68,9 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#ifdef TCP_RFC7413 +#include +#endif #define TCPOUTFLAGS #include #include @@ -204,6 +207,17 @@ tcp_output(struct tcpcb *tp) return (tcp_offload_output(tp)); #endif +#ifdef TCP_RFC7413 + /* + * For TFO connections in SYN_RECEIVED, only allow the initial + * SYN|ACK and those sent by the retransmit timer. + */ + if ((tp->t_flags & TF_FASTOPEN) && + (tp->t_state == TCPS_SYN_RECEIVED) && + SEQ_GT(tp->snd_max, tp->snd_una) && /* inital SYN|ACK sent */ + (tp->snd_nxt != tp->snd_una)) /* not a retransmit */ + return (0); +#endif /* * Determine length of data that should be transmitted, * and flags that will be used. @@ -390,6 +404,15 @@ after_sack_rexmit: if ((flags & TH_SYN) && SEQ_GT(tp->snd_nxt, tp->snd_una)) { if (tp->t_state != TCPS_SYN_RECEIVED) flags &= ~TH_SYN; +#ifdef TCP_RFC7413 + /* + * When sending additional segments following a TFO SYN|ACK, + * do not include the SYN bit. + */ + if ((tp->t_flags & TF_FASTOPEN) && + (tp->t_state == TCPS_SYN_RECEIVED)) + flags &= ~TH_SYN; +#endif off--, len++; } @@ -403,6 +426,17 @@ after_sack_rexmit: flags &= ~TH_FIN; } +#ifdef TCP_RFC7413 + /* + * When retransmitting SYN|ACK on a passively-created TFO socket, + * don't include data, as the presence of data may have caused the + * original SYN|ACK to have been dropped by a middlebox. + */ + if ((tp->t_flags & TF_FASTOPEN) && + (((tp->t_state == TCPS_SYN_RECEIVED) && (tp->t_rxtshift > 0)) || + (flags & TH_RST))) + len = 0; +#endif if (len <= 0) { /* * If FIN has been sent but not acked, @@ -725,6 +759,22 @@ send: tp->snd_nxt = tp->iss; to.to_mss = tcp_mssopt(&tp->t_inpcb->inp_inc); to.to_flags |= TOF_MSS; +#ifdef TCP_RFC7413 + /* + * Only include the TFO option on the first + * transmission of the SYN|ACK on a + * passively-created TFO socket, as the presence of + * the TFO option may have caused the original + * SYN|ACK to have been dropped by a middlebox. + */ + if ((tp->t_flags & TF_FASTOPEN) && + (tp->t_state == TCPS_SYN_RECEIVED) && + (tp->t_rxtshift == 0)) { + to.to_tfo_len = TCP_FASTOPEN_COOKIE_LEN; + to.to_tfo_cookie = (u_char *)&tp->t_tfo_cookie; + to.to_flags |= TOF_FASTOPEN; + } +#endif } /* Window scaling. */ if ((flags & TH_SYN) && (tp->t_flags & TF_REQ_SCALE)) { @@ -1004,7 +1054,7 @@ send: * give data to the user when a buffer fills or * a PUSH comes in.) */ - if (off + len == sbused(&so->so_snd)) + if ((off + len == sbused(&so->so_snd)) && !(flags & TH_SYN)) flags |= TH_PUSH; SOCKBUF_UNLOCK(&so->so_snd); } else { @@ -1711,6 +1761,25 @@ tcp_addoptions(struct tcpopt *to, u_char TCPSTAT_INC(tcps_sack_send_blocks); break; } +#ifdef TCP_RFC7413 + case TOF_FASTOPEN: + { + int total_len; + + /* XXX is there any point to aligning this option? */ + total_len = TCPOLEN_FAST_OPEN_EMPTY + to->to_tfo_len; + if (TCP_MAXOLEN - optlen < total_len) + continue; + *optp++ = TCPOPT_FAST_OPEN; + *optp++ = total_len; + if (to->to_tfo_len > 0) { + bcopy(to->to_tfo_cookie, optp, to->to_tfo_len); + optp += to->to_tfo_len; + } + optlen += total_len; + break; + } +#endif default: panic("%s: unknown TCP option type", __func__); break; Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Dec 24 18:53:17 2015 (r292705) +++ head/sys/netinet/tcp_subr.c Thu Dec 24 19:09:48 2015 (r292706) @@ -84,6 +84,9 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef TCP_RFC7413 +#include +#endif #include #include #include @@ -704,6 +707,10 @@ tcp_init(void) #ifdef TCPPCAP tcp_pcap_init(); #endif + +#ifdef TCP_RFC7413 + tcp_fastopen_init(); +#endif } #ifdef VIMAGE @@ -712,6 +719,9 @@ tcp_destroy(void) { int error; +#ifdef TCP_RFC7413 + tcp_fastopen_destroy(); +#endif tcp_hc_destroy(); syncache_destroy(); tcp_tw_destroy(); @@ -1439,6 +1449,17 @@ tcp_close(struct tcpcb *tp) if (tp->t_state == TCPS_LISTEN) tcp_offload_listen_stop(tp); #endif +#ifdef TCP_RFC7413 + /* + * This releases the TFO pending counter resource for TFO listen + * sockets as well as passively-created TFO sockets that transition + * from SYN_RECEIVED to CLOSED. + */ + if (tp->t_tfo_pending) { + tcp_fastopen_decrement_counter(tp->t_tfo_pending); + tp->t_tfo_pending = NULL; + } +#endif in_pcbdrop(inp); TCPSTAT_INC(tcps_closed); KASSERT(inp->inp_socket != NULL, ("tcp_close: inp_socket NULL")); Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Dec 24 18:53:17 2015 (r292705) +++ head/sys/netinet/tcp_syncache.c Thu Dec 24 19:09:48 2015 (r292706) @@ -81,6 +81,9 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#ifdef TCP_RFC7413 +#include +#endif #include #include #include @@ -1083,6 +1086,39 @@ failed: return (0); } +#ifdef TCP_RFC7413 +static void +syncache_tfo_expand(struct syncache *sc, struct socket **lsop, struct mbuf *m, + uint64_t response_cookie) +{ + struct inpcb *inp; + struct tcpcb *tp; + unsigned int *pending_counter; + + /* + * Global TCP locks are held because we manipulate the PCB lists + * and create a new socket. + */ + INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + + pending_counter = intotcpcb(sotoinpcb(*lsop))->t_tfo_pending; + *lsop = syncache_socket(sc, *lsop, m); + if (*lsop == NULL) { + TCPSTAT_INC(tcps_sc_aborted); + atomic_subtract_int(pending_counter, 1); + } else { + inp = sotoinpcb(*lsop); + tp = intotcpcb(inp); + tp->t_flags |= TF_FASTOPEN; + tp->t_tfo_cookie = response_cookie; + tp->snd_max = tp->iss; + tp->snd_nxt = tp->iss; + tp->t_tfo_pending = pending_counter; + TCPSTAT_INC(tcps_sc_completed); + } +} +#endif /* TCP_RFC7413 */ + /* * Given a LISTEN socket and an inbound SYN request, add * this to the syn cache, and send back a segment: @@ -1095,8 +1131,15 @@ failed: * DoS attack, an attacker could send data which would eventually * consume all available buffer space if it were ACKed. By not ACKing * the data, we avoid this DoS scenario. + * + * The exception to the above is when a SYN with a valid TCP Fast Open (TFO) + * cookie is processed, V_tcp_fastopen_enabled set to true, and the + * TCP_FASTOPEN socket option is set. In this case, a new socket is created + * and returned via lsop, the mbuf is not freed so that tcp_input() can + * queue its data to the socket, and 1 is returned to indicate the + * TFO-socket-creation path was taken. */ -void +int syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, struct inpcb *inp, struct socket **lsop, struct mbuf *m, void *tod, void *todctx) @@ -1109,6 +1152,7 @@ syncache_add(struct in_conninfo *inc, st u_int ltflags; int win, sb_hiwat, ip_ttl, ip_tos; char *s; + int rv = 0; #ifdef INET6 int autoflowlabel = 0; #endif @@ -1117,6 +1161,11 @@ syncache_add(struct in_conninfo *inc, st #endif struct syncache scs; struct ucred *cred; +#ifdef TCP_RFC7413 + uint64_t tfo_response_cookie; + int tfo_cookie_valid = 0; + int tfo_response_cookie_valid = 0; +#endif INP_WLOCK_ASSERT(inp); /* listen socket */ KASSERT((th->th_flags & (TH_RST|TH_ACK|TH_SYN)) == TH_SYN, @@ -1141,6 +1190,29 @@ syncache_add(struct in_conninfo *inc, st sb_hiwat = so->so_rcv.sb_hiwat; ltflags = (tp->t_flags & (TF_NOOPT | TF_SIGNATURE)); +#ifdef TCP_RFC7413 + if (V_tcp_fastopen_enabled && (tp->t_flags & TF_FASTOPEN) && + (tp->t_tfo_pending != NULL) && (to->to_flags & TOF_FASTOPEN)) { + /* + * Limit the number of pending TFO connections to + * approximately half of the queue limit. This prevents TFO + * SYN floods from starving the service by filling the + * listen queue with bogus TFO connections. + */ + if (atomic_fetchadd_int(tp->t_tfo_pending, 1) <= *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 24 19:34:59 2015 Return-Path: Delivered-To: svn-src-all@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 E58D2A51F18 for ; Thu, 24 Dec 2015 19:34:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x22f.google.com (mail-qg0-x22f.google.com [IPv6:2607:f8b0:400d:c04::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 B69B11F9F for ; Thu, 24 Dec 2015 19:34:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qg0-x22f.google.com with SMTP id 6so24177510qgy.1 for ; Thu, 24 Dec 2015 11:34:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=XJD5PilVct1C0PqZElGhe7axMIgibe4NAkmKlF1qu2w=; b=o9MJ54JShaW/OAucWC9NCwV6XnLuVOii7IYEixCdqd79wr/BuRg0awrTuQlYZehiYw HNd1kDLmJXVE4QZA0pGtfRU6m+Ke2u8SYHCoXA+J06OmWKH3GsREBFl8hYh05d0vA5GO CdRWgeQxSM9+urCcbityu4F9L/VEzoc/Bulz7EesiQk9srtDToVNDQp5DsDXiRhmBS9m ih3lMc2vbbSaYS5ZkqOyuMuEhluAzyS/kwfQ1ytJEprxda1qzrdXXzhO+O4dJG1I+dkS 4ttnCJ9uC0ERbl8cD1ru1XblD33H4MfbfbXbpVJxvFNQfNcaCrGdVRVz35oUwAWSR8tT g0Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=XJD5PilVct1C0PqZElGhe7axMIgibe4NAkmKlF1qu2w=; b=EUIw2o3H1IuiKj8c7SDMZ85MbBi4d3Isj3y0E712MQwrbgjds2TUHlDwzpfuIRmYhU VjMrC1eJ1IELZsJHPHw/ZVBSB28hxzVvZVnT/TTYKq5dHrNUNLwwpIRybg5LOiFmDknG Dg3/cBun42lQ+NhlIeKcp8iiJBqMvIAO5BR23bZqtQ/V4t824r1oqVK2cWFMhpZj3kVW GIiCjNVd70wZDWc6A5goRnTXoLDDzbMuYmzMHI/6REdpdAENfsYa7SIyHXwkOQLgjgFz 7ms4wA+w3znvYGVHX9faPIPlhlggDrzPSfalrcj/3KiFF+Dvctk1WmmdXXVyPOKu8N4g zB5Q== X-Gm-Message-State: ALoCoQmn18k3KB8kzhEcj+nWfOGUHXe8MeF4ZHQFIzHzl9ntgKN7qDsH5CfiIvReSZJVWzvEmMU9OB3D1ZXts9QyjCnY5ckyRQ== MIME-Version: 1.0 X-Received: by 10.140.141.210 with SMTP id 201mr52851123qhn.74.1450985697729; Thu, 24 Dec 2015 11:34:57 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Thu, 24 Dec 2015 11:34:57 -0800 (PST) X-Originating-IP: [2607:fb90:125:17cf:0:47:d429:cf01] Received: by 10.140.27.181 with HTTP; Thu, 24 Dec 2015 11:34:57 -0800 (PST) In-Reply-To: <1450971642.25138.247.camel@freebsd.org> References: <201512071220.tB7CKRw0027858@repo.freebsd.org> <1450971642.25138.247.camel@freebsd.org> Date: Thu, 24 Dec 2015 12:34:57 -0700 X-Google-Sender-Auth: L1K99UyVFFUtEIoCs65H7x4iob8 Message-ID: Subject: Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern From: Warner Losh To: Ian Lepore Cc: src-committers , svn-src-head@freebsd.org, Konstantin Belousov , svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 19:34:59 -0000 I'm running Atmel hardware with this change built on amd64. I'm not sure what the issue here is. Warner On Dec 24, 2015 8:40 AM, "Ian Lepore" wrote: > On Mon, 2015-12-07 at 12:20 +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Mon Dec 7 12:20:26 2015 > > New Revision: 291937 > > URL: https://svnweb.freebsd.org/changeset/base/291937 > > > > Log: > > Add support for usermode (vdso-like) gettimeofday(2) and > > clock_gettime(2) on ARMv7 and ARMv8 systems which have architectural > > generic timer hardware. It is similar how the RDTSC timer is used in > > userspace on x86. > > > > Fix a permission problem where generic timer access from EL0 (or > > userspace on v7) was not properly initialized on APs. > > > > For ARMv7, mark the stack non-executable. The shared page is added for > > all arms (including ARMv8 64bit), and the signal trampoline code is > > moved to the page. > > > > Reviewed by:> > andrew > > Discussed with:> > emaste, mmel > > Sponsored by:> > The FreeBSD Foundation > > Differential revision:> https://reviews.freebsd.org/D4209 > > I've just discovered this change breaks buildworld on armv4/5 systems. > Those systems don't have the counter hardware that can be read from > userland (they don't have any common timer hardware at all, every > system is different). Also, they don't support the 'mrrc' instruction, > so the buildworld fails to compile libc. > > -- Ian > > From owner-svn-src-all@freebsd.org Thu Dec 24 19:43:16 2015 Return-Path: Delivered-To: svn-src-all@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 0EB69A50284; Thu, 24 Dec 2015 19:43:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 994B71733; Thu, 24 Dec 2015 19:43:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tBOJh9N6082055 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 24 Dec 2015 21:43:10 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tBOJh9N6082055 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tBOJh94W082054; Thu, 24 Dec 2015 21:43:09 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 Dec 2015 21:43:09 +0200 From: Konstantin Belousov To: Warner Losh Cc: Ian Lepore , src-committers , svn-src-head@freebsd.org, Konstantin Belousov , svn-src-all@freebsd.org Subject: Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern Message-ID: <20151224194309.GB3625@kib.kiev.ua> References: <201512071220.tB7CKRw0027858@repo.freebsd.org> <1450971642.25138.247.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 19:43:16 -0000 On Thu, Dec 24, 2015 at 12:34:57PM -0700, Warner Losh wrote: > I'm running Atmel hardware with this change built on amd64. > I'm not sure what the issue here is. I suspect that either clang for cross-build is misconfigured for armv6, or universe uses wrong clang (again, for armv6, instead of for arm). I.e. there are two issues to fix, one is wrong native (or cross) clang, and another is the use of the mrrc instruction on ARM v5 in libc (but the code should not be executed, it is only compiled). For later, see how I encoded isb in the same file. From owner-svn-src-all@freebsd.org Thu Dec 24 19:47:14 2015 Return-Path: Delivered-To: svn-src-all@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 AD274A503AB; Thu, 24 Dec 2015 19:47:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x22e.google.com (mail-pa0-x22e.google.com [IPv6:2607:f8b0:400e:c03::22e]) (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 83AB41939; Thu, 24 Dec 2015 19:47:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x22e.google.com with SMTP id cy9so69820979pac.0; Thu, 24 Dec 2015 11:47:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rjo0IatzdEeO4YOlYWOa2Kcm/D6hN2vQGwUwewUdiHU=; b=CmTDS79p/GvYRj0vJZy0HIpPCsYgn1eFS1yAMSHHLE9XTNH/ehn2KaWI2hVB8k9T52 aM0d+2bPjGZ0srtl5C/tHTlTfvUc4Cj7gt4yQZV7i6HRxwV7qMwjqKOM70antnKPo4kq tbf/rlnYDL9qr2EePzJ8/vPpzzrybX8uVSJcJDuRio6wtIXaZfV63WAmvJhq2V+NOj2u 4lIt/o+Bf59SqnTfpCB5ZSVZ5oz/8jyQX66WYNTny6DfQJ9mIZW41VyonONLmE89/5qn xDuMh1JL4eFunilOTmgVwxcMPx9AQ6DaXh7/d8llfQYWLjFXi2Zs68G1d5n0VEq66Ntt ZdBQ== X-Received: by 10.66.137.38 with SMTP id qf6mr13323141pab.158.1450986434079; Thu, 24 Dec 2015 11:47:14 -0800 (PST) Received: from [100.193.219.245] ([172.56.42.5]) by smtp.gmail.com with ESMTPSA id 19sm19666914pfj.16.2015.12.24.11.47.12 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Dec 2015 11:47:12 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern From: Garrett Cooper X-Mailer: iPhone Mail (13C75) In-Reply-To: <20151224180053.GY3625@kib.kiev.ua> Date: Thu, 24 Dec 2015 11:47:10 -0800 Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <7B6C35A2-53E1-4424-A99A-904CB3DC9C1F@gmail.com> References: <201512071220.tB7CKRw0027858@repo.freebsd.org> <1450971642.25138.247.camel@freebsd.org> <20151224180053.GY3625@kib.kiev.ua> To: Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 19:47:14 -0000 > On Dec 24, 2015, at 10:00, Konstantin Belousov wrote: > >> On Thu, Dec 24, 2015 at 08:40:42AM -0700, Ian Lepore wrote: >>> On Mon, 2015-12-07 at 12:20 +0000, Konstantin Belousov wrote: >>> Author: kib >>> Date: Mon Dec 7 12:20:26 2015 >>> New Revision: 291937 >>> URL: https://svnweb.freebsd.org/changeset/base/291937 >>> >>> Log: >>> Add support for usermode (vdso-like) gettimeofday(2) and >>> clock_gettime(2) on ARMv7 and ARMv8 systems which have architectural >>> generic timer hardware. It is similar how the RDTSC timer is used in >>> userspace on x86. >>> >>> Fix a permission problem where generic timer access from EL0 (or >>> userspace on v7) was not properly initialized on APs. >>> >>> For ARMv7, mark the stack non-executable. The shared page is added for >>> all arms (including ARMv8 64bit), and the signal trampoline code is >>> moved to the page. >>> >>> Reviewed by:> > andrew >>> Discussed with:> > emaste, mmel >>> Sponsored by:> > The FreeBSD Foundation >>> Differential revision:> https://reviews.freebsd.org/D4209 >> >> I've just discovered this change breaks buildworld on armv4/5 systems. >> Those systems don't have the counter hardware that can be read from >> userland (they don't have any common timer hardware at all, every >> system is different). Also, they don't support the 'mrrc' instruction, >> so the buildworld fails to compile libc. > > I tested the change with make universe. Is the armv5 world included > into the make ? If yes, there is something even more broken. > > That said, the code in __vdso_gettime.c is unused om armv4/v5 since kernel > never directs libc to use a fast timecounter. The routines could be left > undefined since they are declared weak, or the bodies could be stubbed out. > Anyway, to test, I should be able to compile libc for the target. > > And, BTW, what is exactly your error message ? It was an assembler error on stable/9 at least... From owner-svn-src-all@freebsd.org Thu Dec 24 20:15:15 2015 Return-Path: Delivered-To: svn-src-all@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 E5DDEA50D8B; Thu, 24 Dec 2015 20:15:15 +0000 (UTC) (envelope-from brueffer@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 97DA01516; Thu, 24 Dec 2015 20:15:15 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBOKFEiu091509; Thu, 24 Dec 2015 20:15:14 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOKFEUj091507; Thu, 24 Dec 2015 20:15:14 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512242015.tBOKFEUj091507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Thu, 24 Dec 2015 20:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292707 - in stable/10: contrib/smbfs tools/debugscripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 20:15:16 -0000 Author: brueffer Date: Thu Dec 24 20:15:14 2015 New Revision: 292707 URL: https://svnweb.freebsd.org/changeset/base/292707 Log: MFH: r292263 Assorted grammar, spelling and punctuation fixes. PR: 203336, 203339 Submitted by: espeyb@rpi.edu, themesta@gmail.com Modified: stable/10/contrib/smbfs/README stable/10/tools/debugscripts/README Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/smbfs/README ============================================================================== --- stable/10/contrib/smbfs/README Thu Dec 24 19:09:48 2015 (r292706) +++ stable/10/contrib/smbfs/README Thu Dec 24 20:15:14 2015 (r292707) @@ -15,7 +15,7 @@ It is a complete, kernel side implementa Darwin maintained in the Darwin's tree. - I'm would be very grateful for any feedback, bug reports etc. + I would be very grateful for any feedback, bug reports etc. Supported SMB servers: Samba @@ -23,14 +23,14 @@ It is a complete, kernel side implementa IBM LanManager NetApp - An updated versions of this package can be retrieved from ftp server: + An updated version of this package can be retrieved from ftp server: ftp://ftp.butya.kz/pub/smbfs/smbfs.tar.gz - Perfomance + Performance ========== - There is some perfomance benchmarks over 10Mbit network: + These are some performance benchmarks over a 10Mbit network: Win95 machine as server: IOZONE: auto-test mode Modified: stable/10/tools/debugscripts/README ============================================================================== --- stable/10/tools/debugscripts/README Thu Dec 24 19:09:48 2015 (r292706) +++ stable/10/tools/debugscripts/README Thu Dec 24 20:15:14 2015 (r292707) @@ -14,8 +14,8 @@ perform kernel debugging, you would do: (kgdb) -This directory also contains a kgdb script that given a crash dump number -automatically extract the path to the kernel source, run gdb to extract -information about kernel modules loaded, and then rerun gdb loading the +This directory also contains a kgdb script that, given a crash dump number, +automatically extracts the path to the kernel source, runs gdb to extract +information about kernel modules loaded, and then reruns gdb loading the necessary symbols for the modules. You need to make sure you build the modules w/ debugging symbols separately to get things to work. From owner-svn-src-all@freebsd.org Thu Dec 24 20:18:57 2015 Return-Path: Delivered-To: svn-src-all@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 2237AA50E59 for ; Thu, 24 Dec 2015 20:18:57 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB3BE17A9 for ; Thu, 24 Dec 2015 20:18:56 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 24 Dec 2015 20:19:14 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tBOKIrwm006314; Thu, 24 Dec 2015 13:18:53 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1450988333.25138.261.camel@freebsd.org> Subject: Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern From: Ian Lepore To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 24 Dec 2015 13:18:53 -0700 In-Reply-To: <20151224180053.GY3625@kib.kiev.ua> References: <201512071220.tB7CKRw0027858@repo.freebsd.org> <1450971642.25138.247.camel@freebsd.org> <20151224180053.GY3625@kib.kiev.ua> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 20:18:57 -0000 On Thu, 2015-12-24 at 20:00 +0200, Konstantin Belousov wrote: > On Thu, Dec 24, 2015 at 08:40:42AM -0700, Ian Lepore wrote: > > On Mon, 2015-12-07 at 12:20 +0000, Konstantin Belousov wrote: > > > Author: kib > > > Date: Mon Dec 7 12:20:26 2015 > > > New Revision: 291937 > > > URL: https://svnweb.freebsd.org/changeset/base/291937 > > > > > > Log: > > > Add support for usermode (vdso-like) gettimeofday(2) and > > > clock_gettime(2) on ARMv7 and ARMv8 systems which have > > > architectural > > > generic timer hardware. It is similar how the RDTSC timer is > > > used in > > > userspace on x86. > > > > > > Fix a permission problem where generic timer access from EL0 > > > (or > > > userspace on v7) was not properly initialized on APs. > > > > > > For ARMv7, mark the stack non-executable. The shared page is > > > added for > > > all arms (including ARMv8 64bit), and the signal trampoline > > > code is > > > moved to the page. > > > > > > Reviewed by:> > andrew > > > Discussed with:> > emaste, mmel > > > Sponsored by:> > The FreeBSD Foundation > > > Differential revision:> > > > https://reviews.freebsd.org/D4209 > > > > I've just discovered this change breaks buildworld on armv4/5 > > systems. > > Those systems don't have the counter hardware that can be read > > from > > userland (they don't have any common timer hardware at all, every > > system is different). Also, they don't support the 'mrrc' > > instruction, > > so the buildworld fails to compile libc. > > I tested the change with make universe. Is the armv5 world included > into the make ? If yes, there is something even more broken. > > That said, the code in __vdso_gettime.c is unused om armv4/v5 since > kernel > never directs libc to use a fast timecounter. The routines could be > left > undefined since they are declared weak, or the bodies could be > stubbed out. > Anyway, to test, I should be able to compile libc for the target. > > And, BTW, what is exactly your error message ? > Oh, I know what's likely at the heart of this... I'm using gcc 4.2.1 for arm v4/v5, because clang 3.7 is broken (works to crossbuild, but fails to run native). The mrrc instruction was introduced at arm arch 5E, I'll bet clang is defaulting to 5E and gcc defaults to 4. This is what's in my make.conf for the build that failed: WITH_GCC=yes WITH_GNUCXX=yes WITH_GCC_BOOTSTRAP=yes WITHOUT_CLANG=yes WITHOUT_CLANG_IS_CC=yes WITHOUT_CLANG_BOOTSTRAP=yes Yep, just confirmed it, switched back to clang 3.7 for crossbuild and no errors. -- Ian From owner-svn-src-all@freebsd.org Thu Dec 24 20:19:51 2015 Return-Path: Delivered-To: svn-src-all@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 65A07A50EEE; Thu, 24 Dec 2015 20:19:51 +0000 (UTC) (envelope-from brueffer@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 1A7841973; Thu, 24 Dec 2015 20:19:51 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBOKJo1d091732; Thu, 24 Dec 2015 20:19:50 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOKJoeQ091730; Thu, 24 Dec 2015 20:19:50 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512242019.tBOKJoeQ091730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Thu, 24 Dec 2015 20:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292708 - in stable/9: contrib/smbfs tools/debugscripts X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 20:19:51 -0000 Author: brueffer Date: Thu Dec 24 20:19:49 2015 New Revision: 292708 URL: https://svnweb.freebsd.org/changeset/base/292708 Log: MFH: r292263 Assorted grammar, spelling and punctuation fixes. PR: 203336, 203339 Submitted by: espeyb@rpi.edu, themesta@gmail.com Modified: stable/9/contrib/smbfs/README stable/9/tools/debugscripts/README Directory Properties: stable/9/contrib/smbfs/ (props changed) stable/9/tools/ (props changed) Modified: stable/9/contrib/smbfs/README ============================================================================== --- stable/9/contrib/smbfs/README Thu Dec 24 20:15:14 2015 (r292707) +++ stable/9/contrib/smbfs/README Thu Dec 24 20:19:49 2015 (r292708) @@ -15,7 +15,7 @@ It is a complete, kernel side implementa Darwin maintained in the Darwin's tree. - I'm would be very grateful for any feedback, bug reports etc. + I would be very grateful for any feedback, bug reports etc. Supported SMB servers: Samba @@ -23,14 +23,14 @@ It is a complete, kernel side implementa IBM LanManager NetApp - An updated versions of this package can be retrieved from ftp server: + An updated version of this package can be retrieved from ftp server: ftp://ftp.butya.kz/pub/smbfs/smbfs.tar.gz - Perfomance + Performance ========== - There is some perfomance benchmarks over 10Mbit network: + These are some performance benchmarks over a 10Mbit network: Win95 machine as server: IOZONE: auto-test mode Modified: stable/9/tools/debugscripts/README ============================================================================== --- stable/9/tools/debugscripts/README Thu Dec 24 20:15:14 2015 (r292707) +++ stable/9/tools/debugscripts/README Thu Dec 24 20:19:49 2015 (r292708) @@ -14,8 +14,8 @@ perform kernel debugging, you would do: (kgdb) -This directory also contains a kgdb script that given a crash dump number -automatically extract the path to the kernel source, run gdb to extract -information about kernel modules loaded, and then rerun gdb loading the +This directory also contains a kgdb script that, given a crash dump number, +automatically extracts the path to the kernel source, runs gdb to extract +information about kernel modules loaded, and then reruns gdb loading the necessary symbols for the modules. You need to make sure you build the modules w/ debugging symbols separately to get things to work. From owner-svn-src-all@freebsd.org Thu Dec 24 20:57:41 2015 Return-Path: Delivered-To: svn-src-all@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 06564A51CAB; Thu, 24 Dec 2015 20:57:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B4281823; Thu, 24 Dec 2015 20:57:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tBOKvZkx090747 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 24 Dec 2015 22:57:35 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tBOKvZkx090747 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tBOKvU3I090746; Thu, 24 Dec 2015 22:57:30 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 Dec 2015 22:57:30 +0200 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292620 - head/sys/kern Message-ID: <20151224205730.GC3625@kib.kiev.ua> References: <201512222012.tBMKCqqg039018@repo.freebsd.org> <20151223073258.M993@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151223073258.M993@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 20:57:41 -0000 On Wed, Dec 23, 2015 at 08:02:10AM +1100, Bruce Evans wrote: > On Tue, 22 Dec 2015, Konstantin Belousov wrote: > > > Log: > > If we annoy user with the terminal output due to failed load of > > interpreter, also show the actual error code instead of some > > interpretation. > > This and nearby messages are of annoyingly low quality. They don't > even print the program name(s). > > I use the following partial fixes. I forget if they print the program > name or the interpeter name. > > X Index: imgact_elf.c > X =================================================================== > X RCS file: /home/ncvs/src/sys/kern/imgact_elf.c,v > X retrieving revision 1.151 > X diff -u -2 -r1.151 imgact_elf.c > X --- imgact_elf.c 5 Jun 2004 02:18:28 -0000 1.151 > X +++ imgact_elf.c 5 Jun 2004 06:51:25 -0000 > X @@ -694,6 +693,6 @@ > X brand_info = __elfN(get_brandinfo)(hdr, interp); > X if (brand_info == NULL) { > X - uprintf("ELF binary type \"%u\" not known.\n", > X - hdr->e_ident[EI_OSABI]); > X + uprintf("%s: ELF binary type \"%u\" not known.\n", > X + imgp->stringbase, hdr->e_ident[EI_OSABI]); This cannot be a fix. there is no stringbase member in struct imgact. In fact, there is no available path to the executable in the image activation routine, and due to things like fexecve(2), it may have been not passed to the kernel at all. The present structure of the messages is forced by this fact, and it is usually obvious what is the image kernel complained about, since it is the image that was just executed. From owner-svn-src-all@freebsd.org Thu Dec 24 21:10:24 2015 Return-Path: Delivered-To: svn-src-all@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 F2C42A50115; Thu, 24 Dec 2015 21:10:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AB4B1D59; Thu, 24 Dec 2015 21:10:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tBOLAJ2D093343 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 24 Dec 2015 23:10:19 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tBOLAJ2D093343 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tBOLAJw7093342; Thu, 24 Dec 2015 23:10:19 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 Dec 2015 23:10:19 +0200 From: Konstantin Belousov To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern Message-ID: <20151224211019.GD3625@kib.kiev.ua> References: <201512071220.tB7CKRw0027858@repo.freebsd.org> <1450971642.25138.247.camel@freebsd.org> <20151224180053.GY3625@kib.kiev.ua> <1450988333.25138.261.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1450988333.25138.261.camel@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 21:10:25 -0000 On Thu, Dec 24, 2015 at 01:18:53PM -0700, Ian Lepore wrote: > Oh, I know what's likely at the heart of this... I'm using gcc 4.2.1 > for arm v4/v5, because clang 3.7 is broken (works to crossbuild, but > fails to run native). The mrrc instruction was introduced at arm arch > 5E, I'll bet clang is defaulting to 5E and gcc defaults to 4. > > This is what's in my make.conf for the build that failed: > > WITH_GCC=yes > WITH_GNUCXX=yes > WITH_GCC_BOOTSTRAP=yes > WITHOUT_CLANG=yes > WITHOUT_CLANG_IS_CC=yes > WITHOUT_CLANG_BOOTSTRAP=yes > > Yep, just confirmed it, switched back to clang 3.7 for crossbuild and > no errors. I think that the following is the least intrusive change. I built it with your make.conf successfully (and make.conf seems to take effect judging by the build time). If you are fine with the change, I will commit right after confirming that ARMv6 build still results in correct code (building right now). diff --git a/lib/libc/arm/sys/__vdso_gettc.c b/lib/libc/arm/sys/__vdso_gettc.c index d75d866..1f43e72 100644 --- a/lib/libc/arm/sys/__vdso_gettc.c +++ b/lib/libc/arm/sys/__vdso_gettc.c @@ -34,8 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libc_private.h" +#if __ARM_ARCH >= 6 static inline uint64_t cp15_cntvct_get(void) { @@ -53,6 +55,7 @@ cp15_cntpct_get(void) __asm __volatile("mrrc\tp15, 0, %Q0, %R0, c14" : "=r" (reg)); return (reg); } +#endif #pragma weak __vdso_gettc u_int @@ -60,6 +63,7 @@ __vdso_gettc(const struct vdso_timehands *th) { uint64_t val; +#if __ARM_ARCH >= 6 /* * Userspace gettimeofday() is only enabled on ARMv7 CPUs, but * libc is compiled for ARMv6. Due to clang issues, .arch @@ -67,6 +71,9 @@ __vdso_gettc(const struct vdso_timehands *th) */ __asm __volatile(".word\t0xf57ff06f" : : : "memory"); /* isb */ val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); +#else + val = 0; +#endif return (val); } From owner-svn-src-all@freebsd.org Thu Dec 24 21:15:34 2015 Return-Path: Delivered-To: svn-src-all@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 395F2A504BD for ; Thu, 24 Dec 2015 21:15:34 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A48412FC for ; Thu, 24 Dec 2015 21:15:33 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 24 Dec 2015 21:15:51 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tBOLFUol006384; Thu, 24 Dec 2015 14:15:30 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1450991730.25138.263.camel@freebsd.org> Subject: Re: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern From: Ian Lepore To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 24 Dec 2015 14:15:30 -0700 In-Reply-To: <20151224211019.GD3625@kib.kiev.ua> References: <201512071220.tB7CKRw0027858@repo.freebsd.org> <1450971642.25138.247.camel@freebsd.org> <20151224180053.GY3625@kib.kiev.ua> <1450988333.25138.261.camel@freebsd.org> <20151224211019.GD3625@kib.kiev.ua> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 21:15:34 -0000 On Thu, 2015-12-24 at 23:10 +0200, Konstantin Belousov wrote: > On Thu, Dec 24, 2015 at 01:18:53PM -0700, Ian Lepore wrote: > > Oh, I know what's likely at the heart of this... I'm using gcc > > 4.2.1 > > for arm v4/v5, because clang 3.7 is broken (works to crossbuild, > > but > > fails to run native). The mrrc instruction was introduced at arm > > arch > > 5E, I'll bet clang is defaulting to 5E and gcc defaults to 4. > > > > This is what's in my make.conf for the build that failed: > > > > WITH_GCC=yes > > WITH_GNUCXX=yes > > WITH_GCC_BOOTSTRAP=yes > > WITHOUT_CLANG=yes > > WITHOUT_CLANG_IS_CC=yes > > WITHOUT_CLANG_BOOTSTRAP=yes > > > > Yep, just confirmed it, switched back to clang 3.7 for crossbuild > > and > > no errors. > > I think that the following is the least intrusive change. I built it > with your make.conf successfully (and make.conf seems to take effect > judging > by the build time). > > If you are fine with the change, I will commit right after confirming > that > ARMv6 build still results in correct code (building right now). yeah, gcc sure builds fast compared to clang. :) The change looks good to me. -- Ian From owner-svn-src-all@freebsd.org Thu Dec 24 21:19:00 2015 Return-Path: Delivered-To: svn-src-all@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 3E429A50682; Thu, 24 Dec 2015 21:19:00 +0000 (UTC) (envelope-from gnn@freebsd.org) Received: from smtp.hungerhost.com (smtp.hungerhost.com [216.38.51.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C5CA15E8; Thu, 24 Dec 2015 21:18:59 +0000 (UTC) (envelope-from gnn@freebsd.org) Received: from pool-108-54-164-204.nycmny.fios.verizon.net ([108.54.164.204]:50944 helo=[192.168.1.12]) by vps.hungerhost.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.86) (envelope-from ) id 1aCDHh-0000gu-NJ; Thu, 24 Dec 2015 16:18:53 -0500 From: "George Neville-Neil" To: "Cy Schubert" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290383 - in head/sys: net netinet Date: Thu, 24 Dec 2015 16:18:52 -0500 Message-ID: <98F16C2B-3904-438D-912B-85C17ACFBDEA@freebsd.org> In-Reply-To: <201512201802.tBKI2jpx051586@slippy.cwsent.com> References: <201512201802.tBKI2jpx051586@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Mailer: MailMate (1.9.3r5187) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - freebsd.org X-Get-Message-Sender-Via: vps.hungerhost.com: authenticated_id: gnn@neville-neil.com X-Authenticated-Sender: vps.hungerhost.com: gnn@neville-neil.com X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 21:19:00 -0000 On 20 Dec 2015, at 13:02, Cy Schubert wrote: > Cy Schubert writes: >> In message <201511050726.tA57QXlu074213@repo.freebsd.org>, "George V. >> Neville-N >> eil" writes: >>> Author: gnn >>> Date: Thu Nov 5 07:26:32 2015 >>> New Revision: 290383 >>> URL: https://svnweb.freebsd.org/changeset/base/290383 >>> >>> Log: >>> Replace the fastforward path with tryforward which does not require >>> a >>> sysctl and will always be on. The former split between default and >>> fast forwarding is removed by this commit while preserving the >>> ability >>> to use all network stack features. >>> >>> Differential Revision: https://reviews.freebsd.org/D4042 >>> Reviewed by: ae, melifaro, olivier, rwatson >>> MFC after: 1 month >>> Sponsored by: Rubicon Communications (Netgate) >>> >>> Modified: >>> head/sys/net/if_arcsubr.c >>> head/sys/net/if_ethersubr.c >>> head/sys/net/if_fddisubr.c >>> head/sys/net/if_fwsubr.c >>> head/sys/net/if_iso88025subr.c >>> head/sys/netinet/in_var.h >>> head/sys/netinet/ip_fastfwd.c >>> head/sys/netinet/ip_input.c >>> >>> Modified: head/sys/net/if_arcsubr.c >>> =========================================================================== >> == >>> = >>> --- head/sys/net/if_arcsubr.c Thu Nov 5 04:16:03 2015 (r29038 >> 2) >>> +++ head/sys/net/if_arcsubr.c Thu Nov 5 07:26:32 2015 (r29038 >> 3) >>> @@ -550,15 +550,11 @@ arc_input(struct ifnet *ifp, struct mbuf >>> #ifdef INET >>> case ARCTYPE_IP: >>> m_adj(m, ARC_HDRNEWLEN); >>> - if ((m = ip_fastforward(m)) == NULL) >>> - return; >>> isr = NETISR_IP; >>> break; >>> >>> case ARCTYPE_IP_OLD: >>> m_adj(m, ARC_HDRLEN); >>> - if ((m = ip_fastforward(m)) == NULL) >>> - return; >>> isr = NETISR_IP; >>> break; >>> >>> >>> Modified: head/sys/net/if_ethersubr.c >>> =========================================================================== >> == >>> = >>> --- head/sys/net/if_ethersubr.c Thu Nov 5 04:16:03 2015 (r29038 >>> 2) >>> +++ head/sys/net/if_ethersubr.c Thu Nov 5 07:26:32 2015 (r29038 >>> 3) >>> @@ -722,8 +722,6 @@ ether_demux(struct ifnet *ifp, struct mb >>> switch (ether_type) { >>> #ifdef INET >>> case ETHERTYPE_IP: >>> - if ((m = ip_fastforward(m)) == NULL) >>> - return; >>> isr = NETISR_IP; >>> break; >>> >>> >>> Modified: head/sys/net/if_fddisubr.c >>> =========================================================================== >> == >>> = >>> --- head/sys/net/if_fddisubr.c Thu Nov 5 04:16:03 2015 (r29038 >>> 2) >>> +++ head/sys/net/if_fddisubr.c Thu Nov 5 07:26:32 2015 (r29038 >>> 3) >>> @@ -429,8 +429,6 @@ fddi_input(ifp, m) >>> switch (type) { >>> #ifdef INET >>> case ETHERTYPE_IP: >>> - if ((m = ip_fastforward(m)) == NULL) >>> - return; >>> isr = NETISR_IP; >>> break; >>> >>> >>> Modified: head/sys/net/if_fwsubr.c >>> =========================================================================== >> == >>> = >>> --- head/sys/net/if_fwsubr.c Thu Nov 5 04:16:03 2015 (r29038 >> 2) >>> +++ head/sys/net/if_fwsubr.c Thu Nov 5 07:26:32 2015 (r29038 >> 3) >>> @@ -605,8 +605,6 @@ firewire_input(struct ifnet *ifp, struct >>> switch (type) { >>> #ifdef INET >>> case ETHERTYPE_IP: >>> - if ((m = ip_fastforward(m)) == NULL) >>> - return; >>> isr = NETISR_IP; >>> break; >>> >>> >>> Modified: head/sys/net/if_iso88025subr.c >>> =========================================================================== >> == >>> = >>> --- head/sys/net/if_iso88025subr.c Thu Nov 5 04:16:03 2015 (r29038 >>> 2) >>> +++ head/sys/net/if_iso88025subr.c Thu Nov 5 07:26:32 2015 (r29038 >>> 3) >>> @@ -519,8 +519,6 @@ iso88025_input(ifp, m) >>> #ifdef INET >>> case ETHERTYPE_IP: >>> th->iso88025_shost[0] &= ~(TR_RII); >>> - if ((m = ip_fastforward(m)) == NULL) >>> - return; >>> isr = NETISR_IP; >>> break; >>> >>> >>> Modified: head/sys/netinet/in_var.h >>> =========================================================================== >> == >>> = >>> --- head/sys/netinet/in_var.h Thu Nov 5 04:16:03 2015 (r29038 >> 2) >>> +++ head/sys/netinet/in_var.h Thu Nov 5 07:26:32 2015 (r29038 >> 3) >>> @@ -380,7 +380,7 @@ int in_scrubprefix(struct in_ifaddr *, u >>> void ip_input(struct mbuf *); >>> void ip_direct_input(struct mbuf *); >>> void in_ifadown(struct ifaddr *ifa, int); >>> -struct mbuf *ip_fastforward(struct mbuf *); >>> +struct mbuf *ip_tryforward(struct mbuf *); >>> void *in_domifattach(struct ifnet *); >>> void in_domifdetach(struct ifnet *, void *); >>> >>> >>> Modified: head/sys/netinet/ip_fastfwd.c >>> =========================================================================== >> == >>> = >>> --- head/sys/netinet/ip_fastfwd.c Thu Nov 5 04:16:03 2015 (r29038 >>> 2) >>> +++ head/sys/netinet/ip_fastfwd.c Thu Nov 5 07:26:32 2015 (r29038 >>> 3) >>> @@ -108,12 +108,6 @@ __FBSDID("$FreeBSD$"); >>> >>> #include >>> >>> -static VNET_DEFINE(int, ipfastforward_active); >>> -#define V_ipfastforward_active VNET(ipfastforward_active) >>> - >>> -SYSCTL_INT(_net_inet_ip, OID_AUTO, fastforwarding, CTLFLAG_VNET | >>> CTLFLAG_ >> RW >>> , >>> - &VNET_NAME(ipfastforward_active), 0, "Enable fast IP >>> forwarding"); >>> - >>> static struct sockaddr_in * >>> ip_findroute(struct route *ro, struct in_addr dest, struct mbuf *m) >>> { >>> @@ -158,7 +152,7 @@ ip_findroute(struct route *ro, struct in >>> * to ip_input for full processing. >>> */ >>> struct mbuf * >>> -ip_fastforward(struct mbuf *m) >>> +ip_tryforward(struct mbuf *m) >>> { >>> struct ip *ip; >>> struct mbuf *m0 = NULL; >>> @@ -166,119 +160,20 @@ ip_fastforward(struct mbuf *m) >>> struct sockaddr_in *dst = NULL; >>> struct ifnet *ifp; >>> struct in_addr odest, dest; >>> - uint16_t sum, ip_len, ip_off; >>> + uint16_t ip_len, ip_off; >>> int error = 0; >>> - int hlen, mtu; >>> + int mtu; >>> struct m_tag *fwd_tag = NULL; >>> >>> /* >>> * Are we active and forwarding packets? >>> */ >>> - if (!V_ipfastforward_active || !V_ipforwarding) >>> - return m; >>> >>> M_ASSERTVALID(m); >>> M_ASSERTPKTHDR(m); >>> >>> bzero(&ro, sizeof(ro)); >>> >>> - /* >>> - * Step 1: check for packet drop conditions (and sanity checks) >>> - */ >>> - >>> - /* >>> - * Is entire packet big enough? >>> - */ >>> - if (m->m_pkthdr.len < sizeof(struct ip)) { >>> - IPSTAT_INC(ips_tooshort); >>> - goto drop; >>> - } >>> - >>> - /* >>> - * Is first mbuf large enough for ip header and is header present? >>> - */ >>> - if (m->m_len < sizeof (struct ip) && >>> - (m = m_pullup(m, sizeof (struct ip))) == NULL) { >>> - IPSTAT_INC(ips_toosmall); >>> - return NULL; /* mbuf already free'd */ >>> - } >>> - >>> - ip = mtod(m, struct ip *); >>> - >>> - /* >>> - * Is it IPv4? >>> - */ >>> - if (ip->ip_v != IPVERSION) { >>> - IPSTAT_INC(ips_badvers); >>> - goto drop; >>> - } >>> - >>> - /* >>> - * Is IP header length correct and is it in first mbuf? >>> - */ >>> - hlen = ip->ip_hl << 2; >>> - if (hlen < sizeof(struct ip)) { /* minimum header length */ >>> - IPSTAT_INC(ips_badhlen); >>> - goto drop; >>> - } >>> - if (hlen > m->m_len) { >>> - if ((m = m_pullup(m, hlen)) == NULL) { >>> - IPSTAT_INC(ips_badhlen); >>> - return NULL; /* mbuf already free'd */ >>> - } >>> - ip = mtod(m, struct ip *); >>> - } >>> - >>> - /* >>> - * Checksum correct? >>> - */ >>> - if (m->m_pkthdr.csum_flags & CSUM_IP_CHECKED) >>> - sum = !(m->m_pkthdr.csum_flags & CSUM_IP_VALID); >>> - else { >>> - if (hlen == sizeof(struct ip)) >>> - sum = in_cksum_hdr(ip); >>> - else >>> - sum = in_cksum(m, hlen); >>> - } >>> - if (sum) { >>> - IPSTAT_INC(ips_badsum); >>> - goto drop; >>> - } >>> - >>> - /* >>> - * Remember that we have checked the IP header and found it valid. >>> - */ >>> - m->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); >>> - >>> - ip_len = ntohs(ip->ip_len); >>> - >>> - /* >>> - * Is IP length longer than packet we have got? >>> - */ >>> - if (m->m_pkthdr.len < ip_len) { >>> - IPSTAT_INC(ips_tooshort); >>> - goto drop; >>> - } >>> - >>> - /* >>> - * Is packet longer than IP header tells us? If yes, truncate >>> packet. >>> - */ >>> - if (m->m_pkthdr.len > ip_len) { >>> - if (m->m_len == m->m_pkthdr.len) { >>> - m->m_len = ip_len; >>> - m->m_pkthdr.len = ip_len; >>> - } else >>> - m_adj(m, ip_len - m->m_pkthdr.len); >>> - } >>> - >>> - /* >>> - * Is packet from or to 127/8? >>> - */ >>> - if ((ntohl(ip->ip_dst.s_addr) >> IN_CLASSA_NSHIFT) == >>> IN_LOOPBACKNET || >>> - (ntohl(ip->ip_src.s_addr) >> IN_CLASSA_NSHIFT) == >>> IN_LOOPBACKNET) { >>> - IPSTAT_INC(ips_badaddr); >>> - goto drop; >>> - } >>> >>> #ifdef ALTQ >>> /* >>> @@ -289,12 +184,10 @@ ip_fastforward(struct mbuf *m) >>> #endif >>> >>> /* >>> - * Step 2: fallback conditions to normal ip_input path processing >>> - */ >>> - >>> - /* >>> * Only IP packets without options >>> */ >>> + ip = mtod(m, struct ip *); >>> + >>> if (ip->ip_hl != (sizeof(struct ip) >> 2)) { >>> if (V_ip_doopts == 1) >>> return m; >>> >>> Modified: head/sys/netinet/ip_input.c >>> =========================================================================== >> == >>> = >>> --- head/sys/netinet/ip_input.c Thu Nov 5 04:16:03 2015 (r29038 >>> 2) >>> +++ head/sys/netinet/ip_input.c Thu Nov 5 07:26:32 2015 (r29038 >>> 3) >>> @@ -79,6 +79,8 @@ __FBSDID("$FreeBSD$"); >>> #include >>> #ifdef IPSEC >>> #include >>> +#include >>> +#include >>> #endif /* IPSEC */ >>> #include >>> >>> @@ -500,12 +502,22 @@ tooshort: >>> m_adj(m, ip_len - m->m_pkthdr.len); >>> } >>> >>> + /* Try to forward the packet, but if we fail continue */ >>> #ifdef IPSEC >>> + /* For now we do not handle IPSEC in tryforward. */ >>> + if (!key_havesp(IPSEC_DIR_INBOUND) && >>> !key_havesp(IPSEC_DIR_OUTBOUND) & >>> & >>> + (V_ipforwarding == 1)) >>> + if (ip_tryforward(m) == NULL) >>> + return; >>> /* >>> * Bypass packet filtering for packets previously handled by IPsec. >>> */ >>> if (ip_ipsec_filtertunnel(m)) >>> goto passin; >>> +#else >>> + if (V_ipforwarding == 1) >>> + if (ip_tryforward(m) == NULL) >>> + return; >>> #endif /* IPSEC */ >>> >>> /* >>> >>> >> >> Hi George, >> >> Sorry for the lateness of this reply, I finally got some time off for >> Christmas and have time to myself to boot. >> >> This breaks ipfilter's ipnat. I want to let you know before anyone >> MFCs >> this. > > A fix to ipfilter has been committed to head and will be MFCed in a > week. > Let me know when that's done. Thanks! Best, George From owner-svn-src-all@freebsd.org Thu Dec 24 22:05:35 2015 Return-Path: Delivered-To: svn-src-all@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 E341CA51599; Thu, 24 Dec 2015 22:05:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id A4FB91813; Thu, 24 Dec 2015 22:05:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id A419C1A5F78; Fri, 25 Dec 2015 08:45:53 +1100 (AEDT) Date: Fri, 25 Dec 2015 08:45:50 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292620 - head/sys/kern In-Reply-To: <20151224205730.GC3625@kib.kiev.ua> Message-ID: <20151225083416.K1523@besplex.bde.org> References: <201512222012.tBMKCqqg039018@repo.freebsd.org> <20151223073258.M993@besplex.bde.org> <20151224205730.GC3625@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=zuGDGuoEEVfoYA-YHOMA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 22:05:36 -0000 On Thu, 24 Dec 2015, Konstantin Belousov wrote: > On Wed, Dec 23, 2015 at 08:02:10AM +1100, Bruce Evans wrote: >> On Tue, 22 Dec 2015, Konstantin Belousov wrote: >> >>> Log: >>> If we annoy user with the terminal output due to failed load of >>> interpreter, also show the actual error code instead of some >>> interpretation. >> >> This and nearby messages are of annoyingly low quality. They don't >> even print the program name(s). >> >> I use the following partial fixes. I forget if they print the program >> name or the interpeter name. >> >> X Index: imgact_elf.c >> X =================================================================== >> X RCS file: /home/ncvs/src/sys/kern/imgact_elf.c,v >> X retrieving revision 1.151 >> X diff -u -2 -r1.151 imgact_elf.c >> X --- imgact_elf.c 5 Jun 2004 02:18:28 -0000 1.151 >> X +++ imgact_elf.c 5 Jun 2004 06:51:25 -0000 >> X @@ -694,6 +693,6 @@ >> X brand_info = __elfN(get_brandinfo)(hdr, interp); >> X if (brand_info == NULL) { >> X - uprintf("ELF binary type \"%u\" not known.\n", >> X - hdr->e_ident[EI_OSABI]); >> X + uprintf("%s: ELF binary type \"%u\" not known.\n", >> X + imgp->stringbase, hdr->e_ident[EI_OSABI]); > This cannot be a fix. there is no stringbase member in struct imgact. There was in FreeBSD-5. > In fact, there is no available path to the executable in the image activation > routine, and due to things like fexecve(2), it may have been not passed > to the kernel at all. argv[0] and the string being interpreted must be known at some point. > The present structure of the messages is forced by this fact, and it is > usually obvious what is the image kernel complained about, since it is > the image that was just executed. Not if it is one of many commands in a script. Bruce From owner-svn-src-all@freebsd.org Thu Dec 24 22:13:53 2015 Return-Path: Delivered-To: svn-src-all@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 60A0CA517DE; Thu, 24 Dec 2015 22:13: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 31D861BDE; Thu, 24 Dec 2015 22:13: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 tBOMDq8G026086; Thu, 24 Dec 2015 22:13:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOMDqRW026085; Thu, 24 Dec 2015 22:13:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512242213.tBOMDqRW026085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 24 Dec 2015 22:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292709 - head/lib/libc/arm/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 22:13:53 -0000 Author: kib Date: Thu Dec 24 22:13:52 2015 New Revision: 292709 URL: https://svnweb.freebsd.org/changeset/base/292709 Log: Do not compile ARMv6 instructions on ARMv4/v5. Although clang is fine with mrrc, gcc is not. The disabled code is not executed on ARMv4 anyway. Reported and reviewed by: ian Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/arm/sys/__vdso_gettc.c Modified: head/lib/libc/arm/sys/__vdso_gettc.c ============================================================================== --- head/lib/libc/arm/sys/__vdso_gettc.c Thu Dec 24 20:19:49 2015 (r292708) +++ head/lib/libc/arm/sys/__vdso_gettc.c Thu Dec 24 22:13:52 2015 (r292709) @@ -34,8 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libc_private.h" +#if __ARM_ARCH >= 6 static inline uint64_t cp15_cntvct_get(void) { @@ -53,6 +55,7 @@ cp15_cntpct_get(void) __asm __volatile("mrrc\tp15, 0, %Q0, %R0, c14" : "=r" (reg)); return (reg); } +#endif #pragma weak __vdso_gettc u_int @@ -60,6 +63,7 @@ __vdso_gettc(const struct vdso_timehands { uint64_t val; +#if __ARM_ARCH >= 6 /* * Userspace gettimeofday() is only enabled on ARMv7 CPUs, but * libc is compiled for ARMv6. Due to clang issues, .arch @@ -67,6 +71,9 @@ __vdso_gettc(const struct vdso_timehands */ __asm __volatile(".word\t0xf57ff06f" : : : "memory"); /* isb */ val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); +#else + val = 0; +#endif return (val); } From owner-svn-src-all@freebsd.org Thu Dec 24 22:22:03 2015 Return-Path: Delivered-To: svn-src-all@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 DD75FA51A1F; Thu, 24 Dec 2015 22:22:03 +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 A68A91F27; Thu, 24 Dec 2015 22:22:03 +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 tBOMM2lt028707; Thu, 24 Dec 2015 22:22:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOMM2bS028706; Thu, 24 Dec 2015 22:22:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512242222.tBOMM2bS028706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 24 Dec 2015 22:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292710 - head/contrib/bsnmp/snmpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 22:22:04 -0000 Author: ngie Date: Thu Dec 24 22:22:02 2015 New Revision: 292710 URL: https://svnweb.freebsd.org/changeset/base/292710 Log: Remove unused function `act_getkernstring` This fixes a clang -Wunused warning Differential Revision: https://reviews.freebsd.org/D4697 MFC after: 1 week Reported by: Jenkins Reviewed by: araujo, bapt Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/bsnmp/snmpd/action.c Modified: head/contrib/bsnmp/snmpd/action.c ============================================================================== --- head/contrib/bsnmp/snmpd/action.c Thu Dec 24 22:13:52 2015 (r292709) +++ head/contrib/bsnmp/snmpd/action.c Thu Dec 24 22:22:02 2015 (r292710) @@ -60,29 +60,6 @@ static const struct asn_oid #endif /* - * Get a string value from the KERN sysctl subtree. - */ -static char * -act_getkernstring(int id) -{ - int mib[2]; - size_t len; - char *string; - - mib[0] = CTL_KERN; - mib[1] = id; - if (sysctl(mib, 2, NULL, &len, NULL, 0) != 0) - return (NULL); - if ((string = malloc(len)) == NULL) - return (NULL); - if (sysctl(mib, 2, string, &len, NULL, 0) != 0) { - free(string); - return (NULL); - } - return (string); -} - -/* * Get an integer value from the KERN sysctl subtree. */ static char * From owner-svn-src-all@freebsd.org Thu Dec 24 22:27:01 2015 Return-Path: Delivered-To: svn-src-all@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 7A731A51C2D; Thu, 24 Dec 2015 22:27:01 +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 483C8135A; Thu, 24 Dec 2015 22:27:01 +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 tBOMR0Gd029376; Thu, 24 Dec 2015 22:27:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBOMR04r029375; Thu, 24 Dec 2015 22:27:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512242227.tBOMR04r029375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 24 Dec 2015 22:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292711 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 22:27:01 -0000 Author: adrian Date: Thu Dec 24 22:27:00 2015 New Revision: 292711 URL: https://svnweb.freebsd.org/changeset/base/292711 Log: Add missing device rename. Modified: head/sys/mips/conf/RT305X Modified: head/sys/mips/conf/RT305X ============================================================================== --- head/sys/mips/conf/RT305X Thu Dec 24 22:22:02 2015 (r292710) +++ head/sys/mips/conf/RT305X Thu Dec 24 22:27:00 2015 (r292711) @@ -118,7 +118,7 @@ device cfid device nvram2env device usb -#device dotg # DWC like USB OTG Controller driver +#device dwcotg # DWC like USB OTG Controller driver #device u3g #device umodem #device uplcom From owner-svn-src-all@freebsd.org Fri Dec 25 00:58:43 2015 Return-Path: Delivered-To: svn-src-all@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 49E0BA50792; Fri, 25 Dec 2015 00:58:43 +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 0EDD915D2; Fri, 25 Dec 2015 00:58:42 +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 tBP0wgYs073862; Fri, 25 Dec 2015 00:58:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBP0wfCr073858; Fri, 25 Dec 2015 00:58:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512250058.tBP0wfCr073858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 25 Dec 2015 00:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292712 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 00:58:43 -0000 Author: adrian Date: Fri Dec 25 00:58:41 2015 New Revision: 292712 URL: https://svnweb.freebsd.org/changeset/base/292712 Log: Add initial configuration files for the MT7620 and RT5350 SoCs. These are all works in progress. Notably - no wifi support just yet! I've booted the MT7620 on a TP-Link Archer C2 via tftpboot. Submitted by: Stanislav Galabov Added: head/sys/mips/conf/MT7620 (contents, props changed) head/sys/mips/conf/MT7620.hints (contents, props changed) head/sys/mips/conf/RT5350 (contents, props changed) head/sys/mips/conf/RT5350.hints (contents, props changed) Added: head/sys/mips/conf/MT7620 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/MT7620 Fri Dec 25 00:58:41 2015 (r292712) @@ -0,0 +1,149 @@ +# MT7620 -- Kernel configuration file for FreeBSD/mips for Ralink MT7620 systems +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident MT7620 + +machine mips mipsel +makeoptions MIPS_LITTLE_ENDIAN=defined +makeoptions KERNLOADADDR=0x80010000 + +# Don't build any modules yet. +#makeoptions MODULES_OVERRIDE="wlan_xauth wlan_wep wlan_tkip wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt if_bridge bridgestp msdosfs md ipfw dummynet libalias geom/geom_label ufs usb/uplcom usb/u3g usb/umodem usb/umass usb/ucom cam zlib" +makeoptions MODULES_OVERRIDE="" +makeoptions MT7620 + +include "../rt305x/std.rt305x" + +hints "MT7620.hints" #Default places to look for devices. + +#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols + +options MT7620 +options RT305X_UBOOT + +# Debugging for use in -current +options DEADLKRES #Enable the deadlock resolver +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS #Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options DIAGNOSTIC +#options DEBUG_LOCKS +#options DEBUG_VFS_LOCKS +#options GDB +options DDB +options KDB + +options SCHED_ULE +#options SCHED_4BSD #4BSD scheduler +#options COMPAT_43 +options INET #InterNETworking +options NFSCL #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCL +options PSEUDOFS #Pseudo-filesystem framework +#options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +#options BOOTP +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=rt0 +#options BOOTP_COMPAT +#options CD9660 # ISO 9660 Filesystem +#options ROOTDEVNAME=\"cd9660:/dev/map/rootfs.uncompress\" +#options TMPFS # TMP Memory Filesystem + +options FFS #Berkeley Fast Filesystem +#options SOFTUPDATES #Enable FFS soft updates support +#options UFS_ACL #Support for access control lists +#options UFS_DIRHASH #Improve performance on big directories +#options ROOTDEVNAME=\"nfs:10.0.0.1:/mnt/bsd\" + +# Options for making kernel less hangry +#makeoptions INLINE_LIMIT=1024 +#options MAXUSERS=3 +#options MAXFILES=512 +#options NSFBUFS=256 +#options SHMALL=128 +#options MSGBUF_SIZE=65536 + +# Options for making kernel smallest +#options NO_SYSCTL_DESCR # No description string of sysctl +#options NO_FFS_SNAPSHOT # Disable Snapshot supporting +#options SCSI_NO_SENSE_STRINGS +#options SCSI_NO_OP_STRINGS +#options RWLOCK_NOINLINE +#options SX_NOINLINE +#options NO_SWAPPING +options MROUTING # Multicast routing +options IPFIREWALL_DEFAULT_TO_ACCEPT + +options GEOM_UNCOMPRESS +options MD_ROOT +options ROOTDEVNAME=\"ufs:da0s1\" + +device md + +device random +device loop +# RT3050F, RT3052F have only pseudo PHYs, so mii not required +device rt + +device spibus +device mx25l + +device ether +device miibus +device bpf # Berkeley packet filter +device vlan +device lagg +device if_bridge +device uart +nodevice uart_ns8250 +#device tun # Packet tunnel. + +#device wlan + + +#device gpio +#device gpioled + +#device cfi # Detect Flash memmory +#device cfid + +#device nvram2env + +device usb +device ehci +#device ohci +#device dwcotg # DWC like USB OTG Controller driver +#device u3g +#device umodem +#device uplcom +device cdce +device umass +device da +device pass +device scbus +options SCSI_DELAY=1000 # Delay (in ms) before probing SCSI + +#options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order +#options USB_DEBUG +#options USB_REQ_DEBUG + +device pci Added: head/sys/mips/conf/MT7620.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/MT7620.hints Fri Dec 25 00:58:41 2015 (r292712) @@ -0,0 +1,143 @@ +# $FreeBSD$ +# device.hints +hint.obio.0.at="nexus0" +hint.obio.0.maddr=0x10000000 +hint.obio.0.msize=0x10000000 + +hint.pcib.0.at="nexus0" +hint.pcib.0.maddr=0x10140000 +hint.pcib.0.msize=0x30000 + +hint.mx25l.0.at="spibus0" + +#hint.nvram.0.sig=0xe5e60a74 +#hint.nvram.0.base=0x1f030000 +#hint.nvram.0.maxsize=0x2000 +#hint.nvram.0.flags=3 # 1 = No check, 2 = Format Generic +#hint.nvram.1.sig=0x5a045e94 +#hint.nvram.1.base=0x1f032000 +#hint.nvram.1.maxsize=0x4000 +#hint.nvram.1.flags=3 # 1 = No check, 2 = Format Generic + +# on-board Ralink Frame Engine +hint.rt.0.at="nexus0" +hint.rt.0.maddr=0x10100000 +hint.rt.0.msize=0x10000 +hint.rt.0.irq=3 +# macaddr can be statically set +#hint.rt.0.macaddr="xx:xx:xx:xx:xx:xx" + +# on-board Ralink 2872 802.11n core +hint.rt2860.0.at="nexus0" +hint.rt2860.0.maddr=0x10180000 +hint.rt2860.0.msize=0x40000 +hint.rt2860.0.irq=4 + +# uart0 +#hint.uart.0.at="obio0" +#hint.uart.0.maddr=0x10000C00 +#hint.uart.0.msize=0x100 +#hint.uart.0.irq=12 +#hint.uart.0.flags="0x30" + +# uart1 +#hint.uart.1.at="obio0" +#hint.uart.1.maddr=0x10000500 +#hint.uart.1.msize=0x100 +#hint.uart.1.irq=5 +#hint.uart.1.flags="0x30" + + +# gpio +# GPIO0 - WPS BTN IN II IO +#hint.gpiobutton.0.at="gpiobus0" +#hint.gpiobutton.0.pins="0x01" +#hint.gpiobutton.0.name="wps" +#hint.gpiobutton.0.flags="0x0581" + +# GPIO7 - MODE SW AP IN II IO +#hint.gpiobutton.1.at="gpiobus0" +#hint.gpiobutton.1.pins="0x80" +#hint.gpiobutton.1.name="mode_ap" +#hint.gpiobutton.1.flags="0x0581" + +# GPIO8 - ST LEDRED OUT /* 2pin BiDir RED/BLUE LED */ +# GPIO9 - ST LEDBLUE OUT +#hint.gpioled.0.at="gpiobus0" +#hint.gpioled.0.pins="0x100" +#hint.gpioled.0.name="status_red" +#hint.gpioled.0.flags="0x0002" +#hint.gpioled.1.at="gpiobus0" +#hint.gpioled.1.pins="0x200" +#hint.gpioled.1.name="status_blue" +#hint.gpioled.1.name="status" +#hint.gpioled.1.flags="0x0002" + +# GPIO10 - RST BTN IN II IO +#hint.gpiobutton.2.at="gpiobus0" +#hint.gpiobutton.2.pins="0x400" +##hint.gpiobutton.2.name="reset" +#hint.gpiobutton.2.flags="0x0581" + +# GPIO11 - MODE SW CL IN II IO +#hint.gpiobutton.3.at="gpiobus0" +#hint.gpiobutton.3.pins="0x800" +#hint.gpiobutton.3.name="mode_wlan_client" +#hint.gpiobutton.3.flags="0x0581" + +# GPIO14 - WPS LED OUT II IO +#hint.gpioled.2.at="gpiobus0" +#hint.gpioled.2.pins="0x4000" +#hint.gpioled.2.name="wps" +#hint.gpioled.2.flags="0x0182" + + + +#0x00000000-0x00030000 : "Bootloader" +#0x00030000-0x00040000 : "Factory" +#0x00040000-0x00070000 : "Config" +#0x00070000-0x000b0000 : "Language" +#0x000b0000-0x001a0000 : "Kernel" +#0x001a0000-0x01000000 : "RootFS" + +#hint.map.0.at="cfid0" +#hint.map.0.start=0x00000000 +#hint.map.0.end=0x00030000 +#hint.map.0.name="bootloader" +#hint.map.0.readonly=1 + +#hint.map.1.at="cfid0" +#hint.map.1.start=0x00030000 +#hint.map.1.end=0x00040000 +#hint.map.1.name="factory" + +#hint.map.2.at="cfid0" +#hint.map.2.start=0x00040000 +#hint.map.2.end=0x00800000 +#hint.map.2.name="upgrade" + +#hint.map.3.at="cfid0" +#hint.map.3.start=0x00040000 +#hint.map.3.end=0x00050000 +#hint.map.3.name="config" + +#hint.map.4.at="cfid0" +#hint.map.4.start=0x00000000 +#hint.map.4.end=0x00000000 +#hint.map.4.name="language" + +#hint.map.5.at="cfid0" +#hint.map.5.start=0x00050000 +#hint.map.5.end=0x00150000 +#hint.map.5.name="kernel" + +#hint.map.6.at="cfid0" +#hint.map.6.start=0x00150000 +#hint.map.6.end=0x00800000 +#hint.map.6.name="rootfs" + + +#hint.rt.0.phymask=0x1f +#hint.rt.0.media=100 +#hint.rt.0.fduplex=1 + Added: head/sys/mips/conf/RT5350 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/RT5350 Fri Dec 25 00:58:41 2015 (r292712) @@ -0,0 +1,125 @@ +# RT5350 -- Kernel configuration file for FreeBSD/mips for Ralink RT5350 systems +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident RT5350 + +machine mips mipsel +makeoptions MIPS_LITTLE_ENDIAN=defined +makeoptions KERNLOADADDR=0x80001000 + +# Don't build any modules yet. +makeoptions MODULES_OVERRIDE="wlan_xauth wlan_wep wlan_tkip wlan_acl wlan_amrr wlan_ccmp wlan_rssadapt if_bridge bridgestp msdosfs md ipfw dummynet libalias geom/geom_label ufs usb/uplcom usb/u3g usb/umodem usb/umass usb/ucom cam zlib" +makeoptions RT5350 + +include "../rt305x/std.rt305x" + +hints "RT5350.hints" #Default places to look for devices. + +#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols + +options RT5350 +options RT305X_UBOOT + +# Debugging for use in -current +options DEADLKRES #Enable the deadlock resolver +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS #Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options DIAGNOSTIC +#options DEBUG_LOCKS +#options DEBUG_VFS_LOCKS +#options GDB +options DDB +options KDB + +options SCHED_ULE +options INET #InterNETworking +#options NFSCL #Network Filesystem Client +#options NFS_ROOT #NFS usable as /, requires NFSCL +options PSEUDOFS #Pseudo-filesystem framework +#options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +#options BOOTP +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=rt0 +#options BOOTP_COMPAT + +options TMPFS # TMP Memory Filesystem + +options FFS #Berkeley Fast Filesystem +#options ROOTDEVNAME=\"nfs:193.178.153.200:/bsdmips\" + +#device geom_uncompress +#options GEOM_UNCOMPRESS +#options MD_ROOT +#options ROOTDEVNAME=\"ufs:md0.uncompress\" + +# Options for making kernel less hangry +makeoptions INLINE_LIMIT=1024 +options MAXUSERS=3 +options MAXFILES=512 +options NSFBUFS=256 +options SHMALL=128 +options MSGBUF_SIZE=65536 + +# Options for making kernel smallest +options NO_SYSCTL_DESCR # No description string of sysctl +#options NO_FFS_SNAPSHOT # Disable Snapshot supporting +options SCSI_NO_SENSE_STRINGS +options SCSI_NO_OP_STRINGS +options RWLOCK_NOINLINE +options SX_NOINLINE +options NO_SWAPPING +options MROUTING # Multicast routing +options IPFIREWALL_DEFAULT_TO_ACCEPT + +#device md +device random +device loop +# RT3050F, RT3052F have only pseudo PHYs, so mii not required +device rt + +device ether +device bpf # Berkeley packet filter +device vlan +#device lagg +#device if_bridge +device uart +nodevice uart_ns8250 +device tun # Packet tunnel. + +device wlan + +#device gpio +#device gpioled + +#device nvram2env + +device spibus +device mx25l + +device usb +device ehci +options SCSI_DELAY=1000 # Delay (in ms) before probing SCSI + +#options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order +#options USB_DEBUG +#options USB_REQ_DEBUG Added: head/sys/mips/conf/RT5350.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/RT5350.hints Fri Dec 25 00:58:41 2015 (r292712) @@ -0,0 +1,35 @@ +# $FreeBSD$ +# device.hints +hint.obio.0.at="nexus0" +hint.obio.0.maddr=0x10000000 +hint.obio.0.msize=0x10000000 + +hint.mx25l.0.at="spibus0" + +#hint.nvram.0.sig=0xe5e60a74 +#hint.nvram.0.base=0x1f030000 +#hint.nvram.0.maxsize=0x2000 +#hint.nvram.0.flags=3 # 1 = No check, 2 = Format Generic +#hint.nvram.1.sig=0x5a045e94 +#hint.nvram.1.base=0x1f032000 +#hint.nvram.1.maxsize=0x4000 +#hint.nvram.1.flags=3 # 1 = No check, 2 = Format Generic + +# on-board Ralink Frame Engine +hint.rt.0.at="nexus0" +hint.rt.0.maddr=0x10100000 +hint.rt.0.msize=0x10000 +hint.rt.0.irq=3 +# macaddr can be statically set +#hint.rt.0.macaddr="xx:xx:xx:xx:xx:xx" + +# on-board Ralink 2872 802.11n core +hint.rt2860.0.at="nexus0" +hint.rt2860.0.maddr=0x10180000 +hint.rt2860.0.msize=0x40000 +hint.rt2860.0.irq=4 + +hint.rt.0.phymask=0x1f +hint.rt.0.media=100 +hint.rt.0.fduplex=1 + From owner-svn-src-all@freebsd.org Fri Dec 25 03:44:31 2015 Return-Path: Delivered-To: svn-src-all@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 67E49A51855; Fri, 25 Dec 2015 03:44:31 +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 26AD31484; Fri, 25 Dec 2015 03:44:31 +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 tBP3iUTc023626; Fri, 25 Dec 2015 03:44:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBP3iTjq023623; Fri, 25 Dec 2015 03:44:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512250344.tBP3iTjq023623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 25 Dec 2015 03:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292715 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 03:44:31 -0000 Author: mav Date: Fri Dec 25 03:44:29 2015 New Revision: 292715 URL: https://svnweb.freebsd.org/changeset/base/292715 Log: Clear virtual port's port database when disabling it. Previously it was done only on full chip reinit, that caused old ports resurrect in case of virtual port reenabling. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_library.c head/sys/dev/isp/isp_library.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Fri Dec 25 02:15:26 2015 (r292714) +++ head/sys/dev/isp/isp.c Fri Dec 25 03:44:29 2015 (r292715) @@ -2344,6 +2344,159 @@ isp_fibre_init_2400(ispsoftc_t *isp) isp->isp_state = ISP_RUNSTATE; } +static int +isp_fc_enable_vp(ispsoftc_t *isp, int chan) +{ + fcparam *fcp = FCPARAM(isp, chan); + mbreg_t mbs; + vp_modify_t *vp; + uint8_t qe[QENTRY_LEN], *scp; + + ISP_MEMZERO(qe, QENTRY_LEN); + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + return (EBUSY); + } + scp = fcp->isp_scratch; + + /* Build a VP MODIFY command in memory */ + vp = (vp_modify_t *) qe; + vp->vp_mod_hdr.rqs_entry_type = RQSTYPE_VP_MODIFY; + vp->vp_mod_hdr.rqs_entry_count = 1; + vp->vp_mod_cnt = 1; + vp->vp_mod_idx0 = chan; + vp->vp_mod_cmd = VP_MODIFY_ENA; + vp->vp_mod_ports[0].options = ICB2400_VPOPT_ENABLED | + ICB2400_VPOPT_ENA_SNSLOGIN; + if (fcp->role & ISP_ROLE_INITIATOR) { + vp->vp_mod_ports[0].options |= ICB2400_VPOPT_INI_ENABLE; + } + if ((fcp->role & ISP_ROLE_TARGET) == 0) { + vp->vp_mod_ports[0].options |= ICB2400_VPOPT_TGT_DISABLE; + } + if (fcp->isp_loopid < LOCAL_LOOP_LIM) { + vp->vp_mod_ports[0].loopid = fcp->isp_loopid; + if (isp->isp_confopts & ISP_CFG_OWNLOOPID) + vp->vp_mod_ports[0].options |= + ICB2400_VPOPT_HARD_ADDRESS; + else + vp->vp_mod_ports[0].options |= + ICB2400_VPOPT_PREV_ADDRESS; + } + MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwpn, fcp->isp_wwpn); + MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwnn, fcp->isp_wwnn); + isp_put_vp_modify(isp, vp, (vp_modify_t *) scp); + + /* Build a EXEC IOCB A64 command that points to the VP MODIFY command */ + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 0); + mbs.param[1] = QENTRY_LEN; + mbs.param[2] = DMA_WD1(fcp->isp_scdma); + mbs.param[3] = DMA_WD0(fcp->isp_scdma); + mbs.param[6] = DMA_WD3(fcp->isp_scdma); + mbs.param[7] = DMA_WD2(fcp->isp_scdma); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); + isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + FC_SCRATCH_RELEASE(isp, chan); + return (EIO); + } + MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); + isp_get_vp_modify(isp, (vp_modify_t *)&scp[QENTRY_LEN], vp); + + FC_SCRATCH_RELEASE(isp, chan); + + if (vp->vp_mod_status != VP_STS_OK) { + isp_prt(isp, ISP_LOGERR, "%s: VP_MODIFY of Chan %d failed with status %d", __func__, chan, vp->vp_mod_status); + return (EIO); + } + return (0); +} + +static int +isp_fc_disable_vp(ispsoftc_t *isp, int chan) +{ + fcparam *fcp = FCPARAM(isp, chan); + mbreg_t mbs; + vp_ctrl_info_t *vp; + uint8_t qe[QENTRY_LEN], *scp; + + ISP_MEMZERO(qe, QENTRY_LEN); + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + return (EBUSY); + } + scp = fcp->isp_scratch; + + /* Build a VP CTRL command in memory */ + vp = (vp_ctrl_info_t *) qe; + vp->vp_ctrl_hdr.rqs_entry_type = RQSTYPE_VP_CTRL; + vp->vp_ctrl_hdr.rqs_entry_count = 1; + if (ISP_CAP_VP0(isp)) { + vp->vp_ctrl_status = 1; + } else { + vp->vp_ctrl_status = 0; + chan--; /* VP0 can not be controlled in this case. */ + } + vp->vp_ctrl_command = VP_CTRL_CMD_DISABLE_VP_LOGO_ALL; + vp->vp_ctrl_vp_count = 1; + vp->vp_ctrl_idmap[chan / 16] |= (1 << chan % 16); + isp_put_vp_ctrl_info(isp, vp, (vp_ctrl_info_t *) scp); + + /* Build a EXEC IOCB A64 command that points to the VP CTRL command */ + MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 0); + mbs.param[1] = QENTRY_LEN; + mbs.param[2] = DMA_WD1(fcp->isp_scdma); + mbs.param[3] = DMA_WD0(fcp->isp_scdma); + mbs.param[6] = DMA_WD3(fcp->isp_scdma); + mbs.param[7] = DMA_WD2(fcp->isp_scdma); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); + isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); + if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + FC_SCRATCH_RELEASE(isp, chan); + return (EIO); + } + MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); + isp_get_vp_ctrl_info(isp, (vp_ctrl_info_t *)&scp[QENTRY_LEN], vp); + + FC_SCRATCH_RELEASE(isp, chan); + + if (vp->vp_ctrl_status != 0) { + isp_prt(isp, ISP_LOGERR, + "%s: VP_CTRL of Chan %d failed with status %d %d", + __func__, chan, vp->vp_ctrl_status, vp->vp_ctrl_index_fail); + return (EIO); + } + return (0); +} + +static int +isp_fc_change_role(ispsoftc_t *isp, int chan, int new_role) +{ + fcparam *fcp = FCPARAM(isp, chan); + int i, was, res = 0; + + if (chan >= isp->isp_nchan) { + isp_prt(isp, ISP_LOGWARN, "%s: bad channel %d", __func__, chan); + return (ENXIO); + } + if (fcp->role == new_role) + return (0); + for (was = 0, i = 0; i < isp->isp_nchan; i++) { + if (FCPARAM(isp, i)->role != ISP_ROLE_NONE) + was++; + } + if (was == 0 || (was == 1 && fcp->role != ISP_ROLE_NONE)) { + fcp->role = new_role; + return (isp_reinit(isp, 0)); + } + if (fcp->role != ISP_ROLE_NONE) { + res = isp_fc_disable_vp(isp, chan); + isp_clear_portdb(isp, chan); + } + fcp->role = new_role; + if (fcp->role != ISP_ROLE_NONE) + res = isp_fc_enable_vp(isp, chan); + return (res); +} + static void isp_clear_portdb(ispsoftc_t *isp, int chan) { Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Fri Dec 25 02:15:26 2015 (r292714) +++ head/sys/dev/isp/isp_library.c Fri Dec 25 03:44:29 2015 (r292715) @@ -573,168 +573,6 @@ isp_fc_toponame(fcparam *fcp) } } -static int -isp_fc_enable_vp(ispsoftc_t *isp, int chan) -{ - fcparam *fcp = FCPARAM(isp, chan); - mbreg_t mbs; - vp_modify_t *vp; - uint8_t qe[QENTRY_LEN], *scp; - - ISP_MEMZERO(qe, QENTRY_LEN); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - return (EBUSY); - } - scp = fcp->isp_scratch; - - /* - * Build a VP MODIFY command in memory - */ - vp = (vp_modify_t *) qe; - vp->vp_mod_hdr.rqs_entry_type = RQSTYPE_VP_MODIFY; - vp->vp_mod_hdr.rqs_entry_count = 1; - vp->vp_mod_cnt = 1; - vp->vp_mod_idx0 = chan; - vp->vp_mod_cmd = VP_MODIFY_ENA; - vp->vp_mod_ports[0].options = ICB2400_VPOPT_ENABLED | - ICB2400_VPOPT_ENA_SNSLOGIN; - if (fcp->role & ISP_ROLE_INITIATOR) { - vp->vp_mod_ports[0].options |= ICB2400_VPOPT_INI_ENABLE; - } - if ((fcp->role & ISP_ROLE_TARGET) == 0) { - vp->vp_mod_ports[0].options |= ICB2400_VPOPT_TGT_DISABLE; - } - if (fcp->isp_loopid < LOCAL_LOOP_LIM) { - vp->vp_mod_ports[0].loopid = fcp->isp_loopid; - if (isp->isp_confopts & ISP_CFG_OWNLOOPID) - vp->vp_mod_ports[0].options |= - ICB2400_VPOPT_HARD_ADDRESS; - else - vp->vp_mod_ports[0].options |= - ICB2400_VPOPT_PREV_ADDRESS; - } - MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwpn, fcp->isp_wwpn); - MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwnn, fcp->isp_wwnn); - isp_put_vp_modify(isp, vp, (vp_modify_t *) scp); - - /* - * Build a EXEC IOCB A64 command that points to the VP MODIFY command - */ - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 0); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); - isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - FC_SCRATCH_RELEASE(isp, chan); - return (EIO); - } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); - isp_get_vp_modify(isp, (vp_modify_t *)&scp[QENTRY_LEN], vp); - - FC_SCRATCH_RELEASE(isp, chan); - - if (vp->vp_mod_status != VP_STS_OK) { - isp_prt(isp, ISP_LOGERR, "%s: VP_MODIFY of Chan %d failed with status %d", __func__, chan, vp->vp_mod_status); - return (EIO); - } - return (0); -} - -static int -isp_fc_disable_vp(ispsoftc_t *isp, int chan) -{ - fcparam *fcp = FCPARAM(isp, chan); - mbreg_t mbs; - vp_ctrl_info_t *vp; - uint8_t qe[QENTRY_LEN], *scp; - - ISP_MEMZERO(qe, QENTRY_LEN); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - return (EBUSY); - } - scp = fcp->isp_scratch; - - /* - * Build a VP CTRL command in memory - */ - vp = (vp_ctrl_info_t *) qe; - vp->vp_ctrl_hdr.rqs_entry_type = RQSTYPE_VP_CTRL; - vp->vp_ctrl_hdr.rqs_entry_count = 1; - if (ISP_CAP_VP0(isp)) { - vp->vp_ctrl_status = 1; - } else { - vp->vp_ctrl_status = 0; - chan--; /* VP0 can not be controlled in this case. */ - } - vp->vp_ctrl_command = VP_CTRL_CMD_DISABLE_VP_LOGO_ALL; - vp->vp_ctrl_vp_count = 1; - vp->vp_ctrl_idmap[chan / 16] |= (1 << chan % 16); - isp_put_vp_ctrl_info(isp, vp, (vp_ctrl_info_t *) scp); - - /* - * Build a EXEC IOCB A64 command that points to the VP CTRL command - */ - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 0); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); - isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - FC_SCRATCH_RELEASE(isp, chan); - return (EIO); - } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); - isp_get_vp_ctrl_info(isp, (vp_ctrl_info_t *)&scp[QENTRY_LEN], vp); - - FC_SCRATCH_RELEASE(isp, chan); - - if (vp->vp_ctrl_status != 0) { - isp_prt(isp, ISP_LOGERR, - "%s: VP_CTRL of Chan %d failed with status %d %d", - __func__, chan, vp->vp_ctrl_status, vp->vp_ctrl_index_fail); - return (EIO); - } - return (0); -} - -/* - * Change Roles - */ -int -isp_fc_change_role(ispsoftc_t *isp, int chan, int new_role) -{ - fcparam *fcp = FCPARAM(isp, chan); - int i, was, res = 0; - - if (chan >= isp->isp_nchan) { - isp_prt(isp, ISP_LOGWARN, "%s: bad channel %d", __func__, chan); - return (ENXIO); - } - if (fcp->role == new_role) - return (0); - for (was = 0, i = 0; i < isp->isp_nchan; i++) { - if (FCPARAM(isp, i)->role != ISP_ROLE_NONE) - was++; - } - if (was == 0 || (was == 1 && fcp->role != ISP_ROLE_NONE)) { - fcp->role = new_role; - return (isp_reinit(isp, 0)); - } - if (fcp->role != ISP_ROLE_NONE) - res = isp_fc_disable_vp(isp, chan); - fcp->role = new_role; - if (fcp->role != ISP_ROLE_NONE) - res = isp_fc_enable_vp(isp, chan); - return (res); -} - void isp_clear_commands(ispsoftc_t *isp) { Modified: head/sys/dev/isp/isp_library.h ============================================================================== --- head/sys/dev/isp/isp_library.h Fri Dec 25 02:15:26 2015 (r292714) +++ head/sys/dev/isp/isp_library.h Fri Dec 25 03:44:29 2015 (r292715) @@ -72,9 +72,6 @@ const char *isp_fc_fw_statename(int); const char *isp_fc_loop_statename(int); const char *isp_fc_toponame(fcparam *); -int isp_fc_change_role(ispsoftc_t *, int, int); - - /* * Cleanup */ From owner-svn-src-all@freebsd.org Fri Dec 25 08:09:49 2015 Return-Path: Delivered-To: svn-src-all@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 E3ACCA51A76; Fri, 25 Dec 2015 08:09:49 +0000 (UTC) (envelope-from sjg@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 BE58D12D7; Fri, 25 Dec 2015 08:09:49 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBP89mcV000850; Fri, 25 Dec 2015 08:09:48 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBP89mu8000841; Fri, 25 Dec 2015 08:09:48 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201512250809.tBP89mu8000841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 25 Dec 2015 08:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292716 - in vendor/NetBSD/bmake/dist: . mk X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 08:09:50 -0000 Author: sjg Date: Fri Dec 25 08:09:48 2015 New Revision: 292716 URL: https://svnweb.freebsd.org/changeset/base/292716 Log: Import bmake-20151220 Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/Makefile vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/auto.obj.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/os.sh vendor/NetBSD/bmake/dist/suff.c Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Fri Dec 25 03:44:29 2015 (r292715) +++ vendor/NetBSD/bmake/dist/ChangeLog Fri Dec 25 08:09:48 2015 (r292716) @@ -1,3 +1,9 @@ +2015-12-20 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151220 + Merge with NetBSD make, pick up + o suff.c: re-initialize suffNull when clearing suffixes. + 2015-12-01 Simon J. Gerraty * Makefile (MAKE_VERSION): 20151201 Modified: vendor/NetBSD/bmake/dist/Makefile ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile Fri Dec 25 03:44:29 2015 (r292715) +++ vendor/NetBSD/bmake/dist/Makefile Fri Dec 25 08:09:48 2015 (r292716) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.48 2015/12/02 00:36:42 sjg Exp $ +# $Id: Makefile,v 1.49 2015/12/20 22:54:40 sjg Exp $ # Base version on src date -MAKE_VERSION= 20151201 +MAKE_VERSION= 20151220 PROG= bmake Modified: vendor/NetBSD/bmake/dist/mk/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/mk/ChangeLog Fri Dec 25 03:44:29 2015 (r292715) +++ vendor/NetBSD/bmake/dist/mk/ChangeLog Fri Dec 25 08:09:48 2015 (r292716) @@ -1,3 +1,9 @@ +2015-12-12 Simon J. Gerraty + + * install-mk (MK_VERSION): 20151212 + * auto.obj.mk: do not require MAKEOBJDIRPREFIX to exist. + only apply :tA to __objdir when comparing to .OBJDIR + 2015-11-14 Simon J. Gerraty * install-mk (MK_VERSION): 20151111 Modified: vendor/NetBSD/bmake/dist/mk/auto.obj.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/auto.obj.mk Fri Dec 25 03:44:29 2015 (r292715) +++ vendor/NetBSD/bmake/dist/mk/auto.obj.mk Fri Dec 25 08:09:48 2015 (r292716) @@ -1,4 +1,4 @@ -# $Id: auto.obj.mk,v 1.11 2015/06/16 06:28:21 sjg Exp $ +# $Id: auto.obj.mk,v 1.12 2015/12/16 01:57:06 sjg Exp $ # # @(#) Copyright (c) 2004, Simon J. Gerraty # @@ -40,12 +40,12 @@ MKOBJDIRS= auto .if !defined(NOOBJ) && !defined(NO_OBJ) && ${MKOBJDIRS:Uno} == auto # Use __objdir here so it is easier to tweak without impacting # the logic. -.if !empty(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX}) +.if !empty(MAKEOBJDIRPREFIX) __objdir?= ${MAKEOBJDIRPREFIX}${.CURDIR} .endif __objdir?= ${MAKEOBJDIR:Uobj} -__objdir:= ${__objdir:tA} -.if ${.OBJDIR} != ${__objdir} +__objdir:= ${__objdir} +.if ${.OBJDIR:tA} != ${__objdir:tA} # We need to chdir, make the directory if needed .if !exists(${__objdir}/) && \ (${.TARGETS} == "" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} != "") @@ -53,11 +53,10 @@ __objdir:= ${__objdir:tA} __objdir_made != echo ${__objdir}/; umask ${OBJDIR_UMASK:U002}; \ ${ECHO_TRACE} "[Creating objdir ${__objdir}...]" >&2; \ ${Mkdirs}; Mkdirs ${__objdir} -__objdir:= ${__objdir:tA} .endif # This causes make to use the specified directory as .OBJDIR .OBJDIR: ${__objdir} -.if ${.OBJDIR} != ${__objdir} && ${__objdir_made:Uno:M${__objdir}/*} != "" +.if ${.OBJDIR:tA} != ${__objdir:tA} && ${__objdir_made:Uno:M${__objdir}/*} != "" .error could not use ${__objdir}: .OBJDIR=${.OBJDIR} .endif .endif Modified: vendor/NetBSD/bmake/dist/mk/install-mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/install-mk Fri Dec 25 03:44:29 2015 (r292715) +++ vendor/NetBSD/bmake/dist/mk/install-mk Fri Dec 25 08:09:48 2015 (r292716) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.117 2015/11/14 18:09:57 sjg Exp $ +# $Id: install-mk,v 1.118 2015/12/16 01:57:06 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20151111 +MK_VERSION=20151212 OWNER= GROUP= MODE=444 Modified: vendor/NetBSD/bmake/dist/os.sh ============================================================================== --- vendor/NetBSD/bmake/dist/os.sh Fri Dec 25 03:44:29 2015 (r292715) +++ vendor/NetBSD/bmake/dist/os.sh Fri Dec 25 08:09:48 2015 (r292716) @@ -17,7 +17,7 @@ # Simon J. Gerraty # RCSid: -# $Id: os.sh,v 1.49 2015/10/25 00:05:40 sjg Exp $ +# $Id: os.sh,v 1.50 2015/12/17 17:06:29 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -56,10 +56,10 @@ Which() { case "$1" in /*) test $t $1 && echo $1;; *) - # some shells cannot correctly handle `IFS` - # in conjunction with the for loop. - _dirs=`IFS=:; echo ${2:-$PATH}` - for d in $_dirs + # some shells cannot correctly handle `IFS` + # in conjunction with the for loop. + _dirs=`IFS=:; echo ${2:-$PATH}` + for d in $_dirs do test $t $d/$1 && { echo $d/$1; break; } done @@ -70,11 +70,11 @@ Which() { # tr is insanely non-portable wrt char classes, so we need to # spell out the alphabet. sed y/// would work too. toUpper() { - ${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ + ${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ } toLower() { - ${TR:-tr} ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz + ${TR:-tr} ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz } K= @@ -91,7 +91,7 @@ SunOS) export CHOWN # Great! Solaris keeps moving arch(1) - # should just bite the bullet and use uname -p + # should just bite the bullet and use uname -p arch=`Which arch /usr/bin:/usr/ucb` MAILER=/usr/ucb/Mail @@ -105,8 +105,8 @@ SunOS) MACHINE=$MACHINE_ARCH ;; 4*) - MACHINE_ARCH=`arch` - ;; + MACHINE_ARCH=`arch` + ;; 5*) K=-k LOCAL_FS=ufs @@ -116,8 +116,8 @@ SunOS) # overwriting an existing file!!!!! We want one that works! test -x /usr/xpg4/bin/ln && LN=${LN:-/usr/xpg4/bin/ln} # wonderful, 5.8's tr again require's []'s - # but /usr/xpg4/bin/tr causes problems if LC_COLLATE is set! - # use toUpper/toLower instead. + # but /usr/xpg4/bin/tr causes problems if LC_COLLATE is set! + # use toUpper/toLower instead. ;; esac case "$OS/$MACHINE_ARCH" in @@ -142,9 +142,9 @@ SunOS) SHARE_ARCH=$OS/$HOST ;; OpenBSD) - arch=`Which arch /usr/bin:/usr/ucb:$PATH` - MACHINE_ARCH=`$arch -s` - ;; + arch=`Which arch /usr/bin:/usr/ucb:$PATH` + MACHINE_ARCH=`$arch -s` + ;; esac NAWK=awk export NAWK @@ -218,17 +218,25 @@ export HOST_TARGET case `echo -n .` in -n*) N=; C="\c";; *) N=-n; C=;; esac -export HOSTNAME HOST +Echo() { + case "$1" in + -n) _n=$N _c=$C; shift;; + *) _n= _c=;; + esac + echo $_n "$@" $_c +} + +export HOSTNAME HOST export OS MACHINE MACHINE_ARCH OSREL OSMAJOR LOCAL_FS TMP_DIRS MAILER N C K PS_AXC export LN SHARE_ARCH TR case /$0 in */os.sh) - for v in $* + for v in $* do - eval vv=\$$v - echo "$v='$vv'" + eval vv=\$$v + echo "$v='$vv'" done - ;; + ;; esac Modified: vendor/NetBSD/bmake/dist/suff.c ============================================================================== --- vendor/NetBSD/bmake/dist/suff.c Fri Dec 25 03:44:29 2015 (r292715) +++ vendor/NetBSD/bmake/dist/suff.c Fri Dec 25 08:09:48 2015 (r292716) @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $ */ +/* $NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $"; +static char rcsid[] = "$NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -__RCSID("$NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $"); +__RCSID("$NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -553,7 +553,20 @@ Suff_ClearSuffixes(void) #endif sufflist = Lst_Init(FALSE); sNum = 0; - suffNull = emptySuff; + if (suffNull) + SuffFree(suffNull); + emptySuff = suffNull = bmake_malloc(sizeof(Suff)); + + suffNull->name = bmake_strdup(""); + suffNull->nameLen = 0; + suffNull->searchPath = Lst_Init(FALSE); + Dir_Concat(suffNull->searchPath, dirSearchPath); + suffNull->children = Lst_Init(FALSE); + suffNull->parents = Lst_Init(FALSE); + suffNull->ref = Lst_Init(FALSE); + suffNull->sNum = sNum++; + suffNull->flags = SUFF_NULL; + suffNull->refCount = 1; } /*- @@ -2524,32 +2537,18 @@ Suff_SetNull(char *name) void Suff_Init(void) { - sufflist = Lst_Init(FALSE); #ifdef CLEANUP suffClean = Lst_Init(FALSE); #endif srclist = Lst_Init(FALSE); transforms = Lst_Init(FALSE); - sNum = 0; /* * Create null suffix for single-suffix rules (POSIX). The thing doesn't * actually go on the suffix list or everyone will think that's its * suffix. */ - emptySuff = suffNull = bmake_malloc(sizeof(Suff)); - - suffNull->name = bmake_strdup(""); - suffNull->nameLen = 0; - suffNull->searchPath = Lst_Init(FALSE); - Dir_Concat(suffNull->searchPath, dirSearchPath); - suffNull->children = Lst_Init(FALSE); - suffNull->parents = Lst_Init(FALSE); - suffNull->ref = Lst_Init(FALSE); - suffNull->sNum = sNum++; - suffNull->flags = SUFF_NULL; - suffNull->refCount = 1; - + Suff_ClearSuffixes(); } From owner-svn-src-all@freebsd.org Fri Dec 25 08:10:35 2015 Return-Path: Delivered-To: svn-src-all@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 0051FA51B2C; Fri, 25 Dec 2015 08:10:35 +0000 (UTC) (envelope-from sjg@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 AC1B01462; Fri, 25 Dec 2015 08:10:34 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBP8AXLI000938; Fri, 25 Dec 2015 08:10:33 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBP8AXac000937; Fri, 25 Dec 2015 08:10:33 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201512250810.tBP8AXac000937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 25 Dec 2015 08:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292717 - vendor/NetBSD/bmake/20151220 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 08:10:35 -0000 Author: sjg Date: Fri Dec 25 08:10:33 2015 New Revision: 292717 URL: https://svnweb.freebsd.org/changeset/base/292717 Log: Tag bmake/20151220 Added: vendor/NetBSD/bmake/20151220/ - copied from r292716, vendor/NetBSD/bmake/dist/ From owner-svn-src-all@freebsd.org Fri Dec 25 08:29:50 2015 Return-Path: Delivered-To: svn-src-all@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 57471A5027E for ; Fri, 25 Dec 2015 08:29:50 +0000 (UTC) (envelope-from ubm@u-boot-man.de) Received: from mail.server41.configcenter.info (mail.server41.configcenter.info [31.47.242.37]) (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 1D5541D0F for ; Fri, 25 Dec 2015 08:29:49 +0000 (UTC) (envelope-from ubm@u-boot-man.de) Received: from ubm.strangled.net (ipbcc30645.dynamic.kabel-deutschland.de [188.195.6.69]) (Authenticated sender: web4) by mail.server41.configcenter.info (Postfix) with ESMTP id A012E142A0A5 for ; Fri, 25 Dec 2015 09:05:42 +0100 (CET) Date: Fri, 25 Dec 2015 09:05:22 +0100 From: Marc "UBM" Bocklet To: svn-src-all@freebsd.org Subject: Re: svn commit: r292706 - in head/sys: conf netinet Message-Id: <20151225090522.983637f3b4763736e87a9207@u-boot-man.de> In-Reply-To: <201512241909.tBOJ9nlX070850@repo.freebsd.org> References: <201512241909.tBOJ9nlX070850@repo.freebsd.org> X-Mailer: Sylpheed 3.4.3 (GTK+ 2.24.28; amd64-portbld-freebsd11.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (mail.server41.configcenter.info [0.0.0.0]); Fri, 25 Dec 2015 09:05:42 +0100 (CET) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 08:29:50 -0000 On Thu, 24 Dec 2015 19:09:49 +0000 (UTC) Patrick Kelsey wrote: > Added: head/sys/netinet/tcp_fastopen.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/netinet/tcp_fastopen.c Thu Dec 24 19:09:48 2015 (r292706) > @@ -0,0 +1,442 @@ > +/*- > + * Copyright (c) 2015 Patrick Kelsey > + * 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. > + */ > + > +/* > + * This is a server-side implementation of TCP Fast Open (TFO) [RFC7413]. > + * > + * This implementation is currently considered to be experimental and is not > + * included in kernel builds by default. To include this code, add the > + * following line to your kernel config: > + * > + * options TCP_RFC7413 > + * > + * The generated TFO cookies are the 64-bit output of > + * SipHash24(<16-byte-key>). Multiple concurrent valid keys are > + * supported so that time-based rolling cookie invalidation policies can be > + * implemented in the system. The default number of concurrent keys is 2. > + * This can be adjusted in the kernel config as follows: > + * > + * options TCP_RFC7413_MAX_KEYS= > + * > + * > + * The following TFO-specific sysctls are defined: > + * > + * net.inet.tcp.fastopen.acceptany (RW, default 0) There's a typo here, it should probably be "acceptancy"? Bye, Marc From owner-svn-src-all@freebsd.org Fri Dec 25 10:08:44 2015 Return-Path: Delivered-To: svn-src-all@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 2A233A51532; Fri, 25 Dec 2015 10:08:44 +0000 (UTC) (envelope-from cperciva@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 EEA271F4C; Fri, 25 Dec 2015 10:08:43 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPA8h90035575; Fri, 25 Dec 2015 10:08:43 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPA8hRW035574; Fri, 25 Dec 2015 10:08:43 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201512251008.tBPA8hRW035574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Fri, 25 Dec 2015 10:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292718 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 10:08:44 -0000 Author: cperciva Date: Fri Dec 25 10:08:42 2015 New Revision: 292718 URL: https://svnweb.freebsd.org/changeset/base/292718 Log: Document that make's .POSIX: handling is broken. In fact, it has been broken ever since it was added in November 1996. Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Fri Dec 25 08:10:33 2015 (r292717) +++ head/share/mk/sys.mk Fri Dec 25 10:08:42 2015 (r292718) @@ -69,6 +69,10 @@ __ENV_ONLY_OPTIONS:= \ # # The rules below use this macro to distinguish between Posix-compliant # and default behaviour. +# +# This functionality is currently broken, since make(1) processes sys.mk +# before reading any other files, and consequently has no opportunity to +# set the %POSIX macro before we read this point. .if defined(%POSIX) .SUFFIXES: .o .c .y .l .a .sh .f From owner-svn-src-all@freebsd.org Fri Dec 25 10:49:41 2015 Return-Path: Delivered-To: svn-src-all@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 99EDEA50106; Fri, 25 Dec 2015 10:49:41 +0000 (UTC) (envelope-from ume@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 4F5AB1EA7; Fri, 25 Dec 2015 10:49:41 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPAneb0047335; Fri, 25 Dec 2015 10:49:40 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPAneax047333; Fri, 25 Dec 2015 10:49:40 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512251049.tBPAneax047333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Fri, 25 Dec 2015 10:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292719 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 10:49:41 -0000 Author: ume Date: Fri Dec 25 10:49:40 2015 New Revision: 292719 URL: https://svnweb.freebsd.org/changeset/base/292719 Log: Remove _gethostbynisname() and _gethostbynisaddr(). These functions used to be called from getipnodebyname(). MFC after: 1 week Modified: head/lib/libc/net/gethostbynis.c head/lib/libc/net/netdb_private.h Modified: head/lib/libc/net/gethostbynis.c ============================================================================== --- head/lib/libc/net/gethostbynis.c Fri Dec 25 10:08:42 2015 (r292718) +++ head/lib/libc/net/gethostbynis.c Fri Dec 25 10:49:40 2015 (r292719) @@ -198,61 +198,6 @@ _gethostbynisaddr_r(const void *addr, so } #endif /* YP */ -/* XXX _gethostbynisname/_gethostbynisaddr only used by getipnodeby*() */ -struct hostent * -_gethostbynisname(const char *name, int af) -{ -#ifdef YP - struct hostent *he; - struct hostent_data *hed; - u_long oresopt; - int error; - res_state statp; - - statp = __res_state(); - if ((he = __hostent_init()) == NULL || - (hed = __hostent_data_init()) == NULL) { - RES_SET_H_ERRNO(statp, NETDB_INTERNAL); - return (NULL); - } - - oresopt = statp->options; - statp->options &= ~RES_USE_INET6; - error = _gethostbynisname_r(name, af, he, hed); - statp->options = oresopt; - return (error == 0) ? he : NULL; -#else - return (NULL); -#endif -} - -struct hostent * -_gethostbynisaddr(const void *addr, socklen_t len, int af) -{ -#ifdef YP - struct hostent *he; - struct hostent_data *hed; - u_long oresopt; - int error; - res_state statp; - - statp = __res_state(); - if ((he = __hostent_init()) == NULL || - (hed = __hostent_data_init()) == NULL) { - RES_SET_H_ERRNO(statp, NETDB_INTERNAL); - return (NULL); - } - - oresopt = statp->options; - statp->options &= ~RES_USE_INET6; - error = _gethostbynisaddr_r(addr, len, af, he, hed); - statp->options = oresopt; - return (error == 0) ? he : NULL; -#else - return (NULL); -#endif -} - int _nis_gethostbyname(void *rval, void *cb_data, va_list ap) { Modified: head/lib/libc/net/netdb_private.h ============================================================================== --- head/lib/libc/net/netdb_private.h Fri Dec 25 10:08:42 2015 (r292718) +++ head/lib/libc/net/netdb_private.h Fri Dec 25 10:49:40 2015 (r292719) @@ -133,8 +133,6 @@ void _endhostdnsent(void); void _endhosthtent(struct hostent_data *); void _endnetdnsent(void); void _endnethtent(struct netent_data *); -struct hostent *_gethostbynisaddr(const void *, socklen_t, int); -struct hostent *_gethostbynisname(const char *, int); void _map_v4v6_address(const char *, char *); void _map_v4v6_hostent(struct hostent *, char **, char *); void _sethostdnsent(int); From owner-svn-src-all@freebsd.org Fri Dec 25 10:53:31 2015 Return-Path: Delivered-To: svn-src-all@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 88424A502C9; Fri, 25 Dec 2015 10:53:31 +0000 (UTC) (envelope-from ume@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 6504712EE; Fri, 25 Dec 2015 10:53:31 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPArU4i050057; Fri, 25 Dec 2015 10:53:30 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPArUVB050056; Fri, 25 Dec 2015 10:53:30 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512251053.tBPArUVB050056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Fri, 25 Dec 2015 10:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292720 - stable/10/usr.sbin/ypserv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 10:53:31 -0000 Author: ume Date: Fri Dec 25 10:53:30 2015 New Revision: 292720 URL: https://svnweb.freebsd.org/changeset/base/292720 Log: MFC r292435, r292441: - Keep hosts.by{name,addr} IPv4 only. - Add comment how we handle hosts and ipnodes. - Generate ipnodes.by{addr,name} from /etc/hosts for compatibility with FreeBSD local name resolution. If /var/yp/ipnodes exists, we generate them from it for backward compatibility. Modified: stable/10/usr.sbin/ypserv/Makefile.yp Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ypserv/Makefile.yp ============================================================================== --- stable/10/usr.sbin/ypserv/Makefile.yp Fri Dec 25 10:49:40 2015 (r292719) +++ stable/10/usr.sbin/ypserv/Makefile.yp Fri Dec 25 10:53:30 2015 (r292720) @@ -141,6 +141,7 @@ target: # If you want to omit some of them, feel free to comment # them out from this list. TARGETS= servers hosts networks protocols rpc services shells group +TARGETS+= ipnodes #TARGETS+= aliases # Sanity checks: filter out targets we can't build @@ -193,10 +194,8 @@ TARGETS+= amd.map AMDHOST= /dev/null .endif -.if exists($(IPNODES)) -TARGETS+= ipnodes -.else -IPNODES= /dev/null +.if !exists($(IPNODES)) +IPNODES= $(HOSTS) .endif all: $(TARGETS) @@ -387,9 +386,22 @@ netgroup.byuser: $(NETGROUP) .endif +# Solaris 8 does the following: +# - /etc/hosts and hosts.{byname,byaddr} are IPv4 only. +# - /etc/inet/ipnodes and ipnodes.{byname,byaddr} are used for protocol +# independent name-to-address mapping. +# +# For local name resolution, we made /etc/hosts protocol independent. +# For NIS name resolution, we obey Solaris 8 practice. +# - We keep hosts.{byname,byaddr} IPv4 only, to be friendly with Solaris 8 +# clients. +# - ipnodes.{byname,byaddr} is used for protocol independent mapping. +# We generate all the mappings from /etc/hosts unless /var/yp/ipnodes +# exists, for compatibility with FreeBSD local name resolution. +# hosts.byname: $(HOSTS) @echo "Updating $@..." - @$(AWK) '/^[0-9]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ + @$(AWK) '/^[0-9.]+[\t ]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ print $$n"\t"$$0 }' $(HOSTS) | $(DBLOAD) ${B} -i $(HOSTS) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -399,7 +411,7 @@ hosts.byname: $(HOSTS) hosts.byaddr: $(HOSTS) @echo "Updating $@..." - @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(HOSTS) \ + @$(AWK) '/^[0-9.]+[\t ]/ { print $$1"\t"$$0 }' $(HOSTS) \ | $(DBLOAD) ${B} -i $(HOSTS) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -409,30 +421,22 @@ hosts.byaddr: $(HOSTS) ipnodes.byname: $(IPNODES) @echo "Updating $@..." -.if ${IPNODES} == "/dev/null" - @echo "Ipnodes source file not found -- skipping" -.else @$(AWK) '/^[0-9a-fA-F:]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ print $$n"\t"$$0 }' $(IPNODES) | $(DBLOAD) ${B} -i $(IPNODES) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi -.endif ipnodes.byaddr: $(IPNODES) @echo "Updating $@..." -.if ${IPNODES} == "/dev/null" - @echo "Ipnodes source file not found -- skipping" -.else @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(IPNODES) \ | $(DBLOAD) ${B} -i $(IPNODES) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi -.endif networks.byname: $(NETWORKS) From owner-svn-src-all@freebsd.org Fri Dec 25 10:55:41 2015 Return-Path: Delivered-To: svn-src-all@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 DD537A5042A; Fri, 25 Dec 2015 10:55:40 +0000 (UTC) (envelope-from ume@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 B875814C2; Fri, 25 Dec 2015 10:55:40 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPAtdlA050185; Fri, 25 Dec 2015 10:55:39 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPAtdQG050184; Fri, 25 Dec 2015 10:55:39 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512251055.tBPAtdQG050184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Fri, 25 Dec 2015 10:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292721 - stable/9/usr.sbin/ypserv X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 10:55:41 -0000 Author: ume Date: Fri Dec 25 10:55:39 2015 New Revision: 292721 URL: https://svnweb.freebsd.org/changeset/base/292721 Log: MFC r292435, r292441: - Keep hosts.by{name,addr} IPv4 only. - Add comment how we handle hosts and ipnodes. - Generate ipnodes.by{addr,name} from /etc/hosts for compatibility with FreeBSD local name resolution. If /var/yp/ipnodes exists, we generate them from it for backward compatibility. Modified: stable/9/usr.sbin/ypserv/Makefile.yp Directory Properties: stable/9/usr.sbin/ypserv/ (props changed) Modified: stable/9/usr.sbin/ypserv/Makefile.yp ============================================================================== --- stable/9/usr.sbin/ypserv/Makefile.yp Fri Dec 25 10:53:30 2015 (r292720) +++ stable/9/usr.sbin/ypserv/Makefile.yp Fri Dec 25 10:55:39 2015 (r292721) @@ -140,6 +140,7 @@ target: # If you want to omit some of them, feel free to comment # them out from this list. TARGETS= servers hosts networks protocols rpc services shells group +TARGETS+= ipnodes #TARGETS+= aliases # Sanity checks: filter out targets we can't build @@ -186,10 +187,8 @@ TARGETS+= amd.map AMDHOST= /dev/null .endif -.if exists($(IPNODES)) -TARGETS+= ipnodes -.else -IPNODES= /dev/null +.if !exists($(IPNODES)) +IPNODES= $(HOSTS) .endif all: $(TARGETS) @@ -353,9 +352,22 @@ netgroup.byuser: $(NETGROUP) .endif +# Solaris 8 does the following: +# - /etc/hosts and hosts.{byname,byaddr} are IPv4 only. +# - /etc/inet/ipnodes and ipnodes.{byname,byaddr} are used for protocol +# independent name-to-address mapping. +# +# For local name resolution, we made /etc/hosts protocol independent. +# For NIS name resolution, we obey Solaris 8 practice. +# - We keep hosts.{byname,byaddr} IPv4 only, to be friendly with Solaris 8 +# clients. +# - ipnodes.{byname,byaddr} is used for protocol independent mapping. +# We generate all the mappings from /etc/hosts unless /var/yp/ipnodes +# exists, for compatibility with FreeBSD local name resolution. +# hosts.byname: $(HOSTS) @echo "Updating $@..." - @$(AWK) '/^[0-9]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ + @$(AWK) '/^[0-9.]+[\t ]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ print $$n"\t"$$0 }' $(HOSTS) | $(DBLOAD) ${B} -i $(HOSTS) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -365,7 +377,7 @@ hosts.byname: $(HOSTS) hosts.byaddr: $(HOSTS) @echo "Updating $@..." - @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(HOSTS) \ + @$(AWK) '/^[0-9.]+[\t ]/ { print $$1"\t"$$0 }' $(HOSTS) \ | $(DBLOAD) ${B} -i $(HOSTS) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @@ -375,30 +387,22 @@ hosts.byaddr: $(HOSTS) ipnodes.byname: $(IPNODES) @echo "Updating $@..." -.if ${IPNODES} == "/dev/null" - @echo "Ipnodes source file not found -- skipping" -.else @$(AWK) '/^[0-9a-fA-F:]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ print $$n"\t"$$0 }' $(IPNODES) | $(DBLOAD) ${B} -i $(IPNODES) \ -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi -.endif ipnodes.byaddr: $(IPNODES) @echo "Updating $@..." -.if ${IPNODES} == "/dev/null" - @echo "Ipnodes source file not found -- skipping" -.else @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(IPNODES) \ | $(DBLOAD) ${B} -i $(IPNODES) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi -.endif networks.byname: $(NETWORKS) From owner-svn-src-all@freebsd.org Fri Dec 25 11:17:23 2015 Return-Path: Delivered-To: svn-src-all@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 55326A5094E; Fri, 25 Dec 2015 11:17:23 +0000 (UTC) (envelope-from ume@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 1340A1C29; Fri, 25 Dec 2015 11:17:23 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPBHMOD055814; Fri, 25 Dec 2015 11:17:22 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPBHLHo055811; Fri, 25 Dec 2015 11:17:21 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512251117.tBPBHLHo055811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Fri, 25 Dec 2015 11:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292722 - in stable/10: include lib/libc/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 11:17:23 -0000 Author: ume Date: Fri Dec 25 11:17:21 2015 New Revision: 292722 URL: https://svnweb.freebsd.org/changeset/base/292722 Log: Add AI_V4MAPPED and AI_ALL support for getaddrinfo(3). PR: 198092 Modified: stable/10/include/netdb.h stable/10/lib/libc/net/getaddrinfo.3 stable/10/lib/libc/net/getaddrinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/include/netdb.h ============================================================================== --- stable/10/include/netdb.h Fri Dec 25 10:55:39 2015 (r292721) +++ stable/10/include/netdb.h Fri Dec 25 11:17:21 2015 (r292722) @@ -179,7 +179,7 @@ struct addrinfo { /* valid flags for addrinfo (not a standard def, apps should not use it) */ #define AI_MASK \ (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \ - AI_ADDRCONFIG) + AI_ADDRCONFIG | AI_ALL | AI_V4MAPPED) #define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */ #define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */ Modified: stable/10/lib/libc/net/getaddrinfo.3 ============================================================================== --- stable/10/lib/libc/net/getaddrinfo.3 Fri Dec 25 10:55:39 2015 (r292721) +++ stable/10/lib/libc/net/getaddrinfo.3 Fri Dec 25 11:17:21 2015 (r292722) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2015 +.Dd December 19, 2015 .Dt GETADDRINFO 3 .Os .Sh NAME @@ -126,11 +126,13 @@ field to which the parameter points shall be set to zero or be the bitwise-inclusive OR of one or more of the values .Dv AI_ADDRCONFIG , +.Dv AI_ALL , .Dv AI_CANONNAME , .Dv AI_NUMERICHOST , -.Dv AI_NUMERICSERV +.Dv AI_NUMERICSERV , +.Dv AI_PASSIVE and -.Dv AI_PASSIVE . +.Dv AI_V4MAPPED . .Bl -tag -width "AI_CANONNAMEXX" .It Dv AI_ADDRCONFIG If the @@ -139,6 +141,25 @@ bit is set, IPv4 addresses shall be retu an IPv4 address is configured on the local system, and IPv6 addresses shall be returned only if an IPv6 address is configured on the local system. +.It Dv AI_ALL +If the +.Dv AI_ALL +flag is used with the +.Dv AI_V4MAPPED +flag, then +.Fn getaddrinfo +shall return all matching IPv6 and IPv4 addresses. +.Pp +For example, when using the DNS, queries are made for both AAAA records and A records, and +.Fn getaddrinfo +returns the combined results of both queries. +Any IPv4 addresses found are returned as IPv4-mapped IPv6 addresses. +.Pp +The +.Dv AI_ALL +flag without the +.Dv AI_V4MAPPED +flag is ignored. .It Dv AI_CANONNAME If the .Dv AI_CANONNAME @@ -203,6 +224,25 @@ loopback address if is the null pointer and .Dv AI_PASSIVE is not set. +.It Dv AI_V4MAPPED +If the +.Dv AI_V4MAPPED +flag is specified along with an ai_family of +.Dv AF_INET6 , +then +.Fn getaddrinfo +shall return IPv4-mapped IPv6 addresses on finding no matching IPv6 addresses ( +.Fa ai_addrlen +shall be 16). +.Pp +For example, when using the DNS, if no AAAA records are found then a query is made for A records and any found are returned as IPv4-mapped IPv6 addresses. +.Pp +The +.Dv AI_V4MAPPED +flag shall be ignored unless +.Fa ai_family +equals +.Dv AF_INET6 . .El .El .Pp Modified: stable/10/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/10/lib/libc/net/getaddrinfo.c Fri Dec 25 10:55:39 2015 (r292721) +++ stable/10/lib/libc/net/getaddrinfo.c Fri Dec 25 11:17:21 2015 (r292722) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "netdb_private.h" #include "libc_private.h" #ifdef NS_CACHING #include "nscache.h" @@ -451,6 +452,24 @@ getaddrinfo(const char *hostname, const } /* + * RFC 3493: AI_ALL and AI_V4MAPPED are effective only against + * AF_INET6 query. They need to be ignored if specified in other + * occassions. + */ + switch (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) { + case AI_V4MAPPED: + case AI_ALL | AI_V4MAPPED: +#ifdef INET6 + if (pai->ai_family != AF_INET6) + pai->ai_flags &= ~(AI_ALL | AI_V4MAPPED); + break; +#endif + case AI_ALL: + pai->ai_flags &= ~(AI_ALL | AI_V4MAPPED); + break; + } + + /* * check for special cases. (1) numeric servname is disallowed if * socktype/protocol are left unspecified. (2) servname is disallowed * for raw and other inet{,6} sockets. @@ -842,6 +861,16 @@ set_source(struct ai_order *aio, struct if ((s = _socket(ai.ai_family, ai.ai_socktype | SOCK_CLOEXEC, ai.ai_protocol)) < 0) return; /* give up */ +#ifdef INET6 + if (ai.ai_family == AF_INET6) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)ai.ai_addr; + int off = 0; + + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) + (void)_setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, + (char *)&off, sizeof(off)); + } +#endif if (_connect(s, ai.ai_addr, ai.ai_addrlen) < 0) goto cleanup; srclen = ai.ai_addrlen; @@ -1177,7 +1206,7 @@ explore_numeric(const struct addrinfo *p const char *servname, struct addrinfo **res, const char *canonname) { const struct afd *afd; - struct addrinfo *ai; + struct addrinfo *ai, ai0; int error; char pton[PTON_MAX]; @@ -1201,8 +1230,17 @@ explore_numeric(const struct addrinfo *p return 0; break; default: - if (inet_pton(afd->a_af, hostname, pton) != 1) - return 0; + if (inet_pton(afd->a_af, hostname, pton) != 1) { + if (pai->ai_family != AF_INET6 || + (pai->ai_flags & AI_V4MAPPED) != AI_V4MAPPED) + return 0; + if (inet_aton(hostname, (struct in_addr *)pton) != 1) + return 0; + afd = &afdl[N_INET]; + ai0 = *pai; + ai0.ai_family = AF_INET; + pai = &ai0; + } break; } @@ -1321,6 +1359,9 @@ get_ai(const struct addrinfo *pai, const char *fp_str; int translate = 0; #endif +#ifdef INET6 + struct in6_addr mapaddr; +#endif #ifdef FAITH /* @@ -1358,6 +1399,14 @@ get_ai(const struct addrinfo *pai, const } #endif +#ifdef INET6 + if (afd->a_af == AF_INET && (pai->ai_flags & AI_V4MAPPED) != 0) { + afd = &afdl[N_INET6]; + _map_v4v6_address(addr, (char *)&mapaddr); + addr = (char *)&mapaddr; + } +#endif + ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) + (afd->a_socklen)); if (ai == NULL) @@ -2191,7 +2240,7 @@ addr4sort(struct addrinfo *sentinel, res static int _dns_getaddrinfo(void *rv, void *cb_data, va_list ap) { - struct addrinfo *ai; + struct addrinfo *ai, ai0; querybuf *buf, *buf2; const char *hostname; const struct addrinfo *pai; @@ -2221,6 +2270,13 @@ _dns_getaddrinfo(void *rv, void *cb_data return NS_NOTFOUND; } + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) { + ai0 = *pai; + ai0.ai_family = AF_UNSPEC; + pai = &ai0; + } + switch (pai->ai_family) { case AF_UNSPEC: q.name = hostname; @@ -2276,9 +2332,12 @@ _dns_getaddrinfo(void *rv, void *cb_data cur = cur->ai_next; } } - ai = getanswer(buf, q.n, q.name, q.qtype, pai, res); - if (ai) - cur->ai_next = ai; + if (!ai || pai->ai_family != AF_UNSPEC || + (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) != AI_V4MAPPED) { + ai = getanswer(buf, q.n, q.name, q.qtype, pai, res); + if (ai) + cur->ai_next = ai; + } free(buf); free(buf2); if (sentinel.ai_next == NULL) @@ -2360,6 +2419,9 @@ found: hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = 0; hints.ai_flags = AI_NUMERICHOST; + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) + hints.ai_flags |= AI_V4MAPPED; error = getaddrinfo(addr, "0", &hints, &res0); if (error) goto again; @@ -2387,6 +2449,20 @@ found: return res0; } +static struct addrinfo * +_getht(FILE **hostf, const char *name, const struct addrinfo *pai, + struct addrinfo *cur) +{ + struct addrinfo *p; + + while ((p = _gethtent(hostf, name, pai)) != NULL) { + cur->ai_next = p; + while (cur && cur->ai_next) + cur = cur->ai_next; + } + return (cur); +} + /*ARGSUSED*/ static int _files_getaddrinfo(void *rv, void *cb_data, va_list ap) @@ -2394,7 +2470,6 @@ _files_getaddrinfo(void *rv, void *cb_da const char *name; const struct addrinfo *pai; struct addrinfo sentinel, *cur; - struct addrinfo *p; FILE *hostf = NULL; name = va_arg(ap, char *); @@ -2404,11 +2479,19 @@ _files_getaddrinfo(void *rv, void *cb_da cur = &sentinel; _sethtent(&hostf); - while ((p = _gethtent(&hostf, name, pai)) != NULL) { - cur->ai_next = p; - while (cur && cur->ai_next) - cur = cur->ai_next; - } + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) == AI_V4MAPPED) { + struct addrinfo ai0 = *pai; + + ai0.ai_flags &= ~AI_V4MAPPED; + cur = _getht(&hostf, name, &ai0, cur); + if (sentinel.ai_next == NULL) { + _sethtent(&hostf); + ai0.ai_flags |= AI_V4MAPPED; + cur = _getht(&hostf, name, &ai0, cur); + } + } else + cur = _getht(&hostf, name, pai, cur); _endhtent(&hostf); *((struct addrinfo **)rv) = sentinel.ai_next; @@ -2468,6 +2551,9 @@ nextline: hints = *pai; hints.ai_flags = AI_NUMERICHOST; + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) + hints.ai_flags |= AI_V4MAPPED; error = getaddrinfo(addr, NULL, &hints, &res0); if (error == 0) { for (res = res0; res; res = res->ai_next) { @@ -2515,15 +2601,46 @@ _yp_getaddrinfo(void *rv, void *cb_data, memset(&sentinel, 0, sizeof(sentinel)); cur = &sentinel; + /* ipnodes.byname can hold both IPv4/v6 */ + r = yp_match(ypdomain, "ipnodes.byname", name, + (int)strlen(name), &ypbuf, &ypbuflen); + if (r == 0) { + ai = _yphostent(ypbuf, pai); + if (ai) { + cur->ai_next = ai; + while (cur && cur->ai_next) + cur = cur->ai_next; + } + free(ypbuf); + } + + if (ai != NULL) { + struct sockaddr_in6 *sin6; + + switch (ai->ai_family) { + case AF_INET: + goto done; + case AF_INET6: + sin6 = (struct sockaddr_in6 *)ai->ai_addr; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) + goto done; + break; + } + } + /* hosts.byname is only for IPv4 (Solaris8) */ - if (pai->ai_family == PF_UNSPEC || pai->ai_family == PF_INET) { + if (pai->ai_family == AF_UNSPEC || pai->ai_family == AF_INET || + ((pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) && + (ai == NULL || (pai->ai_flags & AI_ALL) == AI_ALL))) { r = yp_match(ypdomain, "hosts.byname", name, (int)strlen(name), &ypbuf, &ypbuflen); if (r == 0) { struct addrinfo ai4; ai4 = *pai; - ai4.ai_family = AF_INET; + if (pai->ai_family == AF_UNSPEC) + ai4.ai_family = AF_INET; ai = _yphostent(ypbuf, &ai4); if (ai) { cur->ai_next = ai; @@ -2534,16 +2651,7 @@ _yp_getaddrinfo(void *rv, void *cb_data, } } - /* ipnodes.byname can hold both IPv4/v6 */ - r = yp_match(ypdomain, "ipnodes.byname", name, - (int)strlen(name), &ypbuf, &ypbuflen); - if (r == 0) { - ai = _yphostent(ypbuf, pai); - if (ai) - cur->ai_next = ai; - free(ypbuf); - } - +done: if (sentinel.ai_next == NULL) { RES_SET_H_ERRNO(__res_state(), HOST_NOT_FOUND); return NS_NOTFOUND; From owner-svn-src-all@freebsd.org Fri Dec 25 11:29:19 2015 Return-Path: Delivered-To: svn-src-all@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 BF722A50D32; Fri, 25 Dec 2015 11:29:19 +0000 (UTC) (envelope-from cperciva@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 8F0831FDE; Fri, 25 Dec 2015 11:29:19 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPBTIOC058827; Fri, 25 Dec 2015 11:29:18 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPBTIZp058825; Fri, 25 Dec 2015 11:29:18 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201512251129.tBPBTIZp058825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Fri, 25 Dec 2015 11:29:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292723 - in head: lib/libc share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 11:29:19 -0000 Author: cperciva Date: Fri Dec 25 11:29:18 2015 New Revision: 292723 URL: https://svnweb.freebsd.org/changeset/base/292723 Log: Make libxnet.so a symlink to libc.so. This makes `-lxnet` a no-op, as POSIX requires for the c99 compiler. (In fact, our c99(1) already ignores -lxnet; but our make(1) doesn't set ${CC} correctly, and our cc(1) treats xnet like any other library.) Reviewed by: kib Modified: head/lib/libc/Makefile head/share/mk/bsd.lib.mk Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Fri Dec 25 11:17:21 2015 (r292722) +++ head/lib/libc/Makefile Fri Dec 25 11:29:18 2015 (r292723) @@ -26,6 +26,7 @@ LIBC_ARCH=${MACHINE_CPUARCH} LIB=c SHLIB_MAJOR= 7 SHLIB_LDSCRIPT=libc.ldscript +SHLIB_LDSCRIPT_LINKS=libxnet.so WARNS?= 2 CFLAGS+=-I${LIBC_SRCTOP}/include -I${LIBC_SRCTOP}/../../include CFLAGS+=-I${LIBC_SRCTOP}/${LIBC_ARCH} Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Fri Dec 25 11:17:21 2015 (r292722) +++ head/share/mk/bsd.lib.mk Fri Dec 25 11:29:18 2015 (r292723) @@ -368,6 +368,9 @@ _libinstall: ${INSTALL} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} +.for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS} + ${INSTALL_SYMLINK} ${SHLIB_LINK} ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK} +.endfor .else .if ${_SHLIBDIR} == ${_LIBDIR} ${INSTALL_SYMLINK} ${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} From owner-svn-src-all@freebsd.org Fri Dec 25 11:33:10 2015 Return-Path: Delivered-To: svn-src-all@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 B1C48A50F89; Fri, 25 Dec 2015 11:33:10 +0000 (UTC) (envelope-from ume@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 7200814BE; Fri, 25 Dec 2015 11:33:10 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPBX90T061778; Fri, 25 Dec 2015 11:33:09 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPBX9Hk061775; Fri, 25 Dec 2015 11:33:09 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512251133.tBPBX9Hk061775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Fri, 25 Dec 2015 11:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292724 - in stable/9: include lib/libc/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 11:33:10 -0000 Author: ume Date: Fri Dec 25 11:33:09 2015 New Revision: 292724 URL: https://svnweb.freebsd.org/changeset/base/292724 Log: MFC r292444, r292446: Add AI_V4MAPPED and AI_ALL support for getaddrinfo(3). PR: 198092 Modified: stable/9/include/netdb.h stable/9/lib/libc/net/getaddrinfo.3 stable/9/lib/libc/net/getaddrinfo.c Directory Properties: stable/9/include/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/include/netdb.h ============================================================================== --- stable/9/include/netdb.h Fri Dec 25 11:29:18 2015 (r292723) +++ stable/9/include/netdb.h Fri Dec 25 11:33:09 2015 (r292724) @@ -179,7 +179,7 @@ struct addrinfo { /* valid flags for addrinfo (not a standard def, apps should not use it) */ #define AI_MASK \ (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \ - AI_ADDRCONFIG) + AI_ADDRCONFIG | AI_ALL | AI_V4MAPPED) #define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */ #define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */ Modified: stable/9/lib/libc/net/getaddrinfo.3 ============================================================================== --- stable/9/lib/libc/net/getaddrinfo.3 Fri Dec 25 11:29:18 2015 (r292723) +++ stable/9/lib/libc/net/getaddrinfo.3 Fri Dec 25 11:33:09 2015 (r292724) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 2013 +.Dd December 19, 2015 .Dt GETADDRINFO 3 .Os .Sh NAME @@ -126,11 +126,13 @@ field to which the parameter points shall be set to zero or be the bitwise-inclusive OR of one or more of the values .Dv AI_ADDRCONFIG , +.Dv AI_ALL , .Dv AI_CANONNAME , .Dv AI_NUMERICHOST , -.Dv AI_NUMERICSERV +.Dv AI_NUMERICSERV , +.Dv AI_PASSIVE and -.Dv AI_PASSIVE . +.Dv AI_V4MAPPED . .Bl -tag -width "AI_CANONNAMEXX" .It Dv AI_ADDRCONFIG If the @@ -139,6 +141,25 @@ bit is set, IPv4 addresses shall be retu an IPv4 address is configured on the local system, and IPv6 addresses shall be returned only if an IPv6 address is configured on the local system. +.It Dv AI_ALL +If the +.Dv AI_ALL +flag is used with the +.Dv AI_V4MAPPED +flag, then +.Fn getaddrinfo +shall return all matching IPv6 and IPv4 addresses. +.Pp +For example, when using the DNS, queries are made for both AAAA records and A records, and +.Fn getaddrinfo +returns the combined results of both queries. +Any IPv4 addresses found are returned as IPv4-mapped IPv6 addresses. +.Pp +The +.Dv AI_ALL +flag without the +.Dv AI_V4MAPPED +flag is ignored. .It Dv AI_CANONNAME If the .Dv AI_CANONNAME @@ -203,6 +224,25 @@ loopback address if is the null pointer and .Dv AI_PASSIVE is not set. +.It Dv AI_V4MAPPED +If the +.Dv AI_V4MAPPED +flag is specified along with an ai_family of +.Dv AF_INET6 , +then +.Fn getaddrinfo +shall return IPv4-mapped IPv6 addresses on finding no matching IPv6 addresses ( +.Fa ai_addrlen +shall be 16). +.Pp +For example, when using the DNS, if no AAAA records are found then a query is made for A records and any found are returned as IPv4-mapped IPv6 addresses. +.Pp +The +.Dv AI_V4MAPPED +flag shall be ignored unless +.Fa ai_family +equals +.Dv AF_INET6 . .El .El .Pp Modified: stable/9/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/9/lib/libc/net/getaddrinfo.c Fri Dec 25 11:29:18 2015 (r292723) +++ stable/9/lib/libc/net/getaddrinfo.c Fri Dec 25 11:33:09 2015 (r292724) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "netdb_private.h" #include "libc_private.h" #ifdef NS_CACHING #include "nscache.h" @@ -450,6 +451,24 @@ getaddrinfo(const char *hostname, const } /* + * RFC 3493: AI_ALL and AI_V4MAPPED are effective only against + * AF_INET6 query. They need to be ignored if specified in other + * occassions. + */ + switch (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) { + case AI_V4MAPPED: + case AI_ALL | AI_V4MAPPED: +#ifdef INET6 + if (pai->ai_family != AF_INET6) + pai->ai_flags &= ~(AI_ALL | AI_V4MAPPED); + break; +#endif + case AI_ALL: + pai->ai_flags &= ~(AI_ALL | AI_V4MAPPED); + break; + } + + /* * check for special cases. (1) numeric servname is disallowed if * socktype/protocol are left unspecified. (2) servname is disallowed * for raw and other inet{,6} sockets. @@ -840,6 +859,16 @@ set_source(struct ai_order *aio, struct /* open a socket to get the source address for the given dst */ if ((s = _socket(ai.ai_family, ai.ai_socktype, ai.ai_protocol)) < 0) return; /* give up */ +#ifdef INET6 + if (ai.ai_family == AF_INET6) { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)ai.ai_addr; + int off = 0; + + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) + (void)_setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, + (char *)&off, sizeof(off)); + } +#endif if (_connect(s, ai.ai_addr, ai.ai_addrlen) < 0) goto cleanup; srclen = ai.ai_addrlen; @@ -1175,7 +1204,7 @@ explore_numeric(const struct addrinfo *p const char *servname, struct addrinfo **res, const char *canonname) { const struct afd *afd; - struct addrinfo *ai; + struct addrinfo *ai, ai0; int error; char pton[PTON_MAX]; @@ -1199,8 +1228,17 @@ explore_numeric(const struct addrinfo *p return 0; break; default: - if (inet_pton(afd->a_af, hostname, pton) != 1) - return 0; + if (inet_pton(afd->a_af, hostname, pton) != 1) { + if (pai->ai_family != AF_INET6 || + (pai->ai_flags & AI_V4MAPPED) != AI_V4MAPPED) + return 0; + if (inet_aton(hostname, (struct in_addr *)pton) != 1) + return 0; + afd = &afdl[N_INET]; + ai0 = *pai; + ai0.ai_family = AF_INET; + pai = &ai0; + } break; } @@ -1319,6 +1357,9 @@ get_ai(const struct addrinfo *pai, const char *fp_str; int translate = 0; #endif +#ifdef INET6 + struct in6_addr mapaddr; +#endif #ifdef FAITH /* @@ -1356,6 +1397,14 @@ get_ai(const struct addrinfo *pai, const } #endif +#ifdef INET6 + if (afd->a_af == AF_INET && (pai->ai_flags & AI_V4MAPPED) != 0) { + afd = &afdl[N_INET6]; + _map_v4v6_address(addr, (char *)&mapaddr); + addr = (char *)&mapaddr; + } +#endif + ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) + (afd->a_socklen)); if (ai == NULL) @@ -2186,7 +2235,7 @@ addr4sort(struct addrinfo *sentinel, res static int _dns_getaddrinfo(void *rv, void *cb_data, va_list ap) { - struct addrinfo *ai; + struct addrinfo *ai, ai0; querybuf *buf, *buf2; const char *hostname; const struct addrinfo *pai; @@ -2216,6 +2265,13 @@ _dns_getaddrinfo(void *rv, void *cb_data return NS_NOTFOUND; } + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) { + ai0 = *pai; + ai0.ai_family = AF_UNSPEC; + pai = &ai0; + } + switch (pai->ai_family) { case AF_UNSPEC: q.name = hostname; @@ -2271,9 +2327,12 @@ _dns_getaddrinfo(void *rv, void *cb_data cur = cur->ai_next; } } - ai = getanswer(buf, q.n, q.name, q.qtype, pai, res); - if (ai) - cur->ai_next = ai; + if (!ai || pai->ai_family != AF_UNSPEC || + (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) != AI_V4MAPPED) { + ai = getanswer(buf, q.n, q.name, q.qtype, pai, res); + if (ai) + cur->ai_next = ai; + } free(buf); free(buf2); if (sentinel.ai_next == NULL) @@ -2355,6 +2414,9 @@ found: hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = 0; hints.ai_flags = AI_NUMERICHOST; + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) + hints.ai_flags |= AI_V4MAPPED; error = getaddrinfo(addr, "0", &hints, &res0); if (error) goto again; @@ -2382,6 +2444,20 @@ found: return res0; } +static struct addrinfo * +_getht(FILE **hostf, const char *name, const struct addrinfo *pai, + struct addrinfo *cur) +{ + struct addrinfo *p; + + while ((p = _gethtent(hostf, name, pai)) != NULL) { + cur->ai_next = p; + while (cur && cur->ai_next) + cur = cur->ai_next; + } + return (cur); +} + /*ARGSUSED*/ static int _files_getaddrinfo(void *rv, void *cb_data, va_list ap) @@ -2389,7 +2465,6 @@ _files_getaddrinfo(void *rv, void *cb_da const char *name; const struct addrinfo *pai; struct addrinfo sentinel, *cur; - struct addrinfo *p; FILE *hostf = NULL; name = va_arg(ap, char *); @@ -2399,11 +2474,19 @@ _files_getaddrinfo(void *rv, void *cb_da cur = &sentinel; _sethtent(&hostf); - while ((p = _gethtent(&hostf, name, pai)) != NULL) { - cur->ai_next = p; - while (cur && cur->ai_next) - cur = cur->ai_next; - } + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) == AI_V4MAPPED) { + struct addrinfo ai0 = *pai; + + ai0.ai_flags &= ~AI_V4MAPPED; + cur = _getht(&hostf, name, &ai0, cur); + if (sentinel.ai_next == NULL) { + _sethtent(&hostf); + ai0.ai_flags |= AI_V4MAPPED; + cur = _getht(&hostf, name, &ai0, cur); + } + } else + cur = _getht(&hostf, name, pai, cur); _endhtent(&hostf); *((struct addrinfo **)rv) = sentinel.ai_next; @@ -2463,6 +2546,9 @@ nextline: hints = *pai; hints.ai_flags = AI_NUMERICHOST; + if (pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) + hints.ai_flags |= AI_V4MAPPED; error = getaddrinfo(addr, NULL, &hints, &res0); if (error == 0) { for (res = res0; res; res = res->ai_next) { @@ -2510,15 +2596,46 @@ _yp_getaddrinfo(void *rv, void *cb_data, memset(&sentinel, 0, sizeof(sentinel)); cur = &sentinel; + /* ipnodes.byname can hold both IPv4/v6 */ + r = yp_match(ypdomain, "ipnodes.byname", name, + (int)strlen(name), &ypbuf, &ypbuflen); + if (r == 0) { + ai = _yphostent(ypbuf, pai); + if (ai) { + cur->ai_next = ai; + while (cur && cur->ai_next) + cur = cur->ai_next; + } + free(ypbuf); + } + + if (ai != NULL) { + struct sockaddr_in6 *sin6; + + switch (ai->ai_family) { + case AF_INET: + goto done; + case AF_INET6: + sin6 = (struct sockaddr_in6 *)ai->ai_addr; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) + goto done; + break; + } + } + /* hosts.byname is only for IPv4 (Solaris8) */ - if (pai->ai_family == PF_UNSPEC || pai->ai_family == PF_INET) { + if (pai->ai_family == AF_UNSPEC || pai->ai_family == AF_INET || + ((pai->ai_family == AF_INET6 && + (pai->ai_flags & AI_V4MAPPED) == AI_V4MAPPED) && + (ai == NULL || (pai->ai_flags & AI_ALL) == AI_ALL))) { r = yp_match(ypdomain, "hosts.byname", name, (int)strlen(name), &ypbuf, &ypbuflen); if (r == 0) { struct addrinfo ai4; ai4 = *pai; - ai4.ai_family = AF_INET; + if (pai->ai_family == AF_UNSPEC) + ai4.ai_family = AF_INET; ai = _yphostent(ypbuf, &ai4); if (ai) { cur->ai_next = ai; @@ -2529,16 +2646,7 @@ _yp_getaddrinfo(void *rv, void *cb_data, } } - /* ipnodes.byname can hold both IPv4/v6 */ - r = yp_match(ypdomain, "ipnodes.byname", name, - (int)strlen(name), &ypbuf, &ypbuflen); - if (r == 0) { - ai = _yphostent(ypbuf, pai); - if (ai) - cur->ai_next = ai; - free(ypbuf); - } - +done: if (sentinel.ai_next == NULL) { RES_SET_H_ERRNO(__res_state(), HOST_NOT_FOUND); return NS_NOTFOUND; From owner-svn-src-all@freebsd.org Fri Dec 25 11:49:14 2015 Return-Path: Delivered-To: svn-src-all@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 96140A51362; Fri, 25 Dec 2015 11:49:14 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-ig0-x234.google.com (mail-ig0-x234.google.com [IPv6:2607:f8b0:4001:c05::234]) (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 7252F1AE0; Fri, 25 Dec 2015 11:49:14 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-ig0-x234.google.com with SMTP id to18so107907128igc.0; Fri, 25 Dec 2015 03:49:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=8Li5nF7FB1fR/MCIa+Eq69alWmHkkwaJ9RRZfk0DR70=; b=LzKO1h8kABaONvytVWW6DC14MH1+I4obb9MaKmjnXhft9BJ2Q7+c99siIKuzzv5Q6r BEZIN9dqGC8E0jfu3PODTqcQGNxaUBR+Ip6jEY+uh4+ZB+TQk9tsXBcDLX3DS7wDgzJG c+3VJI/eJ+LAyMmiV23tLz12CNV9zlK2I5OJjzJiwj7R6JiZQyJjYpD33RFhJI3nWkem vy6jwVVKu8o3pzuVpN1iJ6mHe7CLdDgUr9gVW+hwNy4G2XsJBjm58Cuswq+jlQG1cEj7 rpAd1hoS+kAnt0PyCM3N9YiX7jtf8rSOYacjGM+hODNWjXjkbbeQVW4x/SzzTSp5o/uq S1Xw== MIME-Version: 1.0 X-Received: by 10.50.18.113 with SMTP id v17mr22842230igd.64.1451044153633; Fri, 25 Dec 2015 03:49:13 -0800 (PST) Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.167.204 with HTTP; Fri, 25 Dec 2015 03:49:13 -0800 (PST) In-Reply-To: <201512220803.tBM83NQ2001422@repo.freebsd.org> References: <201512220803.tBM83NQ2001422@repo.freebsd.org> Date: Fri, 25 Dec 2015 11:49:13 +0000 X-Google-Sender-Auth: W1SS3ZEswMWaSJ8ESrQu3FSpCrk Message-ID: Subject: Re: svn commit: r292588 - in stable/10: . contrib/xz contrib/xz/src/common contrib/xz/src/liblzma contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/... From: Antoine Brodin To: Xin LI Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 11:49:14 -0000 On Tue, Dec 22, 2015 at 8:03 AM, Xin LI wrote: > Author: delphij > Date: Tue Dec 22 08:03:23 2015 > New Revision: 292588 > URL: https://svnweb.freebsd.org/changeset/base/292588 > > Log: > MFC: xz 5.2.2. > > Relnotes: yes Hi, This broke ports using liblzma on amd64 (lib32 in liblzma.pc). > cat usr/libdata/pkgconfig/liblzma.pc # # Author: Lasse Collin # # This file has been put into the public domain. # You can do whatever you want with this file. # prefix=/usr exec_prefix=/usr libdir=/usr/lib32 includedir=/usr/include Name: liblzma Description: General purpose data compression library URL: http://tukaani.org/xz/ Version: 5.2.2 Cflags: -I${includedir} Libs: -L${libdir} -llzma Libs.private: @LIBS@ Cheers, Antoine From owner-svn-src-all@freebsd.org Fri Dec 25 13:03:20 2015 Return-Path: Delivered-To: svn-src-all@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 6C6EDA52B3E; Fri, 25 Dec 2015 13:03:20 +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 2BFED1AFE; Fri, 25 Dec 2015 13:03:20 +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 tBPD3J0D088553; Fri, 25 Dec 2015 13:03:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPD3I2O088546; Fri, 25 Dec 2015 13:03:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512251303.tBPD3I2O088546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 25 Dec 2015 13:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292725 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 13:03:20 -0000 Author: mav Date: Fri Dec 25 13:03:18 2015 New Revision: 292725 URL: https://svnweb.freebsd.org/changeset/base/292725 Log: Unify handles allocation for initiator and target IOCBs. I am not sure why this was split long ago, but I see no reason for it. At this point this unification just slightly reduces memory usage, but as next step I plan to reuse shared handle space for other IOCB types. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_library.c head/sys/dev/isp/isp_library.h head/sys/dev/isp/isp_pci.c head/sys/dev/isp/isp_target.c head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Fri Dec 25 11:33:09 2015 (r292724) +++ head/sys/dev/isp/isp.c Fri Dec 25 13:03:18 2015 (r292725) @@ -4269,7 +4269,7 @@ int isp_start(XS_T *xs) { ispsoftc_t *isp; - uint32_t handle, cdblen; + uint32_t cdblen; uint8_t local[QENTRY_LEN]; ispreq_t *reqp; void *cdbp, *qep; @@ -4565,13 +4565,13 @@ isp_start(XS_T *xs) *tptr = 0x1999; } - if (isp_allocate_xs(isp, xs, &handle)) { + /* Whew. Thankfully the same for type 7 requests */ + reqp->req_handle = isp_allocate_handle(isp, xs, ISP_HANDLE_INITIATOR); + if (reqp->req_handle == 0) { isp_prt(isp, ISP_LOG_WARN1, "out of xflist pointers"); XS_SETERR(xs, HBA_BOTCH); return (CMD_EAGAIN); } - /* Whew. Thankfully the same for type 7 requests */ - reqp->req_handle = handle; /* * Set up DMA and/or do any platform dependent swizzling of the request entry @@ -4581,7 +4581,7 @@ isp_start(XS_T *xs) */ dmaresult = ISP_DMASETUP(isp, xs, reqp); if (dmaresult != CMD_QUEUED) { - isp_destroy_handle(isp, handle); + isp_destroy_handle(isp, reqp->req_handle); /* * dmasetup sets actual error in packet, and * return what we were given to return. @@ -5310,12 +5310,6 @@ again: } } - if (!ISP_VALID_HANDLE(isp, sp->req_handle)) { - isp_prt(isp, ISP_LOGERR, "bad request handle 0x%x (iocb type 0x%x)", sp->req_handle, etype); - ISP_MEMZERO(hp, QENTRY_LEN); /* PERF */ - last_etype = etype; - continue; - } xs = isp_find_xs(isp, sp->req_handle); if (xs == NULL) { uint8_t ts = completion_status & 0xff; Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Fri Dec 25 11:33:09 2015 (r292724) +++ head/sys/dev/isp/isp_freebsd.c Fri Dec 25 13:03:18 2015 (r292725) @@ -1694,7 +1694,8 @@ isp_target_start_ctio(ispsoftc_t *isp, u TAILQ_INSERT_HEAD(&tptr->waitq, &ccb->ccb_h, periph_links.tqe); break; } - if (isp_allocate_xs_tgt(isp, ccb, &handle)) { + handle = isp_allocate_handle(isp, ccb, ISP_HANDLE_TARGET); + if (handle == 0) { ISP_PATH_PRT(isp, ISP_LOGWARN, ccb->ccb_h.path, "No XFLIST pointers for %s\n", __func__); TAILQ_INSERT_HEAD(&tptr->waitq, &ccb->ccb_h, periph_links.tqe); isp_free_pcmd(isp, ccb); @@ -1723,7 +1724,7 @@ isp_target_start_ctio(ispsoftc_t *isp, u dmaresult = ISP_DMASETUP(isp, cso, (ispreq_t *) local); if (dmaresult != CMD_QUEUED) { - isp_destroy_tgt_handle(isp, handle); + isp_destroy_handle(isp, handle); isp_free_pcmd(isp, ccb); if (dmaresult == CMD_EAGAIN) { TAILQ_INSERT_HEAD(&tptr->waitq, &ccb->ccb_h, periph_links.tqe); @@ -2380,12 +2381,12 @@ isp_handle_platform_ctio(ispsoftc_t *isp uint32_t handle, moved_data = 0, data_requested; handle = ((ct2_entry_t *)arg)->ct_syshandle; - ccb = isp_find_xs_tgt(isp, handle); + ccb = isp_find_xs(isp, handle); if (ccb == NULL) { isp_print_bytes(isp, "null ccb in isp_handle_platform_ctio", QENTRY_LEN, arg); return; } - isp_destroy_tgt_handle(isp, handle); + isp_destroy_handle(isp, handle); data_requested = PISP_PCMD(ccb)->datalen; isp_free_pcmd(isp, ccb); if (isp->isp_nactive) { @@ -3321,7 +3322,7 @@ isp_loop_dead(ispsoftc_t *isp, int chan) for (i = 0; i < isp->isp_maxcmds; i++) { struct ccb_scsiio *xs; - if (!ISP_VALID_HANDLE(isp, isp->isp_xflist[i].handle)) { + if (ISP_H2HT(isp->isp_xflist[i].handle) != ISP_HANDLE_INITIATOR) { continue; } if ((xs = isp->isp_xflist[i].cmd) == NULL) { Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Fri Dec 25 11:33:09 2015 (r292724) +++ head/sys/dev/isp/isp_library.c Fri Dec 25 13:03:18 2015 (r292725) @@ -247,28 +247,26 @@ copy_and_sync: return (CMD_QUEUED); } -int -isp_allocate_xs(ispsoftc_t *isp, XS_T *xs, uint32_t *handlep) +uint32_t +isp_allocate_handle(ispsoftc_t *isp, void *xs, int type) { isp_hdl_t *hdp; hdp = isp->isp_xffree; - if (hdp == NULL) { - return (-1); - } + if (hdp == NULL) + return (ISP_HANDLE_FREE); isp->isp_xffree = hdp->cmd; hdp->cmd = xs; hdp->handle = (hdp - isp->isp_xflist); - hdp->handle |= (ISP_HANDLE_INITIATOR << ISP_HANDLE_USAGE_SHIFT); + hdp->handle |= (type << ISP_HANDLE_USAGE_SHIFT); hdp->handle |= (isp->isp_seqno++ << ISP_HANDLE_SEQ_SHIFT); - *handlep = hdp->handle; - return (0); + return (hdp->handle); } -XS_T * +void * isp_find_xs(ispsoftc_t *isp, uint32_t handle) { - if (!ISP_VALID_INI_HANDLE(isp, handle)) { + if (!ISP_VALID_HANDLE(isp, handle)) { isp_prt(isp, ISP_LOGERR, "%s: bad handle 0x%x", __func__, handle); return (NULL); } @@ -276,7 +274,7 @@ isp_find_xs(ispsoftc_t *isp, uint32_t ha } uint32_t -isp_find_handle(ispsoftc_t *isp, XS_T *xs) +isp_find_handle(ispsoftc_t *isp, void *xs) { uint32_t i, foundhdl = ISP_HANDLE_FREE; @@ -292,21 +290,10 @@ isp_find_handle(ispsoftc_t *isp, XS_T *x return (foundhdl); } -uint32_t -isp_handle_index(ispsoftc_t *isp, uint32_t handle) -{ - if (!ISP_VALID_HANDLE(isp, handle)) { - isp_prt(isp, ISP_LOGERR, "%s: bad handle 0x%x", __func__, handle); - return (ISP_BAD_HANDLE_INDEX); - } else { - return (handle & ISP_HANDLE_CMD_MASK); - } -} - void isp_destroy_handle(ispsoftc_t *isp, uint32_t handle) { - if (!ISP_VALID_INI_HANDLE(isp, handle)) { + if (!ISP_VALID_HANDLE(isp, handle)) { isp_prt(isp, ISP_LOGERR, "%s: bad handle 0x%x", __func__, handle); } else { isp->isp_xflist[(handle & ISP_HANDLE_CMD_MASK)].handle = ISP_HANDLE_FREE; @@ -583,46 +570,41 @@ isp_clear_commands(ispsoftc_t *isp) #endif for (tmp = 0; isp->isp_xflist && tmp < isp->isp_maxcmds; tmp++) { - XS_T *xs; hdp = &isp->isp_xflist[tmp]; - if (hdp->handle == ISP_HANDLE_FREE) { - continue; - } - xs = hdp->cmd; - if (XS_XFRLEN(xs)) { - ISP_DMAFREE(isp, xs, hdp->handle); - XS_SET_RESID(xs, XS_XFRLEN(xs)); - } else { - XS_SET_RESID(xs, 0); - } - hdp->handle = 0; - hdp->cmd = NULL; - XS_SETERR(xs, HBA_BUSRESET); - isp_done(xs); - } + if (ISP_H2HT(hdp->handle) == ISP_HANDLE_INITIATOR) { + XS_T *xs = hdp->cmd; + if (XS_XFRLEN(xs)) { + ISP_DMAFREE(isp, xs, hdp->handle); + XS_SET_RESID(xs, XS_XFRLEN(xs)); + } else { + XS_SET_RESID(xs, 0); + } + hdp->handle = 0; + hdp->cmd = NULL; + XS_SETERR(xs, HBA_BUSRESET); + isp_done(xs); #ifdef ISP_TARGET_MODE - for (tmp = 0; isp->isp_tgtlist && tmp < isp->isp_maxcmds; tmp++) { - uint8_t local[QENTRY_LEN]; - hdp = &isp->isp_tgtlist[tmp]; - if (hdp->handle == ISP_HANDLE_FREE) { - continue; - } - ISP_DMAFREE(isp, hdp->cmd, hdp->handle); - ISP_MEMZERO(local, QENTRY_LEN); - if (IS_24XX(isp)) { - ct7_entry_t *ctio = (ct7_entry_t *) local; - ctio->ct_syshandle = hdp->handle; - ctio->ct_nphdl = CT_HBA_RESET; - ctio->ct_header.rqs_entry_type = RQSTYPE_CTIO7; - } else { - ct2_entry_t *ctio = (ct2_entry_t *) local; - ctio->ct_syshandle = hdp->handle; - ctio->ct_status = CT_HBA_RESET; - ctio->ct_header.rqs_entry_type = RQSTYPE_CTIO2; + } else if (ISP_H2HT(hdp->handle) == ISP_HANDLE_TARGET) { + uint8_t local[QENTRY_LEN]; + ISP_DMAFREE(isp, hdp->cmd, hdp->handle); + ISP_MEMZERO(local, QENTRY_LEN); + if (IS_24XX(isp)) { + ct7_entry_t *ctio = (ct7_entry_t *) local; + ctio->ct_syshandle = hdp->handle; + ctio->ct_nphdl = CT_HBA_RESET; + ctio->ct_header.rqs_entry_type = RQSTYPE_CTIO7; + } else { + ct2_entry_t *ctio = (ct2_entry_t *) local; + ctio->ct_syshandle = hdp->handle; + ctio->ct_status = CT_HBA_RESET; + ctio->ct_header.rqs_entry_type = RQSTYPE_CTIO2; + } + isp_async(isp, ISPASYNC_TARGET_ACTION, local); +#endif } - isp_async(isp, ISPASYNC_TARGET_ACTION, local); } +#ifdef ISP_TARGET_MODE for (tmp = 0; tmp < isp->isp_nchan; tmp++) { ISP_MEMZERO(¬ify, sizeof (isp_notify_t)); notify.nt_ncode = NT_HBA_RESET; @@ -2223,69 +2205,6 @@ isp_send_tgt_cmd(ispsoftc_t *isp, void * return (CMD_QUEUED); } -int -isp_allocate_xs_tgt(ispsoftc_t *isp, void *xs, uint32_t *handlep) -{ - isp_hdl_t *hdp; - - hdp = isp->isp_tgtfree; - if (hdp == NULL) { - return (-1); - } - isp->isp_tgtfree = hdp->cmd; - hdp->cmd = xs; - hdp->handle = (hdp - isp->isp_tgtlist); - hdp->handle |= (ISP_HANDLE_TARGET << ISP_HANDLE_USAGE_SHIFT); - /* - * Target handles for SCSI cards are only 16 bits, so - * sequence number protection will be ommitted. - */ - if (IS_FC(isp)) { - hdp->handle |= (isp->isp_seqno++ << ISP_HANDLE_SEQ_SHIFT); - } - *handlep = hdp->handle; - return (0); -} - -void * -isp_find_xs_tgt(ispsoftc_t *isp, uint32_t handle) -{ - if (!ISP_VALID_TGT_HANDLE(isp, handle)) { - isp_prt(isp, ISP_LOGERR, "%s: bad handle 0x%x", __func__, handle); - return (NULL); - } - return (isp->isp_tgtlist[(handle & ISP_HANDLE_CMD_MASK)].cmd); -} - -uint32_t -isp_find_tgt_handle(ispsoftc_t *isp, void *xs) -{ - uint32_t i, foundhdl = ISP_HANDLE_FREE; - - if (xs != NULL) { - for (i = 0; i < isp->isp_maxcmds; i++) { - if (isp->isp_tgtlist[i].cmd != xs) { - continue; - } - foundhdl = isp->isp_tgtlist[i].handle; - break; - } - } - return (foundhdl); -} - -void -isp_destroy_tgt_handle(ispsoftc_t *isp, uint32_t handle) -{ - if (!ISP_VALID_TGT_HANDLE(isp, handle)) { - isp_prt(isp, ISP_LOGERR, "%s: bad handle 0x%x", __func__, handle); - } else { - isp->isp_tgtlist[(handle & ISP_HANDLE_CMD_MASK)].handle = ISP_HANDLE_FREE; - isp->isp_tgtlist[(handle & ISP_HANDLE_CMD_MASK)].cmd = isp->isp_tgtfree; - isp->isp_tgtfree = &isp->isp_tgtlist[(handle & ISP_HANDLE_CMD_MASK)]; - } -} - #endif /* Modified: head/sys/dev/isp/isp_library.h ============================================================================== --- head/sys/dev/isp/isp_library.h Fri Dec 25 11:33:09 2015 (r292724) +++ head/sys/dev/isp/isp_library.h Fri Dec 25 13:03:18 2015 (r292725) @@ -43,10 +43,9 @@ int isp_send_cmd(ispsoftc_t *, void *, v * * These handles are associate with a command. */ -int isp_allocate_xs(ispsoftc_t *, XS_T *, uint32_t *); -XS_T * isp_find_xs(ispsoftc_t *, uint32_t); -uint32_t isp_find_handle(ispsoftc_t *, XS_T *); -uint32_t isp_handle_index(ispsoftc_t *, uint32_t); +uint32_t isp_allocate_handle(ispsoftc_t *, void *, int); +void *isp_find_xs(ispsoftc_t *, uint32_t); +uint32_t isp_find_handle(ispsoftc_t *, void *); void isp_destroy_handle(ispsoftc_t *, uint32_t); /* @@ -162,11 +161,6 @@ void isp_put_fcp_rsp_iu(ispsoftc_t *isp, #endif int isp_send_tgt_cmd(ispsoftc_t *, void *, void *, uint32_t, uint32_t, isp_ddir_t, void *, uint32_t); - -int isp_allocate_xs_tgt(ispsoftc_t *, void *, uint32_t *); -void *isp_find_xs_tgt(ispsoftc_t *, uint32_t); -uint32_t isp_find_tgt_handle(ispsoftc_t *, void *); -void isp_destroy_tgt_handle(ispsoftc_t *, uint32_t); #endif int isp_find_pdb_empty(ispsoftc_t *, int, fcportdb_t **); int isp_find_pdb_by_wwpn(ispsoftc_t *, int, uint64_t, fcportdb_t **); Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Fri Dec 25 11:33:09 2015 (r292724) +++ head/sys/dev/isp/isp_pci.c Fri Dec 25 13:03:18 2015 (r292725) @@ -1684,21 +1684,6 @@ isp_pci_mbxdma(ispsoftc_t *isp) isp->isp_xflist[len].cmd = &isp->isp_xflist[len+1]; } isp->isp_xffree = isp->isp_xflist; -#ifdef ISP_TARGET_MODE - len = sizeof (isp_hdl_t) * isp->isp_maxcmds; - isp->isp_tgtlist = (isp_hdl_t *) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); - if (isp->isp_tgtlist == NULL) { - free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); - free(isp->isp_xflist, M_DEVBUF); - ISP_LOCK(isp); - isp_prt(isp, ISP_LOGERR, "cannot alloc tgtlist array"); - return (1); - } - for (len = 0; len < isp->isp_maxcmds - 1; len++) { - isp->isp_tgtlist[len].cmd = &isp->isp_tgtlist[len+1]; - } - isp->isp_tgtfree = isp->isp_tgtlist; -#endif /* * Allocate and map the request and result queues (and ATIO queue @@ -1725,9 +1710,6 @@ isp_pci_mbxdma(ispsoftc_t *isp) isp_prt(isp, ISP_LOGERR, "cannot create a dma tag for control spaces"); free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); free(isp->isp_xflist, M_DEVBUF); -#ifdef ISP_TARGET_MODE - free(isp->isp_tgtlist, M_DEVBUF); -#endif ISP_LOCK(isp); return (1); } @@ -1737,9 +1719,6 @@ isp_pci_mbxdma(ispsoftc_t *isp) bus_dma_tag_destroy(isp->isp_osinfo.cdmat); free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); free(isp->isp_xflist, M_DEVBUF); -#ifdef ISP_TARGET_MODE - free(isp->isp_tgtlist, M_DEVBUF); -#endif ISP_LOCK(isp); return (1); } @@ -1831,9 +1810,6 @@ bad: bus_dmamem_free(isp->isp_osinfo.cdmat, base, isp->isp_osinfo.cdmap); bus_dma_tag_destroy(isp->isp_osinfo.cdmat); free(isp->isp_xflist, M_DEVBUF); -#ifdef ISP_TARGET_MODE - free(isp->isp_tgtlist, M_DEVBUF); -#endif free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); isp->isp_rquest = NULL; ISP_LOCK(isp); Modified: head/sys/dev/isp/isp_target.c ============================================================================== --- head/sys/dev/isp/isp_target.c Fri Dec 25 11:33:09 2015 (r292724) +++ head/sys/dev/isp/isp_target.c Fri Dec 25 13:03:18 2015 (r292725) @@ -1094,7 +1094,7 @@ isp_handle_ctio2(ispsoftc_t *isp, ct2_en char *fmsg = NULL; if (ct->ct_syshandle) { - xs = isp_find_xs_tgt(isp, ct->ct_syshandle); + xs = isp_find_xs(isp, ct->ct_syshandle); if (xs == NULL) { pl = ISP_LOGALL; } @@ -1249,7 +1249,7 @@ isp_handle_ctio7(ispsoftc_t *isp, ct7_en char *fmsg = NULL; if (ct->ct_syshandle) { - xs = isp_find_xs_tgt(isp, ct->ct_syshandle); + xs = isp_find_xs(isp, ct->ct_syshandle); if (xs == NULL) { pl = ISP_LOGALL; } Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Fri Dec 25 11:33:09 2015 (r292724) +++ head/sys/dev/isp/ispvar.h Fri Dec 25 13:03:18 2015 (r292725) @@ -318,18 +318,11 @@ typedef struct { #define ISP_HANDLE_SEQ_MASK 0xffff0000 #define ISP_HANDLE_SEQ_SHIFT 16 #define ISP_H2SEQ(hdl) ((hdl & ISP_HANDLE_SEQ_MASK) >> ISP_HANDLE_SEQ_SHIFT) -#define ISP_VALID_INI_HANDLE(c, hdl) \ - (ISP_H2HT(hdl) == ISP_HANDLE_INITIATOR && (hdl & ISP_HANDLE_CMD_MASK) < (c)->isp_maxcmds && \ - ISP_H2SEQ(hdl) == ISP_H2SEQ((c)->isp_xflist[hdl & ISP_HANDLE_CMD_MASK].handle)) -#ifdef ISP_TARGET_MODE -#define ISP_VALID_TGT_HANDLE(c, hdl) \ - (ISP_H2HT(hdl) == ISP_HANDLE_TARGET && (hdl & ISP_HANDLE_CMD_MASK) < (c)->isp_maxcmds && \ - ISP_H2SEQ(hdl) == ISP_H2SEQ((c)->isp_tgtlist[hdl & ISP_HANDLE_CMD_MASK].handle)) #define ISP_VALID_HANDLE(c, hdl) \ - (ISP_VALID_INI_HANDLE((c), hdl) || ISP_VALID_TGT_HANDLE((c), hdl)) -#else -#define ISP_VALID_HANDLE ISP_VALID_INI_HANDLE -#endif + ((ISP_H2HT(hdl) == ISP_HANDLE_INITIATOR || \ + ISP_H2HT(hdl) == ISP_HANDLE_TARGET) && \ + ((hdl) & ISP_HANDLE_CMD_MASK) < (c)->isp_maxcmds && \ + (hdl) == ((c)->isp_xflist[(hdl) & ISP_HANDLE_CMD_MASK].handle)) #define ISP_BAD_HANDLE_INDEX 0xffffffff @@ -598,14 +591,6 @@ struct ispsoftc { isp_hdl_t *isp_xflist; isp_hdl_t *isp_xffree; -#ifdef ISP_TARGET_MODE - /* - * Active target commands are stored here, indexed by handle functions. - */ - isp_hdl_t *isp_tgtlist; - isp_hdl_t *isp_tgtfree; -#endif - /* * request/result queue pointers and DMA handles for them. */ From owner-svn-src-all@freebsd.org Fri Dec 25 14:25:54 2015 Return-Path: Delivered-To: svn-src-all@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 BE0DEA5113A; Fri, 25 Dec 2015 14:25:54 +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 7223718DF; Fri, 25 Dec 2015 14:25: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 tBPEPrdi012040; Fri, 25 Dec 2015 14:25:53 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPEPnO7012002; Fri, 25 Dec 2015 14:25:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201512251425.tBPEPnO7012002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 25 Dec 2015 14:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292726 - in vendor/llvm/dist: . autoconf bindings/go/llvm bindings/ocaml/llvm docs include/llvm-c include/llvm/CodeGen lib/CodeGen/AsmPrinter lib/CodeGen/SelectionDAG lib/IR lib/LTO li... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 14:25:54 -0000 Author: dim Date: Fri Dec 25 14:25:49 2015 New Revision: 292726 URL: https://svnweb.freebsd.org/changeset/base/292726 Log: Import llvm 3.7.1 release (r255217). Added: vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.dbg.value.ll vendor/llvm/dist/test/CodeGen/AMDGPU/promote-alloca-bitcast-function.ll vendor/llvm/dist/test/CodeGen/AMDGPU/promote-alloca-stored-pointer-value.ll vendor/llvm/dist/test/CodeGen/AMDGPU/trunc-store.ll vendor/llvm/dist/test/CodeGen/BPF/fi_ri.ll vendor/llvm/dist/test/CodeGen/BPF/undef.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/addrspacecast.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/extractelement.ll vendor/llvm/dist/test/CodeGen/Mips/micromips-zero-mat-uses.ll vendor/llvm/dist/test/CodeGen/PowerPC/ctr-loop-tls-const.ll vendor/llvm/dist/test/CodeGen/PowerPC/ctrloop-intrin.ll vendor/llvm/dist/test/CodeGen/PowerPC/no-rlwimi-trivial-commute.mir vendor/llvm/dist/test/CodeGen/PowerPC/p8altivec-shuffles-pred.ll vendor/llvm/dist/test/CodeGen/PowerPC/pr24546.ll vendor/llvm/dist/test/CodeGen/PowerPC/pr25157.ll vendor/llvm/dist/test/CodeGen/PowerPC/rlwimi-and-or-bits.ll vendor/llvm/dist/test/CodeGen/PowerPC/select-i1-vs-i1.ll vendor/llvm/dist/test/CodeGen/PowerPC/vsx-fma-mutate-trivial-copy.ll vendor/llvm/dist/test/CodeGen/PowerPC/vsx-fma-mutate-undef.ll vendor/llvm/dist/test/CodeGen/X86/pr24374.ll vendor/llvm/dist/test/CodeGen/X86/setcc-lowering.ll vendor/llvm/dist/test/DebugInfo/gvn.ll vendor/llvm/dist/test/LTO/X86/diagnostic-handler-noexit.ll vendor/llvm/dist/test/MC/ARM/directive-arch-semantic-action.s (contents, props changed) Modified: vendor/llvm/dist/CMakeLists.txt vendor/llvm/dist/CREDITS.TXT vendor/llvm/dist/autoconf/configure.ac vendor/llvm/dist/bindings/go/llvm/ir.go vendor/llvm/dist/bindings/ocaml/llvm/llvm_ocaml.c vendor/llvm/dist/configure vendor/llvm/dist/docs/ReleaseNotes.rst vendor/llvm/dist/include/llvm-c/Core.h vendor/llvm/dist/include/llvm/CodeGen/CommandFlags.h vendor/llvm/dist/lib/CodeGen/AsmPrinter/WinException.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp vendor/llvm/dist/lib/IR/AsmWriter.cpp vendor/llvm/dist/lib/IR/Core.cpp vendor/llvm/dist/lib/LTO/LTOCodeGenerator.cpp vendor/llvm/dist/lib/MC/MCContext.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPURegisterInfo.td vendor/llvm/dist/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.h vendor/llvm/dist/lib/Target/AMDGPU/SIInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/SIPrepareScratchRegs.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.h vendor/llvm/dist/lib/Target/ARM/AsmParser/ARMAsmParser.cpp vendor/llvm/dist/lib/Target/BPF/BPFISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/BPF/BPFISelLowering.cpp vendor/llvm/dist/lib/Target/BPF/BPFInstrInfo.td vendor/llvm/dist/lib/Target/BPF/BPFRegisterInfo.cpp vendor/llvm/dist/lib/Target/Mips/MipsISelLowering.h vendor/llvm/dist/lib/Target/Mips/MipsSEISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCAsmPrinter.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCCTRLoops.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.td vendor/llvm/dist/lib/Target/PowerPC/PPCInstrQPX.td vendor/llvm/dist/lib/Target/PowerPC/PPCInstrVSX.td vendor/llvm/dist/lib/Target/PowerPC/PPCVSXFMAMutate.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp vendor/llvm/dist/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Transforms/IPO/PassManagerBuilder.cpp vendor/llvm/dist/lib/Transforms/Scalar/GVN.cpp vendor/llvm/dist/lib/Transforms/Utils/Local.cpp vendor/llvm/dist/test/CodeGen/BPF/sockex2.ll vendor/llvm/dist/test/MC/AMDGPU/vop3.s vendor/llvm/dist/test/MC/Sparc/sparc-directive-xword.s vendor/llvm/dist/tools/llvm-lto/llvm-lto.cpp vendor/llvm/dist/tools/llvm-shlib/Makefile vendor/llvm/dist/unittests/Transforms/Utils/Local.cpp Modified: vendor/llvm/dist/CMakeLists.txt ============================================================================== --- vendor/llvm/dist/CMakeLists.txt Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/CMakeLists.txt Fri Dec 25 14:25:49 2015 (r292726) @@ -60,7 +60,7 @@ set(CMAKE_MODULE_PATH set(LLVM_VERSION_MAJOR 3) set(LLVM_VERSION_MINOR 7) -set(LLVM_VERSION_PATCH 0) +set(LLVM_VERSION_PATCH 1) set(LLVM_VERSION_SUFFIX "") if (NOT PACKAGE_VERSION) Modified: vendor/llvm/dist/CREDITS.TXT ============================================================================== --- vendor/llvm/dist/CREDITS.TXT Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/CREDITS.TXT Fri Dec 25 14:25:49 2015 (r292726) @@ -509,3 +509,10 @@ N: Michael Wong E: fraggamuffin@gmail.com D: Clang OpenMP implementation +N: Alexander Mussman +E: alexander.musman@intel.com +D: Clang OpenMP implementation + +N: Kevin O'Brien +E: caomhin@us.ibm.com +D: Clang OpenMP implementation \ No newline at end of file Modified: vendor/llvm/dist/autoconf/configure.ac ============================================================================== --- vendor/llvm/dist/autoconf/configure.ac Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/autoconf/configure.ac Fri Dec 25 14:25:49 2015 (r292726) @@ -32,11 +32,11 @@ dnl===---------------------------------- dnl Initialize autoconf and define the package name, version number and dnl address for reporting bugs. -AC_INIT([LLVM],[3.7.0],[http://llvm.org/bugs/]) +AC_INIT([LLVM],[3.7.1],[http://llvm.org/bugs/]) LLVM_VERSION_MAJOR=3 LLVM_VERSION_MINOR=7 -LLVM_VERSION_PATCH=0 +LLVM_VERSION_PATCH=1 LLVM_VERSION_SUFFIX= AC_DEFINE_UNQUOTED([LLVM_VERSION_MAJOR], $LLVM_VERSION_MAJOR, [Major version of the LLVM API]) Modified: vendor/llvm/dist/bindings/go/llvm/ir.go ============================================================================== --- vendor/llvm/dist/bindings/go/llvm/ir.go Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/bindings/go/llvm/ir.go Fri Dec 25 14:25:49 2015 (r292726) @@ -1728,7 +1728,7 @@ func (b Builder) CreatePtrDiff(lhs, rhs func (b Builder) CreateLandingPad(t Type, personality Value, nclauses int, name string) (l Value) { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) - l.C = C.LLVMBuildLandingPad(b.C, t.C, C.unsigned(nclauses), cname) + l.C = C.LLVMBuildLandingPad(b.C, t.C, nil, C.unsigned(nclauses), cname) return l } Modified: vendor/llvm/dist/bindings/ocaml/llvm/llvm_ocaml.c ============================================================================== --- vendor/llvm/dist/bindings/ocaml/llvm/llvm_ocaml.c Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/bindings/ocaml/llvm/llvm_ocaml.c Fri Dec 25 14:25:49 2015 (r292726) @@ -1745,7 +1745,7 @@ CAMLprim LLVMValueRef llvm_build_invoke_ CAMLprim LLVMValueRef llvm_build_landingpad(LLVMTypeRef Ty, LLVMValueRef PersFn, value NumClauses, value Name, value B) { - return LLVMBuildLandingPad(Builder_val(B), Ty, Int_val(NumClauses), + return LLVMBuildLandingPad(Builder_val(B), Ty, PersFn, Int_val(NumClauses), String_val(Name)); } Modified: vendor/llvm/dist/configure ============================================================================== --- vendor/llvm/dist/configure Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/configure Fri Dec 25 14:25:49 2015 (r292726) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60 for LLVM 3.7.0. +# Generated by GNU Autoconf 2.60 for LLVM 3.7.1. # # Report bugs to . # @@ -561,8 +561,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='LLVM' PACKAGE_TARNAME='llvm' -PACKAGE_VERSION='3.7.0' -PACKAGE_STRING='LLVM 3.7.0' +PACKAGE_VERSION='3.7.1' +PACKAGE_STRING='LLVM 3.7.1' PACKAGE_BUGREPORT='http://llvm.org/bugs/' ac_unique_file="lib/IR/Module.cpp" @@ -1333,7 +1333,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures LLVM 3.7.0 to adapt to many kinds of systems. +\`configure' configures LLVM 3.7.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1399,7 +1399,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of LLVM 3.7.0:";; + short | recursive ) echo "Configuration of LLVM 3.7.1:";; esac cat <<\_ACEOF @@ -1583,7 +1583,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -LLVM configure 3.7.0 +LLVM configure 3.7.1 generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1599,7 +1599,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by LLVM $as_me 3.7.0, which was +It was created by LLVM $as_me 3.7.1, which was generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -1955,7 +1955,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu LLVM_VERSION_MAJOR=3 LLVM_VERSION_MINOR=7 -LLVM_VERSION_PATCH=0 +LLVM_VERSION_PATCH=1 LLVM_VERSION_SUFFIX= @@ -8643,87 +8643,6 @@ fi if test "$llvm_cv_os_type" = "MingW" ; then -{ echo "$as_me:$LINENO: checking for main in -limagehlp" >&5 -echo $ECHO_N "checking for main in -limagehlp... $ECHO_C" >&6; } -if test "${ac_cv_lib_imagehlp_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-limagehlp $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_imagehlp_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_imagehlp_main=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_imagehlp_main" >&5 -echo "${ECHO_T}$ac_cv_lib_imagehlp_main" >&6; } -if test $ac_cv_lib_imagehlp_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBIMAGEHLP 1 -_ACEOF - - LIBS="-limagehlp $LIBS" - -fi - - { echo "$as_me:$LINENO: checking for main in -lole32" >&5 echo $ECHO_N "checking for main in -lole32... $ECHO_C" >&6; } if test "${ac_cv_lib_ole32_main+set}" = set; then @@ -18610,7 +18529,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by LLVM $as_me 3.7.0, which was +This file was extended by LLVM $as_me 3.7.1, which was generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18663,7 +18582,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -LLVM config.status 3.7.0 +LLVM config.status 3.7.1 configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Modified: vendor/llvm/dist/docs/ReleaseNotes.rst ============================================================================== --- vendor/llvm/dist/docs/ReleaseNotes.rst Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/docs/ReleaseNotes.rst Fri Dec 25 14:25:49 2015 (r292726) @@ -25,7 +25,35 @@ LLVM web page, this document applies to one. To see the release notes for a specific release, please see the `releases page `_. -Non-comprehensive list of changes in this release +Major changes in 3.7.1 +====================== + +* 3.7.0 was released with an inadvertent change to the signature of the C + API function: LLVMBuildLandingPad, which made the C API incompatible with + prior releases. This has been corrected in LLVM 3.7.1. + + As a result of this change, 3.7.0 is not ABI compatible with 3.7.1. + + +----------------------------------------------------------------------------+ + | History of the LLVMBuildLandingPad() function | + +===========================+================================================+ + | 3.6.2 and prior releases | LLVMBuildLandingPad(LLVMBuilderRef, | + | | LLVMTypeRef, | + | | LLVMValueRef, | + | | unsigned, const char*) | + +---------------------------+------------------------------------------------+ + | 3.7.0 | LLVMBuildLandingPad(LLVMBuilderRef, | + | | LLVMTypeRef, | + | | unsigned, const char*) | + +---------------------------+------------------------------------------------+ + | 3.7.1 and future releases | LLVMBuildLandingPad(LLVMBuilderRef, | + | | LLVMTypeRef, | + | | LLVMValueRef, | + | | unsigned, const char*) | + +---------------------------+------------------------------------------------+ + + +Non-comprehensive list of changes in 3.7.0 ================================================= .. NOTE Modified: vendor/llvm/dist/include/llvm-c/Core.h ============================================================================== --- vendor/llvm/dist/include/llvm-c/Core.h Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/include/llvm-c/Core.h Fri Dec 25 14:25:49 2015 (r292726) @@ -2675,7 +2675,8 @@ LLVMValueRef LLVMBuildInvoke(LLVMBuilder LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name); LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, - unsigned NumClauses, const char *Name); + LLVMValueRef PersFn, unsigned NumClauses, + const char *Name); LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn); LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef); Modified: vendor/llvm/dist/include/llvm/CodeGen/CommandFlags.h ============================================================================== --- vendor/llvm/dist/include/llvm/CodeGen/CommandFlags.h Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/include/llvm/CodeGen/CommandFlags.h Fri Dec 25 14:25:49 2015 (r292726) @@ -21,7 +21,7 @@ #include "llvm/IR/Intrinsics.h" #include "llvm/IR/Module.h" #include "llvm/MC/MCTargetOptionsCommandFlags.h" -#include "llvm//MC/SubtargetFeature.h" +#include "llvm/MC/SubtargetFeature.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Host.h" Modified: vendor/llvm/dist/lib/CodeGen/AsmPrinter/WinException.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/AsmPrinter/WinException.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/CodeGen/AsmPrinter/WinException.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -169,7 +169,7 @@ void WinException::endFunction(const Mac Asm->OutStreamer->PopSection(); } - if (shouldEmitMoves) + if (shouldEmitMoves || shouldEmitPersonality) Asm->OutStreamer->EmitWinCFIEndProc(); } Modified: vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -439,7 +439,7 @@ ExpandUnalignedLoad(LoadSDNode *LD, Sele ISD::ANY_EXTEND, dl, VT, Result); ValResult = Result; - ChainResult = Chain; + ChainResult = newLoad.getValue(1); return; } Modified: vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -1010,6 +1010,8 @@ SDValue DAGTypeLegalizer::GetVectorEleme // Calculate the element offset and add it to the pointer. unsigned EltSize = EltVT.getSizeInBits() / 8; // FIXME: should be ABI size. + assert(EltSize * 8 == EltVT.getSizeInBits() && + "Converting bits to bytes lost precision"); Index = DAG.getNode(ISD::MUL, dl, Index.getValueType(), Index, DAG.getConstant(EltSize, dl, Index.getValueType())); Modified: vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -1528,9 +1528,25 @@ SDValue DAGTypeLegalizer::SplitVecOp_EXT if (CustomLowerNode(N, N->getValueType(0), true)) return SDValue(); - // Store the vector to the stack. - EVT EltVT = VecVT.getVectorElementType(); + // Make the vector elements byte-addressable if they aren't already. SDLoc dl(N); + EVT EltVT = VecVT.getVectorElementType(); + if (EltVT.getSizeInBits() < 8) { + SmallVector ElementOps; + for (unsigned i = 0; i < VecVT.getVectorNumElements(); ++i) { + ElementOps.push_back(DAG.getAnyExtOrTrunc( + DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, EltVT, Vec, + DAG.getConstant(i, dl, MVT::i8)), + dl, MVT::i8)); + } + + EltVT = MVT::i8; + VecVT = EVT::getVectorVT(*DAG.getContext(), EltVT, + VecVT.getVectorNumElements()); + Vec = DAG.getNode(ISD::BUILD_VECTOR, dl, VecVT, ElementOps); + } + + // Store the vector to the stack. SDValue StackPtr = DAG.CreateStackTemporary(VecVT); SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, Vec, StackPtr, MachinePointerInfo(), false, false, 0); Modified: vendor/llvm/dist/lib/IR/AsmWriter.cpp ============================================================================== --- vendor/llvm/dist/lib/IR/AsmWriter.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/IR/AsmWriter.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -794,6 +794,10 @@ void SlotTracker::processFunction() { ST_DEBUG("begin processFunction!\n"); fNext = 0; + // Process function metadata if it wasn't hit at the module-level. + if (!ShouldInitializeAllMetadata) + processFunctionMetadata(*TheFunction); + // Add all the function arguments with no names. for(Function::const_arg_iterator AI = TheFunction->arg_begin(), AE = TheFunction->arg_end(); AI != AE; ++AI) @@ -807,8 +811,6 @@ void SlotTracker::processFunction() { if (!BB.hasName()) CreateFunctionSlot(&BB); - processFunctionMetadata(*TheFunction); - for (auto &I : BB) { if (!I.getType()->isVoidTy() && !I.hasName()) CreateFunctionSlot(&I); @@ -836,11 +838,11 @@ void SlotTracker::processFunction() { void SlotTracker::processFunctionMetadata(const Function &F) { SmallVector, 4> MDs; - for (auto &BB : F) { - F.getAllMetadata(MDs); - for (auto &MD : MDs) - CreateMetadataSlot(MD.second); + F.getAllMetadata(MDs); + for (auto &MD : MDs) + CreateMetadataSlot(MD.second); + for (auto &BB : F) { for (auto &I : BB) processInstructionMetadata(I); } Modified: vendor/llvm/dist/lib/IR/Core.cpp ============================================================================== --- vendor/llvm/dist/lib/IR/Core.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/IR/Core.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -2257,7 +2257,14 @@ LLVMValueRef LLVMBuildInvoke(LLVMBuilder } LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, - unsigned NumClauses, const char *Name) { + LLVMValueRef PersFn, unsigned NumClauses, + const char *Name) { + // The personality used to live on the landingpad instruction, but now it + // lives on the parent function. For compatibility, take the provided + // personality and put it on the parent function. + if (PersFn) + unwrap(B)->GetInsertBlock()->getParent()->setPersonalityFn( + cast(unwrap(PersFn))); return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), NumClauses, Name)); } Modified: vendor/llvm/dist/lib/LTO/LTOCodeGenerator.cpp ============================================================================== --- vendor/llvm/dist/lib/LTO/LTOCodeGenerator.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/LTO/LTOCodeGenerator.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -63,14 +63,21 @@ const char* LTOCodeGenerator::getVersion #endif } +static void handleLTODiagnostic(const DiagnosticInfo &DI) { + DiagnosticPrinterRawOStream DP(errs()); + DI.print(DP); + errs() << "\n"; +} + LTOCodeGenerator::LTOCodeGenerator() - : Context(getGlobalContext()), IRLinker(new Module("ld-temp.o", Context)) { + : Context(getGlobalContext()), IRLinker(new Module("ld-temp.o", Context), + handleLTODiagnostic) { initializeLTOPasses(); } LTOCodeGenerator::LTOCodeGenerator(std::unique_ptr Context) : OwnedContext(std::move(Context)), Context(*OwnedContext), - IRLinker(new Module("ld-temp.o", *OwnedContext)) { + IRLinker(new Module("ld-temp.o", *OwnedContext), handleLTODiagnostic) { initializeLTOPasses(); } Modified: vendor/llvm/dist/lib/MC/MCContext.cpp ============================================================================== --- vendor/llvm/dist/lib/MC/MCContext.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/MC/MCContext.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -82,6 +82,7 @@ void MCContext::reset() { UsedNames.clear(); Symbols.clear(); + SectionSymbols.clear(); Allocator.Reset(); Instances.clear(); CompilationDir.clear(); Modified: vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -264,6 +264,12 @@ void AMDGPUAsmPrinter::getSIProgramInfo( for (const MachineBasicBlock &MBB : MF) { for (const MachineInstr &MI : MBB) { // TODO: CodeSize should account for multiple functions. + + // TODO: Should we count size of debug info? + if (MI.isDebugValue()) + continue; + + // FIXME: This is reporting 0 for many instructions. CodeSize += MI.getDesc().Size; unsigned numOperands = MI.getNumOperands(); Modified: vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -134,13 +134,17 @@ static Value* GEPToVectorIndex(GetElemen // // TODO: Check isTriviallyVectorizable for calls and handle other // instructions. -static bool canVectorizeInst(Instruction *Inst) { +static bool canVectorizeInst(Instruction *Inst, User *User) { switch (Inst->getOpcode()) { case Instruction::Load: - case Instruction::Store: case Instruction::BitCast: case Instruction::AddrSpaceCast: return true; + case Instruction::Store: { + // Must be the stored pointer operand, not a stored value. + StoreInst *SI = cast(Inst); + return SI->getPointerOperand() == User; + } default: return false; } @@ -166,7 +170,7 @@ static bool tryPromoteAllocaToVector(All for (User *AllocaUser : Alloca->users()) { GetElementPtrInst *GEP = dyn_cast(AllocaUser); if (!GEP) { - if (!canVectorizeInst(cast(AllocaUser))) + if (!canVectorizeInst(cast(AllocaUser), Alloca)) return false; WorkList.push_back(AllocaUser); @@ -184,7 +188,7 @@ static bool tryPromoteAllocaToVector(All GEPVectorIdx[GEP] = Index; for (User *GEPUser : AllocaUser->users()) { - if (!canVectorizeInst(cast(GEPUser))) + if (!canVectorizeInst(cast(GEPUser), AllocaUser)) return false; WorkList.push_back(GEPUser); @@ -240,7 +244,12 @@ static bool collectUsesWithPtrTypes(Valu for (User *User : Val->users()) { if(std::find(WorkList.begin(), WorkList.end(), User) != WorkList.end()) continue; - if (isa(User)) { + if (CallInst *CI = dyn_cast(User)) { + // TODO: We might be able to handle some cases where the callee is a + // constantexpr bitcast of a function. + if (!CI->getCalledFunction()) + return false; + WorkList.push_back(User); continue; } @@ -250,6 +259,12 @@ static bool collectUsesWithPtrTypes(Valu if (UseInst && UseInst->getOpcode() == Instruction::PtrToInt) return false; + if (StoreInst *SI = dyn_cast_or_null(UseInst)) { + // Reject if the stored value is not the pointer operand. + if (SI->getPointerOperand() != Val) + return false; + } + if (!User->getType()->isPointerTy()) continue; Modified: vendor/llvm/dist/lib/Target/AMDGPU/AMDGPURegisterInfo.td ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/AMDGPURegisterInfo.td Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/AMDGPU/AMDGPURegisterInfo.td Fri Dec 25 14:25:49 2015 (r292726) @@ -14,8 +14,7 @@ let Namespace = "AMDGPU" in { foreach Index = 0-15 in { - // Indices are used in a variety of ways here, so don't set a size/offset. - def sub#Index : SubRegIndex<-1, -1>; + def sub#Index : SubRegIndex<32, !shl(Index, 5)>; } def INDIRECT_BASE_ADDR : Register <"INDIRECT_BASE_ADDR">; Modified: vendor/llvm/dist/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -71,12 +71,26 @@ void AMDGPUMCObjectWriter::writeObject(M } } +static unsigned getFixupKindNumBytes(unsigned Kind) { + switch (Kind) { + case FK_Data_1: + return 1; + case FK_Data_2: + return 2; + case FK_Data_4: + return 4; + case FK_Data_8: + return 8; + default: + llvm_unreachable("Unknown fixup kind!"); + } +} + void AMDGPUAsmBackend::applyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize, uint64_t Value, bool IsPCRel) const { switch ((unsigned)Fixup.getKind()) { - default: llvm_unreachable("Unknown fixup kind"); case AMDGPU::fixup_si_sopp_br: { uint16_t *Dst = (uint16_t*)(Data + Fixup.getOffset()); *Dst = (Value - 4) / 4; @@ -96,6 +110,24 @@ void AMDGPUAsmBackend::applyFixup(const *Dst = Value + 4; break; } + default: { + // FIXME: Copied from AArch64 + unsigned NumBytes = getFixupKindNumBytes(Fixup.getKind()); + if (!Value) + return; // Doesn't change encoding. + MCFixupKindInfo Info = getFixupKindInfo(Fixup.getKind()); + + // Shift the value into position. + Value <<= Info.TargetOffset; + + unsigned Offset = Fixup.getOffset(); + assert(Offset + NumBytes <= DataSize && "Invalid fixup offset!"); + + // For each byte of the fragment that the fixup touches, mask in the + // bits from the fixup value. + for (unsigned i = 0; i != NumBytes; ++i) + Data[Offset + i] |= uint8_t((Value >> (i * 8)) & 0xff); + } } } Modified: vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -157,6 +157,7 @@ SITargetLowering::SITargetLowering(Targe setTruncStoreAction(MVT::i64, MVT::i32, Expand); setTruncStoreAction(MVT::v8i32, MVT::v8i16, Expand); + setTruncStoreAction(MVT::v16i32, MVT::v16i8, Expand); setTruncStoreAction(MVT::v16i32, MVT::v16i16, Expand); setOperationAction(ISD::LOAD, MVT::i1, Custom); @@ -2252,10 +2253,8 @@ MachineSDNode *SITargetLowering::buildSc SDValue Ptr) const { const SIInstrInfo *TII = static_cast(Subtarget->getInstrInfo()); - uint64_t Rsrc = TII->getDefaultRsrcDataFormat() | AMDGPU::RSRC_TID_ENABLE | - 0xffffffff; // Size - return buildRSRC(DAG, DL, Ptr, 0, Rsrc); + return buildRSRC(DAG, DL, Ptr, 0, TII->getScratchRsrcWords23()); } SDValue SITargetLowering::CreateLiveInRegister(SelectionDAG &DAG, Modified: vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -2778,3 +2778,16 @@ uint64_t SIInstrInfo::getDefaultRsrcData return RsrcDataFormat; } + +uint64_t SIInstrInfo::getScratchRsrcWords23() const { + uint64_t Rsrc23 = getDefaultRsrcDataFormat() | + AMDGPU::RSRC_TID_ENABLE | + 0xffffffff; // Size; + + // If TID_ENABLE is set, DATA_FORMAT specifies stride bits [14:17]. + // Clear them unless we want a huge stride. + if (ST.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS) + Rsrc23 &= ~AMDGPU::RSRC_DATA_FORMAT; + + return Rsrc23; +} Modified: vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.h ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.h Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.h Fri Dec 25 14:25:49 2015 (r292726) @@ -353,7 +353,7 @@ public: } uint64_t getDefaultRsrcDataFormat() const; - + uint64_t getScratchRsrcWords23() const; }; namespace AMDGPU { Modified: vendor/llvm/dist/lib/Target/AMDGPU/SIInstructions.td ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/SIInstructions.td Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/AMDGPU/SIInstructions.td Fri Dec 25 14:25:49 2015 (r292726) @@ -1548,6 +1548,12 @@ defm V_WRITELANE_B32 : VOP2SI_3VI_m < // These instructions only exist on SI and CI let SubtargetPredicate = isSICI in { +let isCommutable = 1 in { +defm V_MAC_LEGACY_F32 : VOP2InstSI , "v_mac_legacy_f32", + VOP_F32_F32_F32 +>; +} // End isCommutable = 1 + defm V_MIN_LEGACY_F32 : VOP2InstSI , "v_min_legacy_f32", VOP_F32_F32_F32, AMDGPUfmin_legacy >; @@ -1562,12 +1568,6 @@ defm V_LSHL_B32 : VOP2InstSI } // End isCommutable = 1 } // End let SubtargetPredicate = SICI -let isCommutable = 1 in { -defm V_MAC_LEGACY_F32 : VOP2_VI3_Inst , "v_mac_legacy_f32", - VOP_F32_F32_F32 ->; -} // End isCommutable = 1 - defm V_BFM_B32 : VOP2_VI3_Inst , "v_bfm_b32", VOP_I32_I32_I32 >; Modified: vendor/llvm/dist/lib/Target/AMDGPU/SIPrepareScratchRegs.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/SIPrepareScratchRegs.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/AMDGPU/SIPrepareScratchRegs.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -135,8 +135,7 @@ bool SIPrepareScratchRegs::runOnMachineF unsigned ScratchRsrcReg = RS.scavengeRegister(&AMDGPU::SReg_128RegClass, 0); - uint64_t Rsrc = AMDGPU::RSRC_DATA_FORMAT | AMDGPU::RSRC_TID_ENABLE | - 0xffffffff; // Size + uint64_t Rsrc23 = TII->getScratchRsrcWords23(); unsigned Rsrc0 = TRI->getSubReg(ScratchRsrcReg, AMDGPU::sub0); unsigned Rsrc1 = TRI->getSubReg(ScratchRsrcReg, AMDGPU::sub1); @@ -152,11 +151,11 @@ bool SIPrepareScratchRegs::runOnMachineF .addReg(ScratchRsrcReg, RegState::ImplicitDefine); BuildMI(MBB, I, DL, TII->get(AMDGPU::S_MOV_B32), Rsrc2) - .addImm(Rsrc & 0xffffffff) + .addImm(Rsrc23 & 0xffffffff) .addReg(ScratchRsrcReg, RegState::ImplicitDefine); BuildMI(MBB, I, DL, TII->get(AMDGPU::S_MOV_B32), Rsrc3) - .addImm(Rsrc >> 32) + .addImm(Rsrc23 >> 32) .addReg(ScratchRsrcReg, RegState::ImplicitDefine); // Scratch Offset Modified: vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -26,23 +26,25 @@ using namespace llvm; SIRegisterInfo::SIRegisterInfo() : AMDGPURegisterInfo() {} -BitVector SIRegisterInfo::getReservedRegs(const MachineFunction &MF) const { - BitVector Reserved(getNumRegs()); - Reserved.set(AMDGPU::EXEC); +void SIRegisterInfo::reserveRegisterTuples(BitVector &Reserved, unsigned Reg) const { + MCRegAliasIterator R(Reg, this, true); - // EXEC_LO and EXEC_HI could be allocated and used as regular register, - // but this seems likely to result in bugs, so I'm marking them as reserved. - Reserved.set(AMDGPU::EXEC_LO); - Reserved.set(AMDGPU::EXEC_HI); + for (; R.isValid(); ++R) + Reserved.set(*R); +} +BitVector SIRegisterInfo::getReservedRegs(const MachineFunction &MF) const { + BitVector Reserved(getNumRegs()); Reserved.set(AMDGPU::INDIRECT_BASE_ADDR); - Reserved.set(AMDGPU::FLAT_SCR); - Reserved.set(AMDGPU::FLAT_SCR_LO); - Reserved.set(AMDGPU::FLAT_SCR_HI); + + // EXEC_LO and EXEC_HI could be allocated and used as regular register, but + // this seems likely to result in bugs, so I'm marking them as reserved. + reserveRegisterTuples(Reserved, AMDGPU::EXEC); + reserveRegisterTuples(Reserved, AMDGPU::FLAT_SCR); // Reserve some VGPRs to use as temp registers in case we have to spill VGPRs - Reserved.set(AMDGPU::VGPR255); - Reserved.set(AMDGPU::VGPR254); + reserveRegisterTuples(Reserved, AMDGPU::VGPR254); + reserveRegisterTuples(Reserved, AMDGPU::VGPR255); // Tonga and Iceland can only allocate a fixed number of SGPRs due // to a hw bug. @@ -54,10 +56,7 @@ BitVector SIRegisterInfo::getReservedReg for (unsigned i = Limit; i < NumSGPRs; ++i) { unsigned Reg = AMDGPU::SGPR_32RegClass.getRegister(i); - MCRegAliasIterator R = MCRegAliasIterator(Reg, this, true); - - for (; R.isValid(); ++R) - Reserved.set(*R); + reserveRegisterTuples(Reserved, Reg); } } Modified: vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.h ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.h Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.h Fri Dec 25 14:25:49 2015 (r292726) @@ -23,7 +23,10 @@ namespace llvm { struct SIRegisterInfo : public AMDGPURegisterInfo { +private: + void reserveRegisterTuples(BitVector &, unsigned Reg) const; +public: SIRegisterInfo(); BitVector getReservedRegs(const MachineFunction &MF) const override; Modified: vendor/llvm/dist/lib/Target/ARM/AsmParser/ARMAsmParser.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -15,6 +15,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringSwitch.h" +#include "llvm/ADT/Triple.h" #include "llvm/ADT/Twine.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCAssembler.h" @@ -9104,6 +9105,10 @@ bool ARMAsmParser::parseDirectiveArch(SM return false; } + Triple T; + STI.setDefaultFeatures(T.getARMCPUForArch(Arch)); + setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits())); + getTargetStreamer().emitArch(ID); return false; } Modified: vendor/llvm/dist/lib/Target/BPF/BPFISelDAGToDAG.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/BPF/BPFISelDAGToDAG.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/BPF/BPFISelDAGToDAG.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -50,6 +50,7 @@ private: // Complex Pattern for address selection. bool SelectAddr(SDValue Addr, SDValue &Base, SDValue &Offset); + bool SelectFIAddr(SDValue Addr, SDValue &Base, SDValue &Offset); }; } @@ -67,7 +68,7 @@ bool BPFDAGToDAGISel::SelectAddr(SDValue Addr.getOpcode() == ISD::TargetGlobalAddress) return false; - // Addresses of the form FI+const or FI|const + // Addresses of the form Addr+const or Addr|const if (CurDAG->isBaseWithConstantOffset(Addr)) { ConstantSDNode *CN = dyn_cast(Addr.getOperand(1)); if (isInt<32>(CN->getSExtValue())) { @@ -89,6 +90,31 @@ bool BPFDAGToDAGISel::SelectAddr(SDValue return true; } +// ComplexPattern used on BPF FI instruction +bool BPFDAGToDAGISel::SelectFIAddr(SDValue Addr, SDValue &Base, SDValue &Offset) { + SDLoc DL(Addr); + + if (!CurDAG->isBaseWithConstantOffset(Addr)) + return false; + + // Addresses of the form Addr+const or Addr|const + ConstantSDNode *CN = dyn_cast(Addr.getOperand(1)); + if (isInt<32>(CN->getSExtValue())) { + + // If the first operand is a FI, get the TargetFI Node + if (FrameIndexSDNode *FIN = + dyn_cast(Addr.getOperand(0))) + Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i64); + else + return false; + + Offset = CurDAG->getTargetConstant(CN->getSExtValue(), DL, MVT::i64); + return true; + } + + return false; +} + SDNode *BPFDAGToDAGISel::Select(SDNode *Node) { unsigned Opcode = Node->getOpcode(); @@ -104,13 +130,6 @@ SDNode *BPFDAGToDAGISel::Select(SDNode * // tablegen selection should be handled here. switch (Opcode) { default: break; - - case ISD::UNDEF: { - errs() << "BUG: "; Node->dump(CurDAG); errs() << '\n'; - report_fatal_error("shouldn't see UNDEF during Select"); - break; - } - case ISD::INTRINSIC_W_CHAIN: { unsigned IntNo = cast(Node->getOperand(1))->getZExtValue(); switch (IntNo) { Modified: vendor/llvm/dist/lib/Target/BPF/BPFISelLowering.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/BPF/BPFISelLowering.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/BPF/BPFISelLowering.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -102,6 +102,7 @@ BPFTargetLowering::BPFTargetLowering(con setOperationAction(ISD::BR_CC, MVT::i64, Custom); setOperationAction(ISD::BR_JT, MVT::Other, Expand); + setOperationAction(ISD::BRIND, MVT::Other, Expand); setOperationAction(ISD::BRCOND, MVT::Other, Expand); setOperationAction(ISD::SETCC, MVT::i64, Expand); setOperationAction(ISD::SELECT, MVT::i64, Expand); @@ -128,9 +129,6 @@ BPFTargetLowering::BPFTargetLowering(con setOperationAction(ISD::SUBC, MVT::i64, Expand); setOperationAction(ISD::SUBE, MVT::i64, Expand); - // no UNDEF allowed - setOperationAction(ISD::UNDEF, MVT::i64, Expand); - setOperationAction(ISD::ROTR, MVT::i64, Expand); setOperationAction(ISD::ROTL, MVT::i64, Expand); setOperationAction(ISD::SHL_PARTS, MVT::i64, Expand); Modified: vendor/llvm/dist/lib/Target/BPF/BPFInstrInfo.td ============================================================================== --- vendor/llvm/dist/lib/Target/BPF/BPFInstrInfo.td Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/BPF/BPFInstrInfo.td Fri Dec 25 14:25:49 2015 (r292726) @@ -54,7 +54,8 @@ def i64immSExt32 : PatLeaf<(imm), [{return isInt<32>(N->getSExtValue()); }]>; // Addressing modes. -def ADDRri : ComplexPattern; +def ADDRri : ComplexPattern; +def FIri : ComplexPattern; // Address operands def MEMri : Operand { @@ -260,6 +261,15 @@ def MOV_rr : MOV_RR<"mov">; def MOV_ri : MOV_RI<"mov">; } +def FI_ri + : InstBPF<(outs GPR:$dst), (ins MEMri:$addr), + "lea\t$dst, $addr", + [(set i64:$dst, FIri:$addr)]> { + // This is a tentative instruction, and will be replaced + // with MOV_rr and ADD_ri in PEI phase +} + + def LD_pseudo : InstBPF<(outs GPR:$dst), (ins i64imm:$pseudo, u64imm:$imm), "ld_pseudo\t$dst, $pseudo, $imm", Modified: vendor/llvm/dist/lib/Target/BPF/BPFRegisterInfo.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/BPF/BPFRegisterInfo.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/BPF/BPFRegisterInfo.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -58,14 +58,13 @@ void BPFRegisterInfo::eliminateFrameInde unsigned FrameReg = getFrameRegister(MF); int FrameIndex = MI.getOperand(i).getIndex(); + const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo(); + MachineBasicBlock &MBB = *MI.getParent(); if (MI.getOpcode() == BPF::MOV_rr) { - const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo(); int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex); MI.getOperand(i).ChangeToRegister(FrameReg, false); - - MachineBasicBlock &MBB = *MI.getParent(); unsigned reg = MI.getOperand(i - 1).getReg(); BuildMI(MBB, ++II, DL, TII.get(BPF::ADD_ri), reg) .addReg(reg) @@ -79,8 +78,24 @@ void BPFRegisterInfo::eliminateFrameInde if (!isInt<32>(Offset)) llvm_unreachable("bug in frame offset"); - MI.getOperand(i).ChangeToRegister(FrameReg, false); - MI.getOperand(i + 1).ChangeToImmediate(Offset); + if (MI.getOpcode() == BPF::FI_ri) { + // architecture does not really support FI_ri, replace it with + // MOV_rr , frame_reg + // ADD_ri , imm + unsigned reg = MI.getOperand(i - 1).getReg(); + + BuildMI(MBB, ++II, DL, TII.get(BPF::MOV_rr), reg) + .addReg(FrameReg); + BuildMI(MBB, II, DL, TII.get(BPF::ADD_ri), reg) + .addReg(reg) + .addImm(Offset); + + // Remove FI_ri instruction + MI.eraseFromParent(); + } else { + MI.getOperand(i).ChangeToRegister(FrameReg, false); + MI.getOperand(i + 1).ChangeToImmediate(Offset); + } } unsigned BPFRegisterInfo::getFrameRegister(const MachineFunction &MF) const { Modified: vendor/llvm/dist/lib/Target/Mips/MipsISelLowering.h ============================================================================== --- vendor/llvm/dist/lib/Target/Mips/MipsISelLowering.h Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/Mips/MipsISelLowering.h Fri Dec 25 14:25:49 2015 (r292726) @@ -269,6 +269,14 @@ namespace llvm { unsigned getRegisterByName(const char* RegName, EVT VT, SelectionDAG &DAG) const override; + /// Returns true if a cast between SrcAS and DestAS is a noop. + bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override { + // Mips doesn't have any special address spaces so we just reserve + // the first 256 for software use (e.g. OpenCL) and treat casts + // between them as noops. + return SrcAS < 256 && DestAS < 256; + } + protected: SDValue getGlobalReg(SelectionDAG &DAG, EVT Ty) const; Modified: vendor/llvm/dist/lib/Target/Mips/MipsSEISelDAGToDAG.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/Mips/MipsSEISelDAGToDAG.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/Mips/MipsSEISelDAGToDAG.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -115,6 +115,11 @@ bool MipsSEDAGToDAGISel::replaceUsesWith if (MI->isPHI() || MI->isRegTiedToDefOperand(OpNo) || MI->isPseudo()) continue; + // Also, we have to check that the register class of the operand + // contains the zero register. + if (!MRI->getRegClass(MO.getReg())->contains(ZeroReg)) + continue; + MO.setReg(ZeroReg); } Modified: vendor/llvm/dist/lib/Target/PowerPC/PPCAsmPrinter.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/PowerPC/PPCAsmPrinter.cpp Fri Dec 25 13:03:18 2015 (r292725) +++ vendor/llvm/dist/lib/Target/PowerPC/PPCAsmPrinter.cpp Fri Dec 25 14:25:49 2015 (r292726) @@ -947,11 +947,11 @@ void PPCAsmPrinter::EmitInstruction(cons return; } case PPC::ADDISdtprelHA: - // Transform: %Xd = ADDISdtprelHA %X3, - // Into: %Xd = ADDIS8 %X3, sym@dtprel@ha + // Transform: %Xd = ADDISdtprelHA %Xs, + // Into: %Xd = ADDIS8 %Xs, sym@dtprel@ha case PPC::ADDISdtprelHA32: { - // Transform: %Rd = ADDISdtprelHA32 %R3, - // Into: %Rd = ADDIS %R3, sym@dtprel@ha + // Transform: %Rd = ADDISdtprelHA32 %Rs, + // Into: %Rd = ADDIS %Rs, sym@dtprel@ha const MachineOperand &MO = MI->getOperand(2); const GlobalValue *GValue = MO.getGlobal(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 25 14:26:38 2015 Return-Path: Delivered-To: svn-src-all@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 8A55CA511C7; Fri, 25 Dec 2015 14:26:38 +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 41D721A7B; Fri, 25 Dec 2015 14:26:38 +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 tBPEQbrs012107; Fri, 25 Dec 2015 14:26:37 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPEQbke012106; Fri, 25 Dec 2015 14:26:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201512251426.tBPEQbke012106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 25 Dec 2015 14:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292727 - vendor/llvm/llvm-release_371-r255217 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 14:26:38 -0000 Author: dim Date: Fri Dec 25 14:26:37 2015 New Revision: 292727 URL: https://svnweb.freebsd.org/changeset/base/292727 Log: Tag llvm 3.7.1 release (r255217). Added: vendor/llvm/llvm-release_371-r255217/ - copied from r292726, vendor/llvm/dist/ From owner-svn-src-all@freebsd.org Fri Dec 25 14:27:01 2015 Return-Path: Delivered-To: svn-src-all@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 17D08A5121F; Fri, 25 Dec 2015 14:27:01 +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 D81C01BE5; Fri, 25 Dec 2015 14:27:00 +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 tBPER0lm012174; Fri, 25 Dec 2015 14:27:00 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPEQw8r012160; Fri, 25 Dec 2015 14:26:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201512251426.tBPEQw8r012160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 25 Dec 2015 14:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292728 - in vendor/clang/dist: lib/Basic lib/CodeGen lib/Driver lib/Sema test/CodeGen test/Driver test/Sema test/SemaCXX X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 14:27:01 -0000 Author: dim Date: Fri Dec 25 14:26:58 2015 New Revision: 292728 URL: https://svnweb.freebsd.org/changeset/base/292728 Log: Import clang 3.7.1 release (r255217). Added: vendor/clang/dist/test/Sema/attr-self-alias.c (contents, props changed) Modified: vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/Basic/Version.cpp vendor/clang/dist/lib/CodeGen/CGCall.cpp vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/CodeGen/TargetInfo.cpp vendor/clang/dist/lib/Driver/Tools.cpp vendor/clang/dist/lib/Sema/SemaExprCXX.cpp vendor/clang/dist/test/CodeGen/libcalls-fno-builtin.c vendor/clang/dist/test/Driver/fopenmp.c vendor/clang/dist/test/SemaCXX/delete.cpp Modified: vendor/clang/dist/lib/Basic/Targets.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/Targets.cpp Fri Dec 25 14:26:37 2015 (r292727) +++ vendor/clang/dist/lib/Basic/Targets.cpp Fri Dec 25 14:26:58 2015 (r292728) @@ -3968,7 +3968,13 @@ public: class MinGWX86_64TargetInfo : public WindowsX86_64TargetInfo { public: MinGWX86_64TargetInfo(const llvm::Triple &Triple) - : WindowsX86_64TargetInfo(Triple) {} + : WindowsX86_64TargetInfo(Triple) { + // Mingw64 rounds long double size and alignment up to 16 bytes, but sticks + // with x86 FP ops. Weird. + LongDoubleWidth = LongDoubleAlign = 128; + LongDoubleFormat = &llvm::APFloat::x87DoubleExtended; + } + void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override { WindowsX86_64TargetInfo::getTargetDefines(Opts, Builder); Modified: vendor/clang/dist/lib/Basic/Version.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/Version.cpp Fri Dec 25 14:26:37 2015 (r292727) +++ vendor/clang/dist/lib/Basic/Version.cpp Fri Dec 25 14:26:58 2015 (r292728) @@ -36,7 +36,7 @@ std::string getClangRepositoryPath() { // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_370/final/lib/Basic/Version.cpp $"); + StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_371/final/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); Modified: vendor/clang/dist/lib/CodeGen/CGCall.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGCall.cpp Fri Dec 25 14:26:37 2015 (r292727) +++ vendor/clang/dist/lib/CodeGen/CGCall.cpp Fri Dec 25 14:26:58 2015 (r292728) @@ -1279,12 +1279,7 @@ CodeGenTypes::GetFunctionType(const CGFu } break; - case ABIArgInfo::Indirect: { - assert(!retAI.getIndirectAlign() && "Align unused on indirect return."); - resultType = llvm::Type::getVoidTy(getLLVMContext()); - break; - } - + case ABIArgInfo::Indirect: case ABIArgInfo::Ignore: resultType = llvm::Type::getVoidTy(getLLVMContext()); break; Modified: vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp Fri Dec 25 14:26:37 2015 (r292727) +++ vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp Fri Dec 25 14:26:58 2015 (r292728) @@ -2493,6 +2493,11 @@ void CodeGenModule::EmitAliasDefinition( StringRef MangledName = getMangledName(GD); + if (AA->getAliasee() == MangledName) { + Diags.Report(AA->getLocation(), diag::err_cyclic_alias); + return; + } + // If there is a definition in the module, then it wins over the alias. // This is dubious, but allow it to be safe. Just ignore the alias. llvm::GlobalValue *Entry = GetGlobalValue(MangledName); Modified: vendor/clang/dist/lib/CodeGen/TargetInfo.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/TargetInfo.cpp Fri Dec 25 14:26:37 2015 (r292727) +++ vendor/clang/dist/lib/CodeGen/TargetInfo.cpp Fri Dec 25 14:26:58 2015 (r292728) @@ -1552,12 +1552,10 @@ public: /// WinX86_64ABIInfo - The Windows X86_64 ABI information. class WinX86_64ABIInfo : public ABIInfo { - - ABIArgInfo classify(QualType Ty, unsigned &FreeSSERegs, - bool IsReturnType) const; - public: - WinX86_64ABIInfo(CodeGen::CodeGenTypes &CGT) : ABIInfo(CGT) {} + WinX86_64ABIInfo(CodeGen::CodeGenTypes &CGT) + : ABIInfo(CGT), + IsMingw64(getTarget().getTriple().isWindowsGNUEnvironment()) {} void computeInfo(CGFunctionInfo &FI) const override; @@ -1574,6 +1572,12 @@ public: // FIXME: Assumes vectorcall is in use. return isX86VectorCallAggregateSmallEnough(NumMembers); } + +private: + ABIArgInfo classify(QualType Ty, unsigned &FreeSSERegs, + bool IsReturnType) const; + + bool IsMingw64; }; class X86_64TargetCodeGenInfo : public TargetCodeGenInfo { @@ -3070,11 +3074,6 @@ ABIArgInfo WinX86_64ABIInfo::classify(Qu if (RT->getDecl()->hasFlexibleArrayMember()) return ABIArgInfo::getIndirect(0, /*ByVal=*/false); - - // FIXME: mingw-w64-gcc emits 128-bit struct as i128 - if (Width == 128 && getTarget().getTriple().isWindowsGNUEnvironment()) - return ABIArgInfo::getDirect(llvm::IntegerType::get(getVMContext(), - Width)); } // vectorcall adds the concept of a homogenous vector aggregate, similar to @@ -3116,6 +3115,14 @@ ABIArgInfo WinX86_64ABIInfo::classify(Qu if (BT && BT->getKind() == BuiltinType::Bool) return ABIArgInfo::getExtend(); + // Mingw64 GCC uses the old 80 bit extended precision floating point unit. It + // passes them indirectly through memory. + if (IsMingw64 && BT && BT->getKind() == BuiltinType::LongDouble) { + const llvm::fltSemantics *LDF = &getTarget().getLongDoubleFormat(); + if (LDF == &llvm::APFloat::x87DoubleExtended) + return ABIArgInfo::getIndirect(Align, /*ByVal=*/false); + } + return ABIArgInfo::getDirect(); } Modified: vendor/clang/dist/lib/Driver/Tools.cpp ============================================================================== --- vendor/clang/dist/lib/Driver/Tools.cpp Fri Dec 25 14:26:37 2015 (r292727) +++ vendor/clang/dist/lib/Driver/Tools.cpp Fri Dec 25 14:26:58 2015 (r292728) @@ -2460,6 +2460,28 @@ static OpenMPRuntimeKind getOpenMPRuntim return RT; } +static void addOpenMPRuntime(ArgStringList &CmdArgs, const ToolChain &TC, + const ArgList &Args) { + if (!Args.hasFlag(options::OPT_fopenmp, options::OPT_fopenmp_EQ, + options::OPT_fno_openmp, false)) + return; + + switch (getOpenMPRuntime(TC, Args)) { + case OMPRT_OMP: + CmdArgs.push_back("-lomp"); + break; + case OMPRT_GOMP: + CmdArgs.push_back("-lgomp"); + break; + case OMPRT_IOMP5: + CmdArgs.push_back("-liomp5"); + break; + case OMPRT_Unknown: + // Already diagnosed. + break; + } +} + static void addSanitizerRuntime(const ToolChain &TC, const ArgList &Args, ArgStringList &CmdArgs, StringRef Sanitizer, bool IsShared) { @@ -6527,24 +6549,6 @@ void darwin::Linker::ConstructJob(Compil Args.AddAllArgs(CmdArgs, options::OPT_L); - if (Args.hasFlag(options::OPT_fopenmp, options::OPT_fopenmp_EQ, - options::OPT_fno_openmp, false)) { - switch (getOpenMPRuntime(getToolChain(), Args)) { - case OMPRT_OMP: - CmdArgs.push_back("-lomp"); - break; - case OMPRT_GOMP: - CmdArgs.push_back("-lgomp"); - break; - case OMPRT_IOMP5: - CmdArgs.push_back("-liomp5"); - break; - case OMPRT_Unknown: - // Already diagnosed. - break; - } - } - AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs); // Build the input file for -filelist (list of linker input files) in case we // need it later @@ -6563,6 +6567,10 @@ void darwin::Linker::ConstructJob(Compil InputFileList.push_back(II.getFilename()); } + if (!Args.hasArg(options::OPT_nostdlib) && + !Args.hasArg(options::OPT_nodefaultlibs)) + addOpenMPRuntime(CmdArgs, getToolChain(), Args); + if (isObjCRuntimeLinked(Args) && !Args.hasArg(options::OPT_nostdlib) && !Args.hasArg(options::OPT_nodefaultlibs)) { // We use arclite library for both ARC and subscripting support. @@ -7347,6 +7355,7 @@ void freebsd::Linker::ConstructJob(Compi if (!Args.hasArg(options::OPT_nostdlib) && !Args.hasArg(options::OPT_nodefaultlibs)) { + addOpenMPRuntime(CmdArgs, ToolChain, Args); if (D.CCCIsCXX()) { ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs); if (Args.hasArg(options::OPT_pg)) @@ -7662,6 +7671,7 @@ void netbsd::Linker::ConstructJob(Compil if (!Args.hasArg(options::OPT_nostdlib) && !Args.hasArg(options::OPT_nodefaultlibs)) { + addOpenMPRuntime(CmdArgs, getToolChain(), Args); if (D.CCCIsCXX()) { getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs); CmdArgs.push_back("-lm"); Modified: vendor/clang/dist/lib/Sema/SemaExprCXX.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaExprCXX.cpp Fri Dec 25 14:26:37 2015 (r292727) +++ vendor/clang/dist/lib/Sema/SemaExprCXX.cpp Fri Dec 25 14:26:58 2015 (r292728) @@ -2485,8 +2485,10 @@ bool MismatchingNewDeleteDetector::hasMa MismatchingNewDeleteDetector::MismatchResult MismatchingNewDeleteDetector::analyzeInClassInitializer() { assert(Field != nullptr && "This should be called only for members"); - if (const CXXNewExpr *NE = - getNewExprFromInitListOrExpr(Field->getInClassInitializer())) { + const Expr *InitExpr = Field->getInClassInitializer(); + if (!InitExpr) + return EndOfTU ? NoMismatch : AnalyzeLater; + if (const CXXNewExpr *NE = getNewExprFromInitListOrExpr(InitExpr)) { if (NE->isArray() != IsArrayForm) { NewExprs.push_back(NE); return MemberInitMismatches; Modified: vendor/clang/dist/test/CodeGen/libcalls-fno-builtin.c ============================================================================== --- vendor/clang/dist/test/CodeGen/libcalls-fno-builtin.c Fri Dec 25 14:26:37 2015 (r292727) +++ vendor/clang/dist/test/CodeGen/libcalls-fno-builtin.c Fri Dec 25 14:26:58 2015 (r292728) @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -S -O3 -fno-builtin -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-w64-mingw32 -S -O3 -fno-builtin -o - %s | FileCheck %s // rdar://10551066 typedef __SIZE_TYPE__ size_t; Modified: vendor/clang/dist/test/Driver/fopenmp.c ============================================================================== --- vendor/clang/dist/test/Driver/fopenmp.c Fri Dec 25 14:26:37 2015 (r292727) +++ vendor/clang/dist/test/Driver/fopenmp.c Fri Dec 25 14:26:58 2015 (r292728) @@ -1,6 +1,15 @@ // RUN: %clang -target x86_64-linux-gnu -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP // RUN: %clang -target x86_64-linux-gnu -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP // RUN: %clang -target x86_64-linux-gnu -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP +// RUN: %clang -target x86_64-apple-darwin -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP +// RUN: %clang -target x86_64-apple-darwin -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP +// RUN: %clang -target x86_64-apple-darwin -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP +// RUN: %clang -target x86_64-freebsd -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP +// RUN: %clang -target x86_64-freebsd -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP +// RUN: %clang -target x86_64-freebsd -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP +// RUN: %clang -target x86_64-netbsd -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP +// RUN: %clang -target x86_64-netbsd -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP +// RUN: %clang -target x86_64-netbsd -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP // // CHECK-CC1-OPENMP: "-cc1" // CHECK-CC1-OPENMP: "-fopenmp" @@ -12,6 +21,30 @@ // RUN: %clang -target x86_64-linux-gnu -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP // RUN: %clang -target x86_64-linux-gnu -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5 // +// RUN: %clang -nostdlib -target x86_64-linux-gnu -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP +// RUN: %clang -nostdlib -target x86_64-linux-gnu -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP +// RUN: %clang -nostdlib -target x86_64-linux-gnu -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5 +// +// RUN: %clang -target x86_64-darwin -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-OMP +// RUN: %clang -target x86_64-darwin -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP +// RUN: %clang -target x86_64-darwin -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5 +// +// RUN: %clang -nostdlib -target x86_64-darwin -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP +// RUN: %clang -nostdlib -target x86_64-darwin -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP +// RUN: %clang -nostdlib -target x86_64-darwin -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5 +// +// RUN: %clang -target x86_64-netbsd -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-OMP +// RUN: %clang -target x86_64-netbsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-GOMP +// RUN: %clang -target x86_64-netbsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-IOMP5 +// +// RUN: %clang -nostdlib -target x86_64-freebsd -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP +// RUN: %clang -nostdlib -target x86_64-freebsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP +// RUN: %clang -nostdlib -target x86_64-freebsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5 +// +// RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OMP +// RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libgomp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-GOMP +// RUN: %clang -nostdlib -target x86_64-netbsd -fopenmp=libiomp5 %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-IOMP5 +// // CHECK-LD-OMP: "{{.*}}ld{{(.exe)?}}" // CHECK-LD-OMP: "-lomp" // @@ -21,6 +54,15 @@ // CHECK-LD-IOMP5: "{{.*}}ld{{(.exe)?}}" // CHECK-LD-IOMP5: "-liomp5" // +// CHECK-NO-OMP: "{{.*}}ld{{(.exe)?}}" +// CHECK-NO-OMP-NOT: "-lomp" +// +// CHECK-NO-GOMP: "{{.*}}ld{{(.exe)?}}" +// CHECK-NO-GOMP-NOT: "-lgomp" +// +// CHECK-NO-IOMP5: "{{.*}}ld{{(.exe)?}}" +// CHECK-NO-IOMP5-NOT: "-liomp5" +// // We'd like to check that the default is sane, but until we have the ability // to *always* semantically analyze OpenMP without always generating runtime // calls (in the event of an unsupported runtime), we don't have a good way to @@ -28,6 +70,9 @@ // OpenMP runtime. // // RUN: %clang -target x86_64-linux-gnu -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY +// RUN: %clang -target x86_64-darwin -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY +// RUN: %clang -target x86_64-freebsd -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY +// RUN: %clang -target x86_64-netbsd -fopenmp %s -o %t -### 2>&1 | FileCheck %s --check-prefix=CHECK-LD-ANY // // CHECK-LD-ANY: "{{.*}}ld{{(.exe)?}}" // CHECK-LD-ANY: "-l{{(omp|gomp|iomp5)}}" Added: vendor/clang/dist/test/Sema/attr-self-alias.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist/test/Sema/attr-self-alias.c Fri Dec 25 14:26:58 2015 (r292728) @@ -0,0 +1,4 @@ +// RUN: %clang_cc1 -triple x86_64-pc-linux -fsyntax-only -verify -emit-llvm-only %s + +int self_alias(void) __attribute__((weak, alias("self_alias"))); // expected-error {{alias definition is part of a cycle}} + Modified: vendor/clang/dist/test/SemaCXX/delete.cpp ============================================================================== --- vendor/clang/dist/test/SemaCXX/delete.cpp Fri Dec 25 14:26:37 2015 (r292727) +++ vendor/clang/dist/test/SemaCXX/delete.cpp Fri Dec 25 14:26:58 2015 (r292728) @@ -120,6 +120,22 @@ void f() { DELETE(d); // expected-warning {{'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'?}} } } + +namespace MissingInitializer { +template +struct Base { + struct S { + const T *p1 = nullptr; + const T *p2 = new T[3]; + }; +}; + +void null_init(Base::S s) { + delete s.p1; + delete s.p2; +} +} + #ifndef WITH_PCH pch_test::X::X() : a(new int[1]) // expected-note{{allocated with 'new[]' here}} From owner-svn-src-all@freebsd.org Fri Dec 25 14:27:38 2015 Return-Path: Delivered-To: svn-src-all@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 6E053A5126D; Fri, 25 Dec 2015 14:27:38 +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 255541D29; Fri, 25 Dec 2015 14:27:38 +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 tBPERbOF012236; Fri, 25 Dec 2015 14:27:37 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPERbkv012235; Fri, 25 Dec 2015 14:27:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201512251427.tBPERbkv012235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 25 Dec 2015 14:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292729 - vendor/clang/clang-release_371-r255217 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 14:27:38 -0000 Author: dim Date: Fri Dec 25 14:27:37 2015 New Revision: 292729 URL: https://svnweb.freebsd.org/changeset/base/292729 Log: Tag clang 3.7.1 release (r255217). Added: vendor/clang/clang-release_371-r255217/ - copied from r292728, vendor/clang/dist/ From owner-svn-src-all@freebsd.org Fri Dec 25 14:51:38 2015 Return-Path: Delivered-To: svn-src-all@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 6A9BCA51958; Fri, 25 Dec 2015 14:51:38 +0000 (UTC) (envelope-from kevlo@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 457261BB4; Fri, 25 Dec 2015 14:51:38 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPEpbBd019259; Fri, 25 Dec 2015 14:51:37 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPEpaW6019254; Fri, 25 Dec 2015 14:51:36 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201512251451.tBPEpaW6019254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 25 Dec 2015 14:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292730 - in head/sys: arm/arm dev/isci/scil dev/netmap mips/cavium netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 14:51:38 -0000 Author: kevlo Date: Fri Dec 25 14:51:36 2015 New Revision: 292730 URL: https://svnweb.freebsd.org/changeset/base/292730 Log: Fix typo (s/harware/hardware/) Modified: head/sys/arm/arm/pmap-v6-new.c head/sys/dev/isci/scil/scic_sds_phy.h head/sys/dev/netmap/netmap.c head/sys/mips/cavium/cvmx_config.h head/sys/netinet/if_ether.c Modified: head/sys/arm/arm/pmap-v6-new.c ============================================================================== --- head/sys/arm/arm/pmap-v6-new.c Fri Dec 25 14:27:37 2015 (r292729) +++ head/sys/arm/arm/pmap-v6-new.c Fri Dec 25 14:51:36 2015 (r292730) @@ -3194,7 +3194,7 @@ setpte1: * When page is not modified, PTE2_RO can be set without * a TLB invalidation. * - * Note: When modified bit is being set, then in harware case, + * Note: When modified bit is being set, then in hardware case, * the TLB entry is re-read (updated) from PT2, and in * software case (abort), the PTE2 is read from PT2 and * TLB flushed if changed. The following cmpset() solves @@ -6170,7 +6170,7 @@ pte1_seta: /* * Handle modify bits for page and section. Note that the modify * bit is emulated by software. So PTEx_RO is software read only - * bit and PTEx_NM flag is real harware read only bit. + * bit and PTEx_NM flag is real hardware read only bit. * * QQQ: This is hardware emulation, we do not call userret() * for aborts from user mode. Modified: head/sys/dev/isci/scil/scic_sds_phy.h ============================================================================== --- head/sys/dev/isci/scil/scic_sds_phy.h Fri Dec 25 14:27:37 2015 (r292729) +++ head/sys/dev/isci/scil/scic_sds_phy.h Fri Dec 25 14:51:36 2015 (r292730) @@ -201,7 +201,7 @@ enum SCIC_SDS_PHY_PROTOCOL * @struct SCIC_SDS_PHY * * @brief This structure contains or references all of the data necessary to - * represent the core phy object and SCU harware protocol engine. + * represent the core phy object and SCU hardware protocol engine. */ typedef struct SCIC_SDS_PHY { Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Fri Dec 25 14:27:37 2015 (r292729) +++ head/sys/dev/netmap/netmap.c Fri Dec 25 14:51:36 2015 (r292730) @@ -589,7 +589,7 @@ netmap_set_all_rings(struct netmap_adapt /* * Convenience function used in drivers. Waits for current txsync()s/rxsync()s * to finish and prevents any new one from starting. Call this before turning - * netmap mode off, or before removing the harware rings (e.g., on module + * netmap mode off, or before removing the hardware rings (e.g., on module * onload). As a rule of thumb for linux drivers, this should be placed near * each napi_disable(). */ Modified: head/sys/mips/cavium/cvmx_config.h ============================================================================== --- head/sys/mips/cavium/cvmx_config.h Fri Dec 25 14:27:37 2015 (r292729) +++ head/sys/mips/cavium/cvmx_config.h Fri Dec 25 14:51:36 2015 (r292730) @@ -63,7 +63,7 @@ #define CVMX_ENABLE_PKO_FUNCTIONS /* Define to enable the use of simple executive helper functions. These -** include many harware setup functions. See cvmx-helper.[ch] for +** include many hardware setup functions. See cvmx-helper.[ch] for ** details. */ #define CVMX_ENABLE_HELPER_FUNCTIONS Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Fri Dec 25 14:27:37 2015 (r292729) +++ head/sys/netinet/if_ether.c Fri Dec 25 14:51:36 2015 (r292730) @@ -599,7 +599,7 @@ arpintr(struct mbuf *m) layer = "firewire"; /* - * Restrict too long harware addresses. + * Restrict too long hardware addresses. * Currently we are capable of handling 20-byte * addresses ( sizeof(lle->ll_addr) ) */ @@ -608,8 +608,8 @@ arpintr(struct mbuf *m) break; default: ARP_LOG(LOG_NOTICE, - "packet with unknown harware format 0x%02d received on %s\n", - ntohs(ar->ar_hrd), if_name(ifp)); + "packet with unknown hardware format 0x%02d received on " + "%s\n", ntohs(ar->ar_hrd), if_name(ifp)); m_freem(m); return; } From owner-svn-src-all@freebsd.org Fri Dec 25 15:12:13 2015 Return-Path: Delivered-To: svn-src-all@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 7AEEBA51059; Fri, 25 Dec 2015 15:12:13 +0000 (UTC) (envelope-from kp@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 46B0817FD; Fri, 25 Dec 2015 15:12:13 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPFCC7R027552; Fri, 25 Dec 2015 15:12:12 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPFCCfv027548; Fri, 25 Dec 2015 15:12:12 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201512251512.tBPFCCfv027548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 25 Dec 2015 15:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292731 - stable/9/sys/contrib/pf/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 15:12:13 -0000 Author: kp Date: Fri Dec 25 15:12:11 2015 New Revision: 292731 URL: https://svnweb.freebsd.org/changeset/base/292731 Log: pf: Fix TSO issues In certain configurations (mostly but not exclusively as a VM on Xen) pf produced packets with an invalid TCP checksum. The problem was that pf could only handle packets with a full checksum. The FreeBSD IP stack produces TCP packets with a pseudo-header checksum (only addresses, length and protocol). Certain network interfaces expect to see the pseudo-header checksum, so they end up producing packets with invalid checksums. To fix this stop calculating the full checksum and teach pf to only update TCP checksums if TSO is disabled or the change affects the pseudo-header checksum. PR: 154428, 193579, 198868 Sponsored by: RootBSD Modified: stable/9/sys/contrib/pf/net/pf.c stable/9/sys/contrib/pf/net/pf_ioctl.c stable/9/sys/contrib/pf/net/pf_norm.c stable/9/sys/contrib/pf/net/pfvar.h Modified: stable/9/sys/contrib/pf/net/pf.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf.c Fri Dec 25 14:51:36 2015 (r292730) +++ stable/9/sys/contrib/pf/net/pf.c Fri Dec 25 15:12:11 2015 (r292731) @@ -239,7 +239,7 @@ void pf_init_threshold(struct pf_thre void pf_add_threshold(struct pf_threshold *); int pf_check_threshold(struct pf_threshold *); -void pf_change_ap(struct pf_addr *, u_int16_t *, +void pf_change_ap(struct mbuf *, struct pf_addr *, u_int16_t *, u_int16_t *, u_int16_t *, struct pf_addr *, u_int16_t, u_int8_t, sa_family_t); int pf_modulate_sack(struct mbuf *, int, struct pf_pdesc *, @@ -2007,6 +2007,22 @@ pf_addr_wrap_neq(struct pf_addr_wrap *aw } } +/** + * Checksum updates are a little complicated because the checksum in the TCP/UDP + * header isn't always a full checksum. In some cases (i.e. output) it's a + * pseudo-header checksum, which is a partial checksum over src/dst IP + * addresses, protocol number and length. + * + * That means we have the following cases: + * * Input or forwarding: we don't have TSO, the checksum fields are full + * checksums, we need to update the checksum whenever we change anything. + * * Output (i.e. the checksum is a pseudo-header checksum): + * x The field being updated is src/dst address or affects the length of + * the packet. We need to update the pseudo-header checksum (note that this + * checksum is not ones' complement). + * x Some other field is being modified (e.g. src/dst port numbers): We + * don't have to update anything. + **/ u_int16_t pf_cksum_fixup(u_int16_t cksum, u_int16_t old, u_int16_t new, u_int8_t udp) { @@ -2022,9 +2038,20 @@ pf_cksum_fixup(u_int16_t cksum, u_int16_ return (l); } +u_int16_t +pf_proto_cksum_fixup(struct mbuf *m, u_int16_t cksum, u_int16_t old, + u_int16_t new, u_int8_t udp) +{ + if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6)) + return (cksum); + + return (pf_cksum_fixup(cksum, old, new, udp)); +} + void -pf_change_ap(struct pf_addr *a, u_int16_t *p, u_int16_t *ic, u_int16_t *pc, - struct pf_addr *an, u_int16_t pn, u_int8_t u, sa_family_t af) +pf_change_ap(struct mbuf *m, struct pf_addr *a, u_int16_t *p, u_int16_t *ic, + u_int16_t *pc, struct pf_addr *an, u_int16_t pn, u_int8_t u, + sa_family_t af) { struct pf_addr ao; u_int16_t po = *p; @@ -2032,6 +2059,9 @@ pf_change_ap(struct pf_addr *a, u_int16_ PF_ACPY(&ao, a, af); PF_ACPY(a, an, af); + if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6)) + *pc = ~*pc; + *p = pn; switch (af) { @@ -2041,17 +2071,19 @@ pf_change_ap(struct pf_addr *a, u_int16_ ao.addr16[0], an->addr16[0], 0), ao.addr16[1], an->addr16[1], 0); *p = pn; - *pc = pf_cksum_fixup(pf_cksum_fixup(pf_cksum_fixup(*pc, + + *pc = pf_cksum_fixup(pf_cksum_fixup(*pc, ao.addr16[0], an->addr16[0], u), - ao.addr16[1], an->addr16[1], u), - po, pn, u); + ao.addr16[1], an->addr16[1], u); + + *pc = pf_proto_cksum_fixup(m, *pc, po, pn, u); break; #endif /* INET */ #ifdef INET6 case AF_INET6: *pc = pf_cksum_fixup(pf_cksum_fixup(pf_cksum_fixup( pf_cksum_fixup(pf_cksum_fixup(pf_cksum_fixup( - pf_cksum_fixup(pf_cksum_fixup(pf_cksum_fixup(*pc, + pf_cksum_fixup(pf_cksum_fixup(*pc, ao.addr16[0], an->addr16[0], u), ao.addr16[1], an->addr16[1], u), ao.addr16[2], an->addr16[2], u), @@ -2059,13 +2091,20 @@ pf_change_ap(struct pf_addr *a, u_int16_ ao.addr16[4], an->addr16[4], u), ao.addr16[5], an->addr16[5], u), ao.addr16[6], an->addr16[6], u), - ao.addr16[7], an->addr16[7], u), - po, pn, u); + ao.addr16[7], an->addr16[7], u); + + *pc = pf_proto_cksum_fixup(m, *pc, po, pn, u); break; #endif /* INET6 */ } -} + if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | + CSUM_DELAY_DATA_IPV6)) { + *pc = ~*pc; + if (! *pc) + *pc = 0xffff; + } +} /* Changes a u_int32_t. Uses a void * so there are no align restrictions */ void @@ -2079,6 +2118,19 @@ pf_change_a(void *a, u_int16_t *c, u_int ao % 65536, an % 65536, u); } +void +pf_change_proto_a(struct mbuf *m, void *a, u_int16_t *c, u_int32_t an, u_int8_t udp) +{ + u_int32_t ao; + + memcpy(&ao, a, sizeof(ao)); + memcpy(a, &an, sizeof(u_int32_t)); + + *c = pf_proto_cksum_fixup(m, + pf_proto_cksum_fixup(m, *c, ao / 65536, an / 65536, udp), + ao % 65536, an % 65536, udp); +} + #ifdef INET6 void pf_change_a6(struct pf_addr *a, u_int16_t *c, struct pf_addr *an, u_int8_t u) @@ -2228,12 +2280,10 @@ pf_modulate_sack(struct mbuf *m, int off for (i = 2; i + TCPOLEN_SACK <= olen; i += TCPOLEN_SACK) { memcpy(&sack, &opt[i], sizeof(sack)); - pf_change_a(&sack.start, &th->th_sum, - htonl(ntohl(sack.start) - - dst->seqdiff), 0); - pf_change_a(&sack.end, &th->th_sum, - htonl(ntohl(sack.end) - - dst->seqdiff), 0); + pf_change_proto_a(m, &sack.start, &th->th_sum, + htonl(ntohl(sack.start) - dst->seqdiff), 0); + pf_change_proto_a(m, &sack.end, &th->th_sum, + htonl(ntohl(sack.end) - dst->seqdiff), 0); memcpy(&opt[i], &sack, sizeof(sack)); } copyback = 1; @@ -3400,7 +3450,7 @@ pf_test_rule(struct pf_rule **rm, struct if (PF_ANEQ(saddr, &nk->addr[pd->sidx], af) || nk->port[pd->sidx] != sport) { - pf_change_ap(saddr, &th->th_sport, pd->ip_sum, + pf_change_ap(m, saddr, &th->th_sport, pd->ip_sum, &th->th_sum, &nk->addr[pd->sidx], nk->port[pd->sidx], 0, af); pd->sport = &th->th_sport; @@ -3409,7 +3459,7 @@ pf_test_rule(struct pf_rule **rm, struct if (PF_ANEQ(daddr, &nk->addr[pd->didx], af) || nk->port[pd->didx] != dport) { - pf_change_ap(daddr, &th->th_dport, pd->ip_sum, + pf_change_ap(m, daddr, &th->th_dport, pd->ip_sum, &th->th_sum, &nk->addr[pd->didx], nk->port[pd->didx], 0, af); dport = th->th_dport; @@ -3423,7 +3473,7 @@ pf_test_rule(struct pf_rule **rm, struct if (PF_ANEQ(saddr, &nk->addr[pd->sidx], af) || nk->port[pd->sidx] != sport) { - pf_change_ap(saddr, &pd->hdr.udp->uh_sport, + pf_change_ap(m, saddr, &pd->hdr.udp->uh_sport, pd->ip_sum, &pd->hdr.udp->uh_sum, &nk->addr[pd->sidx], nk->port[pd->sidx], 1, af); @@ -3433,7 +3483,7 @@ pf_test_rule(struct pf_rule **rm, struct if (PF_ANEQ(daddr, &nk->addr[pd->didx], af) || nk->port[pd->didx] != dport) { - pf_change_ap(daddr, &pd->hdr.udp->uh_dport, + pf_change_ap(m, daddr, &pd->hdr.udp->uh_dport, pd->ip_sum, &pd->hdr.udp->uh_sum, &nk->addr[pd->didx], nk->port[pd->didx], 1, af); @@ -3845,7 +3895,7 @@ pf_create_state(struct pf_rule *r, struc if ((s->src.seqdiff = pf_tcp_iss(pd) - s->src.seqlo) == 0) s->src.seqdiff = 1; - pf_change_a(&th->th_seq, &th->th_sum, + pf_change_proto_a(m, &th->th_seq, &th->th_sum, htonl(s->src.seqlo + s->src.seqdiff), 0); *rewrite = 1; } else @@ -4175,9 +4225,9 @@ pf_tcp_track_full(struct pf_state_peer * while ((src->seqdiff = arc4random() - seq) == 0) ; ack = ntohl(th->th_ack) - dst->seqdiff; - pf_change_a(&th->th_seq, &th->th_sum, htonl(seq + + pf_change_proto_a(m, &th->th_seq, &th->th_sum, htonl(seq + src->seqdiff), 0); - pf_change_a(&th->th_ack, &th->th_sum, htonl(ack), 0); + pf_change_proto_a(m, &th->th_ack, &th->th_sum, htonl(ack), 0); *copyback = 1; } else { ack = ntohl(th->th_ack); @@ -4227,9 +4277,9 @@ pf_tcp_track_full(struct pf_state_peer * ack = ntohl(th->th_ack) - dst->seqdiff; if (src->seqdiff) { /* Modulate sequence numbers */ - pf_change_a(&th->th_seq, &th->th_sum, htonl(seq + + pf_change_proto_a(m, &th->th_seq, &th->th_sum, htonl(seq + src->seqdiff), 0); - pf_change_a(&th->th_ack, &th->th_sum, htonl(ack), 0); + pf_change_proto_a(m, &th->th_ack, &th->th_sum, htonl(ack), 0); *copyback = 1; } end = seq + pd->p_len; @@ -4729,14 +4779,14 @@ pf_test_state_tcp(struct pf_state **stat if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af) || nk->port[pd->sidx] != th->th_sport) - pf_change_ap(pd->src, &th->th_sport, pd->ip_sum, - &th->th_sum, &nk->addr[pd->sidx], + pf_change_ap(m, pd->src, &th->th_sport, + pd->ip_sum, &th->th_sum, &nk->addr[pd->sidx], nk->port[pd->sidx], 0, pd->af); if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], pd->af) || nk->port[pd->didx] != th->th_dport) - pf_change_ap(pd->dst, &th->th_dport, pd->ip_sum, - &th->th_sum, &nk->addr[pd->didx], + pf_change_ap(m, pd->dst, &th->th_dport, + pd->ip_sum, &th->th_sum, &nk->addr[pd->didx], nk->port[pd->didx], 0, pd->af); copyback = 1; } @@ -4807,13 +4857,13 @@ pf_test_state_udp(struct pf_state **stat if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af) || nk->port[pd->sidx] != uh->uh_sport) - pf_change_ap(pd->src, &uh->uh_sport, pd->ip_sum, + pf_change_ap(m, pd->src, &uh->uh_sport, pd->ip_sum, &uh->uh_sum, &nk->addr[pd->sidx], nk->port[pd->sidx], 1, pd->af); if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], pd->af) || nk->port[pd->didx] != uh->uh_dport) - pf_change_ap(pd->dst, &uh->uh_dport, pd->ip_sum, + pf_change_ap(m, pd->dst, &uh->uh_dport, pd->ip_sum, &uh->uh_sum, &nk->addr[pd->didx], nk->port[pd->didx], 1, pd->af); #ifdef __FreeBSD__ Modified: stable/9/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf_ioctl.c Fri Dec 25 14:51:36 2015 (r292730) +++ stable/9/sys/contrib/pf/net/pf_ioctl.c Fri Dec 25 15:12:11 2015 (r292731) @@ -4158,11 +4158,6 @@ pf_check_out(void *arg, struct mbuf **m, struct ip *h = NULL; int chk; - /* We need a proper CSUM befor we start (s. OpenBSD ip_output) */ - if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { - in_delayed_cksum(*m); - (*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; - } if ((*m)->m_pkthdr.len >= (int)sizeof(*h)) { /* if m_pkthdr.len is less than ip header, pf will handle. */ h = mtod(*m, struct ip *); @@ -4222,14 +4217,6 @@ pf_check6_out(void *arg, struct mbuf **m */ int chk; - /* We need a proper CSUM before we start (s. OpenBSD ip_output) */ - if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { -#ifdef INET - /* XXX-BZ copy&paste error from r126261? */ - in_delayed_cksum(*m); -#endif - (*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; - } CURVNET_SET(ifp->if_vnet); chk = pf_test6(PF_OUT, ifp, m, NULL, inp); CURVNET_RESTORE(); Modified: stable/9/sys/contrib/pf/net/pf_norm.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf_norm.c Fri Dec 25 14:51:36 2015 (r292730) +++ stable/9/sys/contrib/pf/net/pf_norm.c Fri Dec 25 15:12:11 2015 (r292731) @@ -1657,13 +1657,14 @@ pf_normalize_tcp(int dir, struct pfi_kif th->th_x2 = 0; nv = *(u_int16_t *)(&th->th_ack + 1); - th->th_sum = pf_cksum_fixup(th->th_sum, ov, nv, 0); + th->th_sum = pf_proto_cksum_fixup(m, th->th_sum, ov, nv, 0); rewrite = 1; } /* Remove urgent pointer, if TH_URG is not set */ if (!(flags & TH_URG) && th->th_urp) { - th->th_sum = pf_cksum_fixup(th->th_sum, th->th_urp, 0, 0); + th->th_sum = pf_proto_cksum_fixup(m, th->th_sum, th->th_urp, + 0, 0); th->th_urp = 0; rewrite = 1; } @@ -1889,7 +1890,7 @@ pf_normalize_tcp_stateful(struct mbuf *m (src->scrub->pfss_flags & PFSS_TIMESTAMP)) { tsval = ntohl(tsval); - pf_change_a(&opt[2], + pf_change_proto_a(m, &opt[2], &th->th_sum, htonl(tsval + src->scrub->pfss_ts_mod), @@ -1905,7 +1906,7 @@ pf_normalize_tcp_stateful(struct mbuf *m PFSS_TIMESTAMP)) { tsecr = ntohl(tsecr) - dst->scrub->pfss_ts_mod; - pf_change_a(&opt[6], + pf_change_proto_a(m, &opt[6], &th->th_sum, htonl(tsecr), 0); copyback = 1; @@ -2286,8 +2287,8 @@ pf_normalize_tcpopt(struct pf_rule *r, s case TCPOPT_MAXSEG: mss = (u_int16_t *)(optp + 2); if ((ntohs(*mss)) > r->max_mss) { - th->th_sum = pf_cksum_fixup(th->th_sum, - *mss, htons(r->max_mss), 0); + th->th_sum = pf_proto_cksum_fixup(m, + th->th_sum, *mss, htons(r->max_mss), 0); *mss = htons(r->max_mss); rewrite = 1; } Modified: stable/9/sys/contrib/pf/net/pfvar.h ============================================================================== --- stable/9/sys/contrib/pf/net/pfvar.h Fri Dec 25 14:51:36 2015 (r292730) +++ stable/9/sys/contrib/pf/net/pfvar.h Fri Dec 25 15:12:11 2015 (r292731) @@ -1909,6 +1909,8 @@ extern void pf_print_state(struct pf_ extern void pf_print_flags(u_int8_t); extern u_int16_t pf_cksum_fixup(u_int16_t, u_int16_t, u_int16_t, u_int8_t); +extern u_int16_t pf_proto_cksum_fixup(struct mbuf *, u_int16_t, + u_int16_t, u_int16_t, u_int8_t); #ifdef __FreeBSD__ VNET_DECLARE(struct ifnet *, sync_ifp); @@ -1954,6 +1956,9 @@ u_int32_t pf_new_isn(struct pf_state *); void *pf_pull_hdr(struct mbuf *, int, void *, int, u_short *, u_short *, sa_family_t); void pf_change_a(void *, u_int16_t *, u_int32_t, u_int8_t); +void pf_change_proto_a(struct mbuf *, void *, u_int16_t *, u_int32_t, + u_int8_t); +void pf_change_tcp_a(struct mbuf *, void *, u_int16_t *, u_int32_t); int pflog_packet(struct pfi_kif *, struct mbuf *, sa_family_t, u_int8_t, u_int8_t, struct pf_rule *, struct pf_rule *, struct pf_ruleset *, struct pf_pdesc *); From owner-svn-src-all@freebsd.org Fri Dec 25 15:12:55 2015 Return-Path: Delivered-To: svn-src-all@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 D78B5A510D5; Fri, 25 Dec 2015 15:12:55 +0000 (UTC) (envelope-from kp@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 8E7F919C9; Fri, 25 Dec 2015 15:12:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPFCs2a027653; Fri, 25 Dec 2015 15:12:54 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPFCs4H027650; Fri, 25 Dec 2015 15:12:54 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201512251512.tBPFCs4H027650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 25 Dec 2015 15:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292732 - in stable/9/sys: contrib/pf/net netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 15:12:55 -0000 Author: kp Date: Fri Dec 25 15:12:54 2015 New Revision: 292732 URL: https://svnweb.freebsd.org/changeset/base/292732 Log: pf: Fix IPv6 checksums with route-to. When using route-to (or reply-to) pf sends the packet directly to the output interface. If that interface doesn't support checksum offloading the checksum has to be calculated in software. That was already done in the IPv4 case, but not for the IPv6 case. As a result we'd emit packets with pseudo-header checksums (i.e. incorrect checksums). This issue was exposed by the changes in r289316 when pf stopped performing full checksum calculations for all packets. Submitted by: Luoqi Chen Modified: stable/9/sys/contrib/pf/net/pf.c stable/9/sys/netinet6/ip6_output.c stable/9/sys/netinet6/ip6_var.h Modified: stable/9/sys/contrib/pf/net/pf.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf.c Fri Dec 25 15:12:11 2015 (r292731) +++ stable/9/sys/contrib/pf/net/pf.c Fri Dec 25 15:12:54 2015 (r292732) @@ -6340,6 +6340,13 @@ pf_route6(struct mbuf **m, struct pf_rul ip6 = mtod(m0, struct ip6_hdr *); } + if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6 & + ~ifp->if_hwassist) { + uint32_t plen = m0->m_pkthdr.len - sizeof(*ip6); + in6_delayed_cksum(m0, plen, sizeof(struct ip6_hdr)); + m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; + } + /* * If the packet is too large for the outgoing interface, * send back an icmp6 error. Modified: stable/9/sys/netinet6/ip6_output.c ============================================================================== --- stable/9/sys/netinet6/ip6_output.c Fri Dec 25 15:12:11 2015 (r292731) +++ stable/9/sys/netinet6/ip6_output.c Fri Dec 25 15:12:54 2015 (r292732) @@ -184,7 +184,7 @@ static int copypktopts(struct ip6_pktopt }\ } while (/*CONSTCOND*/ 0) -static void +void in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset) { u_short csum; Modified: stable/9/sys/netinet6/ip6_var.h ============================================================================== --- stable/9/sys/netinet6/ip6_var.h Fri Dec 25 15:12:11 2015 (r292731) +++ stable/9/sys/netinet6/ip6_var.h Fri Dec 25 15:12:54 2015 (r292732) @@ -455,6 +455,7 @@ int in6_selectroute_fib(struct sockaddr_ struct rtentry **, u_int); u_int32_t ip6_randomid(void); u_int32_t ip6_randomflowlabel(void); +void in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset); #endif /* _KERNEL */ #endif /* !_NETINET6_IP6_VAR_H_ */ From owner-svn-src-all@freebsd.org Fri Dec 25 16:19:23 2015 Return-Path: Delivered-To: svn-src-all@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 AAB2DA52334; Fri, 25 Dec 2015 16:19:23 +0000 (UTC) (envelope-from sjg@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 6874410BE; Fri, 25 Dec 2015 16:19:23 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPGJMFp045011; Fri, 25 Dec 2015 16:19:22 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPGJL9b045003; Fri, 25 Dec 2015 16:19:21 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201512251619.tBPGJL9b045003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 25 Dec 2015 16:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292733 - in head: contrib/bmake contrib/bmake/mk usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 16:19:23 -0000 Author: sjg Date: Fri Dec 25 16:19:21 2015 New Revision: 292733 URL: https://svnweb.freebsd.org/changeset/base/292733 Log: Merge bmake-20151220 Fixed clearing suffixes impact on null suffix Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/Makefile head/contrib/bmake/mk/ChangeLog head/contrib/bmake/mk/auto.obj.mk head/contrib/bmake/mk/install-mk head/contrib/bmake/os.sh head/contrib/bmake/suff.c head/usr.bin/bmake/Makefile Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Fri Dec 25 15:12:54 2015 (r292732) +++ head/contrib/bmake/ChangeLog Fri Dec 25 16:19:21 2015 (r292733) @@ -1,3 +1,9 @@ +2015-12-20 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151220 + Merge with NetBSD make, pick up + o suff.c: re-initialize suffNull when clearing suffixes. + 2015-12-01 Simon J. Gerraty * Makefile (MAKE_VERSION): 20151201 Modified: head/contrib/bmake/Makefile ============================================================================== --- head/contrib/bmake/Makefile Fri Dec 25 15:12:54 2015 (r292732) +++ head/contrib/bmake/Makefile Fri Dec 25 16:19:21 2015 (r292733) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.48 2015/12/02 00:36:42 sjg Exp $ +# $Id: Makefile,v 1.49 2015/12/20 22:54:40 sjg Exp $ # Base version on src date -MAKE_VERSION= 20151201 +MAKE_VERSION= 20151220 PROG= bmake Modified: head/contrib/bmake/mk/ChangeLog ============================================================================== --- head/contrib/bmake/mk/ChangeLog Fri Dec 25 15:12:54 2015 (r292732) +++ head/contrib/bmake/mk/ChangeLog Fri Dec 25 16:19:21 2015 (r292733) @@ -1,3 +1,9 @@ +2015-12-12 Simon J. Gerraty + + * install-mk (MK_VERSION): 20151212 + * auto.obj.mk: do not require MAKEOBJDIRPREFIX to exist. + only apply :tA to __objdir when comparing to .OBJDIR + 2015-11-14 Simon J. Gerraty * install-mk (MK_VERSION): 20151111 Modified: head/contrib/bmake/mk/auto.obj.mk ============================================================================== --- head/contrib/bmake/mk/auto.obj.mk Fri Dec 25 15:12:54 2015 (r292732) +++ head/contrib/bmake/mk/auto.obj.mk Fri Dec 25 16:19:21 2015 (r292733) @@ -1,4 +1,4 @@ -# $Id: auto.obj.mk,v 1.11 2015/06/16 06:28:21 sjg Exp $ +# $Id: auto.obj.mk,v 1.12 2015/12/16 01:57:06 sjg Exp $ # # @(#) Copyright (c) 2004, Simon J. Gerraty # @@ -40,12 +40,12 @@ MKOBJDIRS= auto .if !defined(NOOBJ) && !defined(NO_OBJ) && ${MKOBJDIRS:Uno} == auto # Use __objdir here so it is easier to tweak without impacting # the logic. -.if !empty(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX}) +.if !empty(MAKEOBJDIRPREFIX) __objdir?= ${MAKEOBJDIRPREFIX}${.CURDIR} .endif __objdir?= ${MAKEOBJDIR:Uobj} -__objdir:= ${__objdir:tA} -.if ${.OBJDIR} != ${__objdir} +__objdir:= ${__objdir} +.if ${.OBJDIR:tA} != ${__objdir:tA} # We need to chdir, make the directory if needed .if !exists(${__objdir}/) && \ (${.TARGETS} == "" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} != "") @@ -53,11 +53,10 @@ __objdir:= ${__objdir:tA} __objdir_made != echo ${__objdir}/; umask ${OBJDIR_UMASK:U002}; \ ${ECHO_TRACE} "[Creating objdir ${__objdir}...]" >&2; \ ${Mkdirs}; Mkdirs ${__objdir} -__objdir:= ${__objdir:tA} .endif # This causes make to use the specified directory as .OBJDIR .OBJDIR: ${__objdir} -.if ${.OBJDIR} != ${__objdir} && ${__objdir_made:Uno:M${__objdir}/*} != "" +.if ${.OBJDIR:tA} != ${__objdir:tA} && ${__objdir_made:Uno:M${__objdir}/*} != "" .error could not use ${__objdir}: .OBJDIR=${.OBJDIR} .endif .endif Modified: head/contrib/bmake/mk/install-mk ============================================================================== --- head/contrib/bmake/mk/install-mk Fri Dec 25 15:12:54 2015 (r292732) +++ head/contrib/bmake/mk/install-mk Fri Dec 25 16:19:21 2015 (r292733) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.117 2015/11/14 18:09:57 sjg Exp $ +# $Id: install-mk,v 1.118 2015/12/16 01:57:06 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20151111 +MK_VERSION=20151212 OWNER= GROUP= MODE=444 Modified: head/contrib/bmake/os.sh ============================================================================== --- head/contrib/bmake/os.sh Fri Dec 25 15:12:54 2015 (r292732) +++ head/contrib/bmake/os.sh Fri Dec 25 16:19:21 2015 (r292733) @@ -17,7 +17,7 @@ # Simon J. Gerraty # RCSid: -# $Id: os.sh,v 1.49 2015/10/25 00:05:40 sjg Exp $ +# $Id: os.sh,v 1.50 2015/12/17 17:06:29 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -56,10 +56,10 @@ Which() { case "$1" in /*) test $t $1 && echo $1;; *) - # some shells cannot correctly handle `IFS` - # in conjunction with the for loop. - _dirs=`IFS=:; echo ${2:-$PATH}` - for d in $_dirs + # some shells cannot correctly handle `IFS` + # in conjunction with the for loop. + _dirs=`IFS=:; echo ${2:-$PATH}` + for d in $_dirs do test $t $d/$1 && { echo $d/$1; break; } done @@ -70,11 +70,11 @@ Which() { # tr is insanely non-portable wrt char classes, so we need to # spell out the alphabet. sed y/// would work too. toUpper() { - ${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ + ${TR:-tr} abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ } toLower() { - ${TR:-tr} ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz + ${TR:-tr} ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz } K= @@ -91,7 +91,7 @@ SunOS) export CHOWN # Great! Solaris keeps moving arch(1) - # should just bite the bullet and use uname -p + # should just bite the bullet and use uname -p arch=`Which arch /usr/bin:/usr/ucb` MAILER=/usr/ucb/Mail @@ -105,8 +105,8 @@ SunOS) MACHINE=$MACHINE_ARCH ;; 4*) - MACHINE_ARCH=`arch` - ;; + MACHINE_ARCH=`arch` + ;; 5*) K=-k LOCAL_FS=ufs @@ -116,8 +116,8 @@ SunOS) # overwriting an existing file!!!!! We want one that works! test -x /usr/xpg4/bin/ln && LN=${LN:-/usr/xpg4/bin/ln} # wonderful, 5.8's tr again require's []'s - # but /usr/xpg4/bin/tr causes problems if LC_COLLATE is set! - # use toUpper/toLower instead. + # but /usr/xpg4/bin/tr causes problems if LC_COLLATE is set! + # use toUpper/toLower instead. ;; esac case "$OS/$MACHINE_ARCH" in @@ -142,9 +142,9 @@ SunOS) SHARE_ARCH=$OS/$HOST ;; OpenBSD) - arch=`Which arch /usr/bin:/usr/ucb:$PATH` - MACHINE_ARCH=`$arch -s` - ;; + arch=`Which arch /usr/bin:/usr/ucb:$PATH` + MACHINE_ARCH=`$arch -s` + ;; esac NAWK=awk export NAWK @@ -218,17 +218,25 @@ export HOST_TARGET case `echo -n .` in -n*) N=; C="\c";; *) N=-n; C=;; esac -export HOSTNAME HOST +Echo() { + case "$1" in + -n) _n=$N _c=$C; shift;; + *) _n= _c=;; + esac + echo $_n "$@" $_c +} + +export HOSTNAME HOST export OS MACHINE MACHINE_ARCH OSREL OSMAJOR LOCAL_FS TMP_DIRS MAILER N C K PS_AXC export LN SHARE_ARCH TR case /$0 in */os.sh) - for v in $* + for v in $* do - eval vv=\$$v - echo "$v='$vv'" + eval vv=\$$v + echo "$v='$vv'" done - ;; + ;; esac Modified: head/contrib/bmake/suff.c ============================================================================== --- head/contrib/bmake/suff.c Fri Dec 25 15:12:54 2015 (r292732) +++ head/contrib/bmake/suff.c Fri Dec 25 16:19:21 2015 (r292733) @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $ */ +/* $NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $"; +static char rcsid[] = "$NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -__RCSID("$NetBSD: suff.c,v 1.74 2015/10/11 04:51:24 sjg Exp $"); +__RCSID("$NetBSD: suff.c,v 1.75 2015/12/20 22:44:10 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -553,7 +553,20 @@ Suff_ClearSuffixes(void) #endif sufflist = Lst_Init(FALSE); sNum = 0; - suffNull = emptySuff; + if (suffNull) + SuffFree(suffNull); + emptySuff = suffNull = bmake_malloc(sizeof(Suff)); + + suffNull->name = bmake_strdup(""); + suffNull->nameLen = 0; + suffNull->searchPath = Lst_Init(FALSE); + Dir_Concat(suffNull->searchPath, dirSearchPath); + suffNull->children = Lst_Init(FALSE); + suffNull->parents = Lst_Init(FALSE); + suffNull->ref = Lst_Init(FALSE); + suffNull->sNum = sNum++; + suffNull->flags = SUFF_NULL; + suffNull->refCount = 1; } /*- @@ -2524,32 +2537,18 @@ Suff_SetNull(char *name) void Suff_Init(void) { - sufflist = Lst_Init(FALSE); #ifdef CLEANUP suffClean = Lst_Init(FALSE); #endif srclist = Lst_Init(FALSE); transforms = Lst_Init(FALSE); - sNum = 0; /* * Create null suffix for single-suffix rules (POSIX). The thing doesn't * actually go on the suffix list or everyone will think that's its * suffix. */ - emptySuff = suffNull = bmake_malloc(sizeof(Suff)); - - suffNull->name = bmake_strdup(""); - suffNull->nameLen = 0; - suffNull->searchPath = Lst_Init(FALSE); - Dir_Concat(suffNull->searchPath, dirSearchPath); - suffNull->children = Lst_Init(FALSE); - suffNull->parents = Lst_Init(FALSE); - suffNull->ref = Lst_Init(FALSE); - suffNull->sNum = sNum++; - suffNull->flags = SUFF_NULL; - suffNull->refCount = 1; - + Suff_ClearSuffixes(); } Modified: head/usr.bin/bmake/Makefile ============================================================================== --- head/usr.bin/bmake/Makefile Fri Dec 25 15:12:54 2015 (r292732) +++ head/usr.bin/bmake/Makefile Fri Dec 25 16:19:21 2015 (r292733) @@ -14,10 +14,10 @@ CFLAGS+= -I${.CURDIR} CLEANDIRS+= FreeBSD CLEANFILES+= bootstrap -# $Id: Makefile,v 1.48 2015/12/02 00:36:42 sjg Exp $ +# $Id: Makefile,v 1.49 2015/12/20 22:54:40 sjg Exp $ # Base version on src date -MAKE_VERSION= 20151201 +MAKE_VERSION= 20151220 PROG?= ${.CURDIR:T} From owner-svn-src-all@freebsd.org Fri Dec 25 18:11:42 2015 Return-Path: Delivered-To: svn-src-all@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 4BCE0A518F7; Fri, 25 Dec 2015 18:11:42 +0000 (UTC) (envelope-from tuexen@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 18F44158F; Fri, 25 Dec 2015 18:11:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBPIBfWN082068; Fri, 25 Dec 2015 18:11:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPIBfqg082066; Fri, 25 Dec 2015 18:11:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201512251811.tBPIBfqg082066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 25 Dec 2015 18:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292734 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 18:11:42 -0000 Author: tuexen Date: Fri Dec 25 18:11:40 2015 New Revision: 292734 URL: https://svnweb.freebsd.org/changeset/base/292734 Log: Don't implicitly terminate a user message when moving it to the send_queue and the socket is closed. This results in strange race conditions for the application. While there, remove a stray character. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Dec 25 16:19:21 2015 (r292733) +++ head/sys/netinet/sctp_output.c Fri Dec 25 18:11:40 2015 (r292734) @@ -7219,7 +7219,7 @@ one_more_time: } /* Whack down the size */ atomic_subtract_int(&stcb->asoc.total_output_queue_size, sp->length); - if ((stcb->sctp_socket != NULL) && \ + if ((stcb->sctp_socket != NULL) && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc, sp->length); @@ -7238,9 +7238,6 @@ one_more_time: } } some_taken = sp->some_taken; - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - sp->msg_is_complete = 1; - } re_look: length = sp->length; if (sp->msg_is_complete) { From owner-svn-src-all@freebsd.org Fri Dec 25 20:19:42 2015 Return-Path: Delivered-To: svn-src-all@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 81BCCA52159 for ; Fri, 25 Dec 2015 20:19:42 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yk0-x232.google.com (mail-yk0-x232.google.com [IPv6:2607:f8b0:4002:c07::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 4BF26121D for ; Fri, 25 Dec 2015 20:19:42 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yk0-x232.google.com with SMTP id x67so60167131ykd.2 for ; Fri, 25 Dec 2015 12:19:42 -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:date:message-id:subject:from:to :cc:content-type; bh=T2rHvCfbGR+xiiBiSalZPDTzbMR65sXyj9x24OO/C60=; b=Xf8plBTPO7fcyQxsNT+U3bEGwrzrzQDMjcuK4YA3yTvvbGGuEEz8Hn6AQPf6UsDAq2 bUBK5RWFkE6Dp+wL17mavqDlCnYUu1BvbZeOKF+zSsqzVlw/tzmuLAJ23ZWRutm5R4HX DGbo6pC0/TumPmSLnVK9GVYl1KsC30hdsy4bmCWyxIXLzJd1K53upO8Ra3nT311dgCVo ZcoBn66LpdUUkTJNMHiVfDua/gjXjbp8hAp25ALg+954p0W/NTSbeClHZmbu4F0wsQ5q XUJ9r4ep5E+KHxZ9kEbHmCA6bXg3Miv3cZaePl+Vc8/V8FRL+42qG8TAZZFCGn3wew+4 Szrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=T2rHvCfbGR+xiiBiSalZPDTzbMR65sXyj9x24OO/C60=; b=SF8aYMttk7KmG+X5gl3gSmtg2Ei9+BdTofBWCk4f3x2qo+8W086T1O2LfTPk67FtVn R9uC3+YfRAhjzP5wn+ft0nsqSIGohlT6qVrRu9twk4XUjrmfnkPuqIfZB57fWJvBtaht gqPNpSpbBobVkYogmMm75/pp87GsZkzTMa/IRTp9Qt+cwSVw5qhp/LUFz+7F9WdrkAJH fY2y5PR6cRNlXiRZJFI9LEJlGsX/nj/+mVOlkD9n0j2pMwmjAzKMkdS84aF46B+DRQq+ MeLSa9zX5SH+oZjkACdgSOfMNKSFc9/u2hwzZTcCeitplYeX5ATQUL4YBUAFH08Susom IzkQ== X-Gm-Message-State: ALoCoQkM2Ic2sRQWJpP9VBRsoxgpSosF+UYdmqy6++kcdZ/JwXXS7ZNsrO/kSoAimC0Rv0NRNFRvVeu1Zdnu2hJvS/YAVH7bCg== MIME-Version: 1.0 X-Received: by 10.129.157.79 with SMTP id u76mr36928155ywg.123.1451074781286; Fri, 25 Dec 2015 12:19:41 -0800 (PST) Received: by 10.129.91.197 with HTTP; Fri, 25 Dec 2015 12:19:41 -0800 (PST) In-Reply-To: <201512251129.tBPBTIZp058825@repo.freebsd.org> References: <201512251129.tBPBTIZp058825@repo.freebsd.org> Date: Fri, 25 Dec 2015 21:19:41 +0100 Message-ID: Subject: Re: svn commit: r292723 - in head: lib/libc share/mk From: Ed Schouten To: Colin Percival Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 20:19:42 -0000 Hi Colin, First of all: I Am Not A Linker Expert. 2015-12-25 12:29 GMT+01:00 Colin Percival : > Make libxnet.so a symlink to libc.so. This makes `-lxnet` a no-op, as > POSIX requires for the c99 compiler. I seem to remember I had some issues in the past where I was linking against libc explicitly. Maybe it had something to do with linking both against -lpthread and -lc, but if you pass in -lc later on the command line, libc overrides the symbols that have to be provided by -lpthread? If that's (still) the case, would it make sense to just provide libxnet in the form of an empty .a file instead? -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-all@freebsd.org Fri Dec 25 21:03:23 2015 Return-Path: Delivered-To: svn-src-all@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 DE8B5A52BD2; Fri, 25 Dec 2015 21:03:23 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.netplex.net", Issuer "RapidSSL SHA256 CA - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8A51144D; Fri, 25 Dec 2015 21:03:23 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.15.1/8.15.1/NETPLEX) with ESMTP id tBPL3GRx060877; Fri, 25 Dec 2015 16:03:16 -0500 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.4.3 (mail.netplex.net [204.213.176.9]); Fri, 25 Dec 2015 16:03:16 -0500 (EST) Date: Fri, 25 Dec 2015 16:03:16 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net Reply-To: Daniel Eischen To: Ed Schouten cc: Colin Percival , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292723 - in head: lib/libc share/mk In-Reply-To: Message-ID: References: <201512251129.tBPBTIZp058825@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 21:03:24 -0000 On Fri, 25 Dec 2015, Ed Schouten wrote: > Hi Colin, > > First of all: I Am Not A Linker Expert. > > 2015-12-25 12:29 GMT+01:00 Colin Percival : >> Make libxnet.so a symlink to libc.so. This makes `-lxnet` a no-op, as >> POSIX requires for the c99 compiler. > > I seem to remember I had some issues in the past where I was linking > against libc explicitly. Maybe it had something to do with linking > both against -lpthread and -lc, but if you pass in -lc later on the > command line, libc overrides the symbols that have to be provided by > -lpthread? > > If that's (still) the case, would it make sense to just provide > libxnet in the form of an empty .a file instead? I think that's a good point. Using -lanything shouldn't introduce an unexpected link order. -- DE From owner-svn-src-all@freebsd.org Fri Dec 25 21:39:50 2015 Return-Path: Delivered-To: svn-src-all@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 9C31AA51478; Fri, 25 Dec 2015 21:39:50 +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 4524F11D8; Fri, 25 Dec 2015 21:39:50 +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 tBPLdnN4049302; Fri, 25 Dec 2015 21:39:49 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBPLdj3F049264; Fri, 25 Dec 2015 21:39:45 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201512252139.tBPLdj3F049264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 25 Dec 2015 21:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292735 - in head: . contrib/llvm/include/llvm-c contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen/AsmPrinter contrib/llvm/lib/CodeGen/SelectionDAG contrib/llvm/lib/IR contrib/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2015 21:39:50 -0000 Author: dim Date: Fri Dec 25 21:39:45 2015 New Revision: 292735 URL: https://svnweb.freebsd.org/changeset/base/292735 Log: Upgrade our copies of clang and llvm to 3.7.1 release. This is a bugfix-only release, with no new features. Please note that from 3.5.0 onwards, clang and llvm require C++11 support to build; see UPDATING for more information. Added: head/contrib/llvm/patches/patch-08-clang-cc1as-dwarf2.diff - copied unchanged from r292734, head/contrib/llvm/patches/patch-10-clang-cc1as-dwarf2.diff Deleted: head/contrib/llvm/patches/patch-08-llvm-r250085-fix-avx-crash.diff head/contrib/llvm/patches/patch-09-clang-r250657-openmp.diff head/contrib/llvm/patches/patch-10-clang-cc1as-dwarf2.diff Modified: head/ObsoleteFiles.inc head/contrib/llvm/include/llvm-c/Core.h head/contrib/llvm/include/llvm/CodeGen/CommandFlags.h head/contrib/llvm/lib/CodeGen/AsmPrinter/WinException.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp head/contrib/llvm/lib/IR/AsmWriter.cpp head/contrib/llvm/lib/IR/Core.cpp head/contrib/llvm/lib/LTO/LTOCodeGenerator.cpp head/contrib/llvm/lib/MC/MCContext.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp head/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterInfo.td head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp head/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp head/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.h head/contrib/llvm/lib/Target/AMDGPU/SIInstructions.td head/contrib/llvm/lib/Target/AMDGPU/SIPrepareScratchRegs.cpp head/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp head/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.h head/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp head/contrib/llvm/lib/Target/BPF/BPFISelDAGToDAG.cpp head/contrib/llvm/lib/Target/BPF/BPFISelLowering.cpp head/contrib/llvm/lib/Target/BPF/BPFInstrInfo.td head/contrib/llvm/lib/Target/BPF/BPFRegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.h head/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp head/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrQPX.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrVSX.td head/contrib/llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp head/contrib/llvm/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp head/contrib/llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp (contents, props changed) head/contrib/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp head/contrib/llvm/lib/Transforms/Scalar/GVN.cpp head/contrib/llvm/lib/Transforms/Utils/Local.cpp head/contrib/llvm/patches/README.TXT head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp head/contrib/llvm/tools/llvm-lto/llvm-lto.cpp head/etc/mtree/BSD.debug.dist head/etc/mtree/BSD.usr.dist head/lib/clang/include/Makefile head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/clang/Config/config.h head/lib/clang/include/llvm/Config/config.h head/lib/clang/include/llvm/Config/llvm-config.h head/lib/libclang_rt/Makefile.inc head/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/llvm-dwarfdump/ (props changed) head/contrib/llvm/tools/llvm-lto/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Dec 25 18:11:40 2015 (r292734) +++ head/ObsoleteFiles.inc Fri Dec 25 21:39:45 2015 (r292735) @@ -38,6 +38,88 @@ # xargs -n1 | sort | uniq -d; # done +# 20151225: new clang import which bumps version from 3.7.0 to 3.7.1. +OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/3.7.0/include/sanitizer/tsan_interface_atomic.h +OLD_DIRS+=usr/lib/clang/3.7.0/include/sanitizer +OLD_FILES+=usr/lib/clang/3.7.0/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/3.7.0/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/3.7.0/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/3.7.0/include/adxintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/altivec.h +OLD_FILES+=usr/lib/clang/3.7.0/include/ammintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/arm_acle.h +OLD_FILES+=usr/lib/clang/3.7.0/include/arm_neon.h +OLD_FILES+=usr/lib/clang/3.7.0/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/avxintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/cpuid.h +OLD_FILES+=usr/lib/clang/3.7.0/include/cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/3.7.0/include/emmintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/htmintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/immintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/3.7.0/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/3.7.0/include/mmintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/module.modulemap +OLD_FILES+=usr/lib/clang/3.7.0/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/s390intrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/shaintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/smmintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/vadefs.h +OLD_FILES+=usr/lib/clang/3.7.0/include/vecintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/x86intrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/xopintrin.h +OLD_FILES+=usr/lib/clang/3.7.0/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/3.7.0/include +OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_DIRS+=usr/lib/clang/3.7.0/lib/freebsd +OLD_DIRS+=usr/lib/clang/3.7.0/lib +OLD_DIRS+=usr/lib/clang/3.7.0 # 20151130: libelf moved from /usr/lib to /lib (libkvm dependency in r291406) OLD_LIBS+=usr/lib/libelf.so.2 # 20151115: Fox bad upgrade scheme Modified: head/contrib/llvm/include/llvm-c/Core.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Core.h Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/include/llvm-c/Core.h Fri Dec 25 21:39:45 2015 (r292735) @@ -2675,7 +2675,8 @@ LLVMValueRef LLVMBuildInvoke(LLVMBuilder LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, const char *Name); LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, - unsigned NumClauses, const char *Name); + LLVMValueRef PersFn, unsigned NumClauses, + const char *Name); LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn); LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef); Modified: head/contrib/llvm/include/llvm/CodeGen/CommandFlags.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/CommandFlags.h Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/include/llvm/CodeGen/CommandFlags.h Fri Dec 25 21:39:45 2015 (r292735) @@ -21,7 +21,7 @@ #include "llvm/IR/Intrinsics.h" #include "llvm/IR/Module.h" #include "llvm/MC/MCTargetOptionsCommandFlags.h" -#include "llvm//MC/SubtargetFeature.h" +#include "llvm/MC/SubtargetFeature.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Host.h" Modified: head/contrib/llvm/lib/CodeGen/AsmPrinter/WinException.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/AsmPrinter/WinException.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/CodeGen/AsmPrinter/WinException.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -169,7 +169,7 @@ void WinException::endFunction(const Mac Asm->OutStreamer->PopSection(); } - if (shouldEmitMoves) + if (shouldEmitMoves || shouldEmitPersonality) Asm->OutStreamer->EmitWinCFIEndProc(); } Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -439,7 +439,7 @@ ExpandUnalignedLoad(LoadSDNode *LD, Sele ISD::ANY_EXTEND, dl, VT, Result); ValResult = Result; - ChainResult = Chain; + ChainResult = newLoad.getValue(1); return; } Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -1010,6 +1010,8 @@ SDValue DAGTypeLegalizer::GetVectorEleme // Calculate the element offset and add it to the pointer. unsigned EltSize = EltVT.getSizeInBits() / 8; // FIXME: should be ABI size. + assert(EltSize * 8 == EltVT.getSizeInBits() && + "Converting bits to bytes lost precision"); Index = DAG.getNode(ISD::MUL, dl, Index.getValueType(), Index, DAG.getConstant(EltSize, dl, Index.getValueType())); Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -1528,9 +1528,25 @@ SDValue DAGTypeLegalizer::SplitVecOp_EXT if (CustomLowerNode(N, N->getValueType(0), true)) return SDValue(); - // Store the vector to the stack. - EVT EltVT = VecVT.getVectorElementType(); + // Make the vector elements byte-addressable if they aren't already. SDLoc dl(N); + EVT EltVT = VecVT.getVectorElementType(); + if (EltVT.getSizeInBits() < 8) { + SmallVector ElementOps; + for (unsigned i = 0; i < VecVT.getVectorNumElements(); ++i) { + ElementOps.push_back(DAG.getAnyExtOrTrunc( + DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, EltVT, Vec, + DAG.getConstant(i, dl, MVT::i8)), + dl, MVT::i8)); + } + + EltVT = MVT::i8; + VecVT = EVT::getVectorVT(*DAG.getContext(), EltVT, + VecVT.getVectorNumElements()); + Vec = DAG.getNode(ISD::BUILD_VECTOR, dl, VecVT, ElementOps); + } + + // Store the vector to the stack. SDValue StackPtr = DAG.CreateStackTemporary(VecVT); SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, Vec, StackPtr, MachinePointerInfo(), false, false, 0); Modified: head/contrib/llvm/lib/IR/AsmWriter.cpp ============================================================================== --- head/contrib/llvm/lib/IR/AsmWriter.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/IR/AsmWriter.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -794,6 +794,10 @@ void SlotTracker::processFunction() { ST_DEBUG("begin processFunction!\n"); fNext = 0; + // Process function metadata if it wasn't hit at the module-level. + if (!ShouldInitializeAllMetadata) + processFunctionMetadata(*TheFunction); + // Add all the function arguments with no names. for(Function::const_arg_iterator AI = TheFunction->arg_begin(), AE = TheFunction->arg_end(); AI != AE; ++AI) @@ -807,8 +811,6 @@ void SlotTracker::processFunction() { if (!BB.hasName()) CreateFunctionSlot(&BB); - processFunctionMetadata(*TheFunction); - for (auto &I : BB) { if (!I.getType()->isVoidTy() && !I.hasName()) CreateFunctionSlot(&I); @@ -836,11 +838,11 @@ void SlotTracker::processFunction() { void SlotTracker::processFunctionMetadata(const Function &F) { SmallVector, 4> MDs; - for (auto &BB : F) { - F.getAllMetadata(MDs); - for (auto &MD : MDs) - CreateMetadataSlot(MD.second); + F.getAllMetadata(MDs); + for (auto &MD : MDs) + CreateMetadataSlot(MD.second); + for (auto &BB : F) { for (auto &I : BB) processInstructionMetadata(I); } Modified: head/contrib/llvm/lib/IR/Core.cpp ============================================================================== --- head/contrib/llvm/lib/IR/Core.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/IR/Core.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -2257,7 +2257,14 @@ LLVMValueRef LLVMBuildInvoke(LLVMBuilder } LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, - unsigned NumClauses, const char *Name) { + LLVMValueRef PersFn, unsigned NumClauses, + const char *Name) { + // The personality used to live on the landingpad instruction, but now it + // lives on the parent function. For compatibility, take the provided + // personality and put it on the parent function. + if (PersFn) + unwrap(B)->GetInsertBlock()->getParent()->setPersonalityFn( + cast(unwrap(PersFn))); return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), NumClauses, Name)); } Modified: head/contrib/llvm/lib/LTO/LTOCodeGenerator.cpp ============================================================================== --- head/contrib/llvm/lib/LTO/LTOCodeGenerator.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/LTO/LTOCodeGenerator.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -63,14 +63,21 @@ const char* LTOCodeGenerator::getVersion #endif } +static void handleLTODiagnostic(const DiagnosticInfo &DI) { + DiagnosticPrinterRawOStream DP(errs()); + DI.print(DP); + errs() << "\n"; +} + LTOCodeGenerator::LTOCodeGenerator() - : Context(getGlobalContext()), IRLinker(new Module("ld-temp.o", Context)) { + : Context(getGlobalContext()), IRLinker(new Module("ld-temp.o", Context), + handleLTODiagnostic) { initializeLTOPasses(); } LTOCodeGenerator::LTOCodeGenerator(std::unique_ptr Context) : OwnedContext(std::move(Context)), Context(*OwnedContext), - IRLinker(new Module("ld-temp.o", *OwnedContext)) { + IRLinker(new Module("ld-temp.o", *OwnedContext), handleLTODiagnostic) { initializeLTOPasses(); } Modified: head/contrib/llvm/lib/MC/MCContext.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCContext.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/MC/MCContext.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -82,6 +82,7 @@ void MCContext::reset() { UsedNames.clear(); Symbols.clear(); + SectionSymbols.clear(); Allocator.Reset(); Instances.clear(); CompilationDir.clear(); Modified: head/contrib/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -264,6 +264,12 @@ void AMDGPUAsmPrinter::getSIProgramInfo( for (const MachineBasicBlock &MBB : MF) { for (const MachineInstr &MI : MBB) { // TODO: CodeSize should account for multiple functions. + + // TODO: Should we count size of debug info? + if (MI.isDebugValue()) + continue; + + // FIXME: This is reporting 0 for many instructions. CodeSize += MI.getDesc().Size; unsigned numOperands = MI.getNumOperands(); Modified: head/contrib/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -134,13 +134,17 @@ static Value* GEPToVectorIndex(GetElemen // // TODO: Check isTriviallyVectorizable for calls and handle other // instructions. -static bool canVectorizeInst(Instruction *Inst) { +static bool canVectorizeInst(Instruction *Inst, User *User) { switch (Inst->getOpcode()) { case Instruction::Load: - case Instruction::Store: case Instruction::BitCast: case Instruction::AddrSpaceCast: return true; + case Instruction::Store: { + // Must be the stored pointer operand, not a stored value. + StoreInst *SI = cast(Inst); + return SI->getPointerOperand() == User; + } default: return false; } @@ -166,7 +170,7 @@ static bool tryPromoteAllocaToVector(All for (User *AllocaUser : Alloca->users()) { GetElementPtrInst *GEP = dyn_cast(AllocaUser); if (!GEP) { - if (!canVectorizeInst(cast(AllocaUser))) + if (!canVectorizeInst(cast(AllocaUser), Alloca)) return false; WorkList.push_back(AllocaUser); @@ -184,7 +188,7 @@ static bool tryPromoteAllocaToVector(All GEPVectorIdx[GEP] = Index; for (User *GEPUser : AllocaUser->users()) { - if (!canVectorizeInst(cast(GEPUser))) + if (!canVectorizeInst(cast(GEPUser), AllocaUser)) return false; WorkList.push_back(GEPUser); @@ -240,7 +244,12 @@ static bool collectUsesWithPtrTypes(Valu for (User *User : Val->users()) { if(std::find(WorkList.begin(), WorkList.end(), User) != WorkList.end()) continue; - if (isa(User)) { + if (CallInst *CI = dyn_cast(User)) { + // TODO: We might be able to handle some cases where the callee is a + // constantexpr bitcast of a function. + if (!CI->getCalledFunction()) + return false; + WorkList.push_back(User); continue; } @@ -250,6 +259,12 @@ static bool collectUsesWithPtrTypes(Valu if (UseInst && UseInst->getOpcode() == Instruction::PtrToInt) return false; + if (StoreInst *SI = dyn_cast_or_null(UseInst)) { + // Reject if the stored value is not the pointer operand. + if (SI->getPointerOperand() != Val) + return false; + } + if (!User->getType()->isPointerTy()) continue; Modified: head/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterInfo.td Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/AMDGPU/AMDGPURegisterInfo.td Fri Dec 25 21:39:45 2015 (r292735) @@ -14,8 +14,7 @@ let Namespace = "AMDGPU" in { foreach Index = 0-15 in { - // Indices are used in a variety of ways here, so don't set a size/offset. - def sub#Index : SubRegIndex<-1, -1>; + def sub#Index : SubRegIndex<32, !shl(Index, 5)>; } def INDIRECT_BASE_ADDR : Register <"INDIRECT_BASE_ADDR">; Modified: head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -71,12 +71,26 @@ void AMDGPUMCObjectWriter::writeObject(M } } +static unsigned getFixupKindNumBytes(unsigned Kind) { + switch (Kind) { + case FK_Data_1: + return 1; + case FK_Data_2: + return 2; + case FK_Data_4: + return 4; + case FK_Data_8: + return 8; + default: + llvm_unreachable("Unknown fixup kind!"); + } +} + void AMDGPUAsmBackend::applyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize, uint64_t Value, bool IsPCRel) const { switch ((unsigned)Fixup.getKind()) { - default: llvm_unreachable("Unknown fixup kind"); case AMDGPU::fixup_si_sopp_br: { uint16_t *Dst = (uint16_t*)(Data + Fixup.getOffset()); *Dst = (Value - 4) / 4; @@ -96,6 +110,24 @@ void AMDGPUAsmBackend::applyFixup(const *Dst = Value + 4; break; } + default: { + // FIXME: Copied from AArch64 + unsigned NumBytes = getFixupKindNumBytes(Fixup.getKind()); + if (!Value) + return; // Doesn't change encoding. + MCFixupKindInfo Info = getFixupKindInfo(Fixup.getKind()); + + // Shift the value into position. + Value <<= Info.TargetOffset; + + unsigned Offset = Fixup.getOffset(); + assert(Offset + NumBytes <= DataSize && "Invalid fixup offset!"); + + // For each byte of the fragment that the fixup touches, mask in the + // bits from the fixup value. + for (unsigned i = 0; i != NumBytes; ++i) + Data[Offset + i] |= uint8_t((Value >> (i * 8)) & 0xff); + } } } Modified: head/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/AMDGPU/SIISelLowering.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -157,6 +157,7 @@ SITargetLowering::SITargetLowering(Targe setTruncStoreAction(MVT::i64, MVT::i32, Expand); setTruncStoreAction(MVT::v8i32, MVT::v8i16, Expand); + setTruncStoreAction(MVT::v16i32, MVT::v16i8, Expand); setTruncStoreAction(MVT::v16i32, MVT::v16i16, Expand); setOperationAction(ISD::LOAD, MVT::i1, Custom); @@ -2252,10 +2253,8 @@ MachineSDNode *SITargetLowering::buildSc SDValue Ptr) const { const SIInstrInfo *TII = static_cast(Subtarget->getInstrInfo()); - uint64_t Rsrc = TII->getDefaultRsrcDataFormat() | AMDGPU::RSRC_TID_ENABLE | - 0xffffffff; // Size - return buildRSRC(DAG, DL, Ptr, 0, Rsrc); + return buildRSRC(DAG, DL, Ptr, 0, TII->getScratchRsrcWords23()); } SDValue SITargetLowering::CreateLiveInRegister(SelectionDAG &DAG, Modified: head/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -2778,3 +2778,16 @@ uint64_t SIInstrInfo::getDefaultRsrcData return RsrcDataFormat; } + +uint64_t SIInstrInfo::getScratchRsrcWords23() const { + uint64_t Rsrc23 = getDefaultRsrcDataFormat() | + AMDGPU::RSRC_TID_ENABLE | + 0xffffffff; // Size; + + // If TID_ENABLE is set, DATA_FORMAT specifies stride bits [14:17]. + // Clear them unless we want a huge stride. + if (ST.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS) + Rsrc23 &= ~AMDGPU::RSRC_DATA_FORMAT; + + return Rsrc23; +} Modified: head/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.h ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.h Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/AMDGPU/SIInstrInfo.h Fri Dec 25 21:39:45 2015 (r292735) @@ -353,7 +353,7 @@ public: } uint64_t getDefaultRsrcDataFormat() const; - + uint64_t getScratchRsrcWords23() const; }; namespace AMDGPU { Modified: head/contrib/llvm/lib/Target/AMDGPU/SIInstructions.td ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/SIInstructions.td Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/AMDGPU/SIInstructions.td Fri Dec 25 21:39:45 2015 (r292735) @@ -1548,6 +1548,12 @@ defm V_WRITELANE_B32 : VOP2SI_3VI_m < // These instructions only exist on SI and CI let SubtargetPredicate = isSICI in { +let isCommutable = 1 in { +defm V_MAC_LEGACY_F32 : VOP2InstSI , "v_mac_legacy_f32", + VOP_F32_F32_F32 +>; +} // End isCommutable = 1 + defm V_MIN_LEGACY_F32 : VOP2InstSI , "v_min_legacy_f32", VOP_F32_F32_F32, AMDGPUfmin_legacy >; @@ -1562,12 +1568,6 @@ defm V_LSHL_B32 : VOP2InstSI } // End isCommutable = 1 } // End let SubtargetPredicate = SICI -let isCommutable = 1 in { -defm V_MAC_LEGACY_F32 : VOP2_VI3_Inst , "v_mac_legacy_f32", - VOP_F32_F32_F32 ->; -} // End isCommutable = 1 - defm V_BFM_B32 : VOP2_VI3_Inst , "v_bfm_b32", VOP_I32_I32_I32 >; Modified: head/contrib/llvm/lib/Target/AMDGPU/SIPrepareScratchRegs.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/SIPrepareScratchRegs.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/AMDGPU/SIPrepareScratchRegs.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -135,8 +135,7 @@ bool SIPrepareScratchRegs::runOnMachineF unsigned ScratchRsrcReg = RS.scavengeRegister(&AMDGPU::SReg_128RegClass, 0); - uint64_t Rsrc = AMDGPU::RSRC_DATA_FORMAT | AMDGPU::RSRC_TID_ENABLE | - 0xffffffff; // Size + uint64_t Rsrc23 = TII->getScratchRsrcWords23(); unsigned Rsrc0 = TRI->getSubReg(ScratchRsrcReg, AMDGPU::sub0); unsigned Rsrc1 = TRI->getSubReg(ScratchRsrcReg, AMDGPU::sub1); @@ -152,11 +151,11 @@ bool SIPrepareScratchRegs::runOnMachineF .addReg(ScratchRsrcReg, RegState::ImplicitDefine); BuildMI(MBB, I, DL, TII->get(AMDGPU::S_MOV_B32), Rsrc2) - .addImm(Rsrc & 0xffffffff) + .addImm(Rsrc23 & 0xffffffff) .addReg(ScratchRsrcReg, RegState::ImplicitDefine); BuildMI(MBB, I, DL, TII->get(AMDGPU::S_MOV_B32), Rsrc3) - .addImm(Rsrc >> 32) + .addImm(Rsrc23 >> 32) .addReg(ScratchRsrcReg, RegState::ImplicitDefine); // Scratch Offset Modified: head/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -26,23 +26,25 @@ using namespace llvm; SIRegisterInfo::SIRegisterInfo() : AMDGPURegisterInfo() {} -BitVector SIRegisterInfo::getReservedRegs(const MachineFunction &MF) const { - BitVector Reserved(getNumRegs()); - Reserved.set(AMDGPU::EXEC); +void SIRegisterInfo::reserveRegisterTuples(BitVector &Reserved, unsigned Reg) const { + MCRegAliasIterator R(Reg, this, true); - // EXEC_LO and EXEC_HI could be allocated and used as regular register, - // but this seems likely to result in bugs, so I'm marking them as reserved. - Reserved.set(AMDGPU::EXEC_LO); - Reserved.set(AMDGPU::EXEC_HI); + for (; R.isValid(); ++R) + Reserved.set(*R); +} +BitVector SIRegisterInfo::getReservedRegs(const MachineFunction &MF) const { + BitVector Reserved(getNumRegs()); Reserved.set(AMDGPU::INDIRECT_BASE_ADDR); - Reserved.set(AMDGPU::FLAT_SCR); - Reserved.set(AMDGPU::FLAT_SCR_LO); - Reserved.set(AMDGPU::FLAT_SCR_HI); + + // EXEC_LO and EXEC_HI could be allocated and used as regular register, but + // this seems likely to result in bugs, so I'm marking them as reserved. + reserveRegisterTuples(Reserved, AMDGPU::EXEC); + reserveRegisterTuples(Reserved, AMDGPU::FLAT_SCR); // Reserve some VGPRs to use as temp registers in case we have to spill VGPRs - Reserved.set(AMDGPU::VGPR255); - Reserved.set(AMDGPU::VGPR254); + reserveRegisterTuples(Reserved, AMDGPU::VGPR254); + reserveRegisterTuples(Reserved, AMDGPU::VGPR255); // Tonga and Iceland can only allocate a fixed number of SGPRs due // to a hw bug. @@ -54,10 +56,7 @@ BitVector SIRegisterInfo::getReservedReg for (unsigned i = Limit; i < NumSGPRs; ++i) { unsigned Reg = AMDGPU::SGPR_32RegClass.getRegister(i); - MCRegAliasIterator R = MCRegAliasIterator(Reg, this, true); - - for (; R.isValid(); ++R) - Reserved.set(*R); + reserveRegisterTuples(Reserved, Reg); } } Modified: head/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.h ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.h Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.h Fri Dec 25 21:39:45 2015 (r292735) @@ -23,7 +23,10 @@ namespace llvm { struct SIRegisterInfo : public AMDGPURegisterInfo { +private: + void reserveRegisterTuples(BitVector &, unsigned Reg) const; +public: SIRegisterInfo(); BitVector getReservedRegs(const MachineFunction &MF) const override; Modified: head/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -15,6 +15,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringSwitch.h" +#include "llvm/ADT/Triple.h" #include "llvm/ADT/Twine.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCAssembler.h" @@ -9104,6 +9105,10 @@ bool ARMAsmParser::parseDirectiveArch(SM return false; } + Triple T; + STI.setDefaultFeatures(T.getARMCPUForArch(Arch)); + setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits())); + getTargetStreamer().emitArch(ID); return false; } Modified: head/contrib/llvm/lib/Target/BPF/BPFISelDAGToDAG.cpp ============================================================================== --- head/contrib/llvm/lib/Target/BPF/BPFISelDAGToDAG.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/BPF/BPFISelDAGToDAG.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -50,6 +50,7 @@ private: // Complex Pattern for address selection. bool SelectAddr(SDValue Addr, SDValue &Base, SDValue &Offset); + bool SelectFIAddr(SDValue Addr, SDValue &Base, SDValue &Offset); }; } @@ -67,7 +68,7 @@ bool BPFDAGToDAGISel::SelectAddr(SDValue Addr.getOpcode() == ISD::TargetGlobalAddress) return false; - // Addresses of the form FI+const or FI|const + // Addresses of the form Addr+const or Addr|const if (CurDAG->isBaseWithConstantOffset(Addr)) { ConstantSDNode *CN = dyn_cast(Addr.getOperand(1)); if (isInt<32>(CN->getSExtValue())) { @@ -89,6 +90,31 @@ bool BPFDAGToDAGISel::SelectAddr(SDValue return true; } +// ComplexPattern used on BPF FI instruction +bool BPFDAGToDAGISel::SelectFIAddr(SDValue Addr, SDValue &Base, SDValue &Offset) { + SDLoc DL(Addr); + + if (!CurDAG->isBaseWithConstantOffset(Addr)) + return false; + + // Addresses of the form Addr+const or Addr|const + ConstantSDNode *CN = dyn_cast(Addr.getOperand(1)); + if (isInt<32>(CN->getSExtValue())) { + + // If the first operand is a FI, get the TargetFI Node + if (FrameIndexSDNode *FIN = + dyn_cast(Addr.getOperand(0))) + Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i64); + else + return false; + + Offset = CurDAG->getTargetConstant(CN->getSExtValue(), DL, MVT::i64); + return true; + } + + return false; +} + SDNode *BPFDAGToDAGISel::Select(SDNode *Node) { unsigned Opcode = Node->getOpcode(); @@ -104,13 +130,6 @@ SDNode *BPFDAGToDAGISel::Select(SDNode * // tablegen selection should be handled here. switch (Opcode) { default: break; - - case ISD::UNDEF: { - errs() << "BUG: "; Node->dump(CurDAG); errs() << '\n'; - report_fatal_error("shouldn't see UNDEF during Select"); - break; - } - case ISD::INTRINSIC_W_CHAIN: { unsigned IntNo = cast(Node->getOperand(1))->getZExtValue(); switch (IntNo) { Modified: head/contrib/llvm/lib/Target/BPF/BPFISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/BPF/BPFISelLowering.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/BPF/BPFISelLowering.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -102,6 +102,7 @@ BPFTargetLowering::BPFTargetLowering(con setOperationAction(ISD::BR_CC, MVT::i64, Custom); setOperationAction(ISD::BR_JT, MVT::Other, Expand); + setOperationAction(ISD::BRIND, MVT::Other, Expand); setOperationAction(ISD::BRCOND, MVT::Other, Expand); setOperationAction(ISD::SETCC, MVT::i64, Expand); setOperationAction(ISD::SELECT, MVT::i64, Expand); @@ -128,9 +129,6 @@ BPFTargetLowering::BPFTargetLowering(con setOperationAction(ISD::SUBC, MVT::i64, Expand); setOperationAction(ISD::SUBE, MVT::i64, Expand); - // no UNDEF allowed - setOperationAction(ISD::UNDEF, MVT::i64, Expand); - setOperationAction(ISD::ROTR, MVT::i64, Expand); setOperationAction(ISD::ROTL, MVT::i64, Expand); setOperationAction(ISD::SHL_PARTS, MVT::i64, Expand); Modified: head/contrib/llvm/lib/Target/BPF/BPFInstrInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/BPF/BPFInstrInfo.td Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/BPF/BPFInstrInfo.td Fri Dec 25 21:39:45 2015 (r292735) @@ -54,7 +54,8 @@ def i64immSExt32 : PatLeaf<(imm), [{return isInt<32>(N->getSExtValue()); }]>; // Addressing modes. -def ADDRri : ComplexPattern; +def ADDRri : ComplexPattern; +def FIri : ComplexPattern; // Address operands def MEMri : Operand { @@ -260,6 +261,15 @@ def MOV_rr : MOV_RR<"mov">; def MOV_ri : MOV_RI<"mov">; } +def FI_ri + : InstBPF<(outs GPR:$dst), (ins MEMri:$addr), + "lea\t$dst, $addr", + [(set i64:$dst, FIri:$addr)]> { + // This is a tentative instruction, and will be replaced + // with MOV_rr and ADD_ri in PEI phase +} + + def LD_pseudo : InstBPF<(outs GPR:$dst), (ins i64imm:$pseudo, u64imm:$imm), "ld_pseudo\t$dst, $pseudo, $imm", Modified: head/contrib/llvm/lib/Target/BPF/BPFRegisterInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/BPF/BPFRegisterInfo.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/BPF/BPFRegisterInfo.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -58,14 +58,13 @@ void BPFRegisterInfo::eliminateFrameInde unsigned FrameReg = getFrameRegister(MF); int FrameIndex = MI.getOperand(i).getIndex(); + const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo(); + MachineBasicBlock &MBB = *MI.getParent(); if (MI.getOpcode() == BPF::MOV_rr) { - const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo(); int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex); MI.getOperand(i).ChangeToRegister(FrameReg, false); - - MachineBasicBlock &MBB = *MI.getParent(); unsigned reg = MI.getOperand(i - 1).getReg(); BuildMI(MBB, ++II, DL, TII.get(BPF::ADD_ri), reg) .addReg(reg) @@ -79,8 +78,24 @@ void BPFRegisterInfo::eliminateFrameInde if (!isInt<32>(Offset)) llvm_unreachable("bug in frame offset"); - MI.getOperand(i).ChangeToRegister(FrameReg, false); - MI.getOperand(i + 1).ChangeToImmediate(Offset); + if (MI.getOpcode() == BPF::FI_ri) { + // architecture does not really support FI_ri, replace it with + // MOV_rr , frame_reg + // ADD_ri , imm + unsigned reg = MI.getOperand(i - 1).getReg(); + + BuildMI(MBB, ++II, DL, TII.get(BPF::MOV_rr), reg) + .addReg(FrameReg); + BuildMI(MBB, II, DL, TII.get(BPF::ADD_ri), reg) + .addReg(reg) + .addImm(Offset); + + // Remove FI_ri instruction + MI.eraseFromParent(); + } else { + MI.getOperand(i).ChangeToRegister(FrameReg, false); + MI.getOperand(i + 1).ChangeToImmediate(Offset); + } } unsigned BPFRegisterInfo::getFrameRegister(const MachineFunction &MF) const { Modified: head/contrib/llvm/lib/Target/Mips/MipsISelLowering.h ============================================================================== --- head/contrib/llvm/lib/Target/Mips/MipsISelLowering.h Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/Mips/MipsISelLowering.h Fri Dec 25 21:39:45 2015 (r292735) @@ -269,6 +269,14 @@ namespace llvm { unsigned getRegisterByName(const char* RegName, EVT VT, SelectionDAG &DAG) const override; + /// Returns true if a cast between SrcAS and DestAS is a noop. + bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override { + // Mips doesn't have any special address spaces so we just reserve + // the first 256 for software use (e.g. OpenCL) and treat casts + // between them as noops. + return SrcAS < 256 && DestAS < 256; + } + protected: SDValue getGlobalReg(SelectionDAG &DAG, EVT Ty) const; Modified: head/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp ============================================================================== --- head/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -115,6 +115,11 @@ bool MipsSEDAGToDAGISel::replaceUsesWith if (MI->isPHI() || MI->isRegTiedToDefOperand(OpNo) || MI->isPseudo()) continue; + // Also, we have to check that the register class of the operand + // contains the zero register. + if (!MRI->getRegClass(MO.getReg())->contains(ZeroReg)) + continue; + MO.setReg(ZeroReg); } Modified: head/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -947,11 +947,11 @@ void PPCAsmPrinter::EmitInstruction(cons return; } case PPC::ADDISdtprelHA: - // Transform: %Xd = ADDISdtprelHA %X3, - // Into: %Xd = ADDIS8 %X3, sym@dtprel@ha + // Transform: %Xd = ADDISdtprelHA %Xs, + // Into: %Xd = ADDIS8 %Xs, sym@dtprel@ha case PPC::ADDISdtprelHA32: { - // Transform: %Rd = ADDISdtprelHA32 %R3, - // Into: %Rd = ADDIS %R3, sym@dtprel@ha + // Transform: %Rd = ADDISdtprelHA32 %Rs, + // Into: %Rd = ADDIS %Rs, sym@dtprel@ha const MachineOperand &MO = MI->getOperand(2); const GlobalValue *GValue = MO.getGlobal(); MCSymbol *MOSymbol = getSymbol(GValue); @@ -962,7 +962,7 @@ void PPCAsmPrinter::EmitInstruction(cons *OutStreamer, MCInstBuilder(Subtarget->isPPC64() ? PPC::ADDIS8 : PPC::ADDIS) .addReg(MI->getOperand(0).getReg()) - .addReg(Subtarget->isPPC64() ? PPC::X3 : PPC::R3) + .addReg(MI->getOperand(1).getReg()) .addExpr(SymDtprel)); return; } Modified: head/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp ============================================================================== --- head/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -197,10 +197,18 @@ static bool isLargeIntegerTy(bool Is32Bi // Determining the address of a TLS variable results in a function call in // certain TLS models. static bool memAddrUsesCTR(const PPCTargetMachine *TM, - const llvm::Value *MemAddr) { + const Value *MemAddr) { const auto *GV = dyn_cast(MemAddr); - if (!GV) + if (!GV) { + // Recurse to check for constants that refer to TLS global variables. + if (const auto *CV = dyn_cast(MemAddr)) + for (const auto &CO : CV->operands()) + if (memAddrUsesCTR(TM, CO)) + return true; + return false; + } + if (!GV->isThreadLocal()) return false; if (!TM) @@ -239,6 +247,11 @@ bool PPCCTRLoops::mightUseCTR(const Trip if (F->getIntrinsicID() != Intrinsic::not_intrinsic) { switch (F->getIntrinsicID()) { default: continue; + // If we have a call to ppc_is_decremented_ctr_nonzero, or ppc_mtctr + // we're definitely using CTR. + case Intrinsic::ppc_is_decremented_ctr_nonzero: + case Intrinsic::ppc_mtctr: + return true; // VisualStudio defines setjmp as _setjmp #if defined(_MSC_VER) && defined(setjmp) && \ @@ -426,6 +439,7 @@ bool PPCCTRLoops::convertToCTRLoop(Loop // Process nested loops first. for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I) { MadeChange |= convertToCTRLoop(*I); + DEBUG(dbgs() << "Nested loop converted\n"); } // If a nested loop has been converted, then we can't convert this loop. Modified: head/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp ============================================================================== --- head/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -2570,13 +2570,25 @@ SDNode *PPCDAGToDAGISel::Select(SDNode * return nullptr; } // ISD::OR doesn't get all the bitfield insertion fun. - // (and (or x, c1), c2) where isRunOfOnes(~(c1^c2)) is a bitfield insert + // (and (or x, c1), c2) where isRunOfOnes(~(c1^c2)) might be a + // bitfield insert. if (isInt32Immediate(N->getOperand(1), Imm) && N->getOperand(0).getOpcode() == ISD::OR && isInt32Immediate(N->getOperand(0).getOperand(1), Imm2)) { + // The idea here is to check whether this is equivalent to: + // (c1 & m) | (x & ~m) + // where m is a run-of-ones mask. The logic here is that, for each bit in + // c1 and c2: + // - if both are 1, then the output will be 1. + // - if both are 0, then the output will be 0. + // - if the bit in c1 is 0, and the bit in c2 is 1, then the output will + // come from x. + // - if the bit in c1 is 1, and the bit in c2 is 0, then the output will + // be 0. + // If that last condition is never the case, then we can form m from the + // bits that are the same between c1 and c2. unsigned MB, ME; - Imm = ~(Imm^Imm2); - if (isRunOfOnes(Imm, MB, ME)) { + if (isRunOfOnes(~(Imm^Imm2), MB, ME) && !(~Imm & Imm2)) { SDValue Ops[] = { N->getOperand(0).getOperand(0), N->getOperand(0).getOperand(1), getI32Imm(0, dl), getI32Imm(MB, dl), @@ -2787,6 +2799,8 @@ SDNode *PPCDAGToDAGISel::Select(SDNode * SDValue Base, Offset; if (LD->isUnindexed() && + (LD->getMemoryVT() == MVT::f64 || + LD->getMemoryVT() == MVT::i64) && SelectAddrIdxOnly(LD->getBasePtr(), Base, Offset)) { SDValue Chain = LD->getChain(); SDValue Ops[] = { Base, Offset, Chain }; Modified: head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -431,6 +431,8 @@ PPCTargetLowering::PPCTargetLowering(con AddPromotedToType (ISD::LOAD , VT, MVT::v4i32); setOperationAction(ISD::SELECT, VT, Promote); AddPromotedToType (ISD::SELECT, VT, MVT::v4i32); + setOperationAction(ISD::SELECT_CC, VT, Promote); + AddPromotedToType (ISD::SELECT_CC, VT, MVT::v4i32); setOperationAction(ISD::STORE, VT, Promote); AddPromotedToType (ISD::STORE, VT, MVT::v4i32); @@ -7175,7 +7177,6 @@ SDValue PPCTargetLowering::LowerVECTOR_S PPC::isSplatShuffleMask(SVOp, 4) || PPC::isVPKUWUMShuffleMask(SVOp, 1, DAG) || PPC::isVPKUHUMShuffleMask(SVOp, 1, DAG) || - PPC::isVPKUDUMShuffleMask(SVOp, 1, DAG) || PPC::isVSLDOIShuffleMask(SVOp, 1, DAG) != -1 || PPC::isVMRGLShuffleMask(SVOp, 1, 1, DAG) || PPC::isVMRGLShuffleMask(SVOp, 2, 1, DAG) || @@ -7183,8 +7184,10 @@ SDValue PPCTargetLowering::LowerVECTOR_S PPC::isVMRGHShuffleMask(SVOp, 1, 1, DAG) || PPC::isVMRGHShuffleMask(SVOp, 2, 1, DAG) || PPC::isVMRGHShuffleMask(SVOp, 4, 1, DAG) || - PPC::isVMRGEOShuffleMask(SVOp, true, 1, DAG) || - PPC::isVMRGEOShuffleMask(SVOp, false, 1, DAG)) { + (Subtarget.hasP8Altivec() && ( + PPC::isVPKUDUMShuffleMask(SVOp, 1, DAG) || + PPC::isVMRGEOShuffleMask(SVOp, true, 1, DAG) || + PPC::isVMRGEOShuffleMask(SVOp, false, 1, DAG)))) { return Op; } } @@ -7195,7 +7198,6 @@ SDValue PPCTargetLowering::LowerVECTOR_S unsigned int ShuffleKind = isLittleEndian ? 2 : 0; if (PPC::isVPKUWUMShuffleMask(SVOp, ShuffleKind, DAG) || PPC::isVPKUHUMShuffleMask(SVOp, ShuffleKind, DAG) || - PPC::isVPKUDUMShuffleMask(SVOp, ShuffleKind, DAG) || PPC::isVSLDOIShuffleMask(SVOp, ShuffleKind, DAG) != -1 || PPC::isVMRGLShuffleMask(SVOp, 1, ShuffleKind, DAG) || PPC::isVMRGLShuffleMask(SVOp, 2, ShuffleKind, DAG) || @@ -7203,8 +7205,10 @@ SDValue PPCTargetLowering::LowerVECTOR_S PPC::isVMRGHShuffleMask(SVOp, 1, ShuffleKind, DAG) || PPC::isVMRGHShuffleMask(SVOp, 2, ShuffleKind, DAG) || PPC::isVMRGHShuffleMask(SVOp, 4, ShuffleKind, DAG) || - PPC::isVMRGEOShuffleMask(SVOp, true, ShuffleKind, DAG) || - PPC::isVMRGEOShuffleMask(SVOp, false, ShuffleKind, DAG)) + (Subtarget.hasP8Altivec() && ( + PPC::isVPKUDUMShuffleMask(SVOp, ShuffleKind, DAG) || + PPC::isVMRGEOShuffleMask(SVOp, true, ShuffleKind, DAG) || + PPC::isVMRGEOShuffleMask(SVOp, false, ShuffleKind, DAG)))) return Op; // Check to see if this is a shuffle of 4-byte values. If so, we can use our Modified: head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp Fri Dec 25 21:39:45 2015 (r292735) @@ -309,6 +309,11 @@ PPCInstrInfo::commuteInstruction(Machine unsigned MB = MI->getOperand(4).getImm(); unsigned ME = MI->getOperand(5).getImm(); + // We can't commute a trivial mask (there is no way to represent an all-zero + // mask). + if (MB == 0 && ME == 31) + return nullptr; + if (NewMI) { // Create a new instruction. unsigned Reg0 = ChangeReg0 ? Reg2 : MI->getOperand(0).getReg(); Modified: head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td Fri Dec 25 18:11:40 2015 (r292734) +++ head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td Fri Dec 25 21:39:45 2015 (r292735) @@ -2835,24 +2835,84 @@ def : Pat<(i64 (anyext i1:$in)), (SELECT_I8 $in, (LI8 1), (LI8 0))>; // match setcc on i1 variables. +// CRANDC is: +// 1 1 : F +// 1 0 : T +// 0 1 : F +// 0 0 : F +// +// LT is: +// -1 -1 : F +// -1 0 : T +// 0 -1 : F +// 0 0 : F +// +// ULT is: +// 1 1 : F +// 1 0 : F +// 0 1 : T +// 0 0 : F *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Dec 26 00:26:04 2015 Return-Path: Delivered-To: svn-src-all@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 BCA24A52909; Sat, 26 Dec 2015 00:26:04 +0000 (UTC) (envelope-from np@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 905FB1C19; Sat, 26 Dec 2015 00:26:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBQ0Q3V7000157; Sat, 26 Dec 2015 00:26:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQ0Q3sc000150; Sat, 26 Dec 2015 00:26:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201512260026.tBQ0Q3sc000150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 26 Dec 2015 00:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292736 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 00:26:04 -0000 Author: np Date: Sat Dec 26 00:26:02 2015 New Revision: 292736 URL: https://svnweb.freebsd.org/changeset/base/292736 Log: cxgbe(4): Updates to the base NIC driver and t4_tom to support the iSCSI offload driver. These changes come from projects/cxl_iscsi. Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Fri Dec 25 21:39:45 2015 (r292735) +++ head/sys/dev/cxgbe/adapter.h Sat Dec 26 00:26:02 2015 (r292736) @@ -766,7 +766,7 @@ struct adapter { void *tom_softc; /* (struct tom_data *) */ struct tom_tunables tt; void *iwarp_softc; /* (struct c4iw_dev *) */ - void *iscsi_softc; + void *iscsi_ulp_softc; /* (struct cxgbei_data *) */ #endif struct l2t_data *l2t; /* L2 table */ struct tid_info tids; Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Fri Dec 25 21:39:45 2015 (r292735) +++ head/sys/dev/cxgbe/offload.h Sat Dec 26 00:26:02 2015 (r292736) @@ -156,7 +156,7 @@ int t4_register_uld(struct uld_info *); int t4_unregister_uld(struct uld_info *); int t4_activate_uld(struct adapter *, int); int t4_deactivate_uld(struct adapter *, int); -void t4_iscsi_init(struct ifnet *, unsigned int, const unsigned int *); +void t4_iscsi_init(struct adapter *, u_int, const u_int *); int uld_active(struct adapter *, int); #endif #endif Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Dec 25 21:39:45 2015 (r292735) +++ head/sys/dev/cxgbe/t4_main.c Sat Dec 26 00:26:02 2015 (r292736) @@ -8801,11 +8801,8 @@ t4_ioctl(struct cdev *dev, unsigned long #ifdef TCP_OFFLOAD void -t4_iscsi_init(struct ifnet *ifp, unsigned int tag_mask, - const unsigned int *pgsz_order) +t4_iscsi_init(struct adapter *sc, u_int tag_mask, const u_int *pgsz_order) { - struct vi_info *vi = ifp->if_softc; - struct adapter *sc = vi->pi->adapter; t4_write_reg(sc, A_ULP_RX_ISCSI_TAGMASK, tag_mask); t4_write_reg(sc, A_ULP_RX_ISCSI_PSZ, V_HPZ0(pgsz_order[0]) | Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Dec 25 21:39:45 2015 (r292735) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Dec 26 00:26:02 2015 (r292736) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Chelsio Communications, Inc. + * Copyright (c) 2012, 2015 Chelsio Communications, Inc. * All rights reserved. * Written by: Navdeep Parhar * @@ -71,33 +71,6 @@ VNET_DECLARE(int, tcp_autorcvbuf_inc); VNET_DECLARE(int, tcp_autorcvbuf_max); #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) -/* - * For ULP connections HW may add headers, e.g., for digests, that aren't part - * of the messages sent by the host but that are part of the TCP payload and - * therefore consume TCP sequence space. Tx connection parameters that - * operate in TCP sequence space are affected by the HW additions and need to - * compensate for them to accurately track TCP sequence numbers. This array - * contains the compensating extra lengths for ULP packets. It is indexed by - * a packet's ULP submode. - */ -const unsigned int t4_ulp_extra_len[] = {0, 4, 4, 8}; - -/* - * Return the length of any HW additions that will be made to a Tx packet. - * Such additions can happen for some types of ULP packets. - */ -static inline unsigned int -ulp_extra_len(struct mbuf *m, int *ulp_mode) -{ - struct m_tag *mtag; - - if ((mtag = m_tag_find(m, CXGBE_ISCSI_MBUF_TAG, NULL)) == NULL) - return (0); - *ulp_mode = *((int *)(mtag + 1)); - - return (t4_ulp_extra_len[*ulp_mode & 3]); -} - void send_flowc_wr(struct toepcb *toep, struct flowc_tx_params *ftxp) { @@ -384,13 +357,10 @@ t4_rcvd(struct toedev *tod, struct tcpcb KASSERT(toep->sb_cc >= sbused(sb), ("%s: sb %p has more data (%d) than last time (%d).", __func__, sb, sbused(sb), toep->sb_cc)); - if (toep->ulp_mode == ULP_MODE_ISCSI) { - toep->rx_credits += toep->sb_cc; - toep->sb_cc = 0; - } else { - toep->rx_credits += toep->sb_cc - sbused(sb); - toep->sb_cc = sbused(sb); - } + + toep->rx_credits += toep->sb_cc - sbused(sb); + toep->sb_cc = sbused(sb); + if (toep->rx_credits > 0 && (tp->rcv_wnd <= 32 * 1024 || toep->rx_credits >= 64 * 1024 || (toep->rx_credits >= 16 * 1024 && tp->rcv_wnd <= 128 * 1024) || @@ -490,25 +460,16 @@ max_dsgl_nsegs(int tx_credits) static inline void write_tx_wr(void *dst, struct toepcb *toep, unsigned int immdlen, - unsigned int plen, uint8_t credits, int shove, int ulp_mode, int txalign) + unsigned int plen, uint8_t credits, int shove, int ulp_submode, int txalign) { struct fw_ofld_tx_data_wr *txwr = dst; - unsigned int wr_ulp_mode; txwr->op_to_immdlen = htobe32(V_WR_OP(FW_OFLD_TX_DATA_WR) | V_FW_WR_IMMDLEN(immdlen)); txwr->flowid_len16 = htobe32(V_FW_WR_FLOWID(toep->tid) | V_FW_WR_LEN16(credits)); - - /* for iscsi, the mode & submode setting is per-packet */ - if (toep->ulp_mode == ULP_MODE_ISCSI) - wr_ulp_mode = V_TX_ULP_MODE(ulp_mode >> 4) | - V_TX_ULP_SUBMODE(ulp_mode & 3); - else - wr_ulp_mode = V_TX_ULP_MODE(toep->ulp_mode); - - txwr->lsodisable_to_flags = htobe32(wr_ulp_mode | V_TX_URG(0) | /*XXX*/ - V_TX_SHOVE(shove)); + txwr->lsodisable_to_flags = htobe32(V_TX_ULP_MODE(toep->ulp_mode) | + V_TX_ULP_SUBMODE(ulp_submode) | V_TX_URG(0) | V_TX_SHOVE(shove)); txwr->plen = htobe32(plen); if (txalign > 0) { @@ -616,6 +577,9 @@ t4_push_frames(struct adapter *sc, struc toep->ulp_mode == ULP_MODE_RDMA, ("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, toep)); + if (__predict_false(toep->flags & TPF_ABORT_SHUTDOWN)) + return; + /* * This function doesn't resume by itself. Someone else must clear the * flag and call this function. @@ -802,56 +766,70 @@ t4_push_frames(struct adapter *sc, struc close_conn(sc, toep); } -/* Send ULP data over TOE using TX_DATA_WR. We send whole mbuf at once */ +static inline void +rqdrop_locked(struct mbufq *q, int plen) +{ + struct mbuf *m; + + while (plen > 0) { + m = mbufq_dequeue(q); + + /* Too many credits. */ + MPASS(m != NULL); + M_ASSERTPKTHDR(m); + + /* Partial credits. */ + MPASS(plen >= m->m_pkthdr.len); + + plen -= m->m_pkthdr.len; + m_freem(m); + } +} + void -t4_ulp_push_frames(struct adapter *sc, struct toepcb *toep, int drop) +t4_push_pdus(struct adapter *sc, struct toepcb *toep, int drop) { - struct mbuf *sndptr, *m = NULL; + struct mbuf *sndptr, *m; struct fw_ofld_tx_data_wr *txwr; struct wrqe *wr; - unsigned int plen, nsegs, credits, max_imm, max_nsegs, max_nsegs_1mbuf; + u_int plen, nsegs, credits, max_imm, max_nsegs, max_nsegs_1mbuf; + u_int adjusted_plen, ulp_submode; struct inpcb *inp = toep->inp; - struct tcpcb *tp; - struct socket *so; - struct sockbuf *sb; - int tx_credits, ulp_len = 0, ulp_mode = 0, qlen = 0; - int shove, compl; - struct ofld_tx_sdesc *txsd; + struct tcpcb *tp = intotcpcb(inp); + int tx_credits, shove; + struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx]; + struct mbufq *pduq = &toep->ulp_pduq; + static const u_int ulp_extra_len[] = {0, 4, 4, 8}; INP_WLOCK_ASSERT(inp); - if (toep->flags & TPF_ABORT_SHUTDOWN) - return; - - tp = intotcpcb(inp); - so = inp->inp_socket; - sb = &so->so_snd; - txsd = &toep->txsd[toep->txsd_pidx]; - KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %u.", __func__, toep->tid)); + KASSERT(toep->ulp_mode == ULP_MODE_ISCSI, + ("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, toep)); + + if (__predict_false(toep->flags & TPF_ABORT_SHUTDOWN)) + return; /* * This function doesn't resume by itself. Someone else must clear the * flag and call this function. */ - if (__predict_false(toep->flags & TPF_TX_SUSPENDED)) + if (__predict_false(toep->flags & TPF_TX_SUSPENDED)) { + KASSERT(drop == 0, + ("%s: drop (%d) != 0 but tx is suspended", __func__, drop)); return; + } - sndptr = t4_queue_iscsi_callback(so, toep, 1, &qlen); - if (!qlen) - return; + if (drop) + rqdrop_locked(&toep->ulp_pdu_reclaimq, drop); + + while ((sndptr = mbufq_first(pduq)) != NULL) { + M_ASSERTPKTHDR(sndptr); - do { tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS); max_imm = max_imm_payload(tx_credits); max_nsegs = max_dsgl_nsegs(tx_credits); - if (drop) { - t4_cpl_iscsi_callback(toep->td, toep, &drop, - CPL_FW4_ACK); - drop = 0; - } - plen = 0; nsegs = 0; max_nsegs_1mbuf = 0; /* max # of SGL segments in any one mbuf */ @@ -861,7 +839,10 @@ t4_ulp_push_frames(struct adapter *sc, s nsegs += n; plen += m->m_len; - /* This mbuf sent us _over_ the nsegs limit, return */ + /* + * This mbuf would send us _over_ the nsegs limit. + * Suspend tx because the PDU can't be sent out. + */ if (plen > max_imm && nsegs > max_nsegs) { toep->flags |= TPF_TX_SUSPENDED; return; @@ -869,30 +850,35 @@ t4_ulp_push_frames(struct adapter *sc, s if (max_nsegs_1mbuf < n) max_nsegs_1mbuf = n; - - /* This mbuf put us right at the max_nsegs limit */ - if (plen > max_imm && nsegs == max_nsegs) { - toep->flags |= TPF_TX_SUSPENDED; - return; - } - } - - shove = m == NULL && !(tp->t_flags & TF_MORETOCOME); - /* nothing to send */ - if (plen == 0) { - KASSERT(m == NULL, - ("%s: nothing to send, but m != NULL", __func__)); - break; } if (__predict_false(toep->flags & TPF_FIN_SENT)) panic("%s: excess tx.", __func__); - ulp_len = plen + ulp_extra_len(sndptr, &ulp_mode); + /* + * We have a PDU to send. All of it goes out in one WR so 'm' + * is NULL. A PDU's length is always a multiple of 4. + */ + MPASS(m == NULL); + MPASS((plen & 3) == 0); + MPASS(sndptr->m_pkthdr.len == plen); + + shove = !(tp->t_flags & TF_MORETOCOME); + ulp_submode = mbuf_ulp_submode(sndptr); + MPASS(ulp_submode < nitems(ulp_extra_len)); + + /* + * plen doesn't include header and data digests, which are + * generated and inserted in the right places by the TOE, but + * they do occupy TCP sequence space and need to be accounted + * for. + */ + adjusted_plen = plen + ulp_extra_len[ulp_submode]; if (plen <= max_imm) { /* Immediate data tx */ - wr = alloc_wrqe(roundup(sizeof(*txwr) + plen, 16), + + wr = alloc_wrqe(roundup2(sizeof(*txwr) + plen, 16), toep->ofld_txq); if (wr == NULL) { /* XXX: how will we recover from this? */ @@ -901,16 +887,17 @@ t4_ulp_push_frames(struct adapter *sc, s } txwr = wrtod(wr); credits = howmany(wr->wr_len, 16); - write_tx_wr(txwr, toep, plen, ulp_len, credits, shove, - ulp_mode, 0); + write_tx_wr(txwr, toep, plen, adjusted_plen, credits, + shove, ulp_submode, sc->tt.tx_align); m_copydata(sndptr, 0, plen, (void *)(txwr + 1)); + nsegs = 0; } else { int wr_len; /* DSGL tx */ wr_len = sizeof(*txwr) + sizeof(struct ulptx_sgl) + ((3 * (nsegs - 1)) / 2 + ((nsegs - 1) & 1)) * 8; - wr = alloc_wrqe(roundup(wr_len, 16), toep->ofld_txq); + wr = alloc_wrqe(roundup2(wr_len, 16), toep->ofld_txq); if (wr == NULL) { /* XXX: how will we recover from this? */ toep->flags |= TPF_TX_SUSPENDED; @@ -918,8 +905,8 @@ t4_ulp_push_frames(struct adapter *sc, s } txwr = wrtod(wr); credits = howmany(wr_len, 16); - write_tx_wr(txwr, toep, 0, ulp_len, credits, shove, - ulp_mode, 0); + write_tx_wr(txwr, toep, 0, adjusted_plen, credits, + shove, ulp_submode, sc->tt.tx_align); write_tx_sgl(txwr + 1, sndptr, m, nsegs, max_nsegs_1mbuf); if (wr_len & 0xf) { @@ -932,28 +919,26 @@ t4_ulp_push_frames(struct adapter *sc, s KASSERT(toep->tx_credits >= credits, ("%s: not enough credits", __func__)); + m = mbufq_dequeue(pduq); + MPASS(m == sndptr); + mbufq_enqueue(&toep->ulp_pdu_reclaimq, m); + toep->tx_credits -= credits; toep->tx_nocompl += credits; toep->plen_nocompl += plen; if (toep->tx_credits <= toep->tx_total * 3 / 8 && - toep->tx_nocompl >= toep->tx_total / 4) - compl = 1; - - if (compl) { + toep->tx_nocompl >= toep->tx_total / 4) { txwr->op_to_immdlen |= htobe32(F_FW_WR_COMPL); toep->tx_nocompl = 0; toep->plen_nocompl = 0; } - tp->snd_nxt += ulp_len; - tp->snd_max += ulp_len; - /* goto next mbuf */ - sndptr = m = t4_queue_iscsi_callback(so, toep, 2, &qlen); + tp->snd_nxt += adjusted_plen; + tp->snd_max += adjusted_plen; toep->flags |= TPF_TX_DATA_SENT; - if (toep->tx_credits < MIN_OFLD_TX_CREDITS) { + if (toep->tx_credits < MIN_OFLD_TX_CREDITS) toep->flags |= TPF_TX_SUSPENDED; - } KASSERT(toep->txsd_avail > 0, ("%s: no txsd", __func__)); txsd->plen = plen; @@ -966,10 +951,10 @@ t4_ulp_push_frames(struct adapter *sc, s toep->txsd_avail--; t4_l2t_send(sc, wr, toep->l2te); - } while (m != NULL); + } - /* Send a FIN if requested, but only if there's no more data to send */ - if (m == NULL && toep->flags & TPF_SEND_FIN) + /* Send a FIN if requested, but only if there are no more PDUs to send */ + if (mbufq_first(pduq) == NULL && toep->flags & TPF_SEND_FIN) close_conn(sc, toep); } @@ -987,7 +972,10 @@ t4_tod_output(struct toedev *tod, struct ("%s: inp %p dropped.", __func__, inp)); KASSERT(toep != NULL, ("%s: toep is NULL", __func__)); - t4_push_frames(sc, toep, 0); + if (toep->ulp_mode == ULP_MODE_ISCSI) + t4_push_pdus(sc, toep, 0); + else + t4_push_frames(sc, toep, 0); return (0); } @@ -1009,7 +997,7 @@ t4_send_fin(struct toedev *tod, struct t toep->flags |= TPF_SEND_FIN; if (tp->t_state >= TCPS_ESTABLISHED) { if (toep->ulp_mode == ULP_MODE_ISCSI) - t4_ulp_push_frames(sc, toep, 0); + t4_push_pdus(sc, toep, 0); else t4_push_frames(sc, toep, 0); } @@ -1250,91 +1238,6 @@ abort_status_to_errno(struct tcpcb *tp, } } -int -cpl_not_handled(struct sge_iq *, const struct rss_header *, struct mbuf *); -/* - * tom_cpl_iscsi_callback - - * iscsi and tom would share the following cpl messages, so when any of these - * message is received, after tom is done with processing it, the messages - * needs to be forwarded to iscsi for further processing: - * - CPL_SET_TCB_RPL - * - CPL_RX_DATA_DDP - */ -void (*tom_cpl_iscsi_callback)(struct tom_data *, struct socket *, void *, - unsigned int); - -struct mbuf *(*tom_queue_iscsi_callback)(struct socket *, unsigned int, int *); -/* - * Check if the handler function is set for a given CPL - * return 0 if the function is NULL or cpl_not_handled, 1 otherwise. - */ -int -t4tom_cpl_handler_registered(struct adapter *sc, unsigned int opcode) -{ - - MPASS(opcode < nitems(sc->cpl_handler)); - - return (sc->cpl_handler[opcode] && - sc->cpl_handler[opcode] != cpl_not_handled); -} - -/* - * set the tom_cpl_iscsi_callback function, this function should be used - * whenever both toe and iscsi need to process the same cpl msg. - */ -void -t4tom_register_cpl_iscsi_callback(void (*fp)(struct tom_data *, struct socket *, - void *, unsigned int)) -{ - - tom_cpl_iscsi_callback = fp; -} - -void -t4tom_register_queue_iscsi_callback(struct mbuf *(*fp)(struct socket *, - unsigned int, int *qlen)) -{ - - tom_queue_iscsi_callback = fp; -} - -int -t4_cpl_iscsi_callback(struct tom_data *td, struct toepcb *toep, void *m, - unsigned int opcode) -{ - struct socket *so; - - if (opcode == CPL_FW4_ACK) - so = toep->inp->inp_socket; - else { - INP_WLOCK(toep->inp); - so = toep->inp->inp_socket; - INP_WUNLOCK(toep->inp); - } - - if (tom_cpl_iscsi_callback && so) { - if (toep->ulp_mode == ULP_MODE_ISCSI) { - tom_cpl_iscsi_callback(td, so, m, opcode); - return (0); - } - } - - return (1); -} - -struct mbuf * -t4_queue_iscsi_callback(struct socket *so, struct toepcb *toep, - unsigned int cmd, int *qlen) -{ - - if (tom_queue_iscsi_callback && so) { - if (toep->ulp_mode == ULP_MODE_ISCSI) - return (tom_queue_iscsi_callback(so, cmd, qlen)); - } - - return (NULL); -} - /* * TCP RST from the peer, timeout, or some other such critical error. */ @@ -1733,21 +1636,34 @@ do_fw4_ack(struct sge_iq *iq, const stru toep->tx_credits >= toep->tx_total / 4) { toep->flags &= ~TPF_TX_SUSPENDED; if (toep->ulp_mode == ULP_MODE_ISCSI) - t4_ulp_push_frames(sc, toep, plen); + t4_push_pdus(sc, toep, plen); else t4_push_frames(sc, toep, plen); } else if (plen > 0) { struct sockbuf *sb = &so->so_snd; + int sbu; - if (toep->ulp_mode == ULP_MODE_ISCSI) - t4_cpl_iscsi_callback(toep->td, toep, &plen, - CPL_FW4_ACK); - else { - SOCKBUF_LOCK(sb); + SOCKBUF_LOCK(sb); + sbu = sbused(sb); + if (toep->ulp_mode == ULP_MODE_ISCSI) { + + if (__predict_false(sbu > 0)) { + /* + * The data trasmitted before the tid's ULP mode + * changed to ISCSI is still in so_snd. + * Incoming credits should account for so_snd + * first. + */ + sbdrop_locked(sb, min(sbu, plen)); + plen -= min(sbu, plen); + } + sowwakeup_locked(so); /* unlocks so_snd */ + rqdrop_locked(&toep->ulp_pdu_reclaimq, plen); + } else { sbdrop_locked(sb, plen); - sowwakeup_locked(so); - SOCKBUF_UNLOCK_ASSERT(sb); + sowwakeup_locked(so); /* unlocks so_snd */ } + SOCKBUF_UNLOCK_ASSERT(sb); } INP_WUNLOCK(inp); @@ -1771,14 +1687,21 @@ do_set_tcb_rpl(struct sge_iq *iq, const if (is_ftid(sc, tid)) return (t4_filter_rpl(iq, rss, m)); /* TCB is a filter */ - else { - struct toepcb *toep = lookup_tid(sc, tid); - t4_cpl_iscsi_callback(toep->td, toep, m, CPL_SET_TCB_RPL); - return (0); - } + /* + * TOM and/or other ULPs don't request replies for CPL_SET_TCB or + * CPL_SET_TCB_FIELD requests. This can easily change and when it does + * the dispatch code will go here. + */ +#ifdef INVARIANTS + panic("%s: Unexpected CPL_SET_TCB_RPL for tid %u on iq %p", __func__, + tid, iq); +#else + log(LOG_ERR, "%s: Unexpected CPL_SET_TCB_RPL for tid %u on iq %p\n", + __func__, tid, iq); +#endif - CXGBE_UNIMPLEMENTED(__func__); + return (0); } void Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Fri Dec 25 21:39:45 2015 (r292735) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Sat Dec 26 00:26:02 2015 (r292736) @@ -513,7 +513,6 @@ do_rx_data_ddp(struct sge_iq *iq, const unsigned int tid = GET_TID(cpl); uint32_t vld; struct toepcb *toep = lookup_tid(sc, tid); - struct tom_data *td = toep->td; KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(toep->tid == tid, ("%s: toep tid/atid mismatch", __func__)); @@ -525,16 +524,11 @@ do_rx_data_ddp(struct sge_iq *iq, const panic("%s: DDP error 0x%x (tid %d, toep %p)", __func__, vld, tid, toep); } + if (toep->ulp_mode == ULP_MODE_ISCSI) { - m = m_get(M_NOWAIT, MT_DATA); - if (m == NULL) - CXGBE_UNIMPLEMENTED("mbuf alloc failure"); - memcpy(mtod(m, unsigned char *), cpl, - sizeof(struct cpl_rx_data_ddp)); - if (!t4_cpl_iscsi_callback(td, toep, m, CPL_RX_DATA_DDP)) - return (0); - m_freem(m); - } + sc->cpl_handler[CPL_RX_ISCSI_DDP](iq, rss, m); + return (0); + } handle_ddp_data(toep, cpl->u.ddp_report, cpl->seq, be16toh(cpl->len)); Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Fri Dec 25 21:39:45 2015 (r292735) +++ head/sys/dev/cxgbe/tom/t4_tom.c Sat Dec 26 00:26:02 2015 (r292736) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -158,6 +159,8 @@ alloc_toepcb(struct vi_info *vi, int txq toep->ofld_txq = &sc->sge.ofld_txq[txqid]; toep->ofld_rxq = &sc->sge.ofld_rxq[rxqid]; toep->ctrlq = &sc->sge.ctrlq[pi->port_id]; + mbufq_init(&toep->ulp_pduq, INT_MAX); + mbufq_init(&toep->ulp_pdu_reclaimq, INT_MAX); toep->txsd_total = txsd_total; toep->txsd_avail = txsd_total; toep->txsd_pidx = 0; @@ -273,6 +276,14 @@ release_offload_resources(struct toepcb CTR5(KTR_CXGBE, "%s: toep %p (tid %d, l2te %p, ce %p)", __func__, toep, tid, toep->l2te, toep->ce); + /* + * These queues should have been emptied at approximately the same time + * that a normal connection's socket's so_snd would have been purged or + * drained. Do _not_ clean up here. + */ + MPASS(mbufq_len(&toep->ulp_pduq) == 0); + MPASS(mbufq_len(&toep->ulp_pdu_reclaimq) == 0); + if (toep->ulp_mode == ULP_MODE_TCPDDP) release_ddp_resources(toep); @@ -380,6 +391,7 @@ final_cpl_received(struct toepcb *toep) toep->inp = NULL; toep->flags &= ~TPF_CPL_PENDING; + mbufq_drain(&toep->ulp_pdu_reclaimq); if (!(toep->flags & TPF_ATTACHED)) release_offload_resources(toep); Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Fri Dec 25 21:39:45 2015 (r292735) +++ head/sys/dev/cxgbe/tom/t4_tom.h Sat Dec 26 00:26:02 2015 (r292736) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Chelsio Communications, Inc. + * Copyright (c) 2012, 2015 Chelsio Communications, Inc. * All rights reserved. * Written by: Navdeep Parhar * @@ -115,6 +115,10 @@ struct toepcb { int rx_credits; /* rx credits (in bytes) to be returned to hw */ u_int ulp_mode; /* ULP mode */ + void *ulpcb; + void *ulpcb2; + struct mbufq ulp_pduq; /* PDUs waiting to be sent out. */ + struct mbufq ulp_pdu_reclaimq; u_int ddp_flags; struct ddp_buffer *db[2]; @@ -220,6 +224,22 @@ td_adapter(struct tom_data *td) return (td->tod.tod_softc); } +static inline void +set_mbuf_ulp_submode(struct mbuf *m, uint8_t ulp_submode) +{ + + M_ASSERTPKTHDR(m); + m->m_pkthdr.PH_per.eight[0] = ulp_submode; +} + +static inline uint8_t +mbuf_ulp_submode(struct mbuf *m) +{ + + M_ASSERTPKTHDR(m); + return (m->m_pkthdr.PH_per.eight[0]); +} + /* t4_tom.c */ struct toepcb *alloc_toepcb(struct vi_info *, int, int, int); void free_toepcb(struct toepcb *); @@ -275,6 +295,7 @@ int t4_send_rst(struct toedev *, struct void t4_set_tcb_field(struct adapter *, struct toepcb *, int, uint16_t, uint64_t, uint64_t); void t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop); +void t4_push_pdus(struct adapter *sc, struct toepcb *toep, int drop); /* t4_ddp.c */ void t4_init_ddp(struct adapter *, struct tom_data *); @@ -287,19 +308,4 @@ void handle_ddp_close(struct toepcb *, s uint32_t); void insert_ddp_data(struct toepcb *, uint32_t); -/* ULP related */ -#define CXGBE_ISCSI_MBUF_TAG 50 -int t4tom_cpl_handler_registered(struct adapter *, unsigned int); -void t4tom_register_cpl_iscsi_callback(void (*fp)(struct tom_data *, - struct socket *, void *, unsigned int)); -void t4tom_register_queue_iscsi_callback(struct mbuf *(*fp)(struct socket *, - unsigned int, int *)); -void t4_ulp_push_frames(struct adapter *sc, struct toepcb *toep, int); -int t4_cpl_iscsi_callback(struct tom_data *, struct toepcb *, void *, uint32_t); -struct mbuf *t4_queue_iscsi_callback(struct socket *, struct toepcb *, uint32_t, - int *); -extern void (*tom_cpl_iscsi_callback)(struct tom_data *, struct socket *, - void *, unsigned int); -extern struct mbuf *(*tom_queue_iscsi_callback)(struct socket*, unsigned int, - int *); #endif From owner-svn-src-all@freebsd.org Sat Dec 26 00:38:32 2015 Return-Path: Delivered-To: svn-src-all@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 E6A02A52E02 for ; Sat, 26 Dec 2015 00:38:31 +0000 (UTC) (envelope-from bounces+73574-8822-svn-src-all=freebsd.org@sendgrid.net) Received: from o1.l99.sendgrid.net (o1.l99.sendgrid.net [198.37.153.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEA4312E3 for ; Sat, 26 Dec 2015 00:38:31 +0000 (UTC) (envelope-from bounces+73574-8822-svn-src-all=freebsd.org@sendgrid.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=subject:to:references:cc:from:mime-version:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=n6VVui9hfBcH0aTMSQIThRWCyOk=; b=PlBFKsYOYQeczYeChf 94sMiOG/CFoR7ptGIq5Fb4QQzEZM7WxlSdHbPIUeRHB5ZzqurHh69mD14Th6/eEQ qP8qo0aaHjjMWjYzSlTavJJ1rcy2YeuZU/a+u+Oy6tNv19KfKgm6EAAXDLN1Y9tI dBVpo+pP/5yYHJq4uENimLhd0= Received: by filter0565p1mdw1.sendgrid.net with SMTP id filter0565p1mdw1.12822.567DE1854D 2015-12-26 00:38:29.706107298 +0000 UTC Received: from mail.tarsnap.com (ec2-54-86-246-204.compute-1.amazonaws.com [54.86.246.204]) by ismtpd0001p1iad1.sendgrid.net (SG) with ESMTP id nVi7hGC6Squl2JESYF8RgA for ; Sat, 26 Dec 2015 00:38:29.387 +0000 (UTC) Received: (qmail 18257 invoked from network); 26 Dec 2015 00:36:26 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 26 Dec 2015 00:36:27 -0000 Received: (qmail 58251 invoked from network); 26 Dec 2015 00:38:24 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 26 Dec 2015 00:38:24 -0000 Subject: Re: svn commit: r292723 - in head: lib/libc share/mk To: Daniel Eischen , Ed Schouten References: <201512251129.tBPBTIZp058825@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Colin Percival Message-ID: <567DE180.3040601@freebsd.org> Date: Fri, 25 Dec 2015 16:38:24 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SG-EID: A6W2xSVPHetogaU8rnzccWwgBYtN+QvIzXyjfe/10PFgePcuI5hHh6GTreqUsg1qaOS1yOvd8actRy 1LHIdI5C4yJSeMcYseklRh+le1jfSw/i7WlTyTqKwYwMjoj7511j6tnb/EDWr22YcReZyqSfY+TOwT k1pfcpHCrxUJZoJX+Wxvidf+LKJFcqMRzpAKaylXDPrZs/UtD/67mSCTqbAiCj/b58xFDV/ure8tzj U= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 00:38:32 -0000 On 12/25/15 13:03, Daniel Eischen wrote: > On Fri, 25 Dec 2015, Ed Schouten wrote: >> 2015-12-25 12:29 GMT+01:00 Colin Percival : >>> Make libxnet.so a symlink to libc.so. This makes `-lxnet` a no-op, as >>> POSIX requires for the c99 compiler. >> >> I seem to remember I had some issues in the past where I was linking >> against libc explicitly. Maybe it had something to do with linking >> both against -lpthread and -lc, but if you pass in -lc later on the >> command line, libc overrides the symbols that have to be provided by >> -lpthread? I just did some tests with one of my pthread-using tools, and it passes all of my tests with -lc added before or after -lpthread. Can you remember any details of how the problems showed up? Is it possible that this has been fixed since then? I know there's a lot of tricks to make sure that the right versions of functions get called. >> If that's (still) the case, would it make sense to just provide >> libxnet in the form of an empty .a file instead? > > I think that's a good point. Using -lanything shouldn't introduce an > unexpected link order. Yes, adding a dummy library was my first thought, but kib pointed out that a symlink was much simpler. Obviously it never occurred to me that linking to a library which we were going to be linking to anyway would cause problems... -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@freebsd.org Sat Dec 26 02:31:43 2015 Return-Path: Delivered-To: svn-src-all@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 270FCA5109A; Sat, 26 Dec 2015 02:31:43 +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 E593B1773; Sat, 26 Dec 2015 02:31:42 +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 tBQ2VgZW037333; Sat, 26 Dec 2015 02:31:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQ2VdPH037312; Sat, 26 Dec 2015 02:31:39 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512260231.tBQ2VdPH037312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 26 Dec 2015 02:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292738 - in head: share/man/man4 sys/conf sys/dev/etherswitch sys/dev/etherswitch/arswitch sys/dev/etherswitch/e6000sw sys/dev/etherswitch/ip17x sys/dev/etherswitch/ukswitch 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 02:31:43 -0000 Author: adrian Date: Sat Dec 26 02:31:39 2015 New Revision: 292738 URL: https://svnweb.freebsd.org/changeset/base/292738 Log: [mdio] migrate mdiobus out of etherswitch and into a top-level device of its own. The mdio driver interface is generally useful for devices that require MDIO without the full MII bus interface. This lifts the driver/interface out of etherswitch(4), and adds a mdio(4) man page. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D4606 Added: head/share/man/man4/mdio.4 (contents, props changed) head/sys/dev/mdio/ head/sys/dev/mdio/mdio.c - copied, changed from r292734, head/sys/dev/etherswitch/mdio.c head/sys/dev/mdio/mdio.h - copied, changed from r292734, head/sys/dev/etherswitch/mdio.h head/sys/dev/mdio/mdio_if.m - copied unchanged from r292734, head/sys/dev/etherswitch/mdio_if.m head/sys/modules/mdio/ head/sys/modules/mdio/Makefile (contents, props changed) Deleted: head/sys/dev/etherswitch/mdio.c head/sys/dev/etherswitch/mdio.h head/sys/dev/etherswitch/mdio_if.m Modified: head/share/man/man4/Makefile head/sys/conf/files head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitch_7240.c head/sys/dev/etherswitch/arswitch/arswitch_8216.c head/sys/dev/etherswitch/arswitch/arswitch_8226.c head/sys/dev/etherswitch/arswitch/arswitch_8316.c head/sys/dev/etherswitch/arswitch/arswitch_8327.c head/sys/dev/etherswitch/arswitch/arswitch_9340.c head/sys/dev/etherswitch/arswitch/arswitch_phy.c head/sys/dev/etherswitch/arswitch/arswitch_reg.c head/sys/dev/etherswitch/e6000sw/e6000sw.c head/sys/dev/etherswitch/ip17x/ip17x.c head/sys/dev/etherswitch/ukswitch/ukswitch.c head/sys/dev/mge/if_mge.c head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sat Dec 26 00:31:19 2015 (r292737) +++ head/share/man/man4/Makefile Sat Dec 26 02:31:39 2015 (r292738) @@ -266,6 +266,7 @@ MAN= aac.4 \ malo.4 \ mcd.4 \ md.4 \ + mdio.4 \ me.4 \ mem.4 \ meteor.4 \ Added: head/share/man/man4/mdio.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/mdio.4 Sat Dec 26 02:31:39 2015 (r292738) @@ -0,0 +1,53 @@ +.\" Written by Landon Fuller for the FreeBSD Project. +.\" Based on the miibus(4) manual page written by Tom Rhodes. +.\" Please see the /usr/src/COPYRIGHT file for copyright information. +.\" +.\" $FreeBSD$ +.\" +.Dd December 17, 2015 +.Dt MDIO 4 +.Os +.Sh NAME +.Nm mdio +.Nd IEEE 802.3 Management Data Input/Output interface +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device mdio" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides an interconnection between the Media Access Control (MAC) +sublayer and Physical Layer (PHY) entities' control and status registers, +as defined by the IEEE 802.3 Standard. +.Pp +The +.Nm +layer allows device drivers to share common support code for various +external PHY devices. +.Pp +.Tn MDIO +is one of two signal interfaces that comprise the +Media Independent Interface (MII) defined by the IEEE 802.3 +Standard. The +.Xr miibus 4 +driver provides support for devices that require full +.Tn MII +support. +.Sh SEE ALSO +.Xr miibus 4 +.Sh STANDARDS +More information on +.Tn MDIO +can be found in the IEEE 802.3 Standard. +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The driver was written by +.An Stefan Bethke Aq Mt stb@lassitu.de . Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/conf/files Sat Dec 26 02:31:39 2015 (r292738) @@ -1404,8 +1404,6 @@ dev/etherswitch/ip17x/ip175c.c optional dev/etherswitch/ip17x/ip175d.c optional ip17x dev/etherswitch/ip17x/ip17x_phy.c optional ip17x dev/etherswitch/ip17x/ip17x_vlans.c optional ip17x -dev/etherswitch/mdio_if.m optional miiproxy | mdio -dev/etherswitch/mdio.c optional miiproxy | mdio dev/etherswitch/miiproxy.c optional miiproxy dev/etherswitch/rtl8366/rtl8366rb.c optional rtl8366rb dev/etherswitch/ukswitch/ukswitch.c optional ukswitch @@ -1908,6 +1906,8 @@ dev/mca/mca_bus.c optional mca dev/mcd/mcd.c optional mcd isa nowerror dev/mcd/mcd_isa.c optional mcd isa nowerror dev/md/md.c optional md +dev/mdio/mdio_if.m optional miiproxy | mdio +dev/mdio/mdio.c optional miiproxy | mdio dev/mem/memdev.c optional mem dev/mem/memutil.c optional mem dev/mfi/mfi.c optional mfi Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Sat Dec 26 02:31:39 2015 (r292738) @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_7240.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_7240.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_7240.c Sat Dec 26 02:31:39 2015 (r292738) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_8216.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8216.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_8216.c Sat Dec 26 02:31:39 2015 (r292738) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_8226.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8226.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_8226.c Sat Dec 26 02:31:39 2015 (r292738) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_8316.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8316.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_8316.c Sat Dec 26 02:31:39 2015 (r292738) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sat Dec 26 02:31:39 2015 (r292738) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_9340.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_9340.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_9340.c Sat Dec 26 02:31:39 2015 (r292738) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_phy.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_phy.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_phy.c Sat Dec 26 02:31:39 2015 (r292738) @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/arswitch/arswitch_reg.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_reg.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/arswitch/arswitch_reg.c Sat Dec 26 02:31:39 2015 (r292738) @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6000sw.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c Sat Dec 26 02:31:39 2015 (r292738) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/dev/etherswitch/ip17x/ip17x.c ============================================================================== --- head/sys/dev/etherswitch/ip17x/ip17x.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/ip17x/ip17x.c Sat Dec 26 02:31:39 2015 (r292738) @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include Modified: head/sys/dev/etherswitch/ukswitch/ukswitch.c ============================================================================== --- head/sys/dev/etherswitch/ukswitch/ukswitch.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/etherswitch/ukswitch/ukswitch.c Sat Dec 26 02:31:39 2015 (r292738) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include Copied and modified: head/sys/dev/mdio/mdio.c (from r292734, head/sys/dev/etherswitch/mdio.c) ============================================================================== --- head/sys/dev/etherswitch/mdio.c Fri Dec 25 18:11:40 2015 (r292734, copy source) +++ head/sys/dev/mdio/mdio.c Sat Dec 26 02:31:39 2015 (r292738) @@ -29,8 +29,9 @@ #include #include #include +#include -#include +#include #include "mdio_if.h" @@ -115,3 +116,5 @@ driver_t mdio_driver = { }; devclass_t mdio_devclass; + +MODULE_VERSION(mdio, 1); Copied and modified: head/sys/dev/mdio/mdio.h (from r292734, head/sys/dev/etherswitch/mdio.h) ============================================================================== --- head/sys/dev/etherswitch/mdio.h Fri Dec 25 18:11:40 2015 (r292734, copy source) +++ head/sys/dev/mdio/mdio.h Sat Dec 26 02:31:39 2015 (r292738) @@ -26,10 +26,10 @@ * $FreeBSD$ */ -#ifndef __DEV_ETHERSWITCH_MDIO_H__ -#define __DEV_ETHERSWITCH_MDIO_H__ +#ifndef __DEV_MDIO_MDIO_H__ +#define __DEV_MDIO_MDIO_H__ extern driver_t mdio_driver; extern devclass_t mdio_devclass; -#endif /* __DEV_ETHERSWITCH_MDIO_H__ */ +#endif /* __DEV_MDIO_MDIO_H__ */ Copied: head/sys/dev/mdio/mdio_if.m (from r292734, head/sys/dev/etherswitch/mdio_if.m) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mdio/mdio_if.m Sat Dec 26 02:31:39 2015 (r292738, copy of r292734, head/sys/dev/etherswitch/mdio_if.m) @@ -0,0 +1,24 @@ +# $FreeBSD$ + +#include + +INTERFACE mdio; + +# +# Read register from device on MDIO bus +# +METHOD int readreg { + device_t dev; + int phy; + int reg; +}; + +# +# Write register to device on MDIO bus +# +METHOD int writereg { + device_t dev; + int phy; + int reg; + int val; +}; Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/dev/mge/if_mge.c Sat Dec 26 02:31:39 2015 (r292738) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Dec 26 00:31:19 2015 (r292737) +++ head/sys/modules/Makefile Sat Dec 26 02:31:39 2015 (r292738) @@ -220,6 +220,7 @@ SUBDIR= \ malo \ mcd \ md \ + mdio \ mem \ mfi \ mii \ Added: head/sys/modules/mdio/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/mdio/Makefile Sat Dec 26 02:31:39 2015 (r292738) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/mdio + +KMOD= mdio +SRCS= mdio.c +SRCS+= mdio_if.c mdio_if.h +SRCS+= device_if.h bus_if.h + +.include From owner-svn-src-all@freebsd.org Sat Dec 26 03:30:07 2015 Return-Path: Delivered-To: svn-src-all@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 B5C2AA5248D; Sat, 26 Dec 2015 03:30:07 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qg0-x232.google.com (mail-qg0-x232.google.com [IPv6:2607:f8b0:400d:c04::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 74CF41027; Sat, 26 Dec 2015 03:30:07 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-qg0-x232.google.com with SMTP id e32so26211859qgf.3; Fri, 25 Dec 2015 19:30:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references; bh=3OaKiAA70pB/BFa2nmfke9sil/mG5uPQlkYy3uh/nlw=; b=v/RbguDcbIn39nFDbAjEzRTvVYL7fchdWSh5NEdaonxRfEVuAON70fyO4TFB1DujZk rp6no/uEOb/1ulM+7yRIlTN+/2hww5nHOjqDOnCGR6uwZF8RVHXDeg7Ts/M142/A/Wf6 kZRDsTLtpQ1pQuTbHZyeEu4V3mt+rJ5s2KqpGuwfUmM/IuRW4Ywwf329OHojkm+/xwLy +jydqAWS5JEAIbS9pytNULUOwpv6/HehjZ0HVxPKd+Na9+cqexc1K/2LVjygz4hookCr 9+Qr7TK7YOkFhi6lm4+YPdycth43Kd9oPGd1s7EnBPRdTLode7swOyq1zYHpwsgOrngo astg== X-Received: by 10.140.19.229 with SMTP id 92mr56661594qgh.100.1451100606531; Fri, 25 Dec 2015 19:30:06 -0800 (PST) Received: from [192.168.1.104] (c-69-140-118-251.hsd1.md.comcast.net. [69.140.118.251]) by smtp.gmail.com with ESMTPSA id a197sm3735727qhc.25.2015.12.25.19.30.05 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 25 Dec 2015 19:30:05 -0800 (PST) Cc: Ed Maste , Alan Cox , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: From: Justin Hibbits To: NGie Cooper In-Reply-To: <610A02A5-1399-4A6C-993C-CDCC9DC8502A@gmail.com> Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: svn commit: r292469 - in head/sys: dev/drm2/ttm mips/include mips/mips vm Date: Fri, 25 Dec 2015 22:30:04 -0500 References: <201512191842.tBJIgohI010539@repo.freebsd.org> <610A02A5-1399-4A6C-993C-CDCC9DC8502A@gmail.com> X-Mailer: Apple Mail (2.936) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 03:30:07 -0000 On Dec 22, 2015, at 6:47 PM, NGie Cooper wrote: > >> On Dec 22, 2015, at 13:51, Ed Maste wrote: >> >> On 19 December 2015 at 13:42, Alan Cox wrote: >>> Author: alc >>> Date: Sat Dec 19 18:42:50 2015 >>> New Revision: 292469 >>> URL: https://svnweb.freebsd.org/changeset/base/292469 >>> >>> Log: >>> Introduce a new mechanism for relocating virtual pages to a new =20 >>> physical >>> address and use this mechanism when: >> >> Universe build is failing on powerpc.powerpc with: >> >> cc1: warnings being treated as errors >> /scratch/tmp/emaste/freebsd/sys/vm/vm_page.c: In function =20 >> 'vm_page_reclaim_run': >> /scratch/tmp/emaste/freebsd/sys/vm/vm_page.c:2449: warning: =20 >> comparison >> is always true due to limited range of data type >> *** [vm_page.o] Error code 1 > > +1 > > It=92s only with the MPC85XX kernel, which I believe is 32-bit = powerpc. > > Thanks! > -NGie This is fixed by r292680. - Justin= From owner-svn-src-all@freebsd.org Sat Dec 26 04:26:34 2015 Return-Path: Delivered-To: svn-src-all@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 992FBA513D9; Sat, 26 Dec 2015 04:26:34 +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 4EFCB1891; Sat, 26 Dec 2015 04:26:34 +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 tBQ4QXnS073556; Sat, 26 Dec 2015 04:26:33 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQ4QXmq073553; Sat, 26 Dec 2015 04:26:33 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512260426.tBQ4QXmq073553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 26 Dec 2015 04:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292739 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 04:26:34 -0000 Author: mav Date: Sat Dec 26 04:26:32 2015 New Revision: 292739 URL: https://svnweb.freebsd.org/changeset/base/292739 Log: Make virtual ports control asynchronous. Before this change virtual ports control IOCBs were executed synchronously via Execute IOCB mailbox command. It required exclusive use of scratch space of driver and mailbox registers of the hardware. Because of that shared resources use this code could not really sleep, having to spin for completion, blocking any other operation. This change introduces new asynchronous design, sending the IOCBs directly on request queue and gracefully waiting for their return on response queue. Returned IOCBs are identified with unified handle space from r292725. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_library.c head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sat Dec 26 02:31:39 2015 (r292738) +++ head/sys/dev/isp/isp.c Sat Dec 26 04:26:32 2015 (r292739) @@ -2348,64 +2348,64 @@ static int isp_fc_enable_vp(ispsoftc_t *isp, int chan) { fcparam *fcp = FCPARAM(isp, chan); - mbreg_t mbs; - vp_modify_t *vp; - uint8_t qe[QENTRY_LEN], *scp; - - ISP_MEMZERO(qe, QENTRY_LEN); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - return (EBUSY); - } - scp = fcp->isp_scratch; + vp_modify_t vp; + void *reqp; + uint8_t resp[QENTRY_LEN]; /* Build a VP MODIFY command in memory */ - vp = (vp_modify_t *) qe; - vp->vp_mod_hdr.rqs_entry_type = RQSTYPE_VP_MODIFY; - vp->vp_mod_hdr.rqs_entry_count = 1; - vp->vp_mod_cnt = 1; - vp->vp_mod_idx0 = chan; - vp->vp_mod_cmd = VP_MODIFY_ENA; - vp->vp_mod_ports[0].options = ICB2400_VPOPT_ENABLED | + ISP_MEMZERO(&vp, sizeof(vp)); + vp.vp_mod_hdr.rqs_entry_type = RQSTYPE_VP_MODIFY; + vp.vp_mod_hdr.rqs_entry_count = 1; + vp.vp_mod_cnt = 1; + vp.vp_mod_idx0 = chan; + vp.vp_mod_cmd = VP_MODIFY_ENA; + vp.vp_mod_ports[0].options = ICB2400_VPOPT_ENABLED | ICB2400_VPOPT_ENA_SNSLOGIN; - if (fcp->role & ISP_ROLE_INITIATOR) { - vp->vp_mod_ports[0].options |= ICB2400_VPOPT_INI_ENABLE; - } - if ((fcp->role & ISP_ROLE_TARGET) == 0) { - vp->vp_mod_ports[0].options |= ICB2400_VPOPT_TGT_DISABLE; - } + if (fcp->role & ISP_ROLE_INITIATOR) + vp.vp_mod_ports[0].options |= ICB2400_VPOPT_INI_ENABLE; + if ((fcp->role & ISP_ROLE_TARGET) == 0) + vp.vp_mod_ports[0].options |= ICB2400_VPOPT_TGT_DISABLE; if (fcp->isp_loopid < LOCAL_LOOP_LIM) { - vp->vp_mod_ports[0].loopid = fcp->isp_loopid; + vp.vp_mod_ports[0].loopid = fcp->isp_loopid; if (isp->isp_confopts & ISP_CFG_OWNLOOPID) - vp->vp_mod_ports[0].options |= - ICB2400_VPOPT_HARD_ADDRESS; + vp.vp_mod_ports[0].options |= ICB2400_VPOPT_HARD_ADDRESS; else - vp->vp_mod_ports[0].options |= - ICB2400_VPOPT_PREV_ADDRESS; + vp.vp_mod_ports[0].options |= ICB2400_VPOPT_PREV_ADDRESS; } - MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwpn, fcp->isp_wwpn); - MAKE_NODE_NAME_FROM_WWN(vp->vp_mod_ports[0].wwnn, fcp->isp_wwnn); - isp_put_vp_modify(isp, vp, (vp_modify_t *) scp); + MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwpn, fcp->isp_wwpn); + MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwnn, fcp->isp_wwnn); - /* Build a EXEC IOCB A64 command that points to the VP MODIFY command */ - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 0); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); - isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - FC_SCRATCH_RELEASE(isp, chan); + /* Prepare space for response in memory */ + memset(resp, 0xff, sizeof(resp)); + vp.vp_mod_hdl = isp_allocate_handle(isp, resp, ISP_HANDLE_CTRL); + if (vp.vp_mod_hdl == 0) { + isp_prt(isp, ISP_LOGERR, + "%s: VP_MODIFY of Chan %d out of handles", __func__, chan); return (EIO); } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); - isp_get_vp_modify(isp, (vp_modify_t *)&scp[QENTRY_LEN], vp); - FC_SCRATCH_RELEASE(isp, chan); + /* Send request and wait for response. */ + reqp = isp_getrqentry(isp); + if (reqp == NULL) { + isp_prt(isp, ISP_LOGERR, + "%s: VP_MODIFY of Chan %d out of rqent", __func__, chan); + isp_destroy_handle(isp, vp.vp_mod_hdl); + return (EIO); + } + isp_put_vp_modify(isp, &vp, (vp_modify_t *)reqp); + ISP_SYNC_REQUEST(isp); + if (msleep(resp, &isp->isp_lock, 0, "VP_MODIFY", 5*hz) == EWOULDBLOCK) { + isp_prt(isp, ISP_LOGERR, + "%s: VP_MODIFY of Chan %d timed out", __func__, chan); + isp_destroy_handle(isp, vp.vp_mod_hdl); + return (EIO); + } + isp_get_vp_modify(isp, (vp_modify_t *)resp, &vp); - if (vp->vp_mod_status != VP_STS_OK) { - isp_prt(isp, ISP_LOGERR, "%s: VP_MODIFY of Chan %d failed with status %d", __func__, chan, vp->vp_mod_status); + if (vp.vp_mod_hdr.rqs_flags != 0 || vp.vp_mod_status != VP_STS_OK) { + isp_prt(isp, ISP_LOGERR, + "%s: VP_MODIFY of Chan %d failed with flags %x status %d", + __func__, chan, vp.vp_mod_hdr.rqs_flags, vp.vp_mod_status); return (EIO); } return (0); @@ -2414,54 +2414,56 @@ isp_fc_enable_vp(ispsoftc_t *isp, int ch static int isp_fc_disable_vp(ispsoftc_t *isp, int chan) { - fcparam *fcp = FCPARAM(isp, chan); - mbreg_t mbs; - vp_ctrl_info_t *vp; - uint8_t qe[QENTRY_LEN], *scp; - - ISP_MEMZERO(qe, QENTRY_LEN); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - return (EBUSY); - } - scp = fcp->isp_scratch; + vp_ctrl_info_t vp; + void *reqp; + uint8_t resp[QENTRY_LEN]; /* Build a VP CTRL command in memory */ - vp = (vp_ctrl_info_t *) qe; - vp->vp_ctrl_hdr.rqs_entry_type = RQSTYPE_VP_CTRL; - vp->vp_ctrl_hdr.rqs_entry_count = 1; + ISP_MEMZERO(&vp, sizeof(vp)); + vp.vp_ctrl_hdr.rqs_entry_type = RQSTYPE_VP_CTRL; + vp.vp_ctrl_hdr.rqs_entry_count = 1; if (ISP_CAP_VP0(isp)) { - vp->vp_ctrl_status = 1; + vp.vp_ctrl_status = 1; } else { - vp->vp_ctrl_status = 0; + vp.vp_ctrl_status = 0; chan--; /* VP0 can not be controlled in this case. */ } - vp->vp_ctrl_command = VP_CTRL_CMD_DISABLE_VP_LOGO_ALL; - vp->vp_ctrl_vp_count = 1; - vp->vp_ctrl_idmap[chan / 16] |= (1 << chan % 16); - isp_put_vp_ctrl_info(isp, vp, (vp_ctrl_info_t *) scp); - - /* Build a EXEC IOCB A64 command that points to the VP CTRL command */ - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, 0); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, 2 * QENTRY_LEN, chan); - isp_control(isp, ISPCTL_RUN_MBOXCMD, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - FC_SCRATCH_RELEASE(isp, chan); + vp.vp_ctrl_command = VP_CTRL_CMD_DISABLE_VP_LOGO_ALL; + vp.vp_ctrl_vp_count = 1; + vp.vp_ctrl_idmap[chan / 16] |= (1 << chan % 16); + + /* Prepare space for response in memory */ + memset(resp, 0xff, sizeof(resp)); + vp.vp_ctrl_handle = isp_allocate_handle(isp, resp, ISP_HANDLE_CTRL); + if (vp.vp_ctrl_handle == 0) { + isp_prt(isp, ISP_LOGERR, + "%s: VP_CTRL of Chan %d out of handles", __func__, chan); return (EIO); } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); - isp_get_vp_ctrl_info(isp, (vp_ctrl_info_t *)&scp[QENTRY_LEN], vp); - FC_SCRATCH_RELEASE(isp, chan); + /* Send request and wait for response. */ + reqp = isp_getrqentry(isp); + if (reqp == NULL) { + isp_prt(isp, ISP_LOGERR, + "%s: VP_CTRL of Chan %d out of rqent", __func__, chan); + isp_destroy_handle(isp, vp.vp_ctrl_handle); + return (EIO); + } + isp_put_vp_ctrl_info(isp, &vp, (vp_ctrl_info_t *)reqp); + ISP_SYNC_REQUEST(isp); + if (msleep(resp, &isp->isp_lock, 0, "VP_CTRL", 5*hz) == EWOULDBLOCK) { + isp_prt(isp, ISP_LOGERR, + "%s: VP_CTRL of Chan %d timed out", __func__, chan); + isp_destroy_handle(isp, vp.vp_ctrl_handle); + return (EIO); + } + isp_get_vp_ctrl_info(isp, (vp_ctrl_info_t *)resp, &vp); - if (vp->vp_ctrl_status != 0) { + if (vp.vp_ctrl_hdr.rqs_flags != 0 || vp.vp_ctrl_status != 0) { isp_prt(isp, ISP_LOGERR, - "%s: VP_CTRL of Chan %d failed with status %d %d", - __func__, chan, vp->vp_ctrl_status, vp->vp_ctrl_index_fail); + "%s: VP_CTRL of Chan %d failed with flags %x status %d %d", + __func__, chan, vp.vp_ctrl_hdr.rqs_flags, + vp.vp_ctrl_status, vp.vp_ctrl_index_fail); return (EIO); } return (0); @@ -6123,6 +6125,8 @@ isp_handle_other_response(ispsoftc_t *is { isp_ridacq_t rid; int chan, c; + uint32_t hdl; + void *ptr; switch (type) { case RQSTYPE_STATUS_CONT: @@ -6164,6 +6168,16 @@ isp_handle_other_response(ispsoftc_t *is } } return (1); + case RQSTYPE_VP_MODIFY: + case RQSTYPE_VP_CTRL: + ISP_IOXGET_32(isp, (uint32_t *)(hp + 1), hdl); + ptr = isp_find_xs(isp, hdl); + if (ptr != NULL) { + isp_destroy_handle(isp, hdl); + memcpy(ptr, hp, QENTRY_LEN); + wakeup(ptr); + } + return (1); case RQSTYPE_ATIO: case RQSTYPE_CTIO: case RQSTYPE_ENABLE_LUN: Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Sat Dec 26 02:31:39 2015 (r292738) +++ head/sys/dev/isp/isp_library.c Sat Dec 26 04:26:32 2015 (r292739) @@ -572,7 +572,8 @@ isp_clear_commands(ispsoftc_t *isp) for (tmp = 0; isp->isp_xflist && tmp < isp->isp_maxcmds; tmp++) { hdp = &isp->isp_xflist[tmp]; - if (ISP_H2HT(hdp->handle) == ISP_HANDLE_INITIATOR) { + switch (ISP_H2HT(hdp->handle)) { + case ISP_HANDLE_INITIATOR: { XS_T *xs = hdp->cmd; if (XS_XFRLEN(xs)) { ISP_DMAFREE(isp, xs, hdp->handle); @@ -580,12 +581,13 @@ isp_clear_commands(ispsoftc_t *isp) } else { XS_SET_RESID(xs, 0); } - hdp->handle = 0; - hdp->cmd = NULL; + isp_destroy_handle(isp, hdp->handle); XS_SETERR(xs, HBA_BUSRESET); isp_done(xs); + break; + } #ifdef ISP_TARGET_MODE - } else if (ISP_H2HT(hdp->handle) == ISP_HANDLE_TARGET) { + case ISP_HANDLE_TARGET: { uint8_t local[QENTRY_LEN]; ISP_DMAFREE(isp, hdp->cmd, hdp->handle); ISP_MEMZERO(local, QENTRY_LEN); @@ -601,7 +603,13 @@ isp_clear_commands(ispsoftc_t *isp) ctio->ct_header.rqs_entry_type = RQSTYPE_CTIO2; } isp_async(isp, ISPASYNC_TARGET_ACTION, local); + break; + } #endif + case ISP_HANDLE_CTRL: + wakeup(hdp->cmd); + isp_destroy_handle(isp, hdp->handle); + break; } } #ifdef ISP_TARGET_MODE Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Sat Dec 26 02:31:39 2015 (r292738) +++ head/sys/dev/isp/ispvar.h Sat Dec 26 04:26:32 2015 (r292739) @@ -315,12 +315,14 @@ typedef struct { # define ISP_HANDLE_NONE 0 # define ISP_HANDLE_INITIATOR 1 # define ISP_HANDLE_TARGET 2 +# define ISP_HANDLE_CTRL 3 #define ISP_HANDLE_SEQ_MASK 0xffff0000 #define ISP_HANDLE_SEQ_SHIFT 16 #define ISP_H2SEQ(hdl) ((hdl & ISP_HANDLE_SEQ_MASK) >> ISP_HANDLE_SEQ_SHIFT) #define ISP_VALID_HANDLE(c, hdl) \ ((ISP_H2HT(hdl) == ISP_HANDLE_INITIATOR || \ - ISP_H2HT(hdl) == ISP_HANDLE_TARGET) && \ + ISP_H2HT(hdl) == ISP_HANDLE_TARGET || \ + ISP_H2HT(hdl) == ISP_HANDLE_CTRL) && \ ((hdl) & ISP_HANDLE_CMD_MASK) < (c)->isp_maxcmds && \ (hdl) == ((c)->isp_xflist[(hdl) & ISP_HANDLE_CMD_MASK].handle)) #define ISP_BAD_HANDLE_INDEX 0xffffffff From owner-svn-src-all@freebsd.org Sat Dec 26 06:05:22 2015 Return-Path: Delivered-To: svn-src-all@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 7A0E9A52B11; Sat, 26 Dec 2015 06:05:22 +0000 (UTC) (envelope-from np@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 421DC1619; Sat, 26 Dec 2015 06:05:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBQ65LwS002776; Sat, 26 Dec 2015 06:05:21 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQ65LXL002774; Sat, 26 Dec 2015 06:05:21 GMT (envelope-from np@FreeBSD.org) Message-Id: <201512260605.tBQ65LXL002774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 26 Dec 2015 06:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292740 - in head/sys: dev/cxgbe/cxgbei modules/cxgbe modules/cxgbe/cxgbei X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 06:05:22 -0000 Author: np Date: Sat Dec 26 06:05:21 2015 New Revision: 292740 URL: https://svnweb.freebsd.org/changeset/base/292740 Log: cxgbei: Hardware accelerated iSCSI target and initiator for TOE capable cards supported by cxgbe(4). On the host side this driver interfaces with the storage stack via the ICL (iSCSI Common Layer) in the kernel. On the wire the traffic is standard iSCSI (SCSI over TCP as per RFC 3720/7143 etc.) that interoperates with all other standards compliant implementations. The driver is layered on top of the TOE driver (t4_tom) and promotes connections being handled by t4_tom to iSCSI ULP (Upper Layer Protocol) mode. Hardware assistance in this mode includes: - Full TCP processing. - iSCSI PDU identification and recovery within the TCP stream. - Header and/or data digest insertion (tx) and verification (rx). - Zero copy (both tx and rx). Man page will follow in a separate commit in a couple of weeks. Relnotes: Yes Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/cxgbei/ head/sys/dev/cxgbe/cxgbei/cxgbei.c (contents, props changed) head/sys/dev/cxgbe/cxgbei/cxgbei.h (contents, props changed) head/sys/dev/cxgbe/cxgbei/cxgbei_ulp2_ddp.c (contents, props changed) head/sys/dev/cxgbe/cxgbei/cxgbei_ulp2_ddp.h (contents, props changed) head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c (contents, props changed) head/sys/modules/cxgbe/cxgbei/ head/sys/modules/cxgbe/cxgbei/Makefile (contents, props changed) Modified: head/sys/modules/cxgbe/Makefile Added: head/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Sat Dec 26 06:05:21 2015 (r292740) @@ -0,0 +1,1131 @@ +/*- + * Copyright (c) 2012 Chelsio Communications, Inc. + * All rights reserved. + * + * Chelsio T5xx iSCSI driver + * + * Written by: Sreenivasa Honnur + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_inet6.h" + +#include +#include +#include +#include +#include + +#ifdef TCP_OFFLOAD +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common/common.h" +#include "common/t4_msg.h" +#include "common/t4_regs.h" /* for PCIE_MEM_ACCESS */ +#include "tom/t4_tom.h" +#include "cxgbei.h" +#include "cxgbei_ulp2_ddp.h" + +static int worker_thread_count; +static struct cxgbei_worker_thread_softc *cwt_softc; +static struct proc *cxgbei_proc; + +/* XXXNP some header instead. */ +struct icl_pdu *icl_cxgbei_new_pdu(int); +void icl_cxgbei_new_pdu_set_conn(struct icl_pdu *, struct icl_conn *); +void icl_cxgbei_conn_pdu_free(struct icl_conn *, struct icl_pdu *); + +/* + * Direct Data Placement - + * Directly place the iSCSI Data-In or Data-Out PDU's payload into pre-posted + * final destination host-memory buffers based on the Initiator Task Tag (ITT) + * in Data-In or Target Task Tag (TTT) in Data-Out PDUs. + * The host memory address is programmed into h/w in the format of pagepod + * entries. + * The location of the pagepod entry is encoded into ddp tag which is used as + * the base for ITT/TTT. + */ + +/* + * functions to program the pagepod in h/w + */ +static void inline +ppod_set(struct pagepod *ppod, + struct cxgbei_ulp2_pagepod_hdr *hdr, + struct cxgbei_ulp2_gather_list *gl, + unsigned int pidx) +{ + int i; + + memcpy(ppod, hdr, sizeof(*hdr)); + + for (i = 0; i < (PPOD_PAGES + 1); i++, pidx++) { + ppod->addr[i] = pidx < gl->nelem ? + cpu_to_be64(gl->dma_sg[pidx].phys_addr) : 0ULL; + } +} + +static void inline +ppod_clear(struct pagepod *ppod) +{ + memset(ppod, 0, sizeof(*ppod)); +} + +static inline void +ulp_mem_io_set_hdr(struct adapter *sc, int tid, struct ulp_mem_io *req, + unsigned int wr_len, unsigned int dlen, + unsigned int pm_addr) +{ + struct ulptx_idata *idata = (struct ulptx_idata *)(req + 1); + + INIT_ULPTX_WR(req, wr_len, 0, 0); + req->cmd = cpu_to_be32(V_ULPTX_CMD(ULP_TX_MEM_WRITE) | + V_ULP_MEMIO_ORDER(is_t4(sc)) | + V_T5_ULP_MEMIO_IMM(is_t5(sc))); + req->dlen = htonl(V_ULP_MEMIO_DATA_LEN(dlen >> 5)); + req->len16 = htonl(DIV_ROUND_UP(wr_len - sizeof(req->wr), 16) + | V_FW_WR_FLOWID(tid)); + req->lock_addr = htonl(V_ULP_MEMIO_ADDR(pm_addr >> 5)); + + idata->cmd_more = htonl(V_ULPTX_CMD(ULP_TX_SC_IMM)); + idata->len = htonl(dlen); +} + +#define PPOD_SIZE sizeof(struct pagepod) +#define ULPMEM_IDATA_MAX_NPPODS 1 /* 256/PPOD_SIZE */ +#define PCIE_MEMWIN_MAX_NPPODS 16 /* 1024/PPOD_SIZE */ + +static int +ppod_write_idata(struct cxgbei_data *ci, + struct cxgbei_ulp2_pagepod_hdr *hdr, + unsigned int idx, unsigned int npods, + struct cxgbei_ulp2_gather_list *gl, + unsigned int gl_pidx, struct toepcb *toep) +{ + u_int dlen = PPOD_SIZE * npods; + u_int pm_addr = idx * PPOD_SIZE + ci->llimit; + u_int wr_len = roundup(sizeof(struct ulp_mem_io) + + sizeof(struct ulptx_idata) + dlen, 16); + struct ulp_mem_io *req; + struct ulptx_idata *idata; + struct pagepod *ppod; + u_int i; + struct wrqe *wr; + struct adapter *sc = toep->vi->pi->adapter; + + wr = alloc_wrqe(wr_len, toep->ctrlq); + if (wr == NULL) { + CXGBE_UNIMPLEMENTED("ppod_write_idata: alloc_wrqe failure"); + return (ENOMEM); + } + + req = wrtod(wr); + memset(req, 0, wr_len); + ulp_mem_io_set_hdr(sc, toep->tid, req, wr_len, dlen, pm_addr); + idata = (struct ulptx_idata *)(req + 1); + + ppod = (struct pagepod *)(idata + 1); + for (i = 0; i < npods; i++, ppod++, gl_pidx += PPOD_PAGES) { + if (!hdr) /* clear the pagepod */ + ppod_clear(ppod); + else /* set the pagepod */ + ppod_set(ppod, hdr, gl, gl_pidx); + } + + t4_wrq_tx(sc, wr); + return 0; +} + +int +t4_ddp_set_map(struct cxgbei_data *ci, void *iccp, + struct cxgbei_ulp2_pagepod_hdr *hdr, u_int idx, u_int npods, + struct cxgbei_ulp2_gather_list *gl, int reply) +{ + struct icl_cxgbei_conn *icc = (struct icl_cxgbei_conn *)iccp; + struct toepcb *toep = icc->toep; + int err; + unsigned int pidx = 0, w_npods = 0, cnt; + + /* + * on T4, if we use a mix of IMMD and DSGL with ULP_MEM_WRITE, + * the order would not be garanteed, so we will stick with IMMD + */ + gl->tid = toep->tid; + gl->port_id = toep->vi->pi->port_id; + gl->egress_dev = (void *)toep->vi->ifp; + + /* send via immediate data */ + for (; w_npods < npods; idx += cnt, w_npods += cnt, + pidx += PPOD_PAGES) { + cnt = npods - w_npods; + if (cnt > ULPMEM_IDATA_MAX_NPPODS) + cnt = ULPMEM_IDATA_MAX_NPPODS; + err = ppod_write_idata(ci, hdr, idx, cnt, gl, pidx, toep); + if (err) { + printf("%s: ppod_write_idata failed\n", __func__); + break; + } + } + return err; +} + +void +t4_ddp_clear_map(struct cxgbei_data *ci, struct cxgbei_ulp2_gather_list *gl, + u_int tag, u_int idx, u_int npods, struct icl_cxgbei_conn *icc) +{ + struct toepcb *toep = icc->toep; + int err = -1; + u_int pidx = 0; + u_int w_npods = 0; + u_int cnt; + + for (; w_npods < npods; idx += cnt, w_npods += cnt, + pidx += PPOD_PAGES) { + cnt = npods - w_npods; + if (cnt > ULPMEM_IDATA_MAX_NPPODS) + cnt = ULPMEM_IDATA_MAX_NPPODS; + err = ppod_write_idata(ci, NULL, idx, cnt, gl, 0, toep); + if (err) + break; + } +} + +static int +cxgbei_map_sg(struct cxgbei_sgl *sgl, struct ccb_scsiio *csio) +{ + unsigned int data_len = csio->dxfer_len; + unsigned int sgoffset = (uint64_t)csio->data_ptr & PAGE_MASK; + unsigned int nsge; + unsigned char *sgaddr = csio->data_ptr; + unsigned int len = 0; + + nsge = (csio->dxfer_len + sgoffset + PAGE_SIZE - 1) >> PAGE_SHIFT; + sgl->sg_addr = sgaddr; + sgl->sg_offset = sgoffset; + if (data_len < (PAGE_SIZE - sgoffset)) + len = data_len; + else + len = PAGE_SIZE - sgoffset; + + sgl->sg_length = len; + + data_len -= len; + sgaddr += len; + sgl = sgl+1; + + while (data_len > 0) { + sgl->sg_addr = sgaddr; + len = (data_len < PAGE_SIZE)? data_len: PAGE_SIZE; + sgl->sg_length = len; + sgaddr += len; + data_len -= len; + sgl = sgl + 1; + } + + return nsge; +} + +static int +cxgbei_map_sg_tgt(struct cxgbei_sgl *sgl, union ctl_io *io) +{ + unsigned int data_len, sgoffset, nsge; + unsigned char *sgaddr; + unsigned int len = 0, index = 0, ctl_sg_count, i; + struct ctl_sg_entry ctl_sg_entry, *ctl_sglist; + + if (io->scsiio.kern_sg_entries > 0) { + ctl_sglist = (struct ctl_sg_entry *)io->scsiio.kern_data_ptr; + ctl_sg_count = io->scsiio.kern_sg_entries; + } else { + ctl_sglist = &ctl_sg_entry; + ctl_sglist->addr = io->scsiio.kern_data_ptr; + ctl_sglist->len = io->scsiio.kern_data_len; + ctl_sg_count = 1; + } + + sgaddr = sgl->sg_addr = ctl_sglist[index].addr; + sgoffset = sgl->sg_offset = (uint64_t)sgl->sg_addr & PAGE_MASK; + data_len = ctl_sglist[index].len; + + if (data_len < (PAGE_SIZE - sgoffset)) + len = data_len; + else + len = PAGE_SIZE - sgoffset; + + sgl->sg_length = len; + + data_len -= len; + sgaddr += len; + sgl = sgl+1; + + len = 0; + for (i = 0; i< ctl_sg_count; i++) + len += ctl_sglist[i].len; + nsge = (len + sgoffset + PAGE_SIZE -1) >> PAGE_SHIFT; + while (data_len > 0) { + sgl->sg_addr = sgaddr; + len = (data_len < PAGE_SIZE)? data_len: PAGE_SIZE; + sgl->sg_length = len; + sgaddr += len; + data_len -= len; + sgl = sgl + 1; + if (data_len == 0) { + if (index == ctl_sg_count - 1) + break; + index++; + sgaddr = ctl_sglist[index].addr; + data_len = ctl_sglist[index].len; + } + } + + return nsge; +} + +static int +t4_sk_ddp_tag_reserve(struct cxgbei_data *ci, struct icl_cxgbei_conn *icc, + u_int xferlen, struct cxgbei_sgl *sgl, u_int sgcnt, u_int *ddp_tag) +{ + struct cxgbei_ulp2_gather_list *gl; + int err = -EINVAL; + struct toepcb *toep = icc->toep; + + gl = cxgbei_ulp2_ddp_make_gl_from_iscsi_sgvec(xferlen, sgl, sgcnt, ci, 0); + if (gl) { + err = cxgbei_ulp2_ddp_tag_reserve(ci, icc, toep->tid, + &ci->tag_format, ddp_tag, gl, 0, 0); + if (err) { + cxgbei_ulp2_ddp_release_gl(ci, gl); + } + } + + return err; +} + +static unsigned int +cxgbei_task_reserve_itt(struct icl_conn *ic, void **prv, + struct ccb_scsiio *scmd, unsigned int *itt) +{ + struct icl_cxgbei_conn *icc = ic_to_icc(ic); + int xferlen = scmd->dxfer_len; + struct cxgbei_task_data *tdata = NULL; + struct cxgbei_sgl *sge = NULL; + struct toepcb *toep = icc->toep; + struct adapter *sc = td_adapter(toep->td); + struct cxgbei_data *ci = sc->iscsi_ulp_softc; + int err = -1; + + MPASS(icc->icc_signature == CXGBEI_CONN_SIGNATURE); + + tdata = (struct cxgbei_task_data *)*prv; + if (xferlen == 0 || tdata == NULL) + goto out; + if (xferlen < DDP_THRESHOLD) + goto out; + + if ((scmd->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { + tdata->nsge = cxgbei_map_sg(tdata->sgl, scmd); + if (tdata->nsge == 0) { + CTR1(KTR_CXGBE, "%s: map_sg failed", __func__); + return 0; + } + sge = tdata->sgl; + + tdata->sc_ddp_tag = *itt; + + CTR3(KTR_CXGBE, "%s: *itt:0x%x sc_ddp_tag:0x%x", + __func__, *itt, tdata->sc_ddp_tag); + if (cxgbei_ulp2_sw_tag_usable(&ci->tag_format, + tdata->sc_ddp_tag)) { + err = t4_sk_ddp_tag_reserve(ci, icc, scmd->dxfer_len, + sge, tdata->nsge, &tdata->sc_ddp_tag); + } else { + CTR3(KTR_CXGBE, + "%s: itt:0x%x sc_ddp_tag:0x%x not usable", + __func__, *itt, tdata->sc_ddp_tag); + } + } +out: + if (err < 0) + tdata->sc_ddp_tag = + cxgbei_ulp2_set_non_ddp_tag(&ci->tag_format, *itt); + + return tdata->sc_ddp_tag; +} + +static unsigned int +cxgbei_task_reserve_ttt(struct icl_conn *ic, void **prv, union ctl_io *io, + unsigned int *ttt) +{ + struct icl_cxgbei_conn *icc = ic_to_icc(ic); + struct toepcb *toep = icc->toep; + struct adapter *sc = td_adapter(toep->td); + struct cxgbei_data *ci = sc->iscsi_ulp_softc; + struct cxgbei_task_data *tdata = NULL; + int xferlen, err = -1; + struct cxgbei_sgl *sge = NULL; + + MPASS(icc->icc_signature == CXGBEI_CONN_SIGNATURE); + + xferlen = (io->scsiio.kern_data_len - io->scsiio.ext_data_filled); + tdata = (struct cxgbei_task_data *)*prv; + if ((xferlen == 0) || (tdata == NULL)) + goto out; + if (xferlen < DDP_THRESHOLD) + goto out; + tdata->nsge = cxgbei_map_sg_tgt(tdata->sgl, io); + if (tdata->nsge == 0) { + CTR1(KTR_CXGBE, "%s: map_sg failed", __func__); + return 0; + } + sge = tdata->sgl; + + tdata->sc_ddp_tag = *ttt; + if (cxgbei_ulp2_sw_tag_usable(&ci->tag_format, tdata->sc_ddp_tag)) { + err = t4_sk_ddp_tag_reserve(ci, icc, xferlen, sge, + tdata->nsge, &tdata->sc_ddp_tag); + } else { + CTR2(KTR_CXGBE, "%s: sc_ddp_tag:0x%x not usable", + __func__, tdata->sc_ddp_tag); + } +out: + if (err < 0) + tdata->sc_ddp_tag = + cxgbei_ulp2_set_non_ddp_tag(&ci->tag_format, *ttt); + return tdata->sc_ddp_tag; +} + +static int +t4_sk_ddp_tag_release(struct icl_cxgbei_conn *icc, unsigned int ddp_tag) +{ + struct toepcb *toep = icc->toep; + struct adapter *sc = td_adapter(toep->td); + struct cxgbei_data *ci = sc->iscsi_ulp_softc; + + cxgbei_ulp2_ddp_tag_release(ci, ddp_tag, icc); + + return (0); +} + +static int +cxgbei_ddp_init(struct adapter *sc, struct cxgbei_data *ci) +{ + int nppods, bits, max_sz, rc; + static const u_int pgsz_order[] = {0, 1, 2, 3}; + + MPASS(sc->vres.iscsi.size > 0); + + ci->llimit = sc->vres.iscsi.start; + ci->ulimit = sc->vres.iscsi.start + sc->vres.iscsi.size - 1; + max_sz = G_MAXRXDATA(t4_read_reg(sc, A_TP_PARA_REG2)); + + nppods = sc->vres.iscsi.size >> IPPOD_SIZE_SHIFT; + if (nppods <= 1024) + return (ENXIO); + + bits = fls(nppods); + if (bits > IPPOD_IDX_MAX_SIZE) + bits = IPPOD_IDX_MAX_SIZE; + nppods = (1 << (bits - 1)) - 1; + + rc = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR, + BUS_SPACE_MAXADDR, NULL, NULL, UINT32_MAX , 8, BUS_SPACE_MAXSIZE, + BUS_DMA_ALLOCNOW, NULL, NULL, &ci->ulp_ddp_tag); + if (rc != 0) { + device_printf(sc->dev, "%s: failed to create DMA tag: %u.\n", + __func__, rc); + return (rc); + } + + ci->colors = malloc(nppods * sizeof(char), M_CXGBE, M_NOWAIT | M_ZERO); + ci->gl_map = malloc(nppods * sizeof(struct cxgbei_ulp2_gather_list *), + M_CXGBE, M_NOWAIT | M_ZERO); + if (ci->colors == NULL || ci->gl_map == NULL) { + bus_dma_tag_destroy(ci->ulp_ddp_tag); + free(ci->colors, M_CXGBE); + free(ci->gl_map, M_CXGBE); + return (ENOMEM); + } + + mtx_init(&ci->map_lock, "ddp lock", NULL, MTX_DEF | MTX_DUPOK); + ci->max_txsz = ci->max_rxsz = min(max_sz, ULP2_MAX_PKT_SIZE); + ci->nppods = nppods; + ci->idx_last = nppods; + ci->idx_bits = bits; + ci->idx_mask = (1 << bits) - 1; + ci->rsvd_tag_mask = (1 << (bits + IPPOD_IDX_SHIFT)) - 1; + + ci->tag_format.sw_bits = bits; + ci->tag_format.rsvd_bits = bits; + ci->tag_format.rsvd_shift = IPPOD_IDX_SHIFT; + ci->tag_format.rsvd_mask = ci->idx_mask; + + t4_iscsi_init(sc, ci->idx_mask << IPPOD_IDX_SHIFT, pgsz_order); + + return (rc); +} + +static int +do_rx_iscsi_hdr(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + struct adapter *sc = iq->adapter; + struct cpl_iscsi_hdr *cpl = mtod(m, struct cpl_iscsi_hdr *); + u_int tid = GET_TID(cpl); + struct toepcb *toep = lookup_tid(sc, tid); + struct icl_pdu *ip; + struct icl_cxgbei_pdu *icp; + + M_ASSERTPKTHDR(m); + + ip = icl_cxgbei_new_pdu(M_NOWAIT); + if (ip == NULL) + CXGBE_UNIMPLEMENTED("PDU allocation failure"); + icp = ip_to_icp(ip); + bcopy(mtod(m, caddr_t) + sizeof(*cpl), icp->ip.ip_bhs, sizeof(struct + iscsi_bhs)); + icp->pdu_seq = ntohl(cpl->seq); + icp->pdu_flags = SBUF_ULP_FLAG_HDR_RCVD; + + /* This is the start of a new PDU. There should be no old state. */ + MPASS(toep->ulpcb2 == NULL); + toep->ulpcb2 = icp; + +#if 0 + CTR4(KTR_CXGBE, "%s: tid %u, cpl->len hlen %u, m->m_len hlen %u", + __func__, tid, ntohs(cpl->len), m->m_len); +#endif + + m_freem(m); + return (0); +} + +static int +do_rx_iscsi_data(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + struct adapter *sc = iq->adapter; + struct cpl_iscsi_data *cpl = mtod(m, struct cpl_iscsi_data *); + u_int tid = GET_TID(cpl); + struct toepcb *toep = lookup_tid(sc, tid); + struct icl_cxgbei_pdu *icp = toep->ulpcb2; + + M_ASSERTPKTHDR(m); + + /* Must already have received the header (but not the data). */ + MPASS(icp != NULL); + MPASS(icp->pdu_flags == SBUF_ULP_FLAG_HDR_RCVD); + MPASS(icp->ip.ip_data_mbuf == NULL); + MPASS(icp->ip.ip_data_len == 0); + + m_adj(m, sizeof(*cpl)); + + icp->pdu_flags |= SBUF_ULP_FLAG_DATA_RCVD; + icp->ip.ip_data_mbuf = m; + icp->ip.ip_data_len = m->m_pkthdr.len; + +#if 0 + CTR4(KTR_CXGBE, "%s: tid %u, cpl->len dlen %u, m->m_len dlen %u", + __func__, tid, ntohs(cpl->len), m->m_len); +#endif + + return (0); +} + +static int +do_rx_iscsi_ddp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + struct adapter *sc = iq->adapter; + const struct cpl_rx_data_ddp *cpl = (const void *)(rss + 1); + u_int tid = GET_TID(cpl); + struct toepcb *toep = lookup_tid(sc, tid); + struct inpcb *inp = toep->inp; + struct socket *so; + struct sockbuf *sb; + struct tcpcb *tp; + struct icl_cxgbei_conn *icc; + struct icl_conn *ic; + struct icl_cxgbei_pdu *icp = toep->ulpcb2; + struct icl_pdu *ip; + u_int pdu_len, val; + + MPASS(m == NULL); + + /* Must already be assembling a PDU. */ + MPASS(icp != NULL); + MPASS(icp->pdu_flags & SBUF_ULP_FLAG_HDR_RCVD); /* Data is optional. */ + ip = &icp->ip; + icp->pdu_flags |= SBUF_ULP_FLAG_STATUS_RCVD; + val = ntohl(cpl->ddpvld); + if (val & F_DDP_PADDING_ERR) + icp->pdu_flags |= SBUF_ULP_FLAG_PAD_ERROR; + if (val & F_DDP_HDRCRC_ERR) + icp->pdu_flags |= SBUF_ULP_FLAG_HCRC_ERROR; + if (val & F_DDP_DATACRC_ERR) + icp->pdu_flags |= SBUF_ULP_FLAG_DCRC_ERROR; + if (ip->ip_data_mbuf == NULL) { + /* XXXNP: what should ip->ip_data_len be, and why? */ + icp->pdu_flags |= SBUF_ULP_FLAG_DATA_DDPED; + } + pdu_len = ntohs(cpl->len); /* includes everything. */ + + INP_WLOCK(inp); + if (__predict_false(inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT))) { + CTR4(KTR_CXGBE, "%s: tid %u, rx (%d bytes), inp_flags 0x%x", + __func__, tid, pdu_len, inp->inp_flags); + INP_WUNLOCK(inp); + icl_cxgbei_conn_pdu_free(NULL, ip); +#ifdef INVARIANTS + toep->ulpcb2 = NULL; +#endif + return (0); + } + + tp = intotcpcb(inp); + MPASS(icp->pdu_seq == tp->rcv_nxt); + MPASS(tp->rcv_wnd >= pdu_len); + tp->rcv_nxt += pdu_len; + tp->rcv_wnd -= pdu_len; + tp->t_rcvtime = ticks; + + /* update rx credits */ + toep->rx_credits += pdu_len; + t4_rcvd(&toep->td->tod, tp); /* XXX: sc->tom_softc.tod */ + + so = inp->inp_socket; + sb = &so->so_rcv; + SOCKBUF_LOCK(sb); + + icc = toep->ulpcb; + if (__predict_false(icc == NULL || sb->sb_state & SBS_CANTRCVMORE)) { + CTR5(KTR_CXGBE, + "%s: tid %u, excess rx (%d bytes), icc %p, sb_state 0x%x", + __func__, tid, pdu_len, icc, sb->sb_state); + SOCKBUF_UNLOCK(sb); + INP_WUNLOCK(inp); + + INP_INFO_RLOCK(&V_tcbinfo); + INP_WLOCK(inp); + tp = tcp_drop(tp, ECONNRESET); + if (tp) + INP_WUNLOCK(inp); + INP_INFO_RUNLOCK(&V_tcbinfo); + + icl_cxgbei_conn_pdu_free(NULL, ip); +#ifdef INVARIANTS + toep->ulpcb2 = NULL; +#endif + return (0); + } + MPASS(icc->icc_signature == CXGBEI_CONN_SIGNATURE); + ic = &icc->ic; + icl_cxgbei_new_pdu_set_conn(ip, ic); + + MPASS(m == NULL); /* was unused, we'll use it now. */ + m = sbcut_locked(sb, sbused(sb)); /* XXXNP: toep->sb_cc accounting? */ + if (__predict_false(m != NULL)) { + int len = m_length(m, NULL); + + /* + * PDUs were received before the tid transitioned to ULP mode. + * Convert them to icl_cxgbei_pdus and send them to ICL before + * the PDU in icp/ip. + */ + CTR3(KTR_CXGBE, "%s: tid %u, %u bytes in so_rcv", __func__, tid, + len); + + /* XXXNP: needs to be rewritten. */ + if (len == sizeof(struct iscsi_bhs) || len == 4 + sizeof(struct + iscsi_bhs)) { + struct icl_cxgbei_pdu *icp0; + struct icl_pdu *ip0; + + ip0 = icl_cxgbei_new_pdu(M_NOWAIT); + icl_cxgbei_new_pdu_set_conn(ip0, ic); + if (ip0 == NULL) + CXGBE_UNIMPLEMENTED("PDU allocation failure"); + icp0 = ip_to_icp(ip0); + icp0->pdu_seq = 0; /* XXX */ + icp0->pdu_flags = SBUF_ULP_FLAG_HDR_RCVD | + SBUF_ULP_FLAG_STATUS_RCVD; + m_copydata(m, 0, sizeof(struct iscsi_bhs), (void *)ip0->ip_bhs); + STAILQ_INSERT_TAIL(&icc->rcvd_pdus, ip0, ip_next); + } + m_freem(m); + } + +#if 0 + CTR4(KTR_CXGBE, "%s: tid %u, pdu_len %u, pdu_flags 0x%x", + __func__, tid, pdu_len, icp->pdu_flags); +#endif + + STAILQ_INSERT_TAIL(&icc->rcvd_pdus, ip, ip_next); + if ((icc->rx_flags & RXF_ACTIVE) == 0) { + struct cxgbei_worker_thread_softc *cwt = &cwt_softc[icc->cwt]; + + mtx_lock(&cwt->cwt_lock); + icc->rx_flags |= RXF_ACTIVE; + TAILQ_INSERT_TAIL(&cwt->rx_head, icc, rx_link); + if (cwt->cwt_state == CWT_SLEEPING) { + cwt->cwt_state = CWT_RUNNING; + cv_signal(&cwt->cwt_cv); + } + mtx_unlock(&cwt->cwt_lock); + } + SOCKBUF_UNLOCK(sb); + INP_WUNLOCK(inp); + +#ifdef INVARIANTS + toep->ulpcb2 = NULL; +#endif + + return (0); +} + +static void +t4_register_cpl_handler_with_tom(struct adapter *sc) +{ + + t4_register_cpl_handler(sc, CPL_ISCSI_HDR, do_rx_iscsi_hdr); + t4_register_cpl_handler(sc, CPL_ISCSI_DATA, do_rx_iscsi_data); + t4_register_cpl_handler(sc, CPL_RX_ISCSI_DDP, do_rx_iscsi_ddp); +} + +static void +t4_unregister_cpl_handler_with_tom(struct adapter *sc) +{ + + t4_register_cpl_handler(sc, CPL_ISCSI_HDR, NULL); + t4_register_cpl_handler(sc, CPL_ISCSI_DATA, NULL); + t4_register_cpl_handler(sc, CPL_RX_ISCSI_DDP, NULL); +} + +/* initiator */ +void +cxgbei_conn_task_reserve_itt(void *conn, void **prv, + void *scmd, unsigned int *itt) +{ + unsigned int tag; + tag = cxgbei_task_reserve_itt(conn, prv, scmd, itt); + if (tag) + *itt = htonl(tag); + return; +} + +/* target */ +void +cxgbei_conn_transfer_reserve_ttt(void *conn, void **prv, + void *scmd, unsigned int *ttt) +{ + unsigned int tag; + tag = cxgbei_task_reserve_ttt(conn, prv, scmd, ttt); + if (tag) + *ttt = htonl(tag); + return; +} + +void +cxgbei_cleanup_task(void *conn, void *ofld_priv) +{ + struct icl_conn *ic = (struct icl_conn *)conn; + struct icl_cxgbei_conn *icc = ic_to_icc(ic); + struct cxgbei_task_data *tdata = ofld_priv; + struct adapter *sc = icc->sc; + struct cxgbei_data *ci = sc->iscsi_ulp_softc; + + MPASS(icc->icc_signature == CXGBEI_CONN_SIGNATURE); + MPASS(tdata != NULL); + + if (cxgbei_ulp2_is_ddp_tag(&ci->tag_format, tdata->sc_ddp_tag)) + t4_sk_ddp_tag_release(icc, tdata->sc_ddp_tag); + memset(tdata, 0, sizeof(*tdata)); +} + +static int +cxgbei_activate(struct adapter *sc) +{ + struct cxgbei_data *ci; + int rc; + + ASSERT_SYNCHRONIZED_OP(sc); + + if (uld_active(sc, ULD_ISCSI)) { + KASSERT(0, ("%s: iSCSI offload already enabled on adapter %p", + __func__, sc)); + return (0); + } + + if (sc->iscsicaps == 0 || sc->vres.iscsi.size == 0) { + device_printf(sc->dev, + "not iSCSI offload capable, or capability disabled.\n"); + return (ENOSYS); + } + + /* per-adapter softc for iSCSI */ + ci = malloc(sizeof(*ci), M_CXGBE, M_ZERO | M_NOWAIT); + if (ci == NULL) + return (ENOMEM); + + rc = cxgbei_ddp_init(sc, ci); + if (rc != 0) { + free(ci, M_CXGBE); + return (rc); + } + + t4_register_cpl_handler_with_tom(sc); + sc->iscsi_ulp_softc = ci; + + return (0); +} + +static int +cxgbei_deactivate(struct adapter *sc) +{ + + ASSERT_SYNCHRONIZED_OP(sc); + + if (sc->iscsi_ulp_softc != NULL) { + cxgbei_ddp_cleanup(sc->iscsi_ulp_softc); + t4_unregister_cpl_handler_with_tom(sc); + free(sc->iscsi_ulp_softc, M_CXGBE); + sc->iscsi_ulp_softc = NULL; + } + + return (0); +} + +static void +cxgbei_activate_all(struct adapter *sc, void *arg __unused) +{ + + if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4isact") != 0) + return; + + /* Activate iSCSI if any port on this adapter has IFCAP_TOE enabled. */ + if (sc->offload_map && !uld_active(sc, ULD_ISCSI)) + (void) t4_activate_uld(sc, ULD_ISCSI); + + end_synchronized_op(sc, 0); +} + +static void +cxgbei_deactivate_all(struct adapter *sc, void *arg __unused) +{ + + if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4isdea") != 0) + return; + + if (uld_active(sc, ULD_ISCSI)) + (void) t4_deactivate_uld(sc, ULD_ISCSI); + + end_synchronized_op(sc, 0); +} + +static struct uld_info cxgbei_uld_info = { + .uld_id = ULD_ISCSI, + .activate = cxgbei_activate, + .deactivate = cxgbei_deactivate, +}; + +static void +cwt_main(void *arg) +{ + struct cxgbei_worker_thread_softc *cwt = arg; + struct icl_cxgbei_conn *icc = NULL; + struct icl_conn *ic; + struct icl_pdu *ip; + struct sockbuf *sb; + STAILQ_HEAD(, icl_pdu) rx_pdus = STAILQ_HEAD_INITIALIZER(rx_pdus); + + MPASS(cwt != NULL); + + mtx_lock(&cwt->cwt_lock); + MPASS(cwt->cwt_state == 0); + cwt->cwt_state = CWT_RUNNING; + cv_signal(&cwt->cwt_cv); + + while (__predict_true(cwt->cwt_state != CWT_STOP)) { + cwt->cwt_state = CWT_RUNNING; + while ((icc = TAILQ_FIRST(&cwt->rx_head)) != NULL) { + TAILQ_REMOVE(&cwt->rx_head, icc, rx_link); + mtx_unlock(&cwt->cwt_lock); + + ic = &icc->ic; + sb = &ic->ic_socket->so_rcv; + + SOCKBUF_LOCK(sb); + MPASS(icc->rx_flags & RXF_ACTIVE); + if (__predict_true(!(sb->sb_state & SBS_CANTRCVMORE))) { + MPASS(STAILQ_EMPTY(&rx_pdus)); + STAILQ_SWAP(&icc->rcvd_pdus, &rx_pdus, icl_pdu); + SOCKBUF_UNLOCK(sb); + + /* Hand over PDUs to ICL. */ + while ((ip = STAILQ_FIRST(&rx_pdus)) != NULL) { + STAILQ_REMOVE_HEAD(&rx_pdus, ip_next); + ic->ic_receive(ip); + } + + SOCKBUF_LOCK(sb); + MPASS(STAILQ_EMPTY(&rx_pdus)); + } + MPASS(icc->rx_flags & RXF_ACTIVE); + if (STAILQ_EMPTY(&icc->rcvd_pdus) || + __predict_false(sb->sb_state & SBS_CANTRCVMORE)) { + icc->rx_flags &= ~RXF_ACTIVE; + } else { + /* + * More PDUs were received while we were busy + * handing over the previous batch to ICL. + * Re-add this connection to the end of the + * queue. + */ + mtx_lock(&cwt->cwt_lock); + TAILQ_INSERT_TAIL(&cwt->rx_head, icc, + rx_link); + mtx_unlock(&cwt->cwt_lock); + } + SOCKBUF_UNLOCK(sb); + + mtx_lock(&cwt->cwt_lock); + } + + /* Inner loop doesn't check for CWT_STOP, do that first. */ + if (__predict_false(cwt->cwt_state == CWT_STOP)) + break; + cwt->cwt_state = CWT_SLEEPING; + cv_wait(&cwt->cwt_cv, &cwt->cwt_lock); + } + + MPASS(TAILQ_FIRST(&cwt->rx_head) == NULL); + mtx_assert(&cwt->cwt_lock, MA_OWNED); + cwt->cwt_state = CWT_STOPPED; + cv_signal(&cwt->cwt_cv); + mtx_unlock(&cwt->cwt_lock); + kthread_exit(); +} + +static int +start_worker_threads(void) +{ + int i, rc; + struct cxgbei_worker_thread_softc *cwt; + + worker_thread_count = min(mp_ncpus, 32); + cwt_softc = malloc(worker_thread_count * sizeof(*cwt), M_CXGBE, + M_WAITOK | M_ZERO); + + MPASS(cxgbei_proc == NULL); + for (i = 0, cwt = &cwt_softc[0]; i < worker_thread_count; i++, cwt++) { + mtx_init(&cwt->cwt_lock, "cwt lock", NULL, MTX_DEF); + cv_init(&cwt->cwt_cv, "cwt cv"); + TAILQ_INIT(&cwt->rx_head); + rc = kproc_kthread_add(cwt_main, cwt, &cxgbei_proc, NULL, 0, 0, + "cxgbei", "%d", i); + if (rc != 0) { + printf("cxgbei: failed to start thread #%d/%d (%d)\n", + i + 1, worker_thread_count, rc); + mtx_destroy(&cwt->cwt_lock); + cv_destroy(&cwt->cwt_cv); + bzero(&cwt, sizeof(*cwt)); + if (i == 0) { + free(cwt_softc, M_CXGBE); + worker_thread_count = 0; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Dec 26 06:13:02 2015 Return-Path: Delivered-To: svn-src-all@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 802C6A52D34; Sat, 26 Dec 2015 06:13: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 35B361AB2; Sat, 26 Dec 2015 06:13:02 +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 tBQ6D1Vp005636; Sat, 26 Dec 2015 06:13:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQ6D1Rt005635; Sat, 26 Dec 2015 06:13:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512260613.tBQ6D1Rt005635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 26 Dec 2015 06:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292741 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 06:13:02 -0000 Author: mav Date: Sat Dec 26 06:13:01 2015 New Revision: 292741 URL: https://svnweb.freebsd.org/changeset/base/292741 Log: Make port logins asynchronous, following r292739 logic. This is even more important since it involves more network operations and more prone to delays and timeouts. Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sat Dec 26 06:05:21 2015 (r292740) +++ head/sys/dev/isp/isp.c Sat Dec 26 06:13:01 2015 (r292741) @@ -108,7 +108,7 @@ static void isp_fibre_init(ispsoftc_t *) static void isp_fibre_init_2400(ispsoftc_t *); static void isp_clear_portdb(ispsoftc_t *, int); static void isp_mark_portdb(ispsoftc_t *, int); -static int isp_plogx(ispsoftc_t *, int, uint16_t, uint32_t, int, int); +static int isp_plogx(ispsoftc_t *, int, uint16_t, uint32_t, int); static int isp_port_login(ispsoftc_t *, uint16_t, uint32_t); static int isp_port_logout(ispsoftc_t *, uint16_t, uint32_t); static int isp_getpdb(ispsoftc_t *, int, uint16_t, isp_pdb_t *, int); @@ -2550,13 +2550,11 @@ isp_mark_portdb(ispsoftc_t *isp, int cha * or via FABRIC LOGIN/FABRIC LOGOUT for other cards. */ static int -isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, uint32_t portid, int flags, int gs) +isp_plogx(ispsoftc_t *isp, int chan, uint16_t handle, uint32_t portid, int flags) { - mbreg_t mbs; - uint8_t q[QENTRY_LEN]; - isp_plogx_t *plp; - fcparam *fcp; - uint8_t *scp; + isp_plogx_t pl; + void *reqp; + uint8_t resp[QENTRY_LEN]; uint32_t sst, parm1; int rval, lev; const char *msg; @@ -2576,64 +2574,58 @@ isp_plogx(ispsoftc_t *isp, int chan, uin } } - ISP_MEMZERO(q, QENTRY_LEN); - plp = (isp_plogx_t *) q; - plp->plogx_header.rqs_entry_count = 1; - plp->plogx_header.rqs_entry_type = RQSTYPE_LOGIN; - plp->plogx_handle = 0xffffffff; - plp->plogx_nphdl = handle; - plp->plogx_vphdl = chan; - plp->plogx_portlo = portid; - plp->plogx_rspsz_porthi = (portid >> 16) & 0xff; - plp->plogx_flags = flags; + ISP_MEMZERO(&pl, sizeof(pl)); + pl.plogx_header.rqs_entry_count = 1; + pl.plogx_header.rqs_entry_type = RQSTYPE_LOGIN; + pl.plogx_nphdl = handle; + pl.plogx_vphdl = chan; + pl.plogx_portlo = portid; + pl.plogx_rspsz_porthi = (portid >> 16) & 0xff; + pl.plogx_flags = flags; - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "IOCB LOGX", QENTRY_LEN, plp); - } - - if (gs == 0) { - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - isp_prt(isp, ISP_LOGERR, sacq); - return (-1); - } + /* Prepare space for response in memory */ + memset(resp, 0xff, sizeof(resp)); + pl.plogx_handle = isp_allocate_handle(isp, resp, ISP_HANDLE_CTRL); + if (pl.plogx_handle == 0) { + isp_prt(isp, ISP_LOGERR, + "%s: PLOGX of Chan %d out of handles", __func__, chan); + return (-1); } - fcp = FCPARAM(isp, chan); - scp = fcp->isp_scratch; - isp_put_plogx(isp, plp, (isp_plogx_t *) scp); - MBSINIT(&mbs, MBOX_EXEC_COMMAND_IOCB_A64, MBLOGALL, - MBCMD_DEFAULT_TIMEOUT + ICB_LOGIN_TOV * 1000000); - mbs.param[1] = QENTRY_LEN; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan); - isp_mboxcmd(isp, &mbs); - if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { - rval = mbs.param[0]; - goto out; + /* Send request and wait for response. */ + reqp = isp_getrqentry(isp); + if (reqp == NULL) { + isp_prt(isp, ISP_LOGERR, + "%s: PLOGX of Chan %d out of rqent", __func__, chan); + isp_destroy_handle(isp, pl.plogx_handle); + return (-1); } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); - scp += QENTRY_LEN; - isp_get_plogx(isp, (isp_plogx_t *) scp, plp); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, plp); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB LOGX", QENTRY_LEN, &pl); + isp_put_plogx(isp, &pl, (isp_plogx_t *)reqp); + ISP_SYNC_REQUEST(isp); + if (msleep(resp, &isp->isp_lock, 0, "PLOGX", 3 * ICB_LOGIN_TOV * hz) + == EWOULDBLOCK) { + isp_prt(isp, ISP_LOGERR, + "%s: PLOGX of Chan %d timed out", __func__, chan); + isp_destroy_handle(isp, pl.plogx_handle); + return (-1); } + isp_get_plogx(isp, (isp_plogx_t *)resp, &pl); + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "IOCB LOGX response", QENTRY_LEN, &pl); - if (plp->plogx_status == PLOGX_STATUS_OK) { - rval = 0; - goto out; - } else if (plp->plogx_status != PLOGX_STATUS_IOCBERR) { + if (pl.plogx_status == PLOGX_STATUS_OK) { + return (0); + } else if (pl.plogx_status != PLOGX_STATUS_IOCBERR) { isp_prt(isp, ISP_LOGWARN, "status 0x%x on port login IOCB channel %d", - plp->plogx_status, chan); - rval = -1; - goto out; + pl.plogx_status, chan); + return (-1); } - sst = plp->plogx_ioparm[0].lo16 | (plp->plogx_ioparm[0].hi16 << 16); - parm1 = plp->plogx_ioparm[1].lo16 | (plp->plogx_ioparm[1].hi16 << 16); + sst = pl.plogx_ioparm[0].lo16 | (pl.plogx_ioparm[0].hi16 << 16); + parm1 = pl.plogx_ioparm[1].lo16 | (pl.plogx_ioparm[1].hi16 << 16); rval = -1; lev = ISP_LOGERR; @@ -2694,17 +2686,13 @@ isp_plogx(ispsoftc_t *isp, int chan, uin msg = "no FLOGI_ACC"; break; default: - ISP_SNPRINTF(buf, sizeof (buf), "status %x from %x", plp->plogx_status, flags); + ISP_SNPRINTF(buf, sizeof (buf), "status %x from %x", pl.plogx_status, flags); msg = buf; break; } if (msg) { isp_prt(isp, ISP_LOGERR, "Chan %d PLOGX PortID 0x%06x to N-Port handle 0x%x: %s", chan, portid, handle, msg); } -out: - if (gs == 0) { - FC_SCRATCH_RELEASE(isp, chan); - } return (rval); } @@ -3196,7 +3184,7 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) lp->portid, PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT | - PLOGX_FLG_FREE_NPHDL, 0); + PLOGX_FLG_FREE_NPHDL); } /* * Note that we might come out of this with our state @@ -3883,7 +3871,7 @@ isp_login_device(ispsoftc_t *isp, int ch /* * Now try and log into the device */ - r = isp_plogx(isp, chan, handle, portid, PLOGX_FLG_CMD_PLOGI, 1); + r = isp_plogx(isp, chan, handle, portid, PLOGX_FLG_CMD_PLOGI); if (r == 0) { break; } else if ((r & 0xffff) == MBOX_PORT_ID_USED) { @@ -3892,12 +3880,12 @@ isp_login_device(ispsoftc_t *isp, int ch * handle. We need to break that association. We used to try and just substitute the handle, but then * failed to get any data via isp_getpdb (below). */ - if (isp_plogx(isp, chan, r >> 16, portid, PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT | PLOGX_FLG_FREE_NPHDL, 1)) { + if (isp_plogx(isp, chan, r >> 16, portid, PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT | PLOGX_FLG_FREE_NPHDL)) { isp_prt(isp, ISP_LOGERR, "baw... logout of %x failed", r >> 16); } if (FCPARAM(isp, chan)->isp_loopstate != LOOP_SCANNING_FABRIC) return (-1); - r = isp_plogx(isp, chan, handle, portid, PLOGX_FLG_CMD_PLOGI, 1); + r = isp_plogx(isp, chan, handle, portid, PLOGX_FLG_CMD_PLOGI); if (r != 0) i = lim; break; @@ -4937,11 +4925,11 @@ isp_control(ispsoftc_t *isp, ispctl_t ct va_end(ap); if ((p->flags & PLOGX_FLG_CMD_MASK) != PLOGX_FLG_CMD_PLOGI || (p->handle != NIL_HANDLE)) { - return (isp_plogx(isp, p->channel, p->handle, p->portid, p->flags, 0)); + return (isp_plogx(isp, p->channel, p->handle, p->portid, p->flags)); } do { isp_next_handle(isp, &p->handle); - r = isp_plogx(isp, p->channel, p->handle, p->portid, p->flags, 0); + r = isp_plogx(isp, p->channel, p->handle, p->portid, p->flags); if ((r & 0xffff) == MBOX_PORT_ID_USED) { p->handle = r >> 16; r = 0; @@ -6170,6 +6158,7 @@ isp_handle_other_response(ispsoftc_t *is return (1); case RQSTYPE_VP_MODIFY: case RQSTYPE_VP_CTRL: + case RQSTYPE_LOGIN: ISP_IOXGET_32(isp, (uint32_t *)(hp + 1), hdl); ptr = isp_find_xs(isp, hdl); if (ptr != NULL) { From owner-svn-src-all@freebsd.org Sat Dec 26 09:04:48 2015 Return-Path: Delivered-To: svn-src-all@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 ED91AA5196A; Sat, 26 Dec 2015 09:04:48 +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 BD4A51778; Sat, 26 Dec 2015 09:04:48 +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 tBQ94l0B055556; Sat, 26 Dec 2015 09:04:47 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQ94lpV055555; Sat, 26 Dec 2015 09:04:47 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201512260904.tBQ94lpV055555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 26 Dec 2015 09:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292743 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 09:04:49 -0000 Author: dchagin Date: Sat Dec 26 09:04:47 2015 New Revision: 292743 URL: https://svnweb.freebsd.org/changeset/base/292743 Log: Do not allow access to emuldata for non Linux processes. Pointed out by: mjg@ Security: https://admbugs.freebsd.org/show_bug.cgi?id=679 Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Sat Dec 26 06:13:01 2015 (r292742) +++ head/sys/compat/linux/linux_futex.c Sat Dec 26 09:04:47 2015 (r292743) @@ -1099,6 +1099,8 @@ linux_get_robust_list(struct thread *td, ESRCH); return (ESRCH); } + if (SV_PROC_ABI(td2->td_proc) != SV_ABI_LINUX) + return (EPERM); em = em_find(td2); KASSERT(em != NULL, ("get_robust_list: emuldata notfound.\n")); From owner-svn-src-all@freebsd.org Sat Dec 26 09:09:50 2015 Return-Path: Delivered-To: svn-src-all@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 83BE1A51AA7; Sat, 26 Dec 2015 09:09:50 +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 54A3F197A; Sat, 26 Dec 2015 09:09:50 +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 tBQ99nSq055752; Sat, 26 Dec 2015 09:09:49 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQ99n6J055751; Sat, 26 Dec 2015 09:09:49 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201512260909.tBQ99n6J055751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 26 Dec 2015 09:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292744 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 09:09:50 -0000 Author: dchagin Date: Sat Dec 26 09:09:49 2015 New Revision: 292744 URL: https://svnweb.freebsd.org/changeset/base/292744 Log: Return EINVAL in case of incorrect sigev_signo value specified instead of panicing. Modified: head/sys/compat/linux/linux_timer.c Modified: head/sys/compat/linux/linux_timer.c ============================================================================== --- head/sys/compat/linux/linux_timer.c Sat Dec 26 09:04:47 2015 (r292743) +++ head/sys/compat/linux/linux_timer.c Sat Dec 26 09:09:49 2015 (r292744) @@ -57,6 +57,8 @@ linux_convert_l_sigevent(struct l_sigeve CP(*l_sig, *sig, sigev_notify); switch (l_sig->sigev_notify) { case L_SIGEV_SIGNAL: + if (!LINUX_SIG_VALID(l_sig->sigev_signo)) + return (EINVAL); sig->sigev_notify = SIGEV_SIGNAL; sig->sigev_signo = linux_to_bsd_signal(l_sig->sigev_signo); PTRIN_CP(*l_sig, *sig, sigev_value.sival_ptr); @@ -73,6 +75,8 @@ linux_convert_l_sigevent(struct l_sigeve return (EINVAL); #endif case L_SIGEV_THREAD_ID: + if (!LINUX_SIG_VALID(l_sig->sigev_signo)) + return (EINVAL); sig->sigev_notify = SIGEV_THREAD_ID; CP2(*l_sig, *sig, _l_sigev_un._tid, sigev_notify_thread_id); sig->sigev_signo = linux_to_bsd_signal(l_sig->sigev_signo); From owner-svn-src-all@freebsd.org Sat Dec 26 09:16:07 2015 Return-Path: Delivered-To: svn-src-all@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 1ACD0A51D56; Sat, 26 Dec 2015 09:16:07 +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 CF04C1D6B; Sat, 26 Dec 2015 09:16:06 +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 tBQ9G6RI058580; Sat, 26 Dec 2015 09:16:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQ9G5BN058578; Sat, 26 Dec 2015 09:16:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512260916.tBQ9G5BN058578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 26 Dec 2015 09:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292745 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 09:16:07 -0000 Author: mav Date: Sat Dec 26 09:16:05 2015 New Revision: 292745 URL: https://svnweb.freebsd.org/changeset/base/292745 Log: Use single DMA tag for scratch areas of all virtual ports. Modified: head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/isp_pci.c Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Sat Dec 26 09:09:49 2015 (r292744) +++ head/sys/dev/isp/isp_freebsd.h Sat Dec 26 09:16:05 2015 (r292745) @@ -225,8 +225,7 @@ struct isp_fc { struct cam_path *path; struct ispsoftc *isp; struct proc *kproc; - bus_dma_tag_t tdmat; - bus_dmamap_t tdmap; + bus_dmamap_t scmap; uint64_t def_wwpn; uint64_t def_wwnn; time_t loop_down_time; @@ -285,13 +284,14 @@ struct isposinfo { const struct firmware * fw; /* - * DMA related sdtuff + * DMA related stuff */ struct resource * regs; struct resource * regs2; bus_dma_tag_t dmat; bus_dma_tag_t cdmat; bus_dmamap_t cdmap; + bus_dma_tag_t scdmat; /* * Command and transaction related related stuff @@ -409,7 +409,7 @@ switch (type) { \ case SYNC_SFORDEV: \ { \ struct isp_fc *fc = ISP_FC_PC(isp, chan); \ - bus_dmamap_sync(fc->tdmat, fc->tdmap, \ + bus_dmamap_sync(isp->isp_osinfo.scdmat, fc->scmap, \ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); \ break; \ } \ @@ -421,7 +421,7 @@ case SYNC_REQUEST: \ case SYNC_SFORCPU: \ { \ struct isp_fc *fc = ISP_FC_PC(isp, chan); \ - bus_dmamap_sync(fc->tdmat, fc->tdmap, \ + bus_dmamap_sync(isp->isp_osinfo.scdmat, fc->scmap, \ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); \ break; \ } \ @@ -443,7 +443,7 @@ switch (type) { \ case SYNC_SFORDEV: \ { \ struct isp_fc *fc = ISP_FC_PC(isp, chan); \ - bus_dmamap_sync(fc->tdmat, fc->tdmap, \ + bus_dmamap_sync(isp->isp_osinfo.scdmat, fc->scmap, \ BUS_DMASYNC_PREWRITE); \ break; \ } \ @@ -454,7 +454,7 @@ case SYNC_REQUEST: \ case SYNC_SFORCPU: \ { \ struct isp_fc *fc = ISP_FC_PC(isp, chan); \ - bus_dmamap_sync(fc->tdmat, fc->tdmap, \ + bus_dmamap_sync(isp->isp_osinfo.scdmat, fc->scmap, \ BUS_DMASYNC_POSTWRITE); \ break; \ } \ Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Sat Dec 26 09:09:49 2015 (r292744) +++ head/sys/dev/isp/isp_pci.c Sat Dec 26 09:16:05 2015 (r292745) @@ -1604,11 +1604,8 @@ imc1(void *arg, bus_dma_segment_t *segs, imushp->error = error; return; } - if (nseg != 1) { - imushp->error = EINVAL; - return; - } - isp_prt(imushp->isp, ISP_LOGDEBUG0, "scdma @ 0x%jx/0x%jx", (uintmax_t) segs->ds_addr, (uintmax_t) segs->ds_len); + isp_prt(imushp->isp, ISP_LOGDEBUG0, "scdma @ 0x%jx/0x%jx", + (uintmax_t) segs->ds_addr, (uintmax_t) segs->ds_len); FCPARAM(imushp->isp, imushp->chan)->isp_scdma = segs->ds_addr; FCPARAM(imushp->isp, imushp->chan)->isp_scratch = imushp->vbase; } @@ -1735,23 +1732,27 @@ isp_pci_mbxdma(ispsoftc_t *isp) } if (IS_FC(isp)) { + if (isp_dma_tag_create(isp->isp_osinfo.dmat, 64, slim, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + ISP_FC_SCRLEN, 1, ISP_FC_SCRLEN, 0, &isp->isp_osinfo.scdmat)) { + goto bad; + } for (cmap = 0; cmap < isp->isp_nchan; cmap++) { struct isp_fc *fc = ISP_FC_PC(isp, cmap); - if (isp_dma_tag_create(isp->isp_osinfo.dmat, 64, slim, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, ISP_FC_SCRLEN, 1, slim, 0, &fc->tdmat)) { - goto bad; - } - if (bus_dmamem_alloc(fc->tdmat, (void **)&base, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &fc->tdmap) != 0) { - bus_dma_tag_destroy(fc->tdmat); + if (bus_dmamem_alloc(isp->isp_osinfo.scdmat, + (void **)&base, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, + &fc->scmap) != 0) { goto bad; } im.isp = isp; im.chan = cmap; im.vbase = base; im.error = 0; - bus_dmamap_load(fc->tdmat, fc->tdmap, base, ISP_FC_SCRLEN, imc1, &im, 0); + bus_dmamap_load(isp->isp_osinfo.scdmat, fc->scmap, + base, ISP_FC_SCRLEN, imc1, &im, 0); if (im.error) { - bus_dmamem_free(fc->tdmat, base, fc->tdmap); - bus_dma_tag_destroy(fc->tdmat); + bus_dmamem_free(isp->isp_osinfo.scdmat, + base, fc->scmap); goto bad; } if (!IS_2100(isp)) { @@ -1794,16 +1795,18 @@ isp_pci_mbxdma(ispsoftc_t *isp) return (0); bad: - while (--cmap >= 0) { - struct isp_fc *fc = ISP_FC_PC(isp, cmap); - bus_dmamap_unload(fc->tdmat, fc->tdmap); - bus_dmamem_free(fc->tdmat, base, fc->tdmap); - bus_dma_tag_destroy(fc->tdmat); - while (fc->nexus_free_list) { - struct isp_nexus *n = fc->nexus_free_list; - fc->nexus_free_list = n->next; - free(n, M_DEVBUF); + if (IS_FC(isp)) { + while (--cmap >= 0) { + struct isp_fc *fc = ISP_FC_PC(isp, cmap); + bus_dmamap_unload(isp->isp_osinfo.scdmat, fc->scmap); + bus_dmamem_free(isp->isp_osinfo.scdmat, base, fc->scmap); + while (fc->nexus_free_list) { + struct isp_nexus *n = fc->nexus_free_list; + fc->nexus_free_list = n->next; + free(n, M_DEVBUF); + } } + bus_dma_tag_destroy(isp->isp_osinfo.scdmat); } if (isp->isp_rquest_dma != 0) bus_dmamap_unload(isp->isp_osinfo.cdmat, isp->isp_osinfo.cdmap); From owner-svn-src-all@freebsd.org Sat Dec 26 10:05:27 2015 Return-Path: Delivered-To: svn-src-all@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 B1180A52B75; Sat, 26 Dec 2015 10:05:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3184D1FF4; Sat, 26 Dec 2015 10:05:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tBQA5KYZ031036 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 26 Dec 2015 12:05:21 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tBQA5KYZ031036 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tBQA5Krk031034; Sat, 26 Dec 2015 12:05:20 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 26 Dec 2015 12:05:20 +0200 From: Konstantin Belousov To: Colin Percival Cc: Daniel Eischen , Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292723 - in head: lib/libc share/mk Message-ID: <20151226100520.GG3625@kib.kiev.ua> References: <201512251129.tBPBTIZp058825@repo.freebsd.org> <567DE180.3040601@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <567DE180.3040601@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 10:05:27 -0000 On Fri, Dec 25, 2015 at 04:38:24PM -0800, Colin Percival wrote: > On 12/25/15 13:03, Daniel Eischen wrote: > > On Fri, 25 Dec 2015, Ed Schouten wrote: > >> 2015-12-25 12:29 GMT+01:00 Colin Percival : > >>> Make libxnet.so a symlink to libc.so. This makes `-lxnet` a no-op, as > >>> POSIX requires for the c99 compiler. > >> > >> I seem to remember I had some issues in the past where I was linking > >> against libc explicitly. Maybe it had something to do with linking > >> both against -lpthread and -lc, but if you pass in -lc later on the > >> command line, libc overrides the symbols that have to be provided by > >> -lpthread? > > I just did some tests with one of my pthread-using tools, and it passes > all of my tests with -lc added before or after -lpthread. Can you > remember any details of how the problems showed up? Is it possible that > this has been fixed since then? I know there's a lot of tricks to make > sure that the right versions of functions get called. > > >> If that's (still) the case, would it make sense to just provide > >> libxnet in the form of an empty .a file instead? > > > > I think that's a good point. Using -lanything shouldn't introduce an > > unexpected link order. > > Yes, adding a dummy library was my first thought, but kib pointed out > that a symlink was much simpler. Obviously it never occurred to me that > linking to a library which we were going to be linking to anyway would > cause problems... I fixed all issues I was aware of with dlopen("libthr"), see the longer explanation at https://lists.freebsd.org/pipermail/freebsd-threads/2014-December/005636.html If any of the issue which prevents dlopening libthr left, please provide me with the test case. Note that issues which might break runtime due to libc appears in the DT_NEEDED flatten order before libthr should be equially valid for the dlopen(). From owner-svn-src-all@freebsd.org Sat Dec 26 11:10:46 2015 Return-Path: Delivered-To: svn-src-all@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 1385BA52DFC; Sat, 26 Dec 2015 11:10:46 +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 E2FE61E8B; Sat, 26 Dec 2015 11:10: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 tBQBAjsa092405; Sat, 26 Dec 2015 11:10:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQBAjDh092404; Sat, 26 Dec 2015 11:10:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512261110.tBQBAjDh092404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 26 Dec 2015 11:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292746 - stable/10/sys/dev/md X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 11:10:46 -0000 Author: kib Date: Sat Dec 26 11:10:44 2015 New Revision: 292746 URL: https://svnweb.freebsd.org/changeset/base/292746 Log: MFC r292128: In md(4) over vnode, correct handling of the unaligned unmapped io requests which page alignment + size is greater than MAXPHYS. Split request up to the size of io which fits into pbuf KVA with alignment, and retry if a part of the bio is left unprocessed. Modified: stable/10/sys/dev/md/md.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/md/md.c ============================================================================== --- stable/10/sys/dev/md/md.c Sat Dec 26 09:16:05 2015 (r292745) +++ stable/10/sys/dev/md/md.c Sat Dec 26 11:10:44 2015 (r292746) @@ -825,8 +825,8 @@ mdstart_vnode(struct md_s *sc, struct bi struct buf *pb; bus_dma_segment_t *vlist; struct thread *td; - off_t len, zerosize; - int ma_offs; + off_t iolen, len, zerosize; + int ma_offs, npages; switch (bp->bio_cmd) { case BIO_READ: @@ -847,6 +847,7 @@ mdstart_vnode(struct md_s *sc, struct bi pb = NULL; piov = NULL; ma_offs = bp->bio_ma_offset; + len = bp->bio_length; /* * VNODE I/O @@ -879,7 +880,6 @@ mdstart_vnode(struct md_s *sc, struct bi auio.uio_iovcnt = howmany(bp->bio_length, zerosize); piov = malloc(sizeof(*piov) * auio.uio_iovcnt, M_MD, M_WAITOK); auio.uio_iov = piov; - len = bp->bio_length; while (len > 0) { piov->iov_base = __DECONST(void *, zero_region); piov->iov_len = len; @@ -893,7 +893,6 @@ mdstart_vnode(struct md_s *sc, struct bi piov = malloc(sizeof(*piov) * bp->bio_ma_n, M_MD, M_WAITOK); auio.uio_iov = piov; vlist = (bus_dma_segment_t *)bp->bio_data; - len = bp->bio_length; while (len > 0) { piov->iov_base = (void *)(uintptr_t)(vlist->ds_addr + ma_offs); @@ -909,11 +908,20 @@ mdstart_vnode(struct md_s *sc, struct bi piov = auio.uio_iov; } else if ((bp->bio_flags & BIO_UNMAPPED) != 0) { pb = getpbuf(&md_vnode_pbuf_freecnt); - pmap_qenter((vm_offset_t)pb->b_data, bp->bio_ma, bp->bio_ma_n); - aiov.iov_base = (void *)((vm_offset_t)pb->b_data + ma_offs); - aiov.iov_len = bp->bio_length; + bp->bio_resid = len; +unmapped_step: + npages = atop(min(MAXPHYS, round_page(len + (ma_offs & + PAGE_MASK)))); + iolen = min(ptoa(npages) - (ma_offs & PAGE_MASK), len); + KASSERT(iolen > 0, ("zero iolen")); + pmap_qenter((vm_offset_t)pb->b_data, + &bp->bio_ma[atop(ma_offs)], npages); + aiov.iov_base = (void *)((vm_offset_t)pb->b_data + + (ma_offs & PAGE_MASK)); + aiov.iov_len = iolen; auio.uio_iov = &aiov; auio.uio_iovcnt = 1; + auio.uio_resid = iolen; } else { aiov.iov_base = bp->bio_data; aiov.iov_len = bp->bio_length; @@ -937,15 +945,21 @@ mdstart_vnode(struct md_s *sc, struct bi vn_finished_write(mp); } - if (pb) { - pmap_qremove((vm_offset_t)pb->b_data, bp->bio_ma_n); + if (pb != NULL) { + pmap_qremove((vm_offset_t)pb->b_data, npages); + if (error == 0) { + len -= iolen; + bp->bio_resid -= iolen; + ma_offs += iolen; + if (len > 0) + goto unmapped_step; + } relpbuf(pb, &md_vnode_pbuf_freecnt); } - if (piov != NULL) - free(piov, M_MD); - - bp->bio_resid = auio.uio_resid; + free(piov, M_MD); + if (pb == NULL) + bp->bio_resid = auio.uio_resid; return (error); } From owner-svn-src-all@freebsd.org Sat Dec 26 12:06:54 2015 Return-Path: Delivered-To: svn-src-all@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 13FDBA51304; Sat, 26 Dec 2015 12:06:54 +0000 (UTC) (envelope-from ume@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 D66BB1B52; Sat, 26 Dec 2015 12:06:53 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBQC6qdO009712; Sat, 26 Dec 2015 12:06:52 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQC6q60009711; Sat, 26 Dec 2015 12:06:52 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512261206.tBQC6q60009711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Sat, 26 Dec 2015 12:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292747 - stable/10/lib/liblzma X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 12:06:54 -0000 Author: ume Date: Sat Dec 26 12:06:52 2015 New Revision: 292747 URL: https://svnweb.freebsd.org/changeset/base/292747 Log: MFC 276962: Do not regenerate and install liblzma.pc when only build libraries aka do not regenerate while generating 32bits libs Reported by: Shin-ichi Okano Modified: stable/10/lib/liblzma/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/liblzma/Makefile ============================================================================== --- stable/10/lib/liblzma/Makefile Sat Dec 26 11:10:44 2015 (r292746) +++ stable/10/lib/liblzma/Makefile Sat Dec 26 12:06:52 2015 (r292747) @@ -155,12 +155,13 @@ CFLAGS+= -DSYMBOL_VERSIONING CLEANFILES+= liblzma.pc +.if !defined(LIBRARIES_ONLY) all: liblzma.pc liblzma.pc: liblzma.pc.in @sed -e 's,@prefix@,/usr,g ; \ s,@exec_prefix@,/usr,g ; \ - s,@libdir@,${LIBDIR},g ; \ - s,@includedir@,${INCLUDEDIR},g ; \ + s,@libdir@,/usr/lib,g ; \ + s,@includedir@,/usr/include,g ; \ s,@PACKAGE_URL@,http://tukaani.org/xz/,g ; \ s,@PACKAGE_VERSION@,${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH},g ; \ s,@PTHREAD_CFLAGS@,,g ; \ @@ -169,5 +170,6 @@ liblzma.pc: liblzma.pc.in beforeinstall: @${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ liblzma.pc ${DESTDIR}${LIBDATADIR}/pkgconfig +.endif .include From owner-svn-src-all@freebsd.org Sat Dec 26 14:23:37 2015 Return-Path: Delivered-To: svn-src-all@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 139BEA52E4B; Sat, 26 Dec 2015 14:23:37 +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 D780014E1; Sat, 26 Dec 2015 14:23:36 +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 tBQENZIu051177; Sat, 26 Dec 2015 14:23:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQENZwV051176; Sat, 26 Dec 2015 14:23:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512261423.tBQENZwV051176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 26 Dec 2015 14:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292748 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 14:23:37 -0000 Author: bapt Date: Sat Dec 26 14:23:35 2015 New Revision: 292748 URL: https://svnweb.freebsd.org/changeset/base/292748 Log: procfs(5) is not required by ps(1) and w(1) anymore Remove references of those tools in procfs(5) Modified: head/share/man/man5/procfs.5 Modified: head/share/man/man5/procfs.5 ============================================================================== --- head/share/man/man5/procfs.5 Sat Dec 26 12:06:52 2015 (r292747) +++ head/share/man/man5/procfs.5 Sat Dec 26 14:23:35 2015 (r292748) @@ -2,7 +2,7 @@ .\" Written by Garrett Wollman .\" This file is in the public domain. .\" -.Dd April 22, 2013 +.Dd December 26, 2015 .Dt PROCFS 5 .Os .Sh NAME @@ -17,11 +17,7 @@ The process file system, or .Nm , implements a view of the system process table inside the file system. It is normally mounted on -.Pa /proc , -and is required for the complete operation of programs such as -.Xr ps 1 -and -.Xr w 1 . +.Pa /proc . .Pp The .Nm From owner-svn-src-all@freebsd.org Sat Dec 26 15:40:13 2015 Return-Path: Delivered-To: svn-src-all@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 7D281A51821; Sat, 26 Dec 2015 15:40:13 +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 4DA111E73; Sat, 26 Dec 2015 15:40:13 +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 tBQFeCaR073090; Sat, 26 Dec 2015 15:40:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQFeCYU073089; Sat, 26 Dec 2015 15:40:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512261540.tBQFeCYU073089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 26 Dec 2015 15:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292749 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 15:40:13 -0000 Author: kib Date: Sat Dec 26 15:40:12 2015 New Revision: 292749 URL: https://svnweb.freebsd.org/changeset/base/292749 Log: Do not substitute interpeter if the brand interpreter path is different from the interpreter path requested by the binary. Before this change, it is impossible to activate non-default interpreter for 32bit image on amd64, when /libexec/ld-elf32.so.1 file exists. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sat Dec 26 14:23:35 2015 (r292748) +++ head/sys/kern/imgact_elf.c Sat Dec 26 15:40:12 2015 (r292749) @@ -1002,7 +1002,9 @@ __CONCAT(exec_, __elfN(imgact))(struct i if (error == 0) have_interp = TRUE; } - if (!have_interp && newinterp != NULL) { + if (!have_interp && newinterp != NULL && + (brand_info->interp_path == NULL || + strcmp(interp, brand_info->interp_path) == 0)) { error = __elfN(load_file)(imgp->proc, newinterp, &addr, &imgp->entry_addr, sv->sv_pagesize); if (error == 0) From owner-svn-src-all@freebsd.org Sat Dec 26 17:22:03 2015 Return-Path: Delivered-To: svn-src-all@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 6DDA2A52C46; Sat, 26 Dec 2015 17:22:03 +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 44DC71DD0; Sat, 26 Dec 2015 17:22:03 +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 tBQHM2X2004734; Sat, 26 Dec 2015 17:22:02 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQHM2ui004731; Sat, 26 Dec 2015 17:22:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512261722.tBQHM2ui004731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 26 Dec 2015 17:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292750 - head/sys/dev/mdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 17:22:03 -0000 Author: adrian Date: Sat Dec 26 17:22:02 2015 New Revision: 292750 URL: https://svnweb.freebsd.org/changeset/base/292750 Log: [mdio] Add MDIO support for "extended" registers as defined by IEEE 802.3 Clause 45. IEEE 802.3 Clause 45 added backwards-compatible support for 2^16 PHY registers through the addition of an additional device address frame. Clause 45 addressing is used in 10Gbe PHYs, 802.3az EEE registers, etc. It may make sense to provide a similar extension to the miibus interface, but I've refrained from unilaterally doing so here. Submitted by: Landon Fuller Differential Revision: https://reviews.freebsd.org/D4607 Modified: head/sys/dev/mdio/mdio.c head/sys/dev/mdio/mdio.h head/sys/dev/mdio/mdio_if.m Modified: head/sys/dev/mdio/mdio.c ============================================================================== --- head/sys/dev/mdio/mdio.c Sat Dec 26 15:40:12 2015 (r292749) +++ head/sys/dev/mdio/mdio.c Sat Dec 26 17:22:02 2015 (r292750) @@ -83,6 +83,21 @@ mdio_writereg(device_t dev, int phy, int return (MDIO_WRITEREG(device_get_parent(dev), phy, reg, val)); } +static int +mdio_readextreg(device_t dev, int phy, int devad, int reg) +{ + + return (MDIO_READEXTREG(device_get_parent(dev), phy, devad, reg)); +} + +static int +mdio_writeextreg(device_t dev, int phy, int devad, int reg, + int val) +{ + + return (MDIO_WRITEEXTREG(device_get_parent(dev), phy, devad, reg, val)); +} + static void mdio_hinted_child(device_t dev, const char *name, int unit) { @@ -105,6 +120,8 @@ static device_method_t mdio_methods[] = /* MDIO access */ DEVMETHOD(mdio_readreg, mdio_readreg), DEVMETHOD(mdio_writereg, mdio_writereg), + DEVMETHOD(mdio_readextreg, mdio_readextreg), + DEVMETHOD(mdio_writeextreg, mdio_writeextreg), DEVMETHOD_END }; Modified: head/sys/dev/mdio/mdio.h ============================================================================== --- head/sys/dev/mdio/mdio.h Sat Dec 26 15:40:12 2015 (r292749) +++ head/sys/dev/mdio/mdio.h Sat Dec 26 17:22:02 2015 (r292750) @@ -32,4 +32,6 @@ extern driver_t mdio_driver; extern devclass_t mdio_devclass; +#define MDIO_DEVADDR_NONE -1 /**< Use clause 22 register access */ + #endif /* __DEV_MDIO_MDIO_H__ */ Modified: head/sys/dev/mdio/mdio_if.m ============================================================================== --- head/sys/dev/mdio/mdio_if.m Sat Dec 26 15:40:12 2015 (r292749) +++ head/sys/dev/mdio/mdio_if.m Sat Dec 26 17:22:02 2015 (r292750) @@ -4,21 +4,88 @@ INTERFACE mdio; -# -# Read register from device on MDIO bus -# +CODE { + #include + + static int + mdio_null_readextreg(device_t dev, int phy, int devad, int reg) + { + if (devad == MDIO_DEVADDR_NONE) + return (MDIO_READREG(dev, phy, reg)); + return (~0U); + } + + static int + mdio_null_writeextreg(device_t dev, int phy, int devad, int reg, + int val) + { + if (devad == MDIO_DEVADDR_NONE) + return (MDIO_WRITEREG(dev, phy, reg, val)); + + return (EINVAL); + } +} + +/** + * @brief Read register from device on MDIO bus. + * + * @param dev MDIO bus device. + * @param phy PHY address. + * @param reg The PHY register offset. + */ METHOD int readreg { device_t dev; int phy; int reg; }; -# -# Write register to device on MDIO bus -# +/** + * @brief Write register to device on MDIO bus. + * + * @param dev MDIO bus device. + * @param phy PHY address. + * @param reg The PHY register offset. + * @param val The value to write at offset @p reg. + */ METHOD int writereg { device_t dev; int phy; int reg; int val; }; + + +/** + * @brief Read extended register from device on MDIO bus. + * + * @param dev MDIO bus device. + * @param phy PHY address. + * @param devad The MDIO IEEE 802.3 Clause 45 device address, or + * MDIO_DEVADDR_NONE to request Clause 22 register addressing. + * @param reg The PHY register offset. + */ +METHOD int readextreg { + device_t dev; + int phy; + int devad; + int reg; +} DEFAULT mdio_null_readextreg; + + +/** + * @brief Write extended register to device on MDIO bus. + * + * @param dev MDIO bus device. + * @param phy PHY address. + * @param devad The MDIO IEEE 802.3 Clause 45 device address, or + * MDIO_DEVADDR_NONE to request Clause 22 register addressing. + * @param reg The PHY register offset. + * @param val The value to write at offset @p reg. + */ +METHOD int writeextreg { + device_t dev; + int phy; + int devad; + int reg; + int val; +} DEFAULT mdio_null_writeextreg; From owner-svn-src-all@freebsd.org Sat Dec 26 17:26:29 2015 Return-Path: Delivered-To: svn-src-all@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 9A80AA52D5D; Sat, 26 Dec 2015 17:26:29 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.netplex.net", Issuer "RapidSSL SHA256 CA - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 435231FB3; Sat, 26 Dec 2015 17:26:29 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.15.1/8.15.1/NETPLEX) with ESMTP id tBQHQRrj024065; Sat, 26 Dec 2015 12:26:27 -0500 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.4.3 (mail.netplex.net [204.213.176.9]); Sat, 26 Dec 2015 12:26:27 -0500 (EST) Date: Sat, 26 Dec 2015 12:26:27 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net Reply-To: Daniel Eischen To: Colin Percival cc: Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292723 - in head: lib/libc share/mk In-Reply-To: <567DE180.3040601@freebsd.org> Message-ID: References: <201512251129.tBPBTIZp058825@repo.freebsd.org> <567DE180.3040601@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 17:26:29 -0000 On Fri, 25 Dec 2015, Colin Percival wrote: > On 12/25/15 13:03, Daniel Eischen wrote: >> On Fri, 25 Dec 2015, Ed Schouten wrote: >>> 2015-12-25 12:29 GMT+01:00 Colin Percival : >>>> Make libxnet.so a symlink to libc.so. This makes `-lxnet` a no-op, as >>>> POSIX requires for the c99 compiler. >>> >>> I seem to remember I had some issues in the past where I was linking >>> against libc explicitly. Maybe it had something to do with linking >>> both against -lpthread and -lc, but if you pass in -lc later on the >>> command line, libc overrides the symbols that have to be provided by >>> -lpthread? > > I just did some tests with one of my pthread-using tools, and it passes > all of my tests with -lc added before or after -lpthread. Can you > remember any details of how the problems showed up? Is it possible that > this has been fixed since then? I know there's a lot of tricks to make > sure that the right versions of functions get called. > >>> If that's (still) the case, would it make sense to just provide >>> libxnet in the form of an empty .a file instead? >> >> I think that's a good point. Using -lanything shouldn't introduce an >> unexpected link order. > > Yes, adding a dummy library was my first thought, but kib pointed out > that a symlink was much simpler. Obviously it never occurred to me that > linking to a library which we were going to be linking to anyway would > cause problems... It is hard to contemplate a way this could cause problems (after reading Konstantin's response with regard to threads). The only thought I have is if the application is trying to override libc symbols (which are weak) with other weak symbols. The first weak wins. -- DE From owner-svn-src-all@freebsd.org Sat Dec 26 17:27:49 2015 Return-Path: Delivered-To: svn-src-all@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 DA088A52E18; Sat, 26 Dec 2015 17:27:49 +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 AD77A114B; Sat, 26 Dec 2015 17:27:49 +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 tBQHRmZ9005307; Sat, 26 Dec 2015 17:27:48 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQHRmw6005306; Sat, 26 Dec 2015 17:27:48 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201512261727.tBQHRmw6005306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 26 Dec 2015 17:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292751 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 17:27:49 -0000 Author: bz Date: Sat Dec 26 17:27:48 2015 New Revision: 292751 URL: https://svnweb.freebsd.org/changeset/base/292751 Log: Add missing #ifdef INET after r292674 to allow NOIP and NOINET kernels to build. Modified: head/sys/dev/ixgbe/ix_txrx.c Modified: head/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- head/sys/dev/ixgbe/ix_txrx.c Sat Dec 26 17:22:02 2015 (r292750) +++ head/sys/dev/ixgbe/ix_txrx.c Sat Dec 26 17:27:48 2015 (r292751) @@ -797,6 +797,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, l3d = mtod(mp, caddr_t) + ehdrlen; switch (etype) { +#ifdef INET case ETHERTYPE_IP: ip = (struct ip *)(l3d); ip_hlen = ip->ip_hl << 2; @@ -808,6 +809,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, *olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8; } break; +#endif #ifdef INET6 case ETHERTYPE_IPV6: ip6 = (struct ip6_hdr *)(l3d); From owner-svn-src-all@freebsd.org Sat Dec 26 18:21:34 2015 Return-Path: Delivered-To: svn-src-all@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 6C318A53B35; Sat, 26 Dec 2015 18:21:34 +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 25F66132A; Sat, 26 Dec 2015 18:21:34 +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 tBQILX62021863; Sat, 26 Dec 2015 18:21:33 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQILWmg021860; Sat, 26 Dec 2015 18:21:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201512261821.tBQILWmg021860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 26 Dec 2015 18:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292752 - in head/etc: defaults rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 18:21:34 -0000 Author: ian Date: Sat Dec 26 18:21:32 2015 New Revision: 292752 URL: https://svnweb.freebsd.org/changeset/base/292752 Log: Enhance rc.d/netwait script to wait for late-attaching interfaces such as USB NICs. USB network hardware may not be enumerated and available when the rc.d networking scripts run. Eventually the USB attachment completes and devd events cause the network initialization to happen, but by then other rc.d scripts have already failed, because services which depend on NETWORKING (such as mountcritremote) may end up running before the network is actually ready. There is an existing netwait script, but because it is dependent on NETWORKING it runs too late to prevent failure of some other rc scripts. This change flips the order so that NETWORKING depends on netwait, and netwait now depends on devd and routing (the former is needed to make interfaces appear, and the latter is needed to run the ping tests in netwait). The netwait script used to be oriented primarily towards "as soon as any host is reachable the network is fully functional", so you gave it a list of IPs to try and you could optionally name an interface and it would wait for carrier on that interface. That functionality still works the same, but now you can provide a list of interfaces to wait for and it waits until each one of them is available. The ping logic still completes as soon as the first IP on the list responds. These changes were submitted by Brenden Molloy in PR 205186, and lightly modified by me to allow a list of interfaces instead of just one. PR: 205186 Differential Revision: https://reviews.freebsd.org/D4608 (timeout w/o review) Modified: head/etc/defaults/rc.conf head/etc/rc.d/NETWORKING head/etc/rc.d/netwait Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sat Dec 26 17:27:48 2015 (r292751) +++ head/etc/defaults/rc.conf Sat Dec 26 18:21:32 2015 (r292752) @@ -439,9 +439,9 @@ ubthidhci_enable="NO" # Switch an USB B ### Network link/usability verification options netwait_enable="NO" # Enable rc.d/netwait (or NO) -#netwait_ip="" # IP addresses to be pinged by netwait. +#netwait_ip="" # Wait for ping response from any IP in this list. netwait_timeout="60" # Total number of seconds to perform pings. -#netwait_if="" # Interface name to watch link state on. +#netwait_if="" # Wait for active link on each intf in this list. netwait_if_timeout="30" # Total number of seconds to monitor link state. ### Miscellaneous network options: ### Modified: head/etc/rc.d/NETWORKING ============================================================================== --- head/etc/rc.d/NETWORKING Sat Dec 26 17:27:48 2015 (r292751) +++ head/etc/rc.d/NETWORKING Sat Dec 26 18:21:32 2015 (r292752) @@ -4,7 +4,7 @@ # # PROVIDE: NETWORKING NETWORK -# REQUIRE: netif netoptions routing ppp ipfw stf +# REQUIRE: netif netwait netoptions routing ppp ipfw stf # REQUIRE: defaultroute routed route6d mroute6d resolv bridge # REQUIRE: static_arp static_ndp Modified: head/etc/rc.d/netwait ============================================================================== --- head/etc/rc.d/netwait Sat Dec 26 17:27:48 2015 (r292751) +++ head/etc/rc.d/netwait Sat Dec 26 18:21:32 2015 (r292752) @@ -3,13 +3,20 @@ # $FreeBSD$ # # PROVIDE: netwait -# REQUIRE: NETWORKING +# REQUIRE: devd routing # KEYWORD: nojail # -# The netwait script is intended to be used by systems which have -# statically-configured IP addresses in rc.conf(5). If your system -# uses DHCP, you should use synchronous_dhclient="YES" in your -# /etc/rc.conf instead of using netwait. +# The netwait script helps handle two situations: +# - Systems with USB or other late-attaching network hardware which +# is initialized by devd events. The script waits for all the +# interfaces named in the netwait_if list to appear. +# - Systems with statically-configured IP addresses in rc.conf(5). +# The IP addresses in the netwait_ip list are pinged. The script +# waits for any single IP in the list to respond to the ping. If your +# system uses DHCP, you should probably use synchronous_dhclient="YES" +# in your /etc/rc.conf instead of netwait_ip. +# Either or both of the wait lists can be used (at least one must be +# non-empty if netwait is enabled). . /etc/rc.subr @@ -21,77 +28,87 @@ stop_cmd=":" netwait_start() { - local ip rc count output link + local ip rc count output link wait_if got_if any_error - if [ -z "${netwait_ip}" ]; then - err 1 "You must define one or more IP addresses in netwait_ip" + if [ -z "${netwait_if}" ] && [ -z "${netwait_ip}" ]; then + err 1 "No interface or IP addresses listed, nothing to wait for" fi if [ ${netwait_timeout} -lt 1 ]; then err 1 "netwait_timeout must be >= 1" fi - # Handle SIGINT (Ctrl-C); force abort of while() loop - trap break SIGINT - if [ -n "${netwait_if}" ]; then - echo -n "Waiting for $netwait_if to have link" - - count=1 - while [ ${count} -le ${netwait_if_timeout} ]; do - if output=`/sbin/ifconfig ${netwait_if} 2>/dev/null`; then - link=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'` - if [ -z "${link}" ]; then - echo '.' - break + any_error=0 + for wait_if in ${netwait_if}; do + echo -n "Waiting for ${wait_if}" + link="" + got_if=0 + count=1 + # Handle SIGINT (Ctrl-C); force abort of while() loop + trap break SIGINT + while [ ${count} -le ${netwait_if_timeout} ]; do + if output=`/sbin/ifconfig ${wait_if} 2>/dev/null`; then + if [ ${got_if} -eq 0 ]; then + echo -n ", interface present" + got_if=1 + fi + link=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'` + if [ -z "${link}" ]; then + echo ', got link.' + break + fi fi - else - echo '' - err 1 "ifconfig ${netwait_if} failed" - fi - sleep 1 - count=$((count+1)) - done - if [ -n "${link}" ]; then + sleep 1 + count=$((count+1)) + done # Restore default SIGINT handler trap - SIGINT - - echo '' - warn "Interface still has no link. Continuing with startup, but" - warn "be aware you may not have a fully functional networking" - warn "layer at this point." - return + if [ ${got_if} -eq 0 ]; then + echo ", wait failed: interface never appeared." + any_error=1 + elif [ -n "${link}" ]; then + echo ", wait failed: interface still has no link." + any_error=1 + fi + done + if [ ${any_error} -eq 1 ]; then + warn "Continuing with startup, but be aware you may not have " + warn "a fully functional networking layer at this point." fi fi + + if [ -n "${netwait_ip}" ]; then + # Handle SIGINT (Ctrl-C); force abort of for() loop + trap break SIGINT + + for ip in ${netwait_ip}; do + echo -n "Waiting for ${ip} to respond to ICMP ping" + + count=1 + while [ ${count} -le ${netwait_timeout} ]; do + /sbin/ping -t 1 -c 1 -o ${ip} >/dev/null 2>&1 + rc=$? + + if [ $rc -eq 0 ]; then + # Restore default SIGINT handler + trap - SIGINT - # Handle SIGINT (Ctrl-C); force abort of while() loop - trap break SIGINT - - for ip in ${netwait_ip}; do - echo -n "Waiting for ${ip} to respond to ICMP" - - count=1 - while [ ${count} -le ${netwait_timeout} ]; do - /sbin/ping -t 1 -c 1 -o ${ip} >/dev/null 2>&1 - rc=$? - - if [ $rc -eq 0 ]; then - # Restore default SIGINT handler - trap - SIGINT - - echo '.' - return - fi - count=$((count+1)) + echo ', got response.' + return + fi + count=$((count+1)) + done + echo ', failed: No response from host.' done - echo ': No response from host.' - done - # Restore default SIGINT handler - trap - SIGINT + # Restore default SIGINT handler + trap - SIGINT + + warn "Exhausted IP list. Continuing with startup, but be aware you may" + warn "not have a fully functional networking layer at this point." + fi - warn "Exhausted IP list. Continuing with startup, but be aware you may" - warn "not have a fully functional networking layer at this point." } load_rc_config $name From owner-svn-src-all@freebsd.org Sat Dec 26 18:26:46 2015 Return-Path: Delivered-To: svn-src-all@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 8CE55A53C30; Sat, 26 Dec 2015 18:26:46 +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 5A8D715FB; Sat, 26 Dec 2015 18:26:46 +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 tBQIQjno022596; Sat, 26 Dec 2015 18:26:45 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQIQjhS022592; Sat, 26 Dec 2015 18:26:45 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201512261826.tBQIQjhS022592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 26 Dec 2015 18:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292753 - stable/10/usr.bin/bc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 18:26:46 -0000 Author: pfg Date: Sat Dec 26 18:26:44 2015 New Revision: 292753 URL: https://svnweb.freebsd.org/changeset/base/292753 Log: MFC r291155: bc: sync with OpenBSD tty.c Rev. 1.3 Avoid unintended problems with operator precedence when doing an assignment and comparison. bc.1, Rev. 1.31, 1.32 '.Ql Quit' -> '.Ql quit' because only the lowercase command is valid. Clarify sentence about `quit` in BUGS section. extern.h, Rev. 1.12 whitespace bc.y, Rev. 1.47 Prefer setvbuf() to setlinebuf() for portability Obtained from: OpenBSD Modified: stable/10/usr.bin/bc/bc.1 stable/10/usr.bin/bc/bc.y stable/10/usr.bin/bc/extern.h stable/10/usr.bin/bc/tty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/bc/bc.1 ============================================================================== --- stable/10/usr.bin/bc/bc.1 Sat Dec 26 18:21:32 2015 (r292752) +++ stable/10/usr.bin/bc/bc.1 Sat Dec 26 18:26:44 2015 (r292753) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.\" $OpenBSD: bc.1,v 1.30 2014/01/14 07:42:42 jmc Exp $ +.\" $OpenBSD: bc.1,v 1.32 2015/11/17 05:45:35 mmcc Exp $ .\" .\" Copyright (C) Caldera International Inc. 2001-2002. .\" All rights reserved. @@ -35,7 +35,7 @@ .\" .\" @(#)bc.1 6.8 (Berkeley) 8/8/91 .\" -.Dd April 16, 2014 +.Dd November 21 2015 .Dt BC 1 .Os .Sh NAME @@ -407,8 +407,9 @@ The current version of the utility was written by .An Otto Moerbeek . .Sh BUGS -.Ql Quit -is interpreted when read, not when executed. +The +.Ql quit +statement is interpreted when read, not when executed. .Pp Some non-portable extensions, as found in the GNU version of the .Nm Modified: stable/10/usr.bin/bc/bc.y ============================================================================== --- stable/10/usr.bin/bc/bc.y Sat Dec 26 18:21:32 2015 (r292752) +++ stable/10/usr.bin/bc/bc.y Sat Dec 26 18:26:44 2015 (r292753) @@ -1125,7 +1125,7 @@ main(int argc, char *argv[]) int ch, i; init(); - setlinebuf(stdout); + setvbuf(stdout, NULL, _IOLBF, 0); sargv = malloc(argc * sizeof(char *)); if (sargv == NULL) Modified: stable/10/usr.bin/bc/extern.h ============================================================================== --- stable/10/usr.bin/bc/extern.h Sat Dec 26 18:21:32 2015 (r292752) +++ stable/10/usr.bin/bc/extern.h Sat Dec 26 18:26:44 2015 (r292753) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $OpenBSD: extern.h,v 1.10 2013/09/19 16:12:01 otto Exp $ */ +/* $OpenBSD: extern.h,v 1.12 2014/04/17 19:07:14 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek @@ -39,9 +39,9 @@ extern int fileindex; extern int sargc; extern const char **sargv; extern const char *filename; -extern bool interactive; -extern EditLine *el; -extern History *hist; -extern HistEvent he; +extern bool interactive; +extern EditLine *el; +extern History *hist; +extern HistEvent he; extern char *cmdexpr; extern struct termios ttysaved; Modified: stable/10/usr.bin/bc/tty.c ============================================================================== --- stable/10/usr.bin/bc/tty.c Sat Dec 26 18:21:32 2015 (r292752) +++ stable/10/usr.bin/bc/tty.c Sat Dec 26 18:26:44 2015 (r292753) @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $OpenBSD: tty.c,v 1.2 2013/11/12 13:54:51 deraadt Exp $ */ +/* $OpenBSD: tty.c,v 1.3 2015/09/05 09:49:24 jsg Exp $ */ /* * Copyright (c) 2013, Otto Moerbeek @@ -30,7 +30,7 @@ settty(struct termios *t) { int ret; - while ((ret = tcsetattr(0, TCSADRAIN, t) == -1) && errno == EINTR) + while ((ret = tcsetattr(0, TCSADRAIN, t)) == -1 && errno == EINTR) continue; return ret; } @@ -40,7 +40,7 @@ gettty(struct termios *t) { int ret; - while ((ret = tcgetattr(0, t) == -1) && errno == EINTR) + while ((ret = tcgetattr(0, t)) == -1 && errno == EINTR) continue; return ret; } From owner-svn-src-all@freebsd.org Sat Dec 26 18:37:02 2015 Return-Path: Delivered-To: svn-src-all@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 E7F24A53E91; Sat, 26 Dec 2015 18:37:02 +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 AE0491A87; Sat, 26 Dec 2015 18:37:02 +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 tBQIb1aU025571; Sat, 26 Dec 2015 18:37:01 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQIb18J025570; Sat, 26 Dec 2015 18:37:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201512261837.tBQIb18J025570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 26 Dec 2015 18:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292754 - stable/10/bin/ed X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 18:37:03 -0000 Author: pfg Date: Sat Dec 26 18:37:01 2015 New Revision: 292754 URL: https://svnweb.freebsd.org/changeset/base/292754 Log: MFC r292454, r292455 ed(1): Prevent possible string overflows Use strlcpy to guarantee NULL termination. With hint from: imp, cem, ngie CID: 1007252 Modified: stable/10/bin/ed/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ed/main.c ============================================================================== --- stable/10/bin/ed/main.c Sat Dec 26 18:26:44 2015 (r292753) +++ stable/10/bin/ed/main.c Sat Dec 26 18:37:01 2015 (r292754) @@ -505,7 +505,8 @@ exec_command(void) return ERR; else if (open_sbuf() < 0) return FATAL; - if (*fnp && *fnp != '!') strcpy(old_filename, fnp); + if (*fnp && *fnp != '!') + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; @@ -532,7 +533,8 @@ exec_command(void) return ERR; } GET_COMMAND_SUFFIX(); - if (*fnp) strcpy(old_filename, fnp); + if (*fnp) + strlcpy(old_filename, fnp, PATH_MAX); printf("%s\n", strip_escapes(old_filename)); break; case 'g': @@ -663,7 +665,7 @@ exec_command(void) GET_COMMAND_SUFFIX(); if (!isglobal) clear_undo_stack(); if (*old_filename == '\0' && *fnp != '!') - strcpy(old_filename, fnp); + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; @@ -797,7 +799,7 @@ exec_command(void) return ERR; GET_COMMAND_SUFFIX(); if (*old_filename == '\0' && *fnp != '!') - strcpy(old_filename, fnp); + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; From owner-svn-src-all@freebsd.org Sat Dec 26 18:38:11 2015 Return-Path: Delivered-To: svn-src-all@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 1D875A53EF6; Sat, 26 Dec 2015 18:38:11 +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 E2E701BEE; Sat, 26 Dec 2015 18:38:10 +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 tBQIcAbS025666; Sat, 26 Dec 2015 18:38:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQIcAeM025665; Sat, 26 Dec 2015 18:38:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201512261838.tBQIcAeM025665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 26 Dec 2015 18:38:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r292755 - stable/9/bin/ed X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 18:38:11 -0000 Author: pfg Date: Sat Dec 26 18:38:09 2015 New Revision: 292755 URL: https://svnweb.freebsd.org/changeset/base/292755 Log: MFC r292454, r292455 ed(1): Prevent possible string overflows Use strlcpy to guarantee NULL termination. With hint from: imp, cem, ngie CID: 1007252 Modified: stable/9/bin/ed/main.c Directory Properties: stable/9/bin/ed/ (props changed) Modified: stable/9/bin/ed/main.c ============================================================================== --- stable/9/bin/ed/main.c Sat Dec 26 18:37:01 2015 (r292754) +++ stable/9/bin/ed/main.c Sat Dec 26 18:38:09 2015 (r292755) @@ -504,7 +504,8 @@ exec_command(void) return ERR; else if (open_sbuf() < 0) return FATAL; - if (*fnp && *fnp != '!') strcpy(old_filename, fnp); + if (*fnp && *fnp != '!') + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; @@ -531,7 +532,8 @@ exec_command(void) return ERR; } GET_COMMAND_SUFFIX(); - if (*fnp) strcpy(old_filename, fnp); + if (*fnp) + strlcpy(old_filename, fnp, PATH_MAX); printf("%s\n", strip_escapes(old_filename)); break; case 'g': @@ -662,7 +664,7 @@ exec_command(void) GET_COMMAND_SUFFIX(); if (!isglobal) clear_undo_stack(); if (*old_filename == '\0' && *fnp != '!') - strcpy(old_filename, fnp); + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; @@ -796,7 +798,7 @@ exec_command(void) return ERR; GET_COMMAND_SUFFIX(); if (*old_filename == '\0' && *fnp != '!') - strcpy(old_filename, fnp); + strlcpy(old_filename, fnp, PATH_MAX); #ifdef BACKWARDS if (*fnp == '\0' && *old_filename == '\0') { errmsg = "no current filename"; From owner-svn-src-all@freebsd.org Sat Dec 26 19:14:26 2015 Return-Path: Delivered-To: svn-src-all@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 0FD2CA52890; Sat, 26 Dec 2015 19:14:26 +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 C696219E7; Sat, 26 Dec 2015 19:14:25 +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 tBQJEOUg036856; Sat, 26 Dec 2015 19:14:24 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQJEOLP036854; Sat, 26 Dec 2015 19:14:24 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201512261914.tBQJEOLP036854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 26 Dec 2015 19:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292756 - in head/sys/modules/usb: rsufw urtwnfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 19:14:26 -0000 Author: adrian Date: Sat Dec 26 19:14:24 2015 New Revision: 292756 URL: https://svnweb.freebsd.org/changeset/base/292756 Log: Disable the firwmare licence check for rsu and urtwn. The licence grant says something exactly the same as the atheros patent grant, which is "As long as you use this firmware on our chips, everything is totally okay." Now, I'm pretty sure if that we /have/ to have this, we're going to have to have it for every other firmware for every other device in the tree. So, I'll flip this off in -HEAD for now so people stop asking about why rsu/urtwn don't work out of the box, and I'll kick off a larger discussion about this in the new year. Modified: head/sys/modules/usb/rsufw/Makefile.inc head/sys/modules/usb/urtwnfw/Makefile.inc Modified: head/sys/modules/usb/rsufw/Makefile.inc ============================================================================== --- head/sys/modules/usb/rsufw/Makefile.inc Sat Dec 26 18:38:09 2015 (r292755) +++ head/sys/modules/usb/rsufw/Makefile.inc Sat Dec 26 19:14:24 2015 (r292756) @@ -9,7 +9,7 @@ CLEANFILES+= ${_FIRM} FIRMWS= ${_FIRM}:${KMOD}:120 -FIRMWARE_LICENSE= realtek +# FIRMWARE_LICENSE= realtek ${_FIRM}: ${.CURDIR}/../../../../contrib/dev/rsu/${_FIRM}.uu uudecode -p $? > ${.TARGET} Modified: head/sys/modules/usb/urtwnfw/Makefile.inc ============================================================================== --- head/sys/modules/usb/urtwnfw/Makefile.inc Sat Dec 26 18:38:09 2015 (r292755) +++ head/sys/modules/usb/urtwnfw/Makefile.inc Sat Dec 26 19:14:24 2015 (r292756) @@ -9,7 +9,7 @@ CLEANFILES+= ${_FIRM} FIRMWS= ${_FIRM}:${KMOD}:111 -FIRMWARE_LICENSE= realtek +# FIRMWARE_LICENSE= realtek ${_FIRM}: ${.CURDIR}/../../../../contrib/dev/urtwn/${_FIRM}.uu uudecode -p $? > ${.TARGET} From owner-svn-src-all@freebsd.org Sat Dec 26 19:40:10 2015 Return-Path: Delivered-To: svn-src-all@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 A946BA53067 for ; Sat, 26 Dec 2015 19:40:10 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yk0-x230.google.com (mail-yk0-x230.google.com [IPv6:2607:f8b0:4002:c07::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 6CAA012D6 for ; Sat, 26 Dec 2015 19:40:09 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yk0-x230.google.com with SMTP id x184so261719596yka.3 for ; Sat, 26 Dec 2015 11:40:09 -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:date:message-id:subject:from:to :cc:content-type; bh=IXEayqHxeV/2UXZU3yIC/rQJCJ5ni9x3aok6M97XoVw=; b=ZPLDt3ZUzDzD2ltAajCepCSjTfwdnN5AhR+zxuna5B+OB3BjbcV3W6wKpav2QYKDS6 4XJgkghc+bls6wgt2jnmQdMPg53L4WScWjMnCGyiTN9ouYHl7GEby6MkbBYn6Oc3aEH8 TeratiX3uaQM8TOcjsuX+WNG40cDCfyfAZZ4X9x1bSj2sQcaFZsbtR5h00Gp0UHuW4zj 1GfPy5BHRBwO2NRJP88CFg2DkkNc00GEq4Gv81FqT4nHwlk+75wxoC71hzns0cYd4OLq u1GdQCdPYvEdGOmyrBsoKt927BZtlf9IAY5LpHlUz4iWZBpoOYuPm1+jNK1QOYmuVw4r Os9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=IXEayqHxeV/2UXZU3yIC/rQJCJ5ni9x3aok6M97XoVw=; b=RfLHfs0k8RqVdjmT20kSjZMadKDsgtQSLQ5OQyATXxFL56P4eTCQXccrf7gen+Zy1k /Un3VjbxztBoCYRTaxxegsTfE4TZLm6+A8sbb0p72NUJBx0zku47NctmBf1MKxNm6bgk romY73HScNPNID9WNrFs9EH+CvqZuGpGAG76afFKNNrAGjAgEGjmGy2OPnRYmr1WFVs6 ANv20qIxSB3GY7tZbfhwg8gMs1Pw5PcW6oN1buV7qMaLHtAySOz7PFLyCkpdNFIzg5IT W53c0ogkz6m7y+o5ts40xqfVRdr7+Q+zBoS0D/wbUWf90LxK4c5XC20zq2MtTkOjfArl +M+g== X-Gm-Message-State: ALoCoQmkTTL+DVekpd6C97fzrAo44FcRPGsH8mKR51BVHR2alFKsZH7NxZZZzedT/zZdtMBjL9Ktuie3kgN7A/Rb7I8zZW+CLA== MIME-Version: 1.0 X-Received: by 10.129.133.2 with SMTP id v2mr39530375ywf.76.1451158808856; Sat, 26 Dec 2015 11:40:08 -0800 (PST) Received: by 10.13.211.71 with HTTP; Sat, 26 Dec 2015 11:40:08 -0800 (PST) In-Reply-To: <567DE180.3040601@freebsd.org> References: <201512251129.tBPBTIZp058825@repo.freebsd.org> <567DE180.3040601@freebsd.org> Date: Sat, 26 Dec 2015 20:40:08 +0100 Message-ID: Subject: Re: svn commit: r292723 - in head: lib/libc share/mk From: Ed Schouten To: Colin Percival Cc: Daniel Eischen , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 19:40:10 -0000 Hi Colin, 2015-12-26 1:38 GMT+01:00 Colin Percival : > I just did some tests with one of my pthread-using tools, and it passes > all of my tests with -lc added before or after -lpthread. Can you > remember any details of how the problems showed up? Is it possible that > this has been fixed since then? I know there's a lot of tricks to make > sure that the right versions of functions get called. I think I ran into these issues back when I was using FreeBSD 5 or 6, and I forgot about all of the details. Kostik's email, though, does sound reassuring. Let's assume that the problem I ran into no longer exists. > Yes, adding a dummy library was my first thought, but kib pointed out > that a symlink was much simpler. Obviously it never occurred to me that > linking to a library which we were going to be linking to anyway would > cause problems... Well, they're both equally simple, right? An empty .a file is only a couple of bytes in size, likely not larger than a symlink. But I'm digressing. Thanks, -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-all@freebsd.org Sat Dec 26 19:48:37 2015 Return-Path: Delivered-To: svn-src-all@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 74388A532BA; Sat, 26 Dec 2015 19:48:37 +0000 (UTC) (envelope-from allanjude@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 4440B1892; Sat, 26 Dec 2015 19:48:37 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBQJmaoP045776; Sat, 26 Dec 2015 19:48:36 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQJmaBN045774; Sat, 26 Dec 2015 19:48:36 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201512261948.tBQJmaBN045774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 26 Dec 2015 19:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292757 - head/usr.sbin/fstyp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 19:48:37 -0000 Author: allanjude Date: Sat Dec 26 19:48:36 2015 New Revision: 292757 URL: https://svnweb.freebsd.org/changeset/base/292757 Log: Fix includes in usr.sbin/fstyp/zfs.c Approved by: bapt (mentor) MFC after: 1 week Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D4710 Modified: head/usr.sbin/fstyp/Makefile head/usr.sbin/fstyp/zfs.c Modified: head/usr.sbin/fstyp/Makefile ============================================================================== --- head/usr.sbin/fstyp/Makefile Sat Dec 26 19:14:24 2015 (r292756) +++ head/usr.sbin/fstyp/Makefile Sat Dec 26 19:48:36 2015 (r292757) @@ -19,6 +19,8 @@ WARNS?= 2 SUBDIR+= tests .endif +CFLAGS+=-I${.CURDIR}/../../sys + .if ${MK_ZFS} != "no" IGNORE_PRAGMA= YES @@ -34,8 +36,6 @@ CFLAGS+= -I${.CURDIR}/../../sys/cddl/con CFLAGS+= -I${.CURDIR}/../../cddl/contrib/opensolaris/head .endif -CFLAGS+=-I${.CURDIR}/../../sys - LIBADD= geom md .if ${MK_ZFS} != "no" Modified: head/usr.sbin/fstyp/zfs.c ============================================================================== --- head/usr.sbin/fstyp/zfs.c Sat Dec 26 19:14:24 2015 (r292756) +++ head/usr.sbin/fstyp/zfs.c Sat Dec 26 19:48:36 2015 (r292757) @@ -29,6 +29,9 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +#include #include #include #include From owner-svn-src-all@freebsd.org Sat Dec 26 22:27:50 2015 Return-Path: Delivered-To: svn-src-all@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 0B994A53A11; Sat, 26 Dec 2015 22:27:50 +0000 (UTC) (envelope-from jilles@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 B681B1C26; Sat, 26 Dec 2015 22:27:49 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBQMRmLH091441; Sat, 26 Dec 2015 22:27:48 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQMRmvI091438; Sat, 26 Dec 2015 22:27:48 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201512262227.tBQMRmvI091438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 26 Dec 2015 22:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292758 - head/bin/sh/tests/expansion X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 22:27:50 -0000 Author: jilles Date: Sat Dec 26 22:27:48 2015 New Revision: 292758 URL: https://svnweb.freebsd.org/changeset/base/292758 Log: sh: Add tests for #/##/%/%% on $* and $@. Although POSIX leaves things like ${*#X} unspecified, it occasionally occurs in practice. Add some tests that seem to work sensibly. Added: head/bin/sh/tests/expansion/trim9.0 (contents, props changed) Modified: head/bin/sh/tests/expansion/Makefile Modified: head/bin/sh/tests/expansion/Makefile ============================================================================== --- head/bin/sh/tests/expansion/Makefile Sat Dec 26 19:48:36 2015 (r292757) +++ head/bin/sh/tests/expansion/Makefile Sat Dec 26 22:27:48 2015 (r292758) @@ -90,5 +90,6 @@ FILES+= trim5.0 FILES+= trim6.0 FILES+= trim7.0 FILES+= trim8.0 +FILES+= trim9.0 .include Added: head/bin/sh/tests/expansion/trim9.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/expansion/trim9.0 Sat Dec 26 22:27:48 2015 (r292758) @@ -0,0 +1,61 @@ +# $FreeBSD$ + +# POSIX does not specify these but they occasionally occur in the wild. +# This just serves to keep working what currently works. + +failures='' +ok='' + +testcase() { + code="$1" + expected="$2" + oIFS="$IFS" + eval "$code" + IFS='|' + result="$#|$*" + IFS="$oIFS" + if [ "x$result" = "x$expected" ]; then + ok=x$ok + else + failures=x$failures + echo "For $code, expected $expected actual $result" + fi +} + +testcase 'shift $#; set -- "${*#Q}"' '1|' +testcase 'shift $#; set -- "${*##Q}"' '1|' +testcase 'shift $#; set -- "${*%Q}"' '1|' +testcase 'shift $#; set -- "${*%%Q}"' '1|' +testcase 'set -- Q R; set -- "${*#Q}"' '1| R' +testcase 'set -- Q R; set -- "${*##Q}"' '1| R' +testcase 'set -- Q R; set -- "${*%R}"' '1|Q ' +testcase 'set -- Q R; set -- "${*%%R}"' '1|Q ' +testcase 'set -- Q R; set -- "${*#S}"' '1|Q R' +testcase 'set -- Q R; set -- "${*##S}"' '1|Q R' +testcase 'set -- Q R; set -- "${*%S}"' '1|Q R' +testcase 'set -- Q R; set -- "${*%%S}"' '1|Q R' +testcase 'set -- Q R; set -- ${*#Q}' '1|R' +testcase 'set -- Q R; set -- ${*##Q}' '1|R' +testcase 'set -- Q R; set -- ${*%R}' '1|Q' +testcase 'set -- Q R; set -- ${*%%R}' '1|Q' +testcase 'set -- Q R; set -- ${*#S}' '2|Q|R' +testcase 'set -- Q R; set -- ${*##S}' '2|Q|R' +testcase 'set -- Q R; set -- ${*%S}' '2|Q|R' +testcase 'set -- Q R; set -- ${*%%S}' '2|Q|R' +testcase 'set -- Q R; set -- ${@#Q}' '1|R' +testcase 'set -- Q R; set -- ${@##Q}' '1|R' +testcase 'set -- Q R; set -- ${@%R}' '1|Q' +testcase 'set -- Q R; set -- ${@%%R}' '1|Q' +testcase 'set -- Q R; set -- ${@#S}' '2|Q|R' +testcase 'set -- Q R; set -- ${@##S}' '2|Q|R' +testcase 'set -- Q R; set -- ${@%S}' '2|Q|R' +testcase 'set -- Q R; set -- ${@%%S}' '2|Q|R' +testcase 'set -- Q R; set -- "${@#Q}"' '2||R' +testcase 'set -- Q R; set -- "${@%R}"' '2|Q|' +testcase 'set -- Q R; set -- "${@%%R}"' '2|Q|' +testcase 'set -- Q R; set -- "${@#S}"' '2|Q|R' +testcase 'set -- Q R; set -- "${@##S}"' '2|Q|R' +testcase 'set -- Q R; set -- "${@%S}"' '2|Q|R' +testcase 'set -- Q R; set -- "${@%%S}"' '2|Q|R' + +test "x$failures" = x From owner-svn-src-all@freebsd.org Sat Dec 26 23:01:36 2015 Return-Path: Delivered-To: svn-src-all@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 37397A52294; Sat, 26 Dec 2015 23:01:36 +0000 (UTC) (envelope-from jamie@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 E5A6717E2; Sat, 26 Dec 2015 23:01:35 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBQN1Y7F002816; Sat, 26 Dec 2015 23:01:34 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBQN1YJF002815; Sat, 26 Dec 2015 23:01:34 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201512262301.tBQN1YJF002815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Sat, 26 Dec 2015 23:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292759 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 23:01:36 -0000 Author: jamie Date: Sat Dec 26 23:01:34 2015 New Revision: 292759 URL: https://svnweb.freebsd.org/changeset/base/292759 Log: Let old-style (shell-based) jail configuration handle jail names that contain characters not allowed in a shell variable (such as "-"). These will be replaced by an underscore in jail config variables, e.g. for jail "foo-bar" you would set "jail_foo_bar_hostname". This is separate from the current code that changes the jail names if they contain "." or "/". It also doesn't apply to jails defined in a jail.conf file. PR: 191181 MFC after: 5 days Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Sat Dec 26 22:27:48 2015 (r292758) +++ head/etc/rc.d/jail Sat Dec 26 23:01:34 2015 (r292759) @@ -28,16 +28,16 @@ extra_commands="config console status" need_dad_wait= -# extract_var jail name param num defval -# Extract value from ${jail_$jail_$name} or ${jail_$name} and +# extract_var jv name param num defval +# Extract value from ${jail_$jv_$name} or ${jail_$name} and # set it to $param. If not defined, $defval is used. -# When $num is [0-9]*, ${jail_$jail_$name$num} are looked up and +# When $num is [0-9]*, ${jail_$jv_$name$num} are looked up and # $param is set by using +=. # When $num is YN or NY, the value is interpret as boolean. extract_var() { - local i _j _name _param _num _def _name1 _name2 - _j=$1 + local i _jv _name _param _num _def _name1 _name2 + _jv=$1 _name=$2 _param=$3 _num=$4 @@ -45,7 +45,7 @@ extract_var() case $_num in YN) - _name1=jail_${_j}_${_name} + _name1=jail_${_jv}_${_name} _name2=jail_${_name} eval $_name1=\"\${$_name1:-\${$_name2:-$_def}}\" if checkyesno $_name1; then @@ -55,7 +55,7 @@ extract_var() fi ;; NY) - _name1=jail_${_j}_${_name} + _name1=jail_${_jv}_${_name} _name2=jail_${_name} eval $_name1=\"\${$_name1:-\${$_name2:-$_def}}\" if checkyesno $_name1; then @@ -67,7 +67,7 @@ extract_var() [0-9]*) i=$_num while : ; do - _name1=jail_${_j}_${_name}${i} + _name1=jail_${_jv}_${_name}${i} _name2=jail_${_name}${i} eval _tmpargs=\"\${$_name1:-\${$_name2:-$_def}}\" if [ -n "$_tmpargs" ]; then @@ -79,7 +79,7 @@ extract_var() done ;; *) - _name1=jail_${_j}_${_name} + _name1=jail_${_jv}_${_name} _name2=jail_${_name} eval _tmpargs=\"\${$_name1:-\${$_name2:-$_def}}\" if [ -n "$_tmpargs" ]; then @@ -89,22 +89,23 @@ extract_var() esac } -# parse_options _j +# parse_options _j _jv # Parse options and create a temporary configuration file if necessary. # parse_options() { - local _j _p + local _j _jv _p _j=$1 + _jv=$2 _confwarn=0 if [ -z "$_j" ]; then warn "parse_options: you must specify a jail" return fi - eval _jconf=\"\${jail_${_j}_conf:-/etc/jail.${_j}.conf}\" - eval _rootdir=\"\$jail_${_j}_rootdir\" - eval _hostname=\"\$jail_${_j}_hostname\" + eval _jconf=\"\${jail_${_jv}_conf:-/etc/jail.${_j}.conf}\" + eval _rootdir=\"\$jail_${_jv}_rootdir\" + eval _hostname=\"\$jail_${_jv}_hostname\" if [ -z "$_rootdir" -o \ -z "$_hostname" ]; then if [ -r "$_jconf" ]; then @@ -120,7 +121,7 @@ parse_options() fi return 1 fi - eval _ip=\"\$jail_${_j}_ip\" + eval _ip=\"\$jail_${_jv}_ip\" if [ -z "$_ip" ] && ! check_kern_features vimage; then warn "no ipaddress specified and no vimage support. " \ "Jail $_j was ignored." @@ -138,10 +139,10 @@ parse_options() fi /usr/bin/install -m 0644 -o root -g wheel /dev/null $_conf || return 1 - eval : \${jail_${_j}_flags:=${jail_flags}} - eval _exec=\"\$jail_${_j}_exec\" - eval _exec_start=\"\$jail_${_j}_exec_start\" - eval _exec_stop=\"\$jail_${_j}_exec_stop\" + eval : \${jail_${_jv}_flags:=${jail_flags}} + eval _exec=\"\$jail_${_jv}_exec\" + eval _exec_start=\"\$jail_${_jv}_exec_start\" + eval _exec_stop=\"\$jail_${_jv}_exec_stop\" if [ -n "${_exec}" ]; then # simple/backward-compatible execution _exec_start="${_exec}" @@ -155,20 +156,20 @@ parse_options() fi fi fi - eval _interface=\"\${jail_${_j}_interface:-${jail_interface}}\" - eval _parameters=\"\${jail_${_j}_parameters:-${jail_parameters}}\" - eval _fstab=\"\${jail_${_j}_fstab:-${jail_fstab:-/etc/fstab.$_j}}\" + eval _interface=\"\${jail_${_jv}_interface:-${jail_interface}}\" + eval _parameters=\"\${jail_${_jv}_parameters:-${jail_parameters}}\" + eval _fstab=\"\${jail_${_jv}_fstab:-${jail_fstab:-/etc/fstab.$_j}}\" ( date +"# Generated by rc.d/jail at %Y-%m-%d %H:%M:%S" echo "$_j {" - extract_var $_j hostname host.hostname - "" - extract_var $_j rootdir path - "" + extract_var $_jv hostname host.hostname - "" + extract_var $_jv rootdir path - "" if [ -n "$_ip" ]; then - extract_var $_j interface interface - "" + extract_var $_jv interface interface - "" jail_handle_ips_option $_ip $_interface alias=0 while : ; do - eval _x=\"\$jail_${_j}_ip_multi${alias}\" + eval _x=\"\$jail_${_jv}_ip_multi${alias}\" [ -z "$_x" ] && break jail_handle_ips_option $_x $_interface @@ -184,37 +185,37 @@ parse_options() ;; esac # These are applicable only to non-vimage jails. - extract_var $_j fib exec.fib - "" - extract_var $_j socket_unixiproute_only \ + extract_var $_jv fib exec.fib - "" + extract_var $_jv socket_unixiproute_only \ allow.raw_sockets NY YES else echo " vnet;" - extract_var $_j vnet_interface vnet.interface - "" + extract_var $_jv vnet_interface vnet.interface - "" fi echo " exec.clean;" echo " exec.system_user = \"root\";" echo " exec.jail_user = \"root\";" - extract_var $_j exec_prestart exec.prestart 0 "" - extract_var $_j exec_poststart exec.poststart 0 "" - extract_var $_j exec_prestop exec.prestop 0 "" - extract_var $_j exec_poststop exec.poststop 0 "" + extract_var $_jv exec_prestart exec.prestart 0 "" + extract_var $_jv exec_poststart exec.poststart 0 "" + extract_var $_jv exec_prestop exec.prestop 0 "" + extract_var $_jv exec_poststop exec.poststop 0 "" echo " exec.start += \"$_exec_start\";" - extract_var $_j exec_afterstart exec.start 1 "" + extract_var $_jv exec_afterstart exec.start 1 "" echo " exec.stop = \"$_exec_stop\";" - extract_var $_j consolelog exec.consolelog - \ + extract_var $_jv consolelog exec.consolelog - \ /var/log/jail_${_j}_console.log if [ -r $_fstab ]; then echo " mount.fstab = \"$_fstab\";" fi - eval : \${jail_${_j}_devfs_enable:=${jail_devfs_enable:-NO}} - if checkyesno jail_${_j}_devfs_enable; then + eval : \${jail_${_jv}_devfs_enable:=${jail_devfs_enable:-NO}} + if checkyesno jail_${_jv}_devfs_enable; then echo " mount.devfs;" - eval _ruleset=\${jail_${_j}_devfs_ruleset:-${jail_devfs_ruleset}} + eval _ruleset=\${jail_${_jv}_devfs_ruleset:-${jail_devfs_ruleset}} case $_ruleset in "") ;; [0-9]*) echo " devfs_ruleset = \"$_ruleset\";" ;; @@ -227,24 +228,24 @@ parse_options() *) warn "devfs_ruleset must be an integer." ;; esac fi - eval : \${jail_${_j}_fdescfs_enable:=${jail_fdescfs_enable:-NO}} - if checkyesno jail_${_j}_fdescfs_enable; then + eval : \${jail_${_jv}_fdescfs_enable:=${jail_fdescfs_enable:-NO}} + if checkyesno jail_${_jv}_fdescfs_enable; then echo " mount.fdescfs;" fi - eval : \${jail_${_j}_procfs_enable:=${jail_procfs_enable:-NO}} - if checkyesno jail_${_j}_procfs_enable; then + eval : \${jail_${_jv}_procfs_enable:=${jail_procfs_enable:-NO}} + if checkyesno jail_${_jv}_procfs_enable; then echo " mount.procfs;" fi - eval : \${jail_${_j}_mount_enable:=${jail_mount_enable:-NO}} - if checkyesno jail_${_j}_mount_enable; then + eval : \${jail_${_jv}_mount_enable:=${jail_mount_enable:-NO}} + if checkyesno jail_${_jv}_mount_enable; then echo " allow.mount;" fi - extract_var $_j set_hostname_allow allow.set_hostname YN NO - extract_var $_j sysvipc_allow allow.sysvipc YN NO - extract_var $_j osreldate osreldate - extract_var $_j osrelease osrelease + extract_var $_jv set_hostname_allow allow.set_hostname YN NO + extract_var $_jv sysvipc_allow allow.sysvipc YN NO + extract_var $_jv osreldate osreldate + extract_var $_jv osrelease osrelease for _p in $_parameters; do echo " ${_p%\;};" done @@ -382,14 +383,15 @@ jail_handle_ips_option() jail_config() { - local _j + local _j _jv case $1 in _ALL) return ;; esac for _j in $@; do _j=$(echo $_j | tr /. _) - if parse_options $_j; then + _jv=$(echo -n $_j | tr -c '[:alnum:]' _) + if parse_options $_j $_jv; then echo "$_j: parameters are in $_conf." fi done @@ -397,7 +399,7 @@ jail_config() jail_console() { - local _j _cmd + local _j _jv _cmd # One argument that is not _ALL. case $#:$1 in @@ -405,9 +407,10 @@ jail_console() 1:*) ;; esac _j=$(echo $1 | tr /. _) + _jv=$(echo -n $1 | tr -c '[:alnum:]' _) shift case $# in - 0) eval _cmd=\${jail_${_j}_consolecmd:-$jail_consolecmd} ;; + 0) eval _cmd=\${jail_${_jv}_consolecmd:-$jail_consolecmd} ;; *) _cmd=$@ ;; esac $jail_jexec $_j $_cmd @@ -421,7 +424,7 @@ jail_status() jail_start() { - local _j _jid _jl _id _name + local _j _jv _jid _jl _id _name if [ $# = 0 ]; then return @@ -454,11 +457,12 @@ jail_start() _jl= for _j in $@; do _j=$(echo $_j | tr /. _) - parse_options $_j || continue + _jv=$(echo -n $_j | tr -c '[:alnum:]' _) + parse_options $_j $_jv || continue _jl="$_jl $_j" - eval rc_flags=\${jail_${_j}_flags:-$jail_flags} - eval command=\${jail_${_j}_program:-$jail_program} + eval rc_flags=\${jail_${_jv}_flags:-$jail_flags} + eval command=\${jail_${_jv}_program:-$jail_program} command_args="-i -f $_conf -c $_j" $command $rc_flags $command_args \ >/dev/null 2>&1 /dev/null 2>&1; then continue fi - eval command=\${jail_${_j}_program:-$jail_program} + eval command=\${jail_${_jv}_program:-$jail_program} echo -n " ${_hostname:-${_j}}" _tmp=`mktemp -t jail` || exit 3 $command -q -f $_conf -r $_j >> $_tmp 2>&1